|
|
1.1 ! root 1: /* $Header: Xlib.h,v 11.133 87/09/12 02:35:11 rws Exp $ */ ! 2: /* ! 3: * Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology ! 4: * ! 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. ! 14: * ! 15: * The X Window System is a Trademark of MIT. ! 16: * ! 17: */ ! 18: ! 19: ! 20: /* ! 21: * Xlib.h - Header definition and support file for the C subroutine ! 22: * interface library (Xlib) to the X Window System Protocol (V11). ! 23: * Corresponds to the Beta test release. Structures and symbols ! 24: * starting with "_" are private to the library. ! 25: */ ! 26: #ifndef _XLIB_H_ ! 27: #define _XLIB_H_ ! 28: ! 29: #include <sys/types.h> ! 30: #include <X11/X.h> ! 31: ! 32: #define Bool int ! 33: #define Status int ! 34: #define True 1 ! 35: #define False 0 ! 36: ! 37: #define ConnectionNumber(dpy) ((dpy)->fd) ! 38: #define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root) ! 39: #define DefaultScreen(dpy) ((dpy)->default_screen) ! 40: #define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root) ! 41: #define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual) ! 42: #define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc) ! 43: #define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel) ! 44: #define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel) ! 45: #define AllPlanes (~0) ! 46: #define QLength(dpy) ((dpy)->qlen) ! 47: #define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width) ! 48: #define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height) ! 49: #define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth) ! 50: #define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight) ! 51: #define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth) ! 52: #define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries) ! 53: #define ScreenCount(dpy) ((dpy)->nscreens) ! 54: #define ServerVendor(dpy) ((dpy)->vendor) ! 55: #define ProtocolVersion(dpy) ((dpy)->proto_major_version) ! 56: #define ProtocolRevision(dpy) ((dpy)->proto_minor_version) ! 57: #define VendorRelease(dpy) ((dpy)->release) ! 58: #define DisplayString(dpy) ((dpy)->display_name) ! 59: #define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth) ! 60: #define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap) ! 61: #define BitmapUnit(dpy) ((dpy)->bitmap_unit) ! 62: #define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order) ! 63: #define BitmapPad(dpy) ((dpy)->bitmap_pad) ! 64: #define ImageByteOrder(dpy) ((dpy)->byte_order) ! 65: ! 66: /* macros for screen oriented applications (toolkit) */ ! 67: #define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)])) ! 68: #define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen])) ! 69: #define DisplayOfScreen(s) ((s)->display) ! 70: #define RootWindowOfScreen(s) ((s)->root) ! 71: #define BlackPixelOfScreen(s) ((s)->black_pixel) ! 72: #define WhitePixelOfScreen(s) ((s)->white_pixel) ! 73: #define DefaultColormapOfScreen(s)((s)->cmap) ! 74: #define DefaultDepthOfScreen(s) ((s)->root_depth) ! 75: #define DefaultGCOfScreen(s) ((s)->default_gc) ! 76: #define DefaultVisualOfScreen(s)((s)->root_visual) ! 77: #define WidthOfScreen(s) ((s)->width) ! 78: #define HeightOfScreen(s) ((s)->height) ! 79: #define WidthMMOfScreen(s) ((s)->mwidth) ! 80: #define HeightMMOfScreen(s) ((s)->mheight) ! 81: #define PlanesOfScreen(s) ((s)->root_depth) ! 82: #define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) ! 83: #define MinCmapsOfScreen(s) ((s)->min_maps) ! 84: #define MaxCmapsOfScreen(s) ((s)->max_maps) ! 85: #define DoesSaveUnders(s) ((s)->save_unders) ! 86: #define DoesBackingStore(s) ((s)->backing_store) ! 87: #define EventMaskOfScreen(s) ((s)->root_input_mask) ! 88: ! 89: /* ! 90: * Extensions need a way to hang private data on some structures. ! 91: */ ! 92: typedef struct _XExtData { ! 93: int number; /* number returned by XRegisterExtension */ ! 94: struct _XExtData *next; /* next item on list of data for structure */ ! 95: int (*free_private)(); /* called to free private storage */ ! 96: char *private_data; /* data private to this extension. */ ! 97: } XExtData; ! 98: ! 99: /* ! 100: * This file contains structures used by the extension mechanism. ! 101: */ ! 102: typedef struct { /* public to extension, cannot be changed */ ! 103: int extension; /* extension number */ ! 104: int major_opcode; /* major op-code assigned by server */ ! 105: int first_event; /* first event number for the extension */ ! 106: int first_error; /* first error number for the extension */ ! 107: } XExtCodes; ! 108: ! 109: /* ! 110: * This structure is private to the library. ! 111: */ ! 112: typedef struct _XExten { /* private to extension mechanism */ ! 113: struct _XExten *next; /* next in list */ ! 114: XExtCodes codes; /* public information, all extension told */ ! 115: int (*create_GC)(); /* routine to call when GC created */ ! 116: int (*copy_GC)(); /* routine to call when GC copied */ ! 117: int (*flush_GC)(); /* routine to call when GC flushed */ ! 118: int (*free_GC)(); /* routine to call when GC freed */ ! 119: int (*create_Font)(); /* routine to call when Font created */ ! 120: int (*free_Font)(); /* routine to call when Font freed */ ! 121: int (*close_display)(); /* routine to call when connection closed */ ! 122: int (*error)(); /* who to call when an error occurs */ ! 123: int (*error_string)(); /* routine to supply error string */ ! 124: } _XExtension; ! 125: ! 126: /* ! 127: * Data structure for setting graphics context. ! 128: */ ! 129: typedef struct { ! 130: int function; /* logical operation */ ! 131: unsigned long plane_mask;/* plane mask */ ! 132: unsigned long foreground;/* foreground pixel */ ! 133: unsigned long background;/* background pixel */ ! 134: int line_width; /* line width */ ! 135: int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ ! 136: int cap_style; /* CapNotLast, CapButt, ! 137: CapRound, CapProjecting */ ! 138: int join_style; /* JoinMiter, JoinRound, JoinBevel */ ! 139: int fill_style; /* FillSolid, FillTiled, ! 140: FillStippled, FillOpaeueStippled */ ! 141: int fill_rule; /* EvenOddRule, WindingRule */ ! 142: int arc_mode; /* ArcChord, ArcPieSlice */ ! 143: Pixmap tile; /* tile pixmap for tiling operations */ ! 144: Pixmap stipple; /* stipple 1 plane pixmap for stipping */ ! 145: int ts_x_origin; /* offset for tile or stipple operations */ ! 146: int ts_y_origin; ! 147: Font font; /* default text font for text operations */ ! 148: int subwindow_mode; /* ClipByChildren, IncludeInferiors */ ! 149: Bool graphics_exposures;/* boolean, should exposures be generated */ ! 150: int clip_x_origin; /* origin for clipping */ ! 151: int clip_y_origin; ! 152: Pixmap clip_mask; /* bitmap clipping; other calls for rects */ ! 153: int dash_offset; /* patterned/dashed line information */ ! 154: char dashes; ! 155: } XGCValues; ! 156: ! 157: /* ! 158: * Graphics context. All Xlib routines deal in this rather than ! 159: * in raw protocol GContext ID's. This is so that the library can keep ! 160: * a "shadow" set of values, and thus avoid passing values over the ! 161: * wire which are not in fact changing. ! 162: */ ! 163: ! 164: typedef struct _XGC { ! 165: XExtData *ext_data; /* hook for extension to hang data */ ! 166: GContext gid; /* protocol ID for graphics context */ ! 167: Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ ! 168: Bool dashes; /* boolean: TRUE if dash-list is really a list */ ! 169: unsigned long dirty;/* cache dirty bits */ ! 170: XGCValues values; /* shadow structure of values */ ! 171: } *GC; ! 172: ! 173: ! 174: /* ! 175: * Visual structure; contains information about colormapping possible. ! 176: */ ! 177: typedef struct { ! 178: XExtData *ext_data; /* hook for extension to hang data */ ! 179: VisualID visualid; /* visual id of this visual */ ! 180: int class; /* class of screen (monochrome, etc.) */ ! 181: unsigned long red_mask, green_mask, blue_mask; /* mask values */ ! 182: int bits_per_rgb; /* log base 2 of distinct color values */ ! 183: int map_entries; /* color map entries */ ! 184: } Visual; ! 185: ! 186: /* ! 187: * Depth structure; contains information for each possible depth. ! 188: */ ! 189: typedef struct { ! 190: int depth; /* this depth (Z) of the depth */ ! 191: int nvisuals; /* number of Visual types at this depth */ ! 192: Visual *visuals; /* list of visuals possible at this depth */ ! 193: } Depth; ! 194: ! 195: /* ! 196: * Information about the screen. ! 197: */ ! 198: typedef struct { ! 199: XExtData *ext_data; /* hook for extension to hang data */ ! 200: struct _XDisplay *display;/* back pointer to display structure */ ! 201: Window root; /* Root window id. */ ! 202: int width, height; /* width and height of screen */ ! 203: int mwidth, mheight; /* width and height of in millimeters */ ! 204: int ndepths; /* number of depths possible */ ! 205: Depth *depths; /* list of allowable depths on the screen */ ! 206: int root_depth; /* bits per pixel */ ! 207: Visual *root_visual; /* root visual */ ! 208: GC default_gc; /* GC for the root root visual */ ! 209: Colormap cmap; /* default color map */ ! 210: unsigned long white_pixel; ! 211: unsigned long black_pixel; /* White and Black pixel values */ ! 212: int max_maps, min_maps; /* max and min color maps */ ! 213: int backing_store; /* Never, WhenMapped, Always */ ! 214: Bool save_unders; ! 215: long root_input_mask; /* initial root input mask */ ! 216: } Screen; ! 217: ! 218: /* ! 219: * Format structure; describes ZFormat data the screen will understand. ! 220: */ ! 221: typedef struct { ! 222: XExtData *ext_data; /* hook for extension to hang data */ ! 223: int depth; /* depth of this image format */ ! 224: int bits_per_pixel; /* bits/pixel at this depth */ ! 225: int scanline_pad; /* scanline must padded to this multiple */ ! 226: } ScreenFormat; ! 227: ! 228: #ifndef _XSTRUCT_ /* hack to reduce symbol load in Xlib routines */ ! 229: /* ! 230: * Data structure for setting window attributes. ! 231: */ ! 232: typedef struct { ! 233: Pixmap background_pixmap; /* background or None or ParentRelative */ ! 234: unsigned long background_pixel; /* background pixel */ ! 235: Pixmap border_pixmap; /* border of the window */ ! 236: unsigned long border_pixel; /* border pixel value */ ! 237: int bit_gravity; /* one of bit gravity values */ ! 238: int win_gravity; /* one of the window gravity values */ ! 239: int backing_store; /* NotUseful, WhenMapped, Always */ ! 240: unsigned long backing_planes;/* planes to be preseved if possible */ ! 241: unsigned long backing_pixel;/* value to use in restoring planes */ ! 242: Bool save_under; /* should bits under be saved? (popups) */ ! 243: long event_mask; /* set of events that should be saved */ ! 244: long do_not_propagate_mask; /* set of events that should not propagate */ ! 245: Bool override_redirect; /* boolean value for override-redirect */ ! 246: Colormap colormap; /* color map to be associated with window */ ! 247: Cursor cursor; /* cursor to be displayed (or None) */ ! 248: } XSetWindowAttributes; ! 249: ! 250: typedef struct { ! 251: int x, y; /* location of window */ ! 252: int width, height; /* width and height of window */ ! 253: int border_width; /* border width of window */ ! 254: int depth; /* depth of window */ ! 255: Visual *visual; /* the associated visual structure */ ! 256: Window root; /* root of screen containing window */ ! 257: int class; /* InputOutput, InputOnly*/ ! 258: int bit_gravity; /* one of bit gravity values */ ! 259: int win_gravity; /* one of the window gravity values */ ! 260: int backing_store; /* NotUseful, WhenMapped, Always */ ! 261: unsigned long backing_planes;/* planes to be preserved if possible */ ! 262: unsigned long backing_pixel;/* value to be used when restoring planes */ ! 263: Bool save_under; /* boolean, should bits under be saved? */ ! 264: Colormap colormap; /* color map to be associated with window */ ! 265: Bool map_installed; /* boolean, is color map currently installed*/ ! 266: int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ ! 267: long all_event_masks; /* set of events all people have interest in*/ ! 268: long your_event_mask; /* my event mask */ ! 269: long do_not_propagate_mask; /* set of events that should not propagate */ ! 270: Bool override_redirect; /* boolean value for override-redirect */ ! 271: Screen *screen; /* back pointer to correct screen */ ! 272: } XWindowAttributes; ! 273: ! 274: /* ! 275: * Data structure for host setting; getting routines. ! 276: * ! 277: */ ! 278: ! 279: typedef struct { ! 280: int family; /* for example AF_DNET */ ! 281: int length; /* length of address, in bytes */ ! 282: char *address; /* pointer to where to find the bytes */ ! 283: } XHostAddress; ! 284: ! 285: /* ! 286: * Data structure for "image" data, used by image manipulation routines. ! 287: */ ! 288: typedef struct _XImage { ! 289: int width, height; /* size of image */ ! 290: int xoffset; /* number of pixels offset in X direction */ ! 291: int format; /* XYBitmap, XYPixmap, ZPixmap */ ! 292: char *data; /* pointer to image data */ ! 293: int byte_order; /* data byte order, LSBFirst, MSBFirst */ ! 294: int bitmap_unit; /* quant. of scanline 8, 16, 32 */ ! 295: int bitmap_bit_order; /* LSBFirst, MSBFirst */ ! 296: int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ ! 297: int depth; /* depth of image */ ! 298: int bytes_per_line; /* accelarator to next line */ ! 299: int bits_per_pixel; /* bits per pixel (ZPixmap) */ ! 300: unsigned long red_mask; /* bits in z arrangment */ ! 301: unsigned long green_mask; ! 302: unsigned long blue_mask; ! 303: char *obdata; /* hook for the object routines to hang on */ ! 304: struct funcs { /* image manipulation routines */ ! 305: struct _XImage *(*create_image)(); ! 306: int (*destroy_image)(); ! 307: unsigned long (*get_pixel)(); ! 308: int (*put_pixel)(); ! 309: struct _XImage *(*sub_image)(); ! 310: int (*add_pixel)(); ! 311: } f; ! 312: } XImage; ! 313: ! 314: /* ! 315: * Data structure for XReconfigureWindow ! 316: */ ! 317: typedef struct { ! 318: int x, y; ! 319: int width, height; ! 320: int border_width; ! 321: Window sibling; ! 322: int stack_mode; ! 323: } XWindowChanges; ! 324: ! 325: /* ! 326: * Data structure used by color operations ! 327: */ ! 328: typedef struct { ! 329: unsigned long pixel; ! 330: unsigned short red, green, blue; ! 331: char flags; /* do_red, do_green, do_blue */ ! 332: char pad; ! 333: } XColor; ! 334: ! 335: /* ! 336: * Data structures for graphics operations. On most machines, these are ! 337: * congruent with the wire protocol structures, so reformatting the data ! 338: * can be avoided on these architectures. ! 339: */ ! 340: typedef struct { ! 341: short x1, y1, x2, y2; ! 342: } XSegment; ! 343: ! 344: typedef struct { ! 345: short x, y; ! 346: } XPoint; ! 347: ! 348: typedef struct { ! 349: short x, y; ! 350: unsigned short width, height; ! 351: } XRectangle; ! 352: ! 353: typedef struct { ! 354: short x, y; ! 355: unsigned short width, height; ! 356: short angle1, angle2; ! 357: } XArc; ! 358: ! 359: ! 360: /* Data structure for XChangeKeyboardControl */ ! 361: ! 362: typedef struct { ! 363: int key_click_percent; ! 364: int bell_percent; ! 365: int bell_pitch; ! 366: int bell_duration; ! 367: int led; ! 368: int led_mode; ! 369: int key; ! 370: int auto_repeat_mode; /* On, Off, Default */ ! 371: } XKeyboardControl; ! 372: ! 373: /* Data structure for XGetKeyboardControl */ ! 374: ! 375: typedef struct { ! 376: int key_click_percent; ! 377: int bell_percent; ! 378: unsigned int bell_pitch, bell_duration; ! 379: unsigned long led_mask; ! 380: int global_auto_repeat; ! 381: char auto_repeats[32]; ! 382: } XKeyboardState; ! 383: ! 384: /* Data structure for XGetMotionEvents. */ ! 385: ! 386: typedef struct { ! 387: Time time; ! 388: unsigned short x, y; ! 389: } XTimeCoord; ! 390: ! 391: /* Data structure for X{Set,Get}ModifierMapping */ ! 392: ! 393: typedef struct { ! 394: int max_keypermod; /* The server's max # of keys per modifier */ ! 395: KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ ! 396: } XModifierKeymap; ! 397: ! 398: XModifierKeymap *XNewModifiermap(), ! 399: *XGetModifierMapping(), ! 400: *XDeleteModifiermapEntry(), ! 401: *XInsertModifiermapEntry(); ! 402: #endif /* _XSTRUCT_ */ ! 403: ! 404: /* ! 405: * Display datatype maintaining display specific data. ! 406: */ ! 407: typedef struct _XDisplay { ! 408: XExtData *ext_data; /* hook for extension to hang data */ ! 409: struct _XDisplay *next; /* next open Display on list */ ! 410: int fd; /* Network socket. */ ! 411: int lock; /* is someone in critical section? */ ! 412: int proto_major_version;/* maj. version of server's X protocol */ ! 413: int proto_minor_version;/* minor version of servers X protocol */ ! 414: char *vendor; /* vendor of the server hardware */ ! 415: long resource_base; /* resource ID base */ ! 416: long resource_mask; /* resource ID mask bits */ ! 417: long resource_id; /* allocator current ID */ ! 418: int resource_shift; /* allocator shift to correct bits */ ! 419: XID (*resource_alloc)(); /* allocator function */ ! 420: int byte_order; /* screen byte order, LSBFirst, MSBFirst */ ! 421: int bitmap_unit; /* padding and data requirements */ ! 422: int bitmap_pad; /* padding requirements on bitmaps */ ! 423: int bitmap_bit_order; /* LeastSignificant or MostSignificant */ ! 424: int nformats; /* number of pixmap formats in list */ ! 425: ScreenFormat *pixmap_format; /* pixmap format list */ ! 426: int vnumber; /* Xlib's X protocol version number. */ ! 427: int release; /* release of the server */ ! 428: struct _XSQEvent *head, *tail; /* Input event queue. */ ! 429: int qlen; /* Length of input event queue */ ! 430: int last_request_read; /* sequence number of last event read NI */ ! 431: int request; /* sequence number of last request. */ ! 432: char *last_req; /* beginning of last request, or dummy */ ! 433: char *buffer; /* Output buffer starting address. */ ! 434: char *bufptr; /* Output buffer index pointer. */ ! 435: char *bufmax; /* Output buffer maximum+1 address. */ ! 436: unsigned max_request_size; /* maximum number 32 bit words in request*/ ! 437: struct _XrmResourceDataBase *db; ! 438: int (*synchandler)(); /* Synchronization handler */ ! 439: char *display_name; /* "host:display" string used on this connect*/ ! 440: int default_screen; /* default screen for operations */ ! 441: int nscreens; /* number of screens on this server*/ ! 442: Screen *screens; /* pointer to list of screens */ ! 443: int motion_buffer; /* size of motion buffer */ ! 444: Window current; /* for use internally for Keymap notify */ ! 445: int min_keycode; /* minimum defined keycode */ ! 446: int max_keycode; /* maximum defined keycode */ ! 447: KeySym *keysyms; /* This server's keysyms */ ! 448: XModifierKeymap *modifiermap; /* This server's modifier keymap */ ! 449: int keysyms_per_keycode;/* number of rows */ ! 450: char *xdefaults; /* contents of defaults from server */ ! 451: char *scratch_buffer; /* place to hang scratch buffer */ ! 452: unsigned long scratch_length; /* length of scratch buffer */ ! 453: int ext_number; /* extension number on this display */ ! 454: _XExtension *ext_procs; /* extensions initialized on this display */ ! 455: /* ! 456: * the following can be fixed size, as the protocol defines how ! 457: * much address space is available. ! 458: * While this could be done using the extension vector, there ! 459: * may be MANY events processed, so a search through the extension ! 460: * list to find the right procedure for each event might be ! 461: * expensive if many extensions are being used. ! 462: */ ! 463: int (*event_vec[128])();/* vector for wire to event */ ! 464: int (*wire_vec[128])(); /* vector for event to wire */ ! 465: } Display; ! 466: ! 467: #ifndef _XEVENT_ ! 468: /* ! 469: * A "XEvent" structure always has type as the first entry. This ! 470: * uniquely identifies what kind of event it is. The second entry ! 471: * is always a pointer to the display the event was read from. ! 472: * The third entry is always a window of one type or another, ! 473: * carefully selected to be useful to toolkit dispatchers. (Except ! 474: * for keymap events, which have no window.) You ! 475: * must not change the order of the three elements or toolkits will ! 476: * break! The pointer to the generic event must be cast before use to ! 477: * access any other information in the structure. ! 478: */ ! 479: ! 480: /* ! 481: * Definitions of specific events. If new event types are defined here in ! 482: * the future, the Xlibint.h file union for XBiggestEvent should also have ! 483: * the event type added, to make sure that Xlib maintains enough space for ! 484: * the largest event. We are trying to avoid fragmentation of the malloc ! 485: * pool by keeping the space allocated the same size for all events, even ! 486: * if the actual information is much smaller. ! 487: */ ! 488: typedef struct { ! 489: int type; /* of event */ ! 490: Display *display; /* Display the event was read from */ ! 491: Window window; /* "event" window it is reported relative to */ ! 492: Window root; /* root window that the event occured on */ ! 493: Window subwindow; /* child window */ ! 494: Time time; /* milliseconds */ ! 495: int x, y; /* pointer x, y coordinates in event window */ ! 496: int x_root, y_root; /* coordinates relative to root */ ! 497: unsigned int state; /* key or button mask */ ! 498: unsigned int keycode; /* detail */ ! 499: Bool same_screen; /* same screen flag */ ! 500: } XKeyEvent; ! 501: typedef XKeyEvent XKeyPressedEvent; ! 502: typedef XKeyEvent XKeyReleasedEvent; ! 503: ! 504: typedef struct { ! 505: int type; /* of event */ ! 506: Display *display; /* Display the event was read from */ ! 507: Window window; /* "event" window it is reported relative to */ ! 508: Window root; /* root window that the event occured on */ ! 509: Window subwindow; /* child window */ ! 510: Time time; /* milliseconds */ ! 511: int x, y; /* pointer x, y coordinates in event window */ ! 512: int x_root, y_root; /* coordinates relative to root */ ! 513: unsigned int state; /* key or button mask */ ! 514: unsigned int button; /* detail */ ! 515: Bool same_screen; /* same screen flag */ ! 516: } XButtonEvent; ! 517: typedef XButtonEvent XButtonPressedEvent; ! 518: typedef XButtonEvent XButtonReleasedEvent; ! 519: ! 520: typedef struct { ! 521: int type; /* of event */ ! 522: Display *display; /* Display the event was read from */ ! 523: Window window; /* "event" window reported relative to */ ! 524: Window root; /* root window that the event occured on */ ! 525: Window subwindow; /* child window */ ! 526: Time time; /* milliseconds */ ! 527: int x, y; /* pointer x, y coordinates in event window */ ! 528: int x_root, y_root; /* coordinates relative to root */ ! 529: unsigned int state; /* key or button mask */ ! 530: char is_hint; /* detail */ ! 531: Bool same_screen; /* same screen flag */ ! 532: } XMotionEvent; ! 533: typedef XMotionEvent XPointerMovedEvent; ! 534: ! 535: typedef struct { ! 536: int type; /* of event */ ! 537: Display *display; /* Display the event was read from */ ! 538: Window window; /* "event" window reported relative to */ ! 539: Window root; /* root window that the event occured on */ ! 540: Window subwindow; /* child window */ ! 541: Time time; /* milliseconds */ ! 542: int x, y; /* pointer x, y coordinates in event window */ ! 543: int x_root, y_root; /* coordinates relative to root */ ! 544: int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ ! 545: int detail; ! 546: /* ! 547: * NotifyAncestor, NotifyVirtual, NotifyInferior, ! 548: * NotifyNonLinear,NotifyNonLinearVirtual ! 549: */ ! 550: Bool same_screen; /* same screen flag */ ! 551: Bool focus; /* boolean focus */ ! 552: unsigned int state; /* key or button mask */ ! 553: } XCrossingEvent; ! 554: typedef XCrossingEvent XEnterWindowEvent; ! 555: typedef XCrossingEvent XLeaveWindowEvent; ! 556: ! 557: typedef struct { ! 558: int type; /* FocusIn or FocusOut */ ! 559: Display *display; /* Display the event was read from */ ! 560: Window window; /* window of event */ ! 561: int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ ! 562: int detail; ! 563: /* ! 564: * NotifyAncestor, NotifyVirtual, NotifyInferior, ! 565: * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer, ! 566: * NotifyPointerRoot, NotifyDetailNone ! 567: */ ! 568: } XFocusChangeEvent; ! 569: typedef XFocusChangeEvent XFocusInEvent; ! 570: typedef XFocusChangeEvent XFocusOutEvent; ! 571: ! 572: /* generated on EnterWindow and FocusIn when KeyMapState selected */ ! 573: typedef struct { ! 574: int type; ! 575: Display *display; /* Display the event was read from */ ! 576: Window window; ! 577: char key_vector[32]; ! 578: } XKeymapEvent; ! 579: ! 580: typedef struct { ! 581: int type; ! 582: Display *display; /* Display the event was read from */ ! 583: Window window; ! 584: int x, y; ! 585: int width, height; ! 586: int count; /* if non-zero, at least this many more */ ! 587: } XExposeEvent; ! 588: ! 589: typedef struct { ! 590: int type; ! 591: Display *display; /* Display the event was read from */ ! 592: Drawable drawable; ! 593: int x, y; ! 594: int width, height; ! 595: int count; /* if non-zero, at least this many more */ ! 596: int major_code; /* core is CopyArea or CopyPlane */ ! 597: int minor_code; /* not defined in the core */ ! 598: } XGraphicsExposeEvent; ! 599: ! 600: typedef struct { ! 601: int type; ! 602: Display *display; /* Display the event was read from */ ! 603: Drawable drawable; ! 604: int major_code; /* core is CopyArea or CopyPlane */ ! 605: int minor_code; /* not defined in the core */ ! 606: } XNoExposeEvent; ! 607: ! 608: typedef struct { ! 609: int type; ! 610: Display *display; /* Display the event was read from */ ! 611: Window window; ! 612: int state; /* either Obscured or UnObscured */ ! 613: } XVisibilityEvent; ! 614: ! 615: typedef struct { ! 616: int type; ! 617: Display *display; /* Display the event was read from */ ! 618: Window parent; /* parent of the window */ ! 619: Window window; /* window id of window created */ ! 620: int x, y; /* window location */ ! 621: int width, height; /* size of window */ ! 622: int border_width; /* border width */ ! 623: Bool override_redirect; /* creation should be overridden */ ! 624: } XCreateWindowEvent; ! 625: ! 626: typedef struct { ! 627: int type; ! 628: Display *display; /* Display the event was read from */ ! 629: Window event; ! 630: Window window; ! 631: } XDestroyWindowEvent; ! 632: ! 633: typedef struct { ! 634: int type; ! 635: Display *display; /* Display the event was read from */ ! 636: Window event; ! 637: Window window; ! 638: Bool from_configure; ! 639: } XUnmapEvent; ! 640: ! 641: typedef struct { ! 642: int type; ! 643: Display *display; /* Display the event was read from */ ! 644: Window event; ! 645: Window window; ! 646: Bool override_redirect; /* boolean, is override set... */ ! 647: } XMapEvent; ! 648: ! 649: typedef struct { ! 650: int type; ! 651: Display *display; /* Display the event was read from */ ! 652: Window parent; ! 653: Window window; ! 654: } XMapRequestEvent; ! 655: ! 656: typedef struct { ! 657: int type; ! 658: Display *display; /* Display the event was read from */ ! 659: Window event; ! 660: Window window; ! 661: Window parent; ! 662: int x, y; ! 663: Bool override_redirect; ! 664: } XReparentEvent; ! 665: ! 666: typedef struct { ! 667: int type; ! 668: Display *display; /* Display the event was read from */ ! 669: Window event; ! 670: Window window; ! 671: int x, y; ! 672: int width, height; ! 673: int border_width; ! 674: Window above; ! 675: Bool override_redirect; ! 676: } XConfigureEvent; ! 677: ! 678: typedef struct { ! 679: int type; ! 680: Display *display; /* Display the event was read from */ ! 681: Window event; ! 682: Window window; ! 683: int x, y; ! 684: } XGravityEvent; ! 685: ! 686: typedef struct { ! 687: int type; ! 688: Display *display; /* Display the event was read from */ ! 689: Window window; ! 690: int width, height; ! 691: } XResizeRequestEvent; ! 692: ! 693: typedef struct { ! 694: int type; ! 695: Display *display; /* Display the event was read from */ ! 696: Window parent; ! 697: Window window; ! 698: int x, y; ! 699: int width, height; ! 700: int border_width; ! 701: Window above; ! 702: int detail; /* Above, Below, TopIf, BottomIf, Opposite */ ! 703: unsigned long value_mask; ! 704: } XConfigureRequestEvent; ! 705: ! 706: typedef struct { ! 707: int type; ! 708: Display *display; /* Display the event was read from */ ! 709: Window event; ! 710: Window window; ! 711: int place; /* PlaceOnTop, PlaceOnBottom */ ! 712: } XCirculateEvent; ! 713: ! 714: typedef struct { ! 715: int type; ! 716: Display *display; /* Display the event was read from */ ! 717: Window parent; ! 718: Window window; ! 719: int place; /* PlaceOnTop, PlaceOnBottom */ ! 720: } XCirculateRequestEvent; ! 721: ! 722: typedef struct { ! 723: int type; ! 724: Display *display; /* Display the event was read from */ ! 725: Window window; ! 726: Atom atom; ! 727: Time time; ! 728: int state; /* NewValue, Deleted */ ! 729: } XPropertyEvent; ! 730: ! 731: typedef struct { ! 732: int type; ! 733: Display *display; /* Display the event was read from */ ! 734: Window window; ! 735: Atom selection; ! 736: Time time; ! 737: } XSelectionClearEvent; ! 738: ! 739: typedef struct { ! 740: int type; ! 741: Display *display; /* Display the event was read from */ ! 742: Window owner; /* must be next after type */ ! 743: Window requestor; ! 744: Atom selection; ! 745: Atom target; ! 746: Atom property; ! 747: Time time; ! 748: } XSelectionRequestEvent; ! 749: ! 750: typedef struct { ! 751: int type; ! 752: Display *display; /* Display the event was read from */ ! 753: Window requestor; /* must be next after type */ ! 754: Atom selection; ! 755: Atom target; ! 756: Atom property; /* ATOM or None */ ! 757: Time time; ! 758: } XSelectionEvent; ! 759: ! 760: typedef struct { ! 761: int type; ! 762: Display *display; /* Display the event was read from */ ! 763: Window window; ! 764: Colormap colormap; /* COLORMAP or None */ ! 765: Bool new; ! 766: int state; /* ColormapInstalled, ColormapUninstalled */ ! 767: } XColormapEvent; ! 768: ! 769: typedef struct { ! 770: int type; ! 771: Display *display; /* Display the event was read from */ ! 772: Window window; ! 773: Atom message_type; ! 774: int format; ! 775: union { ! 776: char b[20]; ! 777: short s[10]; ! 778: int l[5]; ! 779: } data; ! 780: } XClientMessageEvent; ! 781: ! 782: typedef struct { ! 783: int type; ! 784: Display *display; /* Display the event was read from */ ! 785: Window window; /* unused */ ! 786: int request; /* one of MappingModifier, MappingKeyboard, ! 787: MappingPointer */ ! 788: int first_keycode; /* first keycode */ ! 789: int count; /* defines range of change w. first_keycode*/ ! 790: } XMappingEvent; ! 791: ! 792: typedef struct { ! 793: int type; ! 794: Display *display; /* Display the event was read from */ ! 795: XID resourceid; /* resource id */ ! 796: int serial; /* serial number of failed request */ ! 797: char error_code; /* error code of failed request */ ! 798: char request_code; /* Major op-code of failed request */ ! 799: char minor_code; /* Minor op-code of failed request */ ! 800: } XErrorEvent; ! 801: ! 802: typedef struct { ! 803: int type; ! 804: Display *display;/* Display the event was read from */ ! 805: Window window; /* window on which event was requested in event mask */ ! 806: } XAnyEvent; ! 807: ! 808: /* ! 809: * this union is defined so Xlib can always use the same sized ! 810: * event structure internally, to avoid memory fragmentation. ! 811: */ ! 812: typedef union _XEvent { ! 813: int type; /* must not be changed; first element */ ! 814: XAnyEvent xany; ! 815: XKeyEvent xkey; ! 816: XButtonEvent xbutton; ! 817: XMotionEvent xmotion; ! 818: XCrossingEvent xcrossing; ! 819: XFocusChangeEvent xfocus; ! 820: XExposeEvent xexpose; ! 821: XGraphicsExposeEvent xgraphicsexpose; ! 822: XNoExposeEvent xnoexpose; ! 823: XVisibilityEvent xvisibility; ! 824: XCreateWindowEvent xcreatewindow; ! 825: XDestroyWindowEvent xdestroywindow; ! 826: XUnmapEvent xunmap; ! 827: XMapEvent xmap; ! 828: XMapRequestEvent xmaprequest; ! 829: XReparentEvent xreparent; ! 830: XConfigureEvent xconfigure; ! 831: XGravityEvent xgravity; ! 832: XResizeRequestEvent xresizerequest; ! 833: XConfigureRequestEvent xconfigurerequest; ! 834: XCirculateEvent xcirculate; ! 835: XCirculateRequestEvent xcirculaterequest; ! 836: XPropertyEvent xproperty; ! 837: XSelectionClearEvent xselectionclear; ! 838: XSelectionRequestEvent xselectionrequest; ! 839: XSelectionEvent xselection; ! 840: XColormapEvent xcolormap; ! 841: XClientMessageEvent xclient; ! 842: XMappingEvent xmapping; ! 843: XErrorEvent xerror; ! 844: XKeymapEvent xkeymap; ! 845: } XEvent; ! 846: /* ! 847: * _QEvent datatype for use in input queueing. ! 848: */ ! 849: typedef struct _XSQEvent { ! 850: struct _XSQEvent *next; ! 851: XEvent event; ! 852: } _XQEvent; ! 853: #endif ! 854: #define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy))) ! 855: #ifndef _XSTRUCT_ ! 856: ! 857: /* ! 858: * per character font metric information. ! 859: */ ! 860: typedef struct { ! 861: short lbearing; /* origin to left edge of raster */ ! 862: short rbearing; /* origin to right edge of raster */ ! 863: short width; /* advance to next char's origin */ ! 864: short ascent; /* baseline to top edge of raster */ ! 865: short descent; /* baseline to bottom edge of raster */ ! 866: unsigned short attributes; /* per char flags (not predefined) */ ! 867: } XCharStruct; ! 868: ! 869: /* ! 870: * To allow arbitrary information with fonts, there are additional properties ! 871: * returned. ! 872: */ ! 873: typedef struct { ! 874: Atom name; ! 875: unsigned long card32; ! 876: } XFontProp; ! 877: ! 878: typedef struct { ! 879: XExtData *ext_data; /* hook for extension to hang data */ ! 880: Font fid; /* Font id for this font */ ! 881: unsigned direction; /* hint about direction the font is painted */ ! 882: unsigned min_char_or_byte2;/* first character */ ! 883: unsigned max_char_or_byte2;/* last character */ ! 884: unsigned min_byte1; /* first row that exists */ ! 885: unsigned max_byte1; /* last row that exists */ ! 886: Bool all_chars_exist;/* flag if all characters have non-zero size*/ ! 887: unsigned default_char; /* char to print for undefined character */ ! 888: int n_properties; /* how many properties there are */ ! 889: XFontProp *properties; /* pointer to array of additional properties*/ ! 890: XCharStruct min_bounds; /* minimum bounds over all existing char*/ ! 891: XCharStruct max_bounds; /* minimum bounds over all existing char*/ ! 892: XCharStruct *per_char; /* first_char to last_char information */ ! 893: int ascent; /* log. extent above baseline for spacing */ ! 894: int descent; /* log. descent below baseline for spacing */ ! 895: } XFontStruct; ! 896: ! 897: /* ! 898: * PolyText routines take these as arguments. ! 899: */ ! 900: typedef struct { ! 901: char *chars; /* pointer to string */ ! 902: int nchars; /* number of characters */ ! 903: int delta; /* delta between strings */ ! 904: Font font; /* font to print it in, None don't change */ ! 905: } XTextItem; ! 906: ! 907: typedef struct { /* normal 16 bit characters are two bytes */ ! 908: unsigned char byte1; ! 909: unsigned char byte2; ! 910: } XChar2b; ! 911: ! 912: typedef struct { ! 913: XChar2b *chars; /* two byte characters */ ! 914: int nchars; /* number of characters */ ! 915: int delta; /* delta between strings */ ! 916: Font font; /* font to print it in, None don't change */ ! 917: } XTextItem16; ! 918: ! 919: ! 920: XFontStruct *XLoadQueryFont(), *XQueryFont(); ! 921: ! 922: XTimeCoord *XGetMotionEvents(); ! 923: #endif ! 924: /* ! 925: * X function declarations. ! 926: */ ! 927: Display *XOpenDisplay(); ! 928: ! 929: char *XFetchBytes(); ! 930: char *XFetchBuffer(); ! 931: char *XGetAtomName(); ! 932: char *XGetDefault(); ! 933: char *XDisplayName(); ! 934: char *XKeysymToString(); ! 935: ! 936: int (*XSynchronize())(); ! 937: int (*XSetAfterFunction())(); ! 938: Atom XInternAtom(); ! 939: Colormap XCopyColormapAndFree(), XCreateColormap(); ! 940: Cursor XCreatePixmapCursor(), XCreateGlyphCursor(), XCreateFontCursor(); ! 941: Font XLoadFont(); ! 942: GC XCreateGC(); ! 943: GContext XGContextFromGC(); ! 944: Pixmap XCreatePixmap(); ! 945: Pixmap XCreateBitmapFromData(); ! 946: Window XCreateSimpleWindow(), XGetSelectionOwner(), XGetIconWindow(); ! 947: Window XCreateWindow(); ! 948: Colormap *XListInstalledColormaps(); ! 949: char **XListFonts(), **XListFontsWithInfo(), **XGetFontPath(); ! 950: char **XListExtensions(); ! 951: Atom *XListProperties(); ! 952: XImage *XCreateImage(), *XGetImage(); ! 953: XHostAddress *XListHosts(); ! 954: KeySym XKeycodeToKeysym(), XLookupKeysym(), *XGetKeyboardMapping(); ! 955: KeySym XStringToKeysym(); ! 956: ! 957: /* routines for dealing with extensions */ ! 958: XExtCodes *XInitExtension(); ! 959: int (*XESetCreateGC())(), (*XESetCopyGC())(), (*XESetFlushGC())(), ! 960: (*XESetFreeGC())(), (*XESetCreateFont())(), (*XESetFreeFont())(), ! 961: (*XESetCloseDisplay())(), (*XESetWireToEvent())(), (*XESetEventToWire())(), ! 962: (*XESetError())(), (*XESetErrorString())(); ! 963: ! 964: /* these are routines for which there are also macros */ ! 965: Window XRootWindow(), XDefaultRootWindow(), XRootWindowOfScreen(); ! 966: Visual *XDefaultVisual(), *XDefaultVisualOfScreen(); ! 967: GC XDefaultGC(), XDefaultGCofScreen(); ! 968: unsigned long XBlackPixel(), XWhitePixel(), XAllPlanes(); ! 969: unsigned long XBlackPixelOfScreen(), XWhitePixelOfScreen(); ! 970: char *XServerVendor(), *XDisplayString(); ! 971: Colormap XDefaultColormap(), XDefaultColormapOfScreen(); ! 972: Display *XDisplayOfScreen(); ! 973: Screen *XScreenOfDisplay(), *XDefaultScreenOfDisplay(); ! 974: long XEventMaskOfScreen(); ! 975: #endif /* _XLIB_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.