Protocol/Constants.pm untested

filter: Statementstmt 0.0% 0 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 457 Podpod 0.0% 0 / 454 totaltotal 0.0% 0 / 959 CC 1 SCAR 6.9
CC
1
Cov
0%
StaticGray
2.0
StaticGrey
2.0
GrayScale
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 package X11::Protocol::Constants;
4  
5 # Copyright (C) 1997, 1999, 2003 Stephen McCamant. All rights
6 # reserved. This program is free software; you can redistribute and/or
7 # modify it under the same terms as Perl itself.
8  
9 use strict;
10 use Exporter;
11 use vars ('$VERSION', '@EXPORT', '@EXPORT_OK', '%EXPORT_TAGS', '@ISA');
12 $VERSION = 0.01;
13 @ISA = ('Exporter');
14  
15 # It seems as if the designers of the protocol started out trying to make
16 # all the constants distinct, got most of the way, then gave up.
17 # Protocol.pm has classes, and Xlib has longer names.
18 # There are just two bad collisions: Cap/Round vs. Join/Round and
19 # ALL the focus mode flags (that aren't also crossing notify ones).
20  
21 my @x_dot_h =
22 ('NoEventMask', 'KeyPressMask', 'KeyReleaseMask',
23 'ButtonPressMask', 'ButtonReleaseMask',
24 'EnterWindowMask', 'LeaveWindowMask',
25 'PointerMotionMask', 'PointerMotionHintMask',
26 'Button1MotionMask', 'Button2MotionMask',
27 'Button3MotionMask', 'Button4MotionMask',
28 'Button5MotionMask', 'ButtonMotionMask',
29 'KeymapStateMask', 'ExposureMask',
30 'VisibilityChangeMask', 'StructureNotifyMask',
31 'ResizeRedirectMask', 'SubstructureNotifyMask',
32 'SubstructureRedirectMask', 'FocusChangeMask',
33 'PropertyChangeMask', 'ColormapChangeMask',
34 'OwnerGrabButtonMask',
35  
36 'KeyPress' , 'KeyRelease', 'ButtonPress',
37 'ButtonRelease', 'MotionNotify', 'EnterNotify',
38 'LeaveNotify', 'FocusIn', 'FocusOut', 'KeymapNotify',
39 'Expose', 'GraphicsExposure', 'NoExposure',
40 'VisibilityNotify', 'CreateNotify', 'DestroyNotify',
41 'UnmapNotify', 'MapNotify', 'MapRequest',
42 'ReparentNotify', 'ConfigureNotify', 'ConfigureRequest',
43 'GravityNotify', 'ResizeRequest', 'CirculateNotify',
44 'CirculateRequest', 'PropertyNotify', 'SelectionClear',
45 'SelectionRequest', 'SelectionNotify', 'ColormapNotify',
46 'ClientMessage', 'MappingNotify', 'LASTEvent',
47  
48 'ShiftMask', 'LockMask', 'ControlMask', 'Mod1Mask',
49 'Mod2Mask', 'Mod3Mask', 'Mod4Mask', 'Mod5Mask',
50  
51 'ShiftMapIndex', 'LockMapIndex', 'ControlMapIndex',
52 'Mod1MapIndex', 'Mod2MapIndex', 'Mod3MapIndex',
53 'Mod4MapIndex', 'Mod5MapIndex',
54  
55 'Button1Mask', 'Button2Mask', 'Button3Mask',
56 'Button4Mask', 'Button5Mask',
57  
58 'Button1', 'Button2', 'Button3', 'Button4', 'Button5',
59  
60 'AnyModifier',
61  
62 'NotifyAncestor', 'NotifyVirtual', 'NotifyInferior',
63 'NotifyNonlinear', 'NotifyNonlinearVirtual',
64 'NotifyPointer', 'NotifyPointerRoot',
65 'NotifyDetailNone',
66  
67 'VisibilityUnobscured', 'VisibilityPartiallyObscured',
68 'VisibilityFullyObscured',
69  
70 'PlaceOnTop', 'PlaceOnBottom',
71  
72 'FamiliyInternet', 'FamiliyDECnet', 'FamiliyChaos',
73  
74 'PropertyNewValue', 'PropertyDeleted',
75  
76 'ColormapUninstalled', 'ColormapInstalled',
77  
78 'GrabModeSync', 'GrabModeAsync',
79  
80 'GrabSuccess', 'GrabInvalidTime', 'GrabNotViewable',
81 'GrabFrozen', 'AlreadyGrabbed',
82  
83 'AsyncPointer', 'SyncPointer', 'ReplayPointer',
84 'AsyncKeyboard', 'SyncKeyboard', 'ReplayKeyboard',
85 'AsyncBoth', 'SyncBoth',
86  
87 'RevertToNone', 'RevertToPointerRoot', 'RevertToParent',
88  
89 'BadRequest', 'BadValue', 'BadWindow', 'BadPixmap',
90 'BadAtom', 'BadCursor', 'BadFont', 'BadMatch',
91 'BadDrawable', 'BadAccess', 'BadAlloc', 'BadColormap',
92 'BadGC', 'BadIDChoice', 'BadName', 'BadLength',
93 'BadImplementation',
94  
95 'FirstExtensionError', 'LastExtensionError',
96  
97 'CopyFromParent', 'InputOutput', 'InputOnly',
98  
99 'ForgetGravity', 'StaticGravity', 'NorthWestGravity',
100 'NorthGravity', 'NorthEastGravity', 'WestGravity',
101 'CenterGravity', 'EastGravity', 'SouthWestGravity',
102 'SouthGravity', 'SouthEastGravity', 'UnmapGravity',
103  
104 'WhenMapped', 'Always',
105  
106 'NotUseful',
107  
108 'IsUnmapped', 'IsUnviewable', 'IsViewable',
109  
110 'SetModeInsert', 'SetModeDelete',
111  
112 'RetainPermanent', 'RetainTemporary',
113  
114 'DestroyAll',
115  
116 'Above', 'Below', 'TopIf', 'BottomIf', 'Opposite',
117  
118 'RaiseLowest', 'LowerHighest',
119  
120 'PropModeReplace', 'PropModePrepend', 'PropModeAppend',
121  
122 'GXclear', 'GXand', 'GXandReverse', 'GXcopy',
123 'GXandInverted', 'GXnoop', 'GXxor', 'GXor', 'GXnor',
124 'GXequiv', 'GXinvert', 'GXorReverse', 'GXcopyInverted',
125 'GXorInverted', 'GXnand', 'GXset',
126  
127 'LineSolid', 'LineOnOffDash', 'LineDoubleDash',
128  
129 'CapNotLast', 'CapButt', 'CapRound', 'CapProjecting',
130  
131 'JoinMiter', 'JoinRound', 'JoinBevel',
132  
133 'FillSolid', 'FillTiled', 'FillStippled',
134 'FillOpaqueStippled',
135  
136 'EvenOddRule', 'WindingRule',
137  
138 'ClipByChildren', 'IncludeInferiors',
139  
140 'YSorted', 'YXSorted', 'YXBanded',
141 'Unsorted',
142  
143 'CoordModeOrigin', 'CoordModePrevious',
144  
145 'Complex', 'Nonconvex', 'Convex',
146  
147 'ArcChord', 'ArcPieSlice',
148  
149 'FontLeftToRight', 'FontRightToLeft',
150  
151 'FontChange',
152  
153 'XYPixmap', 'ZPixmap', 'XYBitmap',
154  
155 'AllocNone', 'AllocAll',
156  
157 'DoRed', 'DoGreen', 'DoBlue',
158  
159 'CursorShape', 'TileShape', 'StippleShape',
160  
161 'AutoRepeatModeOff', 'AutoRepeatModeOn',
162 'AutoRepeatModeDefault',
163  
164 'LedModeOff', 'LedModeOn',
165  
166 'MappingModifier', 'MappingKeyboard', 'MappingPointer',
167  
168 'MappingSuccess', 'MappingBusy', 'MappingFailed',
169  
170 'DontPreferBlanking', 'PreferBlanking', 'DefaultBlanking',
171 'DisableScreenSaver', 'DisableScreenInterval',
172 'DontAllowExposures', 'AllowExposures', 'DefaultExposures',
173  
174 'ScreenSaverReset', 'ScreenSaverActive',
175  
176 'HostInsert', 'HostDelete',
177  
178 'DisableAccess', 'EnableAccess',
179  
180 'StaticGray', 'GrayScale', 'StaticColor',
181 'PseudoColor', 'TrueColor', 'DirectColor',
182  
183 'GreyScale', 'StaticGrey', 'StaticColour',
184 'PseudoColour', 'TrueColour', 'DirectColour',
185  
186 'LSBFirst', 'MSBFirst');
187  
188 my @protocol =
189 (
190 'StaticGray', 'GrayScale', 'StaticColor',
191 'PseudoColor', 'TrueColor', 'DirectColor',
192  
193 'GreyScale', 'StaticGrey', 'StaticColour',
194 'PseudoColour', 'TrueColour', 'DirectColour',
195  
196 'Forget', 'Static', 'NorthWest', 'North',
197 'NorthEast', 'West', 'Center', 'East',
198 'SouthWest', 'South', 'SouthEast', 'Unmap',
199  
200 'KeyPress', 'KeyRelease', 'ButtonPress', 'ButtonRelease',
201 'EnterWindow', 'LeaveWindow', 'PointerMotion',
202 'PointerMotionHint', 'Button1Motion', 'Button2Motion',
203 'Button3Motion', 'Button4Motion', 'Button5Motion',
204 'ButtonMotion', 'KeymapState', 'Exposure',
205 'VisibilityChange', 'StructureNotify', 'ResizeRedirect',
206 'SubstructureNotify', 'SubstructureRedirect',
207 'FocusChange', 'PropertyChange', 'ColormapChange',
208 'OwnerGrabButton',
209  
210 'MotionNotify', 'EnterNotify',
211 'LeaveNotify', 'FocusIn', 'FocusOut', 'KeymapNotify',
212 'Expose', 'GraphicsExposure', 'NoExposure',
213 'VisibilityNotify', 'CreateNotify', 'DestroyNotify',
214 'UnmapNotify', 'MapNotify', 'MapRequest',
215 'ReparentNotify', 'ConfigureNotify', 'ConfigureRequest',
216 'GravityNotify', 'ResizeRequest', 'CirculateNotify',
217 'CirculateRequest', 'PropertyNotify', 'SelectionClear',
218 'SelectionRequest', 'SelectionNotify',
219 'ColormapNotify', 'ClientMessage', 'MappingNotify',
220  
221 'Shift', 'Lock', 'Control', 'Mod1', 'Mod2', 'Mod3',
222 'Mod4', 'Mod5',
223  
224 'LeastSignificant', 'MostSignificant',
225  
226 'Never', 'WhenMapped', 'Always',
227  
228 'False', 'True',
229  
230 'CopyFromParent', 'InputOutput', 'InputOnly',
231  
232 'Unmapped', 'Unviewable', 'Viewable',
233  
234 'Above', 'Below', 'TopIf', 'BottomIf', 'Opposite',
235  
236 'RaiseLowest', 'LowerHighest',
237  
238 'Replace', 'Prepend', 'Append',
239  
240 'Ancestor', 'Virtual', 'Inferior', 'Nonlinear',
241 'NonlinearVirtual',
242  
243 'Normal', 'Grab', 'Ungrab', 'WhileGrabbed',
244  
245 'Unobscured', 'PartiallyObscured', 'FullyObscured',
246  
247 'Top', 'Bottom',
248  
249 'NewValue', 'Deleted',
250  
251 'Uninstalled', 'Installed',
252  
253 'Modifier', 'Keyboard', 'Pointer',
254  
255 'Synchronous', 'Asynchronous',
256  
257 'Success', 'AlreadyGrabbed', 'InvalidTime',
258 'NotViewable', 'Frozen',
259  
260 'AsyncPointer', 'SyncPointer', 'ReplayPointer',
261 'AsyncKeyboard', 'SyncKeyboard',
262 'ReplayKeyboard', 'AsyncBoth', 'SyncBoth',
263  
264 'None', 'PointerRoot', 'Parent',
265  
266 'LeftToRight', 'RightToLeft',
267  
268 'UnSorted', 'YSorted', 'YXSorted', 'YXBanded',
269  
270 'Origin', 'Previous',
271  
272 'Complex', 'Nonconvex', 'Convex',
273  
274 'Bitmap', 'XYPixmap', 'ZPixmap',
275  
276 'Cursor', 'Tile', 'Stipple',
277  
278 'Off', 'On', 'Default',
279  
280 'No', 'Yes', 'Default',
281  
282 'Insert', 'Delete',
283  
284 'Internet', 'DECnet', 'Chaos',
285  
286 'Disabled', 'Enabled',
287  
288 'Destroy', 'RetainPermanent', 'RetainTemporary',
289  
290 'Reset', 'Activate',
291  
292 'Success', 'Busy', 'Failed',
293  
294 'Clear', 'And', 'AndReverse', 'Copy',
295 'AndInverted', 'NoOp', 'Xor', 'Or', 'Nor', 'Equiv',
296 'Invert', 'OrReverse', 'CopyInverted', 'OrInverted',
297 'Nand', 'Set',
298  
299 'Solid', 'OnOffDash', 'DoubleDash',
300  
301 'NotLast', 'Butt', 'Round', 'Projecting',
302  
303 'Miter', 'Round', 'Bevel',
304  
305 'Solid', 'Tiled', 'Stippled', 'OpaqueStippled',
306  
307 'EvenOdd', 'Winding',
308  
309 'ClipByChildren', 'IncludeInferiors',
310  
311 'Chord', 'PieSlice');
312  
313 my @masks =
314 (
315 'KeyPress_mask', 'KeyRelease_mask', 'ButtonPress_mask',
316 'ButtonRelease_mask', 'EnterWindow_mask',
317 'LeaveWindow_mask', 'PointerMotion_mask',
318 'PointerMotionHint_mask', 'Button1Motion_mask',
319 'Button2Motion_mask', 'Button3Motion_mask',
320 'Button4Motion_mask', 'Button5Motion_mask',
321 'ButtonMotion_mask', 'KeymapState_mask',
322 'Exposure_mask', 'VisibilityChange_mask',
323 'StructureNotify_mask', 'ResizeRedirect_mask',
324 'SubstructureNotify_mask', 'SubstructureRedirect_mask',
325 'FocusChange_mask', 'PropertyChange_mask',
326 'ColormapChange_mask', 'OwnerGrabButton_mask',
327 );
328  
329 my @masks_m =
330 (
331 'KeyPress_m', 'KeyRelease_m', 'ButtonPress_m',
332 'ButtonRelease_m', 'EnterWindow_m', 'LeaveWindow_m',
333 'PointerMotion_m', 'PointerMotionHint_m',
334 'Button1Motion_m', 'Button2Motion_m', 'Button3Motion_m',
335 'Button4Motion_m', 'Button5Motion_m', 'ButtonMotion_m',
336 'KeymapState_m', 'Exposure_m', 'VisibilityChange_m',
337 'StructureNotify_m', 'ResizeRedirect_m',
338 'SubstructureNotify_m', 'SubstructureRedirect_m',
339 'FocusChange_m', 'PropertyChange_m', 'ColormapChange_m',
340 'OwnerGrabButton_m',
341 );
342  
343 my @disambig =
344 (
345 'PointerDetail', 'PointerRootDetail', 'NoDetail',
346  
347 'NotifyNormal', 'NotifyGrab', 'NotifyUngrab',
348 'NotifyWhileGrabbed', 'NotifyHint',
349  
350 'RoundCap', 'RoundJoin',
351 );
352  
353 %EXPORT_TAGS = ('X_dot_h' => \@x_dot_h,
354 'Protocol' => \@protocol,
355 'Masks' => \@masks,
356 'Masks_m' => \@masks_m,
357 'Disambiguate' => \@disambig);
358  
359 Exporter::export_ok_tags(keys %EXPORT_TAGS);
360  
361 {
362 my %seen;
363 push @{$EXPORT_TAGS{all}},
364 grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}} foreach keys %EXPORT_TAGS;
365 }
366  
367  
368 # VisualClass
369 sub StaticGray () { 0 }
370 sub StaticGrey () { 0 }
371 sub GrayScale () { 1 }
372 sub GreyScale () { 1 }
373 sub StaticColor () { 2 }
374 sub StaticColour () { 2 }
375 sub PseudoColor () { 3 }
376 sub PseudoColour () { 3 }
377 sub TrueColor () { 4 }
378 sub TrueColour () { 4 }
379 sub DirectColor () { 5 }
380 sub DirectColour () { 5 }
381  
382 # (Bit|Win)Gravity
383 sub Forget () { 0 }
384 sub Unmap () { 0 }
385 sub Static () { 1 }
386 sub NorthWest () { 2 }
387 sub North () { 3 }
388 sub NorthEast () { 4 }
389 sub West () { 5 }
390 sub Center () { 6 }
391 sub East () { 7 }
392 sub SouthWest () { 8 }
393 sub South () { 9 }
394 sub SouthEast () { 10 }
395  
396 sub ForgetGravity () { 0 }
397 sub UnmapGravity () { 0 }
398 sub StaticGravity () { 1 }
399 sub NorthWestGravity () { 2 }
400 sub NorthGravity () { 3 }
401 sub NorthEastGravity () { 4 }
402 sub WestGravity () { 5 }
403 sub CenterGravity () { 6 }
404 sub EastGravity () { 7 }
405 sub SouthWestGravity () { 8 }
406 sub SouthGravity () { 9 }
407 sub SouthEastGravity () { 10 }
408  
409 # EventMask
410 sub KeyPress_m () { 1 }
411 sub KeyRelease_m () { 2 }
412 sub ButtonPress_m () { 4 }
413 sub ButtonRelease_m () { 8 }
414 sub EnterWindow_m () { 16 }
415 sub LeaveWindow_m () { 32 }
416 sub PointerMotion_m () { 64 }
417 sub PointerMotionHint_m () { 128 }
418 sub Button1Motion_m () { 256 }
419 sub Button2Motion_m () { 512 }
420 sub Button3Motion_m () { 1024 }
421 sub Button4Motion_m () { 2048 }
422 sub Button5Motion_m () { 4096 }
423 sub ButtonMotion_m () { 8192 }
424 sub KeymapState_m () { 16384 }
425 sub Exposure_m () { 32768 }
426 sub VisibilityChange_m () { 65536 } # As far as I can go in my head.
427 sub StructureNotify_m () { 131072 } # Luckily, perl can compute these at
428 sub ResizeRedirect_m () { 1<<18 } # compile time.
429 sub SubstructureNotify_m () { 1<<19 }
430 sub SubstructureRedirect_m () { 1<<20 }
431 sub FocusChange_m () { 1<<21 }
432 sub PropertyChange_m () { 1<<22 }
433 sub ColormapChange_m () { 1<<23 }
434 sub OwnerGrabButton_m () { 1<<24 }
435  
436 sub KeyPress_mask () { 1 }
437 sub KeyRelease_mask () { 2 }
438 sub ButtonPress_mask () { 4 }
439 sub ButtonRelease_mask () { 8 }
440 sub EnterWindow_mask () { 16 }
441 sub LeaveWindow_mask () { 32 }
442 sub PointerMotion_mask () { 64 }
443 sub PointerMotionHint_mask () { 128 }
444 sub Button1Motion_mask () { 256 }
445 sub Button2Motion_mask () { 512 }
446 sub Button3Motion_mask () { 1024 }
447 sub Button4Motion_mask () { 2048 }
448 sub Button5Motion_mask () { 4096 }
449 sub ButtonMotion_mask () { 8192 }
450 sub KeymapState_mask () { 16384 }
451 sub Exposure_mask () { 32768 }
452 sub VisibilityChange_mask () { 65536 }
453 sub StructureNotify_mask () { 1<<17 }
454 sub ResizeRedirect_mask () { 1<<18 }
455 sub SubstructureNotify_mask () { 1<<19 }
456 sub SubstructureRedirect_mask () { 1<<20 }
457 sub FocusChange_mask () { 1<<21 }
458 sub PropertyChange_mask () { 1<<22 }
459 sub ColormapChange_mask () { 1<<23 }
460 sub OwnerGrabButton_mask () { 1<<24 }
461  
462 sub NoEventMask () { 0 } # Xlib
463 sub KeyPressMask () { 1 }
464 sub KeyReleaseMask () { 2 }
465 sub ButtonPressMask () { 4 }
466 sub ButtonReleaseMask () { 8 }
467 sub EnterWindowMask () { 16 }
468 sub LeaveWindowMask () { 32 }
469 sub PointerMotionMask () { 64 }
470 sub PointerMotionHintMask () { 128 }
471 sub Button1MotionMask () { 256 }
472 sub Button2MotionMask () { 512 }
473 sub Button3MotionMask () { 1024 }
474 sub Button4MotionMask () { 2048 }
475 sub Button5MotionMask () { 4096 }
476 sub ButtonMotionMask () { 8192 }
477 sub KeymapStateMask () { 16384 }
478 sub ExposureMask () { 32768 }
479 sub VisibilityChangeMask () { 65536 }
480 sub StructureNotifyMask () { 1<<17 }
481 sub ResizeRedirectMask () { 1<<18 }
482 sub SubstructureNotifyMask () { 1<<19 }
483 sub SubstructureRedirectMask () { 1<<20 }
484 sub FocusChangeMask () { 1<<21 }
485 sub PropertyChangeMask () { 1<<22 }
486 sub ColormapChangeMask () { 1<<23 }
487 sub OwnerGrabButtonMask () { 1<<24 }
488  
489  
490 # Plain old Events
491 sub KeyPress () { 2 }
492 sub KeyRelease () { 3 }
493 sub ButtonPress () { 4 }
494 sub ButtonRelease () { 5 }
495 sub MotionNotify () { 6 }
496 sub EnterWindow () { 7 }
497 sub LeaveWindow () { 8 }
498 sub FocusIn () { 9 }
499 sub FocusOut () { 10 }
500 sub KeymapNotify () { 11 }
501 sub Expose () { 12 }
502 sub GraphicsExposure () { 13 }
503 sub NoExposure () { 14 }
504 sub VisibilityNotify () { 15 }
505 sub CreateNotify () { 16 }
506 sub DestroyNotify () { 17 }
507 sub UnmapNotify () { 18 }
508 sub MapNotify () { 19 }
509 sub MapRequest () { 20 }
510 sub ReparentNotify () { 21 }
511 sub ConfigureNotify () { 22 }
512 sub ConfigureRequest () { 23 }
513 sub GravityNotify () { 24 }
514 sub ResizeRequest () { 25 }
515 sub CirculateNotify () { 26 }
516 sub CirculateRequest () { 27 }
517 sub PropertyNotify () { 28 }
518 sub SelectionClear () { 29 }
519 sub SelectionRequest () { 30 }
520 sub SelectionNotify () { 31 }
521 sub ColormapNotify () { 32 }
522 sub ClientMessage () { 33 }
523 sub MappingNotify () { 34 }
524 sub LASTEvent () { 35 } # Xlib
525  
526 # KeyMasks
527 sub Shift () { 1 }
528 sub Lock () { 2 }
529 sub Control () { 4 }
530 sub Mod1 () { 8 }
531 sub Mod2 () { 16 }
532 sub Mod3 () { 32 }
533 sub Mod4 () { 64 }
534 sub Mod5 () { 128 }
535  
536 sub ShiftMask () { 1 }
537 sub LockMask () { 2 }
538 sub ControlMask () { 4 }
539 sub Mod1Mask () { 8 }
540 sub Mod2Mask () { 16 }
541 sub Mod3Mask () { 32 }
542 sub Mod4Mask () { 64 }
543 sub Mod5Mask () { 128 }
544  
545 sub ShiftMapIndex () { 0 }
546 sub LockMapIndex () { 1 }
547 sub ControlMapIndex () { 2 }
548 sub Mod1MapIndex () { 3 }
549 sub Mod2MapIndex () { 4 }
550 sub Mod3MapIndex () { 5 }
551 sub Mod4MapIndex () { 6 }
552 sub Mod5MapIndex () { 7 }
553  
554 # Button masks
555 sub Button1Mask () { 256 }
556 sub Button2Mask () { 512 }
557 sub Button3Mask () { 1024 }
558 sub Button4Mask () { 2048 }
559 sub Button5Mask () { 4096 }
560  
561 sub AnyModifier () { 1<<15 }
562  
563 # Button names. Dubious value.
564 sub Button1 () { 1 }
565 sub Button2 () { 2 }
566 sub Button3 () { 3 }
567 sub Button4 () { 4 }
568 sub Button5 () { 5 }
569  
570 # Significance
571 sub LeastSignificant () { 0 }
572 sub MostSignificant () { 1 }
573  
574 sub LSBFirst () { 0 }
575 sub MSBFirst () { 1 }
576  
577 # BackingStore
578 sub Never () { 0 }
579 sub WhenMapped () { 1 }
580 sub Always () { 2 }
581  
582 sub NotUseful () { 0 }
583  
584 # Booleans
585 sub False () { 0 }
586 sub True () { 1 }
587  
588 # Window Classes
589 sub CopyFromParent () { 0 }
590 sub InputOutput () { 1 } # Bad hash collision between this
591 sub InputOnly () { 2 } # and this. (IO). Oh well.
592  
593 # MapStates
594 sub Unmapped () { 0 }
595 sub Unviewable () { 1 }
596 sub Viewable () { 2 }
597  
598 sub IsUnmapped () { 0 }
599 sub IsUnviewable () { 1 }
600 sub IsViewable () { 2 }
601  
602 # StackModes
603 sub Above () { 0 }
604 sub Below () { 1 }
605 sub TopIf () { 2 }
606 sub BottomIf () { 3 }
607 sub Opposite () { 4 }
608  
609 # CirculateDirections
610 sub RaiseLowest () { 0 }
611 sub LowerHighest () { 1 }
612  
613 # Circulation requests
614 sub PlaceOnTop () { 0 }
615 sub PlaceOnBottom () { 1 }
616  
617 # PropertyChangeModes
618 sub Replace () { 0 }
619 sub Prepend () { 1 }
620 sub Append () { 2 }
621  
622 sub PropModeReplace () { 0 }
623 sub PropModePrepend () { 1 }
624 sub PropModeAppend () { 2 }
625  
626 # CrossingNotifyDetails
627 sub Ancestor () { 0 }
628 sub Virtual () { 1 }
629 sub Inferior () { 2 }
630 sub Nonlinear () { 3 }
631 sub NonlinearVirtual () { 4 }
632 # ... and FocusDetails
633 sub PointerDetail () { 5 } # uh-oh
634 sub PointerRootDetail () { 6 } # "
635 sub NoDetail () { 7 } # "
636  
637 sub NotifyAncestor () { 0 }
638 sub NotifyVirtual () { 1 }
639 sub NotifyInferior () { 2 }
640 sub NotifyNonlinear () { 3 }
641 sub NotifyNonlinearVirtual () { 4 }
642 sub NotifyPointerl () { 5 }
643 sub NotifyPointerRoot () { 6 }
644 sub NotifyDetailNone () { 7 }
645  
646 # CrossingNotifyModes
647 sub Normal () { 0 }
648 sub Grab () { 1 }
649 sub Ungrab () { 2 }
650 # ... and FocusModes
651 sub WhileGrabbed () { 3 }
652  
653 sub NotifyNormal () { 0 }
654 sub NotifyGrab () { 1 }
655 sub NotifyUngrab () { 2 }
656 sub NotifyWhileGrabbed () { 3 }
657  
658 sub NotifyHint () { 1 }
659  
660 # VisibilityStates
661 sub Unobscured () { 0 }
662 sub PartiallyObscured () { 1 }
663 sub FullyObscured () { 2 }
664  
665 sub VisibilityUnobscured () { 0 }
666 sub VisibilityPartiallyObscured () { 1 }
667 sub VisibilityFullyObscured () { 2 }
668  
669 # CirculatePlaces
670 sub Top () { 0 }
671 sub Bottom () { 1 }
672  
673 # PropertyNotifyStates
674 sub NewValue () { 0 }
675 sub Deleted () { 1 }
676  
677 sub PropertyNewValue () { 0 }
678 sub PropertyDeleted () { 1 }
679  
680 # ColormapNotifyStates
681 sub Uninstalled () { 0 }
682 sub Installed () { 1 }
683  
684 sub ColormapUninstalled () { 0 }
685 sub ColormapInstalled () { 1 }
686  
687 # MappingNotifyRequests
688 sub Modifier () { 0 }
689 sub Keyboard () { 1 }
690 sub Pointer () { 2 }
691  
692 sub MappingModifier () { 0 }
693 sub MappingKeyboard () { 1 }
694 sub MappingPointer () { 2 }
695  
696 # Synchroni(city|zation)Modes
697 sub Synchronous () { 0 }
698 sub Asynchronous () { 1 }
699  
700 sub GrabModeSync () { 0 }
701 sub GrabModeAsync () { 1 }
702  
703 # GrabStatuses
704 sub Success () { 0 }
705 sub AlreadyGrabbed () { 1 }
706 sub InvalidTime () { 2 }
707 sub NotViewable () { 3 }
708 sub Frozen () { 4 }
709  
710 sub GrabSuccess () { 0 }
711 # No `GrabAlreadyGrabbed'
712 sub GrabInvalidTime () { 2 }
713 sub GrabNotViewable () { 3 }
714 sub GrabFrozen () { 4 }
715  
716 # AllowEventsModes
717 sub AsyncPointer () { 0 }
718 sub SyncPointer () { 1 }
719 sub ReplayPointer () { 2 }
720 sub AsyncKeyboard () { 3 }
721 sub SyncKeyboard () { 4 }
722 sub ReplayKeyboard () { 5 }
723 sub AsyncBoth () { 6 }
724 sub SyncBoth () { 7 }
725  
726 # InputFocusRevertTos
727 sub None () { 0 }
728 sub PointerRoot () { 1 }
729 sub Parent () { 2 }
730  
731 sub RevertToNone () { 0 }
732 sub RevertToPointerRoot () { 1 }
733 sub RevertToParent () { 2 }
734  
735 # DrawDirections
736 sub LeftToRight () { 0 }
737 sub RightToLeft () { 1 }
738  
739 sub FontLeftToRight () { 0 }
740 sub FontRightToLeft () { 1 }
741  
742 sub FrontChange () { 255 }
743  
744 # ClipRectangleOrderings
745 sub UnSorted () { 0 } # The capitalization of `Un' things is inconsistent
746 sub Unsorted () { 0 } # in these constants. Xlib gets it `right'.
747 sub YSorted () { 1 }
748 sub YXSorted () { 2 }
749 sub YXBanded () { 3 }
750  
751 # CoordinateModes
752 sub Origin () { 0 }
753 sub Previous () { 1 }
754  
755 sub CoordModeOrigin () { 0 }
756 sub CoordModePrevious () { 1 }
757  
758 # PolyShapes
759 sub Complex () { 0 }
760 sub Nonconvex () { 1 }
761 sub Convex () { 2 }
762  
763 # ImageFormats
764 sub Bitmap () { 0 }
765 sub XYPixmap () { 1 }
766 sub ZPixmap () { 2 }
767  
768 sub XYBitmap () { 0 }
769  
770 # SizeClasses
771 sub Cursor () { 0 }
772 sub Tile () { 1 }
773 sub Stipple () { 2 }
774  
775 sub CursorShape () { 0 }
776 sub TileShape () { 1 }
777 sub StippleShape () { 2 }
778  
779 # LedModes
780 sub Off () { 0 }
781 sub On () { 1 }
782 # ... and AutoRepeatModes
783 sub Default () { 2 }
784  
785 sub AutoRepeatModeOff () { 0 }
786 sub AutoRepeatModeOn () { 1 }
787 sub AutoRepeatModeDefault () { 2 }
788  
789 sub LedModeOff () { 0 }
790 sub LedModeOn () { 1 }
791  
792 # ScreenSaver modes
793 sub No () { 0 }
794 sub Yes () { 1 }
795 # sub Default () { 2 }
796  
797 # HostChangeModes
798 sub Insert () { 0 }
799 sub Delete () { 1 }
800  
801 sub SetModeInsert () { 0 }
802 sub SetModeDelete () { 1 }
803  
804 sub HostInsert () { 0 }
805 sub HostDelete () { 1 }
806  
807 # HostFamilies
808 sub Internet () { 0 }
809 sub DECnet () { 1 } # slightly obscure
810 sub Chaos () { 2 } # really obscure
811  
812 sub FamilyInternet () { 0 }
813 sub FamilyDECnet () { 1 }
814 sub FamilyChaos () { 2 }
815  
816 # AccessModes
817 sub Disabled () { 0 }
818 sub Enabled () { 1 }
819  
820 sub DisableAccess () { 0 }
821 sub EnableAccess () { 1 }
822  
823 # CloseDownModes
824 sub Destroy () { 0 }
825 sub RetainPermanent () { 1 }
826 sub RetainTemporary () { 2 }
827  
828 sub DestroyAll () { 0 }
829  
830 # ScreenSaverActions
831 sub Reset () { 0 }
832 sub Activate () { 1 }
833  
834 # MappingChangeStatuses
835 # sub Success () { 0 }
836 sub Busy () { 1 }
837 sub Failed () { 2 }
838  
839 sub MappingSuccess () { 0 }
840 sub MappingBusy () { 1 }
841 sub MappingFailed () { 2 }
842  
843 # dest
844 # \ 0 1
845 # ---------
846 # s 0 | 8 | 4 |
847 # r ---------
848 # c 1 | 2 | 1 |
849 # ---------
850 # GC Functions
851 sub Clear () { 0 } # Yes, we have all 16 logically possible functions.
852 sub And () { 1 }
853 sub AndReverse () { 2 } # When was the last time you used this?
854 sub Copy () { 3 }
855 sub AndInverted () { 4 } # or this?
856 sub NoOp () { 5 } # or this???
857 sub Xor () { 6 } # This one sounds useful...
858 sub Or () { 7 }
859 sub Nor () { 8 }
860 sub Equiv () { 9 }
861 sub Invert () { 10 }
862 sub OrReverse () { 11 }
863 sub CopyInverted () { 12 }
864 sub OrInverted () { 13 }
865 sub Nand () { 14 }
866 sub Set () { 15 }
867  
868 sub GXclear () { 0 }
869 sub GXand () { 1 }
870 sub GXandReverse () { 2 }
871 sub GXcopy () { 3 }
872 sub GXandInverted () { 4 }
873 sub GXnoop () { 5 }
874 sub GXxor () { 6 }
875 sub GXor () { 7 }
876 sub GXnor () { 8 }
877 sub GXequiv () { 9 }
878 sub GXinvert () { 10 }
879 sub GXorReverse () { 11 }
880 sub GXcopyInverted () { 12 }
881 sub GXorInverted () { 13 }
882 sub GXnand () { 14 }
883 sub GXset () { 15 }
884  
885 # GC LineStyles
886 sub Solid () { 0 }
887 sub OnOffDash () { 1 }
888 sub DoubleDash () { 2 }
889  
890 sub LineSolid () { 0 }
891 sub LineOnOffDash () { 1 }
892 sub LineDoubleDash () { 2 }
893  
894 # GC CapStyles
895 sub NotLast () { 0 }
896 sub Butt () { 1 }
897 sub RoundCap () { 2 } # @#!$ protocol designers...
898 sub Projecting () { 3 }
899  
900 sub CapNotLast () { 0 }
901 sub CapButt () { 1 }
902 sub CapRound () { 2 }
903 sub CapProjecting () { 3 }
904  
905 # GC JoinStyles
906 sub Miter () { 0 }
907 sub RoundJoin () { 1 } # right next to each other!
908 sub Bevel () { 2 }
909  
910 sub JoinMiter () { 0 }
911 sub JoinRound () { 1 }
912 sub JoinBevel () { 2 }
913  
914 # GC FillStyles
915 #sub Solid () { 0 }
916 sub Tiled () { 1 }
917 sub Stippled () { 2 }
918 sub OpaqueStippled () { 3 }
919  
920 sub FillSolid () { 0 }
921 sub FillTiled () { 1 }
922 sub FillStippled () { 2 }
923 sub FillOpaqueStippled () { 3 }
924  
925 # GC FillRules
926 sub EvenOdd () { 0 }
927 sub Winding () { 1 }
928  
929 sub EvenOddRule () { 0 }
930 sub WindingRule () { 1 }
931  
932 # GC SubwindowModes
933 sub ClipByChildren () { 0 }
934 sub IncludeInferiors () { 1 }
935  
936 # GC ArcModes
937 sub Chord () { 0 }
938 sub PieSlice () { 1 }
939  
940 sub ArcChord () { 0 }
941 sub ArcPieSlice () { 1 }
942  
943 sub BadRequest () { 1 }
944 sub BadValue () { 2 }
945 sub BadWindow () { 3 }
946 sub BadPixmap () { 4 }
947 sub BadAtom () { 5 }
948 sub BadCursor () { 6 }
949 sub BadFont () { 7 }
950 sub BadMatch () { 8 }
951 sub BadDrawable () { 9 }
952 sub BadAccess () { 10 }
953 sub BadAlloc () { 11 }
954 sub BadColormap () { 12 }
955 sub BadGC () { 13 }
956 sub BadIDChoice () { 14 }
957 sub BadName () { 15 }
958 sub BadLength () { 16 }
959 sub BadImplementation () { 17 }
960  
961 sub FirstExtensionError () { 128 }
962 sub LastExtensionError () { 255 }
963  
964 # Colormap allocation styles
965 sub AllocNone () { 0 }
966 sub AllocAll () { 1 }
967  
968 # Color storage flags
969 sub DoRed () { 1 }
970 sub DoGreen () { 2 }
971 sub DoBlue () { 4 }
972  
973 # `SCREEN SAVER STUFF'
974 sub DontPreferBlanking () { 0 }
975 sub PreferBlanking () { 1 }
976 sub DefaultBlanking () { 2 }
977  
978 sub DisableScreenSaver () { 0 }
979 sub DisableScreenInterval () { 0 }
980  
981 sub DontAllowExposures () { 0 }
982 sub AllowExposures () { 1 }
983 sub DefaultExposures () { 2 }
984  
985 1;