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