1 |
/* $Header$ */ |
2 |
|
3 |
/* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */ |
4 |
/* |
5 |
* Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology |
6 |
* |
7 |
* Permission to use, copy, modify, and distribute this software and its |
8 |
* documentation for any purpose and without fee is hereby granted, provided |
9 |
* that the above copyright notice appear in all copies and that both that |
10 |
* copyright notice and this permission notice appear in supporting |
11 |
* documentation, and that the name of M.I.T. not be used in advertising |
12 |
* or publicity pertaining to distribution of the software without specific, |
13 |
* written prior permission. M.I.T. makes no representations about the |
14 |
* suitability of this software for any purpose. It is provided "as is" |
15 |
* without express or implied warranty. |
16 |
* |
17 |
* X Window System is a Trademark of MIT. |
18 |
* |
19 |
*/ |
20 |
|
21 |
|
22 |
/* |
23 |
* Xlib.h - Header definition and support file for the C subroutine |
24 |
* interface library (Xlib) to the X Window System Protocol (V11). |
25 |
* Structures and symbols starting with "_" are private to the library. |
26 |
*/ |
27 |
#ifndef _XLIB_H_ |
28 |
#define _XLIB_H_ |
29 |
|
30 |
#define XlibSpecificationRelease 5 |
31 |
|
32 |
#ifdef MAC_TCL |
33 |
# include <X.h> |
34 |
# define Cursor XCursor |
35 |
# define Region XRegion |
36 |
#else |
37 |
# include "X.h" |
38 |
#endif |
39 |
|
40 |
/* applications should not depend on these two headers being included! */ |
41 |
#ifdef MAC_TCL |
42 |
#include <Xfuncproto.h> |
43 |
#else |
44 |
#include "Xfuncproto.h" |
45 |
#endif |
46 |
|
47 |
#ifndef X_WCHAR |
48 |
#ifdef X_NOT_STDC_ENV |
49 |
#define X_WCHAR |
50 |
#endif |
51 |
#endif |
52 |
|
53 |
#ifndef X_WCHAR |
54 |
#include <stddef.h> |
55 |
#else |
56 |
/* replace this with #include or typedef appropriate for your system */ |
57 |
typedef unsigned long wchar_t; |
58 |
#endif |
59 |
|
60 |
typedef char *XPointer; |
61 |
|
62 |
#define Bool int |
63 |
#ifdef MAC_TCL |
64 |
#define Status int |
65 |
#else |
66 |
typedef int Status; |
67 |
#endif |
68 |
#define True 1 |
69 |
#define False 0 |
70 |
|
71 |
#define QueuedAlready 0 |
72 |
#define QueuedAfterReading 1 |
73 |
#define QueuedAfterFlush 2 |
74 |
|
75 |
#define ConnectionNumber(dpy) ((dpy)->fd) |
76 |
#define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root) |
77 |
#define DefaultScreen(dpy) ((dpy)->default_screen) |
78 |
#define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root) |
79 |
#define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual) |
80 |
#define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc) |
81 |
#define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel) |
82 |
#define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel) |
83 |
#define AllPlanes ((unsigned long)~0L) |
84 |
#define QLength(dpy) ((dpy)->qlen) |
85 |
#define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width) |
86 |
#define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height) |
87 |
#define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth) |
88 |
#define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight) |
89 |
#define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth) |
90 |
#define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries) |
91 |
#define ScreenCount(dpy) ((dpy)->nscreens) |
92 |
#define ServerVendor(dpy) ((dpy)->vendor) |
93 |
#define ProtocolVersion(dpy) ((dpy)->proto_major_version) |
94 |
#define ProtocolRevision(dpy) ((dpy)->proto_minor_version) |
95 |
#define VendorRelease(dpy) ((dpy)->release) |
96 |
#define DisplayString(dpy) ((dpy)->display_name) |
97 |
#define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth) |
98 |
#define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap) |
99 |
#define BitmapUnit(dpy) ((dpy)->bitmap_unit) |
100 |
#define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order) |
101 |
#define BitmapPad(dpy) ((dpy)->bitmap_pad) |
102 |
#define ImageByteOrder(dpy) ((dpy)->byte_order) |
103 |
#define NextRequest(dpy) ((dpy)->request + 1) |
104 |
#define LastKnownRequestProcessed(dpy) ((dpy)->request) |
105 |
|
106 |
/* macros for screen oriented applications (toolkit) */ |
107 |
#define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)])) |
108 |
#define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen])) |
109 |
#define DisplayOfScreen(s) ((s)->display) |
110 |
#define RootWindowOfScreen(s) ((s)->root) |
111 |
#define BlackPixelOfScreen(s) ((s)->black_pixel) |
112 |
#define WhitePixelOfScreen(s) ((s)->white_pixel) |
113 |
#define DefaultColormapOfScreen(s)((s)->cmap) |
114 |
#define DefaultDepthOfScreen(s) ((s)->root_depth) |
115 |
#define DefaultGCOfScreen(s) ((s)->default_gc) |
116 |
#define DefaultVisualOfScreen(s)((s)->root_visual) |
117 |
#define WidthOfScreen(s) ((s)->width) |
118 |
#define HeightOfScreen(s) ((s)->height) |
119 |
#define WidthMMOfScreen(s) ((s)->mwidth) |
120 |
#define HeightMMOfScreen(s) ((s)->mheight) |
121 |
#define PlanesOfScreen(s) ((s)->root_depth) |
122 |
#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) |
123 |
#define MinCmapsOfScreen(s) ((s)->min_maps) |
124 |
#define MaxCmapsOfScreen(s) ((s)->max_maps) |
125 |
#define DoesSaveUnders(s) ((s)->save_unders) |
126 |
#define DoesBackingStore(s) ((s)->backing_store) |
127 |
#define EventMaskOfScreen(s) ((s)->root_input_mask) |
128 |
|
129 |
/* |
130 |
* Extensions need a way to hang private data on some structures. |
131 |
*/ |
132 |
typedef struct _XExtData { |
133 |
int number; /* number returned by XRegisterExtension */ |
134 |
struct _XExtData *next; /* next item on list of data for structure */ |
135 |
int (*free_private)(); /* called to free private storage */ |
136 |
XPointer private_data; /* data private to this extension. */ |
137 |
} XExtData; |
138 |
|
139 |
/* |
140 |
* This file contains structures used by the extension mechanism. |
141 |
*/ |
142 |
typedef struct { /* public to extension, cannot be changed */ |
143 |
int extension; /* extension number */ |
144 |
int major_opcode; /* major op-code assigned by server */ |
145 |
int first_event; /* first event number for the extension */ |
146 |
int first_error; /* first error number for the extension */ |
147 |
} XExtCodes; |
148 |
|
149 |
/* |
150 |
* Data structure for retrieving info about pixmap formats. |
151 |
*/ |
152 |
|
153 |
typedef struct { |
154 |
int depth; |
155 |
int bits_per_pixel; |
156 |
int scanline_pad; |
157 |
} XPixmapFormatValues; |
158 |
|
159 |
|
160 |
/* |
161 |
* Data structure for setting graphics context. |
162 |
*/ |
163 |
typedef struct { |
164 |
int function; /* logical operation */ |
165 |
unsigned long plane_mask;/* plane mask */ |
166 |
unsigned long foreground;/* foreground pixel */ |
167 |
unsigned long background;/* background pixel */ |
168 |
int line_width; /* line width */ |
169 |
int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ |
170 |
int cap_style; /* CapNotLast, CapButt, |
171 |
CapRound, CapProjecting */ |
172 |
int join_style; /* JoinMiter, JoinRound, JoinBevel */ |
173 |
int fill_style; /* FillSolid, FillTiled, |
174 |
FillStippled, FillOpaeueStippled */ |
175 |
int fill_rule; /* EvenOddRule, WindingRule */ |
176 |
int arc_mode; /* ArcChord, ArcPieSlice */ |
177 |
Pixmap tile; /* tile pixmap for tiling operations */ |
178 |
Pixmap stipple; /* stipple 1 plane pixmap for stipping */ |
179 |
int ts_x_origin; /* offset for tile or stipple operations */ |
180 |
int ts_y_origin; |
181 |
Font font; /* default text font for text operations */ |
182 |
int subwindow_mode; /* ClipByChildren, IncludeInferiors */ |
183 |
Bool graphics_exposures;/* boolean, should exposures be generated */ |
184 |
int clip_x_origin; /* origin for clipping */ |
185 |
int clip_y_origin; |
186 |
Pixmap clip_mask; /* bitmap clipping; other calls for rects */ |
187 |
int dash_offset; /* patterned/dashed line information */ |
188 |
char dashes; |
189 |
} XGCValues; |
190 |
|
191 |
/* |
192 |
* Graphics context. The contents of this structure are implementation |
193 |
* dependent. A GC should be treated as opaque by application code. |
194 |
*/ |
195 |
|
196 |
typedef XGCValues *GC; |
197 |
|
198 |
/* |
199 |
* Visual structure; contains information about colormapping possible. |
200 |
*/ |
201 |
typedef struct { |
202 |
XExtData *ext_data; /* hook for extension to hang data */ |
203 |
VisualID visualid; /* visual id of this visual */ |
204 |
#if defined(__cplusplus) || defined(c_plusplus) |
205 |
int c_class; /* C++ class of screen (monochrome, etc.) */ |
206 |
#else |
207 |
int class; /* class of screen (monochrome, etc.) */ |
208 |
#endif |
209 |
unsigned long red_mask, green_mask, blue_mask; /* mask values */ |
210 |
int bits_per_rgb; /* log base 2 of distinct color values */ |
211 |
int map_entries; /* color map entries */ |
212 |
} Visual; |
213 |
|
214 |
/* |
215 |
* Depth structure; contains information for each possible depth. |
216 |
*/ |
217 |
typedef struct { |
218 |
int depth; /* this depth (Z) of the depth */ |
219 |
int nvisuals; /* number of Visual types at this depth */ |
220 |
Visual *visuals; /* list of visuals possible at this depth */ |
221 |
} Depth; |
222 |
|
223 |
/* |
224 |
* Information about the screen. The contents of this structure are |
225 |
* implementation dependent. A Screen should be treated as opaque |
226 |
* by application code. |
227 |
*/ |
228 |
typedef struct { |
229 |
XExtData *ext_data; /* hook for extension to hang data */ |
230 |
struct _XDisplay *display;/* back pointer to display structure */ |
231 |
Window root; /* Root window id. */ |
232 |
int width, height; /* width and height of screen */ |
233 |
int mwidth, mheight; /* width and height of in millimeters */ |
234 |
int ndepths; /* number of depths possible */ |
235 |
Depth *depths; /* list of allowable depths on the screen */ |
236 |
int root_depth; /* bits per pixel */ |
237 |
Visual *root_visual; /* root visual */ |
238 |
GC default_gc; /* GC for the root root visual */ |
239 |
Colormap cmap; /* default color map */ |
240 |
unsigned long white_pixel; |
241 |
unsigned long black_pixel; /* White and Black pixel values */ |
242 |
int max_maps, min_maps; /* max and min color maps */ |
243 |
int backing_store; /* Never, WhenMapped, Always */ |
244 |
Bool save_unders; |
245 |
long root_input_mask; /* initial root input mask */ |
246 |
} Screen; |
247 |
|
248 |
/* |
249 |
* Format structure; describes ZFormat data the screen will understand. |
250 |
*/ |
251 |
typedef struct { |
252 |
XExtData *ext_data; /* hook for extension to hang data */ |
253 |
int depth; /* depth of this image format */ |
254 |
int bits_per_pixel; /* bits/pixel at this depth */ |
255 |
int scanline_pad; /* scanline must padded to this multiple */ |
256 |
} ScreenFormat; |
257 |
|
258 |
/* |
259 |
* Data structure for setting window attributes. |
260 |
*/ |
261 |
typedef struct { |
262 |
Pixmap background_pixmap; /* background or None or ParentRelative */ |
263 |
unsigned long background_pixel; /* background pixel */ |
264 |
Pixmap border_pixmap; /* border of the window */ |
265 |
unsigned long border_pixel; /* border pixel value */ |
266 |
int bit_gravity; /* one of bit gravity values */ |
267 |
int win_gravity; /* one of the window gravity values */ |
268 |
int backing_store; /* NotUseful, WhenMapped, Always */ |
269 |
unsigned long backing_planes;/* planes to be preseved if possible */ |
270 |
unsigned long backing_pixel;/* value to use in restoring planes */ |
271 |
Bool save_under; /* should bits under be saved? (popups) */ |
272 |
long event_mask; /* set of events that should be saved */ |
273 |
long do_not_propagate_mask; /* set of events that should not propagate */ |
274 |
Bool override_redirect; /* boolean value for override-redirect */ |
275 |
Colormap colormap; /* color map to be associated with window */ |
276 |
Cursor cursor; /* cursor to be displayed (or None) */ |
277 |
} XSetWindowAttributes; |
278 |
|
279 |
typedef struct { |
280 |
int x, y; /* location of window */ |
281 |
int width, height; /* width and height of window */ |
282 |
int border_width; /* border width of window */ |
283 |
int depth; /* depth of window */ |
284 |
Visual *visual; /* the associated visual structure */ |
285 |
Window root; /* root of screen containing window */ |
286 |
#if defined(__cplusplus) || defined(c_plusplus) |
287 |
int c_class; /* C++ InputOutput, InputOnly*/ |
288 |
#else |
289 |
int class; /* InputOutput, InputOnly*/ |
290 |
#endif |
291 |
int bit_gravity; /* one of bit gravity values */ |
292 |
int win_gravity; /* one of the window gravity values */ |
293 |
int backing_store; /* NotUseful, WhenMapped, Always */ |
294 |
unsigned long backing_planes;/* planes to be preserved if possible */ |
295 |
unsigned long backing_pixel;/* value to be used when restoring planes */ |
296 |
Bool save_under; /* boolean, should bits under be saved? */ |
297 |
Colormap colormap; /* color map to be associated with window */ |
298 |
Bool map_installed; /* boolean, is color map currently installed*/ |
299 |
int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ |
300 |
long all_event_masks; /* set of events all people have interest in*/ |
301 |
long your_event_mask; /* my event mask */ |
302 |
long do_not_propagate_mask; /* set of events that should not propagate */ |
303 |
Bool override_redirect; /* boolean value for override-redirect */ |
304 |
Screen *screen; /* back pointer to correct screen */ |
305 |
} XWindowAttributes; |
306 |
|
307 |
/* |
308 |
* Data structure for host setting; getting routines. |
309 |
* |
310 |
*/ |
311 |
|
312 |
typedef struct { |
313 |
int family; /* for example FamilyInternet */ |
314 |
int length; /* length of address, in bytes */ |
315 |
char *address; /* pointer to where to find the bytes */ |
316 |
} XHostAddress; |
317 |
|
318 |
/* |
319 |
* Data structure for "image" data, used by image manipulation routines. |
320 |
*/ |
321 |
typedef struct _XImage { |
322 |
int width, height; /* size of image */ |
323 |
int xoffset; /* number of pixels offset in X direction */ |
324 |
int format; /* XYBitmap, XYPixmap, ZPixmap */ |
325 |
char *data; /* pointer to image data */ |
326 |
int byte_order; /* data byte order, LSBFirst, MSBFirst */ |
327 |
int bitmap_unit; /* quant. of scanline 8, 16, 32 */ |
328 |
int bitmap_bit_order; /* LSBFirst, MSBFirst */ |
329 |
int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ |
330 |
int depth; /* depth of image */ |
331 |
int bytes_per_line; /* accelarator to next line */ |
332 |
int bits_per_pixel; /* bits per pixel (ZPixmap) */ |
333 |
unsigned long red_mask; /* bits in z arrangment */ |
334 |
unsigned long green_mask; |
335 |
unsigned long blue_mask; |
336 |
XPointer obdata; /* hook for the object routines to hang on */ |
337 |
struct funcs { /* image manipulation routines */ |
338 |
struct _XImage *(*create_image)(); |
339 |
#if NeedFunctionPrototypes |
340 |
int (*destroy_image) (struct _XImage *); |
341 |
unsigned long (*get_pixel) (struct _XImage *, int, int); |
342 |
int (*put_pixel) (struct _XImage *, int, int, unsigned long); |
343 |
struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); |
344 |
int (*add_pixel) (struct _XImage *, long); |
345 |
#else |
346 |
int (*destroy_image)(); |
347 |
unsigned long (*get_pixel)(); |
348 |
int (*put_pixel)(); |
349 |
struct _XImage *(*sub_image)(); |
350 |
int (*add_pixel)(); |
351 |
#endif |
352 |
} f; |
353 |
} XImage; |
354 |
|
355 |
/* |
356 |
* Data structure for XReconfigureWindow |
357 |
*/ |
358 |
typedef struct { |
359 |
int x, y; |
360 |
int width, height; |
361 |
int border_width; |
362 |
Window sibling; |
363 |
int stack_mode; |
364 |
} XWindowChanges; |
365 |
|
366 |
/* |
367 |
* Data structure used by color operations |
368 |
*/ |
369 |
typedef struct { |
370 |
unsigned long pixel; |
371 |
unsigned short red, green, blue; |
372 |
char flags; /* do_red, do_green, do_blue */ |
373 |
char pad; |
374 |
} XColor; |
375 |
|
376 |
/* |
377 |
* Data structures for graphics operations. On most machines, these are |
378 |
* congruent with the wire protocol structures, so reformatting the data |
379 |
* can be avoided on these architectures. |
380 |
*/ |
381 |
typedef struct { |
382 |
short x1, y1, x2, y2; |
383 |
} XSegment; |
384 |
|
385 |
typedef struct { |
386 |
short x, y; |
387 |
} XPoint; |
388 |
|
389 |
typedef struct { |
390 |
short x, y; |
391 |
unsigned short width, height; |
392 |
} XRectangle; |
393 |
|
394 |
typedef struct { |
395 |
short x, y; |
396 |
unsigned short width, height; |
397 |
short angle1, angle2; |
398 |
} XArc; |
399 |
|
400 |
|
401 |
/* Data structure for XChangeKeyboardControl */ |
402 |
|
403 |
typedef struct { |
404 |
int key_click_percent; |
405 |
int bell_percent; |
406 |
int bell_pitch; |
407 |
int bell_duration; |
408 |
int led; |
409 |
int led_mode; |
410 |
int key; |
411 |
int auto_repeat_mode; /* On, Off, Default */ |
412 |
} XKeyboardControl; |
413 |
|
414 |
/* Data structure for XGetKeyboardControl */ |
415 |
|
416 |
typedef struct { |
417 |
int key_click_percent; |
418 |
int bell_percent; |
419 |
unsigned int bell_pitch, bell_duration; |
420 |
unsigned long led_mask; |
421 |
int global_auto_repeat; |
422 |
char auto_repeats[32]; |
423 |
} XKeyboardState; |
424 |
|
425 |
/* Data structure for XGetMotionEvents. */ |
426 |
|
427 |
typedef struct { |
428 |
Time time; |
429 |
short x, y; |
430 |
} XTimeCoord; |
431 |
|
432 |
/* Data structure for X{Set,Get}ModifierMapping */ |
433 |
|
434 |
typedef struct { |
435 |
int max_keypermod; /* The server's max # of keys per modifier */ |
436 |
KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ |
437 |
} XModifierKeymap; |
438 |
|
439 |
|
440 |
/* |
441 |
* Display datatype maintaining display specific data. |
442 |
* The contents of this structure are implementation dependent. |
443 |
* A Display should be treated as opaque by application code. |
444 |
*/ |
445 |
typedef struct _XDisplay { |
446 |
XExtData *ext_data; /* hook for extension to hang data */ |
447 |
struct _XFreeFuncs *free_funcs; /* internal free functions */ |
448 |
int fd; /* Network socket. */ |
449 |
int conn_checker; /* ugly thing used by _XEventsQueued */ |
450 |
int proto_major_version;/* maj. version of server's X protocol */ |
451 |
int proto_minor_version;/* minor version of servers X protocol */ |
452 |
char *vendor; /* vendor of the server hardware */ |
453 |
XID resource_base; /* resource ID base */ |
454 |
XID resource_mask; /* resource ID mask bits */ |
455 |
XID resource_id; /* allocator current ID */ |
456 |
int resource_shift; /* allocator shift to correct bits */ |
457 |
XID (*resource_alloc)(); /* allocator function */ |
458 |
int byte_order; /* screen byte order, LSBFirst, MSBFirst */ |
459 |
int bitmap_unit; /* padding and data requirements */ |
460 |
int bitmap_pad; /* padding requirements on bitmaps */ |
461 |
int bitmap_bit_order; /* LeastSignificant or MostSignificant */ |
462 |
int nformats; /* number of pixmap formats in list */ |
463 |
ScreenFormat *pixmap_format; /* pixmap format list */ |
464 |
int vnumber; /* Xlib's X protocol version number. */ |
465 |
int release; /* release of the server */ |
466 |
struct _XSQEvent *head, *tail; /* Input event queue. */ |
467 |
int qlen; /* Length of input event queue */ |
468 |
unsigned long request; /* sequence number of last request. */ |
469 |
char *last_req; /* beginning of last request, or dummy */ |
470 |
char *buffer; /* Output buffer starting address. */ |
471 |
char *bufptr; /* Output buffer index pointer. */ |
472 |
char *bufmax; /* Output buffer maximum+1 address. */ |
473 |
unsigned max_request_size; /* maximum number 32 bit words in request*/ |
474 |
struct _XrmHashBucketRec *db; |
475 |
int (*synchandler)(); /* Synchronization handler */ |
476 |
char *display_name; /* "host:display" string used on this connect*/ |
477 |
int default_screen; /* default screen for operations */ |
478 |
int nscreens; /* number of screens on this server*/ |
479 |
Screen *screens; /* pointer to list of screens */ |
480 |
unsigned long motion_buffer; /* size of motion buffer */ |
481 |
unsigned long flags; /* internal connection flags */ |
482 |
int min_keycode; /* minimum defined keycode */ |
483 |
int max_keycode; /* maximum defined keycode */ |
484 |
KeySym *keysyms; /* This server's keysyms */ |
485 |
XModifierKeymap *modifiermap; /* This server's modifier keymap */ |
486 |
int keysyms_per_keycode;/* number of rows */ |
487 |
char *xdefaults; /* contents of defaults from server */ |
488 |
char *scratch_buffer; /* place to hang scratch buffer */ |
489 |
unsigned long scratch_length; /* length of scratch buffer */ |
490 |
int ext_number; /* extension number on this display */ |
491 |
struct _XExten *ext_procs; /* extensions initialized on this display */ |
492 |
/* |
493 |
* the following can be fixed size, as the protocol defines how |
494 |
* much address space is available. |
495 |
* While this could be done using the extension vector, there |
496 |
* may be MANY events processed, so a search through the extension |
497 |
* list to find the right procedure for each event might be |
498 |
* expensive if many extensions are being used. |
499 |
*/ |
500 |
Bool (*event_vec[128])(); /* vector for wire to event */ |
501 |
Status (*wire_vec[128])(); /* vector for event to wire */ |
502 |
KeySym lock_meaning; /* for XLookupString */ |
503 |
struct _XLockInfo *lock; /* multi-thread state, display lock */ |
504 |
struct _XInternalAsync *async_handlers; /* for internal async */ |
505 |
unsigned long bigreq_size; /* max size of big requests */ |
506 |
struct _XLockPtrs *lock_fns; /* pointers to threads functions */ |
507 |
/* things above this line should not move, for binary compatibility */ |
508 |
struct _XKeytrans *key_bindings; /* for XLookupString */ |
509 |
Font cursor_font; /* for XCreateFontCursor */ |
510 |
struct _XDisplayAtoms *atoms; /* for XInternAtom */ |
511 |
unsigned int mode_switch; /* keyboard group modifiers */ |
512 |
struct _XContextDB *context_db; /* context database */ |
513 |
Bool (**error_vec)(); /* vector for wire to error */ |
514 |
/* |
515 |
* Xcms information |
516 |
*/ |
517 |
struct { |
518 |
XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ |
519 |
XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ |
520 |
XPointer perVisualIntensityMaps; |
521 |
/* linked list of XcmsIntensityMap */ |
522 |
} cms; |
523 |
struct _XIMFilter *im_filters; |
524 |
struct _XSQEvent *qfree; /* unallocated event queue elements */ |
525 |
unsigned long next_event_serial_num; /* inserted into next queue elt */ |
526 |
int (*savedsynchandler)(); /* user synchandler when Xlib usurps */ |
527 |
} Display; |
528 |
|
529 |
#if NeedFunctionPrototypes /* prototypes require event type definitions */ |
530 |
#undef _XEVENT_ |
531 |
#endif |
532 |
#ifndef _XEVENT_ |
533 |
|
534 |
#define XMaxTransChars 4 |
535 |
|
536 |
/* |
537 |
* Definitions of specific events. |
538 |
*/ |
539 |
typedef struct { |
540 |
int type; /* of event */ |
541 |
unsigned long serial; /* # of last request processed by server */ |
542 |
Bool send_event; /* true if this came from a SendEvent request */ |
543 |
Display *display; /* Display the event was read from */ |
544 |
Window window; /* "event" window it is reported relative to */ |
545 |
Window root; /* root window that the event occured on */ |
546 |
Window subwindow; /* child window */ |
547 |
Time time; /* milliseconds */ |
548 |
int x, y; /* pointer x, y coordinates in event window */ |
549 |
int x_root, y_root; /* coordinates relative to root */ |
550 |
unsigned int state; /* key or button mask */ |
551 |
unsigned int keycode; /* detail */ |
552 |
Bool same_screen; /* same screen flag */ |
553 |
char trans_chars[XMaxTransChars]; |
554 |
/* translated characters */ |
555 |
int nbytes; |
556 |
} XKeyEvent; |
557 |
typedef XKeyEvent XKeyPressedEvent; |
558 |
typedef XKeyEvent XKeyReleasedEvent; |
559 |
|
560 |
typedef struct { |
561 |
int type; /* of event */ |
562 |
unsigned long serial; /* # of last request processed by server */ |
563 |
Bool send_event; /* true if this came from a SendEvent request */ |
564 |
Display *display; /* Display the event was read from */ |
565 |
Window window; /* "event" window it is reported relative to */ |
566 |
Window root; /* root window that the event occured on */ |
567 |
Window subwindow; /* child window */ |
568 |
Time time; /* milliseconds */ |
569 |
int x, y; /* pointer x, y coordinates in event window */ |
570 |
int x_root, y_root; /* coordinates relative to root */ |
571 |
unsigned int state; /* key or button mask */ |
572 |
unsigned int button; /* detail */ |
573 |
Bool same_screen; /* same screen flag */ |
574 |
} XButtonEvent; |
575 |
typedef XButtonEvent XButtonPressedEvent; |
576 |
typedef XButtonEvent XButtonReleasedEvent; |
577 |
|
578 |
typedef struct { |
579 |
int type; /* of event */ |
580 |
unsigned long serial; /* # of last request processed by server */ |
581 |
Bool send_event; /* true if this came from a SendEvent request */ |
582 |
Display *display; /* Display the event was read from */ |
583 |
Window window; /* "event" window reported relative to */ |
584 |
Window root; /* root window that the event occured on */ |
585 |
Window subwindow; /* child window */ |
586 |
Time time; /* milliseconds */ |
587 |
int x, y; /* pointer x, y coordinates in event window */ |
588 |
int x_root, y_root; /* coordinates relative to root */ |
589 |
unsigned int state; /* key or button mask */ |
590 |
char is_hint; /* detail */ |
591 |
Bool same_screen; /* same screen flag */ |
592 |
} XMotionEvent; |
593 |
typedef XMotionEvent XPointerMovedEvent; |
594 |
|
595 |
typedef struct { |
596 |
int type; /* of event */ |
597 |
unsigned long serial; /* # of last request processed by server */ |
598 |
Bool send_event; /* true if this came from a SendEvent request */ |
599 |
Display *display; /* Display the event was read from */ |
600 |
Window window; /* "event" window reported relative to */ |
601 |
Window root; /* root window that the event occured on */ |
602 |
Window subwindow; /* child window */ |
603 |
Time time; /* milliseconds */ |
604 |
int x, y; /* pointer x, y coordinates in event window */ |
605 |
int x_root, y_root; /* coordinates relative to root */ |
606 |
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ |
607 |
int detail; |
608 |
/* |
609 |
* NotifyAncestor, NotifyVirtual, NotifyInferior, |
610 |
* NotifyNonlinear,NotifyNonlinearVirtual |
611 |
*/ |
612 |
Bool same_screen; /* same screen flag */ |
613 |
Bool focus; /* boolean focus */ |
614 |
unsigned int state; /* key or button mask */ |
615 |
} XCrossingEvent; |
616 |
typedef XCrossingEvent XEnterWindowEvent; |
617 |
typedef XCrossingEvent XLeaveWindowEvent; |
618 |
|
619 |
typedef struct { |
620 |
int type; /* FocusIn or FocusOut */ |
621 |
unsigned long serial; /* # of last request processed by server */ |
622 |
Bool send_event; /* true if this came from a SendEvent request */ |
623 |
Display *display; /* Display the event was read from */ |
624 |
Window window; /* window of event */ |
625 |
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ |
626 |
int detail; |
627 |
/* |
628 |
* NotifyAncestor, NotifyVirtual, NotifyInferior, |
629 |
* NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, |
630 |
* NotifyPointerRoot, NotifyDetailNone |
631 |
*/ |
632 |
} XFocusChangeEvent; |
633 |
typedef XFocusChangeEvent XFocusInEvent; |
634 |
typedef XFocusChangeEvent XFocusOutEvent; |
635 |
|
636 |
/* generated on EnterWindow and FocusIn when KeyMapState selected */ |
637 |
typedef struct { |
638 |
int type; |
639 |
unsigned long serial; /* # of last request processed by server */ |
640 |
Bool send_event; /* true if this came from a SendEvent request */ |
641 |
Display *display; /* Display the event was read from */ |
642 |
Window window; |
643 |
char key_vector[32]; |
644 |
} XKeymapEvent; |
645 |
|
646 |
typedef struct { |
647 |
int type; |
648 |
unsigned long serial; /* # of last request processed by server */ |
649 |
Bool send_event; /* true if this came from a SendEvent request */ |
650 |
Display *display; /* Display the event was read from */ |
651 |
Window window; |
652 |
int x, y; |
653 |
int width, height; |
654 |
int count; /* if non-zero, at least this many more */ |
655 |
} XExposeEvent; |
656 |
|
657 |
typedef struct { |
658 |
int type; |
659 |
unsigned long serial; /* # of last request processed by server */ |
660 |
Bool send_event; /* true if this came from a SendEvent request */ |
661 |
Display *display; /* Display the event was read from */ |
662 |
Drawable drawable; |
663 |
int x, y; |
664 |
int width, height; |
665 |
int count; /* if non-zero, at least this many more */ |
666 |
int major_code; /* core is CopyArea or CopyPlane */ |
667 |
int minor_code; /* not defined in the core */ |
668 |
} XGraphicsExposeEvent; |
669 |
|
670 |
typedef struct { |
671 |
int type; |
672 |
unsigned long serial; /* # of last request processed by server */ |
673 |
Bool send_event; /* true if this came from a SendEvent request */ |
674 |
Display *display; /* Display the event was read from */ |
675 |
Drawable drawable; |
676 |
int major_code; /* core is CopyArea or CopyPlane */ |
677 |
int minor_code; /* not defined in the core */ |
678 |
} XNoExposeEvent; |
679 |
|
680 |
typedef struct { |
681 |
int type; |
682 |
unsigned long serial; /* # of last request processed by server */ |
683 |
Bool send_event; /* true if this came from a SendEvent request */ |
684 |
Display *display; /* Display the event was read from */ |
685 |
Window window; |
686 |
int state; /* Visibility state */ |
687 |
} XVisibilityEvent; |
688 |
|
689 |
typedef struct { |
690 |
int type; |
691 |
unsigned long serial; /* # of last request processed by server */ |
692 |
Bool send_event; /* true if this came from a SendEvent request */ |
693 |
Display *display; /* Display the event was read from */ |
694 |
Window parent; /* parent of the window */ |
695 |
Window window; /* window id of window created */ |
696 |
int x, y; /* window location */ |
697 |
int width, height; /* size of window */ |
698 |
int border_width; /* border width */ |
699 |
Bool override_redirect; /* creation should be overridden */ |
700 |
} XCreateWindowEvent; |
701 |
|
702 |
typedef struct { |
703 |
int type; |
704 |
unsigned long serial; /* # of last request processed by server */ |
705 |
Bool send_event; /* true if this came from a SendEvent request */ |
706 |
Display *display; /* Display the event was read from */ |
707 |
Window event; |
708 |
Window window; |
709 |
} XDestroyWindowEvent; |
710 |
|
711 |
typedef struct { |
712 |
int type; |
713 |
unsigned long serial; /* # of last request processed by server */ |
714 |
Bool send_event; /* true if this came from a SendEvent request */ |
715 |
Display *display; /* Display the event was read from */ |
716 |
Window event; |
717 |
Window window; |
718 |
Bool from_configure; |
719 |
} XUnmapEvent; |
720 |
|
721 |
typedef struct { |
722 |
int type; |
723 |
unsigned long serial; /* # of last request processed by server */ |
724 |
Bool send_event; /* true if this came from a SendEvent request */ |
725 |
Display *display; /* Display the event was read from */ |
726 |
Window event; |
727 |
Window window; |
728 |
Bool override_redirect; /* boolean, is override set... */ |
729 |
} XMapEvent; |
730 |
|
731 |
typedef struct { |
732 |
int type; |
733 |
unsigned long serial; /* # of last request processed by server */ |
734 |
Bool send_event; /* true if this came from a SendEvent request */ |
735 |
Display *display; /* Display the event was read from */ |
736 |
Window parent; |
737 |
Window window; |
738 |
} XMapRequestEvent; |
739 |
|
740 |
typedef struct { |
741 |
int type; |
742 |
unsigned long serial; /* # of last request processed by server */ |
743 |
Bool send_event; /* true if this came from a SendEvent request */ |
744 |
Display *display; /* Display the event was read from */ |
745 |
Window event; |
746 |
Window window; |
747 |
Window parent; |
748 |
int x, y; |
749 |
Bool override_redirect; |
750 |
} XReparentEvent; |
751 |
|
752 |
typedef struct { |
753 |
int type; |
754 |
unsigned long serial; /* # of last request processed by server */ |
755 |
Bool send_event; /* true if this came from a SendEvent request */ |
756 |
Display *display; /* Display the event was read from */ |
757 |
Window event; |
758 |
Window window; |
759 |
int x, y; |
760 |
int width, height; |
761 |
int border_width; |
762 |
Window above; |
763 |
Bool override_redirect; |
764 |
} XConfigureEvent; |
765 |
|
766 |
typedef struct { |
767 |
int type; |
768 |
unsigned long serial; /* # of last request processed by server */ |
769 |
Bool send_event; /* true if this came from a SendEvent request */ |
770 |
Display *display; /* Display the event was read from */ |
771 |
Window event; |
772 |
Window window; |
773 |
int x, y; |
774 |
} XGravityEvent; |
775 |
|
776 |
typedef struct { |
777 |
int type; |
778 |
unsigned long serial; /* # of last request processed by server */ |
779 |
Bool send_event; /* true if this came from a SendEvent request */ |
780 |
Display *display; /* Display the event was read from */ |
781 |
Window window; |
782 |
int width, height; |
783 |
} XResizeRequestEvent; |
784 |
|
785 |
typedef struct { |
786 |
int type; |
787 |
unsigned long serial; /* # of last request processed by server */ |
788 |
Bool send_event; /* true if this came from a SendEvent request */ |
789 |
Display *display; /* Display the event was read from */ |
790 |
Window parent; |
791 |
Window window; |
792 |
int x, y; |
793 |
int width, height; |
794 |
int border_width; |
795 |
Window above; |
796 |
int detail; /* Above, Below, TopIf, BottomIf, Opposite */ |
797 |
unsigned long value_mask; |
798 |
} XConfigureRequestEvent; |
799 |
|
800 |
typedef struct { |
801 |
int type; |
802 |
unsigned long serial; /* # of last request processed by server */ |
803 |
Bool send_event; /* true if this came from a SendEvent request */ |
804 |
Display *display; /* Display the event was read from */ |
805 |
Window event; |
806 |
Window window; |
807 |
int place; /* PlaceOnTop, PlaceOnBottom */ |
808 |
} XCirculateEvent; |
809 |
|
810 |
typedef struct { |
811 |
int type; |
812 |
unsigned long serial; /* # of last request processed by server */ |
813 |
Bool send_event; /* true if this came from a SendEvent request */ |
814 |
Display *display; /* Display the event was read from */ |
815 |
Window parent; |
816 |
Window window; |
817 |
int place; /* PlaceOnTop, PlaceOnBottom */ |
818 |
} XCirculateRequestEvent; |
819 |
|
820 |
typedef struct { |
821 |
int type; |
822 |
unsigned long serial; /* # of last request processed by server */ |
823 |
Bool send_event; /* true if this came from a SendEvent request */ |
824 |
Display *display; /* Display the event was read from */ |
825 |
Window window; |
826 |
Atom atom; |
827 |
Time time; |
828 |
int state; /* NewValue, Deleted */ |
829 |
} XPropertyEvent; |
830 |
|
831 |
typedef struct { |
832 |
int type; |
833 |
unsigned long serial; /* # of last request processed by server */ |
834 |
Bool send_event; /* true if this came from a SendEvent request */ |
835 |
Display *display; /* Display the event was read from */ |
836 |
Window window; |
837 |
Atom selection; |
838 |
Time time; |
839 |
} XSelectionClearEvent; |
840 |
|
841 |
typedef struct { |
842 |
int type; |
843 |
unsigned long serial; /* # of last request processed by server */ |
844 |
Bool send_event; /* true if this came from a SendEvent request */ |
845 |
Display *display; /* Display the event was read from */ |
846 |
Window owner; |
847 |
Window requestor; |
848 |
Atom selection; |
849 |
Atom target; |
850 |
Atom property; |
851 |
Time time; |
852 |
} XSelectionRequestEvent; |
853 |
|
854 |
typedef struct { |
855 |
int type; |
856 |
unsigned long serial; /* # of last request processed by server */ |
857 |
Bool send_event; /* true if this came from a SendEvent request */ |
858 |
Display *display; /* Display the event was read from */ |
859 |
Window requestor; |
860 |
Atom selection; |
861 |
Atom target; |
862 |
Atom property; /* ATOM or None */ |
863 |
Time time; |
864 |
} XSelectionEvent; |
865 |
|
866 |
typedef struct { |
867 |
int type; |
868 |
unsigned long serial; /* # of last request processed by server */ |
869 |
Bool send_event; /* true if this came from a SendEvent request */ |
870 |
Display *display; /* Display the event was read from */ |
871 |
Window window; |
872 |
Colormap colormap; /* COLORMAP or None */ |
873 |
#if defined(__cplusplus) || defined(c_plusplus) |
874 |
Bool c_new; /* C++ */ |
875 |
#else |
876 |
Bool new; |
877 |
#endif |
878 |
int state; /* ColormapInstalled, ColormapUninstalled */ |
879 |
} XColormapEvent; |
880 |
|
881 |
typedef struct { |
882 |
int type; |
883 |
unsigned long serial; /* # of last request processed by server */ |
884 |
Bool send_event; /* true if this came from a SendEvent request */ |
885 |
Display *display; /* Display the event was read from */ |
886 |
Window window; |
887 |
Atom message_type; |
888 |
int format; |
889 |
union { |
890 |
char b[20]; |
891 |
short s[10]; |
892 |
long l[5]; |
893 |
} data; |
894 |
} XClientMessageEvent; |
895 |
|
896 |
typedef struct { |
897 |
int type; |
898 |
unsigned long serial; /* # of last request processed by server */ |
899 |
Bool send_event; /* true if this came from a SendEvent request */ |
900 |
Display *display; /* Display the event was read from */ |
901 |
Window window; /* unused */ |
902 |
int request; /* one of MappingModifier, MappingKeyboard, |
903 |
MappingPointer */ |
904 |
int first_keycode; /* first keycode */ |
905 |
int count; /* defines range of change w. first_keycode*/ |
906 |
} XMappingEvent; |
907 |
|
908 |
typedef struct { |
909 |
int type; |
910 |
Display *display; /* Display the event was read from */ |
911 |
XID resourceid; /* resource id */ |
912 |
unsigned long serial; /* serial number of failed request */ |
913 |
unsigned char error_code; /* error code of failed request */ |
914 |
unsigned char request_code; /* Major op-code of failed request */ |
915 |
unsigned char minor_code; /* Minor op-code of failed request */ |
916 |
} XErrorEvent; |
917 |
|
918 |
typedef struct { |
919 |
int type; |
920 |
unsigned long serial; /* # of last request processed by server */ |
921 |
Bool send_event; /* true if this came from a SendEvent request */ |
922 |
Display *display;/* Display the event was read from */ |
923 |
Window window; /* window on which event was requested in event mask */ |
924 |
} XAnyEvent; |
925 |
|
926 |
/* |
927 |
* this union is defined so Xlib can always use the same sized |
928 |
* event structure internally, to avoid memory fragmentation. |
929 |
*/ |
930 |
typedef union _XEvent { |
931 |
int type; /* must not be changed; first element */ |
932 |
XAnyEvent xany; |
933 |
XKeyEvent xkey; |
934 |
XButtonEvent xbutton; |
935 |
XMotionEvent xmotion; |
936 |
XCrossingEvent xcrossing; |
937 |
XFocusChangeEvent xfocus; |
938 |
XExposeEvent xexpose; |
939 |
XGraphicsExposeEvent xgraphicsexpose; |
940 |
XNoExposeEvent xnoexpose; |
941 |
XVisibilityEvent xvisibility; |
942 |
XCreateWindowEvent xcreatewindow; |
943 |
XDestroyWindowEvent xdestroywindow; |
944 |
XUnmapEvent xunmap; |
945 |
XMapEvent xmap; |
946 |
XMapRequestEvent xmaprequest; |
947 |
XReparentEvent xreparent; |
948 |
XConfigureEvent xconfigure; |
949 |
XGravityEvent xgravity; |
950 |
XResizeRequestEvent xresizerequest; |
951 |
XConfigureRequestEvent xconfigurerequest; |
952 |
XCirculateEvent xcirculate; |
953 |
XCirculateRequestEvent xcirculaterequest; |
954 |
XPropertyEvent xproperty; |
955 |
XSelectionClearEvent xselectionclear; |
956 |
XSelectionRequestEvent xselectionrequest; |
957 |
XSelectionEvent xselection; |
958 |
XColormapEvent xcolormap; |
959 |
XClientMessageEvent xclient; |
960 |
XMappingEvent xmapping; |
961 |
XErrorEvent xerror; |
962 |
XKeymapEvent xkeymap; |
963 |
long pad[24]; |
964 |
} XEvent; |
965 |
#endif |
966 |
|
967 |
#define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy))) |
968 |
|
969 |
/* |
970 |
* per character font metric information. |
971 |
*/ |
972 |
typedef struct { |
973 |
short lbearing; /* origin to left edge of raster */ |
974 |
short rbearing; /* origin to right edge of raster */ |
975 |
short width; /* advance to next char's origin */ |
976 |
short ascent; /* baseline to top edge of raster */ |
977 |
short descent; /* baseline to bottom edge of raster */ |
978 |
unsigned short attributes; /* per char flags (not predefined) */ |
979 |
} XCharStruct; |
980 |
|
981 |
/* |
982 |
* To allow arbitrary information with fonts, there are additional properties |
983 |
* returned. |
984 |
*/ |
985 |
typedef struct { |
986 |
Atom name; |
987 |
unsigned long card32; |
988 |
} XFontProp; |
989 |
|
990 |
typedef struct { |
991 |
XExtData *ext_data; /* hook for extension to hang data */ |
992 |
Font fid; /* Font id for this font */ |
993 |
unsigned direction; /* hint about direction the font is painted */ |
994 |
unsigned min_char_or_byte2;/* first character */ |
995 |
unsigned max_char_or_byte2;/* last character */ |
996 |
unsigned min_byte1; /* first row that exists */ |
997 |
unsigned max_byte1; /* last row that exists */ |
998 |
Bool all_chars_exist;/* flag if all characters have non-zero size*/ |
999 |
unsigned default_char; /* char to print for undefined character */ |
1000 |
int n_properties; /* how many properties there are */ |
1001 |
XFontProp *properties; /* pointer to array of additional properties*/ |
1002 |
XCharStruct min_bounds; /* minimum bounds over all existing char*/ |
1003 |
XCharStruct max_bounds; /* maximum bounds over all existing char*/ |
1004 |
XCharStruct *per_char; /* first_char to last_char information */ |
1005 |
int ascent; /* log. extent above baseline for spacing */ |
1006 |
int descent; /* log. descent below baseline for spacing */ |
1007 |
} XFontStruct; |
1008 |
|
1009 |
/* |
1010 |
* PolyText routines take these as arguments. |
1011 |
*/ |
1012 |
typedef struct { |
1013 |
char *chars; /* pointer to string */ |
1014 |
int nchars; /* number of characters */ |
1015 |
int delta; /* delta between strings */ |
1016 |
Font font; /* font to print it in, None don't change */ |
1017 |
} XTextItem; |
1018 |
|
1019 |
typedef struct { /* normal 16 bit characters are two bytes */ |
1020 |
unsigned char byte1; |
1021 |
unsigned char byte2; |
1022 |
} XChar2b; |
1023 |
|
1024 |
typedef struct { |
1025 |
XChar2b *chars; /* two byte characters */ |
1026 |
int nchars; /* number of characters */ |
1027 |
int delta; /* delta between strings */ |
1028 |
Font font; /* font to print it in, None don't change */ |
1029 |
} XTextItem16; |
1030 |
|
1031 |
|
1032 |
typedef union { Display *display; |
1033 |
GC gc; |
1034 |
Visual *visual; |
1035 |
Screen *screen; |
1036 |
ScreenFormat *pixmap_format; |
1037 |
XFontStruct *font; } XEDataObject; |
1038 |
|
1039 |
typedef struct { |
1040 |
XRectangle max_ink_extent; |
1041 |
XRectangle max_logical_extent; |
1042 |
} XFontSetExtents; |
1043 |
|
1044 |
typedef struct _XFontSet *XFontSet; |
1045 |
|
1046 |
typedef struct { |
1047 |
char *chars; |
1048 |
int nchars; |
1049 |
int delta; |
1050 |
XFontSet font_set; |
1051 |
} XmbTextItem; |
1052 |
|
1053 |
typedef struct { |
1054 |
wchar_t *chars; |
1055 |
int nchars; |
1056 |
int delta; |
1057 |
XFontSet font_set; |
1058 |
} XwcTextItem; |
1059 |
|
1060 |
typedef void (*XIMProc)(); |
1061 |
|
1062 |
typedef struct _XIM *XIM; |
1063 |
typedef struct _XIC *XIC; |
1064 |
|
1065 |
typedef unsigned long XIMStyle; |
1066 |
|
1067 |
typedef struct { |
1068 |
unsigned short count_styles; |
1069 |
XIMStyle *supported_styles; |
1070 |
} XIMStyles; |
1071 |
|
1072 |
#define XIMPreeditArea 0x0001L |
1073 |
#define XIMPreeditCallbacks 0x0002L |
1074 |
#define XIMPreeditPosition 0x0004L |
1075 |
#define XIMPreeditNothing 0x0008L |
1076 |
#define XIMPreeditNone 0x0010L |
1077 |
#define XIMStatusArea 0x0100L |
1078 |
#define XIMStatusCallbacks 0x0200L |
1079 |
#define XIMStatusNothing 0x0400L |
1080 |
#define XIMStatusNone 0x0800L |
1081 |
|
1082 |
#define XNVaNestedList "XNVaNestedList" |
1083 |
#define XNClientWindow "clientWindow" |
1084 |
#define XNInputStyle "inputStyle" |
1085 |
#define XNFocusWindow "focusWindow" |
1086 |
#define XNResourceName "resourceName" |
1087 |
#define XNResourceClass "resourceClass" |
1088 |
#define XNGeometryCallback "geometryCallback" |
1089 |
#define XNFilterEvents "filterEvents" |
1090 |
#define XNPreeditStartCallback "preeditStartCallback" |
1091 |
#define XNPreeditDoneCallback "preeditDoneCallback" |
1092 |
#define XNPreeditDrawCallback "preeditDrawCallback" |
1093 |
#define XNPreeditCaretCallback "preeditCaretCallback" |
1094 |
#define XNPreeditAttributes "preeditAttributes" |
1095 |
#define XNStatusStartCallback "statusStartCallback" |
1096 |
#define XNStatusDoneCallback "statusDoneCallback" |
1097 |
#define XNStatusDrawCallback "statusDrawCallback" |
1098 |
#define XNStatusAttributes "statusAttributes" |
1099 |
#define XNArea "area" |
1100 |
#define XNAreaNeeded "areaNeeded" |
1101 |
#define XNSpotLocation "spotLocation" |
1102 |
#define XNColormap "colorMap" |
1103 |
#define XNStdColormap "stdColorMap" |
1104 |
#define XNForeground "foreground" |
1105 |
#define XNBackground "background" |
1106 |
#define XNBackgroundPixmap "backgroundPixmap" |
1107 |
#define XNFontSet "fontSet" |
1108 |
#define XNLineSpace "lineSpace" |
1109 |
#define XNCursor "cursor" |
1110 |
|
1111 |
#define XBufferOverflow -1 |
1112 |
#define XLookupNone 1 |
1113 |
#define XLookupChars 2 |
1114 |
#define XLookupKeySym 3 |
1115 |
#define XLookupBoth 4 |
1116 |
|
1117 |
#if NeedFunctionPrototypes |
1118 |
typedef void *XVaNestedList; |
1119 |
#else |
1120 |
typedef XPointer XVaNestedList; |
1121 |
#endif |
1122 |
|
1123 |
typedef struct { |
1124 |
XPointer client_data; |
1125 |
XIMProc callback; |
1126 |
} XIMCallback; |
1127 |
|
1128 |
typedef unsigned long XIMFeedback; |
1129 |
|
1130 |
#define XIMReverse 1 |
1131 |
#define XIMUnderline (1<<1) |
1132 |
#define XIMHighlight (1<<2) |
1133 |
#define XIMPrimary (1<<5) |
1134 |
#define XIMSecondary (1<<6) |
1135 |
#define XIMTertiary (1<<7) |
1136 |
|
1137 |
typedef struct _XIMText { |
1138 |
unsigned short length; |
1139 |
XIMFeedback *feedback; |
1140 |
Bool encoding_is_wchar; |
1141 |
union { |
1142 |
char *multi_byte; |
1143 |
wchar_t *wide_char; |
1144 |
} string; |
1145 |
} XIMText; |
1146 |
|
1147 |
typedef struct _XIMPreeditDrawCallbackStruct { |
1148 |
int caret; /* Cursor offset within pre-edit string */ |
1149 |
int chg_first; /* Starting change position */ |
1150 |
int chg_length; /* Length of the change in character count */ |
1151 |
XIMText *text; |
1152 |
} XIMPreeditDrawCallbackStruct; |
1153 |
|
1154 |
typedef enum { |
1155 |
XIMForwardChar, XIMBackwardChar, |
1156 |
XIMForwardWord, XIMBackwardWord, |
1157 |
XIMCaretUp, XIMCaretDown, |
1158 |
XIMNextLine, XIMPreviousLine, |
1159 |
XIMLineStart, XIMLineEnd, |
1160 |
XIMAbsolutePosition, |
1161 |
XIMDontChange |
1162 |
} XIMCaretDirection; |
1163 |
|
1164 |
typedef enum { |
1165 |
XIMIsInvisible, /* Disable caret feedback */ |
1166 |
XIMIsPrimary, /* UI defined caret feedback */ |
1167 |
XIMIsSecondary /* UI defined caret feedback */ |
1168 |
} XIMCaretStyle; |
1169 |
|
1170 |
typedef struct _XIMPreeditCaretCallbackStruct { |
1171 |
int position; /* Caret offset within pre-edit string */ |
1172 |
XIMCaretDirection direction; /* Caret moves direction */ |
1173 |
XIMCaretStyle style; /* Feedback of the caret */ |
1174 |
} XIMPreeditCaretCallbackStruct; |
1175 |
|
1176 |
typedef enum { |
1177 |
XIMTextType, |
1178 |
XIMBitmapType |
1179 |
} XIMStatusDataType; |
1180 |
|
1181 |
typedef struct _XIMStatusDrawCallbackStruct { |
1182 |
XIMStatusDataType type; |
1183 |
union { |
1184 |
XIMText *text; |
1185 |
Pixmap bitmap; |
1186 |
} data; |
1187 |
} XIMStatusDrawCallbackStruct; |
1188 |
|
1189 |
typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ |
1190 |
#if NeedFunctionPrototypes |
1191 |
Display* /* display */, |
1192 |
XErrorEvent* /* error_event */ |
1193 |
#endif |
1194 |
); |
1195 |
|
1196 |
_XFUNCPROTOBEGIN |
1197 |
|
1198 |
|
1199 |
|
1200 |
#include "tkIntXlibDecls.h" |
1201 |
|
1202 |
_XFUNCPROTOEND |
1203 |
|
1204 |
#ifdef MAC_TCL |
1205 |
# undef Cursor |
1206 |
# undef Region |
1207 |
#endif |
1208 |
|
1209 |
#endif /* _XLIB_H_ */ |
1210 |
|
1211 |
/* End of xlib.h */ |