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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// devela::sys::display::x11::raw::xcb_values
//
//! from `xproto.h`
//
// TOC
// - events
// - keyboard modifiers
// - buttons
// - window attributes
/* event masks */
/// Receive nothing.
pub const XCB_EVENT_MASK_NO_EVENT: u32 = 0;
/// Keyboard input on key press. (XCB_KEY_PRESS)
pub const XCB_EVENT_MASK_KEY_PRESS: u32 = 1 << 0;
/// Keyboard input on key release. (XCB_KEY_RELEASE)
pub const XCB_EVENT_MASK_KEY_RELEASE: u32 = 1 << 1;
/// Mouse button press. (XCB_BUTTON_PRESS)
pub const XCB_EVENT_MASK_BUTTON_PRESS: u32 = 1 << 2;
/// Mouse button release. (XCB_BUTTON_RELEASE)
pub const XCB_EVENT_MASK_BUTTON_RELEASE: u32 = 1 << 3;
/// Enter window boundary. (XCB_ENTER_NOTIFY)
pub const XCB_EVENT_MASK_ENTER_WINDOW: u32 = 1 << 4;
/// Leave window boundary. (XCB_LEAVE_NOTIFY)
pub const XCB_EVENT_MASK_LEAVE_WINDOW: u32 = 1 << 5;
/// Mouse movement with no buttons pressed. (XCB_MOTION_NOTIFY, no buttons)
pub const XCB_EVENT_MASK_POINTER_MOTION: u32 = 1 << 6;
// Obsolete. Mouse movement.
pub const XCB_EVENT_MASK_POINTER_MOTION_HINT: u32 = 1 << 7;
/// Mouse movement with button 1 pressed. (XCB_MOTION_NOTIFY, with button 1)
pub const XCB_EVENT_MASK_BUTTON_1_MOTION: u32 = 1 << 8;
/// Mouse movement with button 2 pressed. (XCB_MOTION_NOTIFY, with button 2)
pub const XCB_EVENT_MASK_BUTTON_2_MOTION: u32 = 1 << 9;
/// Mouse movement with button 3 pressed. (XCB_MOTION_NOTIFY, with button 3)
pub const XCB_EVENT_MASK_BUTTON_3_MOTION: u32 = 1 << 10;
/// Mouse movement with button 5 pressed. (XCB_MOTION_NOTIFY, with button 4)
pub const XCB_EVENT_MASK_BUTTON_4_MOTION: u32 = 1 << 11;
/// Mouse movement with button 5 pressed. (XCB_MOTION_NOTIFY, with button 4)
pub const XCB_EVENT_MASK_BUTTON_5_MOTION: u32 = 1 << 12;
/// Mouse movement with any button pressed. (XCB_MOTION_NOTIFY, with buttons)
pub const XCB_EVENT_MASK_BUTTON_MOTION: u32 = 1 << 13;
// Obsolete map state notification (XCB_KEYMAP_NOTIFY)
pub const XCB_EVENT_MASK_KEYMAP_STATE: u32 = 1 << 14;
/// Redraw requests. (XCB_EVENT_MASK_EXPOSURE)
pub const XCB_EVENT_MASK_EXPOSURE: u32 = 1 << 15;
/// Window partially/fully obscured. (XCB_VISIBILITY_NOTIFY)
pub const XCB_EVENT_MASK_VISIBILITY_CHANGE: u32 = 1 << 16;
/// Window resize, configure, map/unmap.
/// (XCB_CREATE_NOTIFY, XCB_DESTROY_NOTIFY, XCB_UNMAP_NOTIFY, XCB_MAP_NOTIFY,
/// XCB_REPARENT_NOTIFY, XCB_CONFIGURE_NOTIFY, XCB_CIRCULATE_NOTIFY)
pub const XCB_EVENT_MASK_STRUCTURE_NOTIFY: u32 = 1 << 17;
/// WM redirect for client-resize.
pub const XCB_EVENT_MASK_RESIZE_REDIRECT: u32 = 1 << 18;
/// Like `XCB_EVENT_MASK_STRUCTURE_NOTIFY`, but for children.
pub const XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY: u32 = 1 << 19;
/// Like `XCB_EVENT_MASK_STRUCTURE_REDIRECT`, but for children.
pub const XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT: u32 = 1 << 20;
/// Focus in/out. (XCB_FOCUS_IN, XCB_FOCUS_OUT)
pub const XCB_EVENT_MASK_FOCUS_CHANGE: u32 = 1 << 21;
/// Window property changes. (XCB_PROPERTY_NOTIFY)
pub const XCB_EVENT_MASK_PROPERTY_CHANGE: u32 = 1 << 22;
// Obsolete color map change (XCB_COLORMAP_NOTIFY)
pub const XCB_EVENT_MASK_COLOR_MAP_CHANGE: u32 = 1 << 23;
/// Passive button grabs for menus/popups.
pub const XCB_EVENT_MASK_OWNER_GRAB_BUTTON: u32 = 1 << 24;
/* keyboard modifiers masks (xcb_mod_mask_t) */
/// Shift.
pub const XCB_MOD_MASK_SHIFT: u16 = 1;
/// CapsLock.
pub const XCB_MOD_MASK_LOCK: u16 = 2;
/// Control.
pub const XCB_MOD_MASK_CONTROL: u16 = 4;
/// Alt.
pub const XCB_MOD_MASK_1: u16 = 8;
/// NumLock.
pub const XCB_MOD_MASK_2: u16 = 16;
///
pub const XCB_MOD_MASK_3: u16 = 32;
/// Super.
pub const XCB_MOD_MASK_4: u16 = 64;
/// AltGr.
pub const XCB_MOD_MASK_5: u16 = 128;
/* button masks (xcb_key_but_mask_t) */
pub const XCB_KEY_BUT_MASK_SHIFT: u16 = 1;
pub const XCB_KEY_BUT_MASK_LOCK: u16 = 2;
pub const XCB_KEY_BUT_MASK_CONTROL: u16 = 4;
pub const XCB_KEY_BUT_MASK_MOD_1: u16 = 8;
pub const XCB_KEY_BUT_MASK_MOD_2: u16 = 16;
pub const XCB_KEY_BUT_MASK_MOD_3: u16 = 32;
pub const XCB_KEY_BUT_MASK_MOD_4: u16 = 64;
pub const XCB_KEY_BUT_MASK_MOD_5: u16 = 128;
pub const XCB_KEY_BUT_MASK_BUTTON_1: u16 = 256;
pub const XCB_KEY_BUT_MASK_BUTTON_2: u16 = 512;
pub const XCB_KEY_BUT_MASK_BUTTON_3: u16 = 1024;
pub const XCB_KEY_BUT_MASK_BUTTON_4: u16 = 2048;
pub const XCB_KEY_BUT_MASK_BUTTON_5: u16 = 4096;
/* window attribute value-mask bits (`xcb_cw_t`). */
/**< Overrides the default background-pixmap. The background pixmap and window must
have the same root and same depth. Any size pixmap can be used, although some
sizes may be faster than others.
If `XCB_BACK_PIXMAP_NONE` is specified, the window has no defined background.
The server may fill the contents with the previous screen contents or with
contents of its own choosing.
If `XCB_BACK_PIXMAP_PARENT_RELATIVE` is specified, the parent's background is
used, but the window must have the same depth as the parent (or a Match error
results). The parent's background is tracked, and the current version is
used each time the window background is required. */
pub const XCB_CW_BACK_PIXMAP: u32 = 1 << 0;
/// Overrides `BackPixmap`.
///
/// A pixmap of undefined size filled with the specified background pixel is used for the
/// background. Range-checking is not performed, the background pixel is truncated
/// to the appropriate number of bits.
pub const XCB_CW_BACK_PIXEL: u32 = 1 << 1;
/// Overrides the default border-pixmap.
///
/// The border pixmap and window must have the same root and the same depth.
/// Any size pixmap can be used, although some sizes may be faster than others.
///
/// The special value `XCB_COPY_FROM_PARENT` means the parent's border pixmap is copied
/// (subsequent changes to the parent's border attribute do not affect the child),
/// but the window must have the same depth as the parent.
pub const XCB_CW_BORDER_PIXMAP: u32 = 1 << 2;
/// Overrides `BorderPixmap`.
///
/// A pixmap of undefined size filled with the specified border pixel is used for the border.
/// Range checking is not performed on the border-pixel value,
/// it is truncated to the appropriate number of bits.
pub const XCB_CW_BORDER_PIXEL: u32 = 1 << 3;
/// Defines which region of the window should be retained if the window is resized.
pub const XCB_CW_BIT_GRAVITY: u32 = 1 << 4;
/// Defines how the window should be repositioned if the parent is resized.
/// (see `ConfigureWindow`)
pub const XCB_CW_WIN_GRAVITY: u32 = 1 << 5;
/**< A backing-store of `WhenMapped` advises the server that maintaining contents of
obscured regions when the window is mapped would be beneficial. A backing-store
of `Always` advises the server that maintaining contents even when the window
is unmapped would be beneficial. In this case, the server may generate an
exposure event when the window is created. A value of `NotUseful` advises the
server that maintaining contents is unnecessary, although a server may still
choose to maintain contents while the window is mapped. Note that if the server
maintains contents, then the server should maintain complete contents not just
the region within the parent boundaries, even if the window is larger than its
parent. While the server maintains contents, exposure events will not normally
be generated, but the server may stop maintaining contents at any time. */
pub const XCB_CW_BACKING_STORE: u32 = 1 << 6;
/// The backing-planes indicates (with bits set to 1) which bit planes of the window
/// hold dynamic data that must be preserved in backing-stores and during save-unders.
pub const XCB_CW_BACKING_PLANES: u32 = 1 << 7;
/// The backing-pixel specifies what value to use in planes not covered by backing-planes.
///
/// The server is free to save only the specified bit planes in the backing-store or save-under
/// and regenerate the remaining planes with the specified pixel value.
/// Any bits beyond the specified depth of the window in these values are simply ignored.
pub const XCB_CW_BACKING_PIXEL: u32 = 1 << 8;
/// The override-redirect specifies whether map and configure requests
/// on this window should override a SubstructureRedirect on the parent,
/// typically to inform a window manager not to tamper with the window.
pub const XCB_CW_OVERRIDE_REDIRECT: u32 = 1 << 9;
/// If 1, the server is advised that when this window is mapped,
/// saving the contents of windows it obscures would be beneficial.
pub const XCB_CW_SAVE_UNDER: u32 = 1 << 10;
/// The event-mask defines which events the client is interested in for this window
/// (or for some event types, inferiors of the window).
pub const XCB_CW_EVENT_MASK: u32 = 1 << 11;
/// The do-not-propagate-mask defines which events should not be propagated to
/// ancestor windows when no client has the event type selected in this window.
pub const XCB_CW_DONT_PROPAGATE: u32 = 1 << 12;
/// The colormap specifies the colormap that best reflects the true colors of the window.
///
/// Servers capable of supporting multiple hardware colormaps may use this information,
/// and window managers may use it for InstallColormap requests.
///
/// The colormap must have the same visual type and root as the window (or a Match error results).
/// If CopyFromParent is specified, the parent's colormap is copied (subsequent changes to the
/// parent's colormap attribute do not affect the child).
///
/// However, the window must have the same visual type as the parent (or a Match error results),
/// and the parent must not have a colormap of None (or a Match error results). For an explanation
/// of None, see FreeColormap request. The colormap is copied by sharing the colormap object
/// between the child and the parent, not by making a complete copy of the colormap contents.
pub const XCB_CW_COLORMAP: u32 = 1 << 13;
/// If a cursor is specified, it will be used whenever the pointer is in the window.
///
/// If None is specified, the parent's cursor will be used when the pointer is in the window,
/// and any change in the parent's cursor will cause an immediate change in the displayed cursor.
pub const XCB_CW_CURSOR: u32 = 1 << 14;