
; X Protocol
 X_PROTOCOL              =       11
 X_PROTOCOL_REVISION     =       0

;X Constants

None            =       0
ParentRelative  =       1
CopyFromParent  =       0
PointerWindow   =       0
InputFocus      =       1
PointerRoot     =       1
AnyPropertyType =       0
AnyKey          =       0
AnyButton       =       0
AllTemporary    =       0
CurrentTime     =       0
NoSymbol        =       0

;Event Masks

NoEventMask              =       0h
KeyPressMask             =       1h
KeyReleaseMask           =       2h
ButtonPressMask          =       4h
ButtonReleaseMask        =       8h
EnterWindowMask          =      10h
LeaveWindowMask          =      20h
PointerMotionMask        =      40h
PointerMotionHintMask    =      80h
Button1MotionMask        =     100h
Button2MotionMask        =     200h
Button3MotionMask        =     400h
Button4MotionMask        =     800h
Button5MotionMask        =    1000h
ButtonMotionMask         =    2000h
KeymapStateMask          =    4000h
ExposureMask             =    8000h
VisibilityChangeMask     =   10000h
StructureNotifyMask      =   20000h
ResizeRedirectMask       =   40000h
SubstructureNotifyMask   =   80000h
SubstructureRedirectMask =  100000h
FocusChangeMask          =  200000h
PropertyChangeMask       =  400000h
ColormapChangeMask       =  800000h
OwnerGrabButtonMask      = 1000000h

AllEventsMask            = 1fbff7fh   ;1ffffffh




;Event           Names

KeyPress                =       2
KeyRelease              =       3
ButtonPress             =       4
ButtonRelease           =       5
MotionNotify            =       6
EnterNotify             =       7
LeaveNotify             =       8
FocusIn                 =       9
FocusOut                =       10
KeymapNotify            =       11
Expose                  =       12
GraphicsExpose          =       13
NoExpose                =       14
VisibilityNotify        =       15
CreateNotify            =       16
DestroyNotify           =       17
UnmapNotify             =       18
MapNotify               =       19
MapRequest              =       20
ReparentNotify          =       21
ConfigureNotify         =       22
ConfigureRequest        =       23
GravityNotify           =       24
ResizeRequest           =       25
CirculateNotify         =       26
CirculateRequest        =       27
PropertyNotify          =       28
SelectionClear          =       29
SelectionRequest        =       30
SelectionNotify         =       31
ColormapNotify          =       32
ClientMessage           =       33
MappingNotify           =       34
LASTEvent               =       35

;Key             Masks

ShiftMask       =       1h
LockMask        =       2h
ControlMask     =       4h
Mod1Mask        =       8h
Mod2Mask        =       10h
Mod3Mask        =       20h
Mod4Mask        =       40h
Mod5Mask        =       80h

;Modifier                Names

ShiftMapIndex   =       0
LockMapIndex    =       1
ControlMapIndex =       2
Mod1MapIndex    =       3
Mod2MapIndex    =       4
Mod3MapIndex    =       5
Mod4MapIndex    =       6
Mod5MapIndex    =       7

;Button          Masks

Button1Mask     =       100h
Button2Mask     =       200h
Button3Mask     =       400h
Button4Mask     =       800h
Button5Mask     =       1000h
AnyModifier     =       10000h

;Button          Names

Button1         =       1
Button2         =       2
Button3         =       3
Button4         =       4
Button5         =       5

;Notify          Modes
NotifyNormal    =       0
NotifyGrab      =       1
NotifyUngrab    =       2
NotifyWhileGrabbed      =       3
NotifyHint      =       1

;Notify          Detail

NotifyAncestor  =       0
NotifyVirtual   =       1
NotifyInferior  =       2
NotifyNonlinear =       3
NotifyNonlinearVirtual  =       4
NotifyPointer   =       5
NotifyPointerRoot       =       6
NotifyDetailNone        =       7

;Visibility              Notify

VisibilityUnobscured    =       0
VisibilityPartiallyObscured     =       1
VisibilityFullyObscured =       2

;Circulation             request

PlaceOnTop      =       0
PlaceOnBottom   =       1

;Protocol                Families

FamilyInternet  =       0
FamilyDECnet    =       1
FamilyChaos     =       2
FamilyInternet6 =       6

;Unspecific              authentication  families

FamilyServerInterpreted =       5

;Property       Notification

PropertyNewValue        =       0
PropertyDelete  =       1

;Color           Map     notification

ColormapUninstalled     =       0
ColormapInstalled       =       1

;Grab            Modes
GrabModeSync    =       0
GrabModeAsync   =       1

;Grab            reply   status
GrabSuccess     =       0
AlreadyGrabbed  =       1
GrabInvalidTime =       2
GrabNotViewable =       3
GrabFrozen      =       4

;AllowEvents             modes
AsyncPointer    =       0
SyncPointer     =       1
ReplayPointer   =       2
AsyncKeyboard   =       3
SyncKeyboard    =       4
ReplayKeyboard  =       5
AsyncBoth       =       6
SyncBoth        =       7

;InputFocus              specific

RevertToNone    =       None
RevertToPointerRoot     =       PointerRoot
RevertToParent  =       2

;Error           Codes
Success =       0
BadRequest      =       1
BadValue        =       2
BadWindow       =       3
BadPixmap       =       4
BadAtom =       5
BadCursor       =       6
BadFont =       7
BadMatch        =       8
BadDrawable     =       9
BadAccess       =       10
BadAlloc        =       11
BadColor        =       12
BadGC   =       13
BadIDChoice     =       14
BadName =       15
BadLength       =       16
BadImplementation       =       17
FirstExtensionError     =       128
LastExtensionError      =       255

;Window          Classes

InputOutput     =       1
InputOnly       =       2

;Window          Attributes
CWBackPixmap    =       1h
CWBackPixel     =       2h
CWBorderPixmap  =       4h
CWBorderPixel   =       8h
CWBitGravity    =       10h
CWWinGravity    =       20h
CWBackingStore  =       40h
CWBackingPlanes =       80h
CWBackingPixel  =       100h
CWOverrideRedirect      =       200h
CWSaveUnder     =       400h
CWEventMask     =       800h
CWDontPropagate =       1000h
CWColormap      =       2000h
CWCursor        =       4000h

;ConfigureWindow         Structure
CWX             =       1h
CWY             =       2h
CWWidth         =       4h
CWHeight        =       8h
CWBorderWidth   =       10h
CWSibling       =       20h
CWStackMode     =       40h

;Bit             Gravity
ForgetGravity           =       0
NorthWestGravity        =       1
NorthGravity            =       2
NorthEastGravity        =       3
WestGravity             =       4
CenterGravity           =       5
EastGravity             =       6
SouthWestGravity        =       7
SouthGravity            =       8
SouthEastGravity        =       9
StaticGravity           =       10

;Window          Gravity
UnmapGravity    =       0

;CreateWindow            backing-store   hint
NotUseful       =       0
WhenMapped      =       1
Always  =       2

;GetWindowAttributes             reply
IsUnmapped      =       0
IsUnviewable    =       1
IsViewable      =       2

;Used            in      ChangeSaveSet
SetModeInsert   =       0
SetModeDelete   =       1

;Used            in      ChangeCloseDownMode
DestroyAll      =       0
RetainPermanent =       1
RetainTemporary =       2

;Window          stacking        method  (in     configureWindow)
Above   =       0
Below   =       1
TopIf   =       2
BottomIf        =       3
Opposite        =       4

;Circulation             direction
RaiseLowest     =       0
LowerHighest    =       1

;Property                modes
PropModeReplace =       0
PropModePrepend =       1
PropModeAppend  =       2

;Graphics                Functions
GXclear =       0h
GXand   =       1h
GXandReverse    =       2h
GXcopy  =       3h
GXandInverted   =       4h
GXnoop  =       5h
GXxor   =       6h
GXor    =       7h
GXnor   =       8h
GXequiv =       9h
GXinvert        =       10h
GXorReverse     =       11h
GXcopyInverted  =       12h
GXorInverted    =       13h
GXnand  =       14h
GXset   =       15h

;LineStyle
LineSolid       =       0
LineOnOffDash   =       1
LineDoubleDash  =       2

;capStyle
CapNotLast      =       0
CapButt =       1
CapRound        =       2
CapProjecting   =       3

;joinStyle
JoinMiter       =       0
JoinRound       =       1
JoinBevel       =       2

;fillStyle
FillSolid       =       0
FillTiled       =       1
FillStippled    =       2
FillOpaqueStippled      =       3

;fillRule

EvenOddRule     =       0
WindingRule     =       1

;subwindow               mode

ClipByChildren  =       0
IncludeInferiors        =       1

;SetClipRectangles               ordering

Unsorted        =       0
YSorted =       1
YXSorted        =       2
YXBanded        =       3

;CoordinateMode          for     drawing routines

CoordModeOrigin =       0
CoordModePrevious       =       1

;Polygon         shapes

Complex =       0
Nonconvex       =       1
Convex  =       2

;Arc             modes   for     PolyFillArc

ArcChord        =       0
ArcPieSlice     =       1

;GC              components

GCFunction      =       1h
GCPlaneMask     =       2h
GCForeground    =       4h
GCBackground    =       8h
GCLineWidth     =       10h
GCLineStyle     =       20h
GCCapStyle      =       40h
GCJoinStyle     =       80h
GCFillStyle     =       100h
GCFillRule      =       200h
GCTile  =       400h
GCStipple       =       800h
GCTileStipXOrigin       =       1000h
GCTileStipYOrigin       =       2000h
GCFont  =       4000h
GCSubwindowMode =       8000h
GCGraphicsExposures     =       10000h
GCClipXOrigin   =       20000h
GCClipYOrigin   =       40000h
GCClipMask      =       80000h
GCDashOffset    =       100000h
GCDashList      =       200000h
GCArcMode       =       400000h

GCLastBit       =       22

;used            in      QueryFont       --      draw    direction

FontLeftToRight =       0
FontRightToLeft =       1

FontChange      =       255

;ImageFormat             --      PutImage,       GetImage

XYBitmap        =       0
XYPixmap        =       1
ZPixmap =       2

;For             CreateColormap

AllocNone       =       0
AllocAll        =       1


;Flags           used    in      StoreNamedColor,        StoreColors

DoRed   =       1h
DoGreen =       2h
DoBlue  =       4h

;QueryBestSize           Class

CursorShape     =       0
TileShape       =       1
StippleShape    =       2

;Keyboard                pointer stuff

AutoRepeatModeOff       =       0
AutoRepeatModeOn        =       1
AutoRepeatModeDefault   =       2

LedModeOff      =       0
LedModeOn       =       1

;masks           for     ChangeKeyboardControl

KBKeyClickPercent       =       1h
KBBellPercent   =       2h
KBBellPitch     =       4h
KBBellDuration  =       8h
KBLed   =       10h
KBLedMode       =       20h
KBKey   =       40h
KBAutoRepeatMode        =       80h

MappingSuccess  =       0
MappingBusy     =       1
MappingFailed   =       2

MappingModifier =       0
MappingKeyboard =       1
MappingPointer  =       2

;Screensaver             stuff

DontPreferBlanking      =       0
PreferBlanking  =       1
DefaultBlanking =       2

DisableScreenSaver      =       0
DisableScreenInterval   =       0

DontAllowExposures      =       0
AllowExposures  =       1
DefaultExposures        =       2

;for             ForceScreenSaver

ScreenSaverReset        =       0
ScreenSaverActive       =       1

;for             ChangeHosts

HostInsert      =       0
HostDelete      =       1

;for             ChangeAccessControl

EnableAccess    =       1
DisableAccess   =       0

;display         classes

StaticGray      =       0
GrayScale       =       1
StaticColor     =       2
PseudoColor     =       3
TrueColor       =       4
DirectColor     =       5


;Byte            order           used    in      imageByteOrder  and     bitmapBitOrder

LSBFirst        =       0
MSBFirst        =       1

;Keyboard and Pointer Event Structures

struct   XButtonEvent
  .type         rd    1
  .serial       rd    1
  .send_event   rd    1
  .display      rd    1
  .window       rd    1
  .root         rd    1
  .subwindow    rd    1
  .time         rd    1
  .x            rd    1
  .y            rd    1
  .x_root       rd    1
  .y_root       rd    1
  .state        rd    1
  .button       rd    1
  .same_screen  rd    1
ends


virtual at 0
XButtonPressedEvent  XButtonEvent
end virtual

virtual at 0
XButtonReleasedEvent XButtonEvent
end virtual

struct   XKeyEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .root                           rd    1
        .subwindow                      rd    1
        .time                           rd    1
        .x                              rd    1
        .y                              rd    1
        .x_root                         rd    1
        .y_root                         rd    1
        .state                          rd    1
        .keycode                        rd    1
        .same_screen                    rd    1
ends


virtual at 0
XKeyPressedEvent   XKeyEvent
end virtual

virtual at 0
XKeyReleasedEvent  XKeyEvent
end virtual


struct   XMotionEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .root                           rd    1
        .subwindow                      rd    1
        .time                           rd    1
        .x                              rd    1
        .y                              rd    1
        .x_root                         rd    1
        .y_root                         rd    1
        .state                          rd    1
        .is_hint                        rb    1
        .same_screen                    rd    1
ends


virtual at 0
XPointerMovedEvent  XMotionEvent
end virtual

;Window Entry/Exit Events

struct   XCrossingEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .root                           rd    1
        .subwindow                      rd    1
        .time                           rd    1
        .x                              rd    1
        .y                              rd    1
        .x_root                         rd    1
        .y_root                         rd    1
        .mode                           rd    1
        .detail                         rd    1
        .same_screen                    rd    1
        .focus                          rd    1
        .state                          rd    1
ends

virtual at 0
XEnterWindowEvent  XCrossingEvent
end virtual

virtual at 0
XLeaveWindowEvent  XCrossingEvent
end virtual

;       Input           Focus   Events

struct   XFocusChangeEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .mode                           rd    1
        .detail                         rd    1
ends



virtual at 0
XFocusInEvent  XFocusChangeEvent
end virtual

virtual at 0
XFocusOutEvent  XFocusChangeEvent
end virtual

;       Keymap          Notification    Events

struct   XKeymapEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .key_vector                     rb    32
ends

;       Exposure/Update         Events

struct   XExposeEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .x                              rd    1
        .y                              rd    1
        .width                          rd    1
        .height                         rd    1
        .count                          rd    1
ends


struct   XGraphicsExposeEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .drawable                       rd    1
        .x                              rd    1
        .y                              rd    1
        .width                          rd    1
        .height                         rd    1
        .count                          rd    1
        .major_code                     rd    1
        .minor_code                     rd    1
ends


struct   XNoExposeEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .drawable                       rd    1
        .major_code                     rd    1
        .minor_code                     rd    1
ends


;       CirculateNotify         Events

struct   XCirculateEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .place                          rd    1
ends


struct   XCirculateRequestEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .parent                         rd    1
        .window                         rd    1
        .place                          rd    1
ends

;       Configuration           Change  Events

struct   XConfigureEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .x                              rd    1
        .y                              rd    1
        .width                          rd    1
        .height                         rd    1
        .border_width                   rd    1
        .above                          rd    1
        .override_redirect              rd    1
ends

struct   XConfigureRequestEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .parent                         rd    1
        .window                         rd    1
        .x                              rd    1
        .y                              rd    1
        .width                          rd    1
        .height                         rd    1
        .border_width                   rd    1
        .above                          rd    1
        .detail                         rd    1
        .value_mask                     rd    1
ends

struct   XPropertyEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .atom                           rd    1
        .time                           rd    1
        .state                          rd    1
ends

struct   XResizeEvent
        .type                           rd    1
        .serial                         rd    1
        .display                        rd    1
        .window                         rd    1
        .width                          rd    1
        .height                         rd    1
ends

struct   XColormapEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .colormap                       rd    1
        .new                            rd    1
        .state                          rd    1
ends

;       Creation/Destruction            Notifications

struct   XCreateWindowEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .parent                         rd    1
        .window                         rd    1
        .x                              rd    1
        .y                              rd    1
        .width                          rd    1
        .heigth                         rd    1
        .border_width                   rd    1
        .override_redirect              rd    1
ends


struct   XDestroyWindowEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
ends

;       Parent          Movement        Events

struct   XGravityEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .x                              rd    1
        .y                              rd    1
ends

;       Mapping         Events

struct   XMapEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .override_redirect              rd    1
ends

struct   XMappingEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .request                        rd    1
        .first_keycode                  rd    1
        .count                          rd    1
ends


struct   XMapRequestEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .parent                         rd    1
        .window                         rd    1
ends

;       Parent          Change  Events

struct   XReparentEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .parent                         rd    1
        .x                              rd    1
        .y                              rd    1
        .override_redirect              rd    1
ends

struct   XSelectionClearEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .selection                      rd    1
        .time                           rd    1
ends

struct   XSelectionRequestEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .owner                          rd    1
        .requestor                      rd    1
        .selection                      rd    1
        .target                         rd    1
        .property                       rd    1
        .time                           rd    1
ends

struct   XSelectionEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .requestor                      rd    1
        .selection                      rd    1
        .target                         rd    1
        .property                       rd    1
        .time                           rd    1
ends

;       Hidden          Window  Events

struct   XUnmapEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .event                          rd    1
        .window                         rd    1
        .from_configure                 rd    1
ends

struct   XVisibilityEvent
        .type                           rd    1
        .serial                         rd    1
        .send_event                     rd    1
        .display                        rd    1
        .window                         rd    1
        .state                          rd    1
ends

;       Client          Messages        (XSendEvent)

struct   XClientMessageEvent
  .type                           rd    1
  .serial                         rd    1
  .send_event                     rd    1
  .display                        rd    1
  .window                         rd    1
  .message_type                   rd    1
  .format                         rd    1
  .data                           rb    20
ends


struct   XErrorEvent
        .type                           rd    1
        .serial                         rd    1
        .error_code                     rd    1
        .request_code                   rd    1
        .minor_code                     rd    1
        .resourceid                     rd    1
ends



struct XAnyEvent
  .type         rd    1
  .serial       rd    1
  .send_event   rd    1
  .display      rd    1
  .window       rd    1
ends


struct XEvent
  .xany XAnyEvent
  .pad  rb 24*4 - sizeof.XAnyEvent

  virtual at .xany
  . XAnyEvent
  end virtual


  virtual at .xany
  .xkey XKeyEvent
  end virtual

  virtual at .xany
  .xbutton XButtonEvent
  end virtual

  virtual at .xany
  .xmotion XMotionEvent
  end virtual

  virtual at .xany
  .xcrossing XCrossingEvent
  end virtual

  virtual at .xany
  .xfocus XFocusChangeEvent
  end virtual

  virtual at .xany
  .xexpose XExposeEvent
  end virtual

  virtual at .xany
  .xgraphicsexpose XGraphicsExposeEvent
  end virtual

  virtual at .xany
  .xnoexpose XNoExposeEvent
  end virtual

  virtual at .xany
  .xvisibility XVisibilityEvent
  end virtual

  virtual at .xany
  .xcreatewindow XCreateWindowEvent
  end virtual

  virtual at .xany
  .xdestroywindow XDestroyWindowEvent
  end virtual

  virtual at .xany
  .xunmap XUnmapEvent
  end virtual

  virtual at .xany
  .xmap XMapEvent
  end virtual

  virtual at .xany
  .xmaprequest XMapRequestEvent
  end virtual

  virtual at .xany
  .xreparent XReparentEvent
  end virtual

  virtual at .xany
  .xconfigure XConfigureEvent
  end virtual

  virtual at .xany
  .xgravity XGravityEvent
  end virtual

  virtual at .xany
  .xresizerequest XResizeEvent
  end virtual

  virtual at .xany
  .xconfigurerequest XConfigureRequestEvent
  end virtual

  virtual at .xany
  .xcirculate XCirculateEvent
  end virtual

  virtual at .xany
  .xcirculaterequest XCirculateRequestEvent
  end virtual

  virtual at .xany
  .xproperty XPropertyEvent
  end virtual

  virtual at .xany
  .xselectionclear XSelectionClearEvent
  end virtual

  virtual at .xany
  .xselectionrequest XSelectionRequestEvent
  end virtual

  virtual at .xany
  .xselection XSelectionEvent
  end virtual

  virtual at .xany
  .xcolormap XColormapEvent
  end virtual

  virtual at .xany
  .xclient XClientMessageEvent
  end virtual

  virtual at .xany
  .xmapping XMappingEvent
  end virtual

  virtual at .xany
  .xerror XErrorEvent
  end virtual

  virtual at .xany
  .xkeymap XKeymapEvent
  end virtual
ends


;       Misc.           Structures

struct   XKeyboardControl
        .key_click_percent              rd    1
        .bell_percent                   rd    1
        .bell_pitch                     rd    1
        .bell_duration                  rd    1
        .led                            rd    1
        .led_mode                       rd    1
        .key                            rd    1
        .auto_repeat_mode               rd    1
ends



struct   XModifierKeymap
        .max_keypermod                  rd    1
        .modifiermap                    rd    1
ends




struct XWindowAttributes
  .x                     dd  ?     ; location of window
  .y                     dd  ?     ;
  .width                 dd  ?     ; width and height of window
  .height                dd  ?     ;
  .border_width          dd  ?     ; border width of window
  .depth                 dd  ?     ; depth of window
  .pVisual               dd  ?     ; the associated visual structure
  .root                  dd  ?     ; root of screen containing window
  .class                 dd  ?     ; InputOutput, InputOnly
  .bit_gravity           dd  ?     ; one of the bit gravity values
  .win_gravity           dd  ?     ; one of the window gravity values
  .backing_store         dd  ?     ; NotUseful, WhenMapped, Always
  .backing_planes        dd  ?     ; planes to be preserved if possible
  .backing_pixel         dd  ?     ; value to be used when restoring planes
  .save_under            dd  ?     ; boolean, should bits under be saved?
  .colormap              dd  ?     ; color map to be associated with window
  .map_installed         dd  ?     ; boolean, is color map currently installed
  .map_state             dd  ?     ; IsUnmapped, IsUnviewable, IsViewable
  .all_event_masks       dd  ?    ; set of events all people have interest in
  .your_event_mask       dd  ?          ; my event mask
  .do_not_propagate_mask dd  ?    ; set of events that should not propagate
  .override_redirect     dd  ?    ; boolean value for override-redirect
  .pScreen               dd  ?  ; back pointer to correct screen
ends



struct XCharStruct
  .lbearing   dw ?       ; origin to left edge of raster
  .rbearing   dw ?       ; origin to right edge of raster
  .width      dw ?       ; advance to next char's origin
  .ascent     dw ?       ; baseline to top edge of raster
  .descent    dw ?       ; baseline to bottom edge of raster
  .attributes dw ?       ; per char flags (not predefined)
ends


struct XFontStruct
  .ext_data          dd   ?       ; hook for extension to hang data
  .fid               dd   ?       ; Font id for this font
  .direction         dd   ?       ; hint about the direction font is painted
  .min_char_or_byte2 dd   ?       ; first character
  .max_char_or_byte2 dd   ?       ; last character
  .min_byte1         dd   ?       ; first row that exists
  .max_byte1         dd   ?       ; last row that exists
  .all_chars_exist   dd   ?       ; flag if all characters have nonzero size
  .default_char      dd   ?       ; char to print for undefined character
  .n_properties      dd   ?       ; how many properties there are
  .properties        dd   ?       ; pointer to array of additional properties
  .min_bounds        XCharStruct  ; minimum bounds over all existing char
  .max_bounds        XCharStruct  ; maximum bounds over all existing char
  .per_char          dd   ?       ; first_char to last_char information
  .ascent            dd   ?       ; logical extent above baseline for spacing
  .descent           dd   ?       ; logical decent below baseline for spacing
ends


struct XWindowChanges
  .x            dd ?
  .y            dd ?
  .width        dd ?
  .height       dd ?
  .border_width dd ?
  .sibling      dd ?
  .stack_mode   dd ?
ends
