Mercurial > projects > dynamin
annotate dynamin/c/xlib.d @ 23:d55b5b998412
Implement built-in mouse cursors with X.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Sat, 25 Jul 2009 14:58:43 -0500 |
parents | e6e201c3a439 |
children | 43a88caead16 |
rev | line source |
---|---|
0 | 1 module dynamin.c.xlib; |
2 | |
3 /* | |
4 * A binding to at least the part of the X Window System that Dynamin uses. This | |
5 * binding is incomplete as it is made only for Dynamin's use. | |
6 */ | |
7 | |
8 import dynamin.c.x_types; | |
9 | |
10 version(build) { pragma(link, X11); } | |
11 | |
12 extern(C): | |
13 | |
14 alias ubyte* XPointer; | |
15 alias uint XID; | |
16 // export these with an X prefix so they won't as easily conflict | |
17 alias uint XMask; | |
18 alias uint XAtom; | |
19 alias uint XVisualID; | |
20 alias uint XTime; | |
21 alias XID XWindow; | |
22 alias XID XDrawable; | |
23 alias XID XPixmap; | |
24 alias XID XCursor; | |
25 alias XID XColormap; | |
26 alias XID XKeySym; | |
27 alias ubyte XKeyCode; | |
28 alias int XBool; | |
29 alias int XStatus; | |
30 | |
31 alias void XScreen; | |
32 alias void XDisplay; | |
33 | |
34 const None = 0; | |
35 const ParentRelative = 1; | |
36 const CopyFromParent = 0; | |
37 const PointerWindow = 0; | |
38 const InputFocus = 1; | |
39 const PointerRoot = 1; | |
40 const AnyPropertyType = 0; | |
41 const AnyKey = 0; | |
42 const AnyButton = 0; | |
43 const AllTemporary = 0; | |
44 const CurrentTime = 0; | |
45 const NoSymbol = 0; | |
46 | |
47 //{{{ display functions | |
48 Display* XOpenDisplay(char* display_name); | |
49 | |
50 int XNextEvent(Display* display, XEvent* event_return); | |
51 | |
52 int XEventsQueued(Display* display, int mode); | |
53 | |
54 int XPending(Display* display); | |
55 | |
56 int XPutBackEvent(Display* display, XEvent* event); | |
57 | |
58 Status XSendEvent( | |
59 Display* display, | |
60 Window w, | |
61 Bool propagate, | |
62 int event_mask, | |
63 XEvent* event_send); | |
64 | |
65 int XCloseDisplay(Display* display); | |
66 | |
67 char* XDisplayString(Display* display); | |
68 | |
69 int XFlush(Display* display); | |
70 | |
71 int XSync(Display* display, Bool discard); | |
72 | |
73 int XDisplayWidth(Display* display, int screen_number); | |
74 | |
75 int XDisplayHeight(Display* display, int screen_number); | |
76 | |
77 int XProtocolRevision(Display* display); | |
78 | |
79 int XProtocolVersion(Display* display); | |
80 | |
81 Colormap XDefaultColormap(Display* display, int screen_number); | |
82 | |
83 Status XAllocColor(Display* display, Colormap colormap, XColor* screen_in_out); | |
84 //}}} | |
85 | |
86 //{{{ window functions | |
87 Window XCreateSimpleWindow( | |
88 Display* display, | |
89 Window parent, | |
90 int x, | |
91 int y, | |
92 uint width, | |
93 uint height, | |
94 uint border_width, | |
95 uint border, | |
96 uint background); | |
97 | |
98 Window XCreateWindow( | |
99 Display* display, | |
100 Window parent, | |
101 int x, | |
102 int y, | |
103 uint width, | |
104 uint height, | |
105 uint border_width, | |
106 int depth, | |
107 uint c_class, | |
108 Visual* visual, | |
109 uint valuemask, | |
110 XSetWindowAttributes* attributes); | |
111 | |
112 int XDestroyWindow(Display* display, Window w); | |
113 | |
114 int XClearArea( | |
115 Display* display, | |
116 Window w, | |
117 int x, | |
118 int y, | |
119 uint width, | |
120 uint height, | |
121 Bool exposures); | |
122 | |
123 Window XRootWindow(Display* display, int screen_number); | |
124 | |
125 Window XDefaultRootWindow(Display* display); | |
126 | |
127 Status XQueryTree( | |
128 Display* display, | |
129 Window w, | |
130 Window* root_return, | |
131 Window* parent_return, | |
132 Window** children_return, | |
133 uint* nchildren_return); | |
134 | |
135 Bool XTranslateCoordinates( | |
136 Display* display, | |
137 Window src_w, | |
138 Window dest_w, | |
139 int src_x, | |
140 int src_y, | |
141 int* dest_x_return, | |
142 int* dest_y_return, | |
143 Window* child_return); | |
144 | |
145 Window XRootWindowOfScreen(Screen* screen); | |
146 | |
147 Status XIconifyWindow(Display* display, Window w, int screen_number); | |
148 | |
149 Status XWithdrawWindow(Display* display, Window w, int screen_number); | |
150 | |
151 int XChangeProperty( | |
152 Display* display, | |
153 Window w, | |
154 Atom property, | |
155 Atom type, | |
156 int format, | |
157 int mode, | |
158 void* data, | |
159 int nelements); | |
160 | |
161 Bool XCheckIfEvent( | |
162 Display* display, | |
163 XEvent* event_return, | |
164 Bool function(Display* display, | |
165 XEvent* event, | |
166 XPointer arg) predicate, | |
167 XPointer arg); | |
168 | |
169 int XGetWindowProperty( | |
170 Display* display, | |
171 Window w, | |
172 Atom property, | |
173 int long_offset, | |
174 int long_length, | |
175 Bool should_delete, | |
176 Atom req_type, | |
177 Atom* actual_type_return, | |
178 int* actual_format_return, | |
179 uint* nitems_return, | |
180 uint* bytes_after_return, | |
181 void** prop_return); | |
182 | |
183 int XDeleteProperty(Display* display, Window w, Atom property); | |
184 | |
185 int XMapWindow(Display* display, Window w); | |
186 | |
187 int XUnmapWindow(Display* display, Window w); | |
188 | |
189 int XMoveWindow(Display* display, Window w, int x, int y); | |
190 | |
191 int XResizeWindow(Display* display, Window w, uint width, uint height); | |
192 | |
193 int XMoveResizeWindow(Display* display, Window w, | |
194 int x, int y, uint width, uint height); | |
195 | |
196 int XSelectInput(Display* display, Window w, int event_mask); | |
197 | |
198 int XReparentWindow(Display* display, Window w, Window parent, int x, int y); | |
199 | |
200 int XRestackWindows(Display* display, Window* windows, int nwindows); | |
201 | |
202 int XChangeWindowAttributes( | |
203 Display* display, | |
204 Window w, | |
205 uint valuemask, | |
206 XSetWindowAttributes* attributes); | |
207 | |
208 Status XGetWindowAttributes( | |
209 Display* display, | |
210 Window w, | |
211 XWindowAttributes* window_attributes_return); | |
212 //}}} | |
213 | |
214 //{{{ screen functions | |
215 int XDefaultScreen(Display* display); | |
216 | |
217 Screen* XDefaultScreenOfDisplay(Display* display); | |
218 | |
219 int XScreenCount(Display* display); | |
220 | |
221 Screen* XScreenOfDisplay(Display* display, int screen_number); | |
222 | |
223 Display* XDisplayOfScreen(Screen* screen); | |
224 | |
225 int XScreenNumberOfScreen(Screen* screen); | |
226 | |
227 int XWidthOfScreen(Screen* screen); | |
228 | |
229 int XHeightOfScreen(Screen* screen); | |
230 | |
231 int XDefaultDepthOfScreen(Screen* screen); | |
232 | |
233 //}}} | |
234 | |
235 //{{{ pixmap functions | |
236 Pixmap XCreatePixmap(Display* display, Drawable d, uint width, uint height, uint depth); | |
237 | |
238 Pixmap XCreatePixmapFromBitmapData( | |
239 Display* display, | |
240 Drawable d, | |
241 ubyte* data, | |
242 uint width, | |
243 uint height, | |
244 uint fg, | |
245 uint bg, | |
246 uint depth); | |
247 | |
23
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
248 Pixmap XCreateBitmapFromData( |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
249 Display* display, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
250 Drawable d, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
251 /*const*/ char* data, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
252 uint width, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
253 uint height); |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
254 |
0 | 255 int XFreePixmap(Display* display, Pixmap pixmap); |
256 //}}} | |
257 | |
258 //{{{ cursor functions | |
259 Cursor XCreatePixmapCursor( | |
260 Display* display, | |
261 Pixmap source, | |
262 Pixmap mask, | |
263 XColor* foreground_color, | |
264 XColor* background_color, | |
265 uint x, | |
266 uint y); | |
267 | |
23
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
268 Cursor XCreateFontCursor(Display* display, uint shape); |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
269 |
0 | 270 int XDefineCursor(Display* display, Window w, Cursor cursor); |
271 | |
272 int XUndefineCursor(Display* display, Window w); | |
273 | |
274 int XFreeCursor(Display* display, Cursor cursor); | |
275 | |
23
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
276 // cursorfont.h |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
277 enum { |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
278 XC_num_glyphs = 154, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
279 XC_X_cursor = 0, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
280 XC_arrow = 2, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
281 XC_based_arrow_down = 4, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
282 XC_based_arrow_up = 6, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
283 XC_boat = 8, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
284 XC_bogosity = 10, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
285 XC_bottom_left_corner = 12, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
286 XC_bottom_right_corner = 14, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
287 XC_bottom_side = 16, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
288 XC_bottom_tee = 18, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
289 XC_box_spiral = 20, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
290 XC_center_ptr = 22, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
291 XC_circle = 24, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
292 XC_clock = 26, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
293 XC_coffee_mug = 28, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
294 XC_cross = 30, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
295 XC_cross_reverse = 32, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
296 XC_crosshair = 34, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
297 XC_diamond_cross = 36, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
298 XC_dot = 38, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
299 XC_dotbox = 40, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
300 XC_double_arrow = 42, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
301 XC_draft_large = 44, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
302 XC_draft_small = 46, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
303 XC_draped_box = 48, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
304 XC_exchange = 50, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
305 XC_fleur = 52, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
306 XC_gobbler = 54, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
307 XC_gumby = 56, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
308 XC_hand1 = 58, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
309 XC_hand2 = 60, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
310 XC_heart = 62, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
311 XC_icon = 64, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
312 XC_iron_cross = 66, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
313 XC_left_ptr = 68, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
314 XC_left_side = 70, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
315 XC_left_tee = 72, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
316 XC_leftbutton = 74, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
317 XC_ll_angle = 76, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
318 XC_lr_angle = 78, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
319 XC_man = 80, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
320 XC_middlebutton = 82, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
321 XC_mouse = 84, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
322 XC_pencil = 86, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
323 XC_pirate = 88, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
324 XC_plus = 90, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
325 XC_question_arrow = 92, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
326 XC_right_ptr = 94, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
327 XC_right_side = 96, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
328 XC_right_tee = 98, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
329 XC_rightbutton = 100, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
330 XC_rtl_logo = 102, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
331 XC_sailboat = 104, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
332 XC_sb_down_arrow = 106, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
333 XC_sb_h_double_arrow = 108, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
334 XC_sb_left_arrow = 110, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
335 XC_sb_right_arrow = 112, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
336 XC_sb_up_arrow = 114, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
337 XC_sb_v_double_arrow = 116, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
338 XC_shuttle = 118, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
339 XC_sizing = 120, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
340 XC_spider = 122, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
341 XC_spraycan = 124, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
342 XC_star = 126, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
343 XC_target = 128, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
344 XC_tcross = 130, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
345 XC_top_left_arrow = 132, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
346 XC_top_left_corner = 134, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
347 XC_top_right_corner = 136, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
348 XC_top_side = 138, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
349 XC_top_tee = 140, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
350 XC_trek = 142, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
351 XC_ul_angle = 144, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
352 XC_umbrella = 146, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
353 XC_ur_angle = 148, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
354 XC_watch = 150, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
355 XC_xterm = 152, |
d55b5b998412
Implement built-in mouse cursors with X.
Jordan Miner <jminer7@gmail.com>
parents:
14
diff
changeset
|
356 } |
0 | 357 //}}} |
358 | |
359 //{{{ keyboard functions | |
360 KeyCode XKeysymToKeycode(Display* display, KeySym keysym); | |
361 | |
362 KeySym XKeycodeToKeysym( | |
363 Display* display, | |
364 // if NeedWidePrototypes | |
365 uint keycode, | |
366 // else | |
367 //KeyCode keycode, | |
368 int index); | |
369 | |
370 char* XKeysymToString(KeySym keysym); | |
371 | |
372 KeySym XStringToKeysym(char* string); | |
373 //}}} | |
374 | |
375 char** XListExtensions(Display* display, int* nextensions_return); | |
376 | |
377 int XFreeExtensionList(char** list); | |
378 | |
379 XExtCodes* XInitExtension(Display* display, char* name); | |
380 | |
381 uint XBlackPixel(Display* display, int screen_number); | |
382 | |
383 uint XWhitePixel(Display* display, int screen_number); | |
384 | |
385 int XDefaultDepth(Display* display, int screen_number); | |
386 | |
387 int XFree(void* data); | |
388 | |
389 int XNoOp(Display* display); | |
390 | |
391 Visual* XDefaultVisual(Display* display, int screen_number); | |
392 | |
393 Visual* XDefaultVisualOfScreen(Screen* screen); | |
394 | |
395 Window XGetSelectionOwner(Display* display, Atom selection); | |
396 | |
397 int XSetSelectionOwner(Display* display, Atom selection, Window owner, Time time); | |
398 | |
399 void XSetWMName(Display* display, Window w, XTextProperty* text_prop); | |
400 | |
401 Status XSetWMProtocols(Display* display, Window w, Atom* protocols, int count); | |
402 | |
403 int XConvertSelection( | |
404 Display* display, | |
405 Atom selection, | |
406 Atom target, | |
407 Atom property, | |
408 Window requestor, | |
409 Time time); | |
410 | |
411 //{{{ atoms | |
412 Atom XInternAtom(Display* display, char* atom_name, Bool only_if_exists); | |
413 | |
414 Status XInternAtoms( | |
415 Display* dpy, | |
416 char** names, | |
417 int count, | |
418 Bool onlyIfExists, | |
419 Atom* atoms_return); | |
420 | |
421 enum : Atom { | |
422 XA_PRIMARY = 1, | |
423 XA_SECONDARY = 2, | |
424 XA_ARC = 3, | |
425 XA_ATOM = 4, | |
426 XA_BITMAP = 5, | |
427 XA_CARDINAL = 6, | |
428 XA_COLORMAP = 7, | |
429 XA_CURSOR = 8, | |
430 XA_CUT_BUFFER0 = 9, | |
431 XA_CUT_BUFFER1 = 10, | |
432 XA_CUT_BUFFER2 = 11, | |
433 XA_CUT_BUFFER3 = 12, | |
434 XA_CUT_BUFFER4 = 13, | |
435 XA_CUT_BUFFER5 = 14, | |
436 XA_CUT_BUFFER6 = 15, | |
437 XA_CUT_BUFFER7 = 16, | |
438 XA_DRAWABLE = 17, | |
439 XA_FONT = 18, | |
440 XA_INTEGER = 19, | |
441 XA_PIXMAP = 20, | |
442 XA_POINT = 21, | |
443 XA_RECTANGLE = 22, | |
444 XA_RESOURCE_MANAGER = 23, | |
445 XA_RGB_COLOR_MAP = 24, | |
446 XA_RGB_BEST_MAP = 25, | |
447 XA_RGB_BLUE_MAP = 26, | |
448 XA_RGB_DEFAULT_MAP = 27, | |
449 XA_RGB_GRAY_MAP = 28, | |
450 XA_RGB_GREEN_MAP = 29, | |
451 XA_RGB_RED_MAP = 30, | |
452 XA_STRING = 31, | |
453 XA_VISUALID = 32, | |
454 XA_WINDOW = 33, | |
455 XA_WM_COMMAND = 34, | |
456 XA_WM_HINTS = 35, | |
457 XA_WM_CLIENT_MACHINE = 36, | |
458 XA_WM_ICON_NAME = 37, | |
459 XA_WM_ICON_SIZE = 38, | |
460 XA_WM_NAME = 39, | |
461 XA_WM_NORMAL_HINTS = 40, | |
462 XA_WM_SIZE_HINTS = 41, | |
463 XA_WM_ZOOM_HINTS = 42, | |
464 XA_MIN_SPACE = 43, | |
465 XA_NORM_SPACE = 44, | |
466 XA_MAX_SPACE = 45, | |
467 XA_END_SPACE = 46, | |
468 XA_SUPERSCRIPT_X = 47, | |
469 XA_SUPERSCRIPT_Y = 48, | |
470 XA_SUBSCRIPT_X = 49, | |
471 XA_SUBSCRIPT_Y = 50, | |
472 XA_UNDERLINE_POSITION = 51, | |
473 XA_UNDERLINE_THICKNESS = 52, | |
474 XA_STRIKEOUT_ASCENT = 53, | |
475 XA_STRIKEOUT_DESCENT = 54, | |
476 XA_ITALIC_ANGLE = 55, | |
477 XA_X_HEIGHT = 56, | |
478 XA_QUAD_WIDTH = 57, | |
479 XA_WEIGHT = 58, | |
480 XA_POINT_SIZE = 59, | |
481 XA_RESOLUTION = 60, | |
482 XA_COPYRIGHT = 61, | |
483 XA_NOTICE = 62, | |
484 XA_FONT_NAME = 63, | |
485 XA_FAMILY_NAME = 64, | |
486 XA_FULL_NAME = 65, | |
487 XA_CAP_HEIGHT = 66, | |
488 XA_WM_CLASS = 67, | |
489 XA_WM_TRANSIENT_FOR = 68, | |
490 | |
491 XA_LAST_PREDEFINED = 68 | |
492 } | |
493 //}}} | |
494 | |
495 Status XStringListToTextProperty(char** list, int count, XTextProperty* text_prop_return); | |
496 | |
497 XSizeHints* XAllocSizeHints(); | |
498 | |
499 void XSetWMNormalHints(Display* display, Window w, XSizeHints* hints); | |
500 | |
501 Status XGetWMNormalHints( | |
502 Display* display, | |
503 Window w, | |
504 XSizeHints* hints_return, | |
505 long* supplied_return); | |
506 | |
507 XWMHints* XAllocWMHints(); | |
508 | |
509 int XSetWMHints(Display* display, Window w, XWMHints* wm_hints); | |
510 | |
511 XWMHints *XGetWMHints(Display* display, Window w); | |
512 | |
513 //{{{ enums | |
514 enum { | |
515 InputHint = 1 << 0, | |
516 StateHint = 1 << 1, | |
517 IconPixmapHint = 1 << 2, | |
518 IconWindowHint = 1 << 3, | |
519 IconPositionHint = 1 << 4, | |
520 IconMaskHint = 1 << 5, | |
521 WindowGroupHint = 1 << 6, | |
522 AllHints = InputHint | StateHint | IconPixmapHint | IconWindowHint | | |
523 IconPositionHint | IconMaskHint | WindowGroupHint, | |
524 XUrgencyHint = 1 << 8 | |
525 } | |
526 | |
527 enum { | |
528 WithdrawnState = 0, | |
529 NormalState = 1, | |
530 IconicState = 3 | |
531 } | |
532 | |
533 enum { | |
534 QueuedAlready = 0, | |
535 QueuedAfterReading = 1, | |
536 QueuedAfterFlush = 2 | |
537 } | |
538 | |
539 enum { | |
14
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
540 USPosition = 1 << 0, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
541 USSize = 1 << 1, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
542 PPosition = 1 << 2, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
543 PSize = 1 << 3, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
544 PMinSize = 1 << 4, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
545 PMaxSize = 1 << 5, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
546 PResizeInc = 1 << 6, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
547 PAspect = 1 << 7, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
548 PBaseSize = 1 << 8, |
e6e201c3a439
Remove ANSI functions from Windows binding and convert inner tabs to spaces
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
549 PWinGravity = 1 << 9 |
0 | 550 } |
551 | |
552 enum { | |
553 ShiftMask = 1 << 0, | |
554 LockMask = 1 << 1, | |
555 ControlMask = 1 << 2, | |
556 Mod1Mask = 1 << 3, | |
557 Mod2Mask = 1 << 4, | |
558 Mod3Mask = 1 << 5, | |
559 Mod4Mask = 1 << 6, | |
560 Mod5Mask = 1 << 7 | |
561 } | |
562 | |
563 enum { | |
564 ShiftMapIndex = 0, | |
565 LockMapIndex = 1, | |
566 ControlMapIndex = 2, | |
567 Mod1MapIndex = 3, | |
568 Mod2MapIndex = 4, | |
569 Mod3MapIndex = 5, | |
570 Mod4MapIndex = 6, | |
571 Mod5MapIndex = 7 | |
572 } | |
573 | |
574 enum { | |
575 Button1Mask = 1 << 8, | |
576 Button2Mask = 1 << 9, | |
577 Button3Mask = 1 << 10, | |
578 Button4Mask = 1 << 11, | |
579 Button5Mask = 1 << 12 | |
580 } | |
581 | |
582 enum { | |
583 AnyModifier = 1 << 15 | |
584 } | |
585 | |
586 enum { | |
587 Button1 = 1, | |
588 Button2 = 2, | |
589 Button3 = 3, | |
590 Button4 = 4, | |
591 Button5 = 5 | |
592 } | |
593 | |
594 enum { | |
595 NotifyNormal = 0, | |
596 NotifyGrab = 1, | |
597 NotifyUngrab = 2, | |
598 NotifyWhileGrabbed = 3 | |
599 } | |
600 | |
601 enum { | |
602 NotifyHint = 1 | |
603 } | |
604 | |
605 enum { | |
606 NotifyAncestor = 0, | |
607 NotifyVirtual = 1, | |
608 NotifyInferior = 2, | |
609 NotifyNonlinear = 3, | |
610 NotifyNonlinearVirtual = 4, | |
611 NotifyPointer = 5, | |
612 NotifyPointerRoot = 6, | |
613 NotifyDetailNone = 7 | |
614 } | |
615 | |
616 enum { | |
617 VisibilityUnobscured = 0, | |
618 VisibilityPartiallyObscured = 1, | |
619 VisibilityFullyObscured = 2 | |
620 } | |
621 | |
622 enum { | |
623 PlaceOnTop = 0, | |
624 PlaceOnBottom = 1 | |
625 } | |
626 | |
627 enum { | |
628 FamilyInternet = 0, | |
629 FamilyDECnet = 1, | |
630 FamilyChaos = 2, | |
631 FamilyInternet6 = 6 | |
632 } | |
633 | |
634 enum { | |
635 FamilyServerInterpreted = 5 | |
636 } | |
637 | |
638 enum { | |
639 PropertyNewValue = 0, | |
640 PropertyDelete = 1 | |
641 } | |
642 | |
643 enum { | |
644 ColormapUninstalled = 0, | |
645 ColormapInstalled = 1 | |
646 } | |
647 | |
648 enum { | |
649 GrabModeSync = 0, | |
650 GrabModeAsync = 1 | |
651 } | |
652 | |
653 enum { | |
654 GrabSuccess = 0, | |
655 AlreadyGrabbed = 1, | |
656 GrabInvalidTime = 2, | |
657 GrabNotViewable = 3, | |
658 GrabFrozen = 4 | |
659 } | |
660 | |
661 enum { | |
662 AsyncPointer = 0, | |
663 SyncPointer = 1, | |
664 ReplayPointer = 2, | |
665 AsyncKeyboard = 3, | |
666 SyncKeyboard = 4, | |
667 ReplayKeyboard = 5, | |
668 AsyncBoth = 6, | |
669 SyncBoth = 7 | |
670 } | |
671 | |
672 enum { | |
673 RevertToNone = None, | |
674 RevertToPointerRoot = PointerRoot, | |
675 RevertToParent = 2 | |
676 } | |
677 | |
678 enum { | |
679 InputOutput = 1, | |
680 InputOnly = 2 | |
681 } | |
682 | |
683 enum { | |
684 CWBackPixmap = 1 << 0, | |
685 CWBackPixel = 1 << 1, | |
686 CWBorderPixmap = 1 << 2, | |
687 CWBorderPixel = 1 << 3, | |
688 CWBitGravity = 1 << 4, | |
689 CWWinGravity = 1 << 5, | |
690 CWBackingStore = 1 << 6, | |
691 CWBackingPlanes = 1 << 7, | |
692 CWBackingPixel = 1 << 8, | |
693 CWOverrideRedirect = 1 << 9, | |
694 CWSaveUnder = 1 << 10, | |
695 CWEventMask = 1 << 11, | |
696 CWDontPropagate = 1 << 12, | |
697 CWColormap = 1 << 13, | |
698 CWCursor = 1 << 14, | |
699 } | |
700 | |
701 enum { | |
702 CWX = 1 << 0, | |
703 CWY = 1 << 1, | |
704 CWWidth = 1 << 2, | |
705 CWHeight = 1 << 3, | |
706 CWBorderWidth = 1 << 4, | |
707 CWSibling = 1 << 5, | |
708 CWStackMode = 1 << 6 | |
709 } | |
710 | |
711 enum { | |
712 ForgetGravity = 0, | |
713 NorthWestGravity = 1, | |
714 NorthGravity = 2, | |
715 NorthEastGravity = 3, | |
716 WestGravity = 4, | |
717 CenterGravity = 5, | |
718 EastGravity = 6, | |
719 SouthWestGravity = 7, | |
720 SouthGravity = 8, | |
721 SouthEastGravity = 9, | |
722 StaticGravity = 10 | |
723 } | |
724 | |
725 enum { | |
726 UnmapGravity = 0 | |
727 } | |
728 | |
729 enum { | |
730 NotUseful = 0, | |
731 WhenMapped = 1, | |
732 Always = 2 | |
733 } | |
734 | |
735 enum { | |
736 IsUnmapped = 0, | |
737 IsUnviewable = 1, | |
738 IsViewable = 2 | |
739 } | |
740 | |
741 enum { | |
742 SetModeInsert = 0, | |
743 SetModeDelete = 1 | |
744 } | |
745 | |
746 enum { | |
747 DestroyAll = 0, | |
748 RetainPermanent = 1, | |
749 RetainTemporary = 2 | |
750 } | |
751 | |
752 enum { | |
753 Above = 0, | |
754 Below = 1, | |
755 TopIf = 2, | |
756 BottomIf = 3, | |
757 Opposite = 4 | |
758 } | |
759 | |
760 enum { | |
761 RaiseLowest = 0, | |
762 LowerHighest = 1 | |
763 } | |
764 | |
765 enum { | |
766 PropModeReplace = 0, | |
767 PropModePrepend = 1, | |
768 PropModeAppend = 2 | |
769 } | |
770 //}}} | |
771 | |
772 struct XSizeHints { | |
773 int flags; | |
774 int x, y; | |
775 int width, height; | |
776 int min_width, min_height; | |
777 int max_width, max_height; | |
778 int width_inc, height_inc; | |
779 struct _aspect { | |
780 int x; | |
781 int y; | |
782 } | |
783 _aspect min_aspect, max_aspect; | |
784 int base_width, base_height; | |
785 int win_gravity; | |
786 } | |
787 | |
788 struct XWMHints { | |
789 int flags; | |
790 Bool input; | |
791 int initial_state; | |
792 Pixmap icon_pixmap; | |
793 Window icon_window; | |
794 int icon_x, icon_y; | |
795 Pixmap icon_mask; | |
796 XID window_group; | |
797 } | |
798 | |
799 struct XTextProperty { | |
800 char* value; | |
801 Atom encoding; | |
802 int format; | |
803 uint nitems; | |
804 } | |
805 | |
806 struct XColor { | |
807 uint pixel; | |
808 ushort red, green, blue; | |
809 ubyte flags; | |
810 ubyte pad; | |
811 } | |
812 | |
813 struct Visual { | |
814 XExtData* ext_data; | |
815 VisualID visualid; | |
816 int c_class; | |
817 uint red_mask, green_mask, blue_mask; | |
818 int bits_per_rgb; | |
819 int map_entries; | |
820 } | |
821 | |
822 struct XExtCodes { | |
823 int extension; | |
824 int major_opcode; | |
825 int first_event; | |
826 int first_error; | |
827 } | |
828 | |
829 struct XExtData { | |
830 int number; | |
831 XExtData* next; | |
832 int function(XExtData* extension) free_private; | |
833 XPointer private_data; | |
834 } | |
835 | |
836 struct XSetWindowAttributes { | |
837 Pixmap background_pixmap; | |
838 uint background_pixel; | |
839 Pixmap border_pixmap; | |
840 uint border_pixel; | |
841 int bit_gravity; | |
842 int win_gravity; | |
843 int backing_store; | |
844 uint backing_planes; | |
845 uint backing_pixel; | |
846 Bool save_under; | |
847 int event_mask; | |
848 int do_not_propagate_mask; | |
849 Bool override_redirect; | |
850 Colormap colormap; | |
851 Cursor cursor; | |
852 } | |
853 | |
854 struct XWindowAttributes { | |
855 int x, y; | |
856 int width, height; | |
857 int border_width; | |
858 int depth; | |
859 Visual* visual; | |
860 Window root; | |
861 int c_class; | |
862 int bit_gravity; | |
863 int win_gravity; | |
864 int backing_store; | |
865 uint backing_planes; | |
866 uint backing_pixel; | |
867 Bool save_under; | |
868 Colormap colormap; | |
869 Bool map_installed; | |
870 int map_state; | |
871 int all_event_masks; | |
872 int your_event_mask; | |
873 int do_not_propagate_mask; | |
874 Bool override_redirect; | |
875 Screen* screen; | |
876 } | |
877 | |
878 //{{{ events | |
879 struct XKeyEvent { | |
880 int type; | |
881 uint serial; | |
882 Bool send_event; | |
883 Display* display; | |
884 Window window; | |
885 Window root; | |
886 Window subwindow; | |
887 Time time; | |
888 int x, y; | |
889 int x_root, y_root; | |
890 uint state; | |
891 uint keycode; | |
892 Bool same_screen; | |
893 } | |
894 alias XKeyEvent XKeyPressedEvent; | |
895 alias XKeyEvent XKeyReleasedEvent; | |
896 | |
897 struct XButtonEvent { | |
898 int type; | |
899 uint serial; | |
900 Bool send_event; | |
901 Display* display; | |
902 Window window; | |
903 Window root; | |
904 Window subwindow; | |
905 Time time; | |
906 int x, y; | |
907 int x_root, y_root; | |
908 uint state; | |
909 uint button; | |
910 Bool same_screen; | |
911 } | |
912 alias XButtonEvent XButtonPressedEvent; | |
913 alias XButtonEvent XButtonReleasedEvent; | |
914 | |
915 | |
916 struct XMotionEvent { | |
917 int type; | |
918 uint serial; | |
919 Bool send_event; | |
920 Display* display; | |
921 Window window; | |
922 Window root; | |
923 Window subwindow; | |
924 Time time; | |
925 int x, y; | |
926 int x_root, y_root; | |
927 uint state; | |
928 char is_hint; | |
929 Bool same_screen; | |
930 } | |
931 alias XMotionEvent XPointerMovedEvent; | |
932 | |
933 struct XCrossingEvent { | |
934 int type; | |
935 uint serial; | |
936 Bool send_event; | |
937 Display* display; | |
938 Window window; | |
939 Window root; | |
940 Window subwindow; | |
941 Time time; | |
942 int x, y; | |
943 int x_root, y_root; | |
944 int mode; | |
945 int detail; | |
946 Bool same_screen; | |
947 Bool focus; | |
948 uint state; | |
949 } | |
950 alias XCrossingEvent XEnterWindowEvent; | |
951 alias XCrossingEvent XLeaveWindowEvent; | |
952 | |
953 struct XFocusChangeEvent { | |
954 int type; | |
955 uint serial; | |
956 Bool send_event; | |
957 Display* display; | |
958 Window window; | |
959 int mode; | |
960 int detail; | |
961 } | |
962 alias XFocusChangeEvent XFocusInEvent; | |
963 alias XFocusChangeEvent XFocusOutEvent; | |
964 | |
965 struct XKeymapEvent { | |
966 int type; | |
967 uint serial; | |
968 Bool send_event; | |
969 Display* display; | |
970 Window window; | |
971 char key_vector[32]; | |
972 } | |
973 | |
974 struct XExposeEvent { | |
975 int type; | |
976 uint serial; | |
977 Bool send_event; | |
978 Display* display; | |
979 Window window; | |
980 int x, y; | |
981 int width, height; | |
982 int count; | |
983 } | |
984 | |
985 struct XGraphicsExposeEvent { | |
986 int type; | |
987 uint serial; | |
988 Bool send_event; | |
989 Display* display; | |
990 Drawable drawable; | |
991 int x, y; | |
992 int width, height; | |
993 int count; | |
994 int major_code; | |
995 int minor_code; | |
996 } | |
997 | |
998 struct XNoExposeEvent { | |
999 int type; | |
1000 uint serial; | |
1001 Bool send_event; | |
1002 Display* display; | |
1003 Drawable drawable; | |
1004 int major_code; | |
1005 int minor_code; | |
1006 } | |
1007 | |
1008 struct XVisibilityEvent { | |
1009 int type; | |
1010 uint serial; | |
1011 Bool send_event; | |
1012 Display* display; | |
1013 Window window; | |
1014 int state; | |
1015 } | |
1016 | |
1017 struct XCreateWindowEvent { | |
1018 int type; | |
1019 uint serial; | |
1020 Bool send_event; | |
1021 Display* display; | |
1022 Window parent; | |
1023 Window window; | |
1024 int x, y; | |
1025 int width, height; | |
1026 int border_width; | |
1027 Bool override_redirect; | |
1028 } | |
1029 | |
1030 struct XDestroyWindowEvent { | |
1031 int type; | |
1032 uint serial; | |
1033 Bool send_event; | |
1034 Display* display; | |
1035 Window event; | |
1036 Window window; | |
1037 } | |
1038 | |
1039 struct XUnmapEvent { | |
1040 int type; | |
1041 uint serial; | |
1042 Bool send_event; | |
1043 Display* display; | |
1044 Window event; | |
1045 Window window; | |
1046 Bool from_configure; | |
1047 } | |
1048 | |
1049 struct XMapEvent { | |
1050 int type; | |
1051 uint serial; | |
1052 Bool send_event; | |
1053 Display* display; | |
1054 Window event; | |
1055 Window window; | |
1056 Bool override_redirect; | |
1057 } | |
1058 | |
1059 struct XMapRequestEvent { | |
1060 int type; | |
1061 uint serial; | |
1062 Bool send_event; | |
1063 Display* display; | |
1064 Window parent; | |
1065 Window window; | |
1066 } | |
1067 | |
1068 struct XReparentEvent { | |
1069 int type; | |
1070 uint serial; | |
1071 Bool send_event; | |
1072 Display* display; | |
1073 Window event; | |
1074 Window window; | |
1075 Window parent; | |
1076 int x, y; | |
1077 Bool override_redirect; | |
1078 } | |
1079 | |
1080 struct XConfigureEvent { | |
1081 int type; | |
1082 uint serial; | |
1083 Bool send_event; | |
1084 Display* display; | |
1085 Window event; | |
1086 Window window; | |
1087 int x, y; | |
1088 int width, height; | |
1089 int border_width; | |
1090 Window above; | |
1091 Bool override_redirect; | |
1092 } | |
1093 | |
1094 struct XGravityEvent { | |
1095 int type; | |
1096 uint serial; | |
1097 Bool send_event; | |
1098 Display* display; | |
1099 Window event; | |
1100 Window window; | |
1101 int x, y; | |
1102 } | |
1103 | |
1104 struct XResizeRequestEvent { | |
1105 int type; | |
1106 uint serial; | |
1107 Bool send_event; | |
1108 Display* display; | |
1109 Window window; | |
1110 int width, height; | |
1111 } | |
1112 | |
1113 struct XConfigureRequestEvent { | |
1114 int type; | |
1115 uint serial; | |
1116 Bool send_event; | |
1117 Display* display; | |
1118 Window parent; | |
1119 Window window; | |
1120 int x, y; | |
1121 int width, height; | |
1122 int border_width; | |
1123 Window above; | |
1124 int detail; | |
1125 uint value_mask; | |
1126 } | |
1127 | |
1128 struct XCirculateEvent { | |
1129 int type; | |
1130 uint serial; | |
1131 Bool send_event; | |
1132 Display* display; | |
1133 Window event; | |
1134 Window window; | |
1135 int place; | |
1136 } | |
1137 | |
1138 struct XCirculateRequestEvent { | |
1139 int type; | |
1140 uint serial; | |
1141 Bool send_event; | |
1142 Display* display; | |
1143 Window parent; | |
1144 Window window; | |
1145 int place; | |
1146 } | |
1147 | |
1148 struct XPropertyEvent { | |
1149 int type; | |
1150 uint serial; | |
1151 Bool send_event; | |
1152 Display* display; | |
1153 Window window; | |
1154 Atom atom; | |
1155 Time time; | |
1156 int state; | |
1157 } | |
1158 | |
1159 struct XSelectionClearEvent { | |
1160 int type; | |
1161 uint serial; | |
1162 Bool send_event; | |
1163 Display* display; | |
1164 Window window; | |
1165 Atom selection; | |
1166 Time time; | |
1167 } | |
1168 | |
1169 struct XSelectionRequestEvent { | |
1170 int type; | |
1171 uint serial; | |
1172 Bool send_event; | |
1173 Display* display; | |
1174 Window owner; | |
1175 Window requestor; | |
1176 Atom selection; | |
1177 Atom target; | |
1178 Atom property; | |
1179 Time time; | |
1180 } | |
1181 | |
1182 struct XSelectionEvent { | |
1183 int type; | |
1184 uint serial; | |
1185 Bool send_event; | |
1186 Display* display; | |
1187 Window requestor; | |
1188 Atom selection; | |
1189 Atom target; | |
1190 Atom property; | |
1191 Time time; | |
1192 } | |
1193 | |
1194 struct XColormapEvent { | |
1195 int type; | |
1196 uint serial; | |
1197 Bool send_event; | |
1198 Display* display; | |
1199 Window window; | |
1200 Colormap colormap; | |
1201 Bool is_new; | |
1202 int state; | |
1203 } | |
1204 | |
1205 struct XClientMessageEvent { | |
1206 int type; | |
1207 uint serial; | |
1208 Bool send_event; | |
1209 Display* display; | |
1210 Window window; | |
1211 Atom message_type; | |
1212 int format; | |
1213 union _data { | |
1214 char[20] b; | |
1215 short[10] s; | |
1216 int[5] l; | |
1217 } | |
1218 _data data; | |
1219 } | |
1220 | |
1221 struct XMappingEvent { | |
1222 int type; | |
1223 uint serial; | |
1224 Bool send_event; | |
1225 Display* display; | |
1226 Window window; | |
1227 int request; | |
1228 int first_keycode; | |
1229 int count; | |
1230 } | |
1231 | |
1232 struct XErrorEvent { | |
1233 int type; | |
1234 Display* display; | |
1235 XID resourceid; | |
1236 uint serial; | |
1237 ubyte error_code; | |
1238 ubyte request_code; | |
1239 ubyte minor_code; | |
1240 } | |
1241 | |
1242 struct XAnyEvent { | |
1243 int type; | |
1244 uint serial; | |
1245 Bool send_event; | |
1246 Display* display; | |
1247 Window window; | |
1248 } | |
1249 | |
1250 union XEvent { | |
1251 int type; | |
1252 XAnyEvent xany; | |
1253 XKeyEvent xkey; | |
1254 XButtonEvent xbutton; | |
1255 XMotionEvent xmotion; | |
1256 XCrossingEvent xcrossing; | |
1257 XFocusChangeEvent xfocus; | |
1258 XExposeEvent xexpose; | |
1259 XGraphicsExposeEvent xgraphicsexpose; | |
1260 XNoExposeEvent xnoexpose; | |
1261 XVisibilityEvent xvisibility; | |
1262 XCreateWindowEvent xcreatewindow; | |
1263 XDestroyWindowEvent xdestroywindow; | |
1264 XUnmapEvent xunmap; | |
1265 XMapEvent xmap; | |
1266 XMapRequestEvent xmaprequest; | |
1267 XReparentEvent xreparent; | |
1268 XConfigureEvent xconfigure; | |
1269 XGravityEvent xgravity; | |
1270 XResizeRequestEvent xresizerequest; | |
1271 XConfigureRequestEvent xconfigurerequest; | |
1272 XCirculateEvent xcirculate; | |
1273 XCirculateRequestEvent xcirculaterequest; | |
1274 XPropertyEvent xproperty; | |
1275 XSelectionClearEvent xselectionclear; | |
1276 XSelectionRequestEvent xselectionrequest; | |
1277 XSelectionEvent xselection; | |
1278 XColormapEvent xcolormap; | |
1279 XClientMessageEvent xclient; | |
1280 XMappingEvent xmapping; | |
1281 XErrorEvent xerror; | |
1282 XKeymapEvent xkeymap; | |
1283 int pad[24]; | |
1284 } | |
1285 //}}} | |
1286 | |
1287 //{{{ event types | |
1288 enum { | |
1289 KeyPress = 2, | |
1290 KeyRelease = 3, | |
1291 ButtonPress = 4, | |
1292 ButtonRelease = 5, | |
1293 MotionNotify = 6, | |
1294 EnterNotify = 7, | |
1295 LeaveNotify = 8, | |
1296 FocusIn = 9, | |
1297 FocusOut = 10, | |
1298 KeymapNotify = 11, | |
1299 Expose = 12, | |
1300 GraphicsExpose = 13, | |
1301 NoExpose = 14, | |
1302 VisibilityNotify = 15, | |
1303 CreateNotify = 16, | |
1304 DestroyNotify = 17, | |
1305 UnmapNotify = 18, | |
1306 MapNotify = 19, | |
1307 MapRequest = 20, | |
1308 ReparentNotify = 21, | |
1309 ConfigureNotify = 22, | |
1310 ConfigureRequest = 23, | |
1311 GravityNotify = 24, | |
1312 ResizeRequest = 25, | |
1313 CirculateNotify = 26, | |
1314 CirculateRequest = 27, | |
1315 PropertyNotify = 28, | |
1316 SelectionClear = 29, | |
1317 SelectionRequest = 30, | |
1318 SelectionNotify = 31, | |
1319 ColormapNotify = 32, | |
1320 ClientMessage = 33, | |
1321 MappingNotify = 34, | |
1322 LASTEvent = 35 // must be bigger than any event # | |
1323 } | |
1324 //}}} | |
1325 | |
1326 //{{{ event masks | |
1327 enum { | |
1328 NoEventMask = 0, | |
1329 KeyPressMask = 1 << 0, | |
1330 KeyReleaseMask = 1 << 1, | |
1331 ButtonPressMask = 1 << 2, | |
1332 ButtonReleaseMask = 1 << 3, | |
1333 EnterWindowMask = 1 << 4, | |
1334 LeaveWindowMask = 1 << 5, | |
1335 PointerMotionMask = 1 << 6, | |
1336 PointerMotionHintMask = 1 << 7, | |
1337 Button1MotionMask = 1 << 8, | |
1338 Button2MotionMask = 1 << 9, | |
1339 Button3MotionMask = 1 << 10, | |
1340 Button4MotionMask = 1 << 11, | |
1341 Button5MotionMask = 1 << 12, | |
1342 ButtonMotionMask = 1 << 13, | |
1343 KeymapStateMask = 1 << 14, | |
1344 ExposureMask = 1 << 15, | |
1345 VisibilityChangeMask = 1 << 16, | |
1346 StructureNotifyMask = 1 << 17, | |
1347 ResizeRedirectMask = 1 << 18, | |
1348 SubstructureNotifyMask = 1 << 19, | |
1349 SubstructureRedirectMask = 1 << 20, | |
1350 FocusChangeMask = 1 << 21, | |
1351 PropertyChangeMask = 1 << 22, | |
1352 ColormapChangeMask = 1 << 23, | |
1353 OwnerGrabButtonMask = 1 << 24 | |
1354 } | |
1355 //}}} | |
1356 | |
1357 //{{{ keys | |
1358 enum { | |
1359 XK_BackSpace = 0xFF08, | |
1360 XK_Tab = 0xFF09, | |
1361 XK_Linefeed = 0xFF0A, | |
1362 XK_Clear = 0xFF0B, | |
1363 XK_Return = 0xFF0D, | |
1364 XK_Pause = 0xFF13, | |
1365 XK_Scroll_Lock = 0xFF14, | |
1366 XK_Sys_Req = 0xFF15, | |
1367 XK_Escape = 0xFF1B, | |
1368 XK_Delete = 0xFFFF, | |
1369 | |
1370 XK_Home = 0xFF50, | |
1371 XK_Left = 0xFF51, | |
1372 XK_Up = 0xFF52, | |
1373 XK_Right = 0xFF53, | |
1374 XK_Down = 0xFF54, | |
1375 XK_Prior = 0xFF55, | |
1376 XK_Page_Up = 0xFF55, | |
1377 XK_Next = 0xFF56, | |
1378 XK_Page_Down = 0xFF56, | |
1379 XK_End = 0xFF57, | |
1380 XK_Begin = 0xFF58, | |
1381 | |
1382 XK_Select = 0xFF60, | |
1383 XK_Print = 0xFF61, | |
1384 XK_Execute = 0xFF62, | |
1385 XK_Insert = 0xFF63, | |
1386 XK_Undo = 0xFF65, | |
1387 XK_Redo = 0xFF66, | |
1388 XK_Menu = 0xFF67, | |
1389 XK_Find = 0xFF68, | |
1390 XK_Cancel = 0xFF69, | |
1391 XK_Help = 0xFF6A, | |
1392 XK_Break = 0xFF6B, | |
1393 XK_Mode_switch = 0xFF7E, | |
1394 XK_script_switch = 0xFF7E, | |
1395 XK_Num_Lock = 0xFF7F, | |
1396 | |
1397 XK_KP_Space = 0xFF80, | |
1398 XK_KP_Tab = 0xFF89, | |
1399 XK_KP_Enter = 0xFF8D, | |
1400 XK_KP_F1 = 0xFF91, | |
1401 XK_KP_F2 = 0xFF92, | |
1402 XK_KP_F3 = 0xFF93, | |
1403 XK_KP_F4 = 0xFF94, | |
1404 XK_KP_Home = 0xFF95, | |
1405 XK_KP_Left = 0xFF96, | |
1406 XK_KP_Up = 0xFF97, | |
1407 XK_KP_Right = 0xFF98, | |
1408 XK_KP_Down = 0xFF99, | |
1409 XK_KP_Prior = 0xFF9A, | |
1410 XK_KP_Page_Up = 0xFF9A, | |
1411 XK_KP_Next = 0xFF9B, | |
1412 XK_KP_Page_Down = 0xFF9B, | |
1413 XK_KP_End = 0xFF9C, | |
1414 XK_KP_Begin = 0xFF9D, | |
1415 XK_KP_Insert = 0xFF9E, | |
1416 XK_KP_Delete = 0xFF9F, | |
1417 XK_KP_Equal = 0xFFBD, | |
1418 XK_KP_Multiply = 0xFFAA, | |
1419 XK_KP_Add = 0xFFAB, | |
1420 XK_KP_Separator = 0xFFAC, | |
1421 XK_KP_Subtract = 0xFFAD, | |
1422 XK_KP_Decimal = 0xFFAE, | |
1423 XK_KP_Divide = 0xFFAF, | |
1424 | |
1425 XK_KP_0 = 0xFFB0, | |
1426 XK_KP_1 = 0xFFB1, | |
1427 XK_KP_2 = 0xFFB2, | |
1428 XK_KP_3 = 0xFFB3, | |
1429 XK_KP_4 = 0xFFB4, | |
1430 XK_KP_5 = 0xFFB5, | |
1431 XK_KP_6 = 0xFFB6, | |
1432 XK_KP_7 = 0xFFB7, | |
1433 XK_KP_8 = 0xFFB8, | |
1434 XK_KP_9 = 0xFFB9, | |
1435 | |
1436 XK_F1 = 0xFFBE, | |
1437 XK_F2 = 0xFFBF, | |
1438 XK_F3 = 0xFFC0, | |
1439 XK_F4 = 0xFFC1, | |
1440 XK_F5 = 0xFFC2, | |
1441 XK_F6 = 0xFFC3, | |
1442 XK_F7 = 0xFFC4, | |
1443 XK_F8 = 0xFFC5, | |
1444 XK_F9 = 0xFFC6, | |
1445 XK_F10 = 0xFFC7, | |
1446 XK_F11 = 0xFFC8, | |
1447 XK_L1 = 0xFFC8, | |
1448 XK_F12 = 0xFFC9, | |
1449 XK_L2 = 0xFFC9, | |
1450 XK_F13 = 0xFFCA, | |
1451 XK_L3 = 0xFFCA, | |
1452 XK_F14 = 0xFFCB, | |
1453 XK_L4 = 0xFFCB, | |
1454 XK_F15 = 0xFFCC, | |
1455 XK_L5 = 0xFFCC, | |
1456 XK_F16 = 0xFFCD, | |
1457 XK_L6 = 0xFFCD, | |
1458 XK_F17 = 0xFFCE, | |
1459 XK_L7 = 0xFFCE, | |
1460 XK_F18 = 0xFFCF, | |
1461 XK_L8 = 0xFFCF, | |
1462 XK_F19 = 0xFFD0, | |
1463 XK_L9 = 0xFFD0, | |
1464 XK_F20 = 0xFFD1, | |
1465 XK_L10 = 0xFFD1, | |
1466 XK_F21 = 0xFFD2, | |
1467 XK_R1 = 0xFFD2, | |
1468 XK_F22 = 0xFFD3, | |
1469 XK_R2 = 0xFFD3, | |
1470 XK_F23 = 0xFFD4, | |
1471 XK_R3 = 0xFFD4, | |
1472 XK_F24 = 0xFFD5, | |
1473 XK_R4 = 0xFFD5, | |
1474 XK_F25 = 0xFFD6, | |
1475 XK_R5 = 0xFFD6, | |
1476 XK_F26 = 0xFFD7, | |
1477 XK_R6 = 0xFFD7, | |
1478 XK_F27 = 0xFFD8, | |
1479 XK_R7 = 0xFFD8, | |
1480 XK_F28 = 0xFFD9, | |
1481 XK_R8 = 0xFFD9, | |
1482 XK_F29 = 0xFFDA, | |
1483 XK_R9 = 0xFFDA, | |
1484 XK_F30 = 0xFFDB, | |
1485 XK_R10 = 0xFFDB, | |
1486 XK_F31 = 0xFFDC, | |
1487 XK_R11 = 0xFFDC, | |
1488 XK_F32 = 0xFFDD, | |
1489 XK_R12 = 0xFFDD, | |
1490 XK_F33 = 0xFFDE, | |
1491 XK_R13 = 0xFFDE, | |
1492 XK_F34 = 0xFFDF, | |
1493 XK_R14 = 0xFFDF, | |
1494 XK_F35 = 0xFFE0, | |
1495 XK_R15 = 0xFFE0, | |
1496 | |
1497 XK_Shift_L = 0xFFE1, | |
1498 XK_Shift_R = 0xFFE2, | |
1499 XK_Control_L = 0xFFE3, | |
1500 XK_Control_R = 0xFFE4, | |
1501 XK_Caps_Lock = 0xFFE5, | |
1502 XK_Shift_Lock = 0xFFE6, | |
1503 | |
1504 XK_Meta_L = 0xFFE7, | |
1505 XK_Meta_R = 0xFFE8, | |
1506 XK_Alt_L = 0xFFE9, | |
1507 XK_Alt_R = 0xFFEA, | |
1508 XK_Super_L = 0xFFEB, | |
1509 XK_Super_R = 0xFFEC, | |
1510 XK_Hyper_L = 0xFFED, | |
1511 XK_Hyper_R = 0xFFEE, | |
1512 | |
1513 XK_space = 0x020, | |
1514 XK_exclam = 0x021, | |
1515 XK_quotedbl = 0x022, | |
1516 XK_numbersign = 0x023, | |
1517 XK_dollar = 0x024, | |
1518 XK_percent = 0x025, | |
1519 XK_ampersand = 0x026, | |
1520 XK_apostrophe = 0x027, | |
1521 XK_quoteright = 0x027, | |
1522 XK_parenleft = 0x028, | |
1523 XK_parenright = 0x029, | |
1524 XK_asterisk = 0x02A, | |
1525 XK_plus = 0x02B, | |
1526 XK_comma = 0x02C, | |
1527 XK_minus = 0x02D, | |
1528 XK_period = 0x02E, | |
1529 XK_slash = 0x02F, | |
1530 XK_0 = 0x030, | |
1531 XK_1 = 0x031, | |
1532 XK_2 = 0x032, | |
1533 XK_3 = 0x033, | |
1534 XK_4 = 0x034, | |
1535 XK_5 = 0x035, | |
1536 XK_6 = 0x036, | |
1537 XK_7 = 0x037, | |
1538 XK_8 = 0x038, | |
1539 XK_9 = 0x039, | |
1540 XK_colon = 0x03A, | |
1541 XK_semicolon = 0x03B, | |
1542 XK_less = 0x03C, | |
1543 XK_equal = 0x03D, | |
1544 XK_greater = 0x03E, | |
1545 XK_question = 0x03F, | |
1546 XK_at = 0x040, | |
1547 XK_A = 0x041, | |
1548 XK_B = 0x042, | |
1549 XK_C = 0x043, | |
1550 XK_D = 0x044, | |
1551 XK_E = 0x045, | |
1552 XK_F = 0x046, | |
1553 XK_G = 0x047, | |
1554 XK_H = 0x048, | |
1555 XK_I = 0x049, | |
1556 XK_J = 0x04A, | |
1557 XK_K = 0x04B, | |
1558 XK_L = 0x04C, | |
1559 XK_M = 0x04D, | |
1560 XK_N = 0x04E, | |
1561 XK_O = 0x04F, | |
1562 XK_P = 0x050, | |
1563 XK_Q = 0x051, | |
1564 XK_R = 0x052, | |
1565 XK_S = 0x053, | |
1566 XK_T = 0x054, | |
1567 XK_U = 0x055, | |
1568 XK_V = 0x056, | |
1569 XK_W = 0x057, | |
1570 XK_X = 0x058, | |
1571 XK_Y = 0x059, | |
1572 XK_Z = 0x05A, | |
1573 XK_bracketleft = 0x05B, | |
1574 XK_backslash = 0x05C, | |
1575 XK_bracketright = 0x05D, | |
1576 XK_asciicircum = 0x05E, | |
1577 XK_underscore = 0x05F, | |
1578 XK_grave = 0x060, | |
1579 XK_quoteleft = 0x060, | |
1580 XK_a = 0x061, | |
1581 XK_b = 0x062, | |
1582 XK_c = 0x063, | |
1583 XK_d = 0x064, | |
1584 XK_e = 0x065, | |
1585 XK_f = 0x066, | |
1586 XK_g = 0x067, | |
1587 XK_h = 0x068, | |
1588 XK_i = 0x069, | |
1589 XK_j = 0x06A, | |
1590 XK_k = 0x06B, | |
1591 XK_l = 0x06C, | |
1592 XK_m = 0x06D, | |
1593 XK_n = 0x06E, | |
1594 XK_o = 0x06F, | |
1595 XK_p = 0x070, | |
1596 XK_q = 0x071, | |
1597 XK_r = 0x072, | |
1598 XK_s = 0x073, | |
1599 XK_t = 0x074, | |
1600 XK_u = 0x075, | |
1601 XK_v = 0x076, | |
1602 XK_w = 0x077, | |
1603 XK_x = 0x078, | |
1604 XK_y = 0x079, | |
1605 XK_z = 0x07A, | |
1606 XK_braceleft = 0x07B, | |
1607 XK_bar = 0x07C, | |
1608 XK_braceright = 0x07D, | |
1609 XK_asciitilde = 0x07E | |
1610 } | |
1611 //}}} | |
1612 |