~brian-murray/lightdm/bug-967229

« back to all changes in this revision

Viewing changes to tests/src/x-server.h

  • Committer: Sebastien Bacher
  • Date: 2012-01-18 09:21:40 UTC
  • mfrom: (1007.1.355 lightdm)
  • mto: This revision was merged to the branch mainline in revision 1056.
  • Revision ID: seb128@ubuntu.com-20120118092140-fhyj1fmiouth227t
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _X_SERVER_H_
 
2
#define _X_SERVER_H_
 
3
 
 
4
#include <glib-object.h>
 
5
#include <gio/gio.h>
 
6
 
 
7
G_BEGIN_DECLS
 
8
 
 
9
#define X_PROTOCOL_MAJOR_VERSION 11
 
10
#define X_PROTOCOL_MINOR_VERSION 0
 
11
 
 
12
#define X_RELEASE_NUMBER 0
 
13
 
 
14
typedef enum
 
15
{
 
16
    X_EVENT_KeyPress             = 0x00000001,
 
17
    X_EVENT_KeyRelease           = 0x00000002,
 
18
    X_EVENT_ButtonPress          = 0x00000004,
 
19
    X_EVENT_ButtonRelease        = 0x00000008,
 
20
    X_EVENT_EnterWindow          = 0x00000010,
 
21
    X_EVENT_LeaveWindow          = 0x00000020,
 
22
    X_EVENT_PointerMotion        = 0x00000040,
 
23
    X_EVENT_PointerMotionHint    = 0x00000080,
 
24
    X_EVENT_Button1Motion        = 0x00000100,
 
25
    X_EVENT_Button2Motion        = 0x00000200,
 
26
    X_EVENT_Button3Motion        = 0x00000400,
 
27
    X_EVENT_Button4Motion        = 0x00000800,
 
28
    X_EVENT_Button5Motion        = 0x00001000,
 
29
    X_EVENT_ButtonMotion         = 0x00002000,
 
30
    X_EVENT_KeymapState          = 0x00004000,
 
31
    X_EVENT_Exposure             = 0x00008000,
 
32
    X_EVENT_VisibilityChange     = 0x00010000,
 
33
    X_EVENT_StructureNotify      = 0x00020000,
 
34
    X_EVENT_ResizeRedirect       = 0x00040000,
 
35
    X_EVENT_SubstructureNotify   = 0x00080000,
 
36
    X_EVENT_SubstructureRedirect = 0x00100000,
 
37
    X_EVENT_FocusChange          = 0x00200000,
 
38
    X_EVENT_PropertyChange       = 0x00400000,
 
39
    X_EVENT_ColormapChange       = 0x00800000,
 
40
    X_EVENT_OwnerGrabButton      = 0x01000000
 
41
} XEvent;
 
42
 
 
43
enum
 
44
{
 
45
    X_GC_VALUE_MASK_function              = 0x00000001,
 
46
    X_GC_VALUE_MASK_plane_mask            = 0x00000002,
 
47
    X_GC_VALUE_MASK_foreground            = 0x00000004,
 
48
    X_GC_VALUE_MASK_background            = 0x00000008,
 
49
    X_GC_VALUE_MASK_line_width            = 0x00000010,
 
50
    X_GC_VALUE_MASK_line_style            = 0x00000020,
 
51
    X_GC_VALUE_MASK_cap_style             = 0x00000040,
 
52
    X_GC_VALUE_MASK_join_style            = 0x00000080,
 
53
    X_GC_VALUE_MASK_fill_style            = 0x00000100,
 
54
    X_GC_VALUE_MASK_fill_rule             = 0x00000200,
 
55
    X_GC_VALUE_MASK_tile                  = 0x00000400,
 
56
    X_GC_VALUE_MASK_stipple               = 0x00000800,
 
57
    X_GC_VALUE_MASK_tile_stipple_x_origin = 0x00001000,
 
58
    X_GC_VALUE_MASK_tile_stipple_y_origin = 0x00002000,
 
59
    X_GC_VALUE_MASK_font                  = 0x00004000,
 
60
    X_GC_VALUE_MASK_subwindow_mode        = 0x00008000,
 
61
    X_GC_VALUE_MASK_graphics_exposures    = 0x00010000,
 
62
    X_GC_VALUE_MASK_clip_x_origin         = 0x00020000,
 
63
    X_GC_VALUE_MASK_clip_y_origin         = 0x00040000,
 
64
    X_GC_VALUE_MASK_clip_mask             = 0x00080000,
 
65
    X_GC_VALUE_MASK_dash_offset           = 0x00100000,
 
66
    X_GC_VALUE_MASK_dashes                = 0x00200000,
 
67
    X_GC_VALUE_MASK_arc_mode              = 0x00400000
 
68
} XGCValueMask;
 
69
 
 
70
typedef enum
 
71
{
 
72
    X_WINDOW_VALUE_MASK_background_pixmap     = 0x00000001,
 
73
    X_WINDOW_VALUE_MASK_background_pixel      = 0x00000002,
 
74
    X_WINDOW_VALUE_MASK_border_pixmap         = 0x00000004,
 
75
    X_WINDOW_VALUE_MASK_border_pixel          = 0x00000008,
 
76
    X_WINDOW_VALUE_MASK_bit_gravity           = 0x00000010,
 
77
    X_WINDOW_VALUE_MASK_win_gravity           = 0x00000020,
 
78
    X_WINDOW_VALUE_MASK_backing_store         = 0x00000040,
 
79
    X_WINDOW_VALUE_MASK_backing_planes        = 0x00000080,
 
80
    X_WINDOW_VALUE_MASK_backing_pixel         = 0x00000100,
 
81
    X_WINDOW_VALUE_MASK_override_redirect     = 0x00000200,
 
82
    X_WINDOW_VALUE_MASK_save_under            = 0x00000400,
 
83
    X_WINDOW_VALUE_MASK_event_mask            = 0x00000800,
 
84
    X_WINDOW_VALUE_MASK_do_not_propagate_mask = 0x00001000,
 
85
    X_WINDOW_VALUE_MASK_colormap              = 0x00002000,
 
86
    X_WINDOW_VALUE_MASK_cursor                = 0x00004000
 
87
} XCreateWindowValueMask;
 
88
 
 
89
typedef enum {
 
90
    X_CONFIGURE_WINDOW_VALUE_MASK_x            = 0x0001,
 
91
    X_CONFIGURE_WINDOW_VALUE_MASK_y            = 0x0002,
 
92
    X_CONFIGURE_WINDOW_VALUE_MASK_width        = 0x0004,
 
93
    X_CONFIGURE_WINDOW_VALUE_MASK_height       = 0x0008,
 
94
    X_CONFIGURE_WINDOW_VALUE_MASK_border_width = 0x0010,
 
95
    X_CONFIGURE_WINDOW_VALUE_MASK_sibling      = 0x0020,
 
96
    X_CONFIGURE_WINDOW_VALUE_MASK_stack_mode   = 0x0040
 
97
} XConfigureWindowValueMask;
 
98
 
 
99
typedef struct
 
100
{
 
101
    guint8 byte_order;
 
102
    guint16 protocol_major_version, protocol_minor_version;
 
103
    gchar *authorization_protocol_name;
 
104
    guint8 *authorization_protocol_data;
 
105
    guint16 authorization_protocol_data_length;
 
106
} XConnect;
 
107
 
 
108
typedef struct
 
109
{
 
110
    guint16 sequence_number;
 
111
    guint8 depth;
 
112
    guint32 wid;
 
113
    guint32 parent;
 
114
    gint16 x;
 
115
    gint16 y;
 
116
    guint16 width;
 
117
    guint16 height;
 
118
    guint16 border_width;
 
119
    guint16 class;
 
120
    guint32 visual;
 
121
    guint32 value_mask;
 
122
    guint32 background_pixmap;
 
123
    guint32 background_pixel;
 
124
    guint32 border_pixmap;
 
125
    guint32 border_pixel;
 
126
    guint8 bit_gravity;
 
127
    guint8 win_gravity;
 
128
    guint8 backing_store;
 
129
    guint32 backing_planes;
 
130
    guint32 backing_pixel;
 
131
    gboolean override_redirect;
 
132
    gboolean save_under;
 
133
    guint32 event_mask;
 
134
    guint32 do_not_propogate_mask;
 
135
    guint32 colormap;
 
136
    guint32 cursor;
 
137
} XCreateWindow;
 
138
 
 
139
typedef struct
 
140
{
 
141
    guint16 sequence_number;
 
142
    guint32 window;
 
143
    guint32 value_mask;
 
144
    guint32 background_pixmap;
 
145
    guint32 background_pixel;
 
146
    guint32 border_pixmap;
 
147
    guint32 border_pixel;
 
148
    guint8 bit_gravity;
 
149
    guint8 win_gravity;
 
150
    guint8 backing_store;
 
151
    guint32 backing_planes;
 
152
    guint32 backing_pixel;
 
153
    gboolean override_redirect;
 
154
    gboolean save_under;
 
155
    guint32 event_mask;
 
156
    guint32 do_not_propogate_mask;
 
157
    guint32 colormap;
 
158
    guint32 cursor;
 
159
} XChangeWindowAttributes;
 
160
 
 
161
typedef struct
 
162
{
 
163
    guint16 sequence_number;
 
164
    guint32 window;    
 
165
} XGetWindowAttributes;
 
166
 
 
167
typedef struct
 
168
{
 
169
    guint16 sequence_number;
 
170
    guint32 window;
 
171
} XDestroyWindow;
 
172
 
 
173
typedef struct
 
174
{
 
175
    guint16 sequence_number;
 
176
    guint32 window;
 
177
} XDestroySubwindows;
 
178
 
 
179
typedef struct
 
180
{
 
181
    guint16 sequence_number;
 
182
    guint8 mode;
 
183
    guint32 window;
 
184
} XChangeSetSave;
 
185
 
 
186
typedef struct
 
187
{
 
188
    guint16 sequence_number;
 
189
    guint32 window;
 
190
    guint32 parent;
 
191
    gint16 x;
 
192
    gint16 y;
 
193
} XReparentWindow;
 
194
 
 
195
typedef struct
 
196
{
 
197
    guint16 sequence_number;
 
198
    guint32 window;
 
199
} XMapWindow;
 
200
 
 
201
typedef struct
 
202
{
 
203
    guint16 sequence_number;
 
204
    guint32 window;
 
205
} XMapSubwindows;
 
206
 
 
207
typedef struct
 
208
{
 
209
    guint16 sequence_number;
 
210
    guint32 window;
 
211
} XUnmapWindow;
 
212
 
 
213
typedef struct
 
214
{
 
215
    guint16 sequence_number;
 
216
    guint32 window;
 
217
} XUnmapSubwindows;
 
218
 
 
219
typedef struct
 
220
{
 
221
    guint16 sequence_number;
 
222
    guint32 window;
 
223
    guint16 value_mask;
 
224
    gint16 x;
 
225
    gint16 y;
 
226
    guint16 width;
 
227
    guint16 height;
 
228
    guint16 border_width;
 
229
    guint32 sibling;
 
230
    guint8 stack_mode;
 
231
} XConfigureWindow;
 
232
 
 
233
typedef struct
 
234
{
 
235
    guint16 sequence_number;
 
236
    guint8 direction;
 
237
    guint32 window;
 
238
} XCirculateWindow;
 
239
 
 
240
typedef struct
 
241
{
 
242
    guint16 sequence_number;
 
243
    guint32 drawable;
 
244
} XGetGeometry;
 
245
 
 
246
typedef struct
 
247
{
 
248
    guint16 sequence_number;
 
249
    guint32 window;
 
250
} XQueryTree;
 
251
 
 
252
typedef struct
 
253
{
 
254
    guint16 sequence_number;
 
255
    gboolean only_if_exists;
 
256
    gchar *name;
 
257
} XInternAtom;
 
258
 
 
259
typedef struct
 
260
{
 
261
    guint16 sequence_number;
 
262
    guint32 atom;
 
263
} XGetAtomName;
 
264
 
 
265
typedef struct
 
266
{
 
267
    guint16 sequence_number;
 
268
    guint8 mode;
 
269
    guint32 window;
 
270
    guint32 property;
 
271
    guint32 type;
 
272
    guint8 format;
 
273
    guint32 length;
 
274
    guint8 *data;
 
275
} XChangeProperty;
 
276
 
 
277
typedef struct
 
278
{
 
279
    guint16 sequence_number;
 
280
    guint32 window;
 
281
    guint32 property;
 
282
} XDeleteProperty;
 
283
 
 
284
typedef struct
 
285
{
 
286
    guint16 sequence_number;
 
287
    gboolean delete;
 
288
    guint32 window;
 
289
    guint32 property;
 
290
    guint32 type;
 
291
    guint32 long_offset;
 
292
    guint32 long_length;
 
293
} XGetProperty;
 
294
 
 
295
typedef struct
 
296
{
 
297
    guint16 sequence_number;
 
298
    guint32 window;
 
299
} XListProperties;
 
300
 
 
301
typedef struct
 
302
{
 
303
    guint16 sequence_number;
 
304
    guint8 depth;
 
305
    guint32 pid;
 
306
    guint32 drawable;
 
307
    guint16 width;
 
308
    guint16 height;
 
309
} XCreatePixmap;
 
310
 
 
311
typedef struct
 
312
{
 
313
    guint16 sequence_number;
 
314
    guint32 pixmap;
 
315
} XFreePixmap;
 
316
 
 
317
typedef struct
 
318
{
 
319
    guint16 sequence_number;
 
320
    guint32 cid;
 
321
    guint32 drawable;
 
322
    guint32 value_mask;
 
323
    guint8 function;
 
324
    guint32 plane_mask;
 
325
    guint32 foreground;
 
326
    guint32 background;
 
327
    guint16 line_width;
 
328
    guint8 line_style;
 
329
    guint8 cap_style;
 
330
    guint8 join_style;
 
331
    guint8 fill_style;
 
332
    guint8 fill_rule;
 
333
    guint32 tile;
 
334
    guint32 stipple;
 
335
    guint16 tile_stipple_x_origin;
 
336
    guint16 tile_stipple_y_origin;
 
337
    guint32 font;
 
338
    guint8 subwindow_mode;
 
339
    gboolean graphics_exposures;
 
340
    guint16 clip_x_origin;
 
341
    guint16 clip_y_origin;
 
342
    guint32 clip_mask;
 
343
    guint16 dash_offset;
 
344
    guint8 dashes;
 
345
    guint8 arc_mode;
 
346
} XCreateGC;
 
347
 
 
348
typedef struct
 
349
{
 
350
    guint16 sequence_number;
 
351
    guint32 gc;
 
352
    guint32 value_mask;
 
353
    guint8 function;
 
354
    guint32 plane_mask;
 
355
    guint32 foreground;
 
356
    guint32 background;
 
357
    guint16 line_width;
 
358
    guint8 line_style;
 
359
    guint8 cap_style;
 
360
    guint8 join_style;
 
361
    guint8 fill_style;
 
362
    guint8 fill_rule;
 
363
    guint32 tile;
 
364
    guint32 stipple;
 
365
    guint16 tile_stipple_x_origin;
 
366
    guint16 tile_stipple_y_origin;
 
367
    guint32 font;
 
368
    guint8 subwindow_mode;
 
369
    gboolean graphics_exposures;
 
370
    guint16 clip_x_origin;
 
371
    guint16 clip_y_origin;
 
372
    guint32 clip_mask;
 
373
    guint16 dash_offset;
 
374
    guint8 dashes;
 
375
    guint8 arc_mode;
 
376
} XChangeGC;
 
377
 
 
378
typedef struct
 
379
{
 
380
    guint16 sequence_number;
 
381
    guint32 src_gc;
 
382
    guint32 dst_gc;
 
383
    guint32 value_mask;
 
384
    guint8 function;
 
385
    guint32 plane_mask;
 
386
    guint32 foreground;
 
387
    guint32 background;
 
388
    guint16 line_width;
 
389
    guint8 line_style;
 
390
    guint8 cap_style;
 
391
    guint8 join_style;
 
392
    guint8 fill_style;
 
393
    guint8 fill_rule;
 
394
    guint32 tile;
 
395
    guint32 stipple;
 
396
    guint16 tile_stipple_x_origin;
 
397
    guint16 tile_stipple_y_origin;
 
398
    guint32 font;
 
399
    guint8 subwindow_mode;
 
400
    gboolean graphics_exposures;
 
401
    guint16 clip_x_origin;
 
402
    guint16 clip_y_origin;
 
403
    guint32 clip_mask;
 
404
    guint16 dash_offset;
 
405
    guint8 dashes;
 
406
    guint8 arc_mode;
 
407
} XCopyGC;
 
408
 
 
409
typedef struct
 
410
{
 
411
    guint16 sequence_number;
 
412
    guint32 gc;
 
413
} XFreeGC;
 
414
 
 
415
typedef struct
 
416
{
 
417
    guint16 sequence_number;
 
418
    gchar *name;
 
419
} XQueryExtension;
 
420
 
 
421
typedef struct
 
422
{
 
423
    guint16 sequence_number;
 
424
    guint8 percent;
 
425
} XBell;
 
426
 
 
427
typedef struct XClientPrivate XClientPrivate;
 
428
 
 
429
typedef struct
 
430
{
 
431
   GObject         parent_instance;
 
432
   XClientPrivate *priv;
 
433
} XClient;
 
434
 
 
435
typedef struct
 
436
{
 
437
   GObjectClass parent_class;
 
438
   void (*connect)(XClient *client, XConnect *message);
 
439
   void (*create_window)(XClient *client, XCreateWindow *message);
 
440
   void (*change_window_attributes)(XClient *client, XChangeWindowAttributes *message);
 
441
   void (*get_window_attributes)(XClient *client, XGetWindowAttributes *message);
 
442
   void (*destroy_window)(XClient *client, XDestroyWindow *message);
 
443
   void (*destroy_subwindows)(XClient *client, XDestroySubwindows *message);
 
444
   void (*change_set_save)(XClient *client, XChangeSetSave *message);
 
445
   void (*reparent_window)(XClient *client, XReparentWindow *message);
 
446
   void (*map_window)(XClient *client, XMapWindow *message);
 
447
   void (*map_subwindows)(XClient *client, XMapSubwindows *message);
 
448
   void (*unmap_window)(XClient *client, XUnmapWindow *message);
 
449
   void (*unmap_subwindows)(XClient *client, XUnmapSubwindows *message);
 
450
   void (*configure_window)(XClient *client, XConfigureWindow *message);
 
451
   void (*circulate_window)(XClient *client, XCirculateWindow *message);
 
452
   void (*get_geometry)(XClient *client, XGetGeometry *message);
 
453
   void (*query_tree)(XClient *client, XQueryTree *message);
 
454
   void (*intern_atom)(XClient *client, XInternAtom *message);
 
455
   void (*get_atom_name)(XClient *client, XGetAtomName *message);
 
456
   void (*change_property)(XClient *client, XChangeProperty *message);
 
457
   void (*delete_property)(XClient *client, XDeleteProperty *message);
 
458
   void (*get_property)(XClient *client, XGetProperty *message);
 
459
   void (*list_properties)(XClient *client, XListProperties *message);
 
460
   void (*create_pixmap)(XClient *client, XCreatePixmap *message);
 
461
   void (*free_pixmap)(XClient *client, XFreePixmap *message);
 
462
   void (*create_gc)(XClient *client, XCreateGC *message);
 
463
   void (*change_gc)(XClient *client, XChangeGC *message);
 
464
   void (*copy_gc)(XClient *client, XCopyGC *message);
 
465
   void (*free_gc)(XClient *client, XFreeGC *message);
 
466
   void (*query_extension)(XClient *client, XQueryExtension *message);
 
467
   void (*bell)(XClient *client, XBell *message);
 
468
   void (*disconnected)(XClient *client);
 
469
} XClientClass;
 
470
 
 
471
typedef struct XScreenPrivate XScreenPrivate;
 
472
 
 
473
typedef struct
 
474
{
 
475
   GObject         parent_instance;
 
476
   XScreenPrivate *priv;
 
477
} XScreen;
 
478
 
 
479
typedef struct
 
480
{
 
481
   GObjectClass parent_class;
 
482
} XScreenClass;
 
483
 
 
484
typedef struct XVisualPrivate XVisualPrivate;
 
485
 
 
486
typedef struct
 
487
{
 
488
   GObject         parent_instance;
 
489
   XVisualPrivate *priv;
 
490
} XVisual;
 
491
 
 
492
typedef struct
 
493
{
 
494
   GObjectClass parent_class;
 
495
} XVisualClass;
 
496
 
 
497
typedef struct XServerPrivate XServerPrivate;
 
498
 
 
499
typedef struct
 
500
{
 
501
   GObject         parent_instance;
 
502
   XServerPrivate *priv;
 
503
} XServer;
 
504
 
 
505
typedef struct
 
506
{
 
507
   GObjectClass parent_class;
 
508
   void (*client_connected)(XServer *server, XClient *client);
 
509
   void (*client_disconnected)(XServer *server, XClient *client);
 
510
} XServerClass;
 
511
 
 
512
GType x_server_get_type (void);
 
513
 
 
514
XServer *x_server_new (gint display_number);
 
515
 
 
516
XScreen *x_server_add_screen (XServer *server, guint32 white_pixel, guint32 black_pixel, guint32 current_input_masks, guint16 width_in_pixels, guint16 height_in_pixels, guint16 width_in_millimeters, guint16 height_in_millimeters);
 
517
 
 
518
void x_server_add_pixmap_format (XServer *server, guint8 depth, guint8 bits_per_pixel, guint8 scanline_pad);
 
519
 
 
520
void x_server_set_listen_unix (XServer *server, gboolean listen_unix);
 
521
 
 
522
void x_server_set_listen_tcp (XServer *server, gboolean listen_tcp);
 
523
 
 
524
gboolean x_server_start (XServer *server);
 
525
 
 
526
gsize x_server_get_n_clients (XServer *server);
 
527
 
 
528
GType x_screen_get_type (void);
 
529
 
 
530
XVisual *x_screen_add_visual (XScreen *screen, guint8 depth, guint8 class, guint8 bits_per_rgb_value, guint16 colormap_entries, guint32 red_mask, guint32 green_mask, guint32 blue_mask);
 
531
 
 
532
GType x_visual_get_type (void);
 
533
 
 
534
GType x_client_get_type (void);
 
535
 
 
536
GInetAddress *x_client_get_address (XClient *client);
 
537
 
 
538
void x_client_send_failed (XClient *client, const gchar *reason);
 
539
 
 
540
void x_client_send_success (XClient *client);
 
541
 
 
542
void x_client_send_get_window_attributes_response (XClient *client, guint16 sequence_number, guint8 backing_store, guint32 visual, guint16 class, guint8 bit_gravity, guint8 win_gravity, guint32 backing_planes, guint32 backing_pixel, gboolean save_under, gboolean map_is_installed, guint8 map_state, gboolean override_redirect, guint32 colormap, guint32 all_event_masks, guint32 your_event_mask, guint16 do_not_propogate_mask);
 
543
 
 
544
void x_client_send_get_geometry_response (XClient *client, guint16 sequence_number, guint8 depth, guint32 root, gint16 x, gint16 y, guint16 width, guint16 height, guint16 border_width);
 
545
 
 
546
void x_client_send_query_tree_response (XClient *client, guint16 sequence_number, guint32 root, guint32 parent, guint32* children, guint16 children_length);
 
547
 
 
548
void x_client_send_intern_atom_response (XClient *client, guint16 sequence_number, guint32 atom);
 
549
 
 
550
void x_client_send_get_property_response (XClient *client, guint16 sequence_number, guint8 format, guint32 type, guint32 bytes_after, const guint8 *data, guint32 length);
 
551
 
 
552
void x_client_send_query_extension_response (XClient *client, guint16 sequence_number, gboolean present, guint8 major_opcode, guint8 first_event, guint8 first_error);
 
553
 
 
554
void x_client_disconnect (XClient *client);
 
555
 
 
556
G_END_DECLS
 
557
 
 
558
#endif /* _X_SERVER_H_ */