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_TCL) && !defined(MAC_OSX_TK)
35 # define Cursor XCursor
36 # define Region XRegion
40 # define Cursor XCursor
41 # define Region XRegion
44 /* applications should not depend on these two headers being included! */
46 #include <Xfuncproto.h>
48 #include <X11/Xfuncproto.h>
60 /* replace this with #include or typedef appropriate for your system */
61 typedef unsigned long wchar_t;
64 typedef char *XPointer
;
67 #if defined(MAC_TCL) || defined(MAC_OSX_TK)
68 /* Use define rather than typedef, since may need to undefine this later */
76 #define QueuedAlready 0
77 #define QueuedAfterReading 1
78 #define QueuedAfterFlush 2
80 #define ConnectionNumber(dpy) ((dpy)->fd)
81 #define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root)
82 #define DefaultScreen(dpy) ((dpy)->default_screen)
83 #define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root)
84 #define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
85 #define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc)
86 #define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel)
87 #define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel)
88 #define AllPlanes ((unsigned long)~0L)
89 #define QLength(dpy) ((dpy)->qlen)
90 #define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width)
91 #define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
92 #define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
93 #define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
94 #define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
95 #define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries)
96 #define ScreenCount(dpy) ((dpy)->nscreens)
97 #define ServerVendor(dpy) ((dpy)->vendor)
98 #define ProtocolVersion(dpy) ((dpy)->proto_major_version)
99 #define ProtocolRevision(dpy) ((dpy)->proto_minor_version)
100 #define VendorRelease(dpy) ((dpy)->release)
101 #define DisplayString(dpy) ((dpy)->display_name)
102 #define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
103 #define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
104 #define BitmapUnit(dpy) ((dpy)->bitmap_unit)
105 #define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order)
106 #define BitmapPad(dpy) ((dpy)->bitmap_pad)
107 #define ImageByteOrder(dpy) ((dpy)->byte_order)
108 #define NextRequest(dpy) ((dpy)->request + 1)
109 #define LastKnownRequestProcessed(dpy) ((dpy)->request)
111 /* macros for screen oriented applications (toolkit) */
112 #define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
113 #define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
114 #define DisplayOfScreen(s) ((s)->display)
115 #define RootWindowOfScreen(s) ((s)->root)
116 #define BlackPixelOfScreen(s) ((s)->black_pixel)
117 #define WhitePixelOfScreen(s) ((s)->white_pixel)
118 #define DefaultColormapOfScreen(s)((s)->cmap)
119 #define DefaultDepthOfScreen(s) ((s)->root_depth)
120 #define DefaultGCOfScreen(s) ((s)->default_gc)
121 #define DefaultVisualOfScreen(s)((s)->root_visual)
122 #define WidthOfScreen(s) ((s)->width)
123 #define HeightOfScreen(s) ((s)->height)
124 #define WidthMMOfScreen(s) ((s)->mwidth)
125 #define HeightMMOfScreen(s) ((s)->mheight)
126 #define PlanesOfScreen(s) ((s)->root_depth)
127 #define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries)
128 #define MinCmapsOfScreen(s) ((s)->min_maps)
129 #define MaxCmapsOfScreen(s) ((s)->max_maps)
130 #define DoesSaveUnders(s) ((s)->save_unders)
131 #define DoesBackingStore(s) ((s)->backing_store)
132 #define EventMaskOfScreen(s) ((s)->root_input_mask)
135 * Extensions need a way to hang private data on some structures.
137 typedef struct _XExtData
{
138 int number
; /* number returned by XRegisterExtension */
139 struct _XExtData
*next
; /* next item on list of data for structure */
140 int (*free_private
)(); /* called to free private storage */
141 XPointer private_data
; /* data private to this extension. */
145 * This file contains structures used by the extension mechanism.
147 typedef struct { /* public to extension, cannot be changed */
148 int extension
; /* extension number */
149 int major_opcode
; /* major op-code assigned by server */
150 int first_event
; /* first event number for the extension */
151 int first_error
; /* first error number for the extension */
155 * Data structure for retrieving info about pixmap formats.
162 } XPixmapFormatValues
;
166 * Data structure for setting graphics context.
169 int function
; /* logical operation */
170 unsigned long plane_mask
;/* plane mask */
171 unsigned long foreground
;/* foreground pixel */
172 unsigned long background
;/* background pixel */
173 int line_width
; /* line width */
174 int line_style
; /* LineSolid, LineOnOffDash, LineDoubleDash */
175 int cap_style
; /* CapNotLast, CapButt,
176 CapRound, CapProjecting */
177 int join_style
; /* JoinMiter, JoinRound, JoinBevel */
178 int fill_style
; /* FillSolid, FillTiled,
179 FillStippled, FillOpaeueStippled */
180 int fill_rule
; /* EvenOddRule, WindingRule */
181 int arc_mode
; /* ArcChord, ArcPieSlice */
182 Pixmap tile
; /* tile pixmap for tiling operations */
183 Pixmap stipple
; /* stipple 1 plane pixmap for stipping */
184 int ts_x_origin
; /* offset for tile or stipple operations */
186 Font font
; /* default text font for text operations */
187 int subwindow_mode
; /* ClipByChildren, IncludeInferiors */
188 Bool graphics_exposures
;/* boolean, should exposures be generated */
189 int clip_x_origin
; /* origin for clipping */
191 Pixmap clip_mask
; /* bitmap clipping; other calls for rects */
192 int dash_offset
; /* patterned/dashed line information */
197 * Graphics context. The contents of this structure are implementation
198 * dependent. A GC should be treated as opaque by application code.
201 typedef XGCValues
*GC
;
204 * Visual structure; contains information about colormapping possible.
207 XExtData
*ext_data
; /* hook for extension to hang data */
208 VisualID visualid
; /* visual id of this visual */
209 #if defined(__cplusplus) || defined(c_plusplus)
210 int c_class
; /* C++ class of screen (monochrome, etc.) */
212 int class; /* class of screen (monochrome, etc.) */
214 unsigned long red_mask
, green_mask
, blue_mask
; /* mask values */
215 int bits_per_rgb
; /* log base 2 of distinct color values */
216 int map_entries
; /* color map entries */
220 * Depth structure; contains information for each possible depth.
223 int depth
; /* this depth (Z) of the depth */
224 int nvisuals
; /* number of Visual types at this depth */
225 Visual
*visuals
; /* list of visuals possible at this depth */
229 * Information about the screen. The contents of this structure are
230 * implementation dependent. A Screen should be treated as opaque
231 * by application code.
234 XExtData
*ext_data
; /* hook for extension to hang data */
235 struct _XDisplay
*display
;/* back pointer to display structure */
236 Window root
; /* Root window id. */
237 int width
, height
; /* width and height of screen */
238 int mwidth
, mheight
; /* width and height of in millimeters */
239 int ndepths
; /* number of depths possible */
240 Depth
*depths
; /* list of allowable depths on the screen */
241 int root_depth
; /* bits per pixel */
242 Visual
*root_visual
; /* root visual */
243 GC default_gc
; /* GC for the root root visual */
244 Colormap cmap
; /* default color map */
245 unsigned long white_pixel
;
246 unsigned long black_pixel
; /* White and Black pixel values */
247 int max_maps
, min_maps
; /* max and min color maps */
248 int backing_store
; /* Never, WhenMapped, Always */
250 long root_input_mask
; /* initial root input mask */
254 * Format structure; describes ZFormat data the screen will understand.
257 XExtData
*ext_data
; /* hook for extension to hang data */
258 int depth
; /* depth of this image format */
259 int bits_per_pixel
; /* bits/pixel at this depth */
260 int scanline_pad
; /* scanline must padded to this multiple */
264 * Data structure for setting window attributes.
267 Pixmap background_pixmap
; /* background or None or ParentRelative */
268 unsigned long background_pixel
; /* background pixel */
269 Pixmap border_pixmap
; /* border of the window */
270 unsigned long border_pixel
; /* border pixel value */
271 int bit_gravity
; /* one of bit gravity values */
272 int win_gravity
; /* one of the window gravity values */
273 int backing_store
; /* NotUseful, WhenMapped, Always */
274 unsigned long backing_planes
;/* planes to be preseved if possible */
275 unsigned long backing_pixel
;/* value to use in restoring planes */
276 Bool save_under
; /* should bits under be saved? (popups) */
277 long event_mask
; /* set of events that should be saved */
278 long do_not_propagate_mask
; /* set of events that should not propagate */
279 Bool override_redirect
; /* boolean value for override-redirect */
280 Colormap colormap
; /* color map to be associated with window */
281 Cursor cursor
; /* cursor to be displayed (or None) */
282 } XSetWindowAttributes
;
285 int x
, y
; /* location of window */
286 int width
, height
; /* width and height of window */
287 int border_width
; /* border width of window */
288 int depth
; /* depth of window */
289 Visual
*visual
; /* the associated visual structure */
290 Window root
; /* root of screen containing window */
291 #if defined(__cplusplus) || defined(c_plusplus)
292 int c_class
; /* C++ InputOutput, InputOnly*/
294 int class; /* InputOutput, InputOnly*/
296 int bit_gravity
; /* one of bit gravity values */
297 int win_gravity
; /* one of the window gravity values */
298 int backing_store
; /* NotUseful, WhenMapped, Always */
299 unsigned long backing_planes
;/* planes to be preserved if possible */
300 unsigned long backing_pixel
;/* value to be used when restoring planes */
301 Bool save_under
; /* boolean, should bits under be saved? */
302 Colormap colormap
; /* color map to be associated with window */
303 Bool map_installed
; /* boolean, is color map currently installed*/
304 int map_state
; /* IsUnmapped, IsUnviewable, IsViewable */
305 long all_event_masks
; /* set of events all people have interest in*/
306 long your_event_mask
; /* my event mask */
307 long do_not_propagate_mask
; /* set of events that should not propagate */
308 Bool override_redirect
; /* boolean value for override-redirect */
309 Screen
*screen
; /* back pointer to correct screen */
313 * Data structure for host setting; getting routines.
318 int family
; /* for example FamilyInternet */
319 int length
; /* length of address, in bytes */
320 char *address
; /* pointer to where to find the bytes */
324 * Data structure for "image" data, used by image manipulation routines.
326 typedef struct _XImage
{
327 int width
, height
; /* size of image */
328 int xoffset
; /* number of pixels offset in X direction */
329 int format
; /* XYBitmap, XYPixmap, ZPixmap */
330 char *data
; /* pointer to image data */
331 int byte_order
; /* data byte order, LSBFirst, MSBFirst */
332 int bitmap_unit
; /* quant. of scanline 8, 16, 32 */
333 int bitmap_bit_order
; /* LSBFirst, MSBFirst */
334 int bitmap_pad
; /* 8, 16, 32 either XY or ZPixmap */
335 int depth
; /* depth of image */
336 int bytes_per_line
; /* accelarator to next line */
337 int bits_per_pixel
; /* bits per pixel (ZPixmap) */
338 unsigned long red_mask
; /* bits in z arrangment */
339 unsigned long green_mask
;
340 unsigned long blue_mask
;
341 XPointer obdata
; /* hook for the object routines to hang on */
342 struct funcs
{ /* image manipulation routines */
343 struct _XImage
*(*create_image
)();
344 #if NeedFunctionPrototypes
345 int (*destroy_image
) (struct _XImage
*);
346 unsigned long (*get_pixel
) (struct _XImage
*, int, int);
347 int (*put_pixel
) (struct _XImage
*, int, int, unsigned long);
348 struct _XImage
*(*sub_image
)(struct _XImage
*, int, int, unsigned int, unsigned int);
349 int (*add_pixel
) (struct _XImage
*, long);
351 int (*destroy_image
)();
352 unsigned long (*get_pixel
)();
354 struct _XImage
*(*sub_image
)();
361 * Data structure for XReconfigureWindow
372 * Data structure used by color operations
376 unsigned short red
, green
, blue
;
377 char flags
; /* do_red, do_green, do_blue */
382 * Data structures for graphics operations. On most machines, these are
383 * congruent with the wire protocol structures, so reformatting the data
384 * can be avoided on these architectures.
387 short x1
, y1
, x2
, y2
;
396 unsigned short width
, height
;
401 unsigned short width
, height
;
402 short angle1
, angle2
;
406 /* Data structure for XChangeKeyboardControl */
409 int key_click_percent
;
416 int auto_repeat_mode
; /* On, Off, Default */
419 /* Data structure for XGetKeyboardControl */
422 int key_click_percent
;
424 unsigned int bell_pitch
, bell_duration
;
425 unsigned long led_mask
;
426 int global_auto_repeat
;
427 char auto_repeats
[32];
430 /* Data structure for XGetMotionEvents. */
437 /* Data structure for X{Set,Get}ModifierMapping */
440 int max_keypermod
; /* The server's max # of keys per modifier */
441 KeyCode
*modifiermap
; /* An 8 by max_keypermod array of modifiers */
446 * Display datatype maintaining display specific data.
447 * The contents of this structure are implementation dependent.
448 * A Display should be treated as opaque by application code.
450 typedef struct _XDisplay
{
451 XExtData
*ext_data
; /* hook for extension to hang data */
452 struct _XFreeFuncs
*free_funcs
; /* internal free functions */
453 int fd
; /* Network socket. */
454 int conn_checker
; /* ugly thing used by _XEventsQueued */
455 int proto_major_version
;/* maj. version of server's X protocol */
456 int proto_minor_version
;/* minor version of servers X protocol */
457 char *vendor
; /* vendor of the server hardware */
458 XID resource_base
; /* resource ID base */
459 XID resource_mask
; /* resource ID mask bits */
460 XID resource_id
; /* allocator current ID */
461 int resource_shift
; /* allocator shift to correct bits */
462 XID (*resource_alloc
)(); /* allocator function */
463 int byte_order
; /* screen byte order, LSBFirst, MSBFirst */
464 int bitmap_unit
; /* padding and data requirements */
465 int bitmap_pad
; /* padding requirements on bitmaps */
466 int bitmap_bit_order
; /* LeastSignificant or MostSignificant */
467 int nformats
; /* number of pixmap formats in list */
468 ScreenFormat
*pixmap_format
; /* pixmap format list */
469 int vnumber
; /* Xlib's X protocol version number. */
470 int release
; /* release of the server */
471 struct _XSQEvent
*head
, *tail
; /* Input event queue. */
472 int qlen
; /* Length of input event queue */
473 unsigned long request
; /* sequence number of last request. */
474 char *last_req
; /* beginning of last request, or dummy */
475 char *buffer
; /* Output buffer starting address. */
476 char *bufptr
; /* Output buffer index pointer. */
477 char *bufmax
; /* Output buffer maximum+1 address. */
478 unsigned max_request_size
; /* maximum number 32 bit words in request*/
479 struct _XrmHashBucketRec
*db
;
480 int (*synchandler
)(); /* Synchronization handler */
481 char *display_name
; /* "host:display" string used on this connect*/
482 int default_screen
; /* default screen for operations */
483 int nscreens
; /* number of screens on this server*/
484 Screen
*screens
; /* pointer to list of screens */
485 unsigned long motion_buffer
; /* size of motion buffer */
486 unsigned long flags
; /* internal connection flags */
487 int min_keycode
; /* minimum defined keycode */
488 int max_keycode
; /* maximum defined keycode */
489 KeySym
*keysyms
; /* This server's keysyms */
490 XModifierKeymap
*modifiermap
; /* This server's modifier keymap */
491 int keysyms_per_keycode
;/* number of rows */
492 char *xdefaults
; /* contents of defaults from server */
493 char *scratch_buffer
; /* place to hang scratch buffer */
494 unsigned long scratch_length
; /* length of scratch buffer */
495 int ext_number
; /* extension number on this display */
496 struct _XExten
*ext_procs
; /* extensions initialized on this display */
498 * the following can be fixed size, as the protocol defines how
499 * much address space is available.
500 * While this could be done using the extension vector, there
501 * may be MANY events processed, so a search through the extension
502 * list to find the right procedure for each event might be
503 * expensive if many extensions are being used.
505 Bool (*event_vec
[128])(); /* vector for wire to event */
506 Status (*wire_vec
[128])(); /* vector for event to wire */
507 KeySym lock_meaning
; /* for XLookupString */
508 struct _XLockInfo
*lock
; /* multi-thread state, display lock */
509 struct _XInternalAsync
*async_handlers
; /* for internal async */
510 unsigned long bigreq_size
; /* max size of big requests */
511 struct _XLockPtrs
*lock_fns
; /* pointers to threads functions */
512 /* things above this line should not move, for binary compatibility */
513 struct _XKeytrans
*key_bindings
; /* for XLookupString */
514 Font cursor_font
; /* for XCreateFontCursor */
515 struct _XDisplayAtoms
*atoms
; /* for XInternAtom */
516 unsigned int mode_switch
; /* keyboard group modifiers */
517 struct _XContextDB
*context_db
; /* context database */
518 Bool (**error_vec
)(); /* vector for wire to error */
523 XPointer defaultCCCs
; /* pointer to an array of default XcmsCCC */
524 XPointer clientCmaps
; /* pointer to linked list of XcmsCmapRec */
525 XPointer perVisualIntensityMaps
;
526 /* linked list of XcmsIntensityMap */
528 struct _XIMFilter
*im_filters
;
529 struct _XSQEvent
*qfree
; /* unallocated event queue elements */
530 unsigned long next_event_serial_num
; /* inserted into next queue elt */
531 int (*savedsynchandler
)(); /* user synchandler when Xlib usurps */
534 #if NeedFunctionPrototypes /* prototypes require event type definitions */
539 #define XMaxTransChars 4
542 * Definitions of specific events.
545 int type
; /* of event */
546 unsigned long serial
; /* # of last request processed by server */
547 Bool send_event
; /* true if this came from a SendEvent request */
548 Display
*display
; /* Display the event was read from */
549 Window window
; /* "event" window it is reported relative to */
550 Window root
; /* root window that the event occured on */
551 Window subwindow
; /* child window */
552 Time time
; /* milliseconds */
553 int x
, y
; /* pointer x, y coordinates in event window */
554 int x_root
, y_root
; /* coordinates relative to root */
555 unsigned int state
; /* key or button mask */
556 unsigned int keycode
; /* detail */
557 Bool same_screen
; /* same screen flag */
558 char trans_chars
[XMaxTransChars
];
559 /* translated characters */
562 typedef XKeyEvent XKeyPressedEvent
;
563 typedef XKeyEvent XKeyReleasedEvent
;
566 int type
; /* of event */
567 unsigned long serial
; /* # of last request processed by server */
568 Bool send_event
; /* true if this came from a SendEvent request */
569 Display
*display
; /* Display the event was read from */
570 Window window
; /* "event" window it is reported relative to */
571 Window root
; /* root window that the event occured on */
572 Window subwindow
; /* child window */
573 Time time
; /* milliseconds */
574 int x
, y
; /* pointer x, y coordinates in event window */
575 int x_root
, y_root
; /* coordinates relative to root */
576 unsigned int state
; /* key or button mask */
577 unsigned int button
; /* detail */
578 Bool same_screen
; /* same screen flag */
580 typedef XButtonEvent XButtonPressedEvent
;
581 typedef XButtonEvent XButtonReleasedEvent
;
584 int type
; /* of event */
585 unsigned long serial
; /* # of last request processed by server */
586 Bool send_event
; /* true if this came from a SendEvent request */
587 Display
*display
; /* Display the event was read from */
588 Window window
; /* "event" window reported relative to */
589 Window root
; /* root window that the event occured on */
590 Window subwindow
; /* child window */
591 Time time
; /* milliseconds */
592 int x
, y
; /* pointer x, y coordinates in event window */
593 int x_root
, y_root
; /* coordinates relative to root */
594 unsigned int state
; /* key or button mask */
595 char is_hint
; /* detail */
596 Bool same_screen
; /* same screen flag */
598 typedef XMotionEvent XPointerMovedEvent
;
601 int type
; /* of event */
602 unsigned long serial
; /* # of last request processed by server */
603 Bool send_event
; /* true if this came from a SendEvent request */
604 Display
*display
; /* Display the event was read from */
605 Window window
; /* "event" window reported relative to */
606 Window root
; /* root window that the event occured on */
607 Window subwindow
; /* child window */
608 Time time
; /* milliseconds */
609 int x
, y
; /* pointer x, y coordinates in event window */
610 int x_root
, y_root
; /* coordinates relative to root */
611 int mode
; /* NotifyNormal, NotifyGrab, NotifyUngrab */
614 * NotifyAncestor, NotifyVirtual, NotifyInferior,
615 * NotifyNonlinear,NotifyNonlinearVirtual
617 Bool same_screen
; /* same screen flag */
618 Bool focus
; /* boolean focus */
619 unsigned int state
; /* key or button mask */
621 typedef XCrossingEvent XEnterWindowEvent
;
622 typedef XCrossingEvent XLeaveWindowEvent
;
625 int type
; /* FocusIn or FocusOut */
626 unsigned long serial
; /* # of last request processed by server */
627 Bool send_event
; /* true if this came from a SendEvent request */
628 Display
*display
; /* Display the event was read from */
629 Window window
; /* window of event */
630 int mode
; /* NotifyNormal, NotifyGrab, NotifyUngrab */
633 * NotifyAncestor, NotifyVirtual, NotifyInferior,
634 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
635 * NotifyPointerRoot, NotifyDetailNone
638 typedef XFocusChangeEvent XFocusInEvent
;
639 typedef XFocusChangeEvent XFocusOutEvent
;
641 /* generated on EnterWindow and FocusIn when KeyMapState selected */
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 */
653 unsigned long serial
; /* # of last request processed by server */
654 Bool send_event
; /* true if this came from a SendEvent request */
655 Display
*display
; /* Display the event was read from */
659 int count
; /* if non-zero, at least this many more */
664 unsigned long serial
; /* # of last request processed by server */
665 Bool send_event
; /* true if this came from a SendEvent request */
666 Display
*display
; /* Display the event was read from */
670 int count
; /* if non-zero, at least this many more */
671 int major_code
; /* core is CopyArea or CopyPlane */
672 int minor_code
; /* not defined in the core */
673 } XGraphicsExposeEvent
;
677 unsigned long serial
; /* # of last request processed by server */
678 Bool send_event
; /* true if this came from a SendEvent request */
679 Display
*display
; /* Display the event was read from */
681 int major_code
; /* core is CopyArea or CopyPlane */
682 int minor_code
; /* not defined in the core */
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 */
691 int state
; /* Visibility state */
696 unsigned long serial
; /* # of last request processed by server */
697 Bool send_event
; /* true if this came from a SendEvent request */
698 Display
*display
; /* Display the event was read from */
699 Window parent
; /* parent of the window */
700 Window window
; /* window id of window created */
701 int x
, y
; /* window location */
702 int width
, height
; /* size of window */
703 int border_width
; /* border width */
704 Bool override_redirect
; /* creation should be overridden */
705 } XCreateWindowEvent
;
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 */
714 } XDestroyWindowEvent
;
718 unsigned long serial
; /* # of last request processed by server */
719 Bool send_event
; /* true if this came from a SendEvent request */
720 Display
*display
; /* Display the event was read from */
728 unsigned long serial
; /* # of last request processed by server */
729 Bool send_event
; /* true if this came from a SendEvent request */
730 Display
*display
; /* Display the event was read from */
733 Bool override_redirect
; /* boolean, is override set... */
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 */
747 unsigned long serial
; /* # of last request processed by server */
748 Bool send_event
; /* true if this came from a SendEvent request */
749 Display
*display
; /* Display the event was read from */
754 Bool override_redirect
;
759 unsigned long serial
; /* # of last request processed by server */
760 Bool send_event
; /* true if this came from a SendEvent request */
761 Display
*display
; /* Display the event was read from */
768 Bool override_redirect
;
773 unsigned long serial
; /* # of last request processed by server */
774 Bool send_event
; /* true if this came from a SendEvent request */
775 Display
*display
; /* Display the event was read from */
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 */
788 } XResizeRequestEvent
;
792 unsigned long serial
; /* # of last request processed by server */
793 Bool send_event
; /* true if this came from a SendEvent request */
794 Display
*display
; /* Display the event was read from */
801 int detail
; /* Above, Below, TopIf, BottomIf, Opposite */
802 unsigned long value_mask
;
803 } XConfigureRequestEvent
;
807 unsigned long serial
; /* # of last request processed by server */
808 Bool send_event
; /* true if this came from a SendEvent request */
809 Display
*display
; /* Display the event was read from */
812 int place
; /* PlaceOnTop, PlaceOnBottom */
817 unsigned long serial
; /* # of last request processed by server */
818 Bool send_event
; /* true if this came from a SendEvent request */
819 Display
*display
; /* Display the event was read from */
822 int place
; /* PlaceOnTop, PlaceOnBottom */
823 } XCirculateRequestEvent
;
827 unsigned long serial
; /* # of last request processed by server */
828 Bool send_event
; /* true if this came from a SendEvent request */
829 Display
*display
; /* Display the event was read from */
833 int state
; /* NewValue, Deleted */
838 unsigned long serial
; /* # of last request processed by server */
839 Bool send_event
; /* true if this came from a SendEvent request */
840 Display
*display
; /* Display the event was read from */
844 } XSelectionClearEvent
;
848 unsigned long serial
; /* # of last request processed by server */
849 Bool send_event
; /* true if this came from a SendEvent request */
850 Display
*display
; /* Display the event was read from */
857 } XSelectionRequestEvent
;
861 unsigned long serial
; /* # of last request processed by server */
862 Bool send_event
; /* true if this came from a SendEvent request */
863 Display
*display
; /* Display the event was read from */
867 Atom property
; /* ATOM or None */
873 unsigned long serial
; /* # of last request processed by server */
874 Bool send_event
; /* true if this came from a SendEvent request */
875 Display
*display
; /* Display the event was read from */
877 Colormap colormap
; /* COLORMAP or None */
878 #if defined(__cplusplus) || defined(c_plusplus)
879 Bool c_new
; /* C++ */
883 int state
; /* ColormapInstalled, ColormapUninstalled */
888 unsigned long serial
; /* # of last request processed by server */
889 Bool send_event
; /* true if this came from a SendEvent request */
890 Display
*display
; /* Display the event was read from */
899 } XClientMessageEvent
;
903 unsigned long serial
; /* # of last request processed by server */
904 Bool send_event
; /* true if this came from a SendEvent request */
905 Display
*display
; /* Display the event was read from */
906 Window window
; /* unused */
907 int request
; /* one of MappingModifier, MappingKeyboard,
909 int first_keycode
; /* first keycode */
910 int count
; /* defines range of change w. first_keycode*/
915 Display
*display
; /* Display the event was read from */
916 XID resourceid
; /* resource id */
917 unsigned long serial
; /* serial number of failed request */
918 unsigned char error_code
; /* error code of failed request */
919 unsigned char request_code
; /* Major op-code of failed request */
920 unsigned char minor_code
; /* Minor op-code of failed request */
925 unsigned long serial
; /* # of last request processed by server */
926 Bool send_event
; /* true if this came from a SendEvent request */
927 Display
*display
;/* Display the event was read from */
928 Window window
; /* window on which event was requested in event mask */
932 * this union is defined so Xlib can always use the same sized
933 * event structure internally, to avoid memory fragmentation.
935 typedef union _XEvent
{
936 int type
; /* must not be changed; first element */
939 XButtonEvent xbutton
;
940 XMotionEvent xmotion
;
941 XCrossingEvent xcrossing
;
942 XFocusChangeEvent xfocus
;
943 XExposeEvent xexpose
;
944 XGraphicsExposeEvent xgraphicsexpose
;
945 XNoExposeEvent xnoexpose
;
946 XVisibilityEvent xvisibility
;
947 XCreateWindowEvent xcreatewindow
;
948 XDestroyWindowEvent xdestroywindow
;
951 XMapRequestEvent xmaprequest
;
952 XReparentEvent xreparent
;
953 XConfigureEvent xconfigure
;
954 XGravityEvent xgravity
;
955 XResizeRequestEvent xresizerequest
;
956 XConfigureRequestEvent xconfigurerequest
;
957 XCirculateEvent xcirculate
;
958 XCirculateRequestEvent xcirculaterequest
;
959 XPropertyEvent xproperty
;
960 XSelectionClearEvent xselectionclear
;
961 XSelectionRequestEvent xselectionrequest
;
962 XSelectionEvent xselection
;
963 XColormapEvent xcolormap
;
964 XClientMessageEvent xclient
;
965 XMappingEvent xmapping
;
967 XKeymapEvent xkeymap
;
972 #define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy)))
975 * per character font metric information.
978 short lbearing
; /* origin to left edge of raster */
979 short rbearing
; /* origin to right edge of raster */
980 short width
; /* advance to next char's origin */
981 short ascent
; /* baseline to top edge of raster */
982 short descent
; /* baseline to bottom edge of raster */
983 unsigned short attributes
; /* per char flags (not predefined) */
987 * To allow arbitrary information with fonts, there are additional properties
992 unsigned long card32
;
996 XExtData
*ext_data
; /* hook for extension to hang data */
997 Font fid
; /* Font id for this font */
998 unsigned direction
; /* hint about direction the font is painted */
999 unsigned min_char_or_byte2
;/* first character */
1000 unsigned max_char_or_byte2
;/* last character */
1001 unsigned min_byte1
; /* first row that exists */
1002 unsigned max_byte1
; /* last row that exists */
1003 Bool all_chars_exist
;/* flag if all characters have non-zero size*/
1004 unsigned default_char
; /* char to print for undefined character */
1005 int n_properties
; /* how many properties there are */
1006 XFontProp
*properties
; /* pointer to array of additional properties*/
1007 XCharStruct min_bounds
; /* minimum bounds over all existing char*/
1008 XCharStruct max_bounds
; /* maximum bounds over all existing char*/
1009 XCharStruct
*per_char
; /* first_char to last_char information */
1010 int ascent
; /* log. extent above baseline for spacing */
1011 int descent
; /* log. descent below baseline for spacing */
1015 * PolyText routines take these as arguments.
1018 char *chars
; /* pointer to string */
1019 int nchars
; /* number of characters */
1020 int delta
; /* delta between strings */
1021 Font font
; /* font to print it in, None don't change */
1024 typedef struct { /* normal 16 bit characters are two bytes */
1025 unsigned char byte1
;
1026 unsigned char byte2
;
1030 XChar2b
*chars
; /* two byte characters */
1031 int nchars
; /* number of characters */
1032 int delta
; /* delta between strings */
1033 Font font
; /* font to print it in, None don't change */
1037 typedef union { Display
*display
;
1041 ScreenFormat
*pixmap_format
;
1042 XFontStruct
*font
; } XEDataObject
;
1045 XRectangle max_ink_extent
;
1046 XRectangle max_logical_extent
;
1049 typedef struct _XFontSet
*XFontSet
;
1065 typedef void (*XIMProc
)();
1067 typedef struct _XIM
*XIM
;
1068 typedef struct _XIC
*XIC
;
1070 typedef unsigned long XIMStyle
;
1073 unsigned short count_styles
;
1074 XIMStyle
*supported_styles
;
1077 #define XIMPreeditArea 0x0001L
1078 #define XIMPreeditCallbacks 0x0002L
1079 #define XIMPreeditPosition 0x0004L
1080 #define XIMPreeditNothing 0x0008L
1081 #define XIMPreeditNone 0x0010L
1082 #define XIMStatusArea 0x0100L
1083 #define XIMStatusCallbacks 0x0200L
1084 #define XIMStatusNothing 0x0400L
1085 #define XIMStatusNone 0x0800L
1087 #define XNVaNestedList "XNVaNestedList"
1088 #define XNClientWindow "clientWindow"
1089 #define XNInputStyle "inputStyle"
1090 #define XNFocusWindow "focusWindow"
1091 #define XNResourceName "resourceName"
1092 #define XNResourceClass "resourceClass"
1093 #define XNGeometryCallback "geometryCallback"
1094 #define XNFilterEvents "filterEvents"
1095 #define XNPreeditStartCallback "preeditStartCallback"
1096 #define XNPreeditDoneCallback "preeditDoneCallback"
1097 #define XNPreeditDrawCallback "preeditDrawCallback"
1098 #define XNPreeditCaretCallback "preeditCaretCallback"
1099 #define XNPreeditAttributes "preeditAttributes"
1100 #define XNStatusStartCallback "statusStartCallback"
1101 #define XNStatusDoneCallback "statusDoneCallback"
1102 #define XNStatusDrawCallback "statusDrawCallback"
1103 #define XNStatusAttributes "statusAttributes"
1104 #define XNArea "area"
1105 #define XNAreaNeeded "areaNeeded"
1106 #define XNSpotLocation "spotLocation"
1107 #define XNColormap "colorMap"
1108 #define XNStdColormap "stdColorMap"
1109 #define XNForeground "foreground"
1110 #define XNBackground "background"
1111 #define XNBackgroundPixmap "backgroundPixmap"
1112 #define XNFontSet "fontSet"
1113 #define XNLineSpace "lineSpace"
1114 #define XNCursor "cursor"
1116 #define XBufferOverflow -1
1117 #define XLookupNone 1
1118 #define XLookupChars 2
1119 #define XLookupKeySym 3
1120 #define XLookupBoth 4
1122 #if NeedFunctionPrototypes
1123 typedef void *XVaNestedList
;
1125 typedef XPointer XVaNestedList
;
1129 XPointer client_data
;
1133 typedef unsigned long XIMFeedback
;
1135 #define XIMReverse 1
1136 #define XIMUnderline (1<<1)
1137 #define XIMHighlight (1<<2)
1138 #define XIMPrimary (1<<5)
1139 #define XIMSecondary (1<<6)
1140 #define XIMTertiary (1<<7)
1142 typedef struct _XIMText
{
1143 unsigned short length
;
1144 XIMFeedback
*feedback
;
1145 Bool encoding_is_wchar
;
1152 typedef struct _XIMPreeditDrawCallbackStruct
{
1153 int caret
; /* Cursor offset within pre-edit string */
1154 int chg_first
; /* Starting change position */
1155 int chg_length
; /* Length of the change in character count */
1157 } XIMPreeditDrawCallbackStruct
;
1160 XIMForwardChar
, XIMBackwardChar
,
1161 XIMForwardWord
, XIMBackwardWord
,
1162 XIMCaretUp
, XIMCaretDown
,
1163 XIMNextLine
, XIMPreviousLine
,
1164 XIMLineStart
, XIMLineEnd
,
1165 XIMAbsolutePosition
,
1167 } XIMCaretDirection
;
1170 XIMIsInvisible
, /* Disable caret feedback */
1171 XIMIsPrimary
, /* UI defined caret feedback */
1172 XIMIsSecondary
/* UI defined caret feedback */
1175 typedef struct _XIMPreeditCaretCallbackStruct
{
1176 int position
; /* Caret offset within pre-edit string */
1177 XIMCaretDirection direction
; /* Caret moves direction */
1178 XIMCaretStyle style
; /* Feedback of the caret */
1179 } XIMPreeditCaretCallbackStruct
;
1184 } XIMStatusDataType
;
1186 typedef struct _XIMStatusDrawCallbackStruct
{
1187 XIMStatusDataType type
;
1192 } XIMStatusDrawCallbackStruct
;
1194 typedef int (*XErrorHandler
) ( /* WARNING, this type not in Xlib spec */
1195 #if NeedFunctionPrototypes
1196 Display
* /* display */,
1197 XErrorEvent
* /* error_event */
1205 #include "tkIntXlibDecls.h"
1209 #if defined(MAC_TCL) || defined(MAC_OSX_TK)
1214 #endif /* _XLIB_H_ */