]> gitweb.factorcode.org Git - factor.git/commitdiff
x11.*: new vocab x11.X for ffi stuff from the X.h header
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 17 Aug 2016 01:46:28 +0000 (03:46 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 17 Aug 2016 01:46:28 +0000 (03:46 +0200)
It's nicer to have one vocab for each X11 header file than the previous
organization.

17 files changed:
basis/ui/backend/x11/x11.factor
basis/x11/X/X.factor [new file with mode: 0644]
basis/x11/X/authors.txt [new file with mode: 0644]
basis/x11/X/summary.txt [new file with mode: 0644]
basis/x11/clipboard/clipboard.factor
basis/x11/constants/authors.txt [deleted file]
basis/x11/constants/constants.factor [deleted file]
basis/x11/constants/summary.txt [deleted file]
basis/x11/events/events.factor
basis/x11/glx/glx.factor
basis/x11/keysymdef/keysymdef.factor
basis/x11/keysymdef/summary.txt [new file with mode: 0644]
basis/x11/windows/windows.factor
basis/x11/xim/xim.factor
basis/x11/xinput2/ffi/ffi.factor
basis/x11/xinput2/xinput2.factor
basis/x11/xlib/xlib.factor

index ce2133c94c735c1320755fb95eb92a42c32b57a8..a61bd2fe9fda00091902fd27fd3afd96a82a40d5 100644 (file)
@@ -6,14 +6,22 @@ environment io.encodings.ascii io.encodings.string io.encodings.utf8
 kernel literals locals math namespaces sequences specialized-arrays
 strings ui ui.backend ui.backend.x11.keys ui.clipboards ui.event-loop
 ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures
-ui.pixel-formats ui.pixel-formats.private ui.private x11 x11.clipboard
-x11.constants x11.events x11.glx x11.io x11.windows x11.xim x11.xlib ;
+ui.pixel-formats ui.pixel-formats.private ui.private x11 x11.X
+x11.clipboard x11.events x11.glx x11.io x11.windows x11.xim x11.xlib ;
 FROM: libc => system ;
 SPECIALIZED-ARRAYS: uchar ulong ;
 IN: ui.backend.x11
 
 SINGLETON: x11-ui-backend
 
+! *****************************************************************
+! * EXTENDED WINDOW MANAGER HINTS
+! *****************************************************************
+
+CONSTANT: _NET_WM_STATE_REMOVE 0
+CONSTANT: _NET_WM_STATE_ADD 1
+CONSTANT: _NET_WM_STATE_TOGGLE 2
+
 : XA_NET_SUPPORTED ( -- atom ) "_NET_SUPPORTED" x-atom ;
 : XA_NET_WM_NAME ( -- atom ) "_NET_WM_NAME" x-atom ;
 : XA_NET_WM_STATE ( -- atom ) "_NET_WM_STATE" x-atom ;
diff --git a/basis/x11/X/X.factor b/basis/x11/X/X.factor
new file mode 100644 (file)
index 0000000..29c9fdc
--- /dev/null
@@ -0,0 +1,577 @@
+! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman, 2016 Björn Lindqvist
+! http://factorcode.org/license.txt for BSD license.
+
+! Selected parts of /usr/include/X11/X.h
+USING: alien.c-types alien.syntax math ;
+IN: x11.X
+
+! Resources
+TYPEDEF: ulong XID
+TYPEDEF: ulong Mask
+TYPEDEF: ulong Atom
+TYPEDEF: XID Window
+TYPEDEF: XID Drawable
+TYPEDEF: XID Font
+TYPEDEF: XID Pixmap
+TYPEDEF: XID Cursor
+TYPEDEF: XID Colormap
+TYPEDEF: XID GContext
+TYPEDEF: XID KeySym
+
+TYPEDEF: uchar KeyCode
+
+! Reserved resource and constant definitions
+CONSTANT: ParentRelative 1
+CONSTANT: CopyFromParent 0
+CONSTANT: PointerWindow 0
+CONSTANT: InputFocus 1
+CONSTANT: PointerRoot 1
+CONSTANT: AnyPropertyType 0
+CONSTANT: AnyKey 0
+CONSTANT: AnyButton 0
+CONSTANT: AllTemporary 0
+CONSTANT: CurrentTime 0
+CONSTANT: NoSymbol 0
+
+CONSTANT: None 0
+
+! Input Event Masks. Used as event-mask window attribute and as
+! arguments to Grab requests. Not to be confused with event names.
+: NoEventMask              ( -- n ) 0 ; inline
+: KeyPressMask             ( -- n ) 0 2^ ; inline
+: KeyReleaseMask           ( -- n ) 1 2^ ; inline
+: ButtonPressMask          ( -- n ) 2 2^ ; inline
+: ButtonReleaseMask        ( -- n ) 3 2^ ; inline
+: EnterWindowMask          ( -- n ) 4 2^ ; inline
+: LeaveWindowMask          ( -- n ) 5 2^ ; inline
+: PointerMotionMask        ( -- n ) 6 2^ ; inline
+: PointerMotionHintMask    ( -- n ) 7 2^ ; inline
+: Button1MotionMask        ( -- n ) 8 2^ ; inline
+: Button2MotionMask        ( -- n ) 9 2^ ; inline
+: Button3MotionMask        ( -- n ) 10 2^ ; inline
+: Button4MotionMask        ( -- n ) 11 2^ ; inline
+: Button5MotionMask        ( -- n ) 12 2^ ; inline
+: ButtonMotionMask         ( -- n ) 13 2^ ; inline
+: KeymapStateMask          ( -- n ) 14 2^ ; inline
+: ExposureMask             ( -- n ) 15 2^ ; inline
+: VisibilityChangeMask     ( -- n ) 16 2^ ; inline
+: StructureNotifyMask      ( -- n ) 17 2^ ; inline
+: ResizeRedirectMask       ( -- n ) 18 2^ ; inline
+: SubstructureNotifyMask   ( -- n ) 19 2^ ; inline
+: SubstructureRedirectMask ( -- n ) 20 2^ ; inline
+: FocusChangeMask          ( -- n ) 21 2^ ; inline
+: PropertyChangeMask       ( -- n ) 22 2^ ; inline
+: ColormapChangeMask       ( -- n ) 23 2^ ; inline
+: OwnerGrabButtonMask      ( -- n ) 24 2^ ; inline
+
+! Event names. Used in "type" field in XEvent structures. Not to be
+! confused with event masks above. They start from 2 because 0 and 1
+! are reserved in the protocol for errors and replies.
+CONSTANT: KeyPress              2
+CONSTANT: KeyRelease            3
+CONSTANT: ButtonPress           4
+CONSTANT: ButtonRelease         5
+CONSTANT: MotionNotify          6
+CONSTANT: EnterNotify           7
+CONSTANT: LeaveNotify           8
+CONSTANT: FocusIn               9
+CONSTANT: FocusOut              10
+CONSTANT: KeymapNotify          11
+CONSTANT: Expose                12
+CONSTANT: GraphicsExpose        13
+CONSTANT: NoExpose              14
+CONSTANT: VisibilityNotify      15
+CONSTANT: CreateNotify          16
+CONSTANT: DestroyNotify         17
+CONSTANT: UnmapNotify           18
+CONSTANT: MapNotify             19
+CONSTANT: MapRequest            20
+CONSTANT: ReparentNotify        21
+CONSTANT: ConfigureNotify       22
+CONSTANT: ConfigureRequest      23
+CONSTANT: GravityNotify         24
+CONSTANT: ResizeRequest         25
+CONSTANT: CirculateNotify       26
+CONSTANT: CirculateRequest      27
+CONSTANT: PropertyNotify        28
+CONSTANT: SelectionClear        29
+CONSTANT: SelectionRequest      30
+CONSTANT: SelectionNotify       31
+CONSTANT: ColormapNotify        32
+CONSTANT: ClientMessage         33
+CONSTANT: MappingNotify         34
+CONSTANT: GenericEvent          35
+CONSTANT: LASTEvent             36
+
+! Key masks. Used as modifiers to GrabButton and GrabKey, results of
+! QueryPointer, state in various key-, mouse-, and button-related
+! events.
+: ShiftMask   ( -- n ) 1 0 shift ; inline
+: LockMask    ( -- n ) 1 1 shift ; inline
+: ControlMask ( -- n ) 1 2 shift ; inline
+: Mod1Mask    ( -- n ) 1 3 shift ; inline
+: Mod2Mask    ( -- n ) 1 4 shift ; inline
+: Mod3Mask    ( -- n ) 1 5 shift ; inline
+: Mod4Mask    ( -- n ) 1 6 shift ; inline
+: Mod5Mask    ( -- n ) 1 7 shift ; inline
+
+! modifier names.  Used to build a SetModifierMapping request or
+! to read a GetModifierMapping request.  These correspond to the
+! masks defined above.
+CONSTANT: ShiftMapIndex 0
+CONSTANT: LockMapIndex 1
+CONSTANT: ControlMapIndex 2
+CONSTANT: Mod1MapIndex 3
+CONSTANT: Mod2MapIndex 4
+CONSTANT: Mod3MapIndex 5
+CONSTANT: Mod4MapIndex 6
+CONSTANT: Mod5MapIndex 7
+
+! button masks. Used in same manner as Key masks above. Not to be
+! confused with button names below.
+: Button1Mask ( -- n ) 1 8  shift ; inline
+: Button2Mask ( -- n ) 1 9  shift ; inline
+: Button3Mask ( -- n ) 1 10 shift ; inline
+: Button4Mask ( -- n ) 1 11 shift ; inline
+: Button5Mask ( -- n ) 1 12 shift ; inline
+
+: AnyModifier          ( -- n ) 15 2^ ; ! used in GrabButton, GrabKey
+
+! button names. Used as arguments to GrabButton and as detail in
+! ButtonPress and ButtonRelease events.  Not to be confused with
+! button masks above. Note that 0 is already defined above as
+! "AnyButton".  */
+CONSTANT: Button1 1
+CONSTANT: Button2 2
+CONSTANT: Button3 3
+CONSTANT: Button4 4
+CONSTANT: Button5 5
+
+! Notify modes
+
+CONSTANT: NotifyNormal 0
+CONSTANT: NotifyGrab 1
+CONSTANT: NotifyUngrab 2
+CONSTANT: NotifyWhileGrabbed 3
+
+CONSTANT: NotifyHint 1 ! for MotionNotify events
+
+! Notify detail
+
+CONSTANT: NotifyAncestor 0
+CONSTANT: NotifyVirtual 1
+CONSTANT: NotifyInferior 2
+CONSTANT: NotifyNonlinear 3
+CONSTANT: NotifyNonlinearVirtual 4
+CONSTANT: NotifyPointer 5
+CONSTANT: NotifyPointerRoot 6
+CONSTANT: NotifyDetailNone 7
+
+! Visibility notify
+
+CONSTANT: VisibilityUnobscured 0
+CONSTANT: VisibilityPartiallyObscured 1
+CONSTANT: VisibilityFullyObscured 2
+
+! Circulation request
+
+CONSTANT: PlaceOnTop 0
+CONSTANT: PlaceOnBottom 1
+
+! protocol families
+
+CONSTANT: FamilyInternet 0     ! IPv4
+CONSTANT: FamilyDECnet 1
+CONSTANT: FamilyChaos 2
+CONSTANT: FamilyInternet6 6     ! IPv6
+
+! authentication families not tied to a specific protocol
+CONSTANT: FamilyServerInterpreted 5
+
+! Property notification
+
+CONSTANT: PropertyNewValue 0
+CONSTANT: PropertyDelete 1
+
+! Color Map notification
+
+CONSTANT: ColormapUninstalled 0
+CONSTANT: ColormapInstalled 1
+
+! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
+
+CONSTANT: GrabModeSync 0
+CONSTANT: GrabModeAsync 1
+
+! GrabPointer, GrabKeyboard reply status
+
+CONSTANT: GrabSuccess 0
+CONSTANT: AlreadyGrabbed 1
+CONSTANT: GrabInvalidTime 2
+CONSTANT: GrabNotViewable 3
+CONSTANT: GrabFrozen 4
+
+! AllowEvents modes
+
+CONSTANT: AsyncPointer 0
+CONSTANT: SyncPointer 1
+CONSTANT: ReplayPointer 2
+CONSTANT: AsyncKeyboard 3
+CONSTANT: SyncKeyboard 4
+CONSTANT: ReplayKeyboard 5
+CONSTANT: AsyncBoth 6
+CONSTANT: SyncBoth 7
+
+! Used in SetInputFocus, GetInputFocus
+
+: RevertToNone         ( -- n ) None ;
+: RevertToPointerRoot  ( -- n ) PointerRoot ;
+CONSTANT: RevertToParent 2
+
+! *****************************************************************
+! * ERROR CODES
+! *****************************************************************
+
+CONSTANT: Success 0         ! everything's okay
+CONSTANT: BadRequest 1      ! bad request code
+CONSTANT: BadValue 2        ! int parameter out of range
+CONSTANT: BadWindow 3       ! parameter not a Window
+CONSTANT: BadPixmap 4       ! parameter not a Pixmap
+CONSTANT: BadAtom 5         ! parameter not an Atom
+CONSTANT: BadCursor 6       ! parameter not a Cursor
+CONSTANT: BadFont 7         ! parameter not a Font
+CONSTANT: BadMatch 8        ! parameter mismatch
+CONSTANT: BadDrawable 9     ! parameter not a Pixmap or Window
+CONSTANT: BadAccess 10      ! depending on context:
+                            !         - key/button already grabbed
+                            !         - attempt to free an illegal
+                            !           cmap entry
+                            !        - attempt to store into a read-only
+                            !           color map entry.
+                            !        - attempt to modify the access control
+                            !           list from other than the local host.
+CONSTANT: BadAlloc 11       ! insufficient resources
+CONSTANT: BadColor 12       ! no such colormap
+CONSTANT: BadGC 13          ! parameter not a GC
+CONSTANT: BadIDChoice 14    ! choice not in range or already used
+CONSTANT: BadName 15        ! font or color name doesn't exist
+CONSTANT: BadLength 16      ! Request length incorrect
+CONSTANT: BadImplementation 17  ! server is defective
+
+CONSTANT: FirstExtensionError 128
+CONSTANT: LastExtensionError 255
+
+! *****************************************************************
+! * WINDOW DEFINITIONS
+! *****************************************************************
+
+! Window classes used by CreateWindow
+! Note that CopyFromParent is already defined as 0 above
+
+CONSTANT: InputOutput 1
+CONSTANT: InputOnly 2
+
+! ConfigureWindow structure
+: CWX           ( -- n ) 0 2^ ; inline
+: CWY           ( -- n ) 1 2^ ; inline
+: CWWidth       ( -- n ) 2 2^ ; inline
+: CWHeight      ( -- n ) 3 2^ ; inline
+: CWBorderWidth ( -- n ) 4 2^ ; inline
+: CWSibling     ( -- n ) 5 2^ ; inline
+: CWStackMode   ( -- n ) 6 2^ ; inline
+
+! Bit Gravity
+
+CONSTANT: ForgetGravity         0
+CONSTANT: NorthWestGravity      1
+CONSTANT: NorthGravity          2
+CONSTANT: NorthEastGravity      3
+CONSTANT: WestGravity           4
+CONSTANT: CenterGravity         5
+CONSTANT: EastGravity           6
+CONSTANT: SouthWestGravity      7
+CONSTANT: SouthGravity          8
+CONSTANT: SouthEastGravity      9
+CONSTANT: StaticGravity         10
+
+! Window gravity + bit gravity above
+
+CONSTANT: UnmapGravity          0
+
+! Used in CreateWindow for backing-store hint
+
+CONSTANT: NotUseful 0
+CONSTANT: WhenMapped 1
+CONSTANT: Always 2
+
+! Used in GetWindowAttributes reply
+CONSTANT: IsUnmapped            0
+CONSTANT: IsUnviewable          1
+CONSTANT: IsViewable            2
+
+
+! Used in ChangeSaveSet
+
+CONSTANT: SetModeInsert 0
+CONSTANT: SetModeDelete 1
+
+! Used in ChangeCloseDownMode
+
+CONSTANT: DestroyAll 0
+CONSTANT: RetainPermanent 1
+CONSTANT: RetainTemporary 2
+
+! Window stacking method (in configureWindow)
+
+CONSTANT: Above 0
+CONSTANT: Below 1
+CONSTANT: TopIf 2
+CONSTANT: BottomIf 3
+CONSTANT: Opposite 4
+
+! Circulation direction
+
+CONSTANT: RaiseLowest 0
+CONSTANT: LowerHighest 1
+
+! Property modes
+
+CONSTANT: PropModeReplace 0
+CONSTANT: PropModePrepend 1
+CONSTANT: PropModeAppend 2
+
+! *****************************************************************
+! * GRAPHICS DEFINITIONS
+! *****************************************************************
+
+! graphics functions, as in GC.alu
+
+CONSTANT: GXclear               0x0
+CONSTANT: GXand                 0x1
+CONSTANT: GXandReverse          0x2
+CONSTANT: GXcopy                0x3
+CONSTANT: GXandInverted         0x4
+CONSTANT: GXnoop                0x5
+CONSTANT: GXxor                 0x6
+CONSTANT: GXor                  0x7
+CONSTANT: GXnor                 0x8
+CONSTANT: GXequiv               0x9
+CONSTANT: GXinvert              0xa
+CONSTANT: GXorReverse           0xb
+CONSTANT: GXcopyInverted        0xc
+CONSTANT: GXorInverted          0xd
+CONSTANT: GXnand                0xe
+CONSTANT: GXset                 0xf
+
+! LineStyle
+
+CONSTANT: LineSolid 0
+CONSTANT: LineOnOffDash 1
+CONSTANT: LineDoubleDash 2
+
+! capStyle
+
+CONSTANT: CapNotLast 0
+CONSTANT: CapButt 1
+CONSTANT: CapRound 2
+CONSTANT: CapProjecting 3
+
+! joinStyle
+
+CONSTANT: JoinMiter 0
+CONSTANT: JoinRound 1
+CONSTANT: JoinBevel 2
+
+! fillStyle
+
+CONSTANT: FillSolid 0
+CONSTANT: FillTiled 1
+CONSTANT: FillStippled 2
+CONSTANT: FillOpaqueStippled 3
+
+! fillRule
+
+CONSTANT: EvenOddRule 0
+CONSTANT: WindingRule 1
+
+! subwindow mode
+
+CONSTANT: ClipByChildren 0
+CONSTANT: IncludeInferiors 1
+
+! SetClipRectangles ordering
+
+CONSTANT: Unsorted 0
+CONSTANT: YSorted 1
+CONSTANT: YXSorted 2
+CONSTANT: YXBanded 3
+
+! CoordinateMode for drawing routines
+
+CONSTANT: CoordModeOrigin 0     ! relative to the origin
+CONSTANT: CoordModePrevious 1   ! relative to previous point
+
+! Polygon shapes
+
+CONSTANT: Complex 0 ! paths may intersect
+CONSTANT: Nonconvex 1 ! no paths intersect, but not convex
+CONSTANT: Convex 2 ! wholly convex
+
+! Arc modes for PolyFillArc
+
+CONSTANT: ArcChord 0 ! join endpoints of arc
+CONSTANT: ArcPieSlice 1 ! join endpoints to center of arc
+
+! GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
+! GC.stateChanges
+
+: GCFunction          ( -- n ) 0 2^ ; inline
+: GCPlaneMask         ( -- n ) 1 2^ ; inline
+: GCForeground        ( -- n ) 2 2^ ; inline
+: GCBackground        ( -- n ) 3 2^ ; inline
+: GCLineWidth         ( -- n ) 4 2^ ; inline
+: GCLineStyle         ( -- n ) 5 2^ ; inline
+: GCCapStyle          ( -- n ) 6 2^ ; inline
+: GCJoinStyle         ( -- n ) 7 2^ ; inline
+: GCFillStyle         ( -- n ) 8 2^ ; inline
+: GCFillRule          ( -- n ) 9 2^ ; inline
+: GCTile              ( -- n ) 10 2^ ; inline
+: GCStipple           ( -- n ) 11 2^ ; inline
+: GCTileStipXOrigin   ( -- n ) 12 2^ ; inline
+: GCTileStipYOrigin   ( -- n ) 13 2^ ; inline
+: GCFont              ( -- n ) 14 2^ ; inline
+: GCSubwindowMode     ( -- n ) 15 2^ ; inline
+: GCGraphicsExposures ( -- n ) 16 2^ ; inline
+: GCClipXOrigin       ( -- n ) 17 2^ ; inline
+: GCClipYOrigin       ( -- n ) 18 2^ ; inline
+: GCClipMask          ( -- n ) 19 2^ ; inline
+: GCDashOffset        ( -- n ) 20 2^ ; inline
+: GCDashList          ( -- n ) 21 2^ ; inline
+: GCArcMode           ( -- n ) 22 2^ ; inline
+
+! *****************************************************************
+! * FONTS
+! *****************************************************************
+
+! used in QueryFont -- draw direction
+
+CONSTANT: FontLeftToRight 0
+CONSTANT: FontRightToLeft 1
+
+CONSTANT: FontChange 255
+
+! *****************************************************************
+! *  IMAGING
+! *****************************************************************
+
+! ImageFormat -- PutImage, GetImage
+
+CONSTANT: XYBitmap 0    ! depth 1, XYFormat
+CONSTANT: XYPixmap 1    ! depth == drawable depth
+CONSTANT: ZPixmap 2     ! depth == drawable depth
+
+! *****************************************************************
+! *  COLOR MAP STUFF
+! *****************************************************************
+
+! For CreateColormap
+
+CONSTANT: AllocNone 0   ! create map with no entries
+CONSTANT: AllocAll 1    ! allocate entire map writeable
+
+
+! Flags used in StoreNamedColor, StoreColors
+
+: DoRed        ( -- n ) 0 2^ ;
+: DoGreen      ( -- n ) 1 2^ ;
+: DoBlue       ( -- n ) 2 2^ ;
+
+! *****************************************************************
+! * CURSOR STUFF
+! *****************************************************************
+
+! QueryBestSize Class
+
+CONSTANT: CursorShape 0     ! largest size that can be displayed
+CONSTANT: TileShape 1       ! size tiled fastest
+CONSTANT: StippleShape 2    ! size stippled fastest
+
+! *****************************************************************
+! * KEYBOARD/POINTER STUFF
+! *****************************************************************
+
+CONSTANT: AutoRepeatModeOff 0
+CONSTANT: AutoRepeatModeOn 1
+CONSTANT: AutoRepeatModeDefault 2
+
+CONSTANT: LedModeOff 0
+CONSTANT: LedModeOn 1
+
+! masks for ChangeKeyboardControl
+
+: KBKeyClickPercent    ( -- n ) 0 2^ ;
+: KBBellPercent        ( -- n ) 1 2^ ;
+: KBBellPitch          ( -- n ) 2 2^ ;
+: KBBellDuration       ( -- n ) 3 2^ ;
+: KBLed                ( -- n ) 4 2^ ;
+: KBLedMode            ( -- n ) 5 2^ ;
+: KBKey                ( -- n ) 6 2^ ;
+: KBAutoRepeatMode     ( -- n ) 7 2^ ;
+
+CONSTANT: MappingSuccess 0
+CONSTANT: MappingBusy 1
+CONSTANT: MappingFailed 2
+
+CONSTANT: MappingModifier 0
+CONSTANT: MappingKeyboard 1
+CONSTANT: MappingPointer 2
+
+! *****************************************************************
+! * SCREEN SAVER STUFF
+! *****************************************************************
+
+CONSTANT: DontPreferBlanking 0
+CONSTANT: PreferBlanking 1
+CONSTANT: DefaultBlanking 2
+
+CONSTANT: DisableScreenSaver 0
+CONSTANT: DisableScreenInterval 0
+
+CONSTANT: DontAllowExposures 0
+CONSTANT: AllowExposures 1
+CONSTANT: DefaultExposures 2
+
+! for ForceScreenSaver
+
+CONSTANT: ScreenSaverReset 0
+CONSTANT: ScreenSaverActive 1
+
+! *****************************************************************
+! * HOSTS AND CONNECTIONS
+! *****************************************************************
+
+! for ChangeHosts
+
+CONSTANT: HostInsert 0
+CONSTANT: HostDelete 1
+
+! for ChangeAccessControl
+
+CONSTANT: EnableAccess 1
+CONSTANT: DisableAccess 0
+
+! Display classes  used in opening the connection
+! Note that the statically allocated ones are even numbered and the
+! dynamically changeable ones are odd numbered
+
+CONSTANT: StaticGray 0
+CONSTANT: GrayScale 1
+CONSTANT: StaticColor 2
+CONSTANT: PseudoColor 3
+CONSTANT: TrueColor 4
+CONSTANT: DirectColor 5
+
+! Byte order  used in imageByteOrder and bitmapBitOrder
+
+CONSTANT: LSBFirst 0
+CONSTANT: MSBFirst 1
diff --git a/basis/x11/X/authors.txt b/basis/x11/X/authors.txt
new file mode 100644 (file)
index 0000000..d14b895
--- /dev/null
@@ -0,0 +1,3 @@
+Eduardo Cavazos
+Slava Pestov
+Björn Lindqvist
diff --git a/basis/x11/X/summary.txt b/basis/x11/X/summary.txt
new file mode 100644 (file)
index 0000000..09d7240
--- /dev/null
@@ -0,0 +1 @@
+Bindings for /usr/include/X11/X.h constants
index 319ca4671421d1be7ea8bd5cda39d71698eb0ccb..82913b81122879928fc1b327cf27ff084588e3d8 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2006, 2010 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types alien.data alien.strings
-classes.struct io.encodings.utf8 kernel namespaces sequences
-specialized-arrays x11 x11.constants x11.xlib ;
+USING: accessors alien.c-types alien.data alien.strings classes.struct
+io.encodings.utf8 kernel namespaces sequences specialized-arrays x11
+x11.X x11.xlib ;
 SPECIALIZED-ARRAY: int
 IN: x11.clipboard
 
diff --git a/basis/x11/constants/authors.txt b/basis/x11/constants/authors.txt
deleted file mode 100644 (file)
index db8d844..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Eduardo Cavazos
-Slava Pestov
diff --git a/basis/x11/constants/constants.factor b/basis/x11/constants/constants.factor
deleted file mode 100644 (file)
index 872cdbe..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman
-! See http://factorcode.org/license.txt for BSD license.
-
-! Based on X.h
-
-USING: alien alien.c-types alien.syntax math x11.xlib ;
-IN: x11.constants
-
-TYPEDEF: ulong Mask
-
-TYPEDEF: uchar KeyCode
-
-! Reserved Resource and Constant Definitions
-
-CONSTANT: ParentRelative 1
-CONSTANT: CopyFromParent 0
-CONSTANT: PointerWindow 0
-CONSTANT: InputFocus 1
-CONSTANT: PointerRoot 1
-CONSTANT: AnyPropertyType 0
-CONSTANT: AnyKey 0
-CONSTANT: AnyButton 0
-CONSTANT: AllTemporary 0
-CONSTANT: CurrentTime 0
-CONSTANT: NoSymbol 0
-
-! Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
-!   state in various key-, mouse-, and button-related events.
-
-! modifier names.  Used to build a SetModifierMapping request or
-! to read a GetModifierMapping request.  These correspond to the
-! masks defined above.
-CONSTANT: ShiftMapIndex 0
-CONSTANT: LockMapIndex 1
-CONSTANT: ControlMapIndex 2
-CONSTANT: Mod1MapIndex 3
-CONSTANT: Mod2MapIndex 4
-CONSTANT: Mod3MapIndex 5
-CONSTANT: Mod4MapIndex 6
-CONSTANT: Mod5MapIndex 7
-
-
-! button masks.  Used in same manner as Key masks above. Not to be confused
-! with button names below.
-
-
-: AnyModifier          ( -- n ) 15 2^ ; ! used in GrabButton, GrabKey
-
-! button names. Used as arguments to GrabButton and as detail in ButtonPress
-! and ButtonRelease events.  Not to be confused with button masks above.
-! Note that 0 is already defined above as "AnyButton".
-
-! Notify modes
-
-CONSTANT: NotifyNormal 0
-CONSTANT: NotifyGrab 1
-CONSTANT: NotifyUngrab 2
-CONSTANT: NotifyWhileGrabbed 3
-
-CONSTANT: NotifyHint 1 ! for MotionNotify events
-
-! Notify detail
-
-CONSTANT: NotifyAncestor 0
-CONSTANT: NotifyVirtual 1
-CONSTANT: NotifyInferior 2
-CONSTANT: NotifyNonlinear 3
-CONSTANT: NotifyNonlinearVirtual 4
-CONSTANT: NotifyPointer 5
-CONSTANT: NotifyPointerRoot 6
-CONSTANT: NotifyDetailNone 7
-
-! Visibility notify
-
-CONSTANT: VisibilityUnobscured 0
-CONSTANT: VisibilityPartiallyObscured 1
-CONSTANT: VisibilityFullyObscured 2
-
-! Circulation request
-
-CONSTANT: PlaceOnTop 0
-CONSTANT: PlaceOnBottom 1
-
-! protocol families
-
-CONSTANT: FamilyInternet 0     ! IPv4
-CONSTANT: FamilyDECnet 1
-CONSTANT: FamilyChaos 2
-CONSTANT: FamilyInternet6 6     ! IPv6
-
-! authentication families not tied to a specific protocol
-CONSTANT: FamilyServerInterpreted 5
-
-! Property notification
-
-CONSTANT: PropertyNewValue 0
-CONSTANT: PropertyDelete 1
-
-! Color Map notification
-
-CONSTANT: ColormapUninstalled 0
-CONSTANT: ColormapInstalled 1
-
-! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
-
-CONSTANT: GrabModeSync 0
-CONSTANT: GrabModeAsync 1
-
-! GrabPointer, GrabKeyboard reply status
-
-CONSTANT: GrabSuccess 0
-CONSTANT: AlreadyGrabbed 1
-CONSTANT: GrabInvalidTime 2
-CONSTANT: GrabNotViewable 3
-CONSTANT: GrabFrozen 4
-
-! AllowEvents modes
-
-CONSTANT: AsyncPointer 0
-CONSTANT: SyncPointer 1
-CONSTANT: ReplayPointer 2
-CONSTANT: AsyncKeyboard 3
-CONSTANT: SyncKeyboard 4
-CONSTANT: ReplayKeyboard 5
-CONSTANT: AsyncBoth 6
-CONSTANT: SyncBoth 7
-
-! Used in SetInputFocus, GetInputFocus
-
-: RevertToNone         ( -- n ) None ;
-: RevertToPointerRoot  ( -- n ) PointerRoot ;
-CONSTANT: RevertToParent 2
-
-! *****************************************************************
-! * ERROR CODES
-! *****************************************************************
-
-CONSTANT: Success 0         ! everything's okay
-CONSTANT: BadRequest 1      ! bad request code
-CONSTANT: BadValue 2        ! int parameter out of range
-CONSTANT: BadWindow 3       ! parameter not a Window
-CONSTANT: BadPixmap 4       ! parameter not a Pixmap
-CONSTANT: BadAtom 5         ! parameter not an Atom
-CONSTANT: BadCursor 6       ! parameter not a Cursor
-CONSTANT: BadFont 7         ! parameter not a Font
-CONSTANT: BadMatch 8        ! parameter mismatch
-CONSTANT: BadDrawable 9     ! parameter not a Pixmap or Window
-CONSTANT: BadAccess 10      ! depending on context:
-                            !         - key/button already grabbed
-                            !         - attempt to free an illegal
-                            !           cmap entry
-                            !        - attempt to store into a read-only
-                            !           color map entry.
-                            !        - attempt to modify the access control
-                            !           list from other than the local host.
-CONSTANT: BadAlloc 11       ! insufficient resources
-CONSTANT: BadColor 12       ! no such colormap
-CONSTANT: BadGC 13          ! parameter not a GC
-CONSTANT: BadIDChoice 14    ! choice not in range or already used
-CONSTANT: BadName 15        ! font or color name doesn't exist
-CONSTANT: BadLength 16      ! Request length incorrect
-CONSTANT: BadImplementation 17  ! server is defective
-
-CONSTANT: FirstExtensionError 128
-CONSTANT: LastExtensionError 255
-
-! *****************************************************************
-! * WINDOW DEFINITIONS
-! *****************************************************************
-
-! Window classes used by CreateWindow
-! Note that CopyFromParent is already defined as 0 above
-
-CONSTANT: InputOutput 1
-CONSTANT: InputOnly 2
-
-! Used in CreateWindow for backing-store hint
-
-CONSTANT: NotUseful 0
-CONSTANT: WhenMapped 1
-CONSTANT: Always 2
-
-! Used in ChangeSaveSet
-
-CONSTANT: SetModeInsert 0
-CONSTANT: SetModeDelete 1
-
-! Used in ChangeCloseDownMode
-
-CONSTANT: DestroyAll 0
-CONSTANT: RetainPermanent 1
-CONSTANT: RetainTemporary 2
-
-! Window stacking method (in configureWindow)
-
-CONSTANT: Above 0
-CONSTANT: Below 1
-CONSTANT: TopIf 2
-CONSTANT: BottomIf 3
-CONSTANT: Opposite 4
-
-! Circulation direction
-
-CONSTANT: RaiseLowest 0
-CONSTANT: LowerHighest 1
-
-! Property modes
-
-CONSTANT: PropModeReplace 0
-CONSTANT: PropModePrepend 1
-CONSTANT: PropModeAppend 2
-
-! *****************************************************************
-! * GRAPHICS DEFINITIONS
-! *****************************************************************
-
-! LineStyle
-
-CONSTANT: LineSolid 0
-CONSTANT: LineOnOffDash 1
-CONSTANT: LineDoubleDash 2
-
-! capStyle
-
-CONSTANT: CapNotLast 0
-CONSTANT: CapButt 1
-CONSTANT: CapRound 2
-CONSTANT: CapProjecting 3
-
-! joinStyle
-
-CONSTANT: JoinMiter 0
-CONSTANT: JoinRound 1
-CONSTANT: JoinBevel 2
-
-! fillStyle
-
-CONSTANT: FillSolid 0
-CONSTANT: FillTiled 1
-CONSTANT: FillStippled 2
-CONSTANT: FillOpaqueStippled 3
-
-! fillRule
-
-CONSTANT: EvenOddRule 0
-CONSTANT: WindingRule 1
-
-! subwindow mode
-
-CONSTANT: ClipByChildren 0
-CONSTANT: IncludeInferiors 1
-
-! SetClipRectangles ordering
-
-CONSTANT: Unsorted 0
-CONSTANT: YSorted 1
-CONSTANT: YXSorted 2
-CONSTANT: YXBanded 3
-
-! CoordinateMode for drawing routines
-
-CONSTANT: CoordModeOrigin 0     ! relative to the origin
-CONSTANT: CoordModePrevious 1   ! relative to previous point
-
-! Polygon shapes
-
-CONSTANT: Complex 0 ! paths may intersect
-CONSTANT: Nonconvex 1 ! no paths intersect, but not convex
-CONSTANT: Convex 2 ! wholly convex
-
-! Arc modes for PolyFillArc
-
-CONSTANT: ArcChord 0 ! join endpoints of arc
-CONSTANT: ArcPieSlice 1 ! join endpoints to center of arc
-
-! *****************************************************************
-! * FONTS
-! *****************************************************************
-
-! used in QueryFont -- draw direction
-
-CONSTANT: FontLeftToRight 0
-CONSTANT: FontRightToLeft 1
-
-CONSTANT: FontChange 255
-
-! *****************************************************************
-! *  IMAGING
-! *****************************************************************
-
-! ImageFormat -- PutImage, GetImage
-
-CONSTANT: XYBitmap 0    ! depth 1, XYFormat
-CONSTANT: XYPixmap 1    ! depth == drawable depth
-CONSTANT: ZPixmap 2     ! depth == drawable depth
-
-! *****************************************************************
-! *  COLOR MAP STUFF
-! *****************************************************************
-
-! For CreateColormap
-
-CONSTANT: AllocNone 0   ! create map with no entries
-CONSTANT: AllocAll 1    ! allocate entire map writeable
-
-
-! Flags used in StoreNamedColor, StoreColors
-
-: DoRed        ( -- n ) 0 2^ ;
-: DoGreen      ( -- n ) 1 2^ ;
-: DoBlue       ( -- n ) 2 2^ ;
-
-! *****************************************************************
-! * CURSOR STUFF
-! *****************************************************************
-
-! QueryBestSize Class
-
-CONSTANT: CursorShape 0     ! largest size that can be displayed
-CONSTANT: TileShape 1       ! size tiled fastest
-CONSTANT: StippleShape 2    ! size stippled fastest
-
-! *****************************************************************
-! * KEYBOARD/POINTER STUFF
-! *****************************************************************
-
-CONSTANT: AutoRepeatModeOff 0
-CONSTANT: AutoRepeatModeOn 1
-CONSTANT: AutoRepeatModeDefault 2
-
-CONSTANT: LedModeOff 0
-CONSTANT: LedModeOn 1
-
-! masks for ChangeKeyboardControl
-
-: KBKeyClickPercent    ( -- n ) 0 2^ ;
-: KBBellPercent        ( -- n ) 1 2^ ;
-: KBBellPitch          ( -- n ) 2 2^ ;
-: KBBellDuration       ( -- n ) 3 2^ ;
-: KBLed                ( -- n ) 4 2^ ;
-: KBLedMode            ( -- n ) 5 2^ ;
-: KBKey                ( -- n ) 6 2^ ;
-: KBAutoRepeatMode     ( -- n ) 7 2^ ;
-
-CONSTANT: MappingSuccess 0
-CONSTANT: MappingBusy 1
-CONSTANT: MappingFailed 2
-
-CONSTANT: MappingModifier 0
-CONSTANT: MappingKeyboard 1
-CONSTANT: MappingPointer 2
-
-! *****************************************************************
-! * SCREEN SAVER STUFF
-! *****************************************************************
-
-CONSTANT: DontPreferBlanking 0
-CONSTANT: PreferBlanking 1
-CONSTANT: DefaultBlanking 2
-
-CONSTANT: DisableScreenSaver 0
-CONSTANT: DisableScreenInterval 0
-
-CONSTANT: DontAllowExposures 0
-CONSTANT: AllowExposures 1
-CONSTANT: DefaultExposures 2
-
-! for ForceScreenSaver
-
-CONSTANT: ScreenSaverReset 0
-CONSTANT: ScreenSaverActive 1
-
-! *****************************************************************
-! * HOSTS AND CONNECTIONS
-! *****************************************************************
-
-! for ChangeHosts
-
-CONSTANT: HostInsert 0
-CONSTANT: HostDelete 1
-
-! for ChangeAccessControl
-
-CONSTANT: EnableAccess 1
-CONSTANT: DisableAccess 0
-
-! Display classes  used in opening the connection
-! Note that the statically allocated ones are even numbered and the
-! dynamically changeable ones are odd numbered
-
-CONSTANT: StaticGray 0
-CONSTANT: GrayScale 1
-CONSTANT: StaticColor 2
-CONSTANT: PseudoColor 3
-CONSTANT: TrueColor 4
-CONSTANT: DirectColor 5
-
-! Byte order  used in imageByteOrder and bitmapBitOrder
-
-CONSTANT: LSBFirst 0
-CONSTANT: MSBFirst 1
-
-! *****************************************************************
-! * EXTENDED WINDOW MANAGER HINTS
-! *****************************************************************
-
-CONSTANT: _NET_WM_STATE_REMOVE 0
-CONSTANT: _NET_WM_STATE_ADD 1
-CONSTANT: _NET_WM_STATE_TOGGLE 2
diff --git a/basis/x11/constants/summary.txt b/basis/x11/constants/summary.txt
deleted file mode 100644 (file)
index 9580806..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Xlib constants
index 949c751de5ab30f5ae37602eba270a22c8c5bca7..c71f0a6f2328e309bcc9dd90a0a55e0a27691b3c 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2005, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays classes.struct combinators
-combinators.short-circuit kernel math.order namespaces
-x11 x11.xlib ;
+combinators.short-circuit kernel math.order namespaces x11 x11.X
+x11.xlib ;
 IN: x11.events
 
 GENERIC: expose-event ( event window -- )
index 05465d8beaa4497da79b67b340d3c318ee3b090e..81bf8b08c123225656419ccc5c6fb13075696f5b 100644 (file)
@@ -2,9 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 !
 ! based on glx.h from xfree86, and some of glxtokens.h
-USING: alien alien.c-types alien.syntax x11 x11.xlib x11.syntax
-namespaces make kernel sequences parser words
-specialized-arrays accessors ;
+USING: alien.c-types alien.syntax kernel namespaces specialized-arrays
+x11 x11.X x11.syntax x11.xlib ;
 SPECIALIZED-ARRAY: int
 IN: x11.glx
 
index f07f4cd8e73d3c791973478cc5d16514ed584960..35e5edc8b66c3d9cba551f12fab68568ef84357a 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2016 Björn Lindqvist
 ! See http://factorcode.org/license.txt for BSD license.
 
-! Selected parts of keysymdef.h
+! Selected parts of /usr/include/X11/keysymdef.h
 IN: x11.keysymdef
 
 ! TTY function keys, cleverly chosen to map to ASCII, for convenience
diff --git a/basis/x11/keysymdef/summary.txt b/basis/x11/keysymdef/summary.txt
new file mode 100644 (file)
index 0000000..f227d77
--- /dev/null
@@ -0,0 +1 @@
+Bindings for /usr/include/X11/keysymdef.h constants
index 72c0670482d96de5cd0d3fd11b43cba6a3a6e5fc..b0d6ce3d7006d8c5fe6ccb8c7ab2dcac17352799 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2005, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types alien.data kernel math
-math.bitwise math.vectors namespaces sequences arrays fry
-classes.struct literals x11 x11.xlib x11.constants x11.events
-x11.glx ;
+USING: accessors alien.data classes.struct fry kernel literals math
+math.vectors namespaces sequences x11 x11.X x11.events x11.glx
+x11.xlib ;
 IN: x11.windows
 
 CONSTANT: create-window-mask
index 24b7cae12bfe82702af37e8593b8aff7af151397..0f8bd482002a4f5d1d356801009cbf3f3502d977 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2007, 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.data alien.strings arrays
-byte-arrays hashtables io io.encodings.string kernel math
-namespaces sequences strings continuations x11 x11.xlib
-accessors io.encodings.utf8 literals ;
+USING: alien.c-types alien.data byte-arrays continuations
+io.encodings.string io.encodings.utf8 kernel literals math namespaces
+sequences x11 x11.X x11.xlib ;
 IN: x11.xim
 
 SYMBOL: xim
index a12c1044e3099ed92abc4a474343194e60a89317..d625879e6ce8fb39db5bd7b7344a8a361ebf9965 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2010 Niklas Waern.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.libraries alien.syntax
-classes.struct locals sequences x11.syntax x11.xlib ;
+USING: alien alien.c-types alien.libraries alien.syntax classes.struct
+locals sequences x11.X x11.syntax x11.xlib ;
 EXCLUDE: math => float ;
 IN: x11.xinput2.ffi
 
index c60c13b049a14cb289804a1424350a82a1d36245..1ecd010fbf6532af5a1d5e11f89839845ae06746 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2010 Niklas Waern.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types alien.data combinators kernel namespaces
-x11 x11.constants x11.xinput2.ffi ;
+USING: alien.c-types alien.data combinators kernel namespaces x11
+x11.X x11.xinput2.ffi ;
 IN: x11.xinput2
 
 : (xi2-available?) ( display -- ? )
index f68f86f349f1380feffc92960a4a191a2981a18e..eaf7a416ada4d7e53d8e1ded0c709740408cddc2 100644 (file)
 ! and note the section.
 !
 ! https://www.x.org/releases/X11R7.6/doc/libX11/specs/libX11/libX11.html
-USING: accessors kernel arrays alien alien.c-types alien.data
-alien.strings alien.syntax classes.struct math math.bitwise words
-sequences namespaces continuations io io.encodings.ascii x11.syntax
-literals ;
+USING: accessors alien.c-types alien.data alien.syntax classes.struct
+kernel literals math x11.syntax x11.X ;
 FROM: alien.c-types => short ;
 IN: x11.xlib
 
 LIBRARY: xlib
 
-TYPEDEF: ulong XID
-TYPEDEF: XID Window
-TYPEDEF: XID Drawable
-TYPEDEF: XID Font
-TYPEDEF: XID Pixmap
-TYPEDEF: XID Cursor
-TYPEDEF: XID Colormap
-TYPEDEF: XID GContext
-TYPEDEF: XID KeySym
-
-TYPEDEF: ulong Atom
-
 TYPEDEF: c-string XPointer
 C-TYPE: Screen
 TYPEDEF: void* GC
@@ -125,20 +111,6 @@ STRUCT: XSetWindowAttributes
     { colormap Colormap }
     { cursor Cursor } ;
 
-CONSTANT: UnmapGravity          0
-
-CONSTANT: ForgetGravity         0
-CONSTANT: NorthWestGravity      1
-CONSTANT: NorthGravity          2
-CONSTANT: NorthEastGravity      3
-CONSTANT: WestGravity           4
-CONSTANT: CenterGravity         5
-CONSTANT: EastGravity           6
-CONSTANT: SouthWestGravity      7
-CONSTANT: SouthGravity          8
-CONSTANT: SouthEastGravity      9
-CONSTANT: StaticGravity         10
-
 ! 3.3 - Creating Windows
 
 X-FUNCTION: Window XCreateWindow ( Display* display,
@@ -164,14 +136,6 @@ X-FUNCTION: int XMapRaised ( Display* display, Window w )
 
 ! 3.7 - Configuring Windows
 
-: CWX           ( -- n ) 0 2^ ; inline
-: CWY           ( -- n ) 1 2^ ; inline
-: CWWidth       ( -- n ) 2 2^ ; inline
-: CWHeight      ( -- n ) 3 2^ ; inline
-: CWBorderWidth ( -- n ) 4 2^ ; inline
-: CWSibling     ( -- n ) 5 2^ ; inline
-: CWStackMode   ( -- n ) 6 2^ ; inline
-
 STRUCT: XWindowChanges
     { x int }
     { y int }
@@ -186,8 +150,13 @@ X-FUNCTION: Status XConfigureWindow ( Display* display,
                                       uint value_mask, XWindowChanges* values )
 X-FUNCTION: Status XMoveWindow ( Display* display, Window w,
                                  int x, int y )
-X-FUNCTION: Status XResizeWindow ( Display* display, Window w, uint width, uint height )
-X-FUNCTION: Status XSetWindowBorderWidth ( Display* display, ulong w, uint width )
+X-FUNCTION: Status XResizeWindow ( Display* display,
+                                   Window w,
+                                   uint width,
+                                   uint height )
+X-FUNCTION: Status XSetWindowBorderWidth ( Display* display,
+                                           ulong w,
+                                           uint width )
 
 
 ! 3.8 Changing Window Stacking Order
@@ -199,7 +168,8 @@ X-FUNCTION: Status XLowerWindow ( Display* display, Window w )
 
 X-FUNCTION: Status XChangeWindowAttributes ( Display* display,
                                              Window w,
-                                             ulong valuemask, XSetWindowAttributes* attr )
+                                             ulong valuemask,
+                                             XSetWindowAttributes* attr )
 X-FUNCTION: Status XSetWindowBackground ( Display* display,
                                           Window w, ulong background_pixel )
 X-FUNCTION: Status XDefineCursor ( Display* display, Window w, Cursor cursor )
@@ -211,13 +181,12 @@ X-FUNCTION: Status XUndefineCursor ( Display* display, Window w )
 
 ! 4.1 - Obtaining Window Information
 
-X-FUNCTION: Status XQueryTree (
-    Display* display,
-    Window w,
-    Window* root_return,
-    Window* parent_return,
-    Window** children_return, uint* nchildren_return
-)
+X-FUNCTION: Status XQueryTree ( Display* display,
+                                Window w,
+                                Window* root_return,
+                                Window* parent_return,
+                                Window** children_return,
+                                uint* nchildren_return )
 
 STRUCT: XWindowAttributes
     { x int }
@@ -244,66 +213,67 @@ STRUCT: XWindowAttributes
     { override_redirect Bool }
     { screen Screen* } ;
 
-X-FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr )
-
-CONSTANT: IsUnmapped            0
-CONSTANT: IsUnviewable          1
-CONSTANT: IsViewable            2
+X-FUNCTION: Status XGetWindowAttributes ( Display* display,
+                                          Window w,
+                                          XWindowAttributes* attr )
 
-X-FUNCTION: Status XGetGeometry (
-    Display* display,
-    Drawable d,
-    Window* root_return,
-    int* x_return,
-    int* y_return,
-    uint* width_return,
-    uint* height_return,
-    uint* border_width_return,
-    uint* depth_return
-)
+X-FUNCTION: Status XGetGeometry ( Display* display,
+                                  Drawable d,
+                                  Window* root_return,
+                                  int* x_return,
+                                  int* y_return,
+                                  uint* width_return,
+                                  uint* height_return,
+                                  uint* border_width_return,
+                                  uint* depth_return )
 
 ! 4.2 - Translating Screen Coordinates
 
-X-FUNCTION: Bool XQueryPointer (
-    Display* display,
-    Window w,
-    Window* root_return, Window* child_return,
-    int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return,
-    uint* mask_return
-)
+X-FUNCTION: Bool XQueryPointer ( Display* display,
+                                 Window w,
+                                 Window* root_return, Window* child_return,
+                                 int* root_x_return, int* root_y_return,
+                                 int* win_x_return, int* win_y_return,
+                                 uint* mask_return )
 
 ! 4.3 - Properties and Atoms
 
-X-FUNCTION: Atom XInternAtom ( Display* display, c-string atom_name, Bool only_if_exists )
+X-FUNCTION: Atom XInternAtom ( Display* display,
+                               c-string atom_name,
+                               Bool only_if_exists )
 
 X-FUNCTION: c-string XGetAtomName ( Display* display, Atom atom )
 
 ! 4.4 - Obtaining and Changing Window Properties
 
-X-FUNCTION: int XGetWindowProperty (
-    Display* display, Window w, Atom property,
-    long long_offset, long long_length,
-    Bool delete, Atom req_type,
-    Atom* actual_type_return, int* actual_format_return,
-    ulong* nitems_return, ulong* bytes_after_return, c-string* prop_return
-)
+X-FUNCTION: int XGetWindowProperty ( Display* display, Window w, Atom property,
+                                     long long_offset, long long_length,
+                                     Bool delete, Atom req_type,
+                                     Atom* actual_type_return,
+                                     int* actual_format_return,
+                                     ulong* nitems_return,
+                                     ulong* bytes_after_return,
+                                     c-string* prop_return )
 
-X-FUNCTION: int XChangeProperty (
-    Display* display, Window w, Atom property,
-    Atom type, int format,
-    int mode, void* data, int nelements
-)
+X-FUNCTION: int XChangeProperty ( Display* display, Window w, Atom property,
+                                  Atom type, int format,
+                                  int mode, void* data, int nelements )
 
 ! 4.5 Selections
 
-X-FUNCTION: int XSetSelectionOwner ( Display* display, Atom selection, Window owner, Time time )
+X-FUNCTION: int XSetSelectionOwner ( Display* display,
+                                     Atom selection,
+                                     Window owner,
+                                     Time time )
 
 X-FUNCTION: Window XGetSelectionOwner ( Display* display, Atom selection )
 
-X-FUNCTION: int XConvertSelection (
-    Display* display, Atom selection, Atom target,
-    Atom property, Window requestor, Time time
-)
+X-FUNCTION: int XConvertSelection ( Display* display,
+                                    Atom selection,
+                                    Atom target,
+                                    Atom property,
+                                    Window requestor,
+                                    Time time )
 
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -312,13 +282,19 @@ X-FUNCTION: int XConvertSelection (
 
 ! 5.1 - Creating and Freeing Pixmaps
 
-X-FUNCTION: Pixmap XCreatePixmap ( Display* display, Drawable d, uint width, uint height, uint depth )
+X-FUNCTION: Pixmap XCreatePixmap ( Display* display,
+                                   Drawable d,
+                                   uint width, uint height, uint depth )
 X-FUNCTION: int XFreePixmap ( Display* display, Pixmap pixmap )
 
 ! 5.2 - Creating, Recoloring, and Freeing Cursors
 
 C-TYPE: XColor
-X-FUNCTION: Cursor XCreatePixmapCursor ( Display* display, Pixmap source, Pixmap mask, XColor* foreground_color, XColor* background_color, uint x, uint y )
+X-FUNCTION: Cursor XCreatePixmapCursor ( Display* display,
+                                         Pixmap source, Pixmap mask,
+                                         XColor* foreground_color,
+                                         XColor* background_color,
+                                         uint x, uint y )
 X-FUNCTION: int XFreeCursor ( Display* display, Cursor cursor )
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -349,47 +325,6 @@ X-FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visua
 ! 7 - Graphics Context Functions
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: GCFunction          ( -- n ) 0 2^ ; inline
-: GCPlaneMask         ( -- n ) 1 2^ ; inline
-: GCForeground        ( -- n ) 2 2^ ; inline
-: GCBackground        ( -- n ) 3 2^ ; inline
-: GCLineWidth         ( -- n ) 4 2^ ; inline
-: GCLineStyle         ( -- n ) 5 2^ ; inline
-: GCCapStyle          ( -- n ) 6 2^ ; inline
-: GCJoinStyle         ( -- n ) 7 2^ ; inline
-: GCFillStyle         ( -- n ) 8 2^ ; inline
-: GCFillRule          ( -- n ) 9 2^ ; inline
-: GCTile              ( -- n ) 10 2^ ; inline
-: GCStipple           ( -- n ) 11 2^ ; inline
-: GCTileStipXOrigin   ( -- n ) 12 2^ ; inline
-: GCTileStipYOrigin   ( -- n ) 13 2^ ; inline
-: GCFont              ( -- n ) 14 2^ ; inline
-: GCSubwindowMode     ( -- n ) 15 2^ ; inline
-: GCGraphicsExposures ( -- n ) 16 2^ ; inline
-: GCClipXOrigin       ( -- n ) 17 2^ ; inline
-: GCClipYOrigin       ( -- n ) 18 2^ ; inline
-: GCClipMask          ( -- n ) 19 2^ ; inline
-: GCDashOffset        ( -- n ) 20 2^ ; inline
-: GCDashList          ( -- n ) 21 2^ ; inline
-: GCArcMode           ( -- n ) 22 2^ ; inline
-
-CONSTANT: GXclear               0x0
-CONSTANT: GXand                 0x1
-CONSTANT: GXandReverse          0x2
-CONSTANT: GXcopy                0x3
-CONSTANT: GXandInverted         0x4
-CONSTANT: GXnoop                0x5
-CONSTANT: GXxor                 0x6
-CONSTANT: GXor                  0x7
-CONSTANT: GXnor                 0x8
-CONSTANT: GXequiv               0x9
-CONSTANT: GXinvert              0xa
-CONSTANT: GXorReverse           0xb
-CONSTANT: GXcopyInverted        0xc
-CONSTANT: GXorInverted          0xd
-CONSTANT: GXnand                0xe
-CONSTANT: GXset                 0xf
-
 STRUCT: XGCValues
     { function int }
     { plane_mask ulong }
@@ -539,69 +474,6 @@ X-FUNCTION: Status XKillClient ( Display* display, XID resource )
 
 ! 10.3 - Event Masks
 
-: NoEventMask              ( -- n ) 0 ; inline
-: KeyPressMask             ( -- n ) 0 2^ ; inline
-: KeyReleaseMask           ( -- n ) 1 2^ ; inline
-: ButtonPressMask          ( -- n ) 2 2^ ; inline
-: ButtonReleaseMask        ( -- n ) 3 2^ ; inline
-: EnterWindowMask          ( -- n ) 4 2^ ; inline
-: LeaveWindowMask          ( -- n ) 5 2^ ; inline
-: PointerMotionMask        ( -- n ) 6 2^ ; inline
-: PointerMotionHintMask    ( -- n ) 7 2^ ; inline
-: Button1MotionMask        ( -- n ) 8 2^ ; inline
-: Button2MotionMask        ( -- n ) 9 2^ ; inline
-: Button3MotionMask        ( -- n ) 10 2^ ; inline
-: Button4MotionMask        ( -- n ) 11 2^ ; inline
-: Button5MotionMask        ( -- n ) 12 2^ ; inline
-: ButtonMotionMask         ( -- n ) 13 2^ ; inline
-: KeymapStateMask          ( -- n ) 14 2^ ; inline
-: ExposureMask             ( -- n ) 15 2^ ; inline
-: VisibilityChangeMask     ( -- n ) 16 2^ ; inline
-: StructureNotifyMask      ( -- n ) 17 2^ ; inline
-: ResizeRedirectMask       ( -- n ) 18 2^ ; inline
-: SubstructureNotifyMask   ( -- n ) 19 2^ ; inline
-: SubstructureRedirectMask ( -- n ) 20 2^ ; inline
-: FocusChangeMask          ( -- n ) 21 2^ ; inline
-: PropertyChangeMask       ( -- n ) 22 2^ ; inline
-: ColormapChangeMask       ( -- n ) 23 2^ ; inline
-: OwnerGrabButtonMask      ( -- n ) 24 2^ ; inline
-
-CONSTANT: KeyPress              2
-CONSTANT: KeyRelease            3
-CONSTANT: ButtonPress           4
-CONSTANT: ButtonRelease         5
-CONSTANT: MotionNotify          6
-CONSTANT: EnterNotify           7
-CONSTANT: LeaveNotify           8
-CONSTANT: FocusIn               9
-CONSTANT: FocusOut              10
-CONSTANT: KeymapNotify          11
-CONSTANT: Expose                12
-CONSTANT: GraphicsExpose        13
-CONSTANT: NoExpose              14
-CONSTANT: VisibilityNotify      15
-CONSTANT: CreateNotify          16
-CONSTANT: DestroyNotify         17
-CONSTANT: UnmapNotify           18
-CONSTANT: MapNotify             19
-CONSTANT: MapRequest            20
-CONSTANT: ReparentNotify        21
-CONSTANT: ConfigureNotify       22
-CONSTANT: ConfigureRequest      23
-CONSTANT: GravityNotify         24
-CONSTANT: ResizeRequest         25
-CONSTANT: CirculateNotify       26
-CONSTANT: CirculateRequest      27
-CONSTANT: PropertyNotify        28
-CONSTANT: SelectionClear        29
-CONSTANT: SelectionRequest      30
-CONSTANT: SelectionNotify       31
-CONSTANT: ColormapNotify        32
-CONSTANT: ClientMessage         33
-CONSTANT: MappingNotify         34
-CONSTANT: GenericEvent          35
-CONSTANT: LASTEvent             36
-
 STRUCT: XAnyEvent
     { type int }
     { serial ulong }
@@ -613,27 +485,6 @@ STRUCT: XAnyEvent
 
 ! 10.5 Keyboard and Pointer Events
 
-CONSTANT: Button1 1
-CONSTANT: Button2 2
-CONSTANT: Button3 3
-CONSTANT: Button4 4
-CONSTANT: Button5 5
-
-: Button1Mask ( -- n ) 1 8  shift ; inline
-: Button2Mask ( -- n ) 1 9  shift ; inline
-: Button3Mask ( -- n ) 1 10 shift ; inline
-: Button4Mask ( -- n ) 1 11 shift ; inline
-: Button5Mask ( -- n ) 1 12 shift ; inline
-
-: ShiftMask   ( -- n ) 1 0 shift ; inline
-: LockMask    ( -- n ) 1 1 shift ; inline
-: ControlMask ( -- n ) 1 2 shift ; inline
-: Mod1Mask    ( -- n ) 1 3 shift ; inline
-: Mod2Mask    ( -- n ) 1 4 shift ; inline
-: Mod3Mask    ( -- n ) 1 5 shift ; inline
-: Mod4Mask    ( -- n ) 1 6 shift ; inline
-: Mod5Mask    ( -- n ) 1 7 shift ; inline
-
 STRUCT: XButtonEvent
     { type int }
     { serial ulong }
@@ -1121,7 +972,9 @@ X-FUNCTION: Status XSelectInput ( Display* display, Window w, long event_mask )
 X-FUNCTION: Status XFlush ( Display* display )
 X-FUNCTION: Status XSync ( Display* display, int discard )
 X-FUNCTION: Status XNextEvent ( Display* display, XEvent* event )
-X-FUNCTION: Status XMaskEvent ( Display* display, long event_mask, XEvent* event_return )
+X-FUNCTION: Status XMaskEvent ( Display* display,
+                                long event_mask,
+                                XEvent* event_return )
 
 ! 11.3 - Event Queue Management
 
@@ -1134,7 +987,11 @@ X-FUNCTION: int XPending ( Display* display )
 
 ! 11.6 - Sending Events to Other Applications
 
-X-FUNCTION: Status XSendEvent ( Display* display, Window w, Bool propagate, long event_mask, XEvent* event_send )
+X-FUNCTION: Status XSendEvent ( Display* display,
+                                Window w,
+                                Bool propagate,
+                                long event_mask,
+                                XEvent* event_send )
 
 ! 11.8 - Handling Protocol Errors
 
@@ -1143,9 +1000,6 @@ X-FUNCTION: int XSetErrorHandler ( void* handler )
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! 12 - Input Device Functions
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-CONSTANT: None 0
-
 X-FUNCTION: int XGrabPointer (
     Display* display,
     Window grab_window,
@@ -1411,7 +1265,9 @@ CONSTANT: XA_LAST_PREDEFINED 68
 
 X-FUNCTION: void XFree ( void* data )
 X-FUNCTION: int XStoreName ( Display* display, Window w, c-string window_name )
-X-FUNCTION: void XSetWMNormalHints ( Display* display, Window w, XSizeHints* hints )
+X-FUNCTION: void XSetWMNormalHints ( Display* display,
+                                     Window w,
+                                     XSizeHints* hints )
 X-FUNCTION: int XBell ( Display* display, int percent )
 
 ! !!! INPUT METHODS
@@ -1478,19 +1334,20 @@ CONSTANT: XLookupBoth      4
 
 X-FUNCTION: Bool XFilterEvent ( XEvent* event, Window w )
 
-X-FUNCTION: XIM XOpenIM ( Display* dpy, void* rdb, c-string res_name, c-string res_class )
+X-FUNCTION: XIM XOpenIM ( Display* dpy,
+                          void* rdb,
+                          c-string res_name,
+                          c-string res_class )
 
 X-FUNCTION: Status XCloseIM ( XIM im )
 
-X-FUNCTION: XIC XCreateIC (
-    XIM im,
-    c-string key1, Window value1,
-    c-string key2, Window value2,
-    c-string key3, int value3,
-    c-string key4, c-string value4,
-    c-string key5, c-string value5,
-    int key6
-)
+X-FUNCTION: XIC XCreateIC ( XIM im,
+                            c-string key1, Window value1,
+                            c-string key2, Window value2,
+                            c-string key3, int value3,
+                            c-string key4, c-string value4,
+                            c-string key5, c-string value5,
+                            int key6 )
 
 X-FUNCTION: void XDestroyIC ( XIC ic )
 
@@ -1498,9 +1355,19 @@ X-FUNCTION: void XSetICFocus ( XIC ic )
 
 X-FUNCTION: void XUnsetICFocus ( XIC ic )
 
-X-FUNCTION: int XwcLookupString ( XIC ic, XKeyPressedEvent* event, ulong* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return )
-
-X-FUNCTION: int Xutf8LookupString ( XIC ic, XKeyPressedEvent* event, c-string buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return )
+X-FUNCTION: int XwcLookupString ( XIC ic,
+                                  XKeyPressedEvent* event,
+                                  ulong* buffer_return,
+                                  int bytes_buffer,
+                                  KeySym* keysym_return,
+                                  Status* status_return )
+
+X-FUNCTION: int Xutf8LookupString ( XIC ic,
+                                    XKeyPressedEvent* event,
+                                    c-string buffer_return,
+                                    int bytes_buffer,
+                                    KeySym* keysym_return,
+                                    Status* status_return )
 
 ! !!! category of setlocale
 CONSTANT: LC_ALL      0