-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdisplay.h
129 lines (104 loc) · 2.78 KB
/
display.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* evilwm - minimalist window manager for X11
* Copyright (C) 1999-2022 Ciaran Anscomb <[email protected]>
* see README for license and other details. */
// Display management.
//
// One evilwm process can manage one display.
#ifndef EVILWM_DISPLAY_H_
#define EVILWM_DISPLAY_H_
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
struct screen;
// List of atoms. Reflect any changes here in atom_list[] in display.c.
enum {
// Standard X protocol atoms
X_ATOM_WM_STATE,
X_ATOM_WM_PROTOCOLS,
X_ATOM_WM_DELETE_WINDOW,
X_ATOM_WM_COLORMAP_WINDOWS,
// Motif atoms
X_ATOM__MOTIF_WM_HINTS,
// evilwm atoms
X_ATOM__EVILWM_UNMAXIMISED_HORZ,
X_ATOM__EVILWM_UNMAXIMISED_VERT,
// EWMH: Root Window Properties (and Related Messages)
X_ATOM__NET_SUPPORTED,
X_ATOM__NET_CLIENT_LIST,
X_ATOM__NET_CLIENT_LIST_STACKING,
X_ATOM__NET_NUMBER_OF_DESKTOPS,
X_ATOM__NET_DESKTOP_GEOMETRY,
X_ATOM__NET_DESKTOP_VIEWPORT,
X_ATOM__NET_CURRENT_DESKTOP,
X_ATOM__NET_ACTIVE_WINDOW,
X_ATOM__NET_WORKAREA,
X_ATOM__NET_SUPPORTING_WM_CHECK,
// EWMH: Other Root Window Messages
X_ATOM__NET_CLOSE_WINDOW,
X_ATOM__NET_MOVERESIZE_WINDOW,
X_ATOM__NET_RESTACK_WINDOW,
X_ATOM__NET_REQUEST_FRAME_EXTENTS,
// EWMH: Application Window Properties
X_ATOM__NET_WM_NAME,
X_ATOM__NET_WM_DESKTOP,
X_ATOM__NET_WM_WINDOW_TYPE,
X_ATOM__NET_WM_WINDOW_TYPE_DESKTOP,
X_ATOM__NET_WM_WINDOW_TYPE_DOCK,
X_ATOM__NET_WM_WINDOW_TYPE_NOTIFICATION,
X_ATOM__NET_WM_STATE,
X_ATOM__NET_WM_STATE_MAXIMIZED_VERT,
X_ATOM__NET_WM_STATE_MAXIMIZED_HORZ,
X_ATOM__NET_WM_STATE_HIDDEN,
X_ATOM__NET_WM_STATE_FULLSCREEN,
X_ATOM__NET_WM_STATE_FOCUSED,
X_ATOM__NET_WM_ALLOWED_ACTIONS,
X_ATOM__NET_WM_ACTION_MOVE,
X_ATOM__NET_WM_ACTION_RESIZE,
X_ATOM__NET_WM_ACTION_MAXIMIZE_HORZ,
X_ATOM__NET_WM_ACTION_MAXIMIZE_VERT,
X_ATOM__NET_WM_ACTION_FULLSCREEN,
X_ATOM__NET_WM_ACTION_CHANGE_DESKTOP,
X_ATOM__NET_WM_ACTION_CLOSE,
X_ATOM__NET_WM_PID,
X_ATOM__NET_FRAME_EXTENTS,
NUM_ATOMS
};
#define X_ATOM(a) display.atom[X_ATOM_ ## a]
struct display {
// The display handle
Display *dpy;
// Atoms
Atom atom[NUM_ATOMS];
// Font
XFontStruct *font;
// Cursors
Cursor move_curs;
Cursor resize_curs;
// Extensions
#ifdef SHAPE
Bool have_shape;
int shape_event;
#endif
#ifdef RANDR
Bool have_randr;
int randr_event_base;
#endif
// Screens
int nscreens;
struct screen *screens;
// Information window
#ifdef INFOBANNER
Window info_window;
#endif
};
// evilwm only supports one display at a time; this variable is global:
extern struct display display;
// Open and initialise display. Exits the process on failure.
void display_open(void);
// Close display.
void display_close(void);
// Manage all relevant windows.
void display_manage_clients(void);
// Remove all windows from management.
void display_unmanage_clients(void);
#endif