1#!/usr/bin/perl 2 3package 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 9use strict; 10use Exporter; 11use 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 21my @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 188my @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 313my @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 329my @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 343my @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 359Exporter::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 369sub StaticGray () { 0 } 370sub StaticGrey () { 0 } 371sub GrayScale () { 1 } 372sub GreyScale () { 1 } 373sub StaticColor () { 2 } 374sub StaticColour () { 2 } 375sub PseudoColor () { 3 } 376sub PseudoColour () { 3 } 377sub TrueColor () { 4 } 378sub TrueColour () { 4 } 379sub DirectColor () { 5 } 380sub DirectColour () { 5 } 381 382# (Bit|Win)Gravity 383sub Forget () { 0 } 384sub Unmap () { 0 } 385sub Static () { 1 } 386sub NorthWest () { 2 } 387sub North () { 3 } 388sub NorthEast () { 4 } 389sub West () { 5 } 390sub Center () { 6 } 391sub East () { 7 } 392sub SouthWest () { 8 } 393sub South () { 9 } 394sub SouthEast () { 10 } 395 396sub ForgetGravity () { 0 } 397sub UnmapGravity () { 0 } 398sub StaticGravity () { 1 } 399sub NorthWestGravity () { 2 } 400sub NorthGravity () { 3 } 401sub NorthEastGravity () { 4 } 402sub WestGravity () { 5 } 403sub CenterGravity () { 6 } 404sub EastGravity () { 7 } 405sub SouthWestGravity () { 8 } 406sub SouthGravity () { 9 } 407sub SouthEastGravity () { 10 } 408 409# EventMask 410sub KeyPress_m () { 1 } 411sub KeyRelease_m () { 2 } 412sub ButtonPress_m () { 4 } 413sub ButtonRelease_m () { 8 } 414sub EnterWindow_m () { 16 } 415sub LeaveWindow_m () { 32 } 416sub PointerMotion_m () { 64 } 417sub PointerMotionHint_m () { 128 } 418sub Button1Motion_m () { 256 } 419sub Button2Motion_m () { 512 } 420sub Button3Motion_m () { 1024 } 421sub Button4Motion_m () { 2048 } 422sub Button5Motion_m () { 4096 } 423sub ButtonMotion_m () { 8192 } 424sub KeymapState_m () { 16384 } 425sub Exposure_m () { 32768 } 426sub VisibilityChange_m () { 65536 } # As far as I can go in my head. 427sub StructureNotify_m () { 131072 } # Luckily, perl can compute these at 428sub ResizeRedirect_m () { 1<<18 } # compile time. 429sub SubstructureNotify_m () { 1<<19 } 430sub SubstructureRedirect_m () { 1<<20 } 431sub FocusChange_m () { 1<<21 } 432sub PropertyChange_m () { 1<<22 } 433sub ColormapChange_m () { 1<<23 } 434sub OwnerGrabButton_m () { 1<<24 } 435 436sub KeyPress_mask () { 1 } 437sub KeyRelease_mask () { 2 } 438sub ButtonPress_mask () { 4 } 439sub ButtonRelease_mask () { 8 } 440sub EnterWindow_mask () { 16 } 441sub LeaveWindow_mask () { 32 } 442sub PointerMotion_mask () { 64 } 443sub PointerMotionHint_mask () { 128 } 444sub Button1Motion_mask () { 256 } 445sub Button2Motion_mask () { 512 } 446sub Button3Motion_mask () { 1024 } 447sub Button4Motion_mask () { 2048 } 448sub Button5Motion_mask () { 4096 } 449sub ButtonMotion_mask () { 8192 } 450sub KeymapState_mask () { 16384 } 451sub Exposure_mask () { 32768 } 452sub VisibilityChange_mask () { 65536 } 453sub StructureNotify_mask () { 1<<17 } 454sub ResizeRedirect_mask () { 1<<18 } 455sub SubstructureNotify_mask () { 1<<19 } 456sub SubstructureRedirect_mask () { 1<<20 } 457sub FocusChange_mask () { 1<<21 } 458sub PropertyChange_mask () { 1<<22 } 459sub ColormapChange_mask () { 1<<23 } 460sub OwnerGrabButton_mask () { 1<<24 } 461 462sub NoEventMask () { 0 } # Xlib 463sub KeyPressMask () { 1 } 464sub KeyReleaseMask () { 2 } 465sub ButtonPressMask () { 4 } 466sub ButtonReleaseMask () { 8 } 467sub EnterWindowMask () { 16 } 468sub LeaveWindowMask () { 32 } 469sub PointerMotionMask () { 64 } 470sub PointerMotionHintMask () { 128 } 471sub Button1MotionMask () { 256 } 472sub Button2MotionMask () { 512 } 473sub Button3MotionMask () { 1024 } 474sub Button4MotionMask () { 2048 } 475sub Button5MotionMask () { 4096 } 476sub ButtonMotionMask () { 8192 } 477sub KeymapStateMask () { 16384 } 478sub ExposureMask () { 32768 } 479sub VisibilityChangeMask () { 65536 } 480sub StructureNotifyMask () { 1<<17 } 481sub ResizeRedirectMask () { 1<<18 } 482sub SubstructureNotifyMask () { 1<<19 } 483sub SubstructureRedirectMask () { 1<<20 } 484sub FocusChangeMask () { 1<<21 } 485sub PropertyChangeMask () { 1<<22 } 486sub ColormapChangeMask () { 1<<23 } 487sub OwnerGrabButtonMask () { 1<<24 } 488 489 490# Plain old Events 491sub KeyPress () { 2 } 492sub KeyRelease () { 3 } 493sub ButtonPress () { 4 } 494sub ButtonRelease () { 5 } 495sub MotionNotify () { 6 } 496sub EnterWindow () { 7 } 497sub LeaveWindow () { 8 } 498sub FocusIn () { 9 } 499sub FocusOut () { 10 } 500sub KeymapNotify () { 11 } 501sub Expose () { 12 } 502sub GraphicsExposure () { 13 } 503sub NoExposure () { 14 } 504sub VisibilityNotify () { 15 } 505sub CreateNotify () { 16 } 506sub DestroyNotify () { 17 } 507sub UnmapNotify () { 18 } 508sub MapNotify () { 19 } 509sub MapRequest () { 20 } 510sub ReparentNotify () { 21 } 511sub ConfigureNotify () { 22 } 512sub ConfigureRequest () { 23 } 513sub GravityNotify () { 24 } 514sub ResizeRequest () { 25 } 515sub CirculateNotify () { 26 } 516sub CirculateRequest () { 27 } 517sub PropertyNotify () { 28 } 518sub SelectionClear () { 29 } 519sub SelectionRequest () { 30 } 520sub SelectionNotify () { 31 } 521sub ColormapNotify () { 32 } 522sub ClientMessage () { 33 } 523sub MappingNotify () { 34 } 524sub LASTEvent () { 35 } # Xlib 525 526# KeyMasks 527sub Shift () { 1 } 528sub Lock () { 2 } 529sub Control () { 4 } 530sub Mod1 () { 8 } 531sub Mod2 () { 16 } 532sub Mod3 () { 32 } 533sub Mod4 () { 64 } 534sub Mod5 () { 128 } 535 536sub ShiftMask () { 1 } 537sub LockMask () { 2 } 538sub ControlMask () { 4 } 539sub Mod1Mask () { 8 } 540sub Mod2Mask () { 16 } 541sub Mod3Mask () { 32 } 542sub Mod4Mask () { 64 } 543sub Mod5Mask () { 128 } 544 545sub ShiftMapIndex () { 0 } 546sub LockMapIndex () { 1 } 547sub ControlMapIndex () { 2 } 548sub Mod1MapIndex () { 3 } 549sub Mod2MapIndex () { 4 } 550sub Mod3MapIndex () { 5 } 551sub Mod4MapIndex () { 6 } 552sub Mod5MapIndex () { 7 } 553 554# Button masks 555sub Button1Mask () { 256 } 556sub Button2Mask () { 512 } 557sub Button3Mask () { 1024 } 558sub Button4Mask () { 2048 } 559sub Button5Mask () { 4096 } 560 561sub AnyModifier () { 1<<15 } 562 563# Button names. Dubious value. 564sub Button1 () { 1 } 565sub Button2 () { 2 } 566sub Button3 () { 3 } 567sub Button4 () { 4 } 568sub Button5 () { 5 } 569 570# Significance 571sub LeastSignificant () { 0 } 572sub MostSignificant () { 1 } 573 574sub LSBFirst () { 0 } 575sub MSBFirst () { 1 } 576 577# BackingStore 578sub Never () { 0 } 579sub WhenMapped () { 1 } 580sub Always () { 2 } 581 582sub NotUseful () { 0 } 583 584# Booleans 585sub False () { 0 } 586sub True () { 1 } 587 588# Window Classes 589sub CopyFromParent () { 0 } 590sub InputOutput () { 1 } # Bad hash collision between this 591sub InputOnly () { 2 } # and this. (IO). Oh well. 592 593# MapStates 594sub Unmapped () { 0 } 595sub Unviewable () { 1 } 596sub Viewable () { 2 } 597 598sub IsUnmapped () { 0 } 599sub IsUnviewable () { 1 } 600sub IsViewable () { 2 } 601 602# StackModes 603sub Above () { 0 } 604sub Below () { 1 } 605sub TopIf () { 2 } 606sub BottomIf () { 3 } 607sub Opposite () { 4 } 608 609# CirculateDirections 610sub RaiseLowest () { 0 } 611sub LowerHighest () { 1 } 612 613# Circulation requests 614sub PlaceOnTop () { 0 } 615sub PlaceOnBottom () { 1 } 616 617# PropertyChangeModes 618sub Replace () { 0 } 619sub Prepend () { 1 } 620sub Append () { 2 } 621 622sub PropModeReplace () { 0 } 623sub PropModePrepend () { 1 } 624sub PropModeAppend () { 2 } 625 626# CrossingNotifyDetails 627sub Ancestor () { 0 } 628sub Virtual () { 1 } 629sub Inferior () { 2 } 630sub Nonlinear () { 3 } 631sub NonlinearVirtual () { 4 } 632# ... and FocusDetails 633sub PointerDetail () { 5 } # uh-oh 634sub PointerRootDetail () { 6 } # " 635sub NoDetail () { 7 } # " 636 637sub NotifyAncestor () { 0 } 638sub NotifyVirtual () { 1 } 639sub NotifyInferior () { 2 } 640sub NotifyNonlinear () { 3 } 641sub NotifyNonlinearVirtual () { 4 } 642sub NotifyPointerl () { 5 } 643sub NotifyPointerRoot () { 6 } 644sub NotifyDetailNone () { 7 } 645 646# CrossingNotifyModes 647sub Normal () { 0 } 648sub Grab () { 1 } 649sub Ungrab () { 2 } 650# ... and FocusModes 651sub WhileGrabbed () { 3 } 652 653sub NotifyNormal () { 0 } 654sub NotifyGrab () { 1 } 655sub NotifyUngrab () { 2 } 656sub NotifyWhileGrabbed () { 3 } 657 658sub NotifyHint () { 1 } 659 660# VisibilityStates 661sub Unobscured () { 0 } 662sub PartiallyObscured () { 1 } 663sub FullyObscured () { 2 } 664 665sub VisibilityUnobscured () { 0 } 666sub VisibilityPartiallyObscured () { 1 } 667sub VisibilityFullyObscured () { 2 } 668 669# CirculatePlaces 670sub Top () { 0 } 671sub Bottom () { 1 } 672 673# PropertyNotifyStates 674sub NewValue () { 0 } 675sub Deleted () { 1 } 676 677sub PropertyNewValue () { 0 } 678sub PropertyDeleted () { 1 } 679 680# ColormapNotifyStates 681sub Uninstalled () { 0 } 682sub Installed () { 1 } 683 684sub ColormapUninstalled () { 0 } 685sub ColormapInstalled () { 1 } 686 687# MappingNotifyRequests 688sub Modifier () { 0 } 689sub Keyboard () { 1 } 690sub Pointer () { 2 } 691 692sub MappingModifier () { 0 } 693sub MappingKeyboard () { 1 } 694sub MappingPointer () { 2 } 695 696# Synchroni(city|zation)Modes 697sub Synchronous () { 0 } 698sub Asynchronous () { 1 } 699 700sub GrabModeSync () { 0 } 701sub GrabModeAsync () { 1 } 702 703# GrabStatuses 704sub Success () { 0 } 705sub AlreadyGrabbed () { 1 } 706sub InvalidTime () { 2 } 707sub NotViewable () { 3 } 708sub Frozen () { 4 } 709 710sub GrabSuccess () { 0 } 711# No `GrabAlreadyGrabbed' 712sub GrabInvalidTime () { 2 } 713sub GrabNotViewable () { 3 } 714sub GrabFrozen () { 4 } 715 716# AllowEventsModes 717sub AsyncPointer () { 0 } 718sub SyncPointer () { 1 } 719sub ReplayPointer () { 2 } 720sub AsyncKeyboard () { 3 } 721sub SyncKeyboard () { 4 } 722sub ReplayKeyboard () { 5 } 723sub AsyncBoth () { 6 } 724sub SyncBoth () { 7 } 725 726# InputFocusRevertTos 727sub None () { 0 } 728sub PointerRoot () { 1 } 729sub Parent () { 2 } 730 731sub RevertToNone () { 0 } 732sub RevertToPointerRoot () { 1 } 733sub RevertToParent () { 2 } 734 735# DrawDirections 736sub LeftToRight () { 0 } 737sub RightToLeft () { 1 } 738 739sub FontLeftToRight () { 0 } 740sub FontRightToLeft () { 1 } 741 742sub FrontChange () { 255 } 743 744# ClipRectangleOrderings 745sub UnSorted () { 0 } # The capitalization of `Un' things is inconsistent 746sub Unsorted () { 0 } # in these constants. Xlib gets it `right'. 747sub YSorted () { 1 } 748sub YXSorted () { 2 } 749sub YXBanded () { 3 } 750 751# CoordinateModes 752sub Origin () { 0 } 753sub Previous () { 1 } 754 755sub CoordModeOrigin () { 0 } 756sub CoordModePrevious () { 1 } 757 758# PolyShapes 759sub Complex () { 0 } 760sub Nonconvex () { 1 } 761sub Convex () { 2 } 762 763# ImageFormats 764sub Bitmap () { 0 } 765sub XYPixmap () { 1 } 766sub ZPixmap () { 2 } 767 768sub XYBitmap () { 0 } 769 770# SizeClasses 771sub Cursor () { 0 } 772sub Tile () { 1 } 773sub Stipple () { 2 } 774 775sub CursorShape () { 0 } 776sub TileShape () { 1 } 777sub StippleShape () { 2 } 778 779# LedModes 780sub Off () { 0 } 781sub On () { 1 } 782# ... and AutoRepeatModes 783sub Default () { 2 } 784 785sub AutoRepeatModeOff () { 0 } 786sub AutoRepeatModeOn () { 1 } 787sub AutoRepeatModeDefault () { 2 } 788 789sub LedModeOff () { 0 } 790sub LedModeOn () { 1 } 791 792# ScreenSaver modes 793sub No () { 0 } 794sub Yes () { 1 } 795# sub Default () { 2 } 796 797# HostChangeModes 798sub Insert () { 0 } 799sub Delete () { 1 } 800 801sub SetModeInsert () { 0 } 802sub SetModeDelete () { 1 } 803 804sub HostInsert () { 0 } 805sub HostDelete () { 1 } 806 807# HostFamilies 808sub Internet () { 0 } 809sub DECnet () { 1 } # slightly obscure 810sub Chaos () { 2 } # really obscure 811 812sub FamilyInternet () { 0 } 813sub FamilyDECnet () { 1 } 814sub FamilyChaos () { 2 } 815 816# AccessModes 817sub Disabled () { 0 } 818sub Enabled () { 1 } 819 820sub DisableAccess () { 0 } 821sub EnableAccess () { 1 } 822 823# CloseDownModes 824sub Destroy () { 0 } 825sub RetainPermanent () { 1 } 826sub RetainTemporary () { 2 } 827 828sub DestroyAll () { 0 } 829 830# ScreenSaverActions 831sub Reset () { 0 } 832sub Activate () { 1 } 833 834# MappingChangeStatuses 835# sub Success () { 0 } 836sub Busy () { 1 } 837sub Failed () { 2 } 838 839sub MappingSuccess () { 0 } 840sub MappingBusy () { 1 } 841sub 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 851sub Clear () { 0 } # Yes, we have all 16 logically possible functions. 852sub And () { 1 } 853sub AndReverse () { 2 } # When was the last time you used this? 854sub Copy () { 3 } 855sub AndInverted () { 4 } # or this? 856sub NoOp () { 5 } # or this??? 857sub Xor () { 6 } # This one sounds useful... 858sub Or () { 7 } 859sub Nor () { 8 } 860sub Equiv () { 9 } 861sub Invert () { 10 } 862sub OrReverse () { 11 } 863sub CopyInverted () { 12 } 864sub OrInverted () { 13 } 865sub Nand () { 14 } 866sub Set () { 15 } 867 868sub GXclear () { 0 } 869sub GXand () { 1 } 870sub GXandReverse () { 2 } 871sub GXcopy () { 3 } 872sub GXandInverted () { 4 } 873sub GXnoop () { 5 } 874sub GXxor () { 6 } 875sub GXor () { 7 } 876sub GXnor () { 8 } 877sub GXequiv () { 9 } 878sub GXinvert () { 10 } 879sub GXorReverse () { 11 } 880sub GXcopyInverted () { 12 } 881sub GXorInverted () { 13 } 882sub GXnand () { 14 } 883sub GXset () { 15 } 884 885# GC LineStyles 886sub Solid () { 0 } 887sub OnOffDash () { 1 } 888sub DoubleDash () { 2 } 889 890sub LineSolid () { 0 } 891sub LineOnOffDash () { 1 } 892sub LineDoubleDash () { 2 } 893 894# GC CapStyles 895sub NotLast () { 0 } 896sub Butt () { 1 } 897sub RoundCap () { 2 } # @#!$ protocol designers... 898sub Projecting () { 3 } 899 900sub CapNotLast () { 0 } 901sub CapButt () { 1 } 902sub CapRound () { 2 } 903sub CapProjecting () { 3 } 904 905# GC JoinStyles 906sub Miter () { 0 } 907sub RoundJoin () { 1 } # right next to each other! 908sub Bevel () { 2 } 909 910sub JoinMiter () { 0 } 911sub JoinRound () { 1 } 912sub JoinBevel () { 2 } 913 914# GC FillStyles 915#sub Solid () { 0 } 916sub Tiled () { 1 } 917sub Stippled () { 2 } 918sub OpaqueStippled () { 3 } 919 920sub FillSolid () { 0 } 921sub FillTiled () { 1 } 922sub FillStippled () { 2 } 923sub FillOpaqueStippled () { 3 } 924 925# GC FillRules 926sub EvenOdd () { 0 } 927sub Winding () { 1 } 928 929sub EvenOddRule () { 0 } 930sub WindingRule () { 1 } 931 932# GC SubwindowModes 933sub ClipByChildren () { 0 } 934sub IncludeInferiors () { 1 } 935 936# GC ArcModes 937sub Chord () { 0 } 938sub PieSlice () { 1 } 939 940sub ArcChord () { 0 } 941sub ArcPieSlice () { 1 } 942 943sub BadRequest () { 1 } 944sub BadValue () { 2 } 945sub BadWindow () { 3 } 946sub BadPixmap () { 4 } 947sub BadAtom () { 5 } 948sub BadCursor () { 6 } 949sub BadFont () { 7 } 950sub BadMatch () { 8 } 951sub BadDrawable () { 9 } 952sub BadAccess () { 10 } 953sub BadAlloc () { 11 } 954sub BadColormap () { 12 } 955sub BadGC () { 13 } 956sub BadIDChoice () { 14 } 957sub BadName () { 15 } 958sub BadLength () { 16 } 959sub BadImplementation () { 17 } 960 961sub FirstExtensionError () { 128 } 962sub LastExtensionError () { 255 } 963 964# Colormap allocation styles 965sub AllocNone () { 0 } 966sub AllocAll () { 1 } 967 968# Color storage flags 969sub DoRed () { 1 } 970sub DoGreen () { 2 } 971sub DoBlue () { 4 } 972 973# `SCREEN SAVER STUFF' 974sub DontPreferBlanking () { 0 } 975sub PreferBlanking () { 1 } 976sub DefaultBlanking () { 2 } 977 978sub DisableScreenSaver () { 0 } 979sub DisableScreenInterval () { 0 } 980 981sub DontAllowExposures () { 0 } 982sub AllowExposures () { 1 } 983sub DefaultExposures () { 2 } 984 9851; 986