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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/**
* @file hint.h
* @author Joe Wingbermuehle
* @date 2004-2006
*
* @brief Header for reading and writing X properties.
*
*/
#ifndef HINT_H
#define HINT_H
struct ClientNode;
typedef enum {
/* Misc */
ATOM_COMPOUND_TEXT,
ATOM_UTF8_STRING,
/* Standard atoms */
ATOM_WM_STATE,
ATOM_WM_PROTOCOLS,
ATOM_WM_DELETE_WINDOW,
ATOM_WM_TAKE_FOCUS,
ATOM_WM_LOCALE_NAME,
ATOM_WM_CHANGE_STATE,
ATOM_WM_COLORMAP_WINDOWS,
/* WM Spec atoms */
ATOM_NET_SUPPORTED,
ATOM_NET_NUMBER_OF_DESKTOPS,
ATOM_NET_DESKTOP_NAMES,
ATOM_NET_DESKTOP_GEOMETRY,
ATOM_NET_DESKTOP_VIEWPORT,
ATOM_NET_CURRENT_DESKTOP,
ATOM_NET_ACTIVE_WINDOW,
ATOM_NET_WORKAREA,
ATOM_NET_SUPPORTING_WM_CHECK,
ATOM_NET_FRAME_EXTENTS,
ATOM_NET_WM_DESKTOP,
ATOM_NET_WM_STATE,
ATOM_NET_WM_STATE_STICKY,
ATOM_NET_WM_STATE_MAXIMIZED_VERT,
ATOM_NET_WM_STATE_MAXIMIZED_HORZ,
ATOM_NET_WM_STATE_SHADED,
ATOM_NET_WM_STATE_FULLSCREEN,
ATOM_NET_WM_ALLOWED_ACTIONS,
ATOM_NET_WM_ACTION_MOVE,
ATOM_NET_WM_ACTION_RESIZE,
ATOM_NET_WM_ACTION_MINIMIZE,
ATOM_NET_WM_ACTION_SHADE,
ATOM_NET_WM_ACTION_STICK,
ATOM_NET_WM_ACTION_MAXIMIZE_HORZ,
ATOM_NET_WM_ACTION_MAXIMIZE_VERT,
ATOM_NET_WM_ACTION_CHANGE_DESKTOP,
ATOM_NET_WM_ACTION_CLOSE,
ATOM_NET_CLOSE_WINDOW,
ATOM_NET_MOVERESIZE_WINDOW,
ATOM_NET_WM_NAME,
ATOM_NET_WM_ICON,
ATOM_NET_WM_WINDOW_TYPE,
ATOM_NET_WM_WINDOW_TYPE_DESKTOP,
ATOM_NET_WM_WINDOW_TYPE_DOCK,
ATOM_NET_CLIENT_LIST,
ATOM_NET_CLIENT_LIST_STACKING,
ATOM_NET_WM_STRUT_PARTIAL,
ATOM_NET_WM_STRUT,
ATOM_NET_SYSTEM_TRAY_OPCODE,
/* GNOME atoms */
ATOM_WIN_LAYER,
ATOM_WIN_STATE,
ATOM_WIN_WORKSPACE_COUNT,
ATOM_WIN_WORKSPACE,
ATOM_WIN_SUPPORTING_WM_CHECK,
ATOM_WIN_PROTOCOLS,
/* MWM atoms */
ATOM_MOTIF_WM_HINTS,
/* JWM-specific atoms. */
ATOM_JWM_RESTART,
ATOM_JWM_EXIT,
ATOM_COUNT
} AtomType;
#define FIRST_NET_ATOM ATOM_NET_SUPPORTED
#define LAST_NET_ATOM ATOM_NET_SYSTEM_TRAY_OPCODE
#define FIRST_WIN_ATOM ATOM_WIN_LAYER
#define LAST_WIN_ATOM ATOM_WIN_PROTOCOLS
#define FIRST_MWM_ATOM ATOM_MOTIF_WM_HINTS
#define LAST_MWM_ATOM ATOM_MOTIF_WM_HINTS
#define WIN_STATE_STICKY (1UL << 0)
#define WIN_STATE_MINIMIZED (1UL << 1)
#define WIN_STATE_MAXIMIZED_VERT (1UL << 2)
#define WIN_STATE_MAXIMIZED_HORIZ (1UL << 3)
#define WIN_STATE_HIDDEN (1UL << 4)
#define WIN_STATE_SHADED (1UL << 5)
#define WIN_STATE_HIDE_WORKSPACE (1UL << 6)
#define WIN_STATE_HIDE_TRANSIENT (1UL << 7)
#define WIN_STATE_FIXED_POSITION (1UL << 8)
#define WIN_STATE_ARRANGE_IGNORE (1UL << 9)
#define WIN_HINT_SKIP_FOCUS (1UL << 0)
#define WIN_HINT_SKIP_WINLIST (1UL << 1)
#define WIN_HINT_SKIP_TASKBAR (1UL << 2)
#define WIN_HINT_GROUP_TRANSIENT (1UL << 3)
#define WIN_HINT_FOCUS_ON_CLICK (1UL << 4)
typedef enum {
LAYER_BOTTOM = 0,
LAYER_NORMAL = 4,
DEFAULT_TRAY_LAYER = 8,
LAYER_TOP = 10,
LAYER_COUNT = 11
} WinLayerType;
typedef struct ClientState {
unsigned int status;
unsigned int border;
unsigned int layer;
unsigned int desktop;
} ClientState;
typedef enum {
PROT_NONE = 0,
PROT_DELETE = 1,
PROT_TAKE_FOCUS = 2
} ClientProtocolType;
extern Atom atoms[ATOM_COUNT];
void InitializeHints();
void StartupHints();
void ShutdownHints();
void DestroyHints();
void ReadCurrentDesktop();
void ReadClientProtocols(struct ClientNode *np);
void ReadWMName(struct ClientNode *np);
void ReadWMClass(struct ClientNode *np);
void ReadWMNormalHints(struct ClientNode *np);
ClientProtocolType ReadWMProtocols(Window w);
void ReadWMColormaps(struct ClientNode *np);
void ReadWinLayer(struct ClientNode *np);
ClientState ReadWindowState(Window win);
void WriteState(struct ClientNode *np);
int GetCardinalAtom(Window window, AtomType atom, unsigned long *value);
int GetWindowAtom(Window window, AtomType atom, Window *value);
void SetCardinalAtom(Window window, AtomType atom, unsigned long value);
void SetWindowAtom(Window window, AtomType atom, unsigned long value);
#endif
|