1
/* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */
3
* Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation for any purpose and without fee is hereby granted, provided
7
* that the above copyright notice appear in all copies and that both that
8
* copyright notice and this permission notice appear in supporting
9
* documentation, and that the name of M.I.T. not be used in advertising
10
* or publicity pertaining to distribution of the software without specific,
11
* written prior permission. M.I.T. makes no representations about the
12
* suitability of this software for any purpose. It is provided "as is"
13
* without express or implied warranty.
15
* X Window System is a Trademark of MIT.
21
* Xlib.h - Header definition and support file for the C subroutine
22
* interface library (Xlib) to the X Window System Protocol (V11).
23
* Structures and symbols starting with "_" are private to the library.
28
#define XlibSpecificationRelease 5
30
#if !defined(MAC_OSX_TK)
35
# define Cursor XCursor
36
# define Region XRegion
39
/* applications should not depend on these two headers being included! */
40
#include <X11/Xfuncproto.h>
51
/* replace this with #include or typedef appropriate for your system */
52
typedef unsigned long wchar_t;
55
typedef char *XPointer;
58
#if defined(MAC_OSX_TK)
59
/* Use define rather than typedef, since may need to undefine this later */
67
#define QueuedAlready 0
68
#define QueuedAfterReading 1
69
#define QueuedAfterFlush 2
71
#define ConnectionNumber(dpy) ((dpy)->fd)
72
#define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root)
73
#define DefaultScreen(dpy) ((dpy)->default_screen)
74
#define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root)
75
#define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
76
#define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc)
77
#define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel)
78
#define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel)
79
#define AllPlanes ((unsigned long)~0L)
80
#define QLength(dpy) ((dpy)->qlen)
81
#define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width)
82
#define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
83
#define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
84
#define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
85
#define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
86
#define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries)
87
#define ScreenCount(dpy) ((dpy)->nscreens)
88
#define ServerVendor(dpy) ((dpy)->vendor)
89
#define ProtocolVersion(dpy) ((dpy)->proto_major_version)
90
#define ProtocolRevision(dpy) ((dpy)->proto_minor_version)
91
#define VendorRelease(dpy) ((dpy)->release)
92
#define DisplayString(dpy) ((dpy)->display_name)
93
#define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
94
#define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
95
#define BitmapUnit(dpy) ((dpy)->bitmap_unit)
96
#define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order)
97
#define BitmapPad(dpy) ((dpy)->bitmap_pad)
98
#define ImageByteOrder(dpy) ((dpy)->byte_order)
99
#define NextRequest(dpy) ((dpy)->request + 1)
100
#define LastKnownRequestProcessed(dpy) ((dpy)->request)
102
/* macros for screen oriented applications (toolkit) */
103
#define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
104
#define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
105
#define DisplayOfScreen(s) ((s)->display)
106
#define RootWindowOfScreen(s) ((s)->root)
107
#define BlackPixelOfScreen(s) ((s)->black_pixel)
108
#define WhitePixelOfScreen(s) ((s)->white_pixel)
109
#define DefaultColormapOfScreen(s)((s)->cmap)
110
#define DefaultDepthOfScreen(s) ((s)->root_depth)
111
#define DefaultGCOfScreen(s) ((s)->default_gc)
112
#define DefaultVisualOfScreen(s)((s)->root_visual)
113
#define WidthOfScreen(s) ((s)->width)
114
#define HeightOfScreen(s) ((s)->height)
115
#define WidthMMOfScreen(s) ((s)->mwidth)
116
#define HeightMMOfScreen(s) ((s)->mheight)
117
#define PlanesOfScreen(s) ((s)->root_depth)
118
#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries)
119
#define MinCmapsOfScreen(s) ((s)->min_maps)
120
#define MaxCmapsOfScreen(s) ((s)->max_maps)
121
#define DoesSaveUnders(s) ((s)->save_unders)
122
#define DoesBackingStore(s) ((s)->backing_store)
123
#define EventMaskOfScreen(s) ((s)->root_input_mask)
126
* Extensions need a way to hang private data on some structures.
128
typedef struct _XExtData {
129
int number; /* number returned by XRegisterExtension */
130
struct _XExtData *next; /* next item on list of data for structure */
131
int (*free_private)(); /* called to free private storage */
132
XPointer private_data; /* data private to this extension. */
136
* This file contains structures used by the extension mechanism.
138
typedef struct { /* public to extension, cannot be changed */
139
int extension; /* extension number */
140
int major_opcode; /* major op-code assigned by server */
141
int first_event; /* first event number for the extension */
142
int first_error; /* first error number for the extension */
146
* Data structure for retrieving info about pixmap formats.
153
} XPixmapFormatValues;
157
* Data structure for setting graphics context.
160
int function; /* logical operation */
161
unsigned long plane_mask;/* plane mask */
162
unsigned long foreground;/* foreground pixel */
163
unsigned long background;/* background pixel */
164
int line_width; /* line width */
165
int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
166
int cap_style; /* CapNotLast, CapButt,
167
CapRound, CapProjecting */
168
int join_style; /* JoinMiter, JoinRound, JoinBevel */
169
int fill_style; /* FillSolid, FillTiled,
170
FillStippled, FillOpaeueStippled */
171
int fill_rule; /* EvenOddRule, WindingRule */
172
int arc_mode; /* ArcChord, ArcPieSlice */
173
Pixmap tile; /* tile pixmap for tiling operations */
174
Pixmap stipple; /* stipple 1 plane pixmap for stipping */
175
int ts_x_origin; /* offset for tile or stipple operations */
177
Font font; /* default text font for text operations */
178
int subwindow_mode; /* ClipByChildren, IncludeInferiors */
179
Bool graphics_exposures;/* boolean, should exposures be generated */
180
int clip_x_origin; /* origin for clipping */
182
Pixmap clip_mask; /* bitmap clipping; other calls for rects */
183
int dash_offset; /* patterned/dashed line information */
188
* Graphics context. The contents of this structure are implementation
189
* dependent. A GC should be treated as opaque by application code.
192
typedef XGCValues *GC;
195
* Visual structure; contains information about colormapping possible.
198
XExtData *ext_data; /* hook for extension to hang data */
199
VisualID visualid; /* visual id of this visual */
200
#if defined(__cplusplus) || defined(c_plusplus)
201
int c_class; /* C++ class of screen (monochrome, etc.) */
203
int class; /* class of screen (monochrome, etc.) */
205
unsigned long red_mask, green_mask, blue_mask; /* mask values */
206
int bits_per_rgb; /* log base 2 of distinct color values */
207
int map_entries; /* color map entries */
211
* Depth structure; contains information for each possible depth.
214
int depth; /* this depth (Z) of the depth */
215
int nvisuals; /* number of Visual types at this depth */
216
Visual *visuals; /* list of visuals possible at this depth */
220
* Information about the screen. The contents of this structure are
221
* implementation dependent. A Screen should be treated as opaque
222
* by application code.
225
XExtData *ext_data; /* hook for extension to hang data */
226
struct _XDisplay *display;/* back pointer to display structure */
227
Window root; /* Root window id. */
228
int width, height; /* width and height of screen */
229
int mwidth, mheight; /* width and height of in millimeters */
230
int ndepths; /* number of depths possible */
231
Depth *depths; /* list of allowable depths on the screen */
232
int root_depth; /* bits per pixel */
233
Visual *root_visual; /* root visual */
234
GC default_gc; /* GC for the root root visual */
235
Colormap cmap; /* default color map */
236
unsigned long white_pixel;
237
unsigned long black_pixel; /* White and Black pixel values */
238
int max_maps, min_maps; /* max and min color maps */
239
int backing_store; /* Never, WhenMapped, Always */
241
long root_input_mask; /* initial root input mask */
245
* Format structure; describes ZFormat data the screen will understand.
248
XExtData *ext_data; /* hook for extension to hang data */
249
int depth; /* depth of this image format */
250
int bits_per_pixel; /* bits/pixel at this depth */
251
int scanline_pad; /* scanline must padded to this multiple */
255
* Data structure for setting window attributes.
258
Pixmap background_pixmap; /* background or None or ParentRelative */
259
unsigned long background_pixel; /* background pixel */
260
Pixmap border_pixmap; /* border of the window */
261
unsigned long border_pixel; /* border pixel value */
262
int bit_gravity; /* one of bit gravity values */
263
int win_gravity; /* one of the window gravity values */
264
int backing_store; /* NotUseful, WhenMapped, Always */
265
unsigned long backing_planes;/* planes to be preseved if possible */
266
unsigned long backing_pixel;/* value to use in restoring planes */
267
Bool save_under; /* should bits under be saved? (popups) */
268
long event_mask; /* set of events that should be saved */
269
long do_not_propagate_mask; /* set of events that should not propagate */
270
Bool override_redirect; /* boolean value for override-redirect */
271
Colormap colormap; /* color map to be associated with window */
272
Cursor cursor; /* cursor to be displayed (or None) */
273
} XSetWindowAttributes;
276
int x, y; /* location of window */
277
int width, height; /* width and height of window */
278
int border_width; /* border width of window */
279
int depth; /* depth of window */
280
Visual *visual; /* the associated visual structure */
281
Window root; /* root of screen containing window */
282
#if defined(__cplusplus) || defined(c_plusplus)
283
int c_class; /* C++ InputOutput, InputOnly*/
285
int class; /* InputOutput, InputOnly*/
287
int bit_gravity; /* one of bit gravity values */
288
int win_gravity; /* one of the window gravity values */
289
int backing_store; /* NotUseful, WhenMapped, Always */
290
unsigned long backing_planes;/* planes to be preserved if possible */
291
unsigned long backing_pixel;/* value to be used when restoring planes */
292
Bool save_under; /* boolean, should bits under be saved? */
293
Colormap colormap; /* color map to be associated with window */
294
Bool map_installed; /* boolean, is color map currently installed*/
295
int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
296
long all_event_masks; /* set of events all people have interest in*/
297
long your_event_mask; /* my event mask */
298
long do_not_propagate_mask; /* set of events that should not propagate */
299
Bool override_redirect; /* boolean value for override-redirect */
300
Screen *screen; /* back pointer to correct screen */
304
* Data structure for host setting; getting routines.
309
int family; /* for example FamilyInternet */
310
int length; /* length of address, in bytes */
311
char *address; /* pointer to where to find the bytes */
315
* Data structure for "image" data, used by image manipulation routines.
317
typedef struct _XImage {
318
int width, height; /* size of image */
319
int xoffset; /* number of pixels offset in X direction */
320
int format; /* XYBitmap, XYPixmap, ZPixmap */
321
char *data; /* pointer to image data */
322
int byte_order; /* data byte order, LSBFirst, MSBFirst */
323
int bitmap_unit; /* quant. of scanline 8, 16, 32 */
324
int bitmap_bit_order; /* LSBFirst, MSBFirst */
325
int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
326
int depth; /* depth of image */
327
int bytes_per_line; /* accelarator to next line */
328
int bits_per_pixel; /* bits per pixel (ZPixmap) */
329
unsigned long red_mask; /* bits in z arrangment */
330
unsigned long green_mask;
331
unsigned long blue_mask;
332
XPointer obdata; /* hook for the object routines to hang on */
333
struct funcs { /* image manipulation routines */
334
struct _XImage *(*create_image)();
335
#if NeedFunctionPrototypes
336
int (*destroy_image) (struct _XImage *);
337
unsigned long (*get_pixel) (struct _XImage *, int, int);
338
int (*put_pixel) (struct _XImage *, int, int, unsigned long);
339
struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
340
int (*add_pixel) (struct _XImage *, long);
342
int (*destroy_image)();
343
unsigned long (*get_pixel)();
345
struct _XImage *(*sub_image)();
352
* Data structure for XReconfigureWindow
363
* Data structure used by color operations
367
unsigned short red, green, blue;
368
char flags; /* do_red, do_green, do_blue */
373
* Data structures for graphics operations. On most machines, these are
374
* congruent with the wire protocol structures, so reformatting the data
375
* can be avoided on these architectures.
378
short x1, y1, x2, y2;
387
unsigned short width, height;
392
unsigned short width, height;
393
short angle1, angle2;
397
/* Data structure for XChangeKeyboardControl */
400
int key_click_percent;
407
int auto_repeat_mode; /* On, Off, Default */
410
/* Data structure for XGetKeyboardControl */
413
int key_click_percent;
415
unsigned int bell_pitch, bell_duration;
416
unsigned long led_mask;
417
int global_auto_repeat;
418
char auto_repeats[32];
421
/* Data structure for XGetMotionEvents. */
428
/* Data structure for X{Set,Get}ModifierMapping */
431
int max_keypermod; /* The server's max # of keys per modifier */
432
KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */
437
* Display datatype maintaining display specific data.
438
* The contents of this structure are implementation dependent.
439
* A Display should be treated as opaque by application code.
441
typedef struct _XDisplay {
442
XExtData *ext_data; /* hook for extension to hang data */
443
struct _XFreeFuncs *free_funcs; /* internal free functions */
444
int fd; /* Network socket. */
445
int conn_checker; /* ugly thing used by _XEventsQueued */
446
int proto_major_version;/* maj. version of server's X protocol */
447
int proto_minor_version;/* minor version of servers X protocol */
448
char *vendor; /* vendor of the server hardware */
449
XID resource_base; /* resource ID base */
450
XID resource_mask; /* resource ID mask bits */
451
XID resource_id; /* allocator current ID */
452
int resource_shift; /* allocator shift to correct bits */
453
XID (*resource_alloc)(); /* allocator function */
454
int byte_order; /* screen byte order, LSBFirst, MSBFirst */
455
int bitmap_unit; /* padding and data requirements */
456
int bitmap_pad; /* padding requirements on bitmaps */
457
int bitmap_bit_order; /* LeastSignificant or MostSignificant */
458
int nformats; /* number of pixmap formats in list */
459
ScreenFormat *pixmap_format; /* pixmap format list */
460
int vnumber; /* Xlib's X protocol version number. */
461
int release; /* release of the server */
462
struct _XSQEvent *head, *tail; /* Input event queue. */
463
int qlen; /* Length of input event queue */
464
unsigned long request; /* sequence number of last request. */
465
char *last_req; /* beginning of last request, or dummy */
466
char *buffer; /* Output buffer starting address. */
467
char *bufptr; /* Output buffer index pointer. */
468
char *bufmax; /* Output buffer maximum+1 address. */
469
unsigned max_request_size; /* maximum number 32 bit words in request*/
470
struct _XrmHashBucketRec *db;
471
int (*synchandler)(); /* Synchronization handler */
472
char *display_name; /* "host:display" string used on this connect*/
473
int default_screen; /* default screen for operations */
474
int nscreens; /* number of screens on this server*/
475
Screen *screens; /* pointer to list of screens */
476
unsigned long motion_buffer; /* size of motion buffer */
477
unsigned long flags; /* internal connection flags */
478
int min_keycode; /* minimum defined keycode */
479
int max_keycode; /* maximum defined keycode */
480
KeySym *keysyms; /* This server's keysyms */
481
XModifierKeymap *modifiermap; /* This server's modifier keymap */
482
int keysyms_per_keycode;/* number of rows */
483
char *xdefaults; /* contents of defaults from server */
484
char *scratch_buffer; /* place to hang scratch buffer */
485
unsigned long scratch_length; /* length of scratch buffer */
486
int ext_number; /* extension number on this display */
487
struct _XExten *ext_procs; /* extensions initialized on this display */
489
* the following can be fixed size, as the protocol defines how
490
* much address space is available.
491
* While this could be done using the extension vector, there
492
* may be MANY events processed, so a search through the extension
493
* list to find the right procedure for each event might be
494
* expensive if many extensions are being used.
496
Bool (*event_vec[128])(); /* vector for wire to event */
497
Status (*wire_vec[128])(); /* vector for event to wire */
498
KeySym lock_meaning; /* for XLookupString */
499
struct _XLockInfo *lock; /* multi-thread state, display lock */
500
struct _XInternalAsync *async_handlers; /* for internal async */
501
unsigned long bigreq_size; /* max size of big requests */
502
struct _XLockPtrs *lock_fns; /* pointers to threads functions */
503
/* things above this line should not move, for binary compatibility */
504
struct _XKeytrans *key_bindings; /* for XLookupString */
505
Font cursor_font; /* for XCreateFontCursor */
506
struct _XDisplayAtoms *atoms; /* for XInternAtom */
507
unsigned int mode_switch; /* keyboard group modifiers */
508
struct _XContextDB *context_db; /* context database */
509
Bool (**error_vec)(); /* vector for wire to error */
514
XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */
515
XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */
516
XPointer perVisualIntensityMaps;
517
/* linked list of XcmsIntensityMap */
519
struct _XIMFilter *im_filters;
520
struct _XSQEvent *qfree; /* unallocated event queue elements */
521
unsigned long next_event_serial_num; /* inserted into next queue elt */
522
int (*savedsynchandler)(); /* user synchandler when Xlib usurps */
525
#if NeedFunctionPrototypes /* prototypes require event type definitions */
530
#define XMaxTransChars 4
533
* Definitions of specific events.
536
int type; /* of event */
537
unsigned long serial; /* # of last request processed by server */
538
Bool send_event; /* true if this came from a SendEvent request */
539
Display *display; /* Display the event was read from */
540
Window window; /* "event" window it is reported relative to */
541
Window root; /* root window that the event occured on */
542
Window subwindow; /* child window */
543
Time time; /* milliseconds */
544
int x, y; /* pointer x, y coordinates in event window */
545
int x_root, y_root; /* coordinates relative to root */
546
unsigned int state; /* key or button mask */
547
unsigned int keycode; /* detail */
548
Bool same_screen; /* same screen flag */
549
char trans_chars[XMaxTransChars];
550
/* translated characters */
553
typedef XKeyEvent XKeyPressedEvent;
554
typedef XKeyEvent XKeyReleasedEvent;
557
int type; /* of event */
558
unsigned long serial; /* # of last request processed by server */
559
Bool send_event; /* true if this came from a SendEvent request */
560
Display *display; /* Display the event was read from */
561
Window window; /* "event" window it is reported relative to */
562
Window root; /* root window that the event occured on */
563
Window subwindow; /* child window */
564
Time time; /* milliseconds */
565
int x, y; /* pointer x, y coordinates in event window */
566
int x_root, y_root; /* coordinates relative to root */
567
unsigned int state; /* key or button mask */
568
unsigned int button; /* detail */
569
Bool same_screen; /* same screen flag */
571
typedef XButtonEvent XButtonPressedEvent;
572
typedef XButtonEvent XButtonReleasedEvent;
575
int type; /* of event */
576
unsigned long serial; /* # of last request processed by server */
577
Bool send_event; /* true if this came from a SendEvent request */
578
Display *display; /* Display the event was read from */
579
Window window; /* "event" window reported relative to */
580
Window root; /* root window that the event occured on */
581
Window subwindow; /* child window */
582
Time time; /* milliseconds */
583
int x, y; /* pointer x, y coordinates in event window */
584
int x_root, y_root; /* coordinates relative to root */
585
unsigned int state; /* key or button mask */
586
char is_hint; /* detail */
587
Bool same_screen; /* same screen flag */
589
typedef XMotionEvent XPointerMovedEvent;
592
int type; /* of event */
593
unsigned long serial; /* # of last request processed by server */
594
Bool send_event; /* true if this came from a SendEvent request */
595
Display *display; /* Display the event was read from */
596
Window window; /* "event" window reported relative to */
597
Window root; /* root window that the event occured on */
598
Window subwindow; /* child window */
599
Time time; /* milliseconds */
600
int x, y; /* pointer x, y coordinates in event window */
601
int x_root, y_root; /* coordinates relative to root */
602
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
605
* NotifyAncestor, NotifyVirtual, NotifyInferior,
606
* NotifyNonlinear,NotifyNonlinearVirtual
608
Bool same_screen; /* same screen flag */
609
Bool focus; /* boolean focus */
610
unsigned int state; /* key or button mask */
612
typedef XCrossingEvent XEnterWindowEvent;
613
typedef XCrossingEvent XLeaveWindowEvent;
616
int type; /* FocusIn or FocusOut */
617
unsigned long serial; /* # of last request processed by server */
618
Bool send_event; /* true if this came from a SendEvent request */
619
Display *display; /* Display the event was read from */
620
Window window; /* window of event */
621
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
624
* NotifyAncestor, NotifyVirtual, NotifyInferior,
625
* NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
626
* NotifyPointerRoot, NotifyDetailNone
629
typedef XFocusChangeEvent XFocusInEvent;
630
typedef XFocusChangeEvent XFocusOutEvent;
632
/* generated on EnterWindow and FocusIn when KeyMapState selected */
635
unsigned long serial; /* # of last request processed by server */
636
Bool send_event; /* true if this came from a SendEvent request */
637
Display *display; /* Display the event was read from */
644
unsigned long serial; /* # of last request processed by server */
645
Bool send_event; /* true if this came from a SendEvent request */
646
Display *display; /* Display the event was read from */
650
int count; /* if non-zero, at least this many more */
655
unsigned long serial; /* # of last request processed by server */
656
Bool send_event; /* true if this came from a SendEvent request */
657
Display *display; /* Display the event was read from */
661
int count; /* if non-zero, at least this many more */
662
int major_code; /* core is CopyArea or CopyPlane */
663
int minor_code; /* not defined in the core */
664
} XGraphicsExposeEvent;
668
unsigned long serial; /* # of last request processed by server */
669
Bool send_event; /* true if this came from a SendEvent request */
670
Display *display; /* Display the event was read from */
672
int major_code; /* core is CopyArea or CopyPlane */
673
int minor_code; /* not defined in the core */
678
unsigned long serial; /* # of last request processed by server */
679
Bool send_event; /* true if this came from a SendEvent request */
680
Display *display; /* Display the event was read from */
682
int state; /* Visibility state */
687
unsigned long serial; /* # of last request processed by server */
688
Bool send_event; /* true if this came from a SendEvent request */
689
Display *display; /* Display the event was read from */
690
Window parent; /* parent of the window */
691
Window window; /* window id of window created */
692
int x, y; /* window location */
693
int width, height; /* size of window */
694
int border_width; /* border width */
695
Bool override_redirect; /* creation should be overridden */
696
} XCreateWindowEvent;
700
unsigned long serial; /* # of last request processed by server */
701
Bool send_event; /* true if this came from a SendEvent request */
702
Display *display; /* Display the event was read from */
705
} XDestroyWindowEvent;
709
unsigned long serial; /* # of last request processed by server */
710
Bool send_event; /* true if this came from a SendEvent request */
711
Display *display; /* Display the event was read from */
719
unsigned long serial; /* # of last request processed by server */
720
Bool send_event; /* true if this came from a SendEvent request */
721
Display *display; /* Display the event was read from */
724
Bool override_redirect; /* boolean, is override set... */
729
unsigned long serial; /* # of last request processed by server */
730
Bool send_event; /* true if this came from a SendEvent request */
731
Display *display; /* Display the event was read from */
738
unsigned long serial; /* # of last request processed by server */
739
Bool send_event; /* true if this came from a SendEvent request */
740
Display *display; /* Display the event was read from */
745
Bool override_redirect;
750
unsigned long serial; /* # of last request processed by server */
751
Bool send_event; /* true if this came from a SendEvent request */
752
Display *display; /* Display the event was read from */
759
Bool override_redirect;
764
unsigned long serial; /* # of last request processed by server */
765
Bool send_event; /* true if this came from a SendEvent request */
766
Display *display; /* Display the event was read from */
774
unsigned long serial; /* # of last request processed by server */
775
Bool send_event; /* true if this came from a SendEvent request */
776
Display *display; /* Display the event was read from */
779
} XResizeRequestEvent;
783
unsigned long serial; /* # of last request processed by server */
784
Bool send_event; /* true if this came from a SendEvent request */
785
Display *display; /* Display the event was read from */
792
int detail; /* Above, Below, TopIf, BottomIf, Opposite */
793
unsigned long value_mask;
794
} XConfigureRequestEvent;
798
unsigned long serial; /* # of last request processed by server */
799
Bool send_event; /* true if this came from a SendEvent request */
800
Display *display; /* Display the event was read from */
803
int place; /* PlaceOnTop, PlaceOnBottom */
808
unsigned long serial; /* # of last request processed by server */
809
Bool send_event; /* true if this came from a SendEvent request */
810
Display *display; /* Display the event was read from */
813
int place; /* PlaceOnTop, PlaceOnBottom */
814
} XCirculateRequestEvent;
818
unsigned long serial; /* # of last request processed by server */
819
Bool send_event; /* true if this came from a SendEvent request */
820
Display *display; /* Display the event was read from */
824
int state; /* NewValue, Deleted */
829
unsigned long serial; /* # of last request processed by server */
830
Bool send_event; /* true if this came from a SendEvent request */
831
Display *display; /* Display the event was read from */
835
} XSelectionClearEvent;
839
unsigned long serial; /* # of last request processed by server */
840
Bool send_event; /* true if this came from a SendEvent request */
841
Display *display; /* Display the event was read from */
848
} XSelectionRequestEvent;
852
unsigned long serial; /* # of last request processed by server */
853
Bool send_event; /* true if this came from a SendEvent request */
854
Display *display; /* Display the event was read from */
858
Atom property; /* ATOM or None */
864
unsigned long serial; /* # of last request processed by server */
865
Bool send_event; /* true if this came from a SendEvent request */
866
Display *display; /* Display the event was read from */
868
Colormap colormap; /* COLORMAP or None */
869
#if defined(__cplusplus) || defined(c_plusplus)
870
Bool c_new; /* C++ */
874
int state; /* ColormapInstalled, ColormapUninstalled */
879
unsigned long serial; /* # of last request processed by server */
880
Bool send_event; /* true if this came from a SendEvent request */
881
Display *display; /* Display the event was read from */
890
} XClientMessageEvent;
894
unsigned long serial; /* # of last request processed by server */
895
Bool send_event; /* true if this came from a SendEvent request */
896
Display *display; /* Display the event was read from */
897
Window window; /* unused */
898
int request; /* one of MappingModifier, MappingKeyboard,
900
int first_keycode; /* first keycode */
901
int count; /* defines range of change w. first_keycode*/
906
Display *display; /* Display the event was read from */
907
XID resourceid; /* resource id */
908
unsigned long serial; /* serial number of failed request */
909
unsigned char error_code; /* error code of failed request */
910
unsigned char request_code; /* Major op-code of failed request */
911
unsigned char minor_code; /* Minor op-code of failed request */
916
unsigned long serial; /* # of last request processed by server */
917
Bool send_event; /* true if this came from a SendEvent request */
918
Display *display;/* Display the event was read from */
919
Window window; /* window on which event was requested in event mask */
923
* this union is defined so Xlib can always use the same sized
924
* event structure internally, to avoid memory fragmentation.
926
typedef union _XEvent {
927
int type; /* must not be changed; first element */
930
XButtonEvent xbutton;
931
XMotionEvent xmotion;
932
XCrossingEvent xcrossing;
933
XFocusChangeEvent xfocus;
934
XExposeEvent xexpose;
935
XGraphicsExposeEvent xgraphicsexpose;
936
XNoExposeEvent xnoexpose;
937
XVisibilityEvent xvisibility;
938
XCreateWindowEvent xcreatewindow;
939
XDestroyWindowEvent xdestroywindow;
942
XMapRequestEvent xmaprequest;
943
XReparentEvent xreparent;
944
XConfigureEvent xconfigure;
945
XGravityEvent xgravity;
946
XResizeRequestEvent xresizerequest;
947
XConfigureRequestEvent xconfigurerequest;
948
XCirculateEvent xcirculate;
949
XCirculateRequestEvent xcirculaterequest;
950
XPropertyEvent xproperty;
951
XSelectionClearEvent xselectionclear;
952
XSelectionRequestEvent xselectionrequest;
953
XSelectionEvent xselection;
954
XColormapEvent xcolormap;
955
XClientMessageEvent xclient;
956
XMappingEvent xmapping;
958
XKeymapEvent xkeymap;
963
#define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy)))
966
* per character font metric information.
969
short lbearing; /* origin to left edge of raster */
970
short rbearing; /* origin to right edge of raster */
971
short width; /* advance to next char's origin */
972
short ascent; /* baseline to top edge of raster */
973
short descent; /* baseline to bottom edge of raster */
974
unsigned short attributes; /* per char flags (not predefined) */
978
* To allow arbitrary information with fonts, there are additional properties
983
unsigned long card32;
987
XExtData *ext_data; /* hook for extension to hang data */
988
Font fid; /* Font id for this font */
989
unsigned direction; /* hint about direction the font is painted */
990
unsigned min_char_or_byte2;/* first character */
991
unsigned max_char_or_byte2;/* last character */
992
unsigned min_byte1; /* first row that exists */
993
unsigned max_byte1; /* last row that exists */
994
Bool all_chars_exist;/* flag if all characters have non-zero size*/
995
unsigned default_char; /* char to print for undefined character */
996
int n_properties; /* how many properties there are */
997
XFontProp *properties; /* pointer to array of additional properties*/
998
XCharStruct min_bounds; /* minimum bounds over all existing char*/
999
XCharStruct max_bounds; /* maximum bounds over all existing char*/
1000
XCharStruct *per_char; /* first_char to last_char information */
1001
int ascent; /* log. extent above baseline for spacing */
1002
int descent; /* log. descent below baseline for spacing */
1006
* PolyText routines take these as arguments.
1009
char *chars; /* pointer to string */
1010
int nchars; /* number of characters */
1011
int delta; /* delta between strings */
1012
Font font; /* font to print it in, None don't change */
1015
typedef struct { /* normal 16 bit characters are two bytes */
1016
unsigned char byte1;
1017
unsigned char byte2;
1021
XChar2b *chars; /* two byte characters */
1022
int nchars; /* number of characters */
1023
int delta; /* delta between strings */
1024
Font font; /* font to print it in, None don't change */
1028
typedef union { Display *display;
1032
ScreenFormat *pixmap_format;
1033
XFontStruct *font; } XEDataObject;
1036
XRectangle max_ink_extent;
1037
XRectangle max_logical_extent;
1040
typedef struct _XFontSet *XFontSet;
1056
typedef void (*XIMProc)();
1058
typedef struct _XIM *XIM;
1059
typedef struct _XIC *XIC;
1061
typedef unsigned long XIMStyle;
1064
unsigned short count_styles;
1065
XIMStyle *supported_styles;
1068
#define XIMPreeditArea 0x0001L
1069
#define XIMPreeditCallbacks 0x0002L
1070
#define XIMPreeditPosition 0x0004L
1071
#define XIMPreeditNothing 0x0008L
1072
#define XIMPreeditNone 0x0010L
1073
#define XIMStatusArea 0x0100L
1074
#define XIMStatusCallbacks 0x0200L
1075
#define XIMStatusNothing 0x0400L
1076
#define XIMStatusNone 0x0800L
1078
#define XNVaNestedList "XNVaNestedList"
1079
#define XNClientWindow "clientWindow"
1080
#define XNInputStyle "inputStyle"
1081
#define XNFocusWindow "focusWindow"
1082
#define XNResourceName "resourceName"
1083
#define XNResourceClass "resourceClass"
1084
#define XNGeometryCallback "geometryCallback"
1085
#define XNFilterEvents "filterEvents"
1086
#define XNPreeditStartCallback "preeditStartCallback"
1087
#define XNPreeditDoneCallback "preeditDoneCallback"
1088
#define XNPreeditDrawCallback "preeditDrawCallback"
1089
#define XNPreeditCaretCallback "preeditCaretCallback"
1090
#define XNPreeditAttributes "preeditAttributes"
1091
#define XNStatusStartCallback "statusStartCallback"
1092
#define XNStatusDoneCallback "statusDoneCallback"
1093
#define XNStatusDrawCallback "statusDrawCallback"
1094
#define XNStatusAttributes "statusAttributes"
1095
#define XNArea "area"
1096
#define XNAreaNeeded "areaNeeded"
1097
#define XNSpotLocation "spotLocation"
1098
#define XNColormap "colorMap"
1099
#define XNStdColormap "stdColorMap"
1100
#define XNForeground "foreground"
1101
#define XNBackground "background"
1102
#define XNBackgroundPixmap "backgroundPixmap"
1103
#define XNFontSet "fontSet"
1104
#define XNLineSpace "lineSpace"
1105
#define XNCursor "cursor"
1107
#define XBufferOverflow -1
1108
#define XLookupNone 1
1109
#define XLookupChars 2
1110
#define XLookupKeySym 3
1111
#define XLookupBoth 4
1113
#if NeedFunctionPrototypes
1114
typedef void *XVaNestedList;
1116
typedef XPointer XVaNestedList;
1120
XPointer client_data;
1124
typedef unsigned long XIMFeedback;
1126
#define XIMReverse 1
1127
#define XIMUnderline (1<<1)
1128
#define XIMHighlight (1<<2)
1129
#define XIMPrimary (1<<5)
1130
#define XIMSecondary (1<<6)
1131
#define XIMTertiary (1<<7)
1133
typedef struct _XIMText {
1134
unsigned short length;
1135
XIMFeedback *feedback;
1136
Bool encoding_is_wchar;
1143
typedef struct _XIMPreeditDrawCallbackStruct {
1144
int caret; /* Cursor offset within pre-edit string */
1145
int chg_first; /* Starting change position */
1146
int chg_length; /* Length of the change in character count */
1148
} XIMPreeditDrawCallbackStruct;
1151
XIMForwardChar, XIMBackwardChar,
1152
XIMForwardWord, XIMBackwardWord,
1153
XIMCaretUp, XIMCaretDown,
1154
XIMNextLine, XIMPreviousLine,
1155
XIMLineStart, XIMLineEnd,
1156
XIMAbsolutePosition,
1158
} XIMCaretDirection;
1161
XIMIsInvisible, /* Disable caret feedback */
1162
XIMIsPrimary, /* UI defined caret feedback */
1163
XIMIsSecondary /* UI defined caret feedback */
1166
typedef struct _XIMPreeditCaretCallbackStruct {
1167
int position; /* Caret offset within pre-edit string */
1168
XIMCaretDirection direction; /* Caret moves direction */
1169
XIMCaretStyle style; /* Feedback of the caret */
1170
} XIMPreeditCaretCallbackStruct;
1175
} XIMStatusDataType;
1177
typedef struct _XIMStatusDrawCallbackStruct {
1178
XIMStatusDataType type;
1183
} XIMStatusDrawCallbackStruct;
1185
typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
1186
#if NeedFunctionPrototypes
1187
Display* /* display */,
1188
XErrorEvent* /* error_event */
1196
#include "tkIntXlibDecls.h"
1200
#if defined(MAC_OSX_TK)
1205
#endif /* _XLIB_H_ */