]> gitweb.factorcode.org Git - factor.git/blob - extra/x11/constants/constants.factor
Fixing everything for mandatory stack effects
[factor.git] / extra / x11 / constants / constants.factor
1 ! Copyright (C) 2005, 2006 Eduardo Cavazos and Alex Chapman
2 ! See http://factorcode.org/license.txt for BSD license.
3
4 ! Based on X.h
5
6 USING: alien alien.syntax math x11.xlib ;
7 IN: x11.constants
8
9 TYPEDEF: ulong Mask
10
11 TYPEDEF: uchar KeyCode
12
13 ! Reserved Resource and Constant Definitions
14
15 : ParentRelative 1 ;
16 : CopyFromParent 0 ;
17 : PointerWindow 0 ;
18 : InputFocus 1 ;
19 : PointerRoot 1 ;
20 : AnyPropertyType 0 ;
21 : AnyKey 0 ;
22 : AnyButton 0 ;
23 : AllTemporary 0 ;
24 : CurrentTime 0 ;
25 : NoSymbol 0 ;
26
27 ! Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
28 !   state in various key-, mouse-, and button-related events.
29
30
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 : ShiftMapIndex         0 ;
35 : LockMapIndex          1 ;
36 : ControlMapIndex       2 ;
37 : Mod1MapIndex          3 ;
38 : Mod2MapIndex          4 ;
39 : Mod3MapIndex          5 ;
40 : Mod4MapIndex          6 ;
41 : Mod5MapIndex          7 ;
42
43
44 ! button masks.  Used in same manner as Key masks above. Not to be confused
45 ! with button names below.
46
47
48 : AnyModifier          ( -- n ) 15 2^ ; ! used in GrabButton, GrabKey
49
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".
53
54 ! Notify modes
55
56 : NotifyNormal          0 ;
57 : NotifyGrab            1 ;
58 : NotifyUngrab          2 ;
59 : NotifyWhileGrabbed    3 ;
60
61 : NotifyHint            1 ; ! for MotionNotify events
62                        
63 ! Notify detail
64
65 : NotifyAncestor         0 ;
66 : NotifyVirtual          1 ;
67 : NotifyInferior         2 ;
68 : NotifyNonlinear        3 ;
69 : NotifyNonlinearVirtual 4 ;
70 : NotifyPointer          5 ;
71 : NotifyPointerRoot      6 ;
72 : NotifyDetailNone       7 ;
73
74 ! Visibility notify
75
76 : VisibilityUnobscured          0 ;
77 : VisibilityPartiallyObscured   1 ;
78 : VisibilityFullyObscured       2 ;
79
80 ! Circulation request
81
82 : PlaceOnTop            0 ;
83 : PlaceOnBottom         1 ;
84
85 ! protocol families
86
87 : FamilyInternet        0 ;     ! IPv4
88 : FamilyDECnet          1 ;
89 : FamilyChaos           2 ;
90 : FamilyInternet6       6 ;     ! IPv6
91
92 ! authentication families not tied to a specific protocol
93 : FamilyServerInterpreted 5 ;
94
95 ! Property notification
96
97 : PropertyNewValue      0 ;
98 : PropertyDelete        1 ;
99
100 ! Color Map notification
101
102 : ColormapUninstalled   0 ;
103 : ColormapInstalled     1 ;
104
105 ! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
106
107 : GrabModeSync          0 ;
108 : GrabModeAsync         1 ;
109
110 ! GrabPointer, GrabKeyboard reply status
111
112 : GrabSuccess           0 ;
113 : AlreadyGrabbed        1 ;
114 : GrabInvalidTime       2 ;
115 : GrabNotViewable       3 ;
116 : GrabFrozen            4 ;
117
118 ! AllowEvents modes
119
120 : AsyncPointer          0 ;
121 : SyncPointer           1 ;
122 : ReplayPointer         2 ;
123 : AsyncKeyboard         3 ;
124 : SyncKeyboard          4 ;
125 : ReplayKeyboard        5 ;
126 : AsyncBoth             6 ;
127 : SyncBoth              7 ;
128
129 ! Used in SetInputFocus, GetInputFocus
130
131 : RevertToNone         ( -- n ) None ;
132 : RevertToPointerRoot  ( -- n ) PointerRoot ;
133 : RevertToParent        2 ;
134
135 ! *****************************************************************
136 ! * ERROR CODES 
137 ! *****************************************************************
138
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 
152                        !           cmap entry 
153                        !        - attempt to store into a read-only 
154                        !           color map entry.
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
164
165 : FirstExtensionError   128 ;
166 : LastExtensionError    255 ;
167
168 ! *****************************************************************
169 ! * WINDOW DEFINITIONS 
170 ! *****************************************************************
171
172 ! Window classes used by CreateWindow
173 ! Note that CopyFromParent is already defined as 0 above
174
175 : InputOutput           1 ;
176 : InputOnly             2 ;
177
178 ! Used in CreateWindow for backing-store hint
179
180 : NotUseful               0 ;
181 : WhenMapped              1 ;
182 : Always                  2 ;
183
184 ! Used in ChangeSaveSet
185
186 : SetModeInsert           0 ;
187 : SetModeDelete           1 ;
188
189 ! Used in ChangeCloseDownMode
190
191 : DestroyAll              0 ;
192 : RetainPermanent         1 ;
193 : RetainTemporary         2 ;
194
195 ! Window stacking method (in configureWindow)
196
197 : Above                   0 ;
198 : Below                   1 ;
199 : TopIf                   2 ;
200 : BottomIf                3 ;
201 : Opposite                4 ;
202
203 ! Circulation direction
204
205 : RaiseLowest             0 ;
206 : LowerHighest            1 ;
207
208 ! Property modes
209
210 : PropModeReplace         0 ;
211 : PropModePrepend         1 ;
212 : PropModeAppend          2 ;
213
214 ! *****************************************************************
215 ! * GRAPHICS DEFINITIONS
216 ! *****************************************************************
217
218 ! LineStyle
219
220 : LineSolid             0 ;
221 : LineOnOffDash         1 ;
222 : LineDoubleDash        2 ;
223
224 ! capStyle
225
226 : CapNotLast            0 ;
227 : CapButt               1 ;
228 : CapRound              2 ;
229 : CapProjecting         3 ;
230
231 ! joinStyle
232
233 : JoinMiter             0 ;
234 : JoinRound             1 ;
235 : JoinBevel             2 ;
236
237 ! fillStyle
238
239 : FillSolid             0 ;
240 : FillTiled             1 ;
241 : FillStippled          2 ;
242 : FillOpaqueStippled    3 ;
243
244 ! fillRule
245
246 : EvenOddRule           0 ;
247 : WindingRule           1 ;
248
249 ! subwindow mode
250
251 : ClipByChildren        0 ;
252 : IncludeInferiors      1 ;
253
254 ! SetClipRectangles ordering
255
256 : Unsorted              0 ;
257 : YSorted               1 ;
258 : YXSorted              2 ;
259 : YXBanded              3 ;
260
261 ! CoordinateMode for drawing routines
262
263 : CoordModeOrigin   0 ; ! relative to the origin
264 : CoordModePrevious 1 ; ! relative to previous point
265
266 ! Polygon shapes
267
268 : Complex       0 ; ! paths may intersect
269 : Nonconvex     1 ; ! no paths intersect, but not convex
270 : Convex        2 ; ! wholly convex
271
272 ! Arc modes for PolyFillArc
273
274 : ArcChord    0 ; ! join endpoints of arc
275 : ArcPieSlice 1 ; ! join endpoints to center of arc
276
277 ! *****************************************************************
278 ! * FONTS 
279 ! *****************************************************************
280
281 ! used in QueryFont -- draw direction
282
283 : FontLeftToRight               0 ;
284 : FontRightToLeft               1 ;
285
286 : FontChange            255 ;
287
288 ! *****************************************************************
289 ! *  IMAGING 
290 ! *****************************************************************
291
292 ! ImageFormat -- PutImage, GetImage
293
294 : XYBitmap              0 ; ! depth 1, XYFormat
295 : XYPixmap              1 ; ! depth == drawable depth
296 : ZPixmap               2 ; ! depth == drawable depth
297
298 ! *****************************************************************
299 ! *  COLOR MAP STUFF 
300 ! *****************************************************************
301
302 ! For CreateColormap
303
304 : AllocNone             0 ; ! create map with no entries
305 : AllocAll              1 ; ! allocate entire map writeable
306
307
308 ! Flags used in StoreNamedColor, StoreColors
309
310 : DoRed        ( -- n ) 0 2^ ;
311 : DoGreen      ( -- n ) 1 2^ ;
312 : DoBlue       ( -- n ) 2 2^ ;
313
314 ! *****************************************************************
315 ! * CURSOR STUFF
316 ! *****************************************************************
317
318 ! QueryBestSize Class
319
320 : CursorShape           0 ; ! largest size that can be displayed
321 : TileShape             1 ; ! size tiled fastest
322 : StippleShape          2 ; ! size stippled fastest
323
324 ! ***************************************************************** 
325 ! * KEYBOARD/POINTER STUFF
326 ! *****************************************************************
327
328 : AutoRepeatModeOff     0 ;
329 : AutoRepeatModeOn      1 ;
330 : AutoRepeatModeDefault 2 ;
331
332 : LedModeOff            0 ;
333 : LedModeOn             1 ;
334
335 ! masks for ChangeKeyboardControl
336
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^ ;
345
346 : MappingSuccess        0 ;
347 : MappingBusy           1 ;
348 : MappingFailed         2 ;
349
350 : MappingModifier               0 ;
351 : MappingKeyboard               1 ;
352 : MappingPointer                2 ;
353
354 ! *****************************************************************
355 ! * SCREEN SAVER STUFF 
356 ! *****************************************************************
357
358 : DontPreferBlanking    0 ;
359 : PreferBlanking        1 ;
360 : DefaultBlanking       2 ;
361
362 : DisableScreenSaver    0 ;
363 : DisableScreenInterval 0 ;
364
365 : DontAllowExposures    0 ;
366 : AllowExposures        1 ;
367 : DefaultExposures      2 ;
368
369 ! for ForceScreenSaver
370
371 : ScreenSaverReset 0 ;
372 : ScreenSaverActive 1 ;
373
374 ! *****************************************************************
375 ! * HOSTS AND CONNECTIONS
376 ! *****************************************************************
377
378 ! for ChangeHosts
379
380 : HostInsert            0 ;
381 : HostDelete            1 ;
382
383 ! for ChangeAccessControl
384
385 : EnableAccess          1 ;
386 : DisableAccess         0 ;
387
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
391
392 : StaticGray            0 ;
393 : GrayScale             1 ;
394 : StaticColor           2 ;
395 : PseudoColor           3 ;
396 : TrueColor             4 ;
397 : DirectColor           5 ;
398
399
400 ! Byte order  used in imageByteOrder and bitmapBitOrder
401
402 : LSBFirst              0 ;
403 : MSBFirst              1 ;
404
405 ! *****************************************************************
406 ! * EXTENDED WINDOW MANAGER HINTS
407 ! *****************************************************************
408
409 C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ;