1 ! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
6 USING: alien alien.syntax math x11.xlib ;
11 TYPEDEF: uchar KeyCode
13 ! Reserved Resource and Constant Definitions
27 ! Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
28 ! state in various key-, mouse-, and button-related events.
31 ! modifier names. Used to build a SetModifierMapping request or
32 ! to read a GetModifierMapping request. These correspond to the
33 ! masks defined above.
44 ! button masks. Used in same manner as Key masks above. Not to be confused
45 ! with button names below.
48 : AnyModifier ( -- n ) 15 2^ ; ! used in GrabButton, GrabKey
50 ! button names. Used as arguments to GrabButton and as detail in ButtonPress
51 ! and ButtonRelease events. Not to be confused with button masks above.
52 ! Note that 0 is already defined above as "AnyButton".
59 : NotifyWhileGrabbed 3 ;
61 : NotifyHint 1 ; ! for MotionNotify events
69 : NotifyNonlinearVirtual 4 ;
71 : NotifyPointerRoot 6 ;
72 : NotifyDetailNone 7 ;
76 : VisibilityUnobscured 0 ;
77 : VisibilityPartiallyObscured 1 ;
78 : VisibilityFullyObscured 2 ;
87 : FamilyInternet 0 ; ! IPv4
90 : FamilyInternet6 6 ; ! IPv6
92 ! authentication families not tied to a specific protocol
93 : FamilyServerInterpreted 5 ;
95 ! Property notification
97 : PropertyNewValue 0 ;
100 ! Color Map notification
102 : ColormapUninstalled 0 ;
103 : ColormapInstalled 1 ;
105 ! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
110 ! GrabPointer, GrabKeyboard reply status
114 : GrabInvalidTime 2 ;
115 : GrabNotViewable 3 ;
129 ! Used in SetInputFocus, GetInputFocus
131 : RevertToNone ( -- n ) None ;
132 : RevertToPointerRoot ( -- n ) PointerRoot ;
135 ! *****************************************************************
137 ! *****************************************************************
139 : Success 0 ; ! everything's okay
140 : BadRequest 1 ; ! bad request code
141 : BadValue 2 ; ! int parameter out of range
142 : BadWindow 3 ; ! parameter not a Window
143 : BadPixmap 4 ; ! parameter not a Pixmap
144 : BadAtom 5 ; ! parameter not an Atom
145 : BadCursor 6 ; ! parameter not a Cursor
146 : BadFont 7 ; ! parameter not a Font
147 : BadMatch 8 ; ! parameter mismatch
148 : BadDrawable 9 ; ! parameter not a Pixmap or Window
149 : BadAccess 10 ; ! depending on context:
150 ! - key/button already grabbed
151 ! - attempt to free an illegal
153 ! - attempt to store into a read-only
155 ! - attempt to modify the access control
156 ! list from other than the local host.
157 : BadAlloc 11 ; ! insufficient resources
158 : BadColor 12 ; ! no such colormap
159 : BadGC 13 ; ! parameter not a GC
160 : BadIDChoice 14 ; ! choice not in range or already used
161 : BadName 15 ; ! font or color name doesn't exist
162 : BadLength 16 ; ! Request length incorrect
163 : BadImplementation 17 ; ! server is defective
165 : FirstExtensionError 128 ;
166 : LastExtensionError 255 ;
168 ! *****************************************************************
169 ! * WINDOW DEFINITIONS
170 ! *****************************************************************
172 ! Window classes used by CreateWindow
173 ! Note that CopyFromParent is already defined as 0 above
178 ! Used in CreateWindow for backing-store hint
184 ! Used in ChangeSaveSet
189 ! Used in ChangeCloseDownMode
192 : RetainPermanent 1 ;
193 : RetainTemporary 2 ;
195 ! Window stacking method (in configureWindow)
203 ! Circulation direction
210 : PropModeReplace 0 ;
211 : PropModePrepend 1 ;
214 ! *****************************************************************
215 ! * GRAPHICS DEFINITIONS
216 ! *****************************************************************
242 : FillOpaqueStippled 3 ;
252 : IncludeInferiors 1 ;
254 ! SetClipRectangles ordering
261 ! CoordinateMode for drawing routines
263 : CoordModeOrigin 0 ; ! relative to the origin
264 : CoordModePrevious 1 ; ! relative to previous point
268 : Complex 0 ; ! paths may intersect
269 : Nonconvex 1 ; ! no paths intersect, but not convex
270 : Convex 2 ; ! wholly convex
272 ! Arc modes for PolyFillArc
274 : ArcChord 0 ; ! join endpoints of arc
275 : ArcPieSlice 1 ; ! join endpoints to center of arc
277 ! *****************************************************************
279 ! *****************************************************************
281 ! used in QueryFont -- draw direction
283 : FontLeftToRight 0 ;
284 : FontRightToLeft 1 ;
288 ! *****************************************************************
290 ! *****************************************************************
292 ! ImageFormat -- PutImage, GetImage
294 : XYBitmap 0 ; ! depth 1, XYFormat
295 : XYPixmap 1 ; ! depth == drawable depth
296 : ZPixmap 2 ; ! depth == drawable depth
298 ! *****************************************************************
300 ! *****************************************************************
304 : AllocNone 0 ; ! create map with no entries
305 : AllocAll 1 ; ! allocate entire map writeable
308 ! Flags used in StoreNamedColor, StoreColors
310 : DoRed ( -- n ) 0 2^ ;
311 : DoGreen ( -- n ) 1 2^ ;
312 : DoBlue ( -- n ) 2 2^ ;
314 ! *****************************************************************
316 ! *****************************************************************
318 ! QueryBestSize Class
320 : CursorShape 0 ; ! largest size that can be displayed
321 : TileShape 1 ; ! size tiled fastest
322 : StippleShape 2 ; ! size stippled fastest
324 ! *****************************************************************
325 ! * KEYBOARD/POINTER STUFF
326 ! *****************************************************************
328 : AutoRepeatModeOff 0 ;
329 : AutoRepeatModeOn 1 ;
330 : AutoRepeatModeDefault 2 ;
335 ! masks for ChangeKeyboardControl
337 : KBKeyClickPercent ( -- n ) 0 2^ ;
338 : KBBellPercent ( -- n ) 1 2^ ;
339 : KBBellPitch ( -- n ) 2 2^ ;
340 : KBBellDuration ( -- n ) 3 2^ ;
341 : KBLed ( -- n ) 4 2^ ;
342 : KBLedMode ( -- n ) 5 2^ ;
343 : KBKey ( -- n ) 6 2^ ;
344 : KBAutoRepeatMode ( -- n ) 7 2^ ;
350 : MappingModifier 0 ;
351 : MappingKeyboard 1 ;
354 ! *****************************************************************
355 ! * SCREEN SAVER STUFF
356 ! *****************************************************************
358 : DontPreferBlanking 0 ;
360 : DefaultBlanking 2 ;
362 : DisableScreenSaver 0 ;
363 : DisableScreenInterval 0 ;
365 : DontAllowExposures 0 ;
367 : DefaultExposures 2 ;
369 ! for ForceScreenSaver
371 : ScreenSaverReset 0 ;
372 : ScreenSaverActive 1 ;
374 ! *****************************************************************
375 ! * HOSTS AND CONNECTIONS
376 ! *****************************************************************
383 ! for ChangeAccessControl
388 ! Display classes used in opening the connection
389 ! Note that the statically allocated ones are even numbered and the
390 ! dynamically changeable ones are odd numbered
400 ! Byte order used in imageByteOrder and bitmapBitOrder
405 ! *****************************************************************
406 ! * EXTENDED WINDOW MANAGER HINTS
407 ! *****************************************************************
409 C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ;