-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxcb_winutil.h
187 lines (164 loc) · 4.67 KB
/
xcb_winutil.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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#ifndef XCB_WINUTIL_H
#define XCB_WINUTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "xcb_trl.h"
enum NETWMPROTOCOLS
{
/* Root window properties */
NetSupported,
NetClientList,
NetClientListStacking,
NetNumberOfDesktops, NetDesktopGeometry,
NetDesktopViewport, NetCurrentDesktop,
NetDesktopNames, NetActiveWindow,
NetWorkarea, NetSupportingWMCheck,
NetVirtualRoots, NetDesktopLayout,
NetShowingDesktop,
/* other root messages */
NetCloseWindow, NetMoveResizeWindow,
NetMoveResize,/* _NET_WM_MOVERESIZE */
NetRestackWindow,
NetRequestFrameExtents,
/* application win properties */
NetWMName, NetWMVisibleName,
NetWMIconName, NetWMVisibleIconName,
NetWMDesktop, NetWMWindowType,
NetWMState, NetWMAllowedActions,
NetWMStrut, NetWMStrutPartial,
NetWMIconGeometry, NetWMIcon,
NetWMPid, NetWMHandledIcons,
NetWMUserTime, NetWMUserTimeWindow,
NetWMFrameExtents, NetWMOpaqueRegion,
NetWMStateFullscreen,
NetWMStateAbove, NetWMStateAlwaysOnTop = NetWMStateAbove,
NetWMStateMaximizedVert, NetWMStateMaximizedHorz,
NetWMStateBelow, NetWMStateDemandAttention, NetWMStateSticky,
NetWMStateShaded, NetWMStateSkipTaskbar, NetWMStateSkipPager,
NetWMStateModal, NetWMStateHidden, NetWMStateFocused,
/* action requests */
NetWMActionMove,
NetWMActionResize, NetWMActionMaximizeVert, NetWMActionMaximizeHorz,
NetWMActionFullscreen, NetWMActionChangeDesktop, NetWMActionClose,
NetWMActionAbove, NetWMActionMinimize, NetWMActionBelow,
/* actions msg */
NetWMFullscreen,
/* window types */
NetWMWindowTypeDesktop, NetWMWindowTypeDock,
NetWMWindowTypeToolbar, NetWMWindowTypeMenu,
NetWMWindowTypeUtility, NetWMWindowTypeSplash,
NetWMWindowTypeDropdownMenu, NetWMWindowTypePopupMenu,
NetWMWindowTypeTooltip, NetWMWindowTypeNotification,
NetWMWindowTypeCombo, NetWMWindowTypeDnd,
NetWMWindowTypeDialog, NetWMWindowTypeNormal,
/* wm protocols */
NetWMPing, NetWMSyncRequest,
NetWMFullscreenMonitors,
/* other */
NetWMFullPlacement ,NetWMBypassCompositor,
NetWMWindowOpacity,
NetUtf8String,
/* last */
NetLast,
};
/* default atoms */
enum WMPROTOCOLS {
WMName,
WMIconName,
WMIconSize,
WMHints, WMNormalHints,
WMClass,
WMTransientFor,
WMColormapWindows,
WMClientMachine,
WMCommand,
WMProtocols,
WMTakeFocus, WMSaveYourself, WMDeleteWindow,
WMState,
WMChangeState,
WMLast
};
/* Fills wm_atom_return and net_atom_return with every atom part of the X11 standard. + EWMH
* wm_atom_return are default atoms.
* net_atom_return are part of the Extended Window Manager Hints. (and some regulars too).
*
* Window managers:
* Should not use NetLast to apply supported wmhints and netwmhints for windows if they dont support every atom.
* Instead they should only use the ones they support.s
*
* Usage: Pass in the adress of the returned value(s), using the respective sizes of WMLast, NetLast;
* XCBAtom wmatom[WMLast]; XCBAtom netatom[NetLast];
* XCBInitAtoms(display, wmatom, netatom);
*
* NOTE: No side-effects if wm_atom_return is NULL.
* NOTE: No side-effects if net_atom_return is NULL.
* NOTE: XCBInitAtoms() assumes that the space given is enough, i.e. WMLast or NetLast for array size
*
*/
void
XCBInitNetWMAtomsCookie(
XCBDisplay *display,
XCBCookie *net_cookie_return
);
void
XCBInitNetWMAtomsReply(
XCBDisplay *display,
XCBCookie *net_cookies,
XCBAtom *net_atom_return
);
void
XCBInitWMAtomsCookie(
XCBDisplay *display,
XCBCookie *wm_cookie_return
);
void
XCBInitWMAtomsReply(
XCBDisplay *display,
XCBCookie *wm_cookies,
XCBAtom *wm_atom_return
);
int
XCBGetTextProp(
XCBDisplay *display,
XCBWindow window,
XCBAtom atom,
char *text,
size_t size);
/* Returns a wchar_t * to the name of the window.
*
* NOTE: No check for if win exists.
* NOTE: Data must be freed when finished using.
*
* RETURN: wchar_t *
*/
char *
XCBGetWindowName(
XCBDisplay *display,
XCBWindow win
);
/* Requests for the windows stored pid.
*
*
* RETURN: Cookie to request.
*/
XCBCookie
XCBGetPidCookie(
XCBDisplay *display,
XCBWindow win,
XCBAtom _NET_WM_ICON_ID
);
/* Gets the pid from the reply, freeing resulting data automatically.
*
* RETURN: -1 on Failure.
* RETURN: int32_t on Success.
*/
int32_t
XCBGetPidReply(
XCBDisplay *display,
XCBCookie cookie
);
#ifdef __cplusplus
}
#endif
#endif