~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to .pc/python3.patch/Xlib/protocol/request.py

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Xlib.protocol.request -- definitions of core requests
 
2
#
 
3
#    Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
 
4
#
 
5
#    This program is free software; you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation; either version 2 of the License, or
 
8
#    (at your option) any later version.
 
9
#
 
10
#    This program is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License for more details.
 
14
#
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with this program; if not, write to the Free Software
 
17
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 
 
19
 
 
20
# Xlib modules
 
21
from Xlib import X
 
22
 
 
23
# Xlib.protocol modules
 
24
import rq
 
25
import structs
 
26
 
 
27
 
 
28
class CreateWindow(rq.Request):
 
29
    _request = rq.Struct(
 
30
        rq.Opcode(1),
 
31
        rq.Card8('depth'),
 
32
        rq.RequestLength(),
 
33
        rq.Window('wid'),
 
34
        rq.Window('parent'),
 
35
        rq.Int16('x'),
 
36
        rq.Int16('y'),
 
37
        rq.Card16('width'),
 
38
        rq.Card16('height'),
 
39
        rq.Card16('border_width'),
 
40
        rq.Set('window_class', 2, (X.CopyFromParent, X.InputOutput, X.InputOnly)),
 
41
        rq.Card32('visual'),
 
42
        structs.WindowValues('attrs'),
 
43
        )
 
44
 
 
45
class ChangeWindowAttributes(rq.Request):
 
46
    _request = rq.Struct(
 
47
        rq.Opcode(2),
 
48
        rq.Pad(1),
 
49
        rq.RequestLength(),
 
50
        rq.Window('window'),
 
51
        structs.WindowValues('attrs'),
 
52
        )
 
53
 
 
54
class GetWindowAttributes(rq.ReplyRequest):
 
55
    _request = rq.Struct(
 
56
        rq.Opcode(3),
 
57
        rq.Pad(1),
 
58
        rq.RequestLength(),
 
59
        rq.Window('window')
 
60
        )
 
61
 
 
62
    _reply = rq.Struct(
 
63
        rq.ReplyCode(),
 
64
        rq.Card8('backing_store'),
 
65
        rq.Card16('sequence_number'),
 
66
        rq.ReplyLength(),
 
67
        rq.Card32('visual'),
 
68
        rq.Card16('win_class'),
 
69
        rq.Card8('bit_gravity'),
 
70
        rq.Card8('win_gravity'),
 
71
        rq.Card32('backing_bit_planes'),
 
72
        rq.Card32('backing_pixel'),
 
73
        rq.Card8('save_under'),
 
74
        rq.Card8('map_is_installed'),
 
75
        rq.Card8('map_state'),
 
76
        rq.Card8('override_redirect'),
 
77
        rq.Colormap('colormap', (X.NONE, )),
 
78
        rq.Card32('all_event_masks'),
 
79
        rq.Card32('your_event_mask'),
 
80
        rq.Card16('do_not_propagate_mask'),
 
81
        rq.Pad(2),
 
82
        )
 
83
 
 
84
class DestroyWindow(rq.Request):
 
85
    _request = rq.Struct(
 
86
        rq.Opcode(4),
 
87
        rq.Pad(1),
 
88
        rq.RequestLength(),
 
89
        rq.Window('window')
 
90
        )
 
91
 
 
92
class DestroySubWindows(rq.Request):
 
93
    _request = rq.Struct(
 
94
        rq.Opcode(5),
 
95
        rq.Pad(1),
 
96
        rq.RequestLength(),
 
97
        rq.Window('window')
 
98
        )
 
99
 
 
100
class ChangeSaveSet(rq.Request):
 
101
    _request = rq.Struct(
 
102
        rq.Opcode(6),
 
103
        rq.Set('mode', 1, (X.SetModeInsert, X.SetModeDelete)),
 
104
        rq.RequestLength(),
 
105
        rq.Window('window'),
 
106
        )
 
107
 
 
108
class ReparentWindow(rq.Request):
 
109
    _request = rq.Struct(
 
110
        rq.Opcode(7),
 
111
        rq.Pad(1),
 
112
        rq.RequestLength(),
 
113
        rq.Window('window'),
 
114
        rq.Window('parent'),
 
115
        rq.Int16('x'),
 
116
        rq.Int16('y'),
 
117
        )
 
118
 
 
119
class MapWindow(rq.Request):
 
120
    _request = rq.Struct(
 
121
        rq.Opcode(8),
 
122
        rq.Pad(1),
 
123
        rq.RequestLength(),
 
124
        rq.Window('window')
 
125
        )
 
126
 
 
127
class MapSubwindows(rq.Request):
 
128
    _request = rq.Struct(
 
129
        rq.Opcode(9),
 
130
        rq.Pad(1),
 
131
        rq.RequestLength(),
 
132
        rq.Window('window')
 
133
        )
 
134
 
 
135
class UnmapWindow(rq.Request):
 
136
    _request = rq.Struct(
 
137
        rq.Opcode(10),
 
138
        rq.Pad(1),
 
139
        rq.RequestLength(),
 
140
        rq.Window('window')
 
141
        )
 
142
 
 
143
class UnmapSubwindows(rq.Request):
 
144
    _request = rq.Struct(
 
145
        rq.Opcode(11),
 
146
        rq.Pad(1),
 
147
        rq.RequestLength(),
 
148
        rq.Window('window')
 
149
        )
 
150
 
 
151
class ConfigureWindow(rq.Request):
 
152
    _request = rq.Struct(
 
153
        rq.Opcode(12),
 
154
        rq.Pad(1),
 
155
        rq.RequestLength(),
 
156
        rq.Window('window'),
 
157
        rq.ValueList( 'attrs', 2, 2,
 
158
                      rq.Int16('x'),
 
159
                      rq.Int16('y'),
 
160
                      rq.Card16('width'),
 
161
                      rq.Card16('height'),
 
162
                      rq.Int16('border_width'),
 
163
                      rq.Window('sibling'),
 
164
                      rq.Set('stack_mode', 1,
 
165
                             (X.Above, X.Below, X.TopIf,
 
166
                              X.BottomIf, X.Opposite))
 
167
                      )
 
168
        )
 
169
 
 
170
class CirculateWindow(rq.Request):
 
171
    _request = rq.Struct(
 
172
        rq.Opcode(13),
 
173
        rq.Set('direction', 1, (X.RaiseLowest, X.LowerHighest)),
 
174
        rq.RequestLength(),
 
175
        rq.Window('window'),
 
176
        )
 
177
 
 
178
class GetGeometry(rq.ReplyRequest):
 
179
    _request = rq.Struct(
 
180
        rq.Opcode(14),
 
181
        rq.Pad(1),
 
182
        rq.RequestLength(),
 
183
        rq.Drawable('drawable')
 
184
        )
 
185
 
 
186
    _reply = rq.Struct (
 
187
        rq.ReplyCode(),
 
188
        rq.Card8('depth'),
 
189
        rq.Card16('sequence_number'),
 
190
        rq.ReplyLength(),
 
191
        rq.Window('root'),
 
192
        rq.Int16('x'),
 
193
        rq.Int16('y'),
 
194
        rq.Card16('width'),
 
195
        rq.Card16('height'),
 
196
        rq.Card16('border_width'),
 
197
        rq.Pad(10)
 
198
        )
 
199
 
 
200
class QueryTree(rq.ReplyRequest):
 
201
    _request = rq.Struct(
 
202
        rq.Opcode(15),
 
203
        rq.Pad(1),
 
204
        rq.RequestLength(),
 
205
        rq.Window('window')
 
206
        )
 
207
 
 
208
    _reply = rq.Struct(
 
209
        rq.ReplyCode(),
 
210
        rq.Pad(1),
 
211
        rq.Card16('sequence_number'),
 
212
        rq.ReplyLength(),
 
213
        rq.Window('root'),
 
214
        rq.Window('parent', (X.NONE, )),
 
215
        rq.LengthOf('children', 2),
 
216
        rq.Pad(14),
 
217
        rq.List('children', rq.WindowObj),
 
218
        )
 
219
 
 
220
class InternAtom(rq.ReplyRequest):
 
221
    _request = rq.Struct(
 
222
        rq.Opcode(16),
 
223
        rq.Bool('only_if_exists'),
 
224
        rq.RequestLength(),
 
225
        rq.LengthOf('name', 2),
 
226
        rq.Pad(2),
 
227
        rq.String8('name'),
 
228
        )
 
229
 
 
230
    _reply = rq.Struct(
 
231
        rq.ReplyCode(),
 
232
        rq.Pad(1),
 
233
        rq.Card16('sequence_number'),
 
234
        rq.ReplyLength(),
 
235
        rq.Card32('atom'),
 
236
        rq.Pad(20),
 
237
        )
 
238
 
 
239
 
 
240
class GetAtomName(rq.ReplyRequest):
 
241
    _request = rq.Struct(
 
242
        rq.Opcode(17),
 
243
        rq.Pad(1),
 
244
        rq.RequestLength(),
 
245
        rq.Card32('atom')
 
246
        )
 
247
 
 
248
    _reply = rq.Struct(
 
249
        rq.ReplyCode(),
 
250
        rq.Pad(1),
 
251
        rq.Card16('sequence_number'),
 
252
        rq.ReplyLength(),
 
253
        rq.LengthOf('name', 2),
 
254
        rq.Pad(22),
 
255
        rq.String8('name'),
 
256
        )
 
257
 
 
258
class ChangeProperty(rq.Request):
 
259
    _request = rq.Struct(
 
260
        rq.Opcode(18),
 
261
        rq.Set('mode', 1, (X.PropModeReplace, X.PropModePrepend, X.PropModeAppend)),
 
262
        rq.RequestLength(),
 
263
        rq.Window('window'),
 
264
        rq.Card32('property'),
 
265
        rq.Card32('type'),
 
266
        rq.Format('data', 1),
 
267
        rq.Pad(3),
 
268
        rq.LengthOf('data', 4),
 
269
        rq.PropertyData('data'),
 
270
        )
 
271
 
 
272
class DeleteProperty(rq.Request):
 
273
    _request = rq.Struct(
 
274
        rq.Opcode(19),
 
275
        rq.Pad(1),
 
276
        rq.RequestLength(),
 
277
        rq.Window('window'),
 
278
        rq.Card32('property'),
 
279
        )
 
280
 
 
281
class GetProperty(rq.ReplyRequest):
 
282
    _request = rq.Struct(
 
283
        rq.Opcode(20),
 
284
        rq.Bool('delete'),
 
285
        rq.RequestLength(),
 
286
        rq.Window('window'),
 
287
        rq.Card32('property'),
 
288
        rq.Card32('type'),
 
289
        rq.Card32('long_offset'),
 
290
        rq.Card32('long_length'),
 
291
        )
 
292
 
 
293
    _reply = rq.Struct(
 
294
        rq.ReplyCode(),
 
295
        rq.Format('value', 1),
 
296
        rq.Card16('sequence_number'),
 
297
        rq.ReplyLength(),
 
298
        rq.Card32('property_type'),
 
299
        rq.Card32('bytes_after'),
 
300
        rq.LengthOf('value', 4),
 
301
        rq.Pad(12),
 
302
        rq.PropertyData('value'),
 
303
        )
 
304
 
 
305
class ListProperties(rq.ReplyRequest):
 
306
    _request = rq.Struct(
 
307
        rq.Opcode(21),
 
308
        rq.Pad(1),
 
309
        rq.RequestLength(),
 
310
        rq.Window('window')
 
311
        )
 
312
 
 
313
    _reply = rq.Struct(
 
314
        rq.ReplyCode(),
 
315
        rq.Pad(1),
 
316
        rq.Card16('sequence_number'),
 
317
        rq.ReplyLength(),
 
318
        rq.LengthOf('atoms', 2),
 
319
        rq.Pad(22),
 
320
        rq.List('atoms', rq.Card32Obj),
 
321
        )
 
322
 
 
323
class SetSelectionOwner(rq.Request):
 
324
    _request = rq.Struct(
 
325
        rq.Opcode(22),
 
326
        rq.Pad(1),
 
327
        rq.RequestLength(),
 
328
        rq.Window('window'),
 
329
        rq.Card32('selection'),
 
330
        rq.Card32('time'),
 
331
        )
 
332
 
 
333
class GetSelectionOwner(rq.ReplyRequest):
 
334
    _request = rq.Struct(
 
335
        rq.Opcode(23),
 
336
        rq.Pad(1),
 
337
        rq.RequestLength(),
 
338
        rq.Card32('selection')
 
339
        )
 
340
 
 
341
    _reply = rq.Struct(
 
342
        rq.ReplyCode(),
 
343
        rq.Pad(1),
 
344
        rq.Card16('sequence_number'),
 
345
        rq.ReplyLength(),
 
346
        rq.Window('owner', (X.NONE, )),
 
347
        rq.Pad(20),
 
348
        )
 
349
 
 
350
class ConvertSelection(rq.Request):
 
351
    _request = rq.Struct(
 
352
        rq.Opcode(24),
 
353
        rq.Pad(1),
 
354
        rq.RequestLength(),
 
355
        rq.Window('requestor'),
 
356
        rq.Card32('selection'),
 
357
        rq.Card32('target'),
 
358
        rq.Card32('property'),
 
359
        rq.Card32('time'),
 
360
        )
 
361
 
 
362
class SendEvent(rq.Request):
 
363
    _request = rq.Struct(
 
364
        rq.Opcode(25),
 
365
        rq.Bool('propagate'),
 
366
        rq.RequestLength(),
 
367
        rq.Window('destination'),
 
368
        rq.Card32('event_mask'),
 
369
        rq.EventField('event'),
 
370
        )
 
371
 
 
372
class GrabPointer(rq.ReplyRequest):
 
373
    _request = rq.Struct(
 
374
        rq.Opcode(26),
 
375
        rq.Bool('owner_events'),
 
376
        rq.RequestLength(),
 
377
        rq.Window('grab_window'),
 
378
        rq.Card16('event_mask'),
 
379
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
380
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
381
        rq.Window('confine_to', (X.NONE, )),
 
382
        rq.Cursor('cursor', (X.NONE, )),
 
383
        rq.Card32('time'),
 
384
        )
 
385
 
 
386
    _reply = rq.Struct(
 
387
        rq.ReplyCode(),
 
388
        rq.Card8('status'),
 
389
        rq.Card16('sequence_number'),
 
390
        rq.ReplyLength(),
 
391
        rq.Pad(24),
 
392
        )
 
393
 
 
394
class UngrabPointer(rq.Request):
 
395
    _request = rq.Struct(
 
396
        rq.Opcode(27),
 
397
        rq.Pad(1),
 
398
        rq.RequestLength(),
 
399
        rq.Card32('time')
 
400
        )
 
401
 
 
402
class GrabButton(rq.Request):
 
403
    _request = rq.Struct(
 
404
        rq.Opcode(28),
 
405
        rq.Bool('owner_events'),
 
406
        rq.RequestLength(),
 
407
        rq.Window('grab_window'),
 
408
        rq.Card16('event_mask'),
 
409
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
410
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
411
        rq.Window('confine_to', (X.NONE, )),
 
412
        rq.Cursor('cursor', (X.NONE, )),
 
413
        rq.Card8('button'),
 
414
        rq.Pad(1),
 
415
        rq.Card16('modifiers'),
 
416
        )
 
417
 
 
418
class UngrabButton(rq.Request):
 
419
    _request = rq.Struct(
 
420
        rq.Opcode(29),
 
421
        rq.Card8('button'),
 
422
        rq.RequestLength(),
 
423
        rq.Window('grab_window'),
 
424
        rq.Card16('modifiers'),
 
425
        rq.Pad(2),
 
426
        )
 
427
 
 
428
class ChangeActivePointerGrab(rq.Request):
 
429
    _request = rq.Struct(
 
430
        rq.Opcode(30),
 
431
        rq.Pad(1),
 
432
        rq.RequestLength(),
 
433
        rq.Cursor('cursor'),
 
434
        rq.Card32('time'),
 
435
        rq.Card16('event_mask'),
 
436
        rq.Pad(2),
 
437
        )
 
438
 
 
439
class GrabKeyboard(rq.ReplyRequest):
 
440
    _request = rq.Struct(
 
441
        rq.Opcode(31),
 
442
        rq.Bool('owner_events'),
 
443
        rq.RequestLength(),
 
444
        rq.Window('grab_window'),
 
445
        rq.Card32('time'),
 
446
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
447
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
448
        rq.Pad(2),
 
449
        )
 
450
 
 
451
    _reply = rq.Struct(
 
452
        rq.ReplyCode(),
 
453
        rq.Card8('status'),
 
454
        rq.Card16('sequence_number'),
 
455
        rq.ReplyLength(),
 
456
        rq.Pad(24),
 
457
        )
 
458
 
 
459
class UngrabKeyboard(rq.Request):
 
460
    _request = rq.Struct(
 
461
        rq.Opcode(32),
 
462
        rq.Pad(1),
 
463
        rq.RequestLength(),
 
464
        rq.Card32('time')
 
465
        )
 
466
 
 
467
class GrabKey(rq.Request):
 
468
    _request = rq.Struct(
 
469
        rq.Opcode(33),
 
470
        rq.Bool('owner_events'),
 
471
        rq.RequestLength(),
 
472
        rq.Window('grab_window'),
 
473
        rq.Card16('modifiers'),
 
474
        rq.Card8('key'),
 
475
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
476
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
 
477
        rq.Pad(3),
 
478
        )
 
479
 
 
480
class UngrabKey(rq.Request):
 
481
    _request = rq.Struct(
 
482
        rq.Opcode(34),
 
483
        rq.Card8('key'),
 
484
        rq.RequestLength(),
 
485
        rq.Window('grab_window'),
 
486
        rq.Card16('modifiers'),
 
487
        rq.Pad(2),
 
488
        )
 
489
 
 
490
class AllowEvents(rq.Request):
 
491
    _request = rq.Struct(
 
492
        rq.Opcode(35),
 
493
        rq.Set('mode', 1, (X.AsyncPointer,
 
494
                           X.SyncPointer,
 
495
                           X.ReplayPointer,
 
496
                           X.AsyncKeyboard,
 
497
                           X.SyncKeyboard,
 
498
                           X.ReplayKeyboard,
 
499
                           X.AsyncBoth,
 
500
                           X.SyncBoth)),
 
501
        rq.RequestLength(),
 
502
        rq.Card32('time'),
 
503
        )
 
504
 
 
505
class GrabServer(rq.Request):
 
506
    _request = rq.Struct(
 
507
        rq.Opcode(36),
 
508
        rq.Pad(1),
 
509
        rq.RequestLength(),
 
510
        )
 
511
 
 
512
class UngrabServer(rq.Request):
 
513
    _request = rq.Struct(
 
514
        rq.Opcode(37),
 
515
        rq.Pad(1),
 
516
        rq.RequestLength(),
 
517
        )
 
518
 
 
519
class QueryPointer(rq.ReplyRequest):
 
520
    _request = rq.Struct(
 
521
        rq.Opcode(38),
 
522
        rq.Pad(1),
 
523
        rq.RequestLength(),
 
524
        rq.Window('window')
 
525
        )
 
526
 
 
527
    _reply = rq.Struct(
 
528
        rq.ReplyCode(),
 
529
        rq.Card8('same_screen'),
 
530
        rq.Card16('sequence_number'),
 
531
        rq.ReplyLength(),
 
532
        rq.Window('root'),
 
533
        rq.Window('child', (X.NONE, )),
 
534
        rq.Int16('root_x'),
 
535
        rq.Int16('root_y'),
 
536
        rq.Int16('win_x'),
 
537
        rq.Int16('win_y'),
 
538
        rq.Card16('mask'),
 
539
        rq.Pad(6),
 
540
        )
 
541
 
 
542
class GetMotionEvents(rq.ReplyRequest):
 
543
    _request = rq.Struct(
 
544
        rq.Opcode(39),
 
545
        rq.Pad(1),
 
546
        rq.RequestLength(),
 
547
        rq.Window('window'),
 
548
        rq.Card32('start'),
 
549
        rq.Card32('stop'),
 
550
        )
 
551
 
 
552
    _reply = rq.Struct(
 
553
        rq.ReplyCode(),
 
554
        rq.Pad(1),
 
555
        rq.Card16('sequence_number'),
 
556
        rq.ReplyLength(),
 
557
        rq.LengthOf('events', 4),
 
558
        rq.Pad(20),
 
559
        rq.List('events', structs.TimeCoord),
 
560
        )
 
561
 
 
562
class TranslateCoords(rq.ReplyRequest):
 
563
    _request = rq.Struct(
 
564
        rq.Opcode(40),
 
565
        rq.Pad(1),
 
566
        rq.RequestLength(),
 
567
        rq.Window('src_wid'),
 
568
        rq.Window('dst_wid'),
 
569
        rq.Int16('src_x'),
 
570
        rq.Int16('src_y'),
 
571
        )
 
572
 
 
573
    _reply = rq.Struct(
 
574
        rq.ReplyCode(),
 
575
        rq.Card8('same_screen'),
 
576
        rq.Card16('sequence_number'),
 
577
        rq.ReplyLength(),
 
578
        rq.Window('child', (X.NONE, )),
 
579
        rq.Int16('x'),
 
580
        rq.Int16('y'),
 
581
        rq.Pad(16),
 
582
        )
 
583
 
 
584
class WarpPointer(rq.Request):
 
585
    _request = rq.Struct(
 
586
        rq.Opcode(41),
 
587
        rq.Pad(1),
 
588
        rq.RequestLength(),
 
589
        rq.Window('src_window'),
 
590
        rq.Window('dst_window'),
 
591
        rq.Int16('src_x'),
 
592
        rq.Int16('src_y'),
 
593
        rq.Card16('src_width'),
 
594
        rq.Card16('src_height'),
 
595
        rq.Int16('dst_x'),
 
596
        rq.Int16('dst_y'),
 
597
        )
 
598
 
 
599
class SetInputFocus(rq.Request):
 
600
    _request = rq.Struct(
 
601
        rq.Opcode(42),
 
602
        rq.Set('revert_to', 1, (X.RevertToNone, X.RevertToPointerRoot,
 
603
                                X.RevertToParent)),
 
604
        rq.RequestLength(),
 
605
        rq.Window('focus'),
 
606
        rq.Card32('time'),
 
607
        )
 
608
 
 
609
class GetInputFocus(rq.ReplyRequest):
 
610
    _request = rq.Struct(
 
611
        rq.Opcode(43),
 
612
        rq.Pad(1),
 
613
        rq.RequestLength(),
 
614
        )
 
615
 
 
616
    _reply = rq.Struct(
 
617
        rq.ReplyCode(),
 
618
        rq.Card8('revert_to'),
 
619
        rq.Card16('sequence_number'),
 
620
        rq.ReplyLength(),
 
621
        rq.Window('focus', (X.NONE, X.PointerRoot)),
 
622
        rq.Pad(20),
 
623
        )
 
624
 
 
625
class QueryKeymap(rq.ReplyRequest):
 
626
    _request = rq.Struct(
 
627
        rq.Opcode(44),
 
628
        rq.Pad(1),
 
629
        rq.RequestLength(),
 
630
        )
 
631
 
 
632
    _reply = rq.Struct(
 
633
        rq.ReplyCode(),
 
634
        rq.Pad(1),
 
635
        rq.Card16('sequence_number'),
 
636
        rq.ReplyLength(),
 
637
        rq.FixedList('map', 32, rq.Card8Obj),
 
638
        )
 
639
 
 
640
 
 
641
class OpenFont(rq.Request):
 
642
    _request = rq.Struct(
 
643
        rq.Opcode(45),
 
644
        rq.Pad(1),
 
645
        rq.RequestLength(),
 
646
        rq.Font('fid'),
 
647
        rq.LengthOf('name', 2),
 
648
        rq.Pad(2),
 
649
        rq.String8('name'),
 
650
        )
 
651
 
 
652
class CloseFont(rq.Request):
 
653
    _request = rq.Struct(
 
654
        rq.Opcode(46),
 
655
        rq.Pad(1),
 
656
        rq.RequestLength(),
 
657
        rq.Font('font')
 
658
        )
 
659
 
 
660
class QueryFont(rq.ReplyRequest):
 
661
    _request = rq.Struct(
 
662
        rq.Opcode(47),
 
663
        rq.Pad(1),
 
664
        rq.RequestLength(),
 
665
        rq.Fontable('font')
 
666
        )
 
667
 
 
668
    _reply = rq.Struct(
 
669
        rq.ReplyCode(),
 
670
        rq.Pad(1),
 
671
        rq.Card16('sequence_number'),
 
672
        rq.ReplyLength(),
 
673
        rq.Object('min_bounds', structs.CharInfo),
 
674
        rq.Pad(4),
 
675
        rq.Object('max_bounds', structs.CharInfo),
 
676
        rq.Pad(4),
 
677
        rq.Card16('min_char_or_byte2'),
 
678
        rq.Card16('max_char_or_byte2'),
 
679
        rq.Card16('default_char'),
 
680
        rq.LengthOf('properties', 2),
 
681
        rq.Card8('draw_direction'),
 
682
        rq.Card8('min_byte1'),
 
683
        rq.Card8('max_byte1'),
 
684
        rq.Card8('all_chars_exist'),
 
685
        rq.Int16('font_ascent'),
 
686
        rq.Int16('font_descent'),
 
687
        rq.LengthOf('char_infos', 4),
 
688
        rq.List('properties', structs.FontProp),
 
689
        rq.List('char_infos', structs.CharInfo),
 
690
        )
 
691
 
 
692
class QueryTextExtents(rq.ReplyRequest):
 
693
    _request = rq.Struct(
 
694
        rq.Opcode(48),
 
695
        rq.OddLength('string'),
 
696
        rq.RequestLength(),
 
697
        rq.Fontable('font'),
 
698
        rq.String16('string'),
 
699
        )
 
700
 
 
701
    _reply = rq.Struct(
 
702
        rq.ReplyCode(),
 
703
        rq.Card8('draw_direction'),
 
704
        rq.Card16('sequence_number'),
 
705
        rq.ReplyLength(),
 
706
        rq.Int16('font_ascent'),
 
707
        rq.Int16('font_descent'),
 
708
        rq.Int16('overall_ascent'),
 
709
        rq.Int16('overall_descent'),
 
710
        rq.Int32('overall_width'),
 
711
        rq.Int32('overall_left'),
 
712
        rq.Int32('overall_right'),
 
713
        rq.Pad(4),
 
714
        )
 
715
 
 
716
class ListFonts(rq.ReplyRequest):
 
717
    _request = rq.Struct(
 
718
        rq.Opcode(49),
 
719
        rq.Pad(1),
 
720
        rq.RequestLength(),
 
721
        rq.Card16('max_names'),
 
722
        rq.LengthOf('pattern', 2),
 
723
        rq.String8('pattern'),
 
724
        )
 
725
 
 
726
    _reply = rq.Struct(
 
727
        rq.ReplyCode(),
 
728
        rq.Pad(1),
 
729
        rq.Card16('sequence_number'),
 
730
        rq.ReplyLength(),
 
731
        rq.LengthOf('fonts', 2),
 
732
        rq.Pad(22),
 
733
        rq.List('fonts', rq.Str),
 
734
        )
 
735
 
 
736
 
 
737
class ListFontsWithInfo(rq.ReplyRequest):
 
738
    _request = rq.Struct(
 
739
        rq.Opcode(50),
 
740
        rq.Pad(1),
 
741
        rq.RequestLength(),
 
742
        rq.Card16('max_names'),
 
743
        rq.LengthOf('pattern', 2),
 
744
        rq.String8('pattern'),
 
745
        )
 
746
 
 
747
    _reply = rq.Struct(
 
748
        rq.ReplyCode(),
 
749
        rq.LengthOf('name', 1),
 
750
        rq.Card16('sequence_number'),
 
751
        rq.ReplyLength(),
 
752
        rq.Object('min_bounds', structs.CharInfo),
 
753
        rq.Pad(4),
 
754
        rq.Object('max_bounds', structs.CharInfo),
 
755
        rq.Pad(4),
 
756
        rq.Card16('min_char_or_byte2'),
 
757
        rq.Card16('max_char_or_byte2'),
 
758
        rq.Card16('default_char'),
 
759
        rq.LengthOf('properties', 2),
 
760
        rq.Card8('draw_direction'),
 
761
        rq.Card8('min_byte1'),
 
762
        rq.Card8('max_byte1'),
 
763
        rq.Card8('all_chars_exist'),
 
764
        rq.Int16('font_ascent'),
 
765
        rq.Int16('font_descent'),
 
766
        rq.Card32('replies_hint'),
 
767
        rq.List('properties', structs.FontProp),
 
768
        rq.String8('name'),
 
769
        )
 
770
 
 
771
 
 
772
    # Somebody must have smoked some really wicked weed when they
 
773
    # defined the ListFontsWithInfo request:
 
774
    # The server sends a reply for _each_ matching font...
 
775
    # It then sends a special reply (name length == 0) to indicate
 
776
    # that there are no more fonts in the reply.
 
777
 
 
778
    # This means that we have to do some special parsing to see if
 
779
    # we have got the end-of-reply reply.  If we haven't, we
 
780
    # have to reinsert the request in the front of the
 
781
    # display.sent_request queue to catch the next response.
 
782
 
 
783
    # Bastards.
 
784
 
 
785
    def __init__(self, *args, **keys):
 
786
        self._fonts = []
 
787
        apply(ReplyRequest.__init__, (self, ) + args, keys)
 
788
 
 
789
    def _parse_response(self, data):
 
790
 
 
791
        if ord(data[1]) == 0:
 
792
            self._response_lock.acquire()
 
793
            self._data = self._fonts
 
794
            del self._fonts
 
795
            self._response_lock.release()
 
796
            return
 
797
 
 
798
        r, d = self._reply.parse_binary(data)
 
799
        self._fonts.append(r)
 
800
 
 
801
        self._display.sent_requests.insert(0, self)
 
802
 
 
803
 
 
804
    # Override the default __getattr__, since it isn't usable for
 
805
    # the list reply.  Instead provide a __getitem__ and a __len__.
 
806
 
 
807
    def __getattr__(self, attr):
 
808
        raise AttributeError(attr)
 
809
 
 
810
    def __getitem__(self, item):
 
811
        return self._data[item]
 
812
 
 
813
    def __len__(self):
 
814
        return len(self._data)
 
815
 
 
816
 
 
817
class SetFontPath(rq.Request):
 
818
    _request = rq.Struct(
 
819
        rq.Opcode(51),
 
820
        rq.Pad(1),
 
821
        rq.RequestLength(),
 
822
        rq.LengthOf('path', 2),
 
823
        rq.Pad(2),
 
824
        rq.List('path', rq.Str),
 
825
        )
 
826
 
 
827
class GetFontPath(rq.ReplyRequest):
 
828
    _request = rq.Struct(
 
829
        rq.Opcode(52),
 
830
        rq.Pad(1),
 
831
        rq.RequestLength(),
 
832
        )
 
833
 
 
834
    _reply = rq.Struct(
 
835
        rq.ReplyCode(),
 
836
        rq.Pad(1),
 
837
        rq.Card16('sequence_number'),
 
838
        rq.ReplyLength(),
 
839
        rq.LengthOf('paths', 2),
 
840
        rq.Pad(22),
 
841
        rq.List('paths', rq.Str),
 
842
        )
 
843
 
 
844
class CreatePixmap(rq.Request):
 
845
    _request = rq.Struct(
 
846
        rq.Opcode(53),
 
847
        rq.Card8('depth'),
 
848
        rq.RequestLength(),
 
849
        rq.Pixmap('pid'),
 
850
        rq.Drawable('drawable'),
 
851
        rq.Card16('width'),
 
852
        rq.Card16('height'),
 
853
        )
 
854
 
 
855
class FreePixmap(rq.Request):
 
856
    _request = rq.Struct(
 
857
        rq.Opcode(54),
 
858
        rq.Pad(1),
 
859
        rq.RequestLength(),
 
860
        rq.Pixmap('pixmap')
 
861
        )
 
862
 
 
863
class CreateGC(rq.Request):
 
864
    _request = rq.Struct(
 
865
        rq.Opcode(55),
 
866
        rq.Pad(1),
 
867
        rq.RequestLength(),
 
868
        rq.GC('cid'),
 
869
        rq.Drawable('drawable'),
 
870
        structs.GCValues('attrs'),
 
871
        )
 
872
 
 
873
class ChangeGC(rq.Request):
 
874
    _request = rq.Struct(
 
875
        rq.Opcode(56),
 
876
        rq.Pad(1),
 
877
        rq.RequestLength(),
 
878
        rq.GC('gc'),
 
879
        structs.GCValues('attrs'),
 
880
        )
 
881
 
 
882
class CopyGC(rq.Request):
 
883
    _request = rq.Struct(
 
884
        rq.Opcode(57),
 
885
        rq.Pad(1),
 
886
        rq.RequestLength(),
 
887
        rq.GC('src_gc'),
 
888
        rq.GC('dst_gc'),
 
889
        rq.Card32('mask'),
 
890
        )
 
891
 
 
892
class SetDashes(rq.Request):
 
893
    _request = rq.Struct(
 
894
        rq.Opcode(58),
 
895
        rq.Pad(1),
 
896
        rq.RequestLength(),
 
897
        rq.GC('gc'),
 
898
        rq.Card16('dash_offset'),
 
899
        rq.LengthOf('dashes', 2),
 
900
        rq.List('dashes', rq.Card8Obj),
 
901
        )
 
902
 
 
903
class SetClipRectangles(rq.Request):
 
904
    _request = rq.Struct(
 
905
        rq.Opcode(59),
 
906
        rq.Set('ordering', 1, (X.Unsorted, X.YSorted, X.YXSorted, X.YXBanded)),
 
907
        rq.RequestLength(),
 
908
        rq.GC('gc'),
 
909
        rq.Int16('x_origin'),
 
910
        rq.Int16('y_origin'),
 
911
        rq.List('rectangles', structs.Rectangle),
 
912
        )
 
913
 
 
914
class FreeGC(rq.Request):
 
915
    _request = rq.Struct(
 
916
        rq.Opcode(60),
 
917
        rq.Pad(1),
 
918
        rq.RequestLength(),
 
919
        rq.GC('gc')
 
920
        )
 
921
 
 
922
class ClearArea(rq.Request):
 
923
    _request = rq.Struct(
 
924
        rq.Opcode(61),
 
925
        rq.Bool('exposures'),
 
926
        rq.RequestLength(),
 
927
        rq.Window('window'),
 
928
        rq.Int16('x'),
 
929
        rq.Int16('y'),
 
930
        rq.Card16('width'),
 
931
        rq.Card16('height'),
 
932
        )
 
933
 
 
934
class CopyArea(rq.Request):
 
935
    _request = rq.Struct(
 
936
        rq.Opcode(62),
 
937
        rq.Pad(1),
 
938
        rq.RequestLength(),
 
939
        rq.Drawable('src_drawable'),
 
940
        rq.Drawable('dst_drawable'),
 
941
        rq.GC('gc'),
 
942
        rq.Int16('src_x'),
 
943
        rq.Int16('src_y'),
 
944
        rq.Int16('dst_x'),
 
945
        rq.Int16('dst_y'),
 
946
        rq.Card16('width'),
 
947
        rq.Card16('height'),
 
948
        )
 
949
 
 
950
class CopyPlane(rq.Request):
 
951
    _request = rq.Struct(
 
952
        rq.Opcode(63),
 
953
        rq.Pad(1),
 
954
        rq.RequestLength(),
 
955
        rq.Drawable('src_drawable'),
 
956
        rq.Drawable('dst_drawable'),
 
957
        rq.GC('gc'),
 
958
        rq.Int16('src_x'),
 
959
        rq.Int16('src_y'),
 
960
        rq.Int16('dst_x'),
 
961
        rq.Int16('dst_y'),
 
962
        rq.Card16('width'),
 
963
        rq.Card16('height'),
 
964
        rq.Card32('bit_plane'),
 
965
        )
 
966
 
 
967
class PolyPoint(rq.Request):
 
968
    _request = rq.Struct(
 
969
        rq.Opcode(64),
 
970
        rq.Set('coord_mode', 1, (X.CoordModeOrigin, X.CoordModePrevious)),
 
971
        rq.RequestLength(),
 
972
        rq.Drawable('drawable'),
 
973
        rq.GC('gc'),
 
974
        rq.List('points', structs.Point),
 
975
        )
 
976
 
 
977
class PolyLine(rq.Request):
 
978
    _request = rq.Struct(
 
979
        rq.Opcode(65),
 
980
        rq.Set('coord_mode', 1, (X.CoordModeOrigin, X.CoordModePrevious)),
 
981
        rq.RequestLength(),
 
982
        rq.Drawable('drawable'),
 
983
        rq.GC('gc'),
 
984
        rq.List('points', structs.Point),
 
985
        )
 
986
 
 
987
 
 
988
class PolySegment(rq.Request):
 
989
    _request = rq.Struct(
 
990
        rq.Opcode(66),
 
991
        rq.Pad(1),
 
992
        rq.RequestLength(),
 
993
        rq.Drawable('drawable'),
 
994
        rq.GC('gc'),
 
995
        rq.List('segments', structs.Segment),
 
996
        )
 
997
 
 
998
 
 
999
class PolyRectangle(rq.Request):
 
1000
    _request = rq.Struct(
 
1001
        rq.Opcode(67),
 
1002
        rq.Pad(1),
 
1003
        rq.RequestLength(),
 
1004
        rq.Drawable('drawable'),
 
1005
        rq.GC('gc'),
 
1006
        rq.List('rectangles', structs.Rectangle),
 
1007
        )
 
1008
 
 
1009
class PolyArc(rq.Request):
 
1010
    _request = rq.Struct(
 
1011
        rq.Opcode(68),
 
1012
        rq.Pad(1),
 
1013
        rq.RequestLength(),
 
1014
        rq.Drawable('drawable'),
 
1015
        rq.GC('gc'),
 
1016
        rq.List('arcs', structs.Arc),
 
1017
        )
 
1018
 
 
1019
class FillPoly(rq.Request):
 
1020
    _request = rq.Struct(
 
1021
        rq.Opcode(69),
 
1022
        rq.Pad(1),
 
1023
        rq.RequestLength(),
 
1024
        rq.Drawable('drawable'),
 
1025
        rq.GC('gc'),
 
1026
        rq.Set('shape', 1, (X.Complex, X.Nonconvex, X.Convex)),
 
1027
        rq.Set('coord_mode', 1, (X.CoordModeOrigin, X.CoordModePrevious)),
 
1028
        rq.Pad(2),
 
1029
        rq.List('points', structs.Point),
 
1030
        )
 
1031
 
 
1032
class PolyFillRectangle(rq.Request):
 
1033
    _request = rq.Struct(
 
1034
        rq.Opcode(70),
 
1035
        rq.Pad(1),
 
1036
        rq.RequestLength(),
 
1037
        rq.Drawable('drawable'),
 
1038
        rq.GC('gc'),
 
1039
        rq.List('rectangles', structs.Rectangle),
 
1040
        )
 
1041
 
 
1042
class PolyFillArc(rq.Request):
 
1043
    _request = rq.Struct(
 
1044
        rq.Opcode(71),
 
1045
        rq.Pad(1),
 
1046
        rq.RequestLength(),
 
1047
        rq.Drawable('drawable'),
 
1048
        rq.GC('gc'),
 
1049
        rq.List('arcs', structs.Arc),
 
1050
        )
 
1051
 
 
1052
class PutImage(rq.Request):
 
1053
    _request = rq.Struct(
 
1054
        rq.Opcode(72),
 
1055
        rq.Set('format', 1, (X.XYBitmap, X.XYPixmap, X.ZPixmap)),
 
1056
        rq.RequestLength(),
 
1057
        rq.Drawable('drawable'),
 
1058
        rq.GC('gc'),
 
1059
        rq.Card16('width'),
 
1060
        rq.Card16('height'),
 
1061
        rq.Int16('dst_x'),
 
1062
        rq.Int16('dst_y'),
 
1063
        rq.Card8('left_pad'),
 
1064
        rq.Card8('depth'),
 
1065
        rq.Pad(2),
 
1066
        rq.String8('data'),
 
1067
        )
 
1068
 
 
1069
class GetImage(rq.ReplyRequest):
 
1070
    _request = rq.Struct(
 
1071
        rq.Opcode(73),
 
1072
        rq.Set('format', 1, (X.XYPixmap, X.ZPixmap)),
 
1073
        rq.RequestLength(),
 
1074
        rq.Drawable('drawable'),
 
1075
        rq.Int16('x'),
 
1076
        rq.Int16('y'),
 
1077
        rq.Card16('width'),
 
1078
        rq.Card16('height'),
 
1079
        rq.Card32('plane_mask'),
 
1080
        )
 
1081
 
 
1082
    _reply = rq.Struct(
 
1083
        rq.ReplyCode(),
 
1084
        rq.Card8('depth'),
 
1085
        rq.Card16('sequence_number'),
 
1086
        rq.ReplyLength(),
 
1087
        rq.Card32('visual'),
 
1088
        rq.Pad(20),
 
1089
        rq.String8('data'),
 
1090
        )
 
1091
 
 
1092
class PolyText8(rq.Request):
 
1093
    _request = rq.Struct(
 
1094
        rq.Opcode(74),
 
1095
        rq.Pad(1),
 
1096
        rq.RequestLength(),
 
1097
        rq.Drawable('drawable'),
 
1098
        rq.GC('gc'),
 
1099
        rq.Int16('x'),
 
1100
        rq.Int16('y'),
 
1101
        rq.TextElements8('items'),
 
1102
        )
 
1103
 
 
1104
class PolyText16(rq.Request):
 
1105
    _request = rq.Struct(
 
1106
        rq.Opcode(75),
 
1107
        rq.Pad(1),
 
1108
        rq.RequestLength(),
 
1109
        rq.Drawable('drawable'),
 
1110
        rq.GC('gc'),
 
1111
        rq.Int16('x'),
 
1112
        rq.Int16('y'),
 
1113
        rq.TextElements16('items'),
 
1114
        )
 
1115
 
 
1116
class ImageText8(rq.Request):
 
1117
    _request = rq.Struct(
 
1118
        rq.Opcode(76),
 
1119
        rq.LengthOf('string', 1),
 
1120
        rq.RequestLength(),
 
1121
        rq.Drawable('drawable'),
 
1122
        rq.GC('gc'),
 
1123
        rq.Int16('x'),
 
1124
        rq.Int16('y'),
 
1125
        rq.String8('string'),
 
1126
        )
 
1127
 
 
1128
class ImageText16(rq.Request):
 
1129
    _request = rq.Struct(
 
1130
        rq.Opcode(77),
 
1131
        rq.LengthOf('string', 1),
 
1132
        rq.RequestLength(),
 
1133
        rq.Drawable('drawable'),
 
1134
        rq.GC('gc'),
 
1135
        rq.Int16('x'),
 
1136
        rq.Int16('y'),
 
1137
        rq.String16('string'),
 
1138
        )
 
1139
 
 
1140
class CreateColormap(rq.Request):
 
1141
    _request = rq.Struct(
 
1142
        rq.Opcode(78),
 
1143
        rq.Set('alloc', 1, (X.AllocNone, X.AllocAll)),
 
1144
        rq.RequestLength(),
 
1145
        rq.Colormap('mid'),
 
1146
        rq.Window('window'),
 
1147
        rq.Card32('visual'),
 
1148
        )
 
1149
 
 
1150
class FreeColormap(rq.Request):
 
1151
    _request = rq.Struct(
 
1152
        rq.Opcode(79),
 
1153
        rq.Pad(1),
 
1154
        rq.RequestLength(),
 
1155
        rq.Colormap('cmap')
 
1156
        )
 
1157
 
 
1158
class CopyColormapAndFree(rq.Request):
 
1159
    _request = rq.Struct(
 
1160
        rq.Opcode(80),
 
1161
        rq.Pad(1),
 
1162
        rq.RequestLength(),
 
1163
        rq.Colormap('mid'),
 
1164
        rq.Colormap('src_cmap'),
 
1165
        )
 
1166
 
 
1167
class InstallColormap(rq.Request):
 
1168
    _request = rq.Struct(
 
1169
        rq.Opcode(81),
 
1170
        rq.Pad(1),
 
1171
        rq.RequestLength(),
 
1172
        rq.Colormap('cmap')
 
1173
        )
 
1174
 
 
1175
class UninstallColormap(rq.Request):
 
1176
    _request = rq.Struct(
 
1177
        rq.Opcode(82),
 
1178
        rq.Pad(1),
 
1179
        rq.RequestLength(),
 
1180
        rq.Colormap('cmap')
 
1181
        )
 
1182
 
 
1183
class ListInstalledColormaps(rq.ReplyRequest):
 
1184
    _request = rq.Struct(
 
1185
        rq.Opcode(83),
 
1186
        rq.Pad(1),
 
1187
        rq.RequestLength(),
 
1188
        rq.Window('window')
 
1189
        )
 
1190
 
 
1191
    _reply = rq.Struct(
 
1192
        rq.ReplyCode(),
 
1193
        rq.Pad(1),
 
1194
        rq.Card16('sequence_number'),
 
1195
        rq.ReplyLength(),
 
1196
        rq.LengthOf('cmaps', 2),
 
1197
        rq.Pad(22),
 
1198
        rq.List('cmaps', rq.ColormapObj),
 
1199
        )
 
1200
 
 
1201
class AllocColor(rq.ReplyRequest):
 
1202
    _request = rq.Struct(
 
1203
        rq.Opcode(84),
 
1204
        rq.Pad(1),
 
1205
        rq.RequestLength(),
 
1206
        rq.Colormap('cmap'),
 
1207
        rq.Card16('red'),
 
1208
        rq.Card16('green'),
 
1209
        rq.Card16('blue'),
 
1210
        rq.Pad(2),
 
1211
        )
 
1212
 
 
1213
    _reply = rq.Struct(
 
1214
        rq.ReplyCode(),
 
1215
        rq.Pad(1),
 
1216
        rq.Card16('sequence_number'),
 
1217
        rq.ReplyLength(),
 
1218
        rq.Card16('red'),
 
1219
        rq.Card16('green'),
 
1220
        rq.Card16('blue'),
 
1221
        rq.Pad(2),
 
1222
        rq.Card32('pixel'),
 
1223
        rq.Pad(12),
 
1224
        )
 
1225
 
 
1226
class AllocNamedColor(rq.ReplyRequest):
 
1227
    _request = rq.Struct(
 
1228
        rq.Opcode(85),
 
1229
        rq.Pad(1),
 
1230
        rq.RequestLength(),
 
1231
        rq.Colormap('cmap'),
 
1232
        rq.LengthOf('name', 2),
 
1233
        rq.Pad(2),
 
1234
        rq.String8('name'),
 
1235
        )
 
1236
 
 
1237
    _reply = rq.Struct(
 
1238
        rq.ReplyCode(),
 
1239
        rq.Pad(1),
 
1240
        rq.Card16('sequence_number'),
 
1241
        rq.ReplyLength(),
 
1242
        rq.Card32('pixel'),
 
1243
        rq.Card16('exact_red'),
 
1244
        rq.Card16('exact_green'),
 
1245
        rq.Card16('exact_blue'),
 
1246
        rq.Card16('screen_red'),
 
1247
        rq.Card16('screen_green'),
 
1248
        rq.Card16('screen_blue'),
 
1249
        rq.Pad(8),
 
1250
        )
 
1251
 
 
1252
class AllocColorCells(rq.ReplyRequest):
 
1253
    _request = rq.Struct(
 
1254
        rq.Opcode(86),
 
1255
        rq.Bool('contiguous'),
 
1256
        rq.RequestLength(),
 
1257
        rq.Colormap('cmap'),
 
1258
        rq.Card16('colors'),
 
1259
        rq.Card16('planes'),
 
1260
        )
 
1261
 
 
1262
    _reply = rq.Struct(
 
1263
        rq.ReplyCode(),
 
1264
        rq.Pad(1),
 
1265
        rq.Card16('sequence_number'),
 
1266
        rq.ReplyLength(),
 
1267
        rq.LengthOf('pixels', 2),
 
1268
        rq.LengthOf('masks', 2),
 
1269
        rq.Pad(20),
 
1270
        rq.List('pixels', rq.Card32Obj),
 
1271
        rq.List('masks', rq.Card32Obj),
 
1272
        )
 
1273
 
 
1274
class AllocColorPlanes(rq.ReplyRequest):
 
1275
    _request = rq.Struct(
 
1276
        rq.Opcode(87),
 
1277
        rq.Bool('contiguous'),
 
1278
        rq.RequestLength(),
 
1279
        rq.Colormap('cmap'),
 
1280
        rq.Card16('colors'),
 
1281
        rq.Card16('red'),
 
1282
        rq.Card16('green'),
 
1283
        rq.Card16('blue'),
 
1284
        )
 
1285
 
 
1286
    _reply = rq.Struct(
 
1287
        rq.ReplyCode(),
 
1288
        rq.Pad(1),
 
1289
        rq.Card16('sequence_number'),
 
1290
        rq.ReplyLength(),
 
1291
        rq.LengthOf('pixels', 2),
 
1292
        rq.Pad(2),
 
1293
        rq.Card32('red_mask'),
 
1294
        rq.Card32('green_mask'),
 
1295
        rq.Card32('blue_mask'),
 
1296
        rq.Pad(8),
 
1297
        rq.List('pixels', rq.Card32Obj),
 
1298
        )
 
1299
 
 
1300
class FreeColors(rq.Request):
 
1301
    _request = rq.Struct(
 
1302
        rq.Opcode(88),
 
1303
        rq.Pad(1),
 
1304
        rq.RequestLength(),
 
1305
        rq.Colormap('cmap'),
 
1306
        rq.Card32('plane_mask'),
 
1307
        rq.List('pixels', rq.Card32Obj),
 
1308
        )
 
1309
 
 
1310
class StoreColors(rq.Request):
 
1311
    _request = rq.Struct(
 
1312
        rq.Opcode(89),
 
1313
        rq.Pad(1),
 
1314
        rq.RequestLength(),
 
1315
        rq.Colormap('cmap'),
 
1316
        rq.List('items', structs.ColorItem),
 
1317
        )
 
1318
 
 
1319
class StoreNamedColor(rq.Request):
 
1320
    _request = rq.Struct(
 
1321
        rq.Opcode(90),
 
1322
        rq.Card8('flags'),
 
1323
        rq.RequestLength(),
 
1324
        rq.Colormap('cmap'),
 
1325
        rq.Card32('pixel'),
 
1326
        rq.LengthOf('name', 2),
 
1327
        rq.Pad(2),
 
1328
        rq.String8('name'),
 
1329
        )
 
1330
 
 
1331
class QueryColors(rq.ReplyRequest):
 
1332
    _request = rq.Struct(
 
1333
        rq.Opcode(91),
 
1334
        rq.Pad(1),
 
1335
        rq.RequestLength(),
 
1336
        rq.Colormap('cmap'),
 
1337
        rq.List('pixels', rq.Card32Obj),
 
1338
        )
 
1339
 
 
1340
    _reply = rq.Struct(
 
1341
        rq.ReplyCode(),
 
1342
        rq.Pad(1),
 
1343
        rq.Card16('sequence_number'),
 
1344
        rq.ReplyLength(),
 
1345
        rq.LengthOf('colors', 2),
 
1346
        rq.Pad(22),
 
1347
        rq.List('colors', structs.RGB),
 
1348
        )
 
1349
 
 
1350
class LookupColor(rq.ReplyRequest):
 
1351
    _request = rq.Struct(
 
1352
        rq.Opcode(92),
 
1353
        rq.Pad(1),
 
1354
        rq.RequestLength(),
 
1355
        rq.Colormap('cmap'),
 
1356
        rq.LengthOf('name', 2),
 
1357
        rq.Pad(2),
 
1358
        rq.String8('name'),
 
1359
        )
 
1360
 
 
1361
    _reply = rq.Struct(
 
1362
        rq.ReplyCode(),
 
1363
        rq.Pad(1),
 
1364
        rq.Card16('sequence_number'),
 
1365
        rq.ReplyLength(),
 
1366
        rq.Card16('exact_red'),
 
1367
        rq.Card16('exact_green'),
 
1368
        rq.Card16('exact_blue'),
 
1369
        rq.Card16('screen_red'),
 
1370
        rq.Card16('screen_green'),
 
1371
        rq.Card16('screen_blue'),
 
1372
        rq.Pad(12),
 
1373
        )
 
1374
 
 
1375
 
 
1376
class CreateCursor(rq.Request):
 
1377
    _request = rq.Struct(
 
1378
        rq.Opcode(93),
 
1379
        rq.Pad(1),
 
1380
        rq.RequestLength(),
 
1381
        rq.Cursor('cid'),
 
1382
        rq.Pixmap('source'),
 
1383
        rq.Pixmap('mask'),
 
1384
        rq.Card16('fore_red'),
 
1385
        rq.Card16('fore_green'),
 
1386
        rq.Card16('fore_blue'),
 
1387
        rq.Card16('back_red'),
 
1388
        rq.Card16('back_green'),
 
1389
        rq.Card16('back_blue'),
 
1390
        rq.Card16('x'),
 
1391
        rq.Card16('y'),
 
1392
        )
 
1393
 
 
1394
class CreateGlyphCursor(rq.Request):
 
1395
    _request = rq.Struct(
 
1396
        rq.Opcode(94),
 
1397
        rq.Pad(1),
 
1398
        rq.RequestLength(),
 
1399
        rq.Cursor('cid'),
 
1400
        rq.Font('source'),
 
1401
        rq.Font('mask'),
 
1402
        rq.Card16('source_char'),
 
1403
        rq.Card16('mask_char'),
 
1404
        rq.Card16('fore_red'),
 
1405
        rq.Card16('fore_green'),
 
1406
        rq.Card16('fore_blue'),
 
1407
        rq.Card16('back_red'),
 
1408
        rq.Card16('back_green'),
 
1409
        rq.Card16('back_blue'),
 
1410
        )
 
1411
 
 
1412
class FreeCursor(rq.Request):
 
1413
    _request = rq.Struct(
 
1414
        rq.Opcode(95),
 
1415
        rq.Pad(1),
 
1416
        rq.RequestLength(),
 
1417
        rq.Cursor('cursor')
 
1418
        )
 
1419
 
 
1420
class RecolorCursor(rq.Request):
 
1421
    _request = rq.Struct(
 
1422
        rq.Opcode(96),
 
1423
        rq.Pad(1),
 
1424
        rq.RequestLength(),
 
1425
        rq.Cursor('cursor'),
 
1426
        rq.Card16('fore_red'),
 
1427
        rq.Card16('fore_green'),
 
1428
        rq.Card16('fore_blue'),
 
1429
        rq.Card16('back_red'),
 
1430
        rq.Card16('back_green'),
 
1431
        rq.Card16('back_blue'),
 
1432
        )
 
1433
 
 
1434
class QueryBestSize(rq.ReplyRequest):
 
1435
    _request = rq.Struct(
 
1436
        rq.Opcode(97),
 
1437
        rq.Set('item_class', 1, (X.CursorShape, X.TileShape, X.StippleShape)),
 
1438
        rq.RequestLength(),
 
1439
        rq.Drawable('drawable'),
 
1440
        rq.Card16('width'),
 
1441
        rq.Card16('height'),
 
1442
        )
 
1443
 
 
1444
    _reply = rq.Struct(
 
1445
        rq.ReplyCode(),
 
1446
        rq.Pad(1),
 
1447
        rq.Card16('sequence_number'),
 
1448
        rq.ReplyLength(),
 
1449
        rq.Card16('width'),
 
1450
        rq.Card16('height'),
 
1451
        rq.Pad(20),
 
1452
        )
 
1453
 
 
1454
class QueryExtension(rq.ReplyRequest):
 
1455
    _request = rq.Struct(
 
1456
        rq.Opcode(98),
 
1457
        rq.Pad(1),
 
1458
        rq.RequestLength(),
 
1459
        rq.LengthOf('name', 2),
 
1460
        rq.Pad(2),
 
1461
        rq.String8('name'),
 
1462
        )
 
1463
 
 
1464
    _reply = rq.Struct(
 
1465
        rq.ReplyCode(),
 
1466
        rq.Pad(1),
 
1467
        rq.Card16('sequence_number'),
 
1468
        rq.ReplyLength(),
 
1469
        rq.Card8('present'),
 
1470
        rq.Card8('major_opcode'),
 
1471
        rq.Card8('first_event'),
 
1472
        rq.Card8('first_error'),
 
1473
        rq.Pad(20),
 
1474
        )
 
1475
 
 
1476
class ListExtensions(rq.ReplyRequest):
 
1477
    _request = rq.Struct(
 
1478
        rq.Opcode(99),
 
1479
        rq.Pad(1),
 
1480
        rq.RequestLength(),
 
1481
        )
 
1482
 
 
1483
    _reply = rq.Struct(
 
1484
        rq.ReplyCode(),
 
1485
        rq.LengthOf('names', 1),
 
1486
        rq.Card16('sequence_number'),
 
1487
        rq.ReplyLength(),
 
1488
        rq.Pad(24),
 
1489
        rq.List('names', rq.Str),
 
1490
        )
 
1491
 
 
1492
class ChangeKeyboardMapping(rq.Request):
 
1493
    _request = rq.Struct(
 
1494
        rq.Opcode(100),
 
1495
        rq.LengthOf('keysyms', 1),
 
1496
        rq.RequestLength(),
 
1497
        rq.Card8('first_keycode'),
 
1498
        rq.Format('keysyms', 1),
 
1499
        rq.Pad(2),
 
1500
        rq.KeyboardMapping('keysyms'),
 
1501
        )
 
1502
 
 
1503
class GetKeyboardMapping(rq.ReplyRequest):
 
1504
    _request = rq.Struct(
 
1505
        rq.Opcode(101),
 
1506
        rq.Pad(1),
 
1507
        rq.RequestLength(),
 
1508
        rq.Card8('first_keycode'),
 
1509
        rq.Card8('count'),
 
1510
        rq.Pad(2),
 
1511
        )
 
1512
 
 
1513
    _reply = rq.Struct(
 
1514
        rq.ReplyCode(),
 
1515
        rq.Format('keysyms', 1),
 
1516
        rq.Card16('sequence_number'),
 
1517
        rq.ReplyLength(),
 
1518
        rq.Pad(24),
 
1519
        rq.KeyboardMapping('keysyms'),
 
1520
        )
 
1521
 
 
1522
 
 
1523
class ChangeKeyboardControl(rq.Request):
 
1524
    _request = rq.Struct(
 
1525
        rq.Opcode(102),
 
1526
        rq.Pad(1),
 
1527
        rq.RequestLength(),
 
1528
        rq.ValueList( 'attrs', 4, 0,
 
1529
                      rq.Int8('key_click_percent'),
 
1530
                      rq.Int8('bell_percent'),
 
1531
                      rq.Int16('bell_pitch'),
 
1532
                      rq.Int16('bell_duration'),
 
1533
                      rq.Card8('led'),
 
1534
                      rq.Set('led_mode', 1, (X.LedModeOff, X.LedModeOn)),
 
1535
                      rq.Card8('key'),
 
1536
                      rq.Set('auto_repeat_mode', 1, (X.AutoRepeatModeOff,
 
1537
                                                     X.AutoRepeatModeOn,
 
1538
                                                     X.AutoRepeatModeDefault))
 
1539
                      )
 
1540
        )
 
1541
 
 
1542
class GetKeyboardControl(rq.ReplyRequest):
 
1543
    _request = rq.Struct(
 
1544
        rq.Opcode(103),
 
1545
        rq.Pad(1),
 
1546
        rq.RequestLength(),
 
1547
        )
 
1548
 
 
1549
    _reply = rq.Struct(
 
1550
        rq.ReplyCode(),
 
1551
        rq.Card8('global_auto_repeat'),
 
1552
        rq.Card16('sequence_number'),
 
1553
        rq.ReplyLength(),
 
1554
        rq.Card32('led_mask'),
 
1555
        rq.Card8('key_click_percent'),
 
1556
        rq.Card8('bell_percent'),
 
1557
        rq.Card16('bell_pitch'),
 
1558
        rq.Card16('bell_duration'),
 
1559
        rq.Pad(2),
 
1560
        rq.FixedList('auto_repeats', 32, rq.Card8Obj),
 
1561
        )
 
1562
 
 
1563
class Bell(rq.Request):
 
1564
    _request = rq.Struct(
 
1565
        rq.Opcode(104),
 
1566
        rq.Int8('percent'),
 
1567
        rq.RequestLength(),
 
1568
        )
 
1569
 
 
1570
class ChangePointerControl(rq.Request):
 
1571
    _request = rq.Struct(
 
1572
        rq.Opcode(105),
 
1573
        rq.Pad(1),
 
1574
        rq.RequestLength(),
 
1575
        rq.Int16('accel_num'),
 
1576
        rq.Int16('accel_denum'),
 
1577
        rq.Int16('threshold'),
 
1578
        rq.Bool('do_accel'),
 
1579
        rq.Bool('do_thresh'),
 
1580
        )
 
1581
 
 
1582
class GetPointerControl(rq.ReplyRequest):
 
1583
    _request = rq.Struct(
 
1584
        rq.Opcode(106),
 
1585
        rq.Pad(1),
 
1586
        rq.RequestLength(),
 
1587
        )
 
1588
 
 
1589
    _reply = rq.Struct(
 
1590
        rq.ReplyCode(),
 
1591
        rq.Pad(1),
 
1592
        rq.Card16('sequence_number'),
 
1593
        rq.ReplyLength(),
 
1594
        rq.Card16('accel_num'),
 
1595
        rq.Card16('accel_denom'),
 
1596
        rq.Card16('threshold'),
 
1597
        rq.Pad(18),
 
1598
        )
 
1599
 
 
1600
class SetScreenSaver(rq.Request):
 
1601
    _request = rq.Struct(
 
1602
        rq.Opcode(107),
 
1603
        rq.Pad(1),
 
1604
        rq.RequestLength(),
 
1605
        rq.Int16('timeout'),
 
1606
        rq.Int16('interval'),
 
1607
        rq.Set('prefer_blank', 1, (X.DontPreferBlanking,
 
1608
                                   X.PreferBlanking,
 
1609
                                   X.DefaultBlanking)),
 
1610
        rq.Set('allow_exposures', 1, (X.DontAllowExposures,
 
1611
                                      X.AllowExposures,
 
1612
                                      X.DefaultExposures)),
 
1613
        rq.Pad(2),
 
1614
        )
 
1615
 
 
1616
class GetScreenSaver(rq.ReplyRequest):
 
1617
    _request = rq.Struct(
 
1618
        rq.Opcode(108),
 
1619
        rq.Pad(1),
 
1620
        rq.RequestLength(),
 
1621
        )
 
1622
 
 
1623
    _reply = rq.Struct(
 
1624
        rq.ReplyCode(),
 
1625
        rq.Pad(1),
 
1626
        rq.Card16('sequence_number'),
 
1627
        rq.ReplyLength(),
 
1628
        rq.Card16('timeout'),
 
1629
        rq.Card16('interval'),
 
1630
        rq.Card8('prefer_blanking'),
 
1631
        rq.Card8('allow_exposures'),
 
1632
        rq.Pad(18),
 
1633
        )
 
1634
 
 
1635
class ChangeHosts(rq.Request):
 
1636
    _request = rq.Struct(
 
1637
        rq.Opcode(109),
 
1638
        rq.Set('mode', 1, (X.HostInsert, X.HostDelete)),
 
1639
        rq.RequestLength(),
 
1640
        rq.Set('host_family', 1, (X.FamilyInternet, X.FamilyDECnet, X.FamilyChaos)),
 
1641
        rq.Pad(1),
 
1642
        rq.LengthOf('host', 2),
 
1643
        rq.List('host', rq.Card8Obj)
 
1644
        )
 
1645
 
 
1646
class ListHosts(rq.ReplyRequest):
 
1647
    _request = rq.Struct(
 
1648
        rq.Opcode(110),
 
1649
        rq.Pad(1),
 
1650
        rq.RequestLength(),
 
1651
        )
 
1652
 
 
1653
    _reply = rq.Struct(
 
1654
        rq.ReplyCode(),
 
1655
        rq.Card8('mode'),
 
1656
        rq.Card16('sequence_number'),
 
1657
        rq.ReplyLength(),
 
1658
        rq.LengthOf('hosts', 2),
 
1659
        rq.Pad(22),
 
1660
        rq.List('hosts', structs.Host),
 
1661
        )
 
1662
 
 
1663
class SetAccessControl(rq.Request):
 
1664
    _request = rq.Struct(
 
1665
        rq.Opcode(111),
 
1666
        rq.Set('mode', 1, (X.DisableAccess, X.EnableAccess)),
 
1667
        rq.RequestLength(),
 
1668
        )
 
1669
 
 
1670
class SetCloseDownMode(rq.Request):
 
1671
    _request = rq.Struct(
 
1672
        rq.Opcode(112),
 
1673
        rq.Set('mode', 1, (X.DestroyAll, X.RetainPermanent, X.RetainTemporary)),
 
1674
        rq.RequestLength(),
 
1675
        )
 
1676
 
 
1677
class KillClient(rq.Request):
 
1678
    _request = rq.Struct(
 
1679
        rq.Opcode(113),
 
1680
        rq.Pad(1),
 
1681
        rq.RequestLength(),
 
1682
        rq.Resource('resource')
 
1683
        )
 
1684
 
 
1685
class RotateProperties(rq.Request):
 
1686
    _request = rq.Struct(
 
1687
        rq.Opcode(114),
 
1688
        rq.Pad(1),
 
1689
        rq.RequestLength(),
 
1690
        rq.Window('window'),
 
1691
        rq.LengthOf('properties', 2),
 
1692
        rq.Int16('delta'),
 
1693
        rq.List('properties', rq.Card32Obj),
 
1694
        )
 
1695
 
 
1696
class ForceScreenSaver(rq.Request):
 
1697
    _request = rq.Struct(
 
1698
        rq.Opcode(115),
 
1699
        rq.Set('mode', 1, (X.ScreenSaverReset, X.ScreenSaverActive)),
 
1700
        rq.RequestLength(),
 
1701
        )
 
1702
 
 
1703
class SetPointerMapping(rq.ReplyRequest):
 
1704
    _request = rq.Struct(
 
1705
        rq.Opcode(116),
 
1706
        rq.LengthOf('map', 1),
 
1707
        rq.RequestLength(),
 
1708
        rq.List('map', rq.Card8Obj),
 
1709
        )
 
1710
 
 
1711
    _reply = rq.Struct(
 
1712
        rq.ReplyCode(),
 
1713
        rq.Card8('status'),
 
1714
        rq.Card16('sequence_number'),
 
1715
        rq.ReplyLength(),
 
1716
        rq.Pad(24),
 
1717
        )
 
1718
 
 
1719
class GetPointerMapping(rq.ReplyRequest):
 
1720
    _request = rq.Struct(
 
1721
        rq.Opcode(117),
 
1722
        rq.Pad(1),
 
1723
        rq.RequestLength(),
 
1724
        )
 
1725
 
 
1726
    _reply = rq.Struct(
 
1727
        rq.ReplyCode(),
 
1728
        rq.LengthOf('map', 1),
 
1729
        rq.Card16('sequence_number'),
 
1730
        rq.ReplyLength(),
 
1731
        rq.Pad(24),
 
1732
        rq.List('map', rq.Card8Obj),
 
1733
        )
 
1734
 
 
1735
class SetModifierMapping(rq.ReplyRequest):
 
1736
    _request = rq.Struct(
 
1737
        rq.Opcode(118),
 
1738
        rq.Format('keycodes', 1),
 
1739
        rq.RequestLength(),
 
1740
        rq.ModifierMapping('keycodes')
 
1741
        )
 
1742
 
 
1743
    _reply = rq.Struct(
 
1744
        rq.ReplyCode(),
 
1745
        rq.Card8('status'),
 
1746
        rq.Card16('sequence_number'),
 
1747
        rq.ReplyLength(),
 
1748
        rq.Pad(24),
 
1749
        )
 
1750
 
 
1751
class GetModifierMapping(rq.ReplyRequest):
 
1752
    _request = rq.Struct(
 
1753
        rq.Opcode(119),
 
1754
        rq.Pad(1),
 
1755
        rq.RequestLength(),
 
1756
        )
 
1757
 
 
1758
    _reply = rq.Struct(
 
1759
        rq.ReplyCode(),
 
1760
        rq.Format('keycodes', 1),
 
1761
        rq.Card16('sequence_number'),
 
1762
        rq.ReplyLength(),
 
1763
        rq.Pad(24),
 
1764
        rq.ModifierMapping('keycodes')
 
1765
        )
 
1766
 
 
1767
class NoOperation(rq.Request):
 
1768
    _request = rq.Struct(
 
1769
        rq.Opcode(127),
 
1770
        rq.Pad(1),
 
1771
        rq.RequestLength(),
 
1772
        )
 
1773
 
 
1774
 
 
1775
major_codes = {
 
1776
    1: CreateWindow,
 
1777
    2: ChangeWindowAttributes,
 
1778
    3: GetWindowAttributes,
 
1779
    4: DestroyWindow,
 
1780
    5: DestroySubWindows,
 
1781
    6: ChangeSaveSet,
 
1782
    7: ReparentWindow,
 
1783
    8: MapWindow,
 
1784
    9: MapSubwindows,
 
1785
    10: UnmapWindow,
 
1786
    11: UnmapSubwindows,
 
1787
    12: ConfigureWindow,
 
1788
    13: CirculateWindow,
 
1789
    14: GetGeometry,
 
1790
    15: QueryTree,
 
1791
    16: InternAtom,
 
1792
    17: GetAtomName,
 
1793
    18: ChangeProperty,
 
1794
    19: DeleteProperty,
 
1795
    20: GetProperty,
 
1796
    21: ListProperties,
 
1797
    22: SetSelectionOwner,
 
1798
    23: GetSelectionOwner,
 
1799
    24: ConvertSelection,
 
1800
    25: SendEvent,
 
1801
    26: GrabPointer,
 
1802
    27: UngrabPointer,
 
1803
    28: GrabButton,
 
1804
    29: UngrabButton,
 
1805
    30: ChangeActivePointerGrab,
 
1806
    31: GrabKeyboard,
 
1807
    32: UngrabKeyboard,
 
1808
    33: GrabKey,
 
1809
    34: UngrabKey,
 
1810
    35: AllowEvents,
 
1811
    36: GrabServer,
 
1812
    37: UngrabServer,
 
1813
    38: QueryPointer,
 
1814
    39: GetMotionEvents,
 
1815
    40: TranslateCoords,
 
1816
    41: WarpPointer,
 
1817
    42: SetInputFocus,
 
1818
    43: GetInputFocus,
 
1819
    44: QueryKeymap,
 
1820
    45: OpenFont,
 
1821
    46: CloseFont,
 
1822
    47: QueryFont,
 
1823
    48: QueryTextExtents,
 
1824
    49: ListFonts,
 
1825
    50: ListFontsWithInfo,
 
1826
    51: SetFontPath,
 
1827
    52: GetFontPath,
 
1828
    53: CreatePixmap,
 
1829
    54: FreePixmap,
 
1830
    55: CreateGC,
 
1831
    56: ChangeGC,
 
1832
    57: CopyGC,
 
1833
    58: SetDashes,
 
1834
    59: SetClipRectangles,
 
1835
    60: FreeGC,
 
1836
    61: ClearArea,
 
1837
    62: CopyArea,
 
1838
    63: CopyPlane,
 
1839
    64: PolyPoint,
 
1840
    65: PolyLine,
 
1841
    66: PolySegment,
 
1842
    67: PolyRectangle,
 
1843
    68: PolyArc,
 
1844
    69: FillPoly,
 
1845
    70: PolyFillRectangle,
 
1846
    71: PolyFillArc,
 
1847
    72: PutImage,
 
1848
    73: GetImage,
 
1849
    74: PolyText8,
 
1850
    75: PolyText16,
 
1851
    76: ImageText8,
 
1852
    77: ImageText16,
 
1853
    78: CreateColormap,
 
1854
    79: FreeColormap,
 
1855
    80: CopyColormapAndFree,
 
1856
    81: InstallColormap,
 
1857
    82: UninstallColormap,
 
1858
    83: ListInstalledColormaps,
 
1859
    84: AllocColor,
 
1860
    85: AllocNamedColor,
 
1861
    86: AllocColorCells,
 
1862
    87: AllocColorPlanes,
 
1863
    88: FreeColors,
 
1864
    89: StoreColors,
 
1865
    90: StoreNamedColor,
 
1866
    91: QueryColors,
 
1867
    92: LookupColor,
 
1868
    93: CreateCursor,
 
1869
    94: CreateGlyphCursor,
 
1870
    95: FreeCursor,
 
1871
    96: RecolorCursor,
 
1872
    97: QueryBestSize,
 
1873
    98: QueryExtension,
 
1874
    99: ListExtensions,
 
1875
    100: ChangeKeyboardMapping,
 
1876
    101: GetKeyboardMapping,
 
1877
    102: ChangeKeyboardControl,
 
1878
    103: GetKeyboardControl,
 
1879
    104: Bell,
 
1880
    105: ChangePointerControl,
 
1881
    106: GetPointerControl,
 
1882
    107: SetScreenSaver,
 
1883
    108: GetScreenSaver,
 
1884
    109: ChangeHosts,
 
1885
    110: ListHosts,
 
1886
    111: SetAccessControl,
 
1887
    112: SetCloseDownMode,
 
1888
    113: KillClient,
 
1889
    114: RotateProperties,
 
1890
    115: ForceScreenSaver,
 
1891
    116: SetPointerMapping,
 
1892
    117: GetPointerMapping,
 
1893
    118: SetModifierMapping,
 
1894
    119: GetModifierMapping,
 
1895
    127: NoOperation,
 
1896
    }