1 ! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
6 USING: alien alien.c-types alien.syntax math x11.xlib ;
11 TYPEDEF: uchar KeyCode
13 ! Reserved Resource and Constant Definitions
15 CONSTANT: ParentRelative 1
16 CONSTANT: CopyFromParent 0
17 CONSTANT: PointerWindow 0
18 CONSTANT: InputFocus 1
19 CONSTANT: PointerRoot 1
20 CONSTANT: AnyPropertyType 0
23 CONSTANT: AllTemporary 0
24 CONSTANT: CurrentTime 0
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.
34 CONSTANT: ShiftMapIndex 0
35 CONSTANT: LockMapIndex 1
36 CONSTANT: ControlMapIndex 2
37 CONSTANT: Mod1MapIndex 3
38 CONSTANT: Mod2MapIndex 4
39 CONSTANT: Mod3MapIndex 5
40 CONSTANT: Mod4MapIndex 6
41 CONSTANT: Mod5MapIndex 7
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".
56 CONSTANT: NotifyNormal 0
57 CONSTANT: NotifyGrab 1
58 CONSTANT: NotifyUngrab 2
59 CONSTANT: NotifyWhileGrabbed 3
61 CONSTANT: NotifyHint 1 ! for MotionNotify events
65 CONSTANT: NotifyAncestor 0
66 CONSTANT: NotifyVirtual 1
67 CONSTANT: NotifyInferior 2
68 CONSTANT: NotifyNonlinear 3
69 CONSTANT: NotifyNonlinearVirtual 4
70 CONSTANT: NotifyPointer 5
71 CONSTANT: NotifyPointerRoot 6
72 CONSTANT: NotifyDetailNone 7
76 CONSTANT: VisibilityUnobscured 0
77 CONSTANT: VisibilityPartiallyObscured 1
78 CONSTANT: VisibilityFullyObscured 2
82 CONSTANT: PlaceOnTop 0
83 CONSTANT: PlaceOnBottom 1
87 CONSTANT: FamilyInternet 0 ! IPv4
88 CONSTANT: FamilyDECnet 1
89 CONSTANT: FamilyChaos 2
90 CONSTANT: FamilyInternet6 6 ! IPv6
92 ! authentication families not tied to a specific protocol
93 CONSTANT: FamilyServerInterpreted 5
95 ! Property notification
97 CONSTANT: PropertyNewValue 0
98 CONSTANT: PropertyDelete 1
100 ! Color Map notification
102 CONSTANT: ColormapUninstalled 0
103 CONSTANT: ColormapInstalled 1
105 ! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
107 CONSTANT: GrabModeSync 0
108 CONSTANT: GrabModeAsync 1
110 ! GrabPointer, GrabKeyboard reply status
112 CONSTANT: GrabSuccess 0
113 CONSTANT: AlreadyGrabbed 1
114 CONSTANT: GrabInvalidTime 2
115 CONSTANT: GrabNotViewable 3
116 CONSTANT: GrabFrozen 4
120 CONSTANT: AsyncPointer 0
121 CONSTANT: SyncPointer 1
122 CONSTANT: ReplayPointer 2
123 CONSTANT: AsyncKeyboard 3
124 CONSTANT: SyncKeyboard 4
125 CONSTANT: ReplayKeyboard 5
126 CONSTANT: AsyncBoth 6
129 ! Used in SetInputFocus, GetInputFocus
131 : RevertToNone ( -- n ) None ;
132 : RevertToPointerRoot ( -- n ) PointerRoot ;
133 CONSTANT: RevertToParent 2
135 ! *****************************************************************
137 ! *****************************************************************
139 CONSTANT: Success 0 ! everything's okay
140 CONSTANT: BadRequest 1 ! bad request code
141 CONSTANT: BadValue 2 ! int parameter out of range
142 CONSTANT: BadWindow 3 ! parameter not a Window
143 CONSTANT: BadPixmap 4 ! parameter not a Pixmap
144 CONSTANT: BadAtom 5 ! parameter not an Atom
145 CONSTANT: BadCursor 6 ! parameter not a Cursor
146 CONSTANT: BadFont 7 ! parameter not a Font
147 CONSTANT: BadMatch 8 ! parameter mismatch
148 CONSTANT: BadDrawable 9 ! parameter not a Pixmap or Window
149 CONSTANT: 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 CONSTANT: BadAlloc 11 ! insufficient resources
158 CONSTANT: BadColor 12 ! no such colormap
159 CONSTANT: BadGC 13 ! parameter not a GC
160 CONSTANT: BadIDChoice 14 ! choice not in range or already used
161 CONSTANT: BadName 15 ! font or color name doesn't exist
162 CONSTANT: BadLength 16 ! Request length incorrect
163 CONSTANT: BadImplementation 17 ! server is defective
165 CONSTANT: FirstExtensionError 128
166 CONSTANT: LastExtensionError 255
168 ! *****************************************************************
169 ! * WINDOW DEFINITIONS
170 ! *****************************************************************
172 ! Window classes used by CreateWindow
173 ! Note that CopyFromParent is already defined as 0 above
175 CONSTANT: InputOutput 1
176 CONSTANT: InputOnly 2
178 ! Used in CreateWindow for backing-store hint
180 CONSTANT: NotUseful 0
181 CONSTANT: WhenMapped 1
184 ! Used in ChangeSaveSet
186 CONSTANT: SetModeInsert 0
187 CONSTANT: SetModeDelete 1
189 ! Used in ChangeCloseDownMode
191 CONSTANT: DestroyAll 0
192 CONSTANT: RetainPermanent 1
193 CONSTANT: RetainTemporary 2
195 ! Window stacking method (in configureWindow)
203 ! Circulation direction
205 CONSTANT: RaiseLowest 0
206 CONSTANT: LowerHighest 1
210 CONSTANT: PropModeReplace 0
211 CONSTANT: PropModePrepend 1
212 CONSTANT: PropModeAppend 2
214 ! *****************************************************************
215 ! * GRAPHICS DEFINITIONS
216 ! *****************************************************************
220 CONSTANT: LineSolid 0
221 CONSTANT: LineOnOffDash 1
222 CONSTANT: LineDoubleDash 2
226 CONSTANT: CapNotLast 0
229 CONSTANT: CapProjecting 3
233 CONSTANT: JoinMiter 0
234 CONSTANT: JoinRound 1
235 CONSTANT: JoinBevel 2
239 CONSTANT: FillSolid 0
240 CONSTANT: FillTiled 1
241 CONSTANT: FillStippled 2
242 CONSTANT: FillOpaqueStippled 3
246 CONSTANT: EvenOddRule 0
247 CONSTANT: WindingRule 1
251 CONSTANT: ClipByChildren 0
252 CONSTANT: IncludeInferiors 1
254 ! SetClipRectangles ordering
261 ! CoordinateMode for drawing routines
263 CONSTANT: CoordModeOrigin 0 ! relative to the origin
264 CONSTANT: CoordModePrevious 1 ! relative to previous point
268 CONSTANT: Complex 0 ! paths may intersect
269 CONSTANT: Nonconvex 1 ! no paths intersect, but not convex
270 CONSTANT: Convex 2 ! wholly convex
272 ! Arc modes for PolyFillArc
274 CONSTANT: ArcChord 0 ! join endpoints of arc
275 CONSTANT: ArcPieSlice 1 ! join endpoints to center of arc
277 ! *****************************************************************
279 ! *****************************************************************
281 ! used in QueryFont -- draw direction
283 CONSTANT: FontLeftToRight 0
284 CONSTANT: FontRightToLeft 1
286 CONSTANT: FontChange 255
288 ! *****************************************************************
290 ! *****************************************************************
292 ! ImageFormat -- PutImage, GetImage
294 CONSTANT: XYBitmap 0 ! depth 1, XYFormat
295 CONSTANT: XYPixmap 1 ! depth == drawable depth
296 CONSTANT: ZPixmap 2 ! depth == drawable depth
298 ! *****************************************************************
300 ! *****************************************************************
304 CONSTANT: AllocNone 0 ! create map with no entries
305 CONSTANT: 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 CONSTANT: CursorShape 0 ! largest size that can be displayed
321 CONSTANT: TileShape 1 ! size tiled fastest
322 CONSTANT: StippleShape 2 ! size stippled fastest
324 ! *****************************************************************
325 ! * KEYBOARD/POINTER STUFF
326 ! *****************************************************************
328 CONSTANT: AutoRepeatModeOff 0
329 CONSTANT: AutoRepeatModeOn 1
330 CONSTANT: AutoRepeatModeDefault 2
332 CONSTANT: LedModeOff 0
333 CONSTANT: LedModeOn 1
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^ ;
346 CONSTANT: MappingSuccess 0
347 CONSTANT: MappingBusy 1
348 CONSTANT: MappingFailed 2
350 CONSTANT: MappingModifier 0
351 CONSTANT: MappingKeyboard 1
352 CONSTANT: MappingPointer 2
354 ! *****************************************************************
355 ! * SCREEN SAVER STUFF
356 ! *****************************************************************
358 CONSTANT: DontPreferBlanking 0
359 CONSTANT: PreferBlanking 1
360 CONSTANT: DefaultBlanking 2
362 CONSTANT: DisableScreenSaver 0
363 CONSTANT: DisableScreenInterval 0
365 CONSTANT: DontAllowExposures 0
366 CONSTANT: AllowExposures 1
367 CONSTANT: DefaultExposures 2
369 ! for ForceScreenSaver
371 CONSTANT: ScreenSaverReset 0
372 CONSTANT: ScreenSaverActive 1
374 ! *****************************************************************
375 ! * HOSTS AND CONNECTIONS
376 ! *****************************************************************
380 CONSTANT: HostInsert 0
381 CONSTANT: HostDelete 1
383 ! for ChangeAccessControl
385 CONSTANT: EnableAccess 1
386 CONSTANT: DisableAccess 0
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
392 CONSTANT: StaticGray 0
393 CONSTANT: GrayScale 1
394 CONSTANT: StaticColor 2
395 CONSTANT: PseudoColor 3
396 CONSTANT: TrueColor 4
397 CONSTANT: DirectColor 5
400 ! Byte order used in imageByteOrder and bitmapBitOrder
405 ! *****************************************************************
406 ! * EXTENDED WINDOW MANAGER HINTS
407 ! *****************************************************************
409 CONSTANT: _NET_WM_STATE_REMOVE 0
410 CONSTANT: _NET_WM_STATE_ADD 1
411 CONSTANT: _NET_WM_STATE_TOGGLE 2