diff options
Diffstat (limited to 'libX11')
-rw-r--r-- | libX11/include/X11/Xlib.h | 8046 | ||||
-rw-r--r-- | libX11/man/XInternAtom.man | 558 | ||||
-rw-r--r-- | libX11/specs/libX11/CH04.xml | 5020 | ||||
-rw-r--r-- | libX11/src/IntAtom.c | 594 |
4 files changed, 7109 insertions, 7109 deletions
diff --git a/libX11/include/X11/Xlib.h b/libX11/include/X11/Xlib.h index e6cd7471b..b32390894 100644 --- a/libX11/include/X11/Xlib.h +++ b/libX11/include/X11/Xlib.h @@ -1,4023 +1,4023 @@ -/*
-
-Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-
-
-/*
- * Xlib.h - Header definition and support file for the C subroutine
- * interface library (Xlib) to the X Window System Protocol (V11).
- * Structures and symbols starting with "_" are private to the library.
- */
-#ifndef _X11_XLIB_H_
-#define _X11_XLIB_H_
-
-#define XlibSpecificationRelease 6
-
-#include <sys/types.h>
-
-#if defined(__SCO__) || defined(__UNIXWARE__)
-#include <stdint.h>
-#endif
-
-#include <X11/X.h>
-
-/* applications should not depend on these two headers being included! */
-#include <X11/Xfuncproto.h>
-#include <X11/Xosdefs.h>
-
-#ifndef X_WCHAR
-#include <stddef.h>
-#else
-#ifdef __UNIXOS2__
-#include <stdlib.h>
-#else
-/* replace this with #include or typedef appropriate for your system */
-typedef unsigned long wchar_t;
-#endif
-#endif
-
-#if defined(ISC) && defined(USE_XMBTOWC)
-#define wctomb(a,b) _Xwctomb(a,b)
-#define mblen(a,b) _Xmblen(a,b)
-#ifndef USE_XWCHAR_STRING
-#define mbtowc(a,b,c) _Xmbtowc(a,b,c)
-#endif
-#endif
-
-extern int
-_Xmblen(
-#ifdef ISC
- char const *str,
- size_t len
-#else
- char *str,
- int len
-#endif
- );
-
-/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
- November 2000. Its presence is indicated through the following macro. */
-#define X_HAVE_UTF8_STRING 1
-
-typedef char *XPointer;
-
-typedef int Bool;
-typedef int Status;
-#define True 1
-#define False 0
-
-#define QueuedAlready 0
-#define QueuedAfterReading 1
-#define QueuedAfterFlush 2
-
-#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd)
-#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root)
-#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen)
-#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
-#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
-#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc)
-#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel)
-#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel)
-#define AllPlanes ((unsigned long)~0L)
-#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen)
-#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width)
-#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
-#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
-#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
-#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
-#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries)
-#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens)
-#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor)
-#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version)
-#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version)
-#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release)
-#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name)
-#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
-#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
-#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit)
-#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order)
-#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad)
-#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order)
-#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */
-#define NextRequest(dpy) XNextRequest(dpy)
-#else
-#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1)
-#endif
-#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read)
-
-/* macros for screen oriented applications (toolkit) */
-#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
-#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
-#define DisplayOfScreen(s) ((s)->display)
-#define RootWindowOfScreen(s) ((s)->root)
-#define BlackPixelOfScreen(s) ((s)->black_pixel)
-#define WhitePixelOfScreen(s) ((s)->white_pixel)
-#define DefaultColormapOfScreen(s)((s)->cmap)
-#define DefaultDepthOfScreen(s) ((s)->root_depth)
-#define DefaultGCOfScreen(s) ((s)->default_gc)
-#define DefaultVisualOfScreen(s)((s)->root_visual)
-#define WidthOfScreen(s) ((s)->width)
-#define HeightOfScreen(s) ((s)->height)
-#define WidthMMOfScreen(s) ((s)->mwidth)
-#define HeightMMOfScreen(s) ((s)->mheight)
-#define PlanesOfScreen(s) ((s)->root_depth)
-#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries)
-#define MinCmapsOfScreen(s) ((s)->min_maps)
-#define MaxCmapsOfScreen(s) ((s)->max_maps)
-#define DoesSaveUnders(s) ((s)->save_unders)
-#define DoesBackingStore(s) ((s)->backing_store)
-#define EventMaskOfScreen(s) ((s)->root_input_mask)
-
-/*
- * Extensions need a way to hang private data on some structures.
- */
-typedef struct _XExtData {
- int number; /* number returned by XRegisterExtension */
- struct _XExtData *next; /* next item on list of data for structure */
- int (*free_private)( /* called to free private storage */
- struct _XExtData *extension
- );
- XPointer private_data; /* data private to this extension. */
-} XExtData;
-
-/*
- * This file contains structures used by the extension mechanism.
- */
-typedef struct { /* public to extension, cannot be changed */
- int extension; /* extension number */
- int major_opcode; /* major op-code assigned by server */
- int first_event; /* first event number for the extension */
- int first_error; /* first error number for the extension */
-} XExtCodes;
-
-/*
- * Data structure for retrieving info about pixmap formats.
- */
-
-typedef struct {
- int depth;
- int bits_per_pixel;
- int scanline_pad;
-} XPixmapFormatValues;
-
-
-/*
- * Data structure for setting graphics context.
- */
-typedef struct {
- int function; /* logical operation */
- unsigned long plane_mask;/* plane mask */
- unsigned long foreground;/* foreground pixel */
- unsigned long background;/* background pixel */
- int line_width; /* line width */
- int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
- int cap_style; /* CapNotLast, CapButt,
- CapRound, CapProjecting */
- int join_style; /* JoinMiter, JoinRound, JoinBevel */
- int fill_style; /* FillSolid, FillTiled,
- FillStippled, FillOpaeueStippled */
- int fill_rule; /* EvenOddRule, WindingRule */
- int arc_mode; /* ArcChord, ArcPieSlice */
- Pixmap tile; /* tile pixmap for tiling operations */
- Pixmap stipple; /* stipple 1 plane pixmap for stipping */
- int ts_x_origin; /* offset for tile or stipple operations */
- int ts_y_origin;
- Font font; /* default text font for text operations */
- int subwindow_mode; /* ClipByChildren, IncludeInferiors */
- Bool graphics_exposures;/* boolean, should exposures be generated */
- int clip_x_origin; /* origin for clipping */
- int clip_y_origin;
- Pixmap clip_mask; /* bitmap clipping; other calls for rects */
- int dash_offset; /* patterned/dashed line information */
- char dashes;
-} XGCValues;
-
-/*
- * Graphics context. The contents of this structure are implementation
- * dependent. A GC should be treated as opaque by application code.
- */
-
-typedef struct _XGC
-#ifdef XLIB_ILLEGAL_ACCESS
-{
- XExtData *ext_data; /* hook for extension to hang data */
- GContext gid; /* protocol ID for graphics context */
- /* there is more to this structure, but it is private to Xlib */
-}
-#endif
-*GC;
-
-/*
- * Visual structure; contains information about colormapping possible.
- */
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- VisualID visualid; /* visual id of this visual */
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /* C++ class of screen (monochrome, etc.) */
-#else
- int class; /* class of screen (monochrome, etc.) */
-#endif
- unsigned long red_mask, green_mask, blue_mask; /* mask values */
- int bits_per_rgb; /* log base 2 of distinct color values */
- int map_entries; /* color map entries */
-} Visual;
-
-/*
- * Depth structure; contains information for each possible depth.
- */
-typedef struct {
- int depth; /* this depth (Z) of the depth */
- int nvisuals; /* number of Visual types at this depth */
- Visual *visuals; /* list of visuals possible at this depth */
-} Depth;
-
-/*
- * Information about the screen. The contents of this structure are
- * implementation dependent. A Screen should be treated as opaque
- * by application code.
- */
-
-struct _XDisplay; /* Forward declare before use for C++ */
-
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- struct _XDisplay *display;/* back pointer to display structure */
- Window root; /* Root window id. */
- int width, height; /* width and height of screen */
- int mwidth, mheight; /* width and height of in millimeters */
- int ndepths; /* number of depths possible */
- Depth *depths; /* list of allowable depths on the screen */
- int root_depth; /* bits per pixel */
- Visual *root_visual; /* root visual */
- GC default_gc; /* GC for the root root visual */
- Colormap cmap; /* default color map */
- unsigned long white_pixel;
- unsigned long black_pixel; /* White and Black pixel values */
- int max_maps, min_maps; /* max and min color maps */
- int backing_store; /* Never, WhenMapped, Always */
- Bool save_unders;
- long root_input_mask; /* initial root input mask */
-} Screen;
-
-/*
- * Format structure; describes ZFormat data the screen will understand.
- */
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- int depth; /* depth of this image format */
- int bits_per_pixel; /* bits/pixel at this depth */
- int scanline_pad; /* scanline must padded to this multiple */
-} ScreenFormat;
-
-/*
- * Data structure for setting window attributes.
- */
-typedef struct {
- Pixmap background_pixmap; /* background or None or ParentRelative */
- unsigned long background_pixel; /* background pixel */
- Pixmap border_pixmap; /* border of the window */
- unsigned long border_pixel; /* border pixel value */
- int bit_gravity; /* one of bit gravity values */
- int win_gravity; /* one of the window gravity values */
- int backing_store; /* NotUseful, WhenMapped, Always */
- unsigned long backing_planes;/* planes to be preseved if possible */
- unsigned long backing_pixel;/* value to use in restoring planes */
- Bool save_under; /* should bits under be saved? (popups) */
- long event_mask; /* set of events that should be saved */
- long do_not_propagate_mask; /* set of events that should not propagate */
- Bool override_redirect; /* boolean value for override-redirect */
- Colormap colormap; /* color map to be associated with window */
- Cursor cursor; /* cursor to be displayed (or None) */
-} XSetWindowAttributes;
-
-typedef struct {
- int x, y; /* location of window */
- int width, height; /* width and height of window */
- int border_width; /* border width of window */
- int depth; /* depth of window */
- Visual *visual; /* the associated visual structure */
- Window root; /* root of screen containing window */
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /* C++ InputOutput, InputOnly*/
-#else
- int class; /* InputOutput, InputOnly*/
-#endif
- int bit_gravity; /* one of bit gravity values */
- int win_gravity; /* one of the window gravity values */
- int backing_store; /* NotUseful, WhenMapped, Always */
- unsigned long backing_planes;/* planes to be preserved if possible */
- unsigned long backing_pixel;/* value to be used when restoring planes */
- Bool save_under; /* boolean, should bits under be saved? */
- Colormap colormap; /* color map to be associated with window */
- Bool map_installed; /* boolean, is color map currently installed*/
- int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
- long all_event_masks; /* set of events all people have interest in*/
- long your_event_mask; /* my event mask */
- long do_not_propagate_mask; /* set of events that should not propagate */
- Bool override_redirect; /* boolean value for override-redirect */
- Screen *screen; /* back pointer to correct screen */
-} XWindowAttributes;
-
-/*
- * Data structure for host setting; getting routines.
- *
- */
-
-typedef struct {
- int family; /* for example FamilyInternet */
- int length; /* length of address, in bytes */
- char *address; /* pointer to where to find the bytes */
-} XHostAddress;
-
-/*
- * Data structure for ServerFamilyInterpreted addresses in host routines
- */
-typedef struct {
- int typelength; /* length of type string, in bytes */
- int valuelength; /* length of value string, in bytes */
- char *type; /* pointer to where to find the type string */
- char *value; /* pointer to where to find the address */
-} XServerInterpretedAddress;
-
-/*
- * Data structure for "image" data, used by image manipulation routines.
- */
-typedef struct _XImage {
- int width, height; /* size of image */
- int xoffset; /* number of pixels offset in X direction */
- int format; /* XYBitmap, XYPixmap, ZPixmap */
- char *data; /* pointer to image data */
- int byte_order; /* data byte order, LSBFirst, MSBFirst */
- int bitmap_unit; /* quant. of scanline 8, 16, 32 */
- int bitmap_bit_order; /* LSBFirst, MSBFirst */
- int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
- int depth; /* depth of image */
- int bytes_per_line; /* accelarator to next line */
- int bits_per_pixel; /* bits per pixel (ZPixmap) */
- unsigned long red_mask; /* bits in z arrangment */
- unsigned long green_mask;
- unsigned long blue_mask;
- XPointer obdata; /* hook for the object routines to hang on */
- struct funcs { /* image manipulation routines */
- struct _XImage *(*create_image)(
- struct _XDisplay* /* display */,
- Visual* /* visual */,
- unsigned int /* depth */,
- int /* format */,
- int /* offset */,
- char* /* data */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* bitmap_pad */,
- int /* bytes_per_line */);
- int (*destroy_image) (struct _XImage *);
- unsigned long (*get_pixel) (struct _XImage *, int, int);
- int (*put_pixel) (struct _XImage *, int, int, unsigned long);
- struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
- int (*add_pixel) (struct _XImage *, long);
- } f;
-} XImage;
-
-/*
- * Data structure for XReconfigureWindow
- */
-typedef struct {
- int x, y;
- int width, height;
- int border_width;
- Window sibling;
- int stack_mode;
-} XWindowChanges;
-
-/*
- * Data structure used by color operations
- */
-typedef struct {
- unsigned long pixel;
- unsigned short red, green, blue;
- char flags; /* do_red, do_green, do_blue */
- char pad;
-} XColor;
-
-/*
- * Data structures for graphics operations. On most machines, these are
- * congruent with the wire protocol structures, so reformatting the data
- * can be avoided on these architectures.
- */
-typedef struct {
- short x1, y1, x2, y2;
-} XSegment;
-
-typedef struct {
- short x, y;
-} XPoint;
-
-typedef struct {
- short x, y;
- unsigned short width, height;
-} XRectangle;
-
-typedef struct {
- short x, y;
- unsigned short width, height;
- short angle1, angle2;
-} XArc;
-
-
-/* Data structure for XChangeKeyboardControl */
-
-typedef struct {
- int key_click_percent;
- int bell_percent;
- int bell_pitch;
- int bell_duration;
- int led;
- int led_mode;
- int key;
- int auto_repeat_mode; /* On, Off, Default */
-} XKeyboardControl;
-
-/* Data structure for XGetKeyboardControl */
-
-typedef struct {
- int key_click_percent;
- int bell_percent;
- unsigned int bell_pitch, bell_duration;
- unsigned long led_mask;
- int global_auto_repeat;
- char auto_repeats[32];
-} XKeyboardState;
-
-/* Data structure for XGetMotionEvents. */
-
-typedef struct {
- Time time;
- short x, y;
-} XTimeCoord;
-
-/* Data structure for X{Set,Get}ModifierMapping */
-
-typedef struct {
- int max_keypermod; /* The server's max # of keys per modifier */
- KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */
-} XModifierKeymap;
-
-
-/*
- * Display datatype maintaining display specific data.
- * The contents of this structure are implementation dependent.
- * A Display should be treated as opaque by application code.
- */
-#ifndef XLIB_ILLEGAL_ACCESS
-typedef struct _XDisplay Display;
-#endif
-
-struct _XPrivate; /* Forward declare before use for C++ */
-struct _XrmHashBucketRec;
-
-typedef struct
-#ifdef XLIB_ILLEGAL_ACCESS
-_XDisplay
-#endif
-{
- XExtData *ext_data; /* hook for extension to hang data */
- struct _XPrivate *private1;
- int fd; /* Network socket. */
- int private2;
- int proto_major_version;/* major version of server's X protocol */
- int proto_minor_version;/* minor version of servers X protocol */
- char *vendor; /* vendor of the server hardware */
- XID private3;
- XID private4;
- XID private5;
- int private6;
- XID (*resource_alloc)( /* allocator function */
- struct _XDisplay*
- );
- int byte_order; /* screen byte order, LSBFirst, MSBFirst */
- int bitmap_unit; /* padding and data requirements */
- int bitmap_pad; /* padding requirements on bitmaps */
- int bitmap_bit_order; /* LeastSignificant or MostSignificant */
- int nformats; /* number of pixmap formats in list */
- ScreenFormat *pixmap_format; /* pixmap format list */
- int private8;
- int release; /* release of the server */
- struct _XPrivate *private9, *private10;
- int qlen; /* Length of input event queue */
- unsigned long last_request_read; /* seq number of last event read */
- unsigned long request; /* sequence number of last request. */
- XPointer private11;
- XPointer private12;
- XPointer private13;
- XPointer private14;
- unsigned max_request_size; /* maximum number 32 bit words in request*/
- struct _XrmHashBucketRec *db;
- int (*private15)(
- struct _XDisplay*
- );
- char *display_name; /* "host:display" string used on this connect*/
- int default_screen; /* default screen for operations */
- int nscreens; /* number of screens on this server*/
- Screen *screens; /* pointer to list of screens */
- unsigned long motion_buffer; /* size of motion buffer */
- unsigned long private16;
- int min_keycode; /* minimum defined keycode */
- int max_keycode; /* maximum defined keycode */
- XPointer private17;
- XPointer private18;
- int private19;
- char *xdefaults; /* contents of defaults from server */
- /* there is more to this structure, but it is private to Xlib */
-}
-#ifdef XLIB_ILLEGAL_ACCESS
-Display,
-#endif
-*_XPrivDisplay;
-
-#undef _XEVENT_
-#ifndef _XEVENT_
-/*
- * Definitions of specific events.
- */
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window it is reported relative to */
- Window root; /* root window that the event occurred on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- unsigned int keycode; /* detail */
- Bool same_screen; /* same screen flag */
-} XKeyEvent;
-typedef XKeyEvent XKeyPressedEvent;
-typedef XKeyEvent XKeyReleasedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window it is reported relative to */
- Window root; /* root window that the event occurred on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- unsigned int button; /* detail */
- Bool same_screen; /* same screen flag */
-} XButtonEvent;
-typedef XButtonEvent XButtonPressedEvent;
-typedef XButtonEvent XButtonReleasedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window reported relative to */
- Window root; /* root window that the event occurred on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- char is_hint; /* detail */
- Bool same_screen; /* same screen flag */
-} XMotionEvent;
-typedef XMotionEvent XPointerMovedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window reported relative to */
- Window root; /* root window that the event occurred on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
- int detail;
- /*
- * NotifyAncestor, NotifyVirtual, NotifyInferior,
- * NotifyNonlinear,NotifyNonlinearVirtual
- */
- Bool same_screen; /* same screen flag */
- Bool focus; /* boolean focus */
- unsigned int state; /* key or button mask */
-} XCrossingEvent;
-typedef XCrossingEvent XEnterWindowEvent;
-typedef XCrossingEvent XLeaveWindowEvent;
-
-typedef struct {
- int type; /* FocusIn or FocusOut */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* window of event */
- int mode; /* NotifyNormal, NotifyWhileGrabbed,
- NotifyGrab, NotifyUngrab */
- int detail;
- /*
- * NotifyAncestor, NotifyVirtual, NotifyInferior,
- * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
- * NotifyPointerRoot, NotifyDetailNone
- */
-} XFocusChangeEvent;
-typedef XFocusChangeEvent XFocusInEvent;
-typedef XFocusChangeEvent XFocusOutEvent;
-
-/* generated on EnterWindow and FocusIn when KeyMapState selected */
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- char key_vector[32];
-} XKeymapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int x, y;
- int width, height;
- int count; /* if non-zero, at least this many more */
-} XExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Drawable drawable;
- int x, y;
- int width, height;
- int count; /* if non-zero, at least this many more */
- int major_code; /* core is CopyArea or CopyPlane */
- int minor_code; /* not defined in the core */
-} XGraphicsExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Drawable drawable;
- int major_code; /* core is CopyArea or CopyPlane */
- int minor_code; /* not defined in the core */
-} XNoExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int state; /* Visibility state */
-} XVisibilityEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent; /* parent of the window */
- Window window; /* window id of window created */
- int x, y; /* window location */
- int width, height; /* size of window */
- int border_width; /* border width */
- Bool override_redirect; /* creation should be overridden */
-} XCreateWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
-} XDestroyWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Bool from_configure;
-} XUnmapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Bool override_redirect; /* boolean, is override set... */
-} XMapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
-} XMapRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Window parent;
- int x, y;
- Bool override_redirect;
-} XReparentEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int x, y;
- int width, height;
- int border_width;
- Window above;
- Bool override_redirect;
-} XConfigureEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int x, y;
-} XGravityEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int width, height;
-} XResizeRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
- int x, y;
- int width, height;
- int border_width;
- Window above;
- int detail; /* Above, Below, TopIf, BottomIf, Opposite */
- unsigned long value_mask;
-} XConfigureRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int place; /* PlaceOnTop, PlaceOnBottom */
-} XCirculateEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
- int place; /* PlaceOnTop, PlaceOnBottom */
-} XCirculateRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom atom;
- Time time;
- int state; /* NewValue, Deleted */
-} XPropertyEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom selection;
- Time time;
-} XSelectionClearEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window owner;
- Window requestor;
- Atom selection;
- Atom target;
- Atom property;
- Time time;
-} XSelectionRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window requestor;
- Atom selection;
- Atom target;
- Atom property; /* ATOM or None */
- Time time;
-} XSelectionEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Colormap colormap; /* COLORMAP or None */
-#if defined(__cplusplus) || defined(c_plusplus)
- Bool c_new; /* C++ */
-#else
- Bool new;
-#endif
- int state; /* ColormapInstalled, ColormapUninstalled */
-} XColormapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom message_type;
- int format;
- union {
- char b[20];
- short s[10];
- long l[5];
- } data;
-} XClientMessageEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* unused */
- int request; /* one of MappingModifier, MappingKeyboard,
- MappingPointer */
- int first_keycode; /* first keycode */
- int count; /* defines range of change w. first_keycode*/
-} XMappingEvent;
-
-typedef struct {
- int type;
- Display *display; /* Display the event was read from */
- XID resourceid; /* resource id */
- unsigned long serial; /* serial number of failed request */
- unsigned char error_code; /* error code of failed request */
- unsigned char request_code; /* Major op-code of failed request */
- unsigned char minor_code; /* Minor op-code of failed request */
-} XErrorEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display;/* Display the event was read from */
- Window window; /* window on which event was requested in event mask */
-} XAnyEvent;
-
-
-/***************************************************************
- *
- * GenericEvent. This event is the standard event for all newer extensions.
- */
-
-typedef struct
- {
- int type; /* of event. Always GenericEvent */
- unsigned long serial; /* # of last request processed */
- Bool send_event; /* true if from SendEvent request */
- Display *display; /* Display the event was read from */
- int extension; /* major opcode of extension that caused the event */
- int evtype; /* actual event type. */
- } XGenericEvent;
-
-typedef struct {
- int type; /* of event. Always GenericEvent */
- unsigned long serial; /* # of last request processed */
- Bool send_event; /* true if from SendEvent request */
- Display *display; /* Display the event was read from */
- int extension; /* major opcode of extension that caused the event */
- int evtype; /* actual event type. */
- unsigned int cookie;
- void *data;
-} XGenericEventCookie;
-
-/*
- * this union is defined so Xlib can always use the same sized
- * event structure internally, to avoid memory fragmentation.
- */
-typedef union _XEvent {
- int type; /* must not be changed; first element */
- XAnyEvent xany;
- XKeyEvent xkey;
- XButtonEvent xbutton;
- XMotionEvent xmotion;
- XCrossingEvent xcrossing;
- XFocusChangeEvent xfocus;
- XExposeEvent xexpose;
- XGraphicsExposeEvent xgraphicsexpose;
- XNoExposeEvent xnoexpose;
- XVisibilityEvent xvisibility;
- XCreateWindowEvent xcreatewindow;
- XDestroyWindowEvent xdestroywindow;
- XUnmapEvent xunmap;
- XMapEvent xmap;
- XMapRequestEvent xmaprequest;
- XReparentEvent xreparent;
- XConfigureEvent xconfigure;
- XGravityEvent xgravity;
- XResizeRequestEvent xresizerequest;
- XConfigureRequestEvent xconfigurerequest;
- XCirculateEvent xcirculate;
- XCirculateRequestEvent xcirculaterequest;
- XPropertyEvent xproperty;
- XSelectionClearEvent xselectionclear;
- XSelectionRequestEvent xselectionrequest;
- XSelectionEvent xselection;
- XColormapEvent xcolormap;
- XClientMessageEvent xclient;
- XMappingEvent xmapping;
- XErrorEvent xerror;
- XKeymapEvent xkeymap;
- XGenericEvent xgeneric;
- XGenericEventCookie xcookie;
- long pad[24];
-} XEvent;
-#endif
-
-#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
-
-/*
- * per character font metric information.
- */
-typedef struct {
- short lbearing; /* origin to left edge of raster */
- short rbearing; /* origin to right edge of raster */
- short width; /* advance to next char's origin */
- short ascent; /* baseline to top edge of raster */
- short descent; /* baseline to bottom edge of raster */
- unsigned short attributes; /* per char flags (not predefined) */
-} XCharStruct;
-
-/*
- * To allow arbitrary information with fonts, there are additional properties
- * returned.
- */
-typedef struct {
- Atom name;
- unsigned long card32;
-} XFontProp;
-
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- Font fid; /* Font id for this font */
- unsigned direction; /* hint about direction the font is painted */
- unsigned min_char_or_byte2;/* first character */
- unsigned max_char_or_byte2;/* last character */
- unsigned min_byte1; /* first row that exists */
- unsigned max_byte1; /* last row that exists */
- Bool all_chars_exist;/* flag if all characters have non-zero size*/
- unsigned default_char; /* char to print for undefined character */
- int n_properties; /* how many properties there are */
- XFontProp *properties; /* pointer to array of additional properties*/
- XCharStruct min_bounds; /* minimum bounds over all existing char*/
- XCharStruct max_bounds; /* maximum bounds over all existing char*/
- XCharStruct *per_char; /* first_char to last_char information */
- int ascent; /* log. extent above baseline for spacing */
- int descent; /* log. descent below baseline for spacing */
-} XFontStruct;
-
-/*
- * PolyText routines take these as arguments.
- */
-typedef struct {
- char *chars; /* pointer to string */
- int nchars; /* number of characters */
- int delta; /* delta between strings */
- Font font; /* font to print it in, None don't change */
-} XTextItem;
-
-typedef struct { /* normal 16 bit characters are two bytes */
- unsigned char byte1;
- unsigned char byte2;
-} XChar2b;
-
-typedef struct {
- XChar2b *chars; /* two byte characters */
- int nchars; /* number of characters */
- int delta; /* delta between strings */
- Font font; /* font to print it in, None don't change */
-} XTextItem16;
-
-
-typedef union { Display *display;
- GC gc;
- Visual *visual;
- Screen *screen;
- ScreenFormat *pixmap_format;
- XFontStruct *font; } XEDataObject;
-
-typedef struct {
- XRectangle max_ink_extent;
- XRectangle max_logical_extent;
-} XFontSetExtents;
-
-/* unused:
-typedef void (*XOMProc)();
- */
-
-typedef struct _XOM *XOM;
-typedef struct _XOC *XOC, *XFontSet;
-
-typedef struct {
- char *chars;
- int nchars;
- int delta;
- XFontSet font_set;
-} XmbTextItem;
-
-typedef struct {
- wchar_t *chars;
- int nchars;
- int delta;
- XFontSet font_set;
-} XwcTextItem;
-
-#define XNRequiredCharSet "requiredCharSet"
-#define XNQueryOrientation "queryOrientation"
-#define XNBaseFontName "baseFontName"
-#define XNOMAutomatic "omAutomatic"
-#define XNMissingCharSet "missingCharSet"
-#define XNDefaultString "defaultString"
-#define XNOrientation "orientation"
-#define XNDirectionalDependentDrawing "directionalDependentDrawing"
-#define XNContextualDrawing "contextualDrawing"
-#define XNFontInfo "fontInfo"
-
-typedef struct {
- int charset_count;
- char **charset_list;
-} XOMCharSetList;
-
-typedef enum {
- XOMOrientation_LTR_TTB,
- XOMOrientation_RTL_TTB,
- XOMOrientation_TTB_LTR,
- XOMOrientation_TTB_RTL,
- XOMOrientation_Context
-} XOrientation;
-
-typedef struct {
- int num_orientation;
- XOrientation *orientation; /* Input Text description */
-} XOMOrientation;
-
-typedef struct {
- int num_font;
- XFontStruct **font_struct_list;
- char **font_name_list;
-} XOMFontInfo;
-
-typedef struct _XIM *XIM;
-typedef struct _XIC *XIC;
-
-typedef void (*XIMProc)(
- XIM,
- XPointer,
- XPointer
-);
-
-typedef Bool (*XICProc)(
- XIC,
- XPointer,
- XPointer
-);
-
-typedef void (*XIDProc)(
- Display*,
- XPointer,
- XPointer
-);
-
-typedef unsigned long XIMStyle;
-
-typedef struct {
- unsigned short count_styles;
- XIMStyle *supported_styles;
-} XIMStyles;
-
-#define XIMPreeditArea 0x0001L
-#define XIMPreeditCallbacks 0x0002L
-#define XIMPreeditPosition 0x0004L
-#define XIMPreeditNothing 0x0008L
-#define XIMPreeditNone 0x0010L
-#define XIMStatusArea 0x0100L
-#define XIMStatusCallbacks 0x0200L
-#define XIMStatusNothing 0x0400L
-#define XIMStatusNone 0x0800L
-
-#define XNVaNestedList "XNVaNestedList"
-#define XNQueryInputStyle "queryInputStyle"
-#define XNClientWindow "clientWindow"
-#define XNInputStyle "inputStyle"
-#define XNFocusWindow "focusWindow"
-#define XNResourceName "resourceName"
-#define XNResourceClass "resourceClass"
-#define XNGeometryCallback "geometryCallback"
-#define XNDestroyCallback "destroyCallback"
-#define XNFilterEvents "filterEvents"
-#define XNPreeditStartCallback "preeditStartCallback"
-#define XNPreeditDoneCallback "preeditDoneCallback"
-#define XNPreeditDrawCallback "preeditDrawCallback"
-#define XNPreeditCaretCallback "preeditCaretCallback"
-#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
-#define XNPreeditAttributes "preeditAttributes"
-#define XNStatusStartCallback "statusStartCallback"
-#define XNStatusDoneCallback "statusDoneCallback"
-#define XNStatusDrawCallback "statusDrawCallback"
-#define XNStatusAttributes "statusAttributes"
-#define XNArea "area"
-#define XNAreaNeeded "areaNeeded"
-#define XNSpotLocation "spotLocation"
-#define XNColormap "colorMap"
-#define XNStdColormap "stdColorMap"
-#define XNForeground "foreground"
-#define XNBackground "background"
-#define XNBackgroundPixmap "backgroundPixmap"
-#define XNFontSet "fontSet"
-#define XNLineSpace "lineSpace"
-#define XNCursor "cursor"
-
-#define XNQueryIMValuesList "queryIMValuesList"
-#define XNQueryICValuesList "queryICValuesList"
-#define XNVisiblePosition "visiblePosition"
-#define XNR6PreeditCallback "r6PreeditCallback"
-#define XNStringConversionCallback "stringConversionCallback"
-#define XNStringConversion "stringConversion"
-#define XNResetState "resetState"
-#define XNHotKey "hotKey"
-#define XNHotKeyState "hotKeyState"
-#define XNPreeditState "preeditState"
-#define XNSeparatorofNestedList "separatorofNestedList"
-
-#define XBufferOverflow -1
-#define XLookupNone 1
-#define XLookupChars 2
-#define XLookupKeySym 3
-#define XLookupBoth 4
-
-typedef void *XVaNestedList;
-
-typedef struct {
- XPointer client_data;
- XIMProc callback;
-} XIMCallback;
-
-typedef struct {
- XPointer client_data;
- XICProc callback;
-} XICCallback;
-
-typedef unsigned long XIMFeedback;
-
-#define XIMReverse 1L
-#define XIMUnderline (1L<<1)
-#define XIMHighlight (1L<<2)
-#define XIMPrimary (1L<<5)
-#define XIMSecondary (1L<<6)
-#define XIMTertiary (1L<<7)
-#define XIMVisibleToForward (1L<<8)
-#define XIMVisibleToBackword (1L<<9)
-#define XIMVisibleToCenter (1L<<10)
-
-typedef struct _XIMText {
- unsigned short length;
- XIMFeedback *feedback;
- Bool encoding_is_wchar;
- union {
- char *multi_byte;
- wchar_t *wide_char;
- } string;
-} XIMText;
-
-typedef unsigned long XIMPreeditState;
-
-#define XIMPreeditUnKnown 0L
-#define XIMPreeditEnable 1L
-#define XIMPreeditDisable (1L<<1)
-
-typedef struct _XIMPreeditStateNotifyCallbackStruct {
- XIMPreeditState state;
-} XIMPreeditStateNotifyCallbackStruct;
-
-typedef unsigned long XIMResetState;
-
-#define XIMInitialState 1L
-#define XIMPreserveState (1L<<1)
-
-typedef unsigned long XIMStringConversionFeedback;
-
-#define XIMStringConversionLeftEdge (0x00000001)
-#define XIMStringConversionRightEdge (0x00000002)
-#define XIMStringConversionTopEdge (0x00000004)
-#define XIMStringConversionBottomEdge (0x00000008)
-#define XIMStringConversionConcealed (0x00000010)
-#define XIMStringConversionWrapped (0x00000020)
-
-typedef struct _XIMStringConversionText {
- unsigned short length;
- XIMStringConversionFeedback *feedback;
- Bool encoding_is_wchar;
- union {
- char *mbs;
- wchar_t *wcs;
- } string;
-} XIMStringConversionText;
-
-typedef unsigned short XIMStringConversionPosition;
-
-typedef unsigned short XIMStringConversionType;
-
-#define XIMStringConversionBuffer (0x0001)
-#define XIMStringConversionLine (0x0002)
-#define XIMStringConversionWord (0x0003)
-#define XIMStringConversionChar (0x0004)
-
-typedef unsigned short XIMStringConversionOperation;
-
-#define XIMStringConversionSubstitution (0x0001)
-#define XIMStringConversionRetrieval (0x0002)
-
-typedef enum {
- XIMForwardChar, XIMBackwardChar,
- XIMForwardWord, XIMBackwardWord,
- XIMCaretUp, XIMCaretDown,
- XIMNextLine, XIMPreviousLine,
- XIMLineStart, XIMLineEnd,
- XIMAbsolutePosition,
- XIMDontChange
-} XIMCaretDirection;
-
-typedef struct _XIMStringConversionCallbackStruct {
- XIMStringConversionPosition position;
- XIMCaretDirection direction;
- XIMStringConversionOperation operation;
- unsigned short factor;
- XIMStringConversionText *text;
-} XIMStringConversionCallbackStruct;
-
-typedef struct _XIMPreeditDrawCallbackStruct {
- int caret; /* Cursor offset within pre-edit string */
- int chg_first; /* Starting change position */
- int chg_length; /* Length of the change in character count */
- XIMText *text;
-} XIMPreeditDrawCallbackStruct;
-
-typedef enum {
- XIMIsInvisible, /* Disable caret feedback */
- XIMIsPrimary, /* UI defined caret feedback */
- XIMIsSecondary /* UI defined caret feedback */
-} XIMCaretStyle;
-
-typedef struct _XIMPreeditCaretCallbackStruct {
- int position; /* Caret offset within pre-edit string */
- XIMCaretDirection direction; /* Caret moves direction */
- XIMCaretStyle style; /* Feedback of the caret */
-} XIMPreeditCaretCallbackStruct;
-
-typedef enum {
- XIMTextType,
- XIMBitmapType
-} XIMStatusDataType;
-
-typedef struct _XIMStatusDrawCallbackStruct {
- XIMStatusDataType type;
- union {
- XIMText *text;
- Pixmap bitmap;
- } data;
-} XIMStatusDrawCallbackStruct;
-
-typedef struct _XIMHotKeyTrigger {
- KeySym keysym;
- int modifier;
- int modifier_mask;
-} XIMHotKeyTrigger;
-
-typedef struct _XIMHotKeyTriggers {
- int num_hot_key;
- XIMHotKeyTrigger *key;
-} XIMHotKeyTriggers;
-
-typedef unsigned long XIMHotKeyState;
-
-#define XIMHotKeyStateON (0x0001L)
-#define XIMHotKeyStateOFF (0x0002L)
-
-typedef struct {
- unsigned short count_values;
- char **supported_values;
-} XIMValuesList;
-
-_XFUNCPROTOBEGIN
-
-#if defined(WIN32) && !defined(_XLIBINT_)
-#define _Xdebug (*_Xdebug_p)
-#endif
-
-extern int _Xdebug;
-
-extern XFontStruct *XLoadQueryFont(
- Display* /* display */,
- _Xconst char* /* name */
-);
-
-extern XFontStruct *XQueryFont(
- Display* /* display */,
- XID /* font_ID */
-);
-
-
-extern XTimeCoord *XGetMotionEvents(
- Display* /* display */,
- Window /* w */,
- Time /* start */,
- Time /* stop */,
- int* /* nevents_return */
-);
-
-extern XModifierKeymap *XDeleteModifiermapEntry(
- XModifierKeymap* /* modmap */,
-#if NeedWidePrototypes
- unsigned int /* keycode_entry */,
-#else
- KeyCode /* keycode_entry */,
-#endif
- int /* modifier */
-);
-
-extern XModifierKeymap *XGetModifierMapping(
- Display* /* display */
-);
-
-extern XModifierKeymap *XInsertModifiermapEntry(
- XModifierKeymap* /* modmap */,
-#if NeedWidePrototypes
- unsigned int /* keycode_entry */,
-#else
- KeyCode /* keycode_entry */,
-#endif
- int /* modifier */
-);
-
-extern XModifierKeymap *XNewModifiermap(
- int /* max_keys_per_mod */
-);
-
-extern XImage *XCreateImage(
- Display* /* display */,
- Visual* /* visual */,
- unsigned int /* depth */,
- int /* format */,
- int /* offset */,
- char* /* data */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* bitmap_pad */,
- int /* bytes_per_line */
-);
-extern Status XInitImage(
- XImage* /* image */
-);
-extern XImage *XGetImage(
- Display* /* display */,
- Drawable /* d */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned long /* plane_mask */,
- int /* format */
-);
-extern XImage *XGetSubImage(
- Display* /* display */,
- Drawable /* d */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned long /* plane_mask */,
- int /* format */,
- XImage* /* dest_image */,
- int /* dest_x */,
- int /* dest_y */
-);
-
-/*
- * X function declarations.
- */
-extern Display *XOpenDisplay(
- _Xconst char* /* display_name */
-);
-
-extern void XrmInitialize(
- void
-);
-
-extern char *XFetchBytes(
- Display* /* display */,
- int* /* nbytes_return */
-);
-extern char *XFetchBuffer(
- Display* /* display */,
- int* /* nbytes_return */,
- int /* buffer */
-);
-extern char *XGetAtomName(
- Display* /* display */,
- Atom /* atom */
-);
-extern Status XGetAtomNames(
- Display* /* dpy */,
- Atom* /* atoms */,
- int /* count */,
- char** /* names_return */
-);
-extern char *XGetDefault(
- Display* /* display */,
- _Xconst char* /* program */,
- _Xconst char* /* option */
-);
-extern char *XDisplayName(
- _Xconst char* /* string */
-);
-extern char *XKeysymToString(
- KeySym /* keysym */
-);
-
-extern int (*XSynchronize(
- Display* /* display */,
- Bool /* onoff */
-))(
- Display* /* display */
-);
-extern int (*XSetAfterFunction(
- Display* /* display */,
- int (*) (
- Display* /* display */
- ) /* procedure */
-))(
- Display* /* display */
-);
-extern Atom XInternAtom(
- Display* /* display */,
- _Xconst char* /* atom_name */,
- Bool /* only_if_exists */
-);
-extern Status XInternAtoms(
- Display* /* dpy */,
- _Xconst char** /* names */,
- int /* count */,
- Bool /* onlyIfExists */,
- Atom* /* atoms_return */
-);
-extern Colormap XCopyColormapAndFree(
- Display* /* display */,
- Colormap /* colormap */
-);
-extern Colormap XCreateColormap(
- Display* /* display */,
- Window /* w */,
- Visual* /* visual */,
- int /* alloc */
-);
-extern Cursor XCreatePixmapCursor(
- Display* /* display */,
- Pixmap /* source */,
- Pixmap /* mask */,
- XColor* /* foreground_color */,
- XColor* /* background_color */,
- unsigned int /* x */,
- unsigned int /* y */
-);
-extern Cursor XCreateGlyphCursor(
- Display* /* display */,
- Font /* source_font */,
- Font /* mask_font */,
- unsigned int /* source_char */,
- unsigned int /* mask_char */,
- XColor _Xconst * /* foreground_color */,
- XColor _Xconst * /* background_color */
-);
-extern Cursor XCreateFontCursor(
- Display* /* display */,
- unsigned int /* shape */
-);
-extern Font XLoadFont(
- Display* /* display */,
- _Xconst char* /* name */
-);
-extern GC XCreateGC(
- Display* /* display */,
- Drawable /* d */,
- unsigned long /* valuemask */,
- XGCValues* /* values */
-);
-extern GContext XGContextFromGC(
- GC /* gc */
-);
-extern void XFlushGC(
- Display* /* display */,
- GC /* gc */
-);
-extern Pixmap XCreatePixmap(
- Display* /* display */,
- Drawable /* d */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int /* depth */
-);
-extern Pixmap XCreateBitmapFromData(
- Display* /* display */,
- Drawable /* d */,
- _Xconst char* /* data */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-extern Pixmap XCreatePixmapFromBitmapData(
- Display* /* display */,
- Drawable /* d */,
- char* /* data */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned long /* fg */,
- unsigned long /* bg */,
- unsigned int /* depth */
-);
-extern Window XCreateSimpleWindow(
- Display* /* display */,
- Window /* parent */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int /* border_width */,
- unsigned long /* border */,
- unsigned long /* background */
-);
-extern Window XGetSelectionOwner(
- Display* /* display */,
- Atom /* selection */
-);
-extern Window XCreateWindow(
- Display* /* display */,
- Window /* parent */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int /* border_width */,
- int /* depth */,
- unsigned int /* class */,
- Visual* /* visual */,
- unsigned long /* valuemask */,
- XSetWindowAttributes* /* attributes */
-);
-extern Colormap *XListInstalledColormaps(
- Display* /* display */,
- Window /* w */,
- int* /* num_return */
-);
-extern char **XListFonts(
- Display* /* display */,
- _Xconst char* /* pattern */,
- int /* maxnames */,
- int* /* actual_count_return */
-);
-extern char **XListFontsWithInfo(
- Display* /* display */,
- _Xconst char* /* pattern */,
- int /* maxnames */,
- int* /* count_return */,
- XFontStruct** /* info_return */
-);
-extern char **XGetFontPath(
- Display* /* display */,
- int* /* npaths_return */
-);
-extern char **XListExtensions(
- Display* /* display */,
- int* /* nextensions_return */
-);
-extern Atom *XListProperties(
- Display* /* display */,
- Window /* w */,
- int* /* num_prop_return */
-);
-extern XHostAddress *XListHosts(
- Display* /* display */,
- int* /* nhosts_return */,
- Bool* /* state_return */
-);
-extern KeySym XKeycodeToKeysym(
- Display* /* display */,
-#if NeedWidePrototypes
- unsigned int /* keycode */,
-#else
- KeyCode /* keycode */,
-#endif
- int /* index */
-);
-extern KeySym XLookupKeysym(
- XKeyEvent* /* key_event */,
- int /* index */
-);
-extern KeySym *XGetKeyboardMapping(
- Display* /* display */,
-#if NeedWidePrototypes
- unsigned int /* first_keycode */,
-#else
- KeyCode /* first_keycode */,
-#endif
- int /* keycode_count */,
- int* /* keysyms_per_keycode_return */
-);
-extern KeySym XStringToKeysym(
- _Xconst char* /* string */
-);
-extern long XMaxRequestSize(
- Display* /* display */
-);
-extern long XExtendedMaxRequestSize(
- Display* /* display */
-);
-extern char *XResourceManagerString(
- Display* /* display */
-);
-extern char *XScreenResourceString(
- Screen* /* screen */
-);
-extern unsigned long XDisplayMotionBufferSize(
- Display* /* display */
-);
-extern VisualID XVisualIDFromVisual(
- Visual* /* visual */
-);
-
-/* multithread routines */
-
-extern Status XInitThreads(
- void
-);
-
-extern void XLockDisplay(
- Display* /* display */
-);
-
-extern void XUnlockDisplay(
- Display* /* display */
-);
-
-/* routines for dealing with extensions */
-
-extern XExtCodes *XInitExtension(
- Display* /* display */,
- _Xconst char* /* name */
-);
-
-extern XExtCodes *XAddExtension(
- Display* /* display */
-);
-extern XExtData *XFindOnExtensionList(
- XExtData** /* structure */,
- int /* number */
-);
-extern XExtData **XEHeadOfExtensionList(
- XEDataObject /* object */
-);
-
-/* these are routines for which there are also macros */
-extern Window XRootWindow(
- Display* /* display */,
- int /* screen_number */
-);
-extern Window XDefaultRootWindow(
- Display* /* display */
-);
-extern Window XRootWindowOfScreen(
- Screen* /* screen */
-);
-extern Visual *XDefaultVisual(
- Display* /* display */,
- int /* screen_number */
-);
-extern Visual *XDefaultVisualOfScreen(
- Screen* /* screen */
-);
-extern GC XDefaultGC(
- Display* /* display */,
- int /* screen_number */
-);
-extern GC XDefaultGCOfScreen(
- Screen* /* screen */
-);
-extern unsigned long XBlackPixel(
- Display* /* display */,
- int /* screen_number */
-);
-extern unsigned long XWhitePixel(
- Display* /* display */,
- int /* screen_number */
-);
-extern unsigned long XAllPlanes(
- void
-);
-extern unsigned long XBlackPixelOfScreen(
- Screen* /* screen */
-);
-extern unsigned long XWhitePixelOfScreen(
- Screen* /* screen */
-);
-extern unsigned long XNextRequest(
- Display* /* display */
-);
-extern unsigned long XLastKnownRequestProcessed(
- Display* /* display */
-);
-extern char *XServerVendor(
- Display* /* display */
-);
-extern char *XDisplayString(
- Display* /* display */
-);
-extern Colormap XDefaultColormap(
- Display* /* display */,
- int /* screen_number */
-);
-extern Colormap XDefaultColormapOfScreen(
- Screen* /* screen */
-);
-extern Display *XDisplayOfScreen(
- Screen* /* screen */
-);
-extern Screen *XScreenOfDisplay(
- Display* /* display */,
- int /* screen_number */
-);
-extern Screen *XDefaultScreenOfDisplay(
- Display* /* display */
-);
-extern long XEventMaskOfScreen(
- Screen* /* screen */
-);
-
-extern int XScreenNumberOfScreen(
- Screen* /* screen */
-);
-
-typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
- Display* /* display */,
- XErrorEvent* /* error_event */
-);
-
-extern XErrorHandler XSetErrorHandler (
- XErrorHandler /* handler */
-);
-
-
-typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */
- Display* /* display */
-);
-
-extern XIOErrorHandler XSetIOErrorHandler (
- XIOErrorHandler /* handler */
-);
-
-
-extern XPixmapFormatValues *XListPixmapFormats(
- Display* /* display */,
- int* /* count_return */
-);
-extern int *XListDepths(
- Display* /* display */,
- int /* screen_number */,
- int* /* count_return */
-);
-
-/* ICCCM routines for things that don't require special include files; */
-/* other declarations are given in Xutil.h */
-extern Status XReconfigureWMWindow(
- Display* /* display */,
- Window /* w */,
- int /* screen_number */,
- unsigned int /* mask */,
- XWindowChanges* /* changes */
-);
-
-extern Status XGetWMProtocols(
- Display* /* display */,
- Window /* w */,
- Atom** /* protocols_return */,
- int* /* count_return */
-);
-extern Status XSetWMProtocols(
- Display* /* display */,
- Window /* w */,
- Atom* /* protocols */,
- int /* count */
-);
-extern Status XIconifyWindow(
- Display* /* display */,
- Window /* w */,
- int /* screen_number */
-);
-extern Status XWithdrawWindow(
- Display* /* display */,
- Window /* w */,
- int /* screen_number */
-);
-extern Status XGetCommand(
- Display* /* display */,
- Window /* w */,
- char*** /* argv_return */,
- int* /* argc_return */
-);
-extern Status XGetWMColormapWindows(
- Display* /* display */,
- Window /* w */,
- Window** /* windows_return */,
- int* /* count_return */
-);
-extern Status XSetWMColormapWindows(
- Display* /* display */,
- Window /* w */,
- Window* /* colormap_windows */,
- int /* count */
-);
-extern void XFreeStringList(
- char** /* list */
-);
-extern int XSetTransientForHint(
- Display* /* display */,
- Window /* w */,
- Window /* prop_window */
-);
-
-/* The following are given in alphabetical order */
-
-extern int XActivateScreenSaver(
- Display* /* display */
-);
-
-extern int XAddHost(
- Display* /* display */,
- XHostAddress* /* host */
-);
-
-extern int XAddHosts(
- Display* /* display */,
- XHostAddress* /* hosts */,
- int /* num_hosts */
-);
-
-extern int XAddToExtensionList(
- struct _XExtData** /* structure */,
- XExtData* /* ext_data */
-);
-
-extern int XAddToSaveSet(
- Display* /* display */,
- Window /* w */
-);
-
-extern Status XAllocColor(
- Display* /* display */,
- Colormap /* colormap */,
- XColor* /* screen_in_out */
-);
-
-extern Status XAllocColorCells(
- Display* /* display */,
- Colormap /* colormap */,
- Bool /* contig */,
- unsigned long* /* plane_masks_return */,
- unsigned int /* nplanes */,
- unsigned long* /* pixels_return */,
- unsigned int /* npixels */
-);
-
-extern Status XAllocColorPlanes(
- Display* /* display */,
- Colormap /* colormap */,
- Bool /* contig */,
- unsigned long* /* pixels_return */,
- int /* ncolors */,
- int /* nreds */,
- int /* ngreens */,
- int /* nblues */,
- unsigned long* /* rmask_return */,
- unsigned long* /* gmask_return */,
- unsigned long* /* bmask_return */
-);
-
-extern Status XAllocNamedColor(
- Display* /* display */,
- Colormap /* colormap */,
- _Xconst char* /* color_name */,
- XColor* /* screen_def_return */,
- XColor* /* exact_def_return */
-);
-
-extern int XAllowEvents(
- Display* /* display */,
- int /* event_mode */,
- Time /* time */
-);
-
-extern int XAutoRepeatOff(
- Display* /* display */
-);
-
-extern int XAutoRepeatOn(
- Display* /* display */
-);
-
-extern int XBell(
- Display* /* display */,
- int /* percent */
-);
-
-extern int XBitmapBitOrder(
- Display* /* display */
-);
-
-extern int XBitmapPad(
- Display* /* display */
-);
-
-extern int XBitmapUnit(
- Display* /* display */
-);
-
-extern int XCellsOfScreen(
- Screen* /* screen */
-);
-
-extern int XChangeActivePointerGrab(
- Display* /* display */,
- unsigned int /* event_mask */,
- Cursor /* cursor */,
- Time /* time */
-);
-
-extern int XChangeGC(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* valuemask */,
- XGCValues* /* values */
-);
-
-extern int XChangeKeyboardControl(
- Display* /* display */,
- unsigned long /* value_mask */,
- XKeyboardControl* /* values */
-);
-
-extern int XChangeKeyboardMapping(
- Display* /* display */,
- int /* first_keycode */,
- int /* keysyms_per_keycode */,
- KeySym* /* keysyms */,
- int /* num_codes */
-);
-
-extern int XChangePointerControl(
- Display* /* display */,
- Bool /* do_accel */,
- Bool /* do_threshold */,
- int /* accel_numerator */,
- int /* accel_denominator */,
- int /* threshold */
-);
-
-extern int XChangeProperty(
- Display* /* display */,
- Window /* w */,
- Atom /* property */,
- Atom /* type */,
- int /* format */,
- int /* mode */,
- _Xconst unsigned char* /* data */,
- int /* nelements */
-);
-
-extern int XChangeSaveSet(
- Display* /* display */,
- Window /* w */,
- int /* change_mode */
-);
-
-extern int XChangeWindowAttributes(
- Display* /* display */,
- Window /* w */,
- unsigned long /* valuemask */,
- XSetWindowAttributes* /* attributes */
-);
-
-extern Bool XCheckIfEvent(
- Display* /* display */,
- XEvent* /* event_return */,
- Bool (*) (
- Display* /* display */,
- XEvent* /* event */,
- XPointer /* arg */
- ) /* predicate */,
- XPointer /* arg */
-);
-
-extern Bool XCheckMaskEvent(
- Display* /* display */,
- long /* event_mask */,
- XEvent* /* event_return */
-);
-
-extern Bool XCheckTypedEvent(
- Display* /* display */,
- int /* event_type */,
- XEvent* /* event_return */
-);
-
-extern Bool XCheckTypedWindowEvent(
- Display* /* display */,
- Window /* w */,
- int /* event_type */,
- XEvent* /* event_return */
-);
-
-extern Bool XCheckWindowEvent(
- Display* /* display */,
- Window /* w */,
- long /* event_mask */,
- XEvent* /* event_return */
-);
-
-extern int XCirculateSubwindows(
- Display* /* display */,
- Window /* w */,
- int /* direction */
-);
-
-extern int XCirculateSubwindowsDown(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XCirculateSubwindowsUp(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XClearArea(
- Display* /* display */,
- Window /* w */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- Bool /* exposures */
-);
-
-extern int XClearWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XCloseDisplay(
- Display* /* display */
-);
-
-extern int XConfigureWindow(
- Display* /* display */,
- Window /* w */,
- unsigned int /* value_mask */,
- XWindowChanges* /* values */
-);
-
-extern int XConnectionNumber(
- Display* /* display */
-);
-
-extern int XConvertSelection(
- Display* /* display */,
- Atom /* selection */,
- Atom /* target */,
- Atom /* property */,
- Window /* requestor */,
- Time /* time */
-);
-
-extern int XCopyArea(
- Display* /* display */,
- Drawable /* src */,
- Drawable /* dest */,
- GC /* gc */,
- int /* src_x */,
- int /* src_y */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* dest_x */,
- int /* dest_y */
-);
-
-extern int XCopyGC(
- Display* /* display */,
- GC /* src */,
- unsigned long /* valuemask */,
- GC /* dest */
-);
-
-extern int XCopyPlane(
- Display* /* display */,
- Drawable /* src */,
- Drawable /* dest */,
- GC /* gc */,
- int /* src_x */,
- int /* src_y */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* dest_x */,
- int /* dest_y */,
- unsigned long /* plane */
-);
-
-extern int XDefaultDepth(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDefaultDepthOfScreen(
- Screen* /* screen */
-);
-
-extern int XDefaultScreen(
- Display* /* display */
-);
-
-extern int XDefineCursor(
- Display* /* display */,
- Window /* w */,
- Cursor /* cursor */
-);
-
-extern int XDeleteProperty(
- Display* /* display */,
- Window /* w */,
- Atom /* property */
-);
-
-extern int XDestroyWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XDestroySubwindows(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XDoesBackingStore(
- Screen* /* screen */
-);
-
-extern Bool XDoesSaveUnders(
- Screen* /* screen */
-);
-
-extern int XDisableAccessControl(
- Display* /* display */
-);
-
-
-extern int XDisplayCells(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDisplayHeight(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDisplayHeightMM(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDisplayKeycodes(
- Display* /* display */,
- int* /* min_keycodes_return */,
- int* /* max_keycodes_return */
-);
-
-extern int XDisplayPlanes(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDisplayWidth(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDisplayWidthMM(
- Display* /* display */,
- int /* screen_number */
-);
-
-extern int XDrawArc(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* angle1 */,
- int /* angle2 */
-);
-
-extern int XDrawArcs(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XArc* /* arcs */,
- int /* narcs */
-);
-
-extern int XDrawImageString(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* string */,
- int /* length */
-);
-
-extern int XDrawImageString16(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst XChar2b* /* string */,
- int /* length */
-);
-
-extern int XDrawLine(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x1 */,
- int /* y1 */,
- int /* x2 */,
- int /* y2 */
-);
-
-extern int XDrawLines(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XPoint* /* points */,
- int /* npoints */,
- int /* mode */
-);
-
-extern int XDrawPoint(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */
-);
-
-extern int XDrawPoints(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XPoint* /* points */,
- int /* npoints */,
- int /* mode */
-);
-
-extern int XDrawRectangle(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-
-extern int XDrawRectangles(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XRectangle* /* rectangles */,
- int /* nrectangles */
-);
-
-extern int XDrawSegments(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XSegment* /* segments */,
- int /* nsegments */
-);
-
-extern int XDrawString(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* string */,
- int /* length */
-);
-
-extern int XDrawString16(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst XChar2b* /* string */,
- int /* length */
-);
-
-extern int XDrawText(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- XTextItem* /* items */,
- int /* nitems */
-);
-
-extern int XDrawText16(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- XTextItem16* /* items */,
- int /* nitems */
-);
-
-extern int XEnableAccessControl(
- Display* /* display */
-);
-
-extern int XEventsQueued(
- Display* /* display */,
- int /* mode */
-);
-
-extern Status XFetchName(
- Display* /* display */,
- Window /* w */,
- char** /* window_name_return */
-);
-
-extern int XFillArc(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* angle1 */,
- int /* angle2 */
-);
-
-extern int XFillArcs(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XArc* /* arcs */,
- int /* narcs */
-);
-
-extern int XFillPolygon(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XPoint* /* points */,
- int /* npoints */,
- int /* shape */,
- int /* mode */
-);
-
-extern int XFillRectangle(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-
-extern int XFillRectangles(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XRectangle* /* rectangles */,
- int /* nrectangles */
-);
-
-extern int XFlush(
- Display* /* display */
-);
-
-extern int XForceScreenSaver(
- Display* /* display */,
- int /* mode */
-);
-
-extern int XFree(
- void* /* data */
-);
-
-extern int XFreeColormap(
- Display* /* display */,
- Colormap /* colormap */
-);
-
-extern int XFreeColors(
- Display* /* display */,
- Colormap /* colormap */,
- unsigned long* /* pixels */,
- int /* npixels */,
- unsigned long /* planes */
-);
-
-extern int XFreeCursor(
- Display* /* display */,
- Cursor /* cursor */
-);
-
-extern int XFreeExtensionList(
- char** /* list */
-);
-
-extern int XFreeFont(
- Display* /* display */,
- XFontStruct* /* font_struct */
-);
-
-extern int XFreeFontInfo(
- char** /* names */,
- XFontStruct* /* free_info */,
- int /* actual_count */
-);
-
-extern int XFreeFontNames(
- char** /* list */
-);
-
-extern int XFreeFontPath(
- char** /* list */
-);
-
-extern int XFreeGC(
- Display* /* display */,
- GC /* gc */
-);
-
-extern int XFreeModifiermap(
- XModifierKeymap* /* modmap */
-);
-
-extern int XFreePixmap(
- Display* /* display */,
- Pixmap /* pixmap */
-);
-
-extern int XGeometry(
- Display* /* display */,
- int /* screen */,
- _Xconst char* /* position */,
- _Xconst char* /* default_position */,
- unsigned int /* bwidth */,
- unsigned int /* fwidth */,
- unsigned int /* fheight */,
- int /* xadder */,
- int /* yadder */,
- int* /* x_return */,
- int* /* y_return */,
- int* /* width_return */,
- int* /* height_return */
-);
-
-extern int XGetErrorDatabaseText(
- Display* /* display */,
- _Xconst char* /* name */,
- _Xconst char* /* message */,
- _Xconst char* /* default_string */,
- char* /* buffer_return */,
- int /* length */
-);
-
-extern int XGetErrorText(
- Display* /* display */,
- int /* code */,
- char* /* buffer_return */,
- int /* length */
-);
-
-extern Bool XGetFontProperty(
- XFontStruct* /* font_struct */,
- Atom /* atom */,
- unsigned long* /* value_return */
-);
-
-extern Status XGetGCValues(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* valuemask */,
- XGCValues* /* values_return */
-);
-
-extern Status XGetGeometry(
- Display* /* display */,
- Drawable /* d */,
- Window* /* root_return */,
- int* /* x_return */,
- int* /* y_return */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */,
- unsigned int* /* border_width_return */,
- unsigned int* /* depth_return */
-);
-
-extern Status XGetIconName(
- Display* /* display */,
- Window /* w */,
- char** /* icon_name_return */
-);
-
-extern int XGetInputFocus(
- Display* /* display */,
- Window* /* focus_return */,
- int* /* revert_to_return */
-);
-
-extern int XGetKeyboardControl(
- Display* /* display */,
- XKeyboardState* /* values_return */
-);
-
-extern int XGetPointerControl(
- Display* /* display */,
- int* /* accel_numerator_return */,
- int* /* accel_denominator_return */,
- int* /* threshold_return */
-);
-
-extern int XGetPointerMapping(
- Display* /* display */,
- unsigned char* /* map_return */,
- int /* nmap */
-);
-
-extern int XGetScreenSaver(
- Display* /* display */,
- int* /* timeout_return */,
- int* /* interval_return */,
- int* /* prefer_blanking_return */,
- int* /* allow_exposures_return */
-);
-
-extern Status XGetTransientForHint(
- Display* /* display */,
- Window /* w */,
- Window* /* prop_window_return */
-);
-
-extern int XGetWindowProperty(
- Display* /* display */,
- Window /* w */,
- Atom /* property */,
- long /* long_offset */,
- long /* long_length */,
- Bool /* delete */,
- Atom /* req_type */,
- Atom* /* actual_type_return */,
- int* /* actual_format_return */,
- unsigned long* /* nitems_return */,
- unsigned long* /* bytes_after_return */,
- unsigned char** /* prop_return */
-);
-
-extern Status XGetWindowAttributes(
- Display* /* display */,
- Window /* w */,
- XWindowAttributes* /* window_attributes_return */
-);
-
-extern int XGrabButton(
- Display* /* display */,
- unsigned int /* button */,
- unsigned int /* modifiers */,
- Window /* grab_window */,
- Bool /* owner_events */,
- unsigned int /* event_mask */,
- int /* pointer_mode */,
- int /* keyboard_mode */,
- Window /* confine_to */,
- Cursor /* cursor */
-);
-
-extern int XGrabKey(
- Display* /* display */,
- int /* keycode */,
- unsigned int /* modifiers */,
- Window /* grab_window */,
- Bool /* owner_events */,
- int /* pointer_mode */,
- int /* keyboard_mode */
-);
-
-extern int XGrabKeyboard(
- Display* /* display */,
- Window /* grab_window */,
- Bool /* owner_events */,
- int /* pointer_mode */,
- int /* keyboard_mode */,
- Time /* time */
-);
-
-extern int XGrabPointer(
- Display* /* display */,
- Window /* grab_window */,
- Bool /* owner_events */,
- unsigned int /* event_mask */,
- int /* pointer_mode */,
- int /* keyboard_mode */,
- Window /* confine_to */,
- Cursor /* cursor */,
- Time /* time */
-);
-
-extern int XGrabServer(
- Display* /* display */
-);
-
-extern int XHeightMMOfScreen(
- Screen* /* screen */
-);
-
-extern int XHeightOfScreen(
- Screen* /* screen */
-);
-
-extern int XIfEvent(
- Display* /* display */,
- XEvent* /* event_return */,
- Bool (*) (
- Display* /* display */,
- XEvent* /* event */,
- XPointer /* arg */
- ) /* predicate */,
- XPointer /* arg */
-);
-
-extern int XImageByteOrder(
- Display* /* display */
-);
-
-extern int XInstallColormap(
- Display* /* display */,
- Colormap /* colormap */
-);
-
-extern KeyCode XKeysymToKeycode(
- Display* /* display */,
- KeySym /* keysym */
-);
-
-extern int XKillClient(
- Display* /* display */,
- XID /* resource */
-);
-
-extern Status XLookupColor(
- Display* /* display */,
- Colormap /* colormap */,
- _Xconst char* /* color_name */,
- XColor* /* exact_def_return */,
- XColor* /* screen_def_return */
-);
-
-extern int XLowerWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XMapRaised(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XMapSubwindows(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XMapWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XMaskEvent(
- Display* /* display */,
- long /* event_mask */,
- XEvent* /* event_return */
-);
-
-extern int XMaxCmapsOfScreen(
- Screen* /* screen */
-);
-
-extern int XMinCmapsOfScreen(
- Screen* /* screen */
-);
-
-extern int XMoveResizeWindow(
- Display* /* display */,
- Window /* w */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-
-extern int XMoveWindow(
- Display* /* display */,
- Window /* w */,
- int /* x */,
- int /* y */
-);
-
-extern int XNextEvent(
- Display* /* display */,
- XEvent* /* event_return */
-);
-
-extern int XNoOp(
- Display* /* display */
-);
-
-extern Status XParseColor(
- Display* /* display */,
- Colormap /* colormap */,
- _Xconst char* /* spec */,
- XColor* /* exact_def_return */
-);
-
-extern int XParseGeometry(
- _Xconst char* /* parsestring */,
- int* /* x_return */,
- int* /* y_return */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */
-);
-
-extern int XPeekEvent(
- Display* /* display */,
- XEvent* /* event_return */
-);
-
-extern int XPeekIfEvent(
- Display* /* display */,
- XEvent* /* event_return */,
- Bool (*) (
- Display* /* display */,
- XEvent* /* event */,
- XPointer /* arg */
- ) /* predicate */,
- XPointer /* arg */
-);
-
-extern int XPending(
- Display* /* display */
-);
-
-extern int XPlanesOfScreen(
- Screen* /* screen */
-);
-
-extern int XProtocolRevision(
- Display* /* display */
-);
-
-extern int XProtocolVersion(
- Display* /* display */
-);
-
-
-extern int XPutBackEvent(
- Display* /* display */,
- XEvent* /* event */
-);
-
-extern int XPutImage(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- XImage* /* image */,
- int /* src_x */,
- int /* src_y */,
- int /* dest_x */,
- int /* dest_y */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-
-extern int XQLength(
- Display* /* display */
-);
-
-extern Status XQueryBestCursor(
- Display* /* display */,
- Drawable /* d */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */
-);
-
-extern Status XQueryBestSize(
- Display* /* display */,
- int /* class */,
- Drawable /* which_screen */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */
-);
-
-extern Status XQueryBestStipple(
- Display* /* display */,
- Drawable /* which_screen */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */
-);
-
-extern Status XQueryBestTile(
- Display* /* display */,
- Drawable /* which_screen */,
- unsigned int /* width */,
- unsigned int /* height */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */
-);
-
-extern int XQueryColor(
- Display* /* display */,
- Colormap /* colormap */,
- XColor* /* def_in_out */
-);
-
-extern int XQueryColors(
- Display* /* display */,
- Colormap /* colormap */,
- XColor* /* defs_in_out */,
- int /* ncolors */
-);
-
-extern Bool XQueryExtension(
- Display* /* display */,
- _Xconst char* /* name */,
- int* /* major_opcode_return */,
- int* /* first_event_return */,
- int* /* first_error_return */
-);
-
-extern int XQueryKeymap(
- Display* /* display */,
- char [32] /* keys_return */
-);
-
-extern Bool XQueryPointer(
- Display* /* display */,
- Window /* w */,
- Window* /* root_return */,
- Window* /* child_return */,
- int* /* root_x_return */,
- int* /* root_y_return */,
- int* /* win_x_return */,
- int* /* win_y_return */,
- unsigned int* /* mask_return */
-);
-
-extern int XQueryTextExtents(
- Display* /* display */,
- XID /* font_ID */,
- _Xconst char* /* string */,
- int /* nchars */,
- int* /* direction_return */,
- int* /* font_ascent_return */,
- int* /* font_descent_return */,
- XCharStruct* /* overall_return */
-);
-
-extern int XQueryTextExtents16(
- Display* /* display */,
- XID /* font_ID */,
- _Xconst XChar2b* /* string */,
- int /* nchars */,
- int* /* direction_return */,
- int* /* font_ascent_return */,
- int* /* font_descent_return */,
- XCharStruct* /* overall_return */
-);
-
-extern Status XQueryTree(
- Display* /* display */,
- Window /* w */,
- Window* /* root_return */,
- Window* /* parent_return */,
- Window** /* children_return */,
- unsigned int* /* nchildren_return */
-);
-
-extern int XRaiseWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XReadBitmapFile(
- Display* /* display */,
- Drawable /* d */,
- _Xconst char* /* filename */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */,
- Pixmap* /* bitmap_return */,
- int* /* x_hot_return */,
- int* /* y_hot_return */
-);
-
-extern int XReadBitmapFileData(
- _Xconst char* /* filename */,
- unsigned int* /* width_return */,
- unsigned int* /* height_return */,
- unsigned char** /* data_return */,
- int* /* x_hot_return */,
- int* /* y_hot_return */
-);
-
-extern int XRebindKeysym(
- Display* /* display */,
- KeySym /* keysym */,
- KeySym* /* list */,
- int /* mod_count */,
- _Xconst unsigned char* /* string */,
- int /* bytes_string */
-);
-
-extern int XRecolorCursor(
- Display* /* display */,
- Cursor /* cursor */,
- XColor* /* foreground_color */,
- XColor* /* background_color */
-);
-
-extern int XRefreshKeyboardMapping(
- XMappingEvent* /* event_map */
-);
-
-extern int XRemoveFromSaveSet(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XRemoveHost(
- Display* /* display */,
- XHostAddress* /* host */
-);
-
-extern int XRemoveHosts(
- Display* /* display */,
- XHostAddress* /* hosts */,
- int /* num_hosts */
-);
-
-extern int XReparentWindow(
- Display* /* display */,
- Window /* w */,
- Window /* parent */,
- int /* x */,
- int /* y */
-);
-
-extern int XResetScreenSaver(
- Display* /* display */
-);
-
-extern int XResizeWindow(
- Display* /* display */,
- Window /* w */,
- unsigned int /* width */,
- unsigned int /* height */
-);
-
-extern int XRestackWindows(
- Display* /* display */,
- Window* /* windows */,
- int /* nwindows */
-);
-
-extern int XRotateBuffers(
- Display* /* display */,
- int /* rotate */
-);
-
-extern int XRotateWindowProperties(
- Display* /* display */,
- Window /* w */,
- Atom* /* properties */,
- int /* num_prop */,
- int /* npositions */
-);
-
-extern int XScreenCount(
- Display* /* display */
-);
-
-extern int XSelectInput(
- Display* /* display */,
- Window /* w */,
- long /* event_mask */
-);
-
-extern Status XSendEvent(
- Display* /* display */,
- Window /* w */,
- Bool /* propagate */,
- long /* event_mask */,
- XEvent* /* event_send */
-);
-
-extern int XSetAccessControl(
- Display* /* display */,
- int /* mode */
-);
-
-extern int XSetArcMode(
- Display* /* display */,
- GC /* gc */,
- int /* arc_mode */
-);
-
-extern int XSetBackground(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* background */
-);
-
-extern int XSetClipMask(
- Display* /* display */,
- GC /* gc */,
- Pixmap /* pixmap */
-);
-
-extern int XSetClipOrigin(
- Display* /* display */,
- GC /* gc */,
- int /* clip_x_origin */,
- int /* clip_y_origin */
-);
-
-extern int XSetClipRectangles(
- Display* /* display */,
- GC /* gc */,
- int /* clip_x_origin */,
- int /* clip_y_origin */,
- XRectangle* /* rectangles */,
- int /* n */,
- int /* ordering */
-);
-
-extern int XSetCloseDownMode(
- Display* /* display */,
- int /* close_mode */
-);
-
-extern int XSetCommand(
- Display* /* display */,
- Window /* w */,
- char** /* argv */,
- int /* argc */
-);
-
-extern int XSetDashes(
- Display* /* display */,
- GC /* gc */,
- int /* dash_offset */,
- _Xconst char* /* dash_list */,
- int /* n */
-);
-
-extern int XSetFillRule(
- Display* /* display */,
- GC /* gc */,
- int /* fill_rule */
-);
-
-extern int XSetFillStyle(
- Display* /* display */,
- GC /* gc */,
- int /* fill_style */
-);
-
-extern int XSetFont(
- Display* /* display */,
- GC /* gc */,
- Font /* font */
-);
-
-extern int XSetFontPath(
- Display* /* display */,
- char** /* directories */,
- int /* ndirs */
-);
-
-extern int XSetForeground(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* foreground */
-);
-
-extern int XSetFunction(
- Display* /* display */,
- GC /* gc */,
- int /* function */
-);
-
-extern int XSetGraphicsExposures(
- Display* /* display */,
- GC /* gc */,
- Bool /* graphics_exposures */
-);
-
-extern int XSetIconName(
- Display* /* display */,
- Window /* w */,
- _Xconst char* /* icon_name */
-);
-
-extern int XSetInputFocus(
- Display* /* display */,
- Window /* focus */,
- int /* revert_to */,
- Time /* time */
-);
-
-extern int XSetLineAttributes(
- Display* /* display */,
- GC /* gc */,
- unsigned int /* line_width */,
- int /* line_style */,
- int /* cap_style */,
- int /* join_style */
-);
-
-extern int XSetModifierMapping(
- Display* /* display */,
- XModifierKeymap* /* modmap */
-);
-
-extern int XSetPlaneMask(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* plane_mask */
-);
-
-extern int XSetPointerMapping(
- Display* /* display */,
- _Xconst unsigned char* /* map */,
- int /* nmap */
-);
-
-extern int XSetScreenSaver(
- Display* /* display */,
- int /* timeout */,
- int /* interval */,
- int /* prefer_blanking */,
- int /* allow_exposures */
-);
-
-extern int XSetSelectionOwner(
- Display* /* display */,
- Atom /* selection */,
- Window /* owner */,
- Time /* time */
-);
-
-extern int XSetState(
- Display* /* display */,
- GC /* gc */,
- unsigned long /* foreground */,
- unsigned long /* background */,
- int /* function */,
- unsigned long /* plane_mask */
-);
-
-extern int XSetStipple(
- Display* /* display */,
- GC /* gc */,
- Pixmap /* stipple */
-);
-
-extern int XSetSubwindowMode(
- Display* /* display */,
- GC /* gc */,
- int /* subwindow_mode */
-);
-
-extern int XSetTSOrigin(
- Display* /* display */,
- GC /* gc */,
- int /* ts_x_origin */,
- int /* ts_y_origin */
-);
-
-extern int XSetTile(
- Display* /* display */,
- GC /* gc */,
- Pixmap /* tile */
-);
-
-extern int XSetWindowBackground(
- Display* /* display */,
- Window /* w */,
- unsigned long /* background_pixel */
-);
-
-extern int XSetWindowBackgroundPixmap(
- Display* /* display */,
- Window /* w */,
- Pixmap /* background_pixmap */
-);
-
-extern int XSetWindowBorder(
- Display* /* display */,
- Window /* w */,
- unsigned long /* border_pixel */
-);
-
-extern int XSetWindowBorderPixmap(
- Display* /* display */,
- Window /* w */,
- Pixmap /* border_pixmap */
-);
-
-extern int XSetWindowBorderWidth(
- Display* /* display */,
- Window /* w */,
- unsigned int /* width */
-);
-
-extern int XSetWindowColormap(
- Display* /* display */,
- Window /* w */,
- Colormap /* colormap */
-);
-
-extern int XStoreBuffer(
- Display* /* display */,
- _Xconst char* /* bytes */,
- int /* nbytes */,
- int /* buffer */
-);
-
-extern int XStoreBytes(
- Display* /* display */,
- _Xconst char* /* bytes */,
- int /* nbytes */
-);
-
-extern int XStoreColor(
- Display* /* display */,
- Colormap /* colormap */,
- XColor* /* color */
-);
-
-extern int XStoreColors(
- Display* /* display */,
- Colormap /* colormap */,
- XColor* /* color */,
- int /* ncolors */
-);
-
-extern int XStoreName(
- Display* /* display */,
- Window /* w */,
- _Xconst char* /* window_name */
-);
-
-extern int XStoreNamedColor(
- Display* /* display */,
- Colormap /* colormap */,
- _Xconst char* /* color */,
- unsigned long /* pixel */,
- int /* flags */
-);
-
-extern int XSync(
- Display* /* display */,
- Bool /* discard */
-);
-
-extern int XTextExtents(
- XFontStruct* /* font_struct */,
- _Xconst char* /* string */,
- int /* nchars */,
- int* /* direction_return */,
- int* /* font_ascent_return */,
- int* /* font_descent_return */,
- XCharStruct* /* overall_return */
-);
-
-extern int XTextExtents16(
- XFontStruct* /* font_struct */,
- _Xconst XChar2b* /* string */,
- int /* nchars */,
- int* /* direction_return */,
- int* /* font_ascent_return */,
- int* /* font_descent_return */,
- XCharStruct* /* overall_return */
-);
-
-extern int XTextWidth(
- XFontStruct* /* font_struct */,
- _Xconst char* /* string */,
- int /* count */
-);
-
-extern int XTextWidth16(
- XFontStruct* /* font_struct */,
- _Xconst XChar2b* /* string */,
- int /* count */
-);
-
-extern Bool XTranslateCoordinates(
- Display* /* display */,
- Window /* src_w */,
- Window /* dest_w */,
- int /* src_x */,
- int /* src_y */,
- int* /* dest_x_return */,
- int* /* dest_y_return */,
- Window* /* child_return */
-);
-
-extern int XUndefineCursor(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XUngrabButton(
- Display* /* display */,
- unsigned int /* button */,
- unsigned int /* modifiers */,
- Window /* grab_window */
-);
-
-extern int XUngrabKey(
- Display* /* display */,
- int /* keycode */,
- unsigned int /* modifiers */,
- Window /* grab_window */
-);
-
-extern int XUngrabKeyboard(
- Display* /* display */,
- Time /* time */
-);
-
-extern int XUngrabPointer(
- Display* /* display */,
- Time /* time */
-);
-
-extern int XUngrabServer(
- Display* /* display */
-);
-
-extern int XUninstallColormap(
- Display* /* display */,
- Colormap /* colormap */
-);
-
-extern int XUnloadFont(
- Display* /* display */,
- Font /* font */
-);
-
-extern int XUnmapSubwindows(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XUnmapWindow(
- Display* /* display */,
- Window /* w */
-);
-
-extern int XVendorRelease(
- Display* /* display */
-);
-
-extern int XWarpPointer(
- Display* /* display */,
- Window /* src_w */,
- Window /* dest_w */,
- int /* src_x */,
- int /* src_y */,
- unsigned int /* src_width */,
- unsigned int /* src_height */,
- int /* dest_x */,
- int /* dest_y */
-);
-
-extern int XWidthMMOfScreen(
- Screen* /* screen */
-);
-
-extern int XWidthOfScreen(
- Screen* /* screen */
-);
-
-extern int XWindowEvent(
- Display* /* display */,
- Window /* w */,
- long /* event_mask */,
- XEvent* /* event_return */
-);
-
-extern int XWriteBitmapFile(
- Display* /* display */,
- _Xconst char* /* filename */,
- Pixmap /* bitmap */,
- unsigned int /* width */,
- unsigned int /* height */,
- int /* x_hot */,
- int /* y_hot */
-);
-
-extern Bool XSupportsLocale (void);
-
-extern char *XSetLocaleModifiers(
- const char* /* modifier_list */
-);
-
-extern XOM XOpenOM(
- Display* /* display */,
- struct _XrmHashBucketRec* /* rdb */,
- _Xconst char* /* res_name */,
- _Xconst char* /* res_class */
-);
-
-extern Status XCloseOM(
- XOM /* om */
-);
-
-extern char *XSetOMValues(
- XOM /* om */,
- ...
-) _X_SENTINEL(0);
-
-extern char *XGetOMValues(
- XOM /* om */,
- ...
-) _X_SENTINEL(0);
-
-extern Display *XDisplayOfOM(
- XOM /* om */
-);
-
-extern char *XLocaleOfOM(
- XOM /* om */
-);
-
-extern XOC XCreateOC(
- XOM /* om */,
- ...
-) _X_SENTINEL(0);
-
-extern void XDestroyOC(
- XOC /* oc */
-);
-
-extern XOM XOMOfOC(
- XOC /* oc */
-);
-
-extern char *XSetOCValues(
- XOC /* oc */,
- ...
-) _X_SENTINEL(0);
-
-extern char *XGetOCValues(
- XOC /* oc */,
- ...
-) _X_SENTINEL(0);
-
-extern XFontSet XCreateFontSet(
- Display* /* display */,
- _Xconst char* /* base_font_name_list */,
- char*** /* missing_charset_list */,
- int* /* missing_charset_count */,
- char** /* def_string */
-);
-
-extern void XFreeFontSet(
- Display* /* display */,
- XFontSet /* font_set */
-);
-
-extern int XFontsOfFontSet(
- XFontSet /* font_set */,
- XFontStruct*** /* font_struct_list */,
- char*** /* font_name_list */
-);
-
-extern char *XBaseFontNameListOfFontSet(
- XFontSet /* font_set */
-);
-
-extern char *XLocaleOfFontSet(
- XFontSet /* font_set */
-);
-
-extern Bool XContextDependentDrawing(
- XFontSet /* font_set */
-);
-
-extern Bool XDirectionalDependentDrawing(
- XFontSet /* font_set */
-);
-
-extern Bool XContextualDrawing(
- XFontSet /* font_set */
-);
-
-extern XFontSetExtents *XExtentsOfFontSet(
- XFontSet /* font_set */
-);
-
-extern int XmbTextEscapement(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern int XwcTextEscapement(
- XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
- int /* num_wchars */
-);
-
-extern int Xutf8TextEscapement(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern int XmbTextExtents(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern int XwcTextExtents(
- XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
- int /* num_wchars */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern int Xutf8TextExtents(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern Status XmbTextPerCharExtents(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */,
- XRectangle* /* ink_extents_buffer */,
- XRectangle* /* logical_extents_buffer */,
- int /* buffer_size */,
- int* /* num_chars */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern Status XwcTextPerCharExtents(
- XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
- int /* num_wchars */,
- XRectangle* /* ink_extents_buffer */,
- XRectangle* /* logical_extents_buffer */,
- int /* buffer_size */,
- int* /* num_chars */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern Status Xutf8TextPerCharExtents(
- XFontSet /* font_set */,
- _Xconst char* /* text */,
- int /* bytes_text */,
- XRectangle* /* ink_extents_buffer */,
- XRectangle* /* logical_extents_buffer */,
- int /* buffer_size */,
- int* /* num_chars */,
- XRectangle* /* overall_ink_return */,
- XRectangle* /* overall_logical_return */
-);
-
-extern void XmbDrawText(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- XmbTextItem* /* text_items */,
- int /* nitems */
-);
-
-extern void XwcDrawText(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- XwcTextItem* /* text_items */,
- int /* nitems */
-);
-
-extern void Xutf8DrawText(
- Display* /* display */,
- Drawable /* d */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- XmbTextItem* /* text_items */,
- int /* nitems */
-);
-
-extern void XmbDrawString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern void XwcDrawString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst wchar_t* /* text */,
- int /* num_wchars */
-);
-
-extern void Xutf8DrawString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern void XmbDrawImageString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern void XwcDrawImageString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst wchar_t* /* text */,
- int /* num_wchars */
-);
-
-extern void Xutf8DrawImageString(
- Display* /* display */,
- Drawable /* d */,
- XFontSet /* font_set */,
- GC /* gc */,
- int /* x */,
- int /* y */,
- _Xconst char* /* text */,
- int /* bytes_text */
-);
-
-extern XIM XOpenIM(
- Display* /* dpy */,
- struct _XrmHashBucketRec* /* rdb */,
- char* /* res_name */,
- char* /* res_class */
-);
-
-extern Status XCloseIM(
- XIM /* im */
-);
-
-extern char *XGetIMValues(
- XIM /* im */, ...
-) _X_SENTINEL(0);
-
-extern char *XSetIMValues(
- XIM /* im */, ...
-) _X_SENTINEL(0);
-
-extern Display *XDisplayOfIM(
- XIM /* im */
-);
-
-extern char *XLocaleOfIM(
- XIM /* im*/
-);
-
-extern XIC XCreateIC(
- XIM /* im */, ...
-) _X_SENTINEL(0);
-
-extern void XDestroyIC(
- XIC /* ic */
-);
-
-extern void XSetICFocus(
- XIC /* ic */
-);
-
-extern void XUnsetICFocus(
- XIC /* ic */
-);
-
-extern wchar_t *XwcResetIC(
- XIC /* ic */
-);
-
-extern char *XmbResetIC(
- XIC /* ic */
-);
-
-extern char *Xutf8ResetIC(
- XIC /* ic */
-);
-
-extern char *XSetICValues(
- XIC /* ic */, ...
-) _X_SENTINEL(0);
-
-extern char *XGetICValues(
- XIC /* ic */, ...
-) _X_SENTINEL(0);
-
-extern XIM XIMOfIC(
- XIC /* ic */
-);
-
-extern Bool XFilterEvent(
- XEvent* /* event */,
- Window /* window */
-);
-
-extern int XmbLookupString(
- XIC /* ic */,
- XKeyPressedEvent* /* event */,
- char* /* buffer_return */,
- int /* bytes_buffer */,
- KeySym* /* keysym_return */,
- Status* /* status_return */
-);
-
-extern int XwcLookupString(
- XIC /* ic */,
- XKeyPressedEvent* /* event */,
- wchar_t* /* buffer_return */,
- int /* wchars_buffer */,
- KeySym* /* keysym_return */,
- Status* /* status_return */
-);
-
-extern int Xutf8LookupString(
- XIC /* ic */,
- XKeyPressedEvent* /* event */,
- char* /* buffer_return */,
- int /* bytes_buffer */,
- KeySym* /* keysym_return */,
- Status* /* status_return */
-);
-
-extern XVaNestedList XVaCreateNestedList(
- int /*unused*/, ...
-) _X_SENTINEL(0);
-
-/* internal connections for IMs */
-
-extern Bool XRegisterIMInstantiateCallback(
- Display* /* dpy */,
- struct _XrmHashBucketRec* /* rdb */,
- char* /* res_name */,
- char* /* res_class */,
- XIDProc /* callback */,
- XPointer /* client_data */
-);
-
-extern Bool XUnregisterIMInstantiateCallback(
- Display* /* dpy */,
- struct _XrmHashBucketRec* /* rdb */,
- char* /* res_name */,
- char* /* res_class */,
- XIDProc /* callback */,
- XPointer /* client_data */
-);
-
-typedef void (*XConnectionWatchProc)(
- Display* /* dpy */,
- XPointer /* client_data */,
- int /* fd */,
- Bool /* opening */, /* open or close flag */
- XPointer* /* watch_data */ /* open sets, close uses */
-);
-
-
-extern Status XInternalConnectionNumbers(
- Display* /* dpy */,
- int** /* fd_return */,
- int* /* count_return */
-);
-
-extern void XProcessInternalConnection(
- Display* /* dpy */,
- int /* fd */
-);
-
-extern Status XAddConnectionWatch(
- Display* /* dpy */,
- XConnectionWatchProc /* callback */,
- XPointer /* client_data */
-);
-
-extern void XRemoveConnectionWatch(
- Display* /* dpy */,
- XConnectionWatchProc /* callback */,
- XPointer /* client_data */
-);
-
-extern void XSetAuthorization(
- char * /* name */,
- int /* namelen */,
- char * /* data */,
- int /* datalen */
-);
-
-extern int _Xmbtowc(
- wchar_t * /* wstr */,
-#ifdef ISC
- char const * /* str */,
- size_t /* len */
-#else
- char * /* str */,
- int /* len */
-#endif
-);
-
-extern int _Xwctomb(
- char * /* str */,
- wchar_t /* wc */
-);
-
-extern Bool XGetEventData(
- Display* /* dpy */,
- XGenericEventCookie* /* cookie*/
-);
-
-extern void XFreeEventData(
- Display* /* dpy */,
- XGenericEventCookie* /* cookie*/
-);
-
-_XFUNCPROTOEND
-
-#endif /* _X11_XLIB_H_ */
+/* + +Copyright 1985, 1986, 1987, 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + + +/* + * Xlib.h - Header definition and support file for the C subroutine + * interface library (Xlib) to the X Window System Protocol (V11). + * Structures and symbols starting with "_" are private to the library. + */ +#ifndef _X11_XLIB_H_ +#define _X11_XLIB_H_ + +#define XlibSpecificationRelease 6 + +#include <sys/types.h> + +#if defined(__SCO__) || defined(__UNIXWARE__) +#include <stdint.h> +#endif + +#include <X11/X.h> + +/* applications should not depend on these two headers being included! */ +#include <X11/Xfuncproto.h> +#include <X11/Xosdefs.h> + +#ifndef X_WCHAR +#include <stddef.h> +#else +#ifdef __UNIXOS2__ +#include <stdlib.h> +#else +/* replace this with #include or typedef appropriate for your system */ +typedef unsigned long wchar_t; +#endif +#endif + +#if defined(ISC) && defined(USE_XMBTOWC) +#define wctomb(a,b) _Xwctomb(a,b) +#define mblen(a,b) _Xmblen(a,b) +#ifndef USE_XWCHAR_STRING +#define mbtowc(a,b,c) _Xmbtowc(a,b,c) +#endif +#endif + +extern int +_Xmblen( +#ifdef ISC + char const *str, + size_t len +#else + char *str, + int len +#endif + ); + +/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in + November 2000. Its presence is indicated through the following macro. */ +#define X_HAVE_UTF8_STRING 1 + +typedef char *XPointer; + +typedef int Bool; +typedef int Status; +#define True 1 +#define False 0 + +#define QueuedAlready 0 +#define QueuedAfterReading 1 +#define QueuedAfterFlush 2 + +#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd) +#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) +#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) +#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) +#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) +#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc) +#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) +#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) +#define AllPlanes ((unsigned long)~0L) +#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen) +#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) +#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) +#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth) +#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight) +#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) +#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries) +#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens) +#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor) +#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version) +#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version) +#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release) +#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name) +#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) +#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) +#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit) +#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order) +#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad) +#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order) +#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */ +#define NextRequest(dpy) XNextRequest(dpy) +#else +#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1) +#endif +#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read) + +/* macros for screen oriented applications (toolkit) */ +#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) +#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy)) +#define DisplayOfScreen(s) ((s)->display) +#define RootWindowOfScreen(s) ((s)->root) +#define BlackPixelOfScreen(s) ((s)->black_pixel) +#define WhitePixelOfScreen(s) ((s)->white_pixel) +#define DefaultColormapOfScreen(s)((s)->cmap) +#define DefaultDepthOfScreen(s) ((s)->root_depth) +#define DefaultGCOfScreen(s) ((s)->default_gc) +#define DefaultVisualOfScreen(s)((s)->root_visual) +#define WidthOfScreen(s) ((s)->width) +#define HeightOfScreen(s) ((s)->height) +#define WidthMMOfScreen(s) ((s)->mwidth) +#define HeightMMOfScreen(s) ((s)->mheight) +#define PlanesOfScreen(s) ((s)->root_depth) +#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) +#define MinCmapsOfScreen(s) ((s)->min_maps) +#define MaxCmapsOfScreen(s) ((s)->max_maps) +#define DoesSaveUnders(s) ((s)->save_unders) +#define DoesBackingStore(s) ((s)->backing_store) +#define EventMaskOfScreen(s) ((s)->root_input_mask) + +/* + * Extensions need a way to hang private data on some structures. + */ +typedef struct _XExtData { + int number; /* number returned by XRegisterExtension */ + struct _XExtData *next; /* next item on list of data for structure */ + int (*free_private)( /* called to free private storage */ + struct _XExtData *extension + ); + XPointer private_data; /* data private to this extension. */ +} XExtData; + +/* + * This file contains structures used by the extension mechanism. + */ +typedef struct { /* public to extension, cannot be changed */ + int extension; /* extension number */ + int major_opcode; /* major op-code assigned by server */ + int first_event; /* first event number for the extension */ + int first_error; /* first error number for the extension */ +} XExtCodes; + +/* + * Data structure for retrieving info about pixmap formats. + */ + +typedef struct { + int depth; + int bits_per_pixel; + int scanline_pad; +} XPixmapFormatValues; + + +/* + * Data structure for setting graphics context. + */ +typedef struct { + int function; /* logical operation */ + unsigned long plane_mask;/* plane mask */ + unsigned long foreground;/* foreground pixel */ + unsigned long background;/* background pixel */ + int line_width; /* line width */ + int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ + int cap_style; /* CapNotLast, CapButt, + CapRound, CapProjecting */ + int join_style; /* JoinMiter, JoinRound, JoinBevel */ + int fill_style; /* FillSolid, FillTiled, + FillStippled, FillOpaeueStippled */ + int fill_rule; /* EvenOddRule, WindingRule */ + int arc_mode; /* ArcChord, ArcPieSlice */ + Pixmap tile; /* tile pixmap for tiling operations */ + Pixmap stipple; /* stipple 1 plane pixmap for stipping */ + int ts_x_origin; /* offset for tile or stipple operations */ + int ts_y_origin; + Font font; /* default text font for text operations */ + int subwindow_mode; /* ClipByChildren, IncludeInferiors */ + Bool graphics_exposures;/* boolean, should exposures be generated */ + int clip_x_origin; /* origin for clipping */ + int clip_y_origin; + Pixmap clip_mask; /* bitmap clipping; other calls for rects */ + int dash_offset; /* patterned/dashed line information */ + char dashes; +} XGCValues; + +/* + * Graphics context. The contents of this structure are implementation + * dependent. A GC should be treated as opaque by application code. + */ + +typedef struct _XGC +#ifdef XLIB_ILLEGAL_ACCESS +{ + XExtData *ext_data; /* hook for extension to hang data */ + GContext gid; /* protocol ID for graphics context */ + /* there is more to this structure, but it is private to Xlib */ +} +#endif +*GC; + +/* + * Visual structure; contains information about colormapping possible. + */ +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + VisualID visualid; /* visual id of this visual */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ class of screen (monochrome, etc.) */ +#else + int class; /* class of screen (monochrome, etc.) */ +#endif + unsigned long red_mask, green_mask, blue_mask; /* mask values */ + int bits_per_rgb; /* log base 2 of distinct color values */ + int map_entries; /* color map entries */ +} Visual; + +/* + * Depth structure; contains information for each possible depth. + */ +typedef struct { + int depth; /* this depth (Z) of the depth */ + int nvisuals; /* number of Visual types at this depth */ + Visual *visuals; /* list of visuals possible at this depth */ +} Depth; + +/* + * Information about the screen. The contents of this structure are + * implementation dependent. A Screen should be treated as opaque + * by application code. + */ + +struct _XDisplay; /* Forward declare before use for C++ */ + +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + struct _XDisplay *display;/* back pointer to display structure */ + Window root; /* Root window id. */ + int width, height; /* width and height of screen */ + int mwidth, mheight; /* width and height of in millimeters */ + int ndepths; /* number of depths possible */ + Depth *depths; /* list of allowable depths on the screen */ + int root_depth; /* bits per pixel */ + Visual *root_visual; /* root visual */ + GC default_gc; /* GC for the root root visual */ + Colormap cmap; /* default color map */ + unsigned long white_pixel; + unsigned long black_pixel; /* White and Black pixel values */ + int max_maps, min_maps; /* max and min color maps */ + int backing_store; /* Never, WhenMapped, Always */ + Bool save_unders; + long root_input_mask; /* initial root input mask */ +} Screen; + +/* + * Format structure; describes ZFormat data the screen will understand. + */ +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + int depth; /* depth of this image format */ + int bits_per_pixel; /* bits/pixel at this depth */ + int scanline_pad; /* scanline must padded to this multiple */ +} ScreenFormat; + +/* + * Data structure for setting window attributes. + */ +typedef struct { + Pixmap background_pixmap; /* background or None or ParentRelative */ + unsigned long background_pixel; /* background pixel */ + Pixmap border_pixmap; /* border of the window */ + unsigned long border_pixel; /* border pixel value */ + int bit_gravity; /* one of bit gravity values */ + int win_gravity; /* one of the window gravity values */ + int backing_store; /* NotUseful, WhenMapped, Always */ + unsigned long backing_planes;/* planes to be preseved if possible */ + unsigned long backing_pixel;/* value to use in restoring planes */ + Bool save_under; /* should bits under be saved? (popups) */ + long event_mask; /* set of events that should be saved */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Colormap colormap; /* color map to be associated with window */ + Cursor cursor; /* cursor to be displayed (or None) */ +} XSetWindowAttributes; + +typedef struct { + int x, y; /* location of window */ + int width, height; /* width and height of window */ + int border_width; /* border width of window */ + int depth; /* depth of window */ + Visual *visual; /* the associated visual structure */ + Window root; /* root of screen containing window */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ InputOutput, InputOnly*/ +#else + int class; /* InputOutput, InputOnly*/ +#endif + int bit_gravity; /* one of bit gravity values */ + int win_gravity; /* one of the window gravity values */ + int backing_store; /* NotUseful, WhenMapped, Always */ + unsigned long backing_planes;/* planes to be preserved if possible */ + unsigned long backing_pixel;/* value to be used when restoring planes */ + Bool save_under; /* boolean, should bits under be saved? */ + Colormap colormap; /* color map to be associated with window */ + Bool map_installed; /* boolean, is color map currently installed*/ + int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ + long all_event_masks; /* set of events all people have interest in*/ + long your_event_mask; /* my event mask */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Screen *screen; /* back pointer to correct screen */ +} XWindowAttributes; + +/* + * Data structure for host setting; getting routines. + * + */ + +typedef struct { + int family; /* for example FamilyInternet */ + int length; /* length of address, in bytes */ + char *address; /* pointer to where to find the bytes */ +} XHostAddress; + +/* + * Data structure for ServerFamilyInterpreted addresses in host routines + */ +typedef struct { + int typelength; /* length of type string, in bytes */ + int valuelength; /* length of value string, in bytes */ + char *type; /* pointer to where to find the type string */ + char *value; /* pointer to where to find the address */ +} XServerInterpretedAddress; + +/* + * Data structure for "image" data, used by image manipulation routines. + */ +typedef struct _XImage { + int width, height; /* size of image */ + int xoffset; /* number of pixels offset in X direction */ + int format; /* XYBitmap, XYPixmap, ZPixmap */ + char *data; /* pointer to image data */ + int byte_order; /* data byte order, LSBFirst, MSBFirst */ + int bitmap_unit; /* quant. of scanline 8, 16, 32 */ + int bitmap_bit_order; /* LSBFirst, MSBFirst */ + int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ + int depth; /* depth of image */ + int bytes_per_line; /* accelarator to next line */ + int bits_per_pixel; /* bits per pixel (ZPixmap) */ + unsigned long red_mask; /* bits in z arrangment */ + unsigned long green_mask; + unsigned long blue_mask; + XPointer obdata; /* hook for the object routines to hang on */ + struct funcs { /* image manipulation routines */ + struct _XImage *(*create_image)( + struct _XDisplay* /* display */, + Visual* /* visual */, + unsigned int /* depth */, + int /* format */, + int /* offset */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + int /* bitmap_pad */, + int /* bytes_per_line */); + int (*destroy_image) (struct _XImage *); + unsigned long (*get_pixel) (struct _XImage *, int, int); + int (*put_pixel) (struct _XImage *, int, int, unsigned long); + struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); + int (*add_pixel) (struct _XImage *, long); + } f; +} XImage; + +/* + * Data structure for XReconfigureWindow + */ +typedef struct { + int x, y; + int width, height; + int border_width; + Window sibling; + int stack_mode; +} XWindowChanges; + +/* + * Data structure used by color operations + */ +typedef struct { + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ + char pad; +} XColor; + +/* + * Data structures for graphics operations. On most machines, these are + * congruent with the wire protocol structures, so reformatting the data + * can be avoided on these architectures. + */ +typedef struct { + short x1, y1, x2, y2; +} XSegment; + +typedef struct { + short x, y; +} XPoint; + +typedef struct { + short x, y; + unsigned short width, height; +} XRectangle; + +typedef struct { + short x, y; + unsigned short width, height; + short angle1, angle2; +} XArc; + + +/* Data structure for XChangeKeyboardControl */ + +typedef struct { + int key_click_percent; + int bell_percent; + int bell_pitch; + int bell_duration; + int led; + int led_mode; + int key; + int auto_repeat_mode; /* On, Off, Default */ +} XKeyboardControl; + +/* Data structure for XGetKeyboardControl */ + +typedef struct { + int key_click_percent; + int bell_percent; + unsigned int bell_pitch, bell_duration; + unsigned long led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKeyboardState; + +/* Data structure for XGetMotionEvents. */ + +typedef struct { + Time time; + short x, y; +} XTimeCoord; + +/* Data structure for X{Set,Get}ModifierMapping */ + +typedef struct { + int max_keypermod; /* The server's max # of keys per modifier */ + KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ +} XModifierKeymap; + + +/* + * Display datatype maintaining display specific data. + * The contents of this structure are implementation dependent. + * A Display should be treated as opaque by application code. + */ +#ifndef XLIB_ILLEGAL_ACCESS +typedef struct _XDisplay Display; +#endif + +struct _XPrivate; /* Forward declare before use for C++ */ +struct _XrmHashBucketRec; + +typedef struct +#ifdef XLIB_ILLEGAL_ACCESS +_XDisplay +#endif +{ + XExtData *ext_data; /* hook for extension to hang data */ + struct _XPrivate *private1; + int fd; /* Network socket. */ + int private2; + int proto_major_version;/* major version of server's X protocol */ + int proto_minor_version;/* minor version of servers X protocol */ + char *vendor; /* vendor of the server hardware */ + XID private3; + XID private4; + XID private5; + int private6; + XID (*resource_alloc)( /* allocator function */ + struct _XDisplay* + ); + int byte_order; /* screen byte order, LSBFirst, MSBFirst */ + int bitmap_unit; /* padding and data requirements */ + int bitmap_pad; /* padding requirements on bitmaps */ + int bitmap_bit_order; /* LeastSignificant or MostSignificant */ + int nformats; /* number of pixmap formats in list */ + ScreenFormat *pixmap_format; /* pixmap format list */ + int private8; + int release; /* release of the server */ + struct _XPrivate *private9, *private10; + int qlen; /* Length of input event queue */ + unsigned long last_request_read; /* seq number of last event read */ + unsigned long request; /* sequence number of last request. */ + XPointer private11; + XPointer private12; + XPointer private13; + XPointer private14; + unsigned max_request_size; /* maximum number 32 bit words in request*/ + struct _XrmHashBucketRec *db; + int (*private15)( + struct _XDisplay* + ); + char *display_name; /* "host:display" string used on this connect*/ + int default_screen; /* default screen for operations */ + int nscreens; /* number of screens on this server*/ + Screen *screens; /* pointer to list of screens */ + unsigned long motion_buffer; /* size of motion buffer */ + unsigned long private16; + int min_keycode; /* minimum defined keycode */ + int max_keycode; /* maximum defined keycode */ + XPointer private17; + XPointer private18; + int private19; + char *xdefaults; /* contents of defaults from server */ + /* there is more to this structure, but it is private to Xlib */ +} +#ifdef XLIB_ILLEGAL_ACCESS +Display, +#endif +*_XPrivDisplay; + +#undef _XEVENT_ +#ifndef _XEVENT_ +/* + * Definitions of specific events. + */ +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window it is reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int keycode; /* detail */ + Bool same_screen; /* same screen flag */ +} XKeyEvent; +typedef XKeyEvent XKeyPressedEvent; +typedef XKeyEvent XKeyReleasedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window it is reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int button; /* detail */ + Bool same_screen; /* same screen flag */ +} XButtonEvent; +typedef XButtonEvent XButtonPressedEvent; +typedef XButtonEvent XButtonReleasedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + char is_hint; /* detail */ + Bool same_screen; /* same screen flag */ +} XMotionEvent; +typedef XMotionEvent XPointerMovedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual + */ + Bool same_screen; /* same screen flag */ + Bool focus; /* boolean focus */ + unsigned int state; /* key or button mask */ +} XCrossingEvent; +typedef XCrossingEvent XEnterWindowEvent; +typedef XCrossingEvent XLeaveWindowEvent; + +typedef struct { + int type; /* FocusIn or FocusOut */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* window of event */ + int mode; /* NotifyNormal, NotifyWhileGrabbed, + NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + */ +} XFocusChangeEvent; +typedef XFocusChangeEvent XFocusInEvent; +typedef XFocusChangeEvent XFocusOutEvent; + +/* generated on EnterWindow and FocusIn when KeyMapState selected */ +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + char key_vector[32]; +} XKeymapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ +} XExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ + int major_code; /* core is CopyArea or CopyPlane */ + int minor_code; /* not defined in the core */ +} XGraphicsExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; + int major_code; /* core is CopyArea or CopyPlane */ + int minor_code; /* not defined in the core */ +} XNoExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int state; /* Visibility state */ +} XVisibilityEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; /* parent of the window */ + Window window; /* window id of window created */ + int x, y; /* window location */ + int width, height; /* size of window */ + int border_width; /* border width */ + Bool override_redirect; /* creation should be overridden */ +} XCreateWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; +} XDestroyWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool from_configure; +} XUnmapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool override_redirect; /* boolean, is override set... */ +} XMapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; +} XMapRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Window parent; + int x, y; + Bool override_redirect; +} XReparentEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int x, y; + int width, height; + int border_width; + Window above; + Bool override_redirect; +} XConfigureEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int x, y; +} XGravityEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int width, height; +} XResizeRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; + int x, y; + int width, height; + int border_width; + Window above; + int detail; /* Above, Below, TopIf, BottomIf, Opposite */ + unsigned long value_mask; +} XConfigureRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int place; /* PlaceOnTop, PlaceOnBottom */ +} XCirculateEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; + int place; /* PlaceOnTop, PlaceOnBottom */ +} XCirculateRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom atom; + Time time; + int state; /* NewValue, Deleted */ +} XPropertyEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom selection; + Time time; +} XSelectionClearEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window owner; + Window requestor; + Atom selection; + Atom target; + Atom property; + Time time; +} XSelectionRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window requestor; + Atom selection; + Atom target; + Atom property; /* ATOM or None */ + Time time; +} XSelectionEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Colormap colormap; /* COLORMAP or None */ +#if defined(__cplusplus) || defined(c_plusplus) + Bool c_new; /* C++ */ +#else + Bool new; +#endif + int state; /* ColormapInstalled, ColormapUninstalled */ +} XColormapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom message_type; + int format; + union { + char b[20]; + short s[10]; + long l[5]; + } data; +} XClientMessageEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* unused */ + int request; /* one of MappingModifier, MappingKeyboard, + MappingPointer */ + int first_keycode; /* first keycode */ + int count; /* defines range of change w. first_keycode*/ +} XMappingEvent; + +typedef struct { + int type; + Display *display; /* Display the event was read from */ + XID resourceid; /* resource id */ + unsigned long serial; /* serial number of failed request */ + unsigned char error_code; /* error code of failed request */ + unsigned char request_code; /* Major op-code of failed request */ + unsigned char minor_code; /* Minor op-code of failed request */ +} XErrorEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display;/* Display the event was read from */ + Window window; /* window on which event was requested in event mask */ +} XAnyEvent; + + +/*************************************************************** + * + * GenericEvent. This event is the standard event for all newer extensions. + */ + +typedef struct + { + int type; /* of event. Always GenericEvent */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + int extension; /* major opcode of extension that caused the event */ + int evtype; /* actual event type. */ + } XGenericEvent; + +typedef struct { + int type; /* of event. Always GenericEvent */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + int extension; /* major opcode of extension that caused the event */ + int evtype; /* actual event type. */ + unsigned int cookie; + void *data; +} XGenericEventCookie; + +/* + * this union is defined so Xlib can always use the same sized + * event structure internally, to avoid memory fragmentation. + */ +typedef union _XEvent { + int type; /* must not be changed; first element */ + XAnyEvent xany; + XKeyEvent xkey; + XButtonEvent xbutton; + XMotionEvent xmotion; + XCrossingEvent xcrossing; + XFocusChangeEvent xfocus; + XExposeEvent xexpose; + XGraphicsExposeEvent xgraphicsexpose; + XNoExposeEvent xnoexpose; + XVisibilityEvent xvisibility; + XCreateWindowEvent xcreatewindow; + XDestroyWindowEvent xdestroywindow; + XUnmapEvent xunmap; + XMapEvent xmap; + XMapRequestEvent xmaprequest; + XReparentEvent xreparent; + XConfigureEvent xconfigure; + XGravityEvent xgravity; + XResizeRequestEvent xresizerequest; + XConfigureRequestEvent xconfigurerequest; + XCirculateEvent xcirculate; + XCirculateRequestEvent xcirculaterequest; + XPropertyEvent xproperty; + XSelectionClearEvent xselectionclear; + XSelectionRequestEvent xselectionrequest; + XSelectionEvent xselection; + XColormapEvent xcolormap; + XClientMessageEvent xclient; + XMappingEvent xmapping; + XErrorEvent xerror; + XKeymapEvent xkeymap; + XGenericEvent xgeneric; + XGenericEventCookie xcookie; + long pad[24]; +} XEvent; +#endif + +#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy))) + +/* + * per character font metric information. + */ +typedef struct { + short lbearing; /* origin to left edge of raster */ + short rbearing; /* origin to right edge of raster */ + short width; /* advance to next char's origin */ + short ascent; /* baseline to top edge of raster */ + short descent; /* baseline to bottom edge of raster */ + unsigned short attributes; /* per char flags (not predefined) */ +} XCharStruct; + +/* + * To allow arbitrary information with fonts, there are additional properties + * returned. + */ +typedef struct { + Atom name; + unsigned long card32; +} XFontProp; + +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + Font fid; /* Font id for this font */ + unsigned direction; /* hint about direction the font is painted */ + unsigned min_char_or_byte2;/* first character */ + unsigned max_char_or_byte2;/* last character */ + unsigned min_byte1; /* first row that exists */ + unsigned max_byte1; /* last row that exists */ + Bool all_chars_exist;/* flag if all characters have non-zero size*/ + unsigned default_char; /* char to print for undefined character */ + int n_properties; /* how many properties there are */ + XFontProp *properties; /* pointer to array of additional properties*/ + XCharStruct min_bounds; /* minimum bounds over all existing char*/ + XCharStruct max_bounds; /* maximum bounds over all existing char*/ + XCharStruct *per_char; /* first_char to last_char information */ + int ascent; /* log. extent above baseline for spacing */ + int descent; /* log. descent below baseline for spacing */ +} XFontStruct; + +/* + * PolyText routines take these as arguments. + */ +typedef struct { + char *chars; /* pointer to string */ + int nchars; /* number of characters */ + int delta; /* delta between strings */ + Font font; /* font to print it in, None don't change */ +} XTextItem; + +typedef struct { /* normal 16 bit characters are two bytes */ + unsigned char byte1; + unsigned char byte2; +} XChar2b; + +typedef struct { + XChar2b *chars; /* two byte characters */ + int nchars; /* number of characters */ + int delta; /* delta between strings */ + Font font; /* font to print it in, None don't change */ +} XTextItem16; + + +typedef union { Display *display; + GC gc; + Visual *visual; + Screen *screen; + ScreenFormat *pixmap_format; + XFontStruct *font; } XEDataObject; + +typedef struct { + XRectangle max_ink_extent; + XRectangle max_logical_extent; +} XFontSetExtents; + +/* unused: +typedef void (*XOMProc)(); + */ + +typedef struct _XOM *XOM; +typedef struct _XOC *XOC, *XFontSet; + +typedef struct { + char *chars; + int nchars; + int delta; + XFontSet font_set; +} XmbTextItem; + +typedef struct { + wchar_t *chars; + int nchars; + int delta; + XFontSet font_set; +} XwcTextItem; + +#define XNRequiredCharSet "requiredCharSet" +#define XNQueryOrientation "queryOrientation" +#define XNBaseFontName "baseFontName" +#define XNOMAutomatic "omAutomatic" +#define XNMissingCharSet "missingCharSet" +#define XNDefaultString "defaultString" +#define XNOrientation "orientation" +#define XNDirectionalDependentDrawing "directionalDependentDrawing" +#define XNContextualDrawing "contextualDrawing" +#define XNFontInfo "fontInfo" + +typedef struct { + int charset_count; + char **charset_list; +} XOMCharSetList; + +typedef enum { + XOMOrientation_LTR_TTB, + XOMOrientation_RTL_TTB, + XOMOrientation_TTB_LTR, + XOMOrientation_TTB_RTL, + XOMOrientation_Context +} XOrientation; + +typedef struct { + int num_orientation; + XOrientation *orientation; /* Input Text description */ +} XOMOrientation; + +typedef struct { + int num_font; + XFontStruct **font_struct_list; + char **font_name_list; +} XOMFontInfo; + +typedef struct _XIM *XIM; +typedef struct _XIC *XIC; + +typedef void (*XIMProc)( + XIM, + XPointer, + XPointer +); + +typedef Bool (*XICProc)( + XIC, + XPointer, + XPointer +); + +typedef void (*XIDProc)( + Display*, + XPointer, + XPointer +); + +typedef unsigned long XIMStyle; + +typedef struct { + unsigned short count_styles; + XIMStyle *supported_styles; +} XIMStyles; + +#define XIMPreeditArea 0x0001L +#define XIMPreeditCallbacks 0x0002L +#define XIMPreeditPosition 0x0004L +#define XIMPreeditNothing 0x0008L +#define XIMPreeditNone 0x0010L +#define XIMStatusArea 0x0100L +#define XIMStatusCallbacks 0x0200L +#define XIMStatusNothing 0x0400L +#define XIMStatusNone 0x0800L + +#define XNVaNestedList "XNVaNestedList" +#define XNQueryInputStyle "queryInputStyle" +#define XNClientWindow "clientWindow" +#define XNInputStyle "inputStyle" +#define XNFocusWindow "focusWindow" +#define XNResourceName "resourceName" +#define XNResourceClass "resourceClass" +#define XNGeometryCallback "geometryCallback" +#define XNDestroyCallback "destroyCallback" +#define XNFilterEvents "filterEvents" +#define XNPreeditStartCallback "preeditStartCallback" +#define XNPreeditDoneCallback "preeditDoneCallback" +#define XNPreeditDrawCallback "preeditDrawCallback" +#define XNPreeditCaretCallback "preeditCaretCallback" +#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" +#define XNPreeditAttributes "preeditAttributes" +#define XNStatusStartCallback "statusStartCallback" +#define XNStatusDoneCallback "statusDoneCallback" +#define XNStatusDrawCallback "statusDrawCallback" +#define XNStatusAttributes "statusAttributes" +#define XNArea "area" +#define XNAreaNeeded "areaNeeded" +#define XNSpotLocation "spotLocation" +#define XNColormap "colorMap" +#define XNStdColormap "stdColorMap" +#define XNForeground "foreground" +#define XNBackground "background" +#define XNBackgroundPixmap "backgroundPixmap" +#define XNFontSet "fontSet" +#define XNLineSpace "lineSpace" +#define XNCursor "cursor" + +#define XNQueryIMValuesList "queryIMValuesList" +#define XNQueryICValuesList "queryICValuesList" +#define XNVisiblePosition "visiblePosition" +#define XNR6PreeditCallback "r6PreeditCallback" +#define XNStringConversionCallback "stringConversionCallback" +#define XNStringConversion "stringConversion" +#define XNResetState "resetState" +#define XNHotKey "hotKey" +#define XNHotKeyState "hotKeyState" +#define XNPreeditState "preeditState" +#define XNSeparatorofNestedList "separatorofNestedList" + +#define XBufferOverflow -1 +#define XLookupNone 1 +#define XLookupChars 2 +#define XLookupKeySym 3 +#define XLookupBoth 4 + +typedef void *XVaNestedList; + +typedef struct { + XPointer client_data; + XIMProc callback; +} XIMCallback; + +typedef struct { + XPointer client_data; + XICProc callback; +} XICCallback; + +typedef unsigned long XIMFeedback; + +#define XIMReverse 1L +#define XIMUnderline (1L<<1) +#define XIMHighlight (1L<<2) +#define XIMPrimary (1L<<5) +#define XIMSecondary (1L<<6) +#define XIMTertiary (1L<<7) +#define XIMVisibleToForward (1L<<8) +#define XIMVisibleToBackword (1L<<9) +#define XIMVisibleToCenter (1L<<10) + +typedef struct _XIMText { + unsigned short length; + XIMFeedback *feedback; + Bool encoding_is_wchar; + union { + char *multi_byte; + wchar_t *wide_char; + } string; +} XIMText; + +typedef unsigned long XIMPreeditState; + +#define XIMPreeditUnKnown 0L +#define XIMPreeditEnable 1L +#define XIMPreeditDisable (1L<<1) + +typedef struct _XIMPreeditStateNotifyCallbackStruct { + XIMPreeditState state; +} XIMPreeditStateNotifyCallbackStruct; + +typedef unsigned long XIMResetState; + +#define XIMInitialState 1L +#define XIMPreserveState (1L<<1) + +typedef unsigned long XIMStringConversionFeedback; + +#define XIMStringConversionLeftEdge (0x00000001) +#define XIMStringConversionRightEdge (0x00000002) +#define XIMStringConversionTopEdge (0x00000004) +#define XIMStringConversionBottomEdge (0x00000008) +#define XIMStringConversionConcealed (0x00000010) +#define XIMStringConversionWrapped (0x00000020) + +typedef struct _XIMStringConversionText { + unsigned short length; + XIMStringConversionFeedback *feedback; + Bool encoding_is_wchar; + union { + char *mbs; + wchar_t *wcs; + } string; +} XIMStringConversionText; + +typedef unsigned short XIMStringConversionPosition; + +typedef unsigned short XIMStringConversionType; + +#define XIMStringConversionBuffer (0x0001) +#define XIMStringConversionLine (0x0002) +#define XIMStringConversionWord (0x0003) +#define XIMStringConversionChar (0x0004) + +typedef unsigned short XIMStringConversionOperation; + +#define XIMStringConversionSubstitution (0x0001) +#define XIMStringConversionRetrieval (0x0002) + +typedef enum { + XIMForwardChar, XIMBackwardChar, + XIMForwardWord, XIMBackwardWord, + XIMCaretUp, XIMCaretDown, + XIMNextLine, XIMPreviousLine, + XIMLineStart, XIMLineEnd, + XIMAbsolutePosition, + XIMDontChange +} XIMCaretDirection; + +typedef struct _XIMStringConversionCallbackStruct { + XIMStringConversionPosition position; + XIMCaretDirection direction; + XIMStringConversionOperation operation; + unsigned short factor; + XIMStringConversionText *text; +} XIMStringConversionCallbackStruct; + +typedef struct _XIMPreeditDrawCallbackStruct { + int caret; /* Cursor offset within pre-edit string */ + int chg_first; /* Starting change position */ + int chg_length; /* Length of the change in character count */ + XIMText *text; +} XIMPreeditDrawCallbackStruct; + +typedef enum { + XIMIsInvisible, /* Disable caret feedback */ + XIMIsPrimary, /* UI defined caret feedback */ + XIMIsSecondary /* UI defined caret feedback */ +} XIMCaretStyle; + +typedef struct _XIMPreeditCaretCallbackStruct { + int position; /* Caret offset within pre-edit string */ + XIMCaretDirection direction; /* Caret moves direction */ + XIMCaretStyle style; /* Feedback of the caret */ +} XIMPreeditCaretCallbackStruct; + +typedef enum { + XIMTextType, + XIMBitmapType +} XIMStatusDataType; + +typedef struct _XIMStatusDrawCallbackStruct { + XIMStatusDataType type; + union { + XIMText *text; + Pixmap bitmap; + } data; +} XIMStatusDrawCallbackStruct; + +typedef struct _XIMHotKeyTrigger { + KeySym keysym; + int modifier; + int modifier_mask; +} XIMHotKeyTrigger; + +typedef struct _XIMHotKeyTriggers { + int num_hot_key; + XIMHotKeyTrigger *key; +} XIMHotKeyTriggers; + +typedef unsigned long XIMHotKeyState; + +#define XIMHotKeyStateON (0x0001L) +#define XIMHotKeyStateOFF (0x0002L) + +typedef struct { + unsigned short count_values; + char **supported_values; +} XIMValuesList; + +_XFUNCPROTOBEGIN + +#if defined(WIN32) && !defined(_XLIBINT_) +#define _Xdebug (*_Xdebug_p) +#endif + +extern int _Xdebug; + +extern XFontStruct *XLoadQueryFont( + Display* /* display */, + _Xconst char* /* name */ +); + +extern XFontStruct *XQueryFont( + Display* /* display */, + XID /* font_ID */ +); + + +extern XTimeCoord *XGetMotionEvents( + Display* /* display */, + Window /* w */, + Time /* start */, + Time /* stop */, + int* /* nevents_return */ +); + +extern XModifierKeymap *XDeleteModifiermapEntry( + XModifierKeymap* /* modmap */, +#if NeedWidePrototypes + unsigned int /* keycode_entry */, +#else + KeyCode /* keycode_entry */, +#endif + int /* modifier */ +); + +extern XModifierKeymap *XGetModifierMapping( + Display* /* display */ +); + +extern XModifierKeymap *XInsertModifiermapEntry( + XModifierKeymap* /* modmap */, +#if NeedWidePrototypes + unsigned int /* keycode_entry */, +#else + KeyCode /* keycode_entry */, +#endif + int /* modifier */ +); + +extern XModifierKeymap *XNewModifiermap( + int /* max_keys_per_mod */ +); + +extern XImage *XCreateImage( + Display* /* display */, + Visual* /* visual */, + unsigned int /* depth */, + int /* format */, + int /* offset */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + int /* bitmap_pad */, + int /* bytes_per_line */ +); +extern Status XInitImage( + XImage* /* image */ +); +extern XImage *XGetImage( + Display* /* display */, + Drawable /* d */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* plane_mask */, + int /* format */ +); +extern XImage *XGetSubImage( + Display* /* display */, + Drawable /* d */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* plane_mask */, + int /* format */, + XImage* /* dest_image */, + int /* dest_x */, + int /* dest_y */ +); + +/* + * X function declarations. + */ +extern Display *XOpenDisplay( + _Xconst char* /* display_name */ +); + +extern void XrmInitialize( + void +); + +extern char *XFetchBytes( + Display* /* display */, + int* /* nbytes_return */ +); +extern char *XFetchBuffer( + Display* /* display */, + int* /* nbytes_return */, + int /* buffer */ +); +extern char *XGetAtomName( + Display* /* display */, + Atom /* atom */ +); +extern Status XGetAtomNames( + Display* /* dpy */, + Atom* /* atoms */, + int /* count */, + char** /* names_return */ +); +extern char *XGetDefault( + Display* /* display */, + _Xconst char* /* program */, + _Xconst char* /* option */ +); +extern char *XDisplayName( + _Xconst char* /* string */ +); +extern char *XKeysymToString( + KeySym /* keysym */ +); + +extern int (*XSynchronize( + Display* /* display */, + Bool /* onoff */ +))( + Display* /* display */ +); +extern int (*XSetAfterFunction( + Display* /* display */, + int (*) ( + Display* /* display */ + ) /* procedure */ +))( + Display* /* display */ +); +extern Atom XInternAtom( + Display* /* display */, + _Xconst char* /* atom_name */, + Bool /* only_if_exists */ +); +extern Status XInternAtoms( + Display* /* dpy */, + char** /* names */, + int /* count */, + Bool /* onlyIfExists */, + Atom* /* atoms_return */ +); +extern Colormap XCopyColormapAndFree( + Display* /* display */, + Colormap /* colormap */ +); +extern Colormap XCreateColormap( + Display* /* display */, + Window /* w */, + Visual* /* visual */, + int /* alloc */ +); +extern Cursor XCreatePixmapCursor( + Display* /* display */, + Pixmap /* source */, + Pixmap /* mask */, + XColor* /* foreground_color */, + XColor* /* background_color */, + unsigned int /* x */, + unsigned int /* y */ +); +extern Cursor XCreateGlyphCursor( + Display* /* display */, + Font /* source_font */, + Font /* mask_font */, + unsigned int /* source_char */, + unsigned int /* mask_char */, + XColor _Xconst * /* foreground_color */, + XColor _Xconst * /* background_color */ +); +extern Cursor XCreateFontCursor( + Display* /* display */, + unsigned int /* shape */ +); +extern Font XLoadFont( + Display* /* display */, + _Xconst char* /* name */ +); +extern GC XCreateGC( + Display* /* display */, + Drawable /* d */, + unsigned long /* valuemask */, + XGCValues* /* values */ +); +extern GContext XGContextFromGC( + GC /* gc */ +); +extern void XFlushGC( + Display* /* display */, + GC /* gc */ +); +extern Pixmap XCreatePixmap( + Display* /* display */, + Drawable /* d */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* depth */ +); +extern Pixmap XCreateBitmapFromData( + Display* /* display */, + Drawable /* d */, + _Xconst char* /* data */, + unsigned int /* width */, + unsigned int /* height */ +); +extern Pixmap XCreatePixmapFromBitmapData( + Display* /* display */, + Drawable /* d */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* fg */, + unsigned long /* bg */, + unsigned int /* depth */ +); +extern Window XCreateSimpleWindow( + Display* /* display */, + Window /* parent */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* border_width */, + unsigned long /* border */, + unsigned long /* background */ +); +extern Window XGetSelectionOwner( + Display* /* display */, + Atom /* selection */ +); +extern Window XCreateWindow( + Display* /* display */, + Window /* parent */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* border_width */, + int /* depth */, + unsigned int /* class */, + Visual* /* visual */, + unsigned long /* valuemask */, + XSetWindowAttributes* /* attributes */ +); +extern Colormap *XListInstalledColormaps( + Display* /* display */, + Window /* w */, + int* /* num_return */ +); +extern char **XListFonts( + Display* /* display */, + _Xconst char* /* pattern */, + int /* maxnames */, + int* /* actual_count_return */ +); +extern char **XListFontsWithInfo( + Display* /* display */, + _Xconst char* /* pattern */, + int /* maxnames */, + int* /* count_return */, + XFontStruct** /* info_return */ +); +extern char **XGetFontPath( + Display* /* display */, + int* /* npaths_return */ +); +extern char **XListExtensions( + Display* /* display */, + int* /* nextensions_return */ +); +extern Atom *XListProperties( + Display* /* display */, + Window /* w */, + int* /* num_prop_return */ +); +extern XHostAddress *XListHosts( + Display* /* display */, + int* /* nhosts_return */, + Bool* /* state_return */ +); +extern KeySym XKeycodeToKeysym( + Display* /* display */, +#if NeedWidePrototypes + unsigned int /* keycode */, +#else + KeyCode /* keycode */, +#endif + int /* index */ +); +extern KeySym XLookupKeysym( + XKeyEvent* /* key_event */, + int /* index */ +); +extern KeySym *XGetKeyboardMapping( + Display* /* display */, +#if NeedWidePrototypes + unsigned int /* first_keycode */, +#else + KeyCode /* first_keycode */, +#endif + int /* keycode_count */, + int* /* keysyms_per_keycode_return */ +); +extern KeySym XStringToKeysym( + _Xconst char* /* string */ +); +extern long XMaxRequestSize( + Display* /* display */ +); +extern long XExtendedMaxRequestSize( + Display* /* display */ +); +extern char *XResourceManagerString( + Display* /* display */ +); +extern char *XScreenResourceString( + Screen* /* screen */ +); +extern unsigned long XDisplayMotionBufferSize( + Display* /* display */ +); +extern VisualID XVisualIDFromVisual( + Visual* /* visual */ +); + +/* multithread routines */ + +extern Status XInitThreads( + void +); + +extern void XLockDisplay( + Display* /* display */ +); + +extern void XUnlockDisplay( + Display* /* display */ +); + +/* routines for dealing with extensions */ + +extern XExtCodes *XInitExtension( + Display* /* display */, + _Xconst char* /* name */ +); + +extern XExtCodes *XAddExtension( + Display* /* display */ +); +extern XExtData *XFindOnExtensionList( + XExtData** /* structure */, + int /* number */ +); +extern XExtData **XEHeadOfExtensionList( + XEDataObject /* object */ +); + +/* these are routines for which there are also macros */ +extern Window XRootWindow( + Display* /* display */, + int /* screen_number */ +); +extern Window XDefaultRootWindow( + Display* /* display */ +); +extern Window XRootWindowOfScreen( + Screen* /* screen */ +); +extern Visual *XDefaultVisual( + Display* /* display */, + int /* screen_number */ +); +extern Visual *XDefaultVisualOfScreen( + Screen* /* screen */ +); +extern GC XDefaultGC( + Display* /* display */, + int /* screen_number */ +); +extern GC XDefaultGCOfScreen( + Screen* /* screen */ +); +extern unsigned long XBlackPixel( + Display* /* display */, + int /* screen_number */ +); +extern unsigned long XWhitePixel( + Display* /* display */, + int /* screen_number */ +); +extern unsigned long XAllPlanes( + void +); +extern unsigned long XBlackPixelOfScreen( + Screen* /* screen */ +); +extern unsigned long XWhitePixelOfScreen( + Screen* /* screen */ +); +extern unsigned long XNextRequest( + Display* /* display */ +); +extern unsigned long XLastKnownRequestProcessed( + Display* /* display */ +); +extern char *XServerVendor( + Display* /* display */ +); +extern char *XDisplayString( + Display* /* display */ +); +extern Colormap XDefaultColormap( + Display* /* display */, + int /* screen_number */ +); +extern Colormap XDefaultColormapOfScreen( + Screen* /* screen */ +); +extern Display *XDisplayOfScreen( + Screen* /* screen */ +); +extern Screen *XScreenOfDisplay( + Display* /* display */, + int /* screen_number */ +); +extern Screen *XDefaultScreenOfDisplay( + Display* /* display */ +); +extern long XEventMaskOfScreen( + Screen* /* screen */ +); + +extern int XScreenNumberOfScreen( + Screen* /* screen */ +); + +typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */, + XErrorEvent* /* error_event */ +); + +extern XErrorHandler XSetErrorHandler ( + XErrorHandler /* handler */ +); + + +typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); + +extern XIOErrorHandler XSetIOErrorHandler ( + XIOErrorHandler /* handler */ +); + + +extern XPixmapFormatValues *XListPixmapFormats( + Display* /* display */, + int* /* count_return */ +); +extern int *XListDepths( + Display* /* display */, + int /* screen_number */, + int* /* count_return */ +); + +/* ICCCM routines for things that don't require special include files; */ +/* other declarations are given in Xutil.h */ +extern Status XReconfigureWMWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */, + unsigned int /* mask */, + XWindowChanges* /* changes */ +); + +extern Status XGetWMProtocols( + Display* /* display */, + Window /* w */, + Atom** /* protocols_return */, + int* /* count_return */ +); +extern Status XSetWMProtocols( + Display* /* display */, + Window /* w */, + Atom* /* protocols */, + int /* count */ +); +extern Status XIconifyWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */ +); +extern Status XWithdrawWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */ +); +extern Status XGetCommand( + Display* /* display */, + Window /* w */, + char*** /* argv_return */, + int* /* argc_return */ +); +extern Status XGetWMColormapWindows( + Display* /* display */, + Window /* w */, + Window** /* windows_return */, + int* /* count_return */ +); +extern Status XSetWMColormapWindows( + Display* /* display */, + Window /* w */, + Window* /* colormap_windows */, + int /* count */ +); +extern void XFreeStringList( + char** /* list */ +); +extern int XSetTransientForHint( + Display* /* display */, + Window /* w */, + Window /* prop_window */ +); + +/* The following are given in alphabetical order */ + +extern int XActivateScreenSaver( + Display* /* display */ +); + +extern int XAddHost( + Display* /* display */, + XHostAddress* /* host */ +); + +extern int XAddHosts( + Display* /* display */, + XHostAddress* /* hosts */, + int /* num_hosts */ +); + +extern int XAddToExtensionList( + struct _XExtData** /* structure */, + XExtData* /* ext_data */ +); + +extern int XAddToSaveSet( + Display* /* display */, + Window /* w */ +); + +extern Status XAllocColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* screen_in_out */ +); + +extern Status XAllocColorCells( + Display* /* display */, + Colormap /* colormap */, + Bool /* contig */, + unsigned long* /* plane_masks_return */, + unsigned int /* nplanes */, + unsigned long* /* pixels_return */, + unsigned int /* npixels */ +); + +extern Status XAllocColorPlanes( + Display* /* display */, + Colormap /* colormap */, + Bool /* contig */, + unsigned long* /* pixels_return */, + int /* ncolors */, + int /* nreds */, + int /* ngreens */, + int /* nblues */, + unsigned long* /* rmask_return */, + unsigned long* /* gmask_return */, + unsigned long* /* bmask_return */ +); + +extern Status XAllocNamedColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color_name */, + XColor* /* screen_def_return */, + XColor* /* exact_def_return */ +); + +extern int XAllowEvents( + Display* /* display */, + int /* event_mode */, + Time /* time */ +); + +extern int XAutoRepeatOff( + Display* /* display */ +); + +extern int XAutoRepeatOn( + Display* /* display */ +); + +extern int XBell( + Display* /* display */, + int /* percent */ +); + +extern int XBitmapBitOrder( + Display* /* display */ +); + +extern int XBitmapPad( + Display* /* display */ +); + +extern int XBitmapUnit( + Display* /* display */ +); + +extern int XCellsOfScreen( + Screen* /* screen */ +); + +extern int XChangeActivePointerGrab( + Display* /* display */, + unsigned int /* event_mask */, + Cursor /* cursor */, + Time /* time */ +); + +extern int XChangeGC( + Display* /* display */, + GC /* gc */, + unsigned long /* valuemask */, + XGCValues* /* values */ +); + +extern int XChangeKeyboardControl( + Display* /* display */, + unsigned long /* value_mask */, + XKeyboardControl* /* values */ +); + +extern int XChangeKeyboardMapping( + Display* /* display */, + int /* first_keycode */, + int /* keysyms_per_keycode */, + KeySym* /* keysyms */, + int /* num_codes */ +); + +extern int XChangePointerControl( + Display* /* display */, + Bool /* do_accel */, + Bool /* do_threshold */, + int /* accel_numerator */, + int /* accel_denominator */, + int /* threshold */ +); + +extern int XChangeProperty( + Display* /* display */, + Window /* w */, + Atom /* property */, + Atom /* type */, + int /* format */, + int /* mode */, + _Xconst unsigned char* /* data */, + int /* nelements */ +); + +extern int XChangeSaveSet( + Display* /* display */, + Window /* w */, + int /* change_mode */ +); + +extern int XChangeWindowAttributes( + Display* /* display */, + Window /* w */, + unsigned long /* valuemask */, + XSetWindowAttributes* /* attributes */ +); + +extern Bool XCheckIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern Bool XCheckMaskEvent( + Display* /* display */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern Bool XCheckTypedEvent( + Display* /* display */, + int /* event_type */, + XEvent* /* event_return */ +); + +extern Bool XCheckTypedWindowEvent( + Display* /* display */, + Window /* w */, + int /* event_type */, + XEvent* /* event_return */ +); + +extern Bool XCheckWindowEvent( + Display* /* display */, + Window /* w */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XCirculateSubwindows( + Display* /* display */, + Window /* w */, + int /* direction */ +); + +extern int XCirculateSubwindowsDown( + Display* /* display */, + Window /* w */ +); + +extern int XCirculateSubwindowsUp( + Display* /* display */, + Window /* w */ +); + +extern int XClearArea( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + Bool /* exposures */ +); + +extern int XClearWindow( + Display* /* display */, + Window /* w */ +); + +extern int XCloseDisplay( + Display* /* display */ +); + +extern int XConfigureWindow( + Display* /* display */, + Window /* w */, + unsigned int /* value_mask */, + XWindowChanges* /* values */ +); + +extern int XConnectionNumber( + Display* /* display */ +); + +extern int XConvertSelection( + Display* /* display */, + Atom /* selection */, + Atom /* target */, + Atom /* property */, + Window /* requestor */, + Time /* time */ +); + +extern int XCopyArea( + Display* /* display */, + Drawable /* src */, + Drawable /* dest */, + GC /* gc */, + int /* src_x */, + int /* src_y */, + unsigned int /* width */, + unsigned int /* height */, + int /* dest_x */, + int /* dest_y */ +); + +extern int XCopyGC( + Display* /* display */, + GC /* src */, + unsigned long /* valuemask */, + GC /* dest */ +); + +extern int XCopyPlane( + Display* /* display */, + Drawable /* src */, + Drawable /* dest */, + GC /* gc */, + int /* src_x */, + int /* src_y */, + unsigned int /* width */, + unsigned int /* height */, + int /* dest_x */, + int /* dest_y */, + unsigned long /* plane */ +); + +extern int XDefaultDepth( + Display* /* display */, + int /* screen_number */ +); + +extern int XDefaultDepthOfScreen( + Screen* /* screen */ +); + +extern int XDefaultScreen( + Display* /* display */ +); + +extern int XDefineCursor( + Display* /* display */, + Window /* w */, + Cursor /* cursor */ +); + +extern int XDeleteProperty( + Display* /* display */, + Window /* w */, + Atom /* property */ +); + +extern int XDestroyWindow( + Display* /* display */, + Window /* w */ +); + +extern int XDestroySubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XDoesBackingStore( + Screen* /* screen */ +); + +extern Bool XDoesSaveUnders( + Screen* /* screen */ +); + +extern int XDisableAccessControl( + Display* /* display */ +); + + +extern int XDisplayCells( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayHeight( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayHeightMM( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayKeycodes( + Display* /* display */, + int* /* min_keycodes_return */, + int* /* max_keycodes_return */ +); + +extern int XDisplayPlanes( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayWidth( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayWidthMM( + Display* /* display */, + int /* screen_number */ +); + +extern int XDrawArc( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + int /* angle1 */, + int /* angle2 */ +); + +extern int XDrawArcs( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XArc* /* arcs */, + int /* narcs */ +); + +extern int XDrawImageString( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* string */, + int /* length */ +); + +extern int XDrawImageString16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst XChar2b* /* string */, + int /* length */ +); + +extern int XDrawLine( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x1 */, + int /* y1 */, + int /* x2 */, + int /* y2 */ +); + +extern int XDrawLines( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* mode */ +); + +extern int XDrawPoint( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */ +); + +extern int XDrawPoints( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* mode */ +); + +extern int XDrawRectangle( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XDrawRectangles( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XRectangle* /* rectangles */, + int /* nrectangles */ +); + +extern int XDrawSegments( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XSegment* /* segments */, + int /* nsegments */ +); + +extern int XDrawString( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* string */, + int /* length */ +); + +extern int XDrawString16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst XChar2b* /* string */, + int /* length */ +); + +extern int XDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XTextItem* /* items */, + int /* nitems */ +); + +extern int XDrawText16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XTextItem16* /* items */, + int /* nitems */ +); + +extern int XEnableAccessControl( + Display* /* display */ +); + +extern int XEventsQueued( + Display* /* display */, + int /* mode */ +); + +extern Status XFetchName( + Display* /* display */, + Window /* w */, + char** /* window_name_return */ +); + +extern int XFillArc( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + int /* angle1 */, + int /* angle2 */ +); + +extern int XFillArcs( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XArc* /* arcs */, + int /* narcs */ +); + +extern int XFillPolygon( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* shape */, + int /* mode */ +); + +extern int XFillRectangle( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XFillRectangles( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XRectangle* /* rectangles */, + int /* nrectangles */ +); + +extern int XFlush( + Display* /* display */ +); + +extern int XForceScreenSaver( + Display* /* display */, + int /* mode */ +); + +extern int XFree( + void* /* data */ +); + +extern int XFreeColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern int XFreeColors( + Display* /* display */, + Colormap /* colormap */, + unsigned long* /* pixels */, + int /* npixels */, + unsigned long /* planes */ +); + +extern int XFreeCursor( + Display* /* display */, + Cursor /* cursor */ +); + +extern int XFreeExtensionList( + char** /* list */ +); + +extern int XFreeFont( + Display* /* display */, + XFontStruct* /* font_struct */ +); + +extern int XFreeFontInfo( + char** /* names */, + XFontStruct* /* free_info */, + int /* actual_count */ +); + +extern int XFreeFontNames( + char** /* list */ +); + +extern int XFreeFontPath( + char** /* list */ +); + +extern int XFreeGC( + Display* /* display */, + GC /* gc */ +); + +extern int XFreeModifiermap( + XModifierKeymap* /* modmap */ +); + +extern int XFreePixmap( + Display* /* display */, + Pixmap /* pixmap */ +); + +extern int XGeometry( + Display* /* display */, + int /* screen */, + _Xconst char* /* position */, + _Xconst char* /* default_position */, + unsigned int /* bwidth */, + unsigned int /* fwidth */, + unsigned int /* fheight */, + int /* xadder */, + int /* yadder */, + int* /* x_return */, + int* /* y_return */, + int* /* width_return */, + int* /* height_return */ +); + +extern int XGetErrorDatabaseText( + Display* /* display */, + _Xconst char* /* name */, + _Xconst char* /* message */, + _Xconst char* /* default_string */, + char* /* buffer_return */, + int /* length */ +); + +extern int XGetErrorText( + Display* /* display */, + int /* code */, + char* /* buffer_return */, + int /* length */ +); + +extern Bool XGetFontProperty( + XFontStruct* /* font_struct */, + Atom /* atom */, + unsigned long* /* value_return */ +); + +extern Status XGetGCValues( + Display* /* display */, + GC /* gc */, + unsigned long /* valuemask */, + XGCValues* /* values_return */ +); + +extern Status XGetGeometry( + Display* /* display */, + Drawable /* d */, + Window* /* root_return */, + int* /* x_return */, + int* /* y_return */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + unsigned int* /* border_width_return */, + unsigned int* /* depth_return */ +); + +extern Status XGetIconName( + Display* /* display */, + Window /* w */, + char** /* icon_name_return */ +); + +extern int XGetInputFocus( + Display* /* display */, + Window* /* focus_return */, + int* /* revert_to_return */ +); + +extern int XGetKeyboardControl( + Display* /* display */, + XKeyboardState* /* values_return */ +); + +extern int XGetPointerControl( + Display* /* display */, + int* /* accel_numerator_return */, + int* /* accel_denominator_return */, + int* /* threshold_return */ +); + +extern int XGetPointerMapping( + Display* /* display */, + unsigned char* /* map_return */, + int /* nmap */ +); + +extern int XGetScreenSaver( + Display* /* display */, + int* /* timeout_return */, + int* /* interval_return */, + int* /* prefer_blanking_return */, + int* /* allow_exposures_return */ +); + +extern Status XGetTransientForHint( + Display* /* display */, + Window /* w */, + Window* /* prop_window_return */ +); + +extern int XGetWindowProperty( + Display* /* display */, + Window /* w */, + Atom /* property */, + long /* long_offset */, + long /* long_length */, + Bool /* delete */, + Atom /* req_type */, + Atom* /* actual_type_return */, + int* /* actual_format_return */, + unsigned long* /* nitems_return */, + unsigned long* /* bytes_after_return */, + unsigned char** /* prop_return */ +); + +extern Status XGetWindowAttributes( + Display* /* display */, + Window /* w */, + XWindowAttributes* /* window_attributes_return */ +); + +extern int XGrabButton( + Display* /* display */, + unsigned int /* button */, + unsigned int /* modifiers */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */ +); + +extern int XGrabKey( + Display* /* display */, + int /* keycode */, + unsigned int /* modifiers */, + Window /* grab_window */, + Bool /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */ +); + +extern int XGrabKeyboard( + Display* /* display */, + Window /* grab_window */, + Bool /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */, + Time /* time */ +); + +extern int XGrabPointer( + Display* /* display */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */, + Time /* time */ +); + +extern int XGrabServer( + Display* /* display */ +); + +extern int XHeightMMOfScreen( + Screen* /* screen */ +); + +extern int XHeightOfScreen( + Screen* /* screen */ +); + +extern int XIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern int XImageByteOrder( + Display* /* display */ +); + +extern int XInstallColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern KeyCode XKeysymToKeycode( + Display* /* display */, + KeySym /* keysym */ +); + +extern int XKillClient( + Display* /* display */, + XID /* resource */ +); + +extern Status XLookupColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color_name */, + XColor* /* exact_def_return */, + XColor* /* screen_def_return */ +); + +extern int XLowerWindow( + Display* /* display */, + Window /* w */ +); + +extern int XMapRaised( + Display* /* display */, + Window /* w */ +); + +extern int XMapSubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XMapWindow( + Display* /* display */, + Window /* w */ +); + +extern int XMaskEvent( + Display* /* display */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XMaxCmapsOfScreen( + Screen* /* screen */ +); + +extern int XMinCmapsOfScreen( + Screen* /* screen */ +); + +extern int XMoveResizeWindow( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XMoveWindow( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */ +); + +extern int XNextEvent( + Display* /* display */, + XEvent* /* event_return */ +); + +extern int XNoOp( + Display* /* display */ +); + +extern Status XParseColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* spec */, + XColor* /* exact_def_return */ +); + +extern int XParseGeometry( + _Xconst char* /* parsestring */, + int* /* x_return */, + int* /* y_return */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern int XPeekEvent( + Display* /* display */, + XEvent* /* event_return */ +); + +extern int XPeekIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern int XPending( + Display* /* display */ +); + +extern int XPlanesOfScreen( + Screen* /* screen */ +); + +extern int XProtocolRevision( + Display* /* display */ +); + +extern int XProtocolVersion( + Display* /* display */ +); + + +extern int XPutBackEvent( + Display* /* display */, + XEvent* /* event */ +); + +extern int XPutImage( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XImage* /* image */, + int /* src_x */, + int /* src_y */, + int /* dest_x */, + int /* dest_y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XQLength( + Display* /* display */ +); + +extern Status XQueryBestCursor( + Display* /* display */, + Drawable /* d */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestSize( + Display* /* display */, + int /* class */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestStipple( + Display* /* display */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestTile( + Display* /* display */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern int XQueryColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* def_in_out */ +); + +extern int XQueryColors( + Display* /* display */, + Colormap /* colormap */, + XColor* /* defs_in_out */, + int /* ncolors */ +); + +extern Bool XQueryExtension( + Display* /* display */, + _Xconst char* /* name */, + int* /* major_opcode_return */, + int* /* first_event_return */, + int* /* first_error_return */ +); + +extern int XQueryKeymap( + Display* /* display */, + char [32] /* keys_return */ +); + +extern Bool XQueryPointer( + Display* /* display */, + Window /* w */, + Window* /* root_return */, + Window* /* child_return */, + int* /* root_x_return */, + int* /* root_y_return */, + int* /* win_x_return */, + int* /* win_y_return */, + unsigned int* /* mask_return */ +); + +extern int XQueryTextExtents( + Display* /* display */, + XID /* font_ID */, + _Xconst char* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XQueryTextExtents16( + Display* /* display */, + XID /* font_ID */, + _Xconst XChar2b* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern Status XQueryTree( + Display* /* display */, + Window /* w */, + Window* /* root_return */, + Window* /* parent_return */, + Window** /* children_return */, + unsigned int* /* nchildren_return */ +); + +extern int XRaiseWindow( + Display* /* display */, + Window /* w */ +); + +extern int XReadBitmapFile( + Display* /* display */, + Drawable /* d */, + _Xconst char* /* filename */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + Pixmap* /* bitmap_return */, + int* /* x_hot_return */, + int* /* y_hot_return */ +); + +extern int XReadBitmapFileData( + _Xconst char* /* filename */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + unsigned char** /* data_return */, + int* /* x_hot_return */, + int* /* y_hot_return */ +); + +extern int XRebindKeysym( + Display* /* display */, + KeySym /* keysym */, + KeySym* /* list */, + int /* mod_count */, + _Xconst unsigned char* /* string */, + int /* bytes_string */ +); + +extern int XRecolorCursor( + Display* /* display */, + Cursor /* cursor */, + XColor* /* foreground_color */, + XColor* /* background_color */ +); + +extern int XRefreshKeyboardMapping( + XMappingEvent* /* event_map */ +); + +extern int XRemoveFromSaveSet( + Display* /* display */, + Window /* w */ +); + +extern int XRemoveHost( + Display* /* display */, + XHostAddress* /* host */ +); + +extern int XRemoveHosts( + Display* /* display */, + XHostAddress* /* hosts */, + int /* num_hosts */ +); + +extern int XReparentWindow( + Display* /* display */, + Window /* w */, + Window /* parent */, + int /* x */, + int /* y */ +); + +extern int XResetScreenSaver( + Display* /* display */ +); + +extern int XResizeWindow( + Display* /* display */, + Window /* w */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XRestackWindows( + Display* /* display */, + Window* /* windows */, + int /* nwindows */ +); + +extern int XRotateBuffers( + Display* /* display */, + int /* rotate */ +); + +extern int XRotateWindowProperties( + Display* /* display */, + Window /* w */, + Atom* /* properties */, + int /* num_prop */, + int /* npositions */ +); + +extern int XScreenCount( + Display* /* display */ +); + +extern int XSelectInput( + Display* /* display */, + Window /* w */, + long /* event_mask */ +); + +extern Status XSendEvent( + Display* /* display */, + Window /* w */, + Bool /* propagate */, + long /* event_mask */, + XEvent* /* event_send */ +); + +extern int XSetAccessControl( + Display* /* display */, + int /* mode */ +); + +extern int XSetArcMode( + Display* /* display */, + GC /* gc */, + int /* arc_mode */ +); + +extern int XSetBackground( + Display* /* display */, + GC /* gc */, + unsigned long /* background */ +); + +extern int XSetClipMask( + Display* /* display */, + GC /* gc */, + Pixmap /* pixmap */ +); + +extern int XSetClipOrigin( + Display* /* display */, + GC /* gc */, + int /* clip_x_origin */, + int /* clip_y_origin */ +); + +extern int XSetClipRectangles( + Display* /* display */, + GC /* gc */, + int /* clip_x_origin */, + int /* clip_y_origin */, + XRectangle* /* rectangles */, + int /* n */, + int /* ordering */ +); + +extern int XSetCloseDownMode( + Display* /* display */, + int /* close_mode */ +); + +extern int XSetCommand( + Display* /* display */, + Window /* w */, + char** /* argv */, + int /* argc */ +); + +extern int XSetDashes( + Display* /* display */, + GC /* gc */, + int /* dash_offset */, + _Xconst char* /* dash_list */, + int /* n */ +); + +extern int XSetFillRule( + Display* /* display */, + GC /* gc */, + int /* fill_rule */ +); + +extern int XSetFillStyle( + Display* /* display */, + GC /* gc */, + int /* fill_style */ +); + +extern int XSetFont( + Display* /* display */, + GC /* gc */, + Font /* font */ +); + +extern int XSetFontPath( + Display* /* display */, + char** /* directories */, + int /* ndirs */ +); + +extern int XSetForeground( + Display* /* display */, + GC /* gc */, + unsigned long /* foreground */ +); + +extern int XSetFunction( + Display* /* display */, + GC /* gc */, + int /* function */ +); + +extern int XSetGraphicsExposures( + Display* /* display */, + GC /* gc */, + Bool /* graphics_exposures */ +); + +extern int XSetIconName( + Display* /* display */, + Window /* w */, + _Xconst char* /* icon_name */ +); + +extern int XSetInputFocus( + Display* /* display */, + Window /* focus */, + int /* revert_to */, + Time /* time */ +); + +extern int XSetLineAttributes( + Display* /* display */, + GC /* gc */, + unsigned int /* line_width */, + int /* line_style */, + int /* cap_style */, + int /* join_style */ +); + +extern int XSetModifierMapping( + Display* /* display */, + XModifierKeymap* /* modmap */ +); + +extern int XSetPlaneMask( + Display* /* display */, + GC /* gc */, + unsigned long /* plane_mask */ +); + +extern int XSetPointerMapping( + Display* /* display */, + _Xconst unsigned char* /* map */, + int /* nmap */ +); + +extern int XSetScreenSaver( + Display* /* display */, + int /* timeout */, + int /* interval */, + int /* prefer_blanking */, + int /* allow_exposures */ +); + +extern int XSetSelectionOwner( + Display* /* display */, + Atom /* selection */, + Window /* owner */, + Time /* time */ +); + +extern int XSetState( + Display* /* display */, + GC /* gc */, + unsigned long /* foreground */, + unsigned long /* background */, + int /* function */, + unsigned long /* plane_mask */ +); + +extern int XSetStipple( + Display* /* display */, + GC /* gc */, + Pixmap /* stipple */ +); + +extern int XSetSubwindowMode( + Display* /* display */, + GC /* gc */, + int /* subwindow_mode */ +); + +extern int XSetTSOrigin( + Display* /* display */, + GC /* gc */, + int /* ts_x_origin */, + int /* ts_y_origin */ +); + +extern int XSetTile( + Display* /* display */, + GC /* gc */, + Pixmap /* tile */ +); + +extern int XSetWindowBackground( + Display* /* display */, + Window /* w */, + unsigned long /* background_pixel */ +); + +extern int XSetWindowBackgroundPixmap( + Display* /* display */, + Window /* w */, + Pixmap /* background_pixmap */ +); + +extern int XSetWindowBorder( + Display* /* display */, + Window /* w */, + unsigned long /* border_pixel */ +); + +extern int XSetWindowBorderPixmap( + Display* /* display */, + Window /* w */, + Pixmap /* border_pixmap */ +); + +extern int XSetWindowBorderWidth( + Display* /* display */, + Window /* w */, + unsigned int /* width */ +); + +extern int XSetWindowColormap( + Display* /* display */, + Window /* w */, + Colormap /* colormap */ +); + +extern int XStoreBuffer( + Display* /* display */, + _Xconst char* /* bytes */, + int /* nbytes */, + int /* buffer */ +); + +extern int XStoreBytes( + Display* /* display */, + _Xconst char* /* bytes */, + int /* nbytes */ +); + +extern int XStoreColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* color */ +); + +extern int XStoreColors( + Display* /* display */, + Colormap /* colormap */, + XColor* /* color */, + int /* ncolors */ +); + +extern int XStoreName( + Display* /* display */, + Window /* w */, + _Xconst char* /* window_name */ +); + +extern int XStoreNamedColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color */, + unsigned long /* pixel */, + int /* flags */ +); + +extern int XSync( + Display* /* display */, + Bool /* discard */ +); + +extern int XTextExtents( + XFontStruct* /* font_struct */, + _Xconst char* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XTextExtents16( + XFontStruct* /* font_struct */, + _Xconst XChar2b* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XTextWidth( + XFontStruct* /* font_struct */, + _Xconst char* /* string */, + int /* count */ +); + +extern int XTextWidth16( + XFontStruct* /* font_struct */, + _Xconst XChar2b* /* string */, + int /* count */ +); + +extern Bool XTranslateCoordinates( + Display* /* display */, + Window /* src_w */, + Window /* dest_w */, + int /* src_x */, + int /* src_y */, + int* /* dest_x_return */, + int* /* dest_y_return */, + Window* /* child_return */ +); + +extern int XUndefineCursor( + Display* /* display */, + Window /* w */ +); + +extern int XUngrabButton( + Display* /* display */, + unsigned int /* button */, + unsigned int /* modifiers */, + Window /* grab_window */ +); + +extern int XUngrabKey( + Display* /* display */, + int /* keycode */, + unsigned int /* modifiers */, + Window /* grab_window */ +); + +extern int XUngrabKeyboard( + Display* /* display */, + Time /* time */ +); + +extern int XUngrabPointer( + Display* /* display */, + Time /* time */ +); + +extern int XUngrabServer( + Display* /* display */ +); + +extern int XUninstallColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern int XUnloadFont( + Display* /* display */, + Font /* font */ +); + +extern int XUnmapSubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XUnmapWindow( + Display* /* display */, + Window /* w */ +); + +extern int XVendorRelease( + Display* /* display */ +); + +extern int XWarpPointer( + Display* /* display */, + Window /* src_w */, + Window /* dest_w */, + int /* src_x */, + int /* src_y */, + unsigned int /* src_width */, + unsigned int /* src_height */, + int /* dest_x */, + int /* dest_y */ +); + +extern int XWidthMMOfScreen( + Screen* /* screen */ +); + +extern int XWidthOfScreen( + Screen* /* screen */ +); + +extern int XWindowEvent( + Display* /* display */, + Window /* w */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XWriteBitmapFile( + Display* /* display */, + _Xconst char* /* filename */, + Pixmap /* bitmap */, + unsigned int /* width */, + unsigned int /* height */, + int /* x_hot */, + int /* y_hot */ +); + +extern Bool XSupportsLocale (void); + +extern char *XSetLocaleModifiers( + const char* /* modifier_list */ +); + +extern XOM XOpenOM( + Display* /* display */, + struct _XrmHashBucketRec* /* rdb */, + _Xconst char* /* res_name */, + _Xconst char* /* res_class */ +); + +extern Status XCloseOM( + XOM /* om */ +); + +extern char *XSetOMValues( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern char *XGetOMValues( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern Display *XDisplayOfOM( + XOM /* om */ +); + +extern char *XLocaleOfOM( + XOM /* om */ +); + +extern XOC XCreateOC( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern void XDestroyOC( + XOC /* oc */ +); + +extern XOM XOMOfOC( + XOC /* oc */ +); + +extern char *XSetOCValues( + XOC /* oc */, + ... +) _X_SENTINEL(0); + +extern char *XGetOCValues( + XOC /* oc */, + ... +) _X_SENTINEL(0); + +extern XFontSet XCreateFontSet( + Display* /* display */, + _Xconst char* /* base_font_name_list */, + char*** /* missing_charset_list */, + int* /* missing_charset_count */, + char** /* def_string */ +); + +extern void XFreeFontSet( + Display* /* display */, + XFontSet /* font_set */ +); + +extern int XFontsOfFontSet( + XFontSet /* font_set */, + XFontStruct*** /* font_struct_list */, + char*** /* font_name_list */ +); + +extern char *XBaseFontNameListOfFontSet( + XFontSet /* font_set */ +); + +extern char *XLocaleOfFontSet( + XFontSet /* font_set */ +); + +extern Bool XContextDependentDrawing( + XFontSet /* font_set */ +); + +extern Bool XDirectionalDependentDrawing( + XFontSet /* font_set */ +); + +extern Bool XContextualDrawing( + XFontSet /* font_set */ +); + +extern XFontSetExtents *XExtentsOfFontSet( + XFontSet /* font_set */ +); + +extern int XmbTextEscapement( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern int XwcTextEscapement( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern int Xutf8TextEscapement( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern int XmbTextExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern int XwcTextExtents( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern int Xutf8TextExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status XmbTextPerCharExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status XwcTextPerCharExtents( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status Xutf8TextPerCharExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern void XmbDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XmbTextItem* /* text_items */, + int /* nitems */ +); + +extern void XwcDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XwcTextItem* /* text_items */, + int /* nitems */ +); + +extern void Xutf8DrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XmbTextItem* /* text_items */, + int /* nitems */ +); + +extern void XmbDrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XwcDrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern void Xutf8DrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XmbDrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XwcDrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern void Xutf8DrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern XIM XOpenIM( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */ +); + +extern Status XCloseIM( + XIM /* im */ +); + +extern char *XGetIMValues( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern char *XSetIMValues( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern Display *XDisplayOfIM( + XIM /* im */ +); + +extern char *XLocaleOfIM( + XIM /* im*/ +); + +extern XIC XCreateIC( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern void XDestroyIC( + XIC /* ic */ +); + +extern void XSetICFocus( + XIC /* ic */ +); + +extern void XUnsetICFocus( + XIC /* ic */ +); + +extern wchar_t *XwcResetIC( + XIC /* ic */ +); + +extern char *XmbResetIC( + XIC /* ic */ +); + +extern char *Xutf8ResetIC( + XIC /* ic */ +); + +extern char *XSetICValues( + XIC /* ic */, ... +) _X_SENTINEL(0); + +extern char *XGetICValues( + XIC /* ic */, ... +) _X_SENTINEL(0); + +extern XIM XIMOfIC( + XIC /* ic */ +); + +extern Bool XFilterEvent( + XEvent* /* event */, + Window /* window */ +); + +extern int XmbLookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + char* /* buffer_return */, + int /* bytes_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern int XwcLookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + wchar_t* /* buffer_return */, + int /* wchars_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern int Xutf8LookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + char* /* buffer_return */, + int /* bytes_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern XVaNestedList XVaCreateNestedList( + int /*unused*/, ... +) _X_SENTINEL(0); + +/* internal connections for IMs */ + +extern Bool XRegisterIMInstantiateCallback( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */, + XIDProc /* callback */, + XPointer /* client_data */ +); + +extern Bool XUnregisterIMInstantiateCallback( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */, + XIDProc /* callback */, + XPointer /* client_data */ +); + +typedef void (*XConnectionWatchProc)( + Display* /* dpy */, + XPointer /* client_data */, + int /* fd */, + Bool /* opening */, /* open or close flag */ + XPointer* /* watch_data */ /* open sets, close uses */ +); + + +extern Status XInternalConnectionNumbers( + Display* /* dpy */, + int** /* fd_return */, + int* /* count_return */ +); + +extern void XProcessInternalConnection( + Display* /* dpy */, + int /* fd */ +); + +extern Status XAddConnectionWatch( + Display* /* dpy */, + XConnectionWatchProc /* callback */, + XPointer /* client_data */ +); + +extern void XRemoveConnectionWatch( + Display* /* dpy */, + XConnectionWatchProc /* callback */, + XPointer /* client_data */ +); + +extern void XSetAuthorization( + char * /* name */, + int /* namelen */, + char * /* data */, + int /* datalen */ +); + +extern int _Xmbtowc( + wchar_t * /* wstr */, +#ifdef ISC + char const * /* str */, + size_t /* len */ +#else + char * /* str */, + int /* len */ +#endif +); + +extern int _Xwctomb( + char * /* str */, + wchar_t /* wc */ +); + +extern Bool XGetEventData( + Display* /* dpy */, + XGenericEventCookie* /* cookie*/ +); + +extern void XFreeEventData( + Display* /* dpy */, + XGenericEventCookie* /* cookie*/ +); + +_XFUNCPROTOEND + +#endif /* _X11_XLIB_H_ */ diff --git a/libX11/man/XInternAtom.man b/libX11/man/XInternAtom.man index 7a5ecc5b5..237ed91c0 100644 --- a/libX11/man/XInternAtom.man +++ b/libX11/man/XInternAtom.man @@ -1,279 +1,279 @@ -.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
-.\"
-.\" Permission is hereby granted, free of charge, to any person obtaining
-.\" a copy of this software and associated documentation files (the
-.\" "Software"), to deal in the Software without restriction, including
-.\" without limitation the rights to use, copy, modify, merge, publish,
-.\" distribute, sublicense, and/or sell copies of the Software, and to
-.\" permit persons to whom the Software is furnished to do so, subject to
-.\" the following conditions:
-.\"
-.\" The above copyright notice and this permission notice shall be included
-.\" in all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-.\" OTHER DEALINGS IN THE SOFTWARE.
-.\"
-.\" Except as contained in this notice, the name of the X Consortium shall
-.\" not be used in advertising or otherwise to promote the sale, use or
-.\" other dealings in this Software without prior written authorization
-.\" from the X Consortium.
-.\"
-.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
-.\" Digital Equipment Corporation
-.\"
-.\" Portions Copyright \(co 1990, 1991 by
-.\" Tektronix, Inc.
-.\"
-.\" Permission to use, copy, modify and distribute this documentation for
-.\" any purpose and without fee is hereby granted, provided that the above
-.\" copyright notice appears in all copies and that both that copyright notice
-.\" and this permission notice appear in all copies, and that the names of
-.\" Digital and Tektronix not be used in in advertising or publicity pertaining
-.\" to this documentation without specific, written prior permission.
-.\" Digital and Tektronix makes no representations about the suitability
-.\" of this documentation for any purpose.
-.\" It is provided ``as is'' without express or implied warranty.
-.\"
-.\"
-.ds xT X Toolkit Intrinsics \- C Language Interface
-.ds xW Athena X Widgets \- C Language X Toolkit Interface
-.ds xL Xlib \- C Language X Interface
-.ds xC Inter-Client Communication Conventions Manual
-.na
-.de Ds
-.nf
-.\\$1D \\$2 \\$1
-.ft 1
-.\".ps \\n(PS
-.\".if \\n(VS>=40 .vs \\n(VSu
-.\".if \\n(VS<=39 .vs \\n(VSp
-..
-.de De
-.ce 0
-.if \\n(BD .DF
-.nr BD 0
-.in \\n(OIu
-.if \\n(TM .ls 2
-.sp \\n(DDu
-.fi
-..
-.de FD
-.LP
-.KS
-.TA .5i 3i
-.ta .5i 3i
-.nf
-..
-.de FN
-.fi
-.KE
-.LP
-..
-.de IN \" send an index entry to the stderr
-..
-.de C{
-.KS
-.nf
-.D
-.\"
-.\" choose appropriate monospace font
-.\" the imagen conditional, 480,
-.\" may be changed to L if LB is too
-.\" heavy for your eyes...
-.\"
-.ie "\\*(.T"480" .ft L
-.el .ie "\\*(.T"300" .ft L
-.el .ie "\\*(.T"202" .ft PO
-.el .ie "\\*(.T"aps" .ft CW
-.el .ft R
-.ps \\n(PS
-.ie \\n(VS>40 .vs \\n(VSu
-.el .vs \\n(VSp
-..
-.de C}
-.DE
-.R
-..
-.de Pn
-.ie t \\$1\fB\^\\$2\^\fR\\$3
-.el \\$1\fI\^\\$2\^\fP\\$3
-..
-.de ZN
-.ie t \fB\^\\$1\^\fR\\$2
-.el \fI\^\\$1\^\fP\\$2
-..
-.de hN
-.ie t <\fB\\$1\fR>\\$2
-.el <\fI\\$1\fP>\\$2
-..
-.de NT
-.ne 7
-.ds NO Note
-.if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
-.if \\n(.$ .if !'\\$1'C' .ds NO \\$1
-.ie n .sp
-.el .sp 10p
-.TB
-.ce
-\\*(NO
-.ie n .sp
-.el .sp 5p
-.if '\\$1'C' .ce 99
-.if '\\$2'C' .ce 99
-.in +5n
-.ll -5n
-.R
-..
-. \" Note End -- doug kraft 3/85
-.de NE
-.ce 0
-.in -5n
-.ll +5n
-.ie n .sp
-.el .sp 10p
-..
-.ny0
-.TH XInternAtom __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
-.SH NAME
-XInternAtom, XInternAtoms, XGetAtomName, XGetAtomNames \- create or return atom names
-.SH SYNTAX
-.HP
-Atom XInternAtom\^(\^Display *\fIdisplay\fP\^, const char *\fIatom_name\fP\^,
-Bool \fIonly_if_exists\fP\^);
-.HP
-Status XInternAtoms\^(\^Display *\fIdisplay\fP\^, const char **\fInames\fP\^,
-int \fIcount\fP\^, Bool \fIonly_if_exists\fP\^, Atom *\fIatoms_return\fP\^);
-.HP
-char *XGetAtomName\^(\^Display *\fIdisplay\fP\^, Atom \fIatom\fP\^);
-.HP
-Status XGetAtomNames\^(\^Display *\fIdisplay\fP\^, Atom *\fIatoms\fP\^, int
-\fIcount\fP\^, char **\fInames_return\fP\^);
-.SH ARGUMENTS
-.IP \fIatom\fP 1i
-Specifies the atom for the property name you want returned.
-.IP \fIatoms\fP 1i
-Specifies the array of atoms.
-.IP \fIatom_name\fP 1i
-Specifies the name associated with the atom you want returned.
-.IP \fIatoms_return\fP 1i
-Returns the atoms.
-.ds Cn atom names in the array
-.IP \fIcount\fP 1i
-Specifies the number of \*(Cn.
-.ds Cn atoms in the array
-.IP \fIcount\fP 1i
-Specifies the number of \*(Cn.
-.IP \fIdisplay\fP 1i
-Specifies the connection to the X server.
-.IP \fInames\fP 1i
-Specifies the array of atom names.
-.IP \fInames_return\fP 1i
-Returns the atom names.
-.IP \fIonly_if_exists\fP 1i
-Specifies a Boolean value that indicates whether the atom must be created.
-.SH DESCRIPTION
-The
-.ZN XInternAtom
-function returns the atom identifier associated with the specified atom_name
-string.
-If only_if_exists is
-.ZN False ,
-the atom is created if it does not exist.
-Therefore,
-.ZN XInternAtom
-can return
-.ZN None .
-If the atom name is not in the Host Portable Character Encoding,
-the result is implementation-dependent.
-Uppercase and lowercase matter;
-the strings ``thing'', ``Thing'', and ``thinG''
-all designate different atoms.
-The atom will remain defined even after the client's connection closes.
-It will become undefined only when the last connection to
-the X server closes.
-.LP
-.ZN XInternAtom
-can generate
-.ZN BadAlloc
-and
-.ZN BadValue
-errors.
-.LP
-The
-.ZN XInternAtoms
-function returns the atom identifiers associated with the specified names.
-The atoms are stored in the atoms_return array supplied by the caller.
-Calling this function is equivalent to calling
-.ZN XInternAtom
-for each of the names in turn with the specified value of only_if_exists,
-but this function minimizes the number of round-trip protocol exchanges
-between the client and the X server.
-.LP
-This function returns a nonzero status if atoms are returned for
-all of the names;
-otherwise, it returns zero.
-.LP
-.ZN XInternAtoms
-can generate
-.ZN BadAlloc
-and
-.ZN BadValue
-errors.
-.LP
-The
-.ZN XGetAtomName
-function returns the name associated with the specified atom.
-If the data returned by the server is in the Latin Portable Character Encoding,
-then the returned string is in the Host Portable Character Encoding.
-Otherwise, the result is implementation-dependent.
-To free the resulting string,
-call
-.ZN XFree .
-.LP
-.ZN XGetAtomName
-can generate a
-.ZN BadAtom
-error.
-.LP
-The
-.ZN XGetAtomNames
-function returns the names associated with the specified atoms.
-The names are stored in the names_return array supplied by the caller.
-Calling this function is equivalent to calling
-.ZN XGetAtomName
-for each of the atoms in turn,
-but this function minimizes the number of round-trip protocol exchanges
-between the client and the X server.
-.LP
-This function returns a nonzero status if names are returned for
-all of the atoms;
-otherwise, it returns zero.
-.LP
-.ZN XGetAtomNames
-can generate a
-.ZN BadAtom
-error.
-.SH DIAGNOSTICS
-.TP 1i
-.ZN BadAlloc
-The server failed to allocate the requested resource or server memory.
-.TP 1i
-.ZN BadAtom
-A value for an Atom argument does not name a defined Atom.
-.TP 1i
-.ZN BadValue
-Some numeric value falls outside the range of values accepted by the request.
-Unless a specific range is specified for an argument, the full range defined
-by the argument's type is accepted. Any argument defined as a set of
-alternatives can generate this error.
-.SH "SEE ALSO"
-XFree(__libmansuffix__),
-XGetWindowProperty(__libmansuffix__)
-.br
-\fI\*(xL\fP
+.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of the X Consortium shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from the X Consortium. +.\" +.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by +.\" Digital Equipment Corporation +.\" +.\" Portions Copyright \(co 1990, 1991 by +.\" Tektronix, Inc. +.\" +.\" Permission to use, copy, modify and distribute this documentation for +.\" any purpose and without fee is hereby granted, provided that the above +.\" copyright notice appears in all copies and that both that copyright notice +.\" and this permission notice appear in all copies, and that the names of +.\" Digital and Tektronix not be used in in advertising or publicity pertaining +.\" to this documentation without specific, written prior permission. +.\" Digital and Tektronix makes no representations about the suitability +.\" of this documentation for any purpose. +.\" It is provided ``as is'' without express or implied warranty. +.\" +.\" +.ds xT X Toolkit Intrinsics \- C Language Interface +.ds xW Athena X Widgets \- C Language X Toolkit Interface +.ds xL Xlib \- C Language X Interface +.ds xC Inter-Client Communication Conventions Manual +.na +.de Ds +.nf +.\\$1D \\$2 \\$1 +.ft 1 +.\".ps \\n(PS +.\".if \\n(VS>=40 .vs \\n(VSu +.\".if \\n(VS<=39 .vs \\n(VSp +.. +.de De +.ce 0 +.if \\n(BD .DF +.nr BD 0 +.in \\n(OIu +.if \\n(TM .ls 2 +.sp \\n(DDu +.fi +.. +.de FD +.LP +.KS +.TA .5i 3i +.ta .5i 3i +.nf +.. +.de FN +.fi +.KE +.LP +.. +.de IN \" send an index entry to the stderr +.. +.de C{ +.KS +.nf +.D +.\" +.\" choose appropriate monospace font +.\" the imagen conditional, 480, +.\" may be changed to L if LB is too +.\" heavy for your eyes... +.\" +.ie "\\*(.T"480" .ft L +.el .ie "\\*(.T"300" .ft L +.el .ie "\\*(.T"202" .ft PO +.el .ie "\\*(.T"aps" .ft CW +.el .ft R +.ps \\n(PS +.ie \\n(VS>40 .vs \\n(VSu +.el .vs \\n(VSp +.. +.de C} +.DE +.R +.. +.de Pn +.ie t \\$1\fB\^\\$2\^\fR\\$3 +.el \\$1\fI\^\\$2\^\fP\\$3 +.. +.de ZN +.ie t \fB\^\\$1\^\fR\\$2 +.el \fI\^\\$1\^\fP\\$2 +.. +.de hN +.ie t <\fB\\$1\fR>\\$2 +.el <\fI\\$1\fP>\\$2 +.. +.de NT +.ne 7 +.ds NO Note +.if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2 +.if \\n(.$ .if !'\\$1'C' .ds NO \\$1 +.ie n .sp +.el .sp 10p +.TB +.ce +\\*(NO +.ie n .sp +.el .sp 5p +.if '\\$1'C' .ce 99 +.if '\\$2'C' .ce 99 +.in +5n +.ll -5n +.R +.. +. \" Note End -- doug kraft 3/85 +.de NE +.ce 0 +.in -5n +.ll +5n +.ie n .sp +.el .sp 10p +.. +.ny0 +.TH XInternAtom __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS" +.SH NAME +XInternAtom, XInternAtoms, XGetAtomName, XGetAtomNames \- create or return atom names +.SH SYNTAX +.HP +Atom XInternAtom\^(\^Display *\fIdisplay\fP\^, char *\fIatom_name\fP\^, Bool +\fIonly_if_exists\fP\^); +.HP +Status XInternAtoms\^(\^Display *\fIdisplay\fP\^, char **\fInames\fP\^, int +\fIcount\fP\^, Bool \fIonly_if_exists\fP\^, Atom *\fIatoms_return\fP\^); +.HP +char *XGetAtomName\^(\^Display *\fIdisplay\fP\^, Atom \fIatom\fP\^); +.HP +Status XGetAtomNames\^(\^Display *\fIdisplay\fP\^, Atom *\fIatoms\fP\^, int +\fIcount\fP\^, char **\fInames_return\fP\^); +.SH ARGUMENTS +.IP \fIatom\fP 1i +Specifies the atom for the property name you want returned. +.IP \fIatoms\fP 1i +Specifies the array of atoms. +.IP \fIatom_name\fP 1i +Specifies the name associated with the atom you want returned. +.IP \fIatoms_return\fP 1i +Returns the atoms. +.ds Cn atom names in the array +.IP \fIcount\fP 1i +Specifies the number of \*(Cn. +.ds Cn atoms in the array +.IP \fIcount\fP 1i +Specifies the number of \*(Cn. +.IP \fIdisplay\fP 1i +Specifies the connection to the X server. +.IP \fInames\fP 1i +Specifies the array of atom names. +.IP \fInames_return\fP 1i +Returns the atom names. +.IP \fIonly_if_exists\fP 1i +Specifies a Boolean value that indicates whether the atom must be created. +.SH DESCRIPTION +The +.ZN XInternAtom +function returns the atom identifier associated with the specified atom_name +string. +If only_if_exists is +.ZN False , +the atom is created if it does not exist. +Therefore, +.ZN XInternAtom +can return +.ZN None . +If the atom name is not in the Host Portable Character Encoding, +the result is implementation-dependent. +Uppercase and lowercase matter; +the strings ``thing'', ``Thing'', and ``thinG'' +all designate different atoms. +The atom will remain defined even after the client's connection closes. +It will become undefined only when the last connection to +the X server closes. +.LP +.ZN XInternAtom +can generate +.ZN BadAlloc +and +.ZN BadValue +errors. +.LP +The +.ZN XInternAtoms +function returns the atom identifiers associated with the specified names. +The atoms are stored in the atoms_return array supplied by the caller. +Calling this function is equivalent to calling +.ZN XInternAtom +for each of the names in turn with the specified value of only_if_exists, +but this function minimizes the number of round-trip protocol exchanges +between the client and the X server. +.LP +This function returns a nonzero status if atoms are returned for +all of the names; +otherwise, it returns zero. +.LP +.ZN XInternAtoms +can generate +.ZN BadAlloc +and +.ZN BadValue +errors. +.LP +The +.ZN XGetAtomName +function returns the name associated with the specified atom. +If the data returned by the server is in the Latin Portable Character Encoding, +then the returned string is in the Host Portable Character Encoding. +Otherwise, the result is implementation-dependent. +To free the resulting string, +call +.ZN XFree . +.LP +.ZN XGetAtomName +can generate a +.ZN BadAtom +error. +.LP +The +.ZN XGetAtomNames +function returns the names associated with the specified atoms. +The names are stored in the names_return array supplied by the caller. +Calling this function is equivalent to calling +.ZN XGetAtomName +for each of the atoms in turn, +but this function minimizes the number of round-trip protocol exchanges +between the client and the X server. +.LP +This function returns a nonzero status if names are returned for +all of the atoms; +otherwise, it returns zero. +.LP +.ZN XGetAtomNames +can generate a +.ZN BadAtom +error. +.SH DIAGNOSTICS +.TP 1i +.ZN BadAlloc +The server failed to allocate the requested resource or server memory. +.TP 1i +.ZN BadAtom +A value for an Atom argument does not name a defined Atom. +.TP 1i +.ZN BadValue +Some numeric value falls outside the range of values accepted by the request. +Unless a specific range is specified for an argument, the full range defined +by the argument's type is accepted. Any argument defined as a set of +alternatives can generate this error. +.SH "SEE ALSO" +XFree(__libmansuffix__), +XGetWindowProperty(__libmansuffix__) +.br +\fI\*(xL\fP diff --git a/libX11/specs/libX11/CH04.xml b/libX11/specs/libX11/CH04.xml index 0469b2cde..8a3e8c535 100644 --- a/libX11/specs/libX11/CH04.xml +++ b/libX11/specs/libX11/CH04.xml @@ -1,2510 +1,2510 @@ -<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-<chapter id="window_information_functions">
-<title>Window Information Functions</title>
-
-<para>
-After you connect the display to the X server and create a window, you can use the Xlib window
-information functions to:
-</para>
-<itemizedlist>
- <listitem><para>Obtain information about a window</para></listitem>
- <listitem><para>Translate screen coordinates</para></listitem>
- <listitem><para>Manipulate property lists</para></listitem>
- <listitem><para>Obtain and change window properties</para></listitem>
- <listitem><para>Manipulate selections</para></listitem>
-</itemizedlist>
-
-<sect1 id="Obtaining_Window_Information">
-<title>Obtaining Window Information</title>
-<!-- .XS -->
-<!-- (SN Obtaining Window Information -->
-<!-- .XE -->
-<para>
-<!-- .LP -->
-Xlib provides functions that you can use to obtain information about
-the window tree, the window's current attributes,
-the window's current geometry, or the current pointer coordinates.
-Because they are most frequently used by window managers,
-these functions all return a status to indicate whether the window still
-exists.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain the parent, a list of children, and number of children for
-a given window, use
-<function>XQueryTree</function>.
-<indexterm><primary>Child Window</primary></indexterm>
-<indexterm><primary>Parent Window</primary></indexterm>
-<indexterm significance="preferred"><primary>XQueryTree</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Status <function>XQueryTree</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>Window<parameter> *root_return</parameter></paramdef>
- <paramdef>Window<parameter> *parent_return</parameter></paramdef>
- <paramdef>Window<parameter> **children_return</parameter></paramdef>
- <paramdef>unsignedint<parameter> *nchildren_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose list of children, root, parent, and number of children \ -->
-you want to obtain
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>root_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the root window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>parent_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the parent window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>children_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the list of children.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>nchildren_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the number of children.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XQueryTree</function>
-function returns the root ID, the parent window ID,
-a pointer to the list of children windows
-(NULL when there are no children),
-and the number of children in the list for the specified window.
-The children are listed in current stacking order, from bottom-most
-(first) to top-most (last).
-<function>XQueryTree</function>
-returns zero if it fails and nonzero if it succeeds.
-To free a non-NULL children list when it is no longer needed, use
-<function>XFree</function>.
-</para>
-<para>
-<!-- .LP -->
-<function>XQueryTree</function>
-can generate a
-<errorname>BadWindow</errorname>
-error.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain the current attributes of a given window, use
-<function>XGetWindowAttributes</function>.
-<indexterm significance="preferred"><primary>XGetWindowAttributes</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Status <function>XGetWindowAttributes</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>XWindowAttributes<parameter> *window_attributes_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose current attributes you want to obtain -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>window_attributes_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the specified window's attributes in the
-<structname>XWindowAttributes</structname>
-structure.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetWindowAttributes</function>
-function returns the current attributes for the specified window to an
-<structname>XWindowAttributes</structname>
-structure.
-</para>
-<para>
-<!-- .LP -->
-<indexterm significance="preferred"><primary>XWindowAttributes</primary></indexterm>
-<!-- .sM -->
-<literallayout class="monospaced">
-<!-- .TA .5i 3i -->
-<!-- .ta .5i 3i -->
-typedef struct {
- int x, y; /* location of window */
- int width, height; /* width and height of window */
- int border_width; /* border width of window */
- int depth; /* depth of window */
- Visual *visual; /* the associated visual structure */
- Window root; /* root of screen containing window */
- int class; /* InputOutput, InputOnly*/
- int bit_gravity; /* one of the bit gravity values */
- int win_gravity; /* one of the window gravity values */
- int backing_store; /* NotUseful, WhenMapped, Always */
- unsigned long backing_planes; /* planes to be preserved if possible */
- unsigned long backing_pixel; /* value to be used when restoring planes */
- Bool save_under; /* boolean, should bits under be saved? */
- Colormap colormap; /* color map to be associated with window */
- Bool map_installed; /* boolean, is color map currently installed*/
- int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
- long all_event_masks; /* set of events all people have interest in*/
- long your_event_mask; /* my event mask */
- long do_not_propagate_mask; /* set of events that should not propagate */
- Bool override_redirect; /* boolean value for override-redirect */
- Screen *screen; /* back pointer to correct screen */
-} XWindowAttributes;
-</literallayout>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The x and y members are set to the upper-left outer
-corner relative to the parent window's origin.
-The width and height members are set to the inside size of the window,
-not including the border.
-The border_width member is set to the window's border width in pixels.
-The depth member is set to the depth of the window
-(that is, bits per pixel for the object).
-The visual member is a pointer to the screen's associated
-<structname>Visual</structname>
-structure.
-The root member is set to the root window of the screen containing the window.
-The class member is set to the window's class and can be either
-<symbol>InputOutput</symbol>
-or
-<symbol>InputOnly</symbol>.
-</para>
-<para>
-<!-- .LP -->
-The bit_gravity member is set to the window's bit gravity
-and can be one of the following:
- <simplelist type="vert" columns="2">
- <member><symbol>ForgetGravity</symbol></member>
- <member><symbol>NorthWestGravity</symbol></member>
- <member><symbol>NorthGravity</symbol></member>
- <member><symbol>NorthEastGravity</symbol></member>
- <member><symbol>WestGravity</symbol></member>
-
- <member><symbol>EastGravity</symbol></member>
- <member><symbol>SouthWestGravity</symbol></member>
- <member><symbol>SouthGravity</symbol></member>
- <member><symbol>SouthEastGravity</symbol></member>
- <member><symbol>StaticGravity</symbol></member>
- </simplelist>
-</para>
-<para>
-The win_gravity member is set to the window's window gravity
-and can be one of the following:
- <simplelist type="vert" columns="2">
- <member><symbol>UnmapGravity</symbol></member>
- <member><symbol>NorthWestGravity</symbol></member>
- <member><symbol>NorthGravity</symbol></member>
- <member><symbol>NorthEastGravity</symbol></member>
- <member><symbol>WestGravity</symbol></member>
-
- <member><symbol>EastGravity</symbol></member>
- <member><symbol>SouthWestGravity</symbol></member>
- <member><symbol>SouthGravity</symbol></member>
- <member><symbol>SouthEastGravity</symbol></member>
- <member><symbol>StaticGravity</symbol></member>
- <member><symbol>CenterGravity</symbol></member>
- </simplelist>
-</para>
-<para>
-<!-- .LP -->
-For additional information on gravity,
-see section 3.2.3. <!-- xref -->
-</para>
-<para>
-<!-- .LP -->
-The backing_store member is set to indicate how the X server should maintain
-the contents of a window
-and can be
-<symbol>WhenMapped</symbol>,
-<symbol>Always</symbol>,
-or
-<symbol>NotUseful</symbol>.
-The backing_planes member is set to indicate (with bits set to 1) which bit
-planes of the window hold dynamic data that must be preserved in backing_stores
-and during save_unders.
-The backing_pixel member is set to indicate what values to use
-for planes not set in backing_planes.
-</para>
-<para>
-<!-- .LP -->
-The save_under member is set to
-<symbol>True</symbol>
-or
-<symbol>False</symbol>.
-The colormap member is set to the colormap for the specified window and can be
-a colormap ID or
-<symbol>None</symbol>.
-The map_installed member is set to indicate whether the colormap is
-currently installed and can be
-<symbol>True</symbol>
-or
-<symbol>False</symbol>.
-The map_state member is set to indicate the state of the window and can be
-<symbol>IsUnmapped</symbol>,
-<symbol>IsUnviewable</symbol>,
-or
-<symbol>IsViewable</symbol>.
-<symbol>IsUnviewable</symbol>
-is used if the window is mapped but some ancestor is unmapped.
-</para>
-<para>
-<!-- .LP -->
-The all_event_masks member is set to the bitwise inclusive OR of all event
-masks selected on the window by all clients.
-The your_event_mask member is set to the bitwise inclusive OR of all event
-masks selected by the querying client.
-The do_not_propagate_mask member is set to the bitwise inclusive OR of the
-set of events that should not propagate.
-</para>
-<para>
-<!-- .LP -->
-The override_redirect member is set to indicate whether this window overrides
-structure control facilities and can be
-<symbol>True</symbol>
-or
-<symbol>False</symbol>.
-Window manager clients should ignore the window if this member is
-<symbol>True</symbol>.
-</para>
-<para>
-<!-- .LP -->
-The screen member is set to a screen pointer that gives you a back pointer
-to the correct screen.
-This makes it easier to obtain the screen information without
-having to loop over the root window fields to see which field matches.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetWindowAttributes</function>
-can generate
-<errorname>BadDrawable</errorname>
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain the current geometry of a given drawable, use
-<function>XGetGeometry</function>.
-<indexterm significance="preferred"><primary>XGetGeometry</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Status <function>XGetGeometry</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Drawable<parameter> d</parameter></paramdef>
- <paramdef>Window<parameter> *root_return</parameter></paramdef>
- <paramdef>int*x_return,<parameter> *y_return</parameter></paramdef>
- <paramdef>unsignedint*width_return,<parameter> *height_return</parameter></paramdef>
- <paramdef>unsignedint<parameter> *border_width_return</parameter></paramdef>
- <paramdef>unsignedint<parameter> *depth_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Dr , which can be a window or a pixmap -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>d</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the drawable(Dr.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>root_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the root window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>x_return</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>y_return</emphasis>
- </term>
- <listitem>
- <para>
-Return the x and y coordinates that define the location of the drawable.
-For a window,
-these coordinates specify the upper-left outer corner relative to
-its parent's origin.
-For pixmaps, these coordinates are always zero.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>width_return</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>height_return</emphasis>
- </term>
- <listitem>
- <para>
-Return the drawable's dimensions (width and height).
-For a window,
-these dimensions specify the inside size, not including the border.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>border_width_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the border width in pixels.
-If the drawable is a pixmap, it returns zero.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>depth_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the depth of the drawable (bits per pixel for the object).
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetGeometry</function>
-function returns the root window and the current geometry of the drawable.
-The geometry of the drawable includes the x and y coordinates, width and height,
-border width, and depth.
-These are described in the argument list.
-It is legal to pass to this function a window whose class is
-<symbol>InputOnly</symbol>.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetGeometry</function>
-can generate a
-<errorname>BadDrawable</errorname>
-error.
-</para>
-</sect1>
-<sect1 id="Translating_Screen_Coordinates">
-<title>Translating Screen Coordinates</title>
-<!-- .XS -->
-<!-- (SN Translating Screen Coordinates -->
-<!-- .XE -->
-<para>
-<!-- .LP -->
-Applications sometimes
-need to perform a coordinate transformation from the coordinate
-space of one window to another window or need to determine which
-window the pointing device is in.
-<function>XTranslateCoordinates</function>
-and
-<function>XQueryPointer</function>
-fulfill these needs (and avoid any race conditions) by
-asking the X server to perform these operations.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To translate a coordinate in one window to the coordinate
-space of another window, use
-<function>XTranslateCoordinates</function>.
-<indexterm significance="preferred"><primary>XTranslateCoordinates</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Bool <function>XTranslateCoordinates</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Windowsrc_w,<parameter> dest_w</parameter></paramdef>
- <paramdef>intsrc_x,<parameter> src_y</parameter></paramdef>
- <paramdef>int*dest_x_return,<parameter> *dest_y_return</parameter></paramdef>
- <paramdef>Window<parameter> *child_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>src_w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the source window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>dest_w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the destination window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>src_x</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>src_y</emphasis>
- </term>
- <listitem>
- <para>
-Specify the x and y coordinates within the source window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>dest_x_return</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>dest_y_return</emphasis>
- </term>
- <listitem>
- <para>
-Return the x and y coordinates within the destination window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>child_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the child if the coordinates are contained in a mapped child of the
-destination window.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-If
-<function>XTranslateCoordinates</function>
-returns
-<symbol>True</symbol>,
-it takes the src_x and src_y coordinates relative
-to the source window's origin and returns these coordinates to
-dest_x_return and dest_y_return
-relative to the destination window's origin.
-If
-<function>XTranslateCoordinates</function>
-returns
-<symbol>False</symbol>,
-src_w and dest_w are on different screens,
-and dest_x_return and dest_y_return are zero.
-If the coordinates are contained in a mapped child of dest_w,
-that child is returned to child_return.
-Otherwise, child_return is set to
-<symbol>None</symbol>.
-</para>
-<para>
-<!-- .LP -->
-<function>XTranslateCoordinates</function>
-can generate a
-<errorname>BadWindow</errorname>
-error.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain the screen coordinates of the pointer
-or to determine the pointer coordinates relative to a specified window, use
-<function>XQueryPointer</function>.
-<indexterm significance="preferred"><primary>XQueryPointer</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Bool <function>XQueryPointer</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>Window*root_return,<parameter> *child_return</parameter></paramdef>
- <paramdef>int*root_x_return,<parameter> *root_y_return</parameter></paramdef>
- <paramdef>int*win_x_return,<parameter> *win_y_return</parameter></paramdef>
- <paramdef>unsignedint<parameter> *mask_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window.
-<!-- .ds Ro that the pointer is in -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>root_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the root window (Ro.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>child_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the child window that the pointer is located in, if any.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>root_x_return</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>root_y_return</emphasis>
- </term>
- <listitem>
- <para>
-Return the pointer coordinates relative to the root window's origin.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>win_x_return</emphasis>
- </term>
- <listitem>
- <para>
-<!-- .br -->
-<!-- .ns -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>win_y_return</emphasis>
- </term>
- <listitem>
- <para>
-Return the pointer coordinates relative to the specified window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>mask_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the current state of the modifier keys and pointer buttons.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XQueryPointer</function>
-function returns the root window the pointer is logically on and the pointer
-coordinates relative to the root window's origin.
-If
-<function>XQueryPointer</function>
-returns
-<symbol>False</symbol>,
-the pointer is not on the same screen as the specified window, and
-<function>XQueryPointer</function>
-returns
-<symbol>None</symbol>
-to child_return and zero to win_x_return and win_y_return.
-If
-<function>XQueryPointer</function>
-returns
-<symbol>True</symbol>,
-the pointer coordinates returned to win_x_return and win_y_return
-are relative to the origin of the specified window.
-In this case,
-<function>XQueryPointer</function>
-returns the child that contains the pointer, if any,
-or else
-<symbol>None</symbol>
-to child_return.
-</para>
-<para>
-<!-- .LP -->
-<function>XQueryPointer</function>
-returns the current logical state of the keyboard buttons
-and the modifier keys in mask_return.
-It sets mask_return to the bitwise inclusive OR of one or more
-of the button or modifier key bitmasks to match
-the current state of the mouse buttons and the modifier keys.
-</para>
-<para>
-<!-- .LP -->
-Note that the logical state of a device (as seen through Xlib)
-may lag the physical state if device event processing is frozen
-(see section 12.1). <!-- xref -->
-</para>
-<para>
-<!-- .LP -->
-<function>XQueryPointer</function>
-can generate a
-<errorname>BadWindow</errorname>
-error.
-</para>
-</sect1>
-<sect1 id="Properties_and_Atoms">
-<title>Properties and Atoms</title>
-<!-- .XS -->
-<!-- (SN Properties and Atoms -->
-<!-- .XE -->
-<para>
-<!-- .LP -->
-A property is a collection of named, typed data.
-The window system has a set of predefined properties
-<indexterm><primary>Atom</primary><secondary>predefined</secondary></indexterm>
-(for example, the name of a window, size hints, and so on), and users can
-define any other arbitrary information and associate it with windows.
-Each property has a name,
-which is an ISO Latin-1 string.
-For each named property,
-a unique identifier (atom) is associated with it.
-A property also has a type, for example, string or integer.
-These types are also indicated using atoms, so arbitrary new
-types can be defined.
-Data of only one type may be associated with a single
-property name.
-Clients can store and retrieve properties associated with windows.
-For efficiency reasons,
-an atom is used rather than a character string.
-<function>XInternAtom</function>
-can be used to obtain the atom for property names.
-<indexterm><primary>Atom</primary></indexterm>
-</para>
-<para>
-<!-- .LP -->
-A property is also stored in one of several possible formats.
-The X server can store the information as 8-bit quantities, 16-bit
-quantities, or 32-bit quantities.
-This permits the X server to present the data in the byte order that the
-client expects.
-<!-- .NT Note -->
-If you define further properties of complex type,
-you must encode and decode them yourself.
-These functions must be carefully written if they are to be portable.
-For further information about how to write a library extension,
-see appendix C. <!-- xref -->
-<!-- .NE -->
-The type of a property is defined by an atom, which allows for
-arbitrary extension in this type scheme.
-<indexterm><primary>Atom</primary></indexterm>
-</para>
-<para>
-<!-- .LP -->
-Certain property names are
-predefined in the server for commonly used functions.
-The atoms for these properties are defined in
-<filename class="headerfile"><X11/Xatom.h></filename>.
-<indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm>
-<indexterm><primary>Files</primary><secondary><filename class="headerfile"><X11/Xatom.h></filename></secondary></indexterm>
-<indexterm><primary>Headers</primary><secondary><filename class="headerfile"><X11/Xatom.h></filename></secondary></indexterm>
-To avoid name clashes with user symbols, the
-<code>#define</code>
-name for each atom has the XA_ prefix.
-For an explanation of the functions that let you get and set
-much of the information stored in these predefined properties,
-see chapter 14. <!-- xref -->
-</para>
-<para>
-<!-- .LP -->
-The core protocol imposes no semantics on these property names,
-but semantics are specified in other X Consortium standards,
-such as the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>
-and the <emphasis remap='I'>X Logical Font Description Conventions</emphasis>.
-</para>
-<para>
-<!-- .LP -->
-You can use properties to communicate other information between
-applications.
-The functions described in this section let you define new properties
-and get the unique atom IDs in your applications.
-</para>
-<para>
-<!-- .LP -->
-Although any particular atom can have some client interpretation
-within each of the name spaces,
-atoms occur in five distinct name spaces within the protocol:
-</para>
-<itemizedlist>
- <listitem>
- <para>
-Selections
- </para>
- </listitem>
- <listitem>
- <para>
-Property names
- </para>
- </listitem>
- <listitem>
- <para>
-Property types
- </para>
- </listitem>
- <listitem>
- <para>
-Font properties
- </para>
- </listitem>
- <listitem>
- <para>
-Type of a
-<symbol>ClientMessage</symbol>
-event (none are built into the X server)
- </para>
- </listitem>
-</itemizedlist>
-<para>
-<!-- .LP -->
-</para>
-<para>
-<!-- .LP -->
-The built-in selection property names are:
-<simplelist type="vert" columns="2">
- <member><property>PRIMARY</property></member>
- <member><property>SECONDARY</property></member>
-</simplelist>
-</para>
-<para>
-<!-- .LP -->
-The built-in property names are:
- <simplelist type="vert" columns="2">
- <member><property>CUT_BUFFER0</property></member>
- <member><property>CUT_BUFFER1</property></member>
- <member><property>CUT_BUFFER2</property></member>
- <member><property>CUT_BUFFER3</property></member>
- <member><property>CUT_BUFFER4</property></member>
- <member><property>CUT_BUFFER5</property></member>
- <member><property>CUT_BUFFER6</property></member>
- <member><property>CUT_BUFFER7</property></member>
- <member><property>RGB_BEST_MAP</property></member>
- <member><property>RGB_BLUE_MAP</property></member>
- <member><property>RGB_DEFAULT_MAP</property></member>
- <member><property>RGB_GRAY_MAP</property></member>
- <member><property>RGB_GREEN_MAP</property></member>
- <member><property>RGB_RED_MAP</property></member>
-
- <member><property>RESOURCE_MANAGER</property></member>
- <member><property>WM_CLASS</property></member>
- <member><property>WM_CLIENT_MACHINE</property></member>
- <member><property>WM_COLORMAP_WINDOWS</property></member>
- <member><property>WM_COMMAND</property></member>
- <member><property>WM_HINTS</property></member>
- <member><property>WM_ICON_NAME</property></member>
- <member><property>WM_ICON_SIZE</property></member>
- <member><property>WM_NAME</property></member>
- <member><property>WM_NORMAL_HINTS</property></member>
- <member><property>WM_PROTOCOLS</property></member>
- <member><property>WM_STATE</property></member>
- <member><property>WM_TRANSIENT_FOR</property></member>
- <member><property>WM_ZOOM_HINTS</property></member>
- </simplelist>
-</para>
-<para>
-The built-in property types are:
- <simplelist type="vert" columns="2">
- <member><property>ARC</property></member>
- <member><property>ATOM</property></member>
- <member><property>BITMAP</property></member>
- <member><property>CARDINAL</property></member>
- <member><property>COLORMAP</property></member>
- <member><property>CURSOR</property></member>
- <member><property>DRAWABLE</property></member>
- <member><property>FONT</property></member>
- <member><property>INTEGER</property></member>
- <member><property>PIXMAP</property></member>
- <member><property>POINT</property></member>
- <member><property>RGB_COLOR_MAP</property></member>
- <member><property>RECTANGLE</property></member>
- <member><property>STRING</property></member>
- <member><property>VISUALID</property></member>
- <member><property>WINDOW</property></member>
- <member><property>WM_HINTS</property></member>
- <member><property>WM_SIZE_HINTS</property></member>
- </simplelist>
-</para>
-<para>
-The built-in font property names are:
- <simplelist type="vert" columns="2">
- <member><property>MIN_SPACE</property></member>
- <member><property>NORM_SPACE</property></member>
- <member><property>MAX_SPACE</property></member>
- <member><property>END_SPACE</property></member>
- <member><property>SUPERSCRIPT_X</property></member>
- <member><property>SUPERSCRIPT_Y</property></member>
- <member><property>SUBSCRIPT_X</property></member>
- <member><property>SUBSCRIPT_Y</property></member>
- <member><property>UNDERLINE_POSITION</property></member>
- <member><property>UNDERLINE_THICKNESS</property></member>
- <member><property>FONT_NAME</property></member>
- <member><property>FULL_NAME</property></member>
-
- <member><property>STRIKEOUT_DESCENT</property></member>
- <member><property>STRIKEOUT_ASCENT</property></member>
- <member><property>ITALIC_ANGLE</property></member>
- <member><property>X_HEIGHT</property></member>
- <member><property>QUAD_WIDTH</property></member>
- <member><property>WEIGHT</property></member>
- <member><property>POINT_SIZE</property></member>
- <member><property>RESOLUTION</property></member>
- <member><property>COPYRIGHT</property></member>
- <member><property>NOTICE</property></member>
- <member><property>FAMILY_NAME</property></member>
- <member><property>CAP_HEIGHT</property></member>
- </simplelist>
-</para>
-<para>
-<!-- .LP -->
-For further information about font properties,
-see section 8.5. <!-- xref -->
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To return an atom for a given name, use
-<function>XInternAtom</function>.
-<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm>
-<indexterm significance="preferred"><primary>XInternAtom</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Atom <function>XInternAtom</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>const char<parameter> *atom_name</parameter></paramdef>
- <paramdef>Bool<parameter> only_if_exists</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>atom_name</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the name associated with the atom you want returned.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>only_if_exists</emphasis>
- </term>
- <listitem>
- <para>
-Specifies a Boolean value that indicates whether the atom must be created.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XInternAtom</function>
-function returns the atom identifier associated with the specified atom_name
-string.
-If only_if_exists is
-<symbol>False</symbol>,
-the atom is created if it does not exist.
-Therefore,
-<function>XInternAtom</function>
-can return
-<symbol>None</symbol>.
-If the atom name is not in the Host Portable Character Encoding,
-the result is implementation-dependent.
-Uppercase and lowercase matter;
-the strings ``thing'', ``Thing'', and ``thinG''
-all designate different atoms.
-The atom will remain defined even after the client's connection closes.
-It will become undefined only when the last connection to
-the X server closes.
-</para>
-<para>
-<!-- .LP -->
-<function>XInternAtom</function>
-can generate
-<errorname>BadAlloc</errorname>
-and
-<errorname>BadValue</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To return atoms for an array of names, use
-<function>XInternAtoms</function>.
-<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm>
-<indexterm significance="preferred"><primary>XInternAtoms</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Status <function>XInternAtoms</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>const char<parameter> **names</parameter></paramdef>
- <paramdef>int<parameter> count</parameter></paramdef>
- <paramdef>Bool<parameter> only_if_exists</parameter></paramdef>
- <paramdef>Atom<parameter> *atoms_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>names</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the array of atom names.
-<!-- .ds Cn atom names in the array -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>count</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the number of (Cn.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>only_if_exists</emphasis>
- </term>
- <listitem>
- <para>
-Specifies a Boolean value that indicates whether the atom must be created.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>atoms_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the atoms.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XInternAtoms</function>
-function returns the atom identifiers associated with the specified names.
-The atoms are stored in the atoms_return array supplied by the caller.
-Calling this function is equivalent to calling
-<function>XInternAtom</function>
-for each of the names in turn with the specified value of only_if_exists,
-but this function minimizes the number of round-trip protocol exchanges
-between the client and the X server.
-</para>
-<para>
-<!-- .LP -->
-This function returns a nonzero status if atoms are returned for
-all of the names;
-otherwise, it returns zero.
-</para>
-<para>
-<!-- .LP -->
-<function>XInternAtoms</function>
-can generate
-<errorname>BadAlloc</errorname>
-and
-<errorname>BadValue</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To return a name for a given atom identifier, use
-<function>XGetAtomName</function>.
-<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm>
-<indexterm significance="preferred"><primary>XGetAtomName</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>char *<function>XGetAtomName</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Atom<parameter> atom</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>atom</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the atom for the property name you want returned.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetAtomName</function>
-function returns the name associated with the specified atom.
-If the data returned by the server is in the Latin Portable Character Encoding,
-then the returned string is in the Host Portable Character Encoding.
-Otherwise, the result is implementation-dependent.
-To free the resulting string,
-call
-<function>XFree</function>.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetAtomName</function>
-can generate a
-<errorname>BadAtom</errorname>
-error.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To return the names for an array of atom identifiers, use
-<function>XGetAtomNames</function>.
-<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm>
-<indexterm significance="preferred"><primary>XGetAtomNames</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Status <function>XGetAtomNames</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Atom<parameter> *atoms</parameter></paramdef>
- <paramdef>int<parameter> count</parameter></paramdef>
- <paramdef>char<parameter> **names_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>atoms</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the array of atoms.
-<!-- .ds Cn atoms in the array -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>count</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the number of (Cn.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>names_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the atom names.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetAtomNames</function>
-function returns the names associated with the specified atoms.
-The names are stored in the names_return array supplied by the caller.
-Calling this function is equivalent to calling
-<function>XGetAtomName</function>
-for each of the atoms in turn,
-but this function minimizes the number of round-trip protocol exchanges
-between the client and the X server.
-</para>
-<para>
-<!-- .LP -->
-This function returns a nonzero status if names are returned for
-all of the atoms;
-otherwise, it returns zero.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetAtomNames</function>
-can generate a
-<errorname>BadAtom</errorname>
-error.
-</para>
-</sect1>
-<sect1 id="Obtaining_and_Changing_Window_Properties">
-<title>Obtaining and Changing Window Properties</title>
-<!-- .XS -->
-<!-- (SN Obtaining and Changing Window Properties -->
-<!-- .XE -->
-<para>
-<!-- .LP -->
-You can attach a property list to every window.
-Each property has a name, a type, and a value (see section 4.3). <!-- xref -->
-The value is an array of 8-bit, 16-bit, or 32-bit quantities,
-whose interpretation is left to the clients. The type
-<type>char</type>
-is used to represent 8-bit quantities, the type
-<type>short</type>
-is used to represent 16-bit quantities, and the type
-<type>long</type>
-is used to represent 32-bit quantities.
-</para>
-<para>
-<!-- .LP -->
-Xlib provides functions that you can use to obtain,
-change, update, or interchange window properties.
-In addition, Xlib provides other utility functions for inter-client
-communication (see chapter 14). <!-- xref -->
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain the type, format, and value of a property of a given window, use
-<function>XGetWindowProperty</function>.
-<indexterm><primary>Property</primary><secondary>getting</secondary></indexterm>
-</para>
-<para>
-<!-- .LP -->
-<indexterm significance="preferred"><primary>XGetWindowProperty</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>int <function>XGetWindowProperty</function></funcdef>
- <paramdef><parameter> display</parameter></paramdef>
- <paramdef><parameter> w</parameter></paramdef>
- <paramdef><parameter> property</parameter></paramdef>
- <paramdef><parameter> long_offset</parameter></paramdef>
- <paramdef><parameter> long_length</parameter></paramdef>
- <paramdef><parameter> delete</parameter></paramdef>
- <paramdef><parameter> req_type</parameter></paramdef>
- <paramdef><parameter> actual_type_return</parameter></paramdef>
- <paramdef><parameter> actual_format_return</parameter></paramdef>
- <paramdef><parameter> nitems_return</parameter></paramdef>
- <paramdef><parameter> bytes_after_return</parameter></paramdef>
- <paramdef>.br<parameter> prop_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose property you want to obtain -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>property</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the property name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>long_offset</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the offset in the specified property (in 32-bit quantities)
-where the data is to be retrieved.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>long_length</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the length in 32-bit multiples of the data to be retrieved.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>delete</emphasis>
- </term>
- <listitem>
- <para>
-Specifies a Boolean value that determines whether the property is deleted.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>req_type</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the atom identifier associated with the property type or
-<symbol>AnyPropertyType</symbol>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>actual_type_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the atom identifier that defines the actual type of the property.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>actual_format_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the actual format of the property.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>nitems_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the actual number of 8-bit, 16-bit, or 32-bit items
-stored in the prop_return data.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>bytes_after_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the number of bytes remaining to be read in the property if
-a partial read was performed.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>prop_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the data in the specified format.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetWindowProperty</function>
-function returns the actual type of the property; the actual format of the property;
-the number of 8-bit, 16-bit, or 32-bit items transferred; the number of bytes remaining
-to be read in the property; and a pointer to the data actually returned.
-<function>XGetWindowProperty</function>
-sets the return arguments as follows:
-</para>
-<itemizedlist>
- <listitem>
- <para>
-If the specified property does not exist for the specified window,
-<function>XGetWindowProperty</function>
-returns
-<symbol>None</symbol>
-to actual_type_return and the value zero to
-actual_format_return and bytes_after_return.
-The nitems_return argument is empty.
-In this case, the delete argument is ignored.
- </para>
- </listitem>
- <listitem>
- <para>
-If the specified property exists
-but its type does not match the specified type,
-<function>XGetWindowProperty</function>
-returns the actual property type to actual_type_return,
-the actual property format (never zero) to actual_format_return,
-and the property length in bytes
-(even if the actual_format_return is 16 or 32)
-to bytes_after_return.
-It also ignores the delete argument.
-The nitems_return argument is empty.
- </para>
- </listitem>
- <listitem>
- <para>
-If the specified property exists and either you assign
-<symbol>AnyPropertyType</symbol>
-to the req_type argument or the specified type matches the actual property type,
-<function>XGetWindowProperty</function>
-returns the actual property type to actual_type_return and the actual
-property format (never zero) to actual_format_return.
-It also returns a value to bytes_after_return and nitems_return, by
-defining the following
-values:
- </para>
- </listitem>
- <listitem>
- <para>
-<!-- .nf -->
- N = actual length of the stored property in bytes
- (even if the format is 16 or 32)
- I = 4 * long_offset
- T = N - I
- L = MINIMUM(T, 4 * long_length)
- A = N - (I + L)
-<!-- .fi -->
- </para>
- </listitem>
- <listitem>
- <para>
-The returned value starts at byte index I in the property (indexing
-from zero), and its length in bytes is L.
-If the value for long_offset causes L to be negative,
-a
-<errorname>BadValue</errorname>
-error results.
-The value of bytes_after_return is A,
-giving the number of trailing unread bytes in the stored property.
- </para>
- </listitem>
-</itemizedlist>
-<para>
-<!-- .LP -->
-If the returned format is 8, the returned data is represented as a
-<type>char</type>
-array.
-If the returned format is 16, the returned data is represented as a
-<type>short</type>
-array and should be cast to that type to obtain the elements.
-If the returned format is 32, the returned data is represented as a
-<type>long</type>
-array and should be cast to that type to obtain the elements.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetWindowProperty</function>
-always allocates one extra byte in prop_return
-(even if the property is zero length)
-and sets it to zero so that simple properties consisting of characters
-do not have to be copied into yet another string before use.
-</para>
-<para>
-<!-- .LP -->
-If delete is
-<symbol>True</symbol>
-and bytes_after_return is zero,
-<function>XGetWindowProperty</function>
-deletes the property
-from the window and generates a
-<symbol>PropertyNotify</symbol>
-event on the window.
-</para>
-<para>
-<!-- .LP -->
-The function returns
-<symbol>Success</symbol>
-if it executes successfully.
-To free the resulting data,
-use
-<function>XFree</function>.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetWindowProperty</function>
-can generate
-<errorname>BadAtom</errorname>,
-<errorname>BadValue</errorname>,
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To obtain a given window's property list, use
-<function>XListProperties</function>.
-<indexterm><primary>Property</primary><secondary>listing</secondary></indexterm>
-<indexterm significance="preferred"><primary>XListProperties</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Atom *<function>XListProperties</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>int<parameter> *num_prop_return</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose property list you want to obtain -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>num_prop_return</emphasis>
- </term>
- <listitem>
- <para>
-Returns the length of the properties array.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XListProperties</function>
-function returns a pointer to an array of atom properties that are defined for
-the specified window or returns NULL if no properties were found.
-To free the memory allocated by this function, use
-<function>XFree</function>.
-</para>
-<para>
-<!-- .LP -->
-<function>XListProperties</function>
-can generate a
-<errorname>BadWindow</errorname>
-error.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To change a property of a given window, use
-<function>XChangeProperty</function>.
-<indexterm><primary>Property</primary><secondary>changing</secondary></indexterm>
-<indexterm><primary>Property</primary><secondary>appending</secondary></indexterm>
-<indexterm><primary>Property</primary><secondary>prepending</secondary></indexterm>
-<indexterm><primary>Property</primary><secondary>replacing</secondary></indexterm>
-<indexterm><primary>Property</primary><secondary>format</secondary></indexterm>
-<indexterm><primary>Property</primary><secondary>type</secondary></indexterm>
-<indexterm significance="preferred"><primary>XChangeProperty</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef><function>XChangeProperty</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>Atomproperty,<parameter> type</parameter></paramdef>
- <paramdef>int<parameter> format</parameter></paramdef>
- <paramdef>int<parameter> mode</parameter></paramdef>
- <paramdef>unsignedchar<parameter> *data</parameter></paramdef>
- <paramdef>int<parameter> nelements</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose property you want to change -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>property</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the property name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>type</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the type of the property.
-The X server does not interpret the type but simply
-passes it back to an application that later calls
-<function>XGetWindowProperty</function>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>format</emphasis>
- </term>
- <listitem>
- <para>
-Specifies whether the data should be viewed as a list
-of 8-bit, 16-bit, or 32-bit quantities.
-Possible values are 8, 16, and 32.
-This information allows the X server to correctly perform
-byte-swap operations as necessary.
-If the format is 16-bit or 32-bit,
-you must explicitly cast your data pointer to an (unsigned char *) in the call
-to
-<function>XChangeProperty</function>.
-<!-- .\" Changed name of this file to prop_mode.a on 1/13/87 -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>mode</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the mode of the operation.
-You can pass
-<symbol>PropModeReplace</symbol>,
-<symbol>PropModePrepend</symbol>,
-or
-<symbol>PropModeAppend</symbol>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>data</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the property data.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>nelements</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the number of elements of the specified data format.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XChangeProperty</function>
-function alters the property for the specified window and
-causes the X server to generate a
-<symbol>PropertyNotify</symbol>
-event on that window.
-<function>XChangeProperty</function>
-performs the following:
-</para>
-<itemizedlist>
- <listitem>
- <para>
-If mode is
-<symbol>PropModeReplace</symbol>,
-<function>XChangeProperty</function>
-discards the previous property value and stores the new data.
- </para>
- </listitem>
- <listitem>
- <para>
-If mode is
-<symbol>PropModePrepend</symbol>
-or
-<symbol>PropModeAppend</symbol>,
-<function>XChangeProperty</function>
-inserts the specified data before the beginning of the existing data
-or onto the end of the existing data, respectively.
-The type and format must match the existing property value,
-or a
-<errorname>BadMatch</errorname>
-error results.
-If the property is undefined,
-it is treated as defined with the correct type and
-format with zero-length data.
- </para>
- </listitem>
-</itemizedlist>
-<para>
-<!-- .LP -->
-If the specified format is 8, the property data must be a
-<type>char</type>
-array.
-If the specified format is 16, the property data must be a
-<type>short</type>
-array.
-If the specified format is 32, the property data must be a
-<type>long</type>
-array.
-</para>
-<para>
-<!-- .LP -->
-The lifetime of a property is not tied to the storing client.
-Properties remain until explicitly deleted, until the window is destroyed,
-or until the server resets.
-For a discussion of what happens when the connection to the X server is closed,
-see section 2.6. <!-- xref -->
-The maximum size of a property is server dependent and can vary dynamically
-depending on the amount of memory the server has available.
-(If there is insufficient space, a
-<errorname>BadAlloc</errorname>
-error results.)
-</para>
-<para>
-<!-- .LP -->
-<function>XChangeProperty</function>
-can generate
-<errorname>BadAlloc</errorname>,
-<errorname>BadAtom</errorname>,
-<errorname>BadMatch</errorname>,
-<errorname>BadValue</errorname>,
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To rotate a window's property list, use
-<function>XRotateWindowProperties</function>.
-</para>
-<para>
-<!-- .LP -->
-<indexterm significance="preferred"><primary>XRotateWindowProperties</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef><function>XRotateWindowProperties</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>Atom<parameter> properties[]</parameter></paramdef>
- <paramdef>int<parameter> num_prop</parameter></paramdef>
- <paramdef>int<parameter> npositions</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>properties</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the array of properties that are to be rotated.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>num_prop</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the length of the properties array.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>npositions</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the rotation amount.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XRotateWindowProperties</function>
-function allows you to rotate properties on a window and causes
-the X server to generate
-<symbol>PropertyNotify</symbol>
-events.
-If the property names in the properties array are viewed as being numbered
-starting from zero and if there are num_prop property names in the list,
-then the value associated with property name I becomes the value associated
-with property name (I + npositions) mod N for all I from zero to N − 1.
-The effect is to rotate the states by npositions places around the virtual ring
-of property names (right for positive npositions,
-left for negative npositions).
-If npositions mod N is nonzero,
-the X server generates a
-<symbol>PropertyNotify</symbol>
-event for each property in the order that they are listed in the array.
-If an atom occurs more than once in the list or no property with that
-name is defined for the window,
-a
-<errorname>BadMatch</errorname>
-error results.
-If a
-<errorname>BadAtom</errorname>
-or
-<errorname>BadMatch</errorname>
-error results,
-no properties are changed.
-</para>
-<para>
-<!-- .LP -->
-<function>XRotateWindowProperties</function>
-can generate
-<errorname>BadAtom</errorname>,
-<errorname>BadMatch</errorname>,
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To delete a property on a given window, use
-<function>XDeleteProperty</function>.
-<indexterm><primary>Property</primary><secondary>deleting</secondary></indexterm>
-<indexterm significance="preferred"><primary>XDeleteProperty</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef><function>XDeleteProperty</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Window<parameter> w</parameter></paramdef>
- <paramdef>Atom<parameter> property</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Wi whose property you want to delete -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>w</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the window (Wi.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>property</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the property name.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XDeleteProperty</function>
-function deletes the specified property only if the
-property was defined on the specified window
-and causes the X server to generate a
-<symbol>PropertyNotify</symbol>
-event on the window unless the property does not exist.
-</para>
-<para>
-<!-- .LP -->
-<function>XDeleteProperty</function>
-can generate
-<errorname>BadAtom</errorname>
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-</sect1>
-<sect1 id="Selections">
-<title>Selections</title>
-<!-- .XS -->
-<!-- (SN Selections -->
-<!-- .XE -->
-<para>
-<!-- .LP -->
-<indexterm><primary>Selection</primary></indexterm>
-Selections are one method used by applications to exchange data.
-By using the property mechanism,
-applications can exchange data of arbitrary types and can negotiate
-the type of the data.
-A selection can be thought of as an indirect property with a dynamic type.
-That is, rather than having the property stored in the X server,
-the property is maintained by some client (the owner).
-A selection is global in nature (considered to belong to the user
-but be maintained by clients) rather than being private to a particular
-window subhierarchy or a particular set of clients.
-</para>
-<para>
-<!-- .LP -->
-Xlib provides functions that you can use to set, get, or request conversion
-of selections.
-This allows applications to implement the notion of current selection,
-which requires that notification be sent to applications when they no
-longer own the selection.
-Applications that support selection often highlight the current selection
-and so must be informed when another application has
-acquired the selection so that they can unhighlight the selection.
-</para>
-<para>
-<!-- .LP -->
-When a client asks for the contents of
-a selection, it specifies a selection target type.
-This target type
-can be used to control the transmitted representation of the contents.
-For example, if the selection is ``the last thing the user clicked on''
-and that is currently an image, then the target type might specify
-whether the contents of the image should be sent in XY format or Z format.
-</para>
-<para>
-<!-- .LP -->
-The target type can also be used to control the class of
-contents transmitted, for example,
-asking for the ``looks'' (fonts, line
-spacing, indentation, and so forth) of a paragraph selection, not the
-text of the paragraph.
-The target type can also be used for other
-purposes.
-The protocol does not constrain the semantics.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To set the selection owner, use
-<function>XSetSelectionOwner</function>.
-<indexterm><primary>Selection</primary><secondary>setting the owner</secondary></indexterm>
-<indexterm significance="preferred"><primary>XSetSelectionOwner</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef><function>XSetSelectionOwner</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Atom<parameter> selection</parameter></paramdef>
- <paramdef>Window<parameter> owner</parameter></paramdef>
- <paramdef>Time<parameter> time</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>selection</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the selection atom.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>owner</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the owner of the specified selection atom.
-You can pass a window or
-<symbol>None</symbol>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>time</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the time.
-You can pass either a timestamp or
-<symbol>CurrentTime</symbol>.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XSetSelectionOwner</function>
-function changes the owner and last-change time for the specified selection
-and has no effect if the specified time is earlier than the current
-last-change time of the specified selection
-or is later than the current X server time.
-Otherwise, the last-change time is set to the specified time,
-with
-<symbol>CurrentTime</symbol>
-replaced by the current server time.
-If the owner window is specified as
-<symbol>None</symbol>,
-then the owner of the selection becomes
-<symbol>None</symbol>
-(that is, no owner).
-Otherwise, the owner of the selection becomes the client executing
-the request.
-</para>
-<para>
-<!-- .LP -->
-If the new owner (whether a client or
-<symbol>None</symbol>)
-is not
-the same as the current owner of the selection and the current
-owner is not
-<symbol>None</symbol>,
-the current owner is sent a
-<symbol>SelectionClear</symbol>
-event.
-If the client that is the owner of a selection is later
-terminated (that is, its connection is closed)
-or if the owner window it has specified in the request is later
-destroyed,
-the owner of the selection automatically
-reverts to
-<symbol>None</symbol>,
-but the last-change time is not affected.
-The selection atom is uninterpreted by the X server.
-<function>XGetSelectionOwner</function>
-returns the owner window, which is reported in
-<symbol>SelectionRequest</symbol>
-and
-<symbol>SelectionClear</symbol>
-events.
-Selections are global to the X server.
-</para>
-<para>
-<!-- .LP -->
-<function>XSetSelectionOwner</function>
-can generate
-<errorname>BadAtom</errorname>
-and
-<errorname>BadWindow</errorname>
-errors.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To return the selection owner, use
-<function>XGetSelectionOwner</function>.
-<indexterm><primary>Selection</primary><secondary>getting the owner</secondary></indexterm>
-<indexterm significance="preferred"><primary>XGetSelectionOwner</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef>Window <function>XGetSelectionOwner</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Atom<parameter> selection</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
-<!-- .ds Se whose owner you want returned -->
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>selection</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the selection atom (Se.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-The
-<function>XGetSelectionOwner</function>
-function
-returns the window ID associated with the window that currently owns the
-specified selection.
-If no selection was specified, the function returns the constant
-<symbol>None</symbol>.
-If
-<symbol>None</symbol>
-is returned,
-there is no owner for the selection.
-</para>
-<para>
-<!-- .LP -->
-<function>XGetSelectionOwner</function>
-can generate a
-<errorname>BadAtom</errorname>
-error.
-</para>
-<para>
-<!-- .LP -->
-<!-- .sp -->
-To request conversion of a selection, use
-<function>XConvertSelection</function>.
-<indexterm><primary>Selection</primary><secondary>converting</secondary></indexterm>
-<indexterm significance="preferred"><primary>XConvertSelection</primary></indexterm>
-<!-- .sM -->
-<funcsynopsis>
-<funcprototype>
- <funcdef><function>XConvertSelection</function></funcdef>
- <paramdef>Display<parameter> *display</parameter></paramdef>
- <paramdef>Atomselection,<parameter> target</parameter></paramdef>
- <paramdef>Atom<parameter> property</parameter></paramdef>
- <paramdef>Window<parameter> requestor</parameter></paramdef>
- <paramdef>Time<parameter> time</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-<!-- .FN -->
-<variablelist>
- <varlistentry>
- <term>
- <emphasis remap='I'>display</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the connection to the X server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>selection</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the selection atom.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>target</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the target atom.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>property</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the property name.
-You also can pass
-<symbol>None</symbol>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>requestor</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the requestor.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <emphasis remap='I'>time</emphasis>
- </term>
- <listitem>
- <para>
-Specifies the time.
-You can pass either a timestamp or
-<symbol>CurrentTime</symbol>.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</para>
-<para>
-<!-- .LP -->
-<!-- .eM -->
-<function>XConvertSelection</function>
-requests that the specified selection be converted to the specified target
-type:
-</para>
-<itemizedlist>
- <listitem>
- <para>
-If the specified selection has an owner, the X server sends a
-<symbol>SelectionRequest</symbol>
-event to that owner.
- </para>
- </listitem>
- <listitem>
- <para>
-If no owner for the specified
-selection exists, the X server generates a
-<symbol>SelectionNotify</symbol>
-event to the
-requestor with property
-<symbol>None</symbol>.
- </para>
- </listitem>
-</itemizedlist>
-<para>
-<!-- .LP -->
-The arguments are passed on unchanged in either of the events.
-There are two predefined selection atoms: PRIMARY and SECONDARY.
-</para>
-<para>
-<!-- .LP -->
-<function>XConvertSelection</function>
-can generate
-<errorname>BadAtom</errorname>
-and
-<errorname>BadWindow</errorname>
-errors.
-<!-- .bp -->
-
-
-</para>
-</sect1>
-</chapter>
+<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> +<chapter id="window_information_functions"> +<title>Window Information Functions</title> + +<para> +After you connect the display to the X server and create a window, you can use the Xlib window +information functions to: +</para> +<itemizedlist> + <listitem><para>Obtain information about a window</para></listitem> + <listitem><para>Translate screen coordinates</para></listitem> + <listitem><para>Manipulate property lists</para></listitem> + <listitem><para>Obtain and change window properties</para></listitem> + <listitem><para>Manipulate selections</para></listitem> +</itemizedlist> + +<sect1 id="Obtaining_Window_Information"> +<title>Obtaining Window Information</title> +<!-- .XS --> +<!-- (SN Obtaining Window Information --> +<!-- .XE --> +<para> +<!-- .LP --> +Xlib provides functions that you can use to obtain information about +the window tree, the window's current attributes, +the window's current geometry, or the current pointer coordinates. +Because they are most frequently used by window managers, +these functions all return a status to indicate whether the window still +exists. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain the parent, a list of children, and number of children for +a given window, use +<function>XQueryTree</function>. +<indexterm><primary>Child Window</primary></indexterm> +<indexterm><primary>Parent Window</primary></indexterm> +<indexterm significance="preferred"><primary>XQueryTree</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Status <function>XQueryTree</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>Window<parameter> *root_return</parameter></paramdef> + <paramdef>Window<parameter> *parent_return</parameter></paramdef> + <paramdef>Window<parameter> **children_return</parameter></paramdef> + <paramdef>unsignedint<parameter> *nchildren_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose list of children, root, parent, and number of children \ --> +you want to obtain + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>root_return</emphasis> + </term> + <listitem> + <para> +Returns the root window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>parent_return</emphasis> + </term> + <listitem> + <para> +Returns the parent window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>children_return</emphasis> + </term> + <listitem> + <para> +Returns the list of children. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>nchildren_return</emphasis> + </term> + <listitem> + <para> +Returns the number of children. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XQueryTree</function> +function returns the root ID, the parent window ID, +a pointer to the list of children windows +(NULL when there are no children), +and the number of children in the list for the specified window. +The children are listed in current stacking order, from bottom-most +(first) to top-most (last). +<function>XQueryTree</function> +returns zero if it fails and nonzero if it succeeds. +To free a non-NULL children list when it is no longer needed, use +<function>XFree</function>. +</para> +<para> +<!-- .LP --> +<function>XQueryTree</function> +can generate a +<errorname>BadWindow</errorname> +error. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain the current attributes of a given window, use +<function>XGetWindowAttributes</function>. +<indexterm significance="preferred"><primary>XGetWindowAttributes</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Status <function>XGetWindowAttributes</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>XWindowAttributes<parameter> *window_attributes_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose current attributes you want to obtain --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>window_attributes_return</emphasis> + </term> + <listitem> + <para> +Returns the specified window's attributes in the +<structname>XWindowAttributes</structname> +structure. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetWindowAttributes</function> +function returns the current attributes for the specified window to an +<structname>XWindowAttributes</structname> +structure. +</para> +<para> +<!-- .LP --> +<indexterm significance="preferred"><primary>XWindowAttributes</primary></indexterm> +<!-- .sM --> +<literallayout class="monospaced"> +<!-- .TA .5i 3i --> +<!-- .ta .5i 3i --> +typedef struct { + int x, y; /* location of window */ + int width, height; /* width and height of window */ + int border_width; /* border width of window */ + int depth; /* depth of window */ + Visual *visual; /* the associated visual structure */ + Window root; /* root of screen containing window */ + int class; /* InputOutput, InputOnly*/ + int bit_gravity; /* one of the bit gravity values */ + int win_gravity; /* one of the window gravity values */ + int backing_store; /* NotUseful, WhenMapped, Always */ + unsigned long backing_planes; /* planes to be preserved if possible */ + unsigned long backing_pixel; /* value to be used when restoring planes */ + Bool save_under; /* boolean, should bits under be saved? */ + Colormap colormap; /* color map to be associated with window */ + Bool map_installed; /* boolean, is color map currently installed*/ + int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ + long all_event_masks; /* set of events all people have interest in*/ + long your_event_mask; /* my event mask */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Screen *screen; /* back pointer to correct screen */ +} XWindowAttributes; +</literallayout> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The x and y members are set to the upper-left outer +corner relative to the parent window's origin. +The width and height members are set to the inside size of the window, +not including the border. +The border_width member is set to the window's border width in pixels. +The depth member is set to the depth of the window +(that is, bits per pixel for the object). +The visual member is a pointer to the screen's associated +<structname>Visual</structname> +structure. +The root member is set to the root window of the screen containing the window. +The class member is set to the window's class and can be either +<symbol>InputOutput</symbol> +or +<symbol>InputOnly</symbol>. +</para> +<para> +<!-- .LP --> +The bit_gravity member is set to the window's bit gravity +and can be one of the following: + <simplelist type="vert" columns="2"> + <member><symbol>ForgetGravity</symbol></member> + <member><symbol>NorthWestGravity</symbol></member> + <member><symbol>NorthGravity</symbol></member> + <member><symbol>NorthEastGravity</symbol></member> + <member><symbol>WestGravity</symbol></member> + + <member><symbol>EastGravity</symbol></member> + <member><symbol>SouthWestGravity</symbol></member> + <member><symbol>SouthGravity</symbol></member> + <member><symbol>SouthEastGravity</symbol></member> + <member><symbol>StaticGravity</symbol></member> + </simplelist> +</para> +<para> +The win_gravity member is set to the window's window gravity +and can be one of the following: + <simplelist type="vert" columns="2"> + <member><symbol>UnmapGravity</symbol></member> + <member><symbol>NorthWestGravity</symbol></member> + <member><symbol>NorthGravity</symbol></member> + <member><symbol>NorthEastGravity</symbol></member> + <member><symbol>WestGravity</symbol></member> + + <member><symbol>EastGravity</symbol></member> + <member><symbol>SouthWestGravity</symbol></member> + <member><symbol>SouthGravity</symbol></member> + <member><symbol>SouthEastGravity</symbol></member> + <member><symbol>StaticGravity</symbol></member> + <member><symbol>CenterGravity</symbol></member> + </simplelist> +</para> +<para> +<!-- .LP --> +For additional information on gravity, +see section 3.2.3. <!-- xref --> +</para> +<para> +<!-- .LP --> +The backing_store member is set to indicate how the X server should maintain +the contents of a window +and can be +<symbol>WhenMapped</symbol>, +<symbol>Always</symbol>, +or +<symbol>NotUseful</symbol>. +The backing_planes member is set to indicate (with bits set to 1) which bit +planes of the window hold dynamic data that must be preserved in backing_stores +and during save_unders. +The backing_pixel member is set to indicate what values to use +for planes not set in backing_planes. +</para> +<para> +<!-- .LP --> +The save_under member is set to +<symbol>True</symbol> +or +<symbol>False</symbol>. +The colormap member is set to the colormap for the specified window and can be +a colormap ID or +<symbol>None</symbol>. +The map_installed member is set to indicate whether the colormap is +currently installed and can be +<symbol>True</symbol> +or +<symbol>False</symbol>. +The map_state member is set to indicate the state of the window and can be +<symbol>IsUnmapped</symbol>, +<symbol>IsUnviewable</symbol>, +or +<symbol>IsViewable</symbol>. +<symbol>IsUnviewable</symbol> +is used if the window is mapped but some ancestor is unmapped. +</para> +<para> +<!-- .LP --> +The all_event_masks member is set to the bitwise inclusive OR of all event +masks selected on the window by all clients. +The your_event_mask member is set to the bitwise inclusive OR of all event +masks selected by the querying client. +The do_not_propagate_mask member is set to the bitwise inclusive OR of the +set of events that should not propagate. +</para> +<para> +<!-- .LP --> +The override_redirect member is set to indicate whether this window overrides +structure control facilities and can be +<symbol>True</symbol> +or +<symbol>False</symbol>. +Window manager clients should ignore the window if this member is +<symbol>True</symbol>. +</para> +<para> +<!-- .LP --> +The screen member is set to a screen pointer that gives you a back pointer +to the correct screen. +This makes it easier to obtain the screen information without +having to loop over the root window fields to see which field matches. +</para> +<para> +<!-- .LP --> +<function>XGetWindowAttributes</function> +can generate +<errorname>BadDrawable</errorname> +and +<errorname>BadWindow</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain the current geometry of a given drawable, use +<function>XGetGeometry</function>. +<indexterm significance="preferred"><primary>XGetGeometry</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Status <function>XGetGeometry</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Drawable<parameter> d</parameter></paramdef> + <paramdef>Window<parameter> *root_return</parameter></paramdef> + <paramdef>int*x_return,<parameter> *y_return</parameter></paramdef> + <paramdef>unsignedint*width_return,<parameter> *height_return</parameter></paramdef> + <paramdef>unsignedint<parameter> *border_width_return</parameter></paramdef> + <paramdef>unsignedint<parameter> *depth_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Dr , which can be a window or a pixmap --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>d</emphasis> + </term> + <listitem> + <para> +Specifies the drawable(Dr. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>root_return</emphasis> + </term> + <listitem> + <para> +Returns the root window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>x_return</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>y_return</emphasis> + </term> + <listitem> + <para> +Return the x and y coordinates that define the location of the drawable. +For a window, +these coordinates specify the upper-left outer corner relative to +its parent's origin. +For pixmaps, these coordinates are always zero. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>width_return</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>height_return</emphasis> + </term> + <listitem> + <para> +Return the drawable's dimensions (width and height). +For a window, +these dimensions specify the inside size, not including the border. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>border_width_return</emphasis> + </term> + <listitem> + <para> +Returns the border width in pixels. +If the drawable is a pixmap, it returns zero. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>depth_return</emphasis> + </term> + <listitem> + <para> +Returns the depth of the drawable (bits per pixel for the object). + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetGeometry</function> +function returns the root window and the current geometry of the drawable. +The geometry of the drawable includes the x and y coordinates, width and height, +border width, and depth. +These are described in the argument list. +It is legal to pass to this function a window whose class is +<symbol>InputOnly</symbol>. +</para> +<para> +<!-- .LP --> +<function>XGetGeometry</function> +can generate a +<errorname>BadDrawable</errorname> +error. +</para> +</sect1> +<sect1 id="Translating_Screen_Coordinates"> +<title>Translating Screen Coordinates</title> +<!-- .XS --> +<!-- (SN Translating Screen Coordinates --> +<!-- .XE --> +<para> +<!-- .LP --> +Applications sometimes +need to perform a coordinate transformation from the coordinate +space of one window to another window or need to determine which +window the pointing device is in. +<function>XTranslateCoordinates</function> +and +<function>XQueryPointer</function> +fulfill these needs (and avoid any race conditions) by +asking the X server to perform these operations. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To translate a coordinate in one window to the coordinate +space of another window, use +<function>XTranslateCoordinates</function>. +<indexterm significance="preferred"><primary>XTranslateCoordinates</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Bool <function>XTranslateCoordinates</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Windowsrc_w,<parameter> dest_w</parameter></paramdef> + <paramdef>intsrc_x,<parameter> src_y</parameter></paramdef> + <paramdef>int*dest_x_return,<parameter> *dest_y_return</parameter></paramdef> + <paramdef>Window<parameter> *child_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>src_w</emphasis> + </term> + <listitem> + <para> +Specifies the source window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>dest_w</emphasis> + </term> + <listitem> + <para> +Specifies the destination window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>src_x</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>src_y</emphasis> + </term> + <listitem> + <para> +Specify the x and y coordinates within the source window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>dest_x_return</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>dest_y_return</emphasis> + </term> + <listitem> + <para> +Return the x and y coordinates within the destination window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>child_return</emphasis> + </term> + <listitem> + <para> +Returns the child if the coordinates are contained in a mapped child of the +destination window. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +If +<function>XTranslateCoordinates</function> +returns +<symbol>True</symbol>, +it takes the src_x and src_y coordinates relative +to the source window's origin and returns these coordinates to +dest_x_return and dest_y_return +relative to the destination window's origin. +If +<function>XTranslateCoordinates</function> +returns +<symbol>False</symbol>, +src_w and dest_w are on different screens, +and dest_x_return and dest_y_return are zero. +If the coordinates are contained in a mapped child of dest_w, +that child is returned to child_return. +Otherwise, child_return is set to +<symbol>None</symbol>. +</para> +<para> +<!-- .LP --> +<function>XTranslateCoordinates</function> +can generate a +<errorname>BadWindow</errorname> +error. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain the screen coordinates of the pointer +or to determine the pointer coordinates relative to a specified window, use +<function>XQueryPointer</function>. +<indexterm significance="preferred"><primary>XQueryPointer</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Bool <function>XQueryPointer</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>Window*root_return,<parameter> *child_return</parameter></paramdef> + <paramdef>int*root_x_return,<parameter> *root_y_return</parameter></paramdef> + <paramdef>int*win_x_return,<parameter> *win_y_return</parameter></paramdef> + <paramdef>unsignedint<parameter> *mask_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window. +<!-- .ds Ro that the pointer is in --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>root_return</emphasis> + </term> + <listitem> + <para> +Returns the root window (Ro. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>child_return</emphasis> + </term> + <listitem> + <para> +Returns the child window that the pointer is located in, if any. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>root_x_return</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>root_y_return</emphasis> + </term> + <listitem> + <para> +Return the pointer coordinates relative to the root window's origin. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>win_x_return</emphasis> + </term> + <listitem> + <para> +<!-- .br --> +<!-- .ns --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>win_y_return</emphasis> + </term> + <listitem> + <para> +Return the pointer coordinates relative to the specified window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>mask_return</emphasis> + </term> + <listitem> + <para> +Returns the current state of the modifier keys and pointer buttons. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XQueryPointer</function> +function returns the root window the pointer is logically on and the pointer +coordinates relative to the root window's origin. +If +<function>XQueryPointer</function> +returns +<symbol>False</symbol>, +the pointer is not on the same screen as the specified window, and +<function>XQueryPointer</function> +returns +<symbol>None</symbol> +to child_return and zero to win_x_return and win_y_return. +If +<function>XQueryPointer</function> +returns +<symbol>True</symbol>, +the pointer coordinates returned to win_x_return and win_y_return +are relative to the origin of the specified window. +In this case, +<function>XQueryPointer</function> +returns the child that contains the pointer, if any, +or else +<symbol>None</symbol> +to child_return. +</para> +<para> +<!-- .LP --> +<function>XQueryPointer</function> +returns the current logical state of the keyboard buttons +and the modifier keys in mask_return. +It sets mask_return to the bitwise inclusive OR of one or more +of the button or modifier key bitmasks to match +the current state of the mouse buttons and the modifier keys. +</para> +<para> +<!-- .LP --> +Note that the logical state of a device (as seen through Xlib) +may lag the physical state if device event processing is frozen +(see section 12.1). <!-- xref --> +</para> +<para> +<!-- .LP --> +<function>XQueryPointer</function> +can generate a +<errorname>BadWindow</errorname> +error. +</para> +</sect1> +<sect1 id="Properties_and_Atoms"> +<title>Properties and Atoms</title> +<!-- .XS --> +<!-- (SN Properties and Atoms --> +<!-- .XE --> +<para> +<!-- .LP --> +A property is a collection of named, typed data. +The window system has a set of predefined properties +<indexterm><primary>Atom</primary><secondary>predefined</secondary></indexterm> +(for example, the name of a window, size hints, and so on), and users can +define any other arbitrary information and associate it with windows. +Each property has a name, +which is an ISO Latin-1 string. +For each named property, +a unique identifier (atom) is associated with it. +A property also has a type, for example, string or integer. +These types are also indicated using atoms, so arbitrary new +types can be defined. +Data of only one type may be associated with a single +property name. +Clients can store and retrieve properties associated with windows. +For efficiency reasons, +an atom is used rather than a character string. +<function>XInternAtom</function> +can be used to obtain the atom for property names. +<indexterm><primary>Atom</primary></indexterm> +</para> +<para> +<!-- .LP --> +A property is also stored in one of several possible formats. +The X server can store the information as 8-bit quantities, 16-bit +quantities, or 32-bit quantities. +This permits the X server to present the data in the byte order that the +client expects. +<!-- .NT Note --> +If you define further properties of complex type, +you must encode and decode them yourself. +These functions must be carefully written if they are to be portable. +For further information about how to write a library extension, +see appendix C. <!-- xref --> +<!-- .NE --> +The type of a property is defined by an atom, which allows for +arbitrary extension in this type scheme. +<indexterm><primary>Atom</primary></indexterm> +</para> +<para> +<!-- .LP --> +Certain property names are +predefined in the server for commonly used functions. +The atoms for these properties are defined in +<filename class="headerfile"><X11/Xatom.h></filename>. +<indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm> +<indexterm><primary>Files</primary><secondary><filename class="headerfile"><X11/Xatom.h></filename></secondary></indexterm> +<indexterm><primary>Headers</primary><secondary><filename class="headerfile"><X11/Xatom.h></filename></secondary></indexterm> +To avoid name clashes with user symbols, the +<code>#define</code> +name for each atom has the XA_ prefix. +For an explanation of the functions that let you get and set +much of the information stored in these predefined properties, +see chapter 14. <!-- xref --> +</para> +<para> +<!-- .LP --> +The core protocol imposes no semantics on these property names, +but semantics are specified in other X Consortium standards, +such as the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis> +and the <emphasis remap='I'>X Logical Font Description Conventions</emphasis>. +</para> +<para> +<!-- .LP --> +You can use properties to communicate other information between +applications. +The functions described in this section let you define new properties +and get the unique atom IDs in your applications. +</para> +<para> +<!-- .LP --> +Although any particular atom can have some client interpretation +within each of the name spaces, +atoms occur in five distinct name spaces within the protocol: +</para> +<itemizedlist> + <listitem> + <para> +Selections + </para> + </listitem> + <listitem> + <para> +Property names + </para> + </listitem> + <listitem> + <para> +Property types + </para> + </listitem> + <listitem> + <para> +Font properties + </para> + </listitem> + <listitem> + <para> +Type of a +<symbol>ClientMessage</symbol> +event (none are built into the X server) + </para> + </listitem> +</itemizedlist> +<para> +<!-- .LP --> +</para> +<para> +<!-- .LP --> +The built-in selection property names are: +<simplelist type="vert" columns="2"> + <member><property>PRIMARY</property></member> + <member><property>SECONDARY</property></member> +</simplelist> +</para> +<para> +<!-- .LP --> +The built-in property names are: + <simplelist type="vert" columns="2"> + <member><property>CUT_BUFFER0</property></member> + <member><property>CUT_BUFFER1</property></member> + <member><property>CUT_BUFFER2</property></member> + <member><property>CUT_BUFFER3</property></member> + <member><property>CUT_BUFFER4</property></member> + <member><property>CUT_BUFFER5</property></member> + <member><property>CUT_BUFFER6</property></member> + <member><property>CUT_BUFFER7</property></member> + <member><property>RGB_BEST_MAP</property></member> + <member><property>RGB_BLUE_MAP</property></member> + <member><property>RGB_DEFAULT_MAP</property></member> + <member><property>RGB_GRAY_MAP</property></member> + <member><property>RGB_GREEN_MAP</property></member> + <member><property>RGB_RED_MAP</property></member> + + <member><property>RESOURCE_MANAGER</property></member> + <member><property>WM_CLASS</property></member> + <member><property>WM_CLIENT_MACHINE</property></member> + <member><property>WM_COLORMAP_WINDOWS</property></member> + <member><property>WM_COMMAND</property></member> + <member><property>WM_HINTS</property></member> + <member><property>WM_ICON_NAME</property></member> + <member><property>WM_ICON_SIZE</property></member> + <member><property>WM_NAME</property></member> + <member><property>WM_NORMAL_HINTS</property></member> + <member><property>WM_PROTOCOLS</property></member> + <member><property>WM_STATE</property></member> + <member><property>WM_TRANSIENT_FOR</property></member> + <member><property>WM_ZOOM_HINTS</property></member> + </simplelist> +</para> +<para> +The built-in property types are: + <simplelist type="vert" columns="2"> + <member><property>ARC</property></member> + <member><property>ATOM</property></member> + <member><property>BITMAP</property></member> + <member><property>CARDINAL</property></member> + <member><property>COLORMAP</property></member> + <member><property>CURSOR</property></member> + <member><property>DRAWABLE</property></member> + <member><property>FONT</property></member> + <member><property>INTEGER</property></member> + <member><property>PIXMAP</property></member> + <member><property>POINT</property></member> + <member><property>RGB_COLOR_MAP</property></member> + <member><property>RECTANGLE</property></member> + <member><property>STRING</property></member> + <member><property>VISUALID</property></member> + <member><property>WINDOW</property></member> + <member><property>WM_HINTS</property></member> + <member><property>WM_SIZE_HINTS</property></member> + </simplelist> +</para> +<para> +The built-in font property names are: + <simplelist type="vert" columns="2"> + <member><property>MIN_SPACE</property></member> + <member><property>NORM_SPACE</property></member> + <member><property>MAX_SPACE</property></member> + <member><property>END_SPACE</property></member> + <member><property>SUPERSCRIPT_X</property></member> + <member><property>SUPERSCRIPT_Y</property></member> + <member><property>SUBSCRIPT_X</property></member> + <member><property>SUBSCRIPT_Y</property></member> + <member><property>UNDERLINE_POSITION</property></member> + <member><property>UNDERLINE_THICKNESS</property></member> + <member><property>FONT_NAME</property></member> + <member><property>FULL_NAME</property></member> + + <member><property>STRIKEOUT_DESCENT</property></member> + <member><property>STRIKEOUT_ASCENT</property></member> + <member><property>ITALIC_ANGLE</property></member> + <member><property>X_HEIGHT</property></member> + <member><property>QUAD_WIDTH</property></member> + <member><property>WEIGHT</property></member> + <member><property>POINT_SIZE</property></member> + <member><property>RESOLUTION</property></member> + <member><property>COPYRIGHT</property></member> + <member><property>NOTICE</property></member> + <member><property>FAMILY_NAME</property></member> + <member><property>CAP_HEIGHT</property></member> + </simplelist> +</para> +<para> +<!-- .LP --> +For further information about font properties, +see section 8.5. <!-- xref --> +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To return an atom for a given name, use +<function>XInternAtom</function>. +<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm> +<indexterm significance="preferred"><primary>XInternAtom</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Atom <function>XInternAtom</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>char<parameter> *atom_name</parameter></paramdef> + <paramdef>Bool<parameter> only_if_exists</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>atom_name</emphasis> + </term> + <listitem> + <para> +Specifies the name associated with the atom you want returned. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>only_if_exists</emphasis> + </term> + <listitem> + <para> +Specifies a Boolean value that indicates whether the atom must be created. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XInternAtom</function> +function returns the atom identifier associated with the specified atom_name +string. +If only_if_exists is +<symbol>False</symbol>, +the atom is created if it does not exist. +Therefore, +<function>XInternAtom</function> +can return +<symbol>None</symbol>. +If the atom name is not in the Host Portable Character Encoding, +the result is implementation-dependent. +Uppercase and lowercase matter; +the strings ``thing'', ``Thing'', and ``thinG'' +all designate different atoms. +The atom will remain defined even after the client's connection closes. +It will become undefined only when the last connection to +the X server closes. +</para> +<para> +<!-- .LP --> +<function>XInternAtom</function> +can generate +<errorname>BadAlloc</errorname> +and +<errorname>BadValue</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To return atoms for an array of names, use +<function>XInternAtoms</function>. +<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm> +<indexterm significance="preferred"><primary>XInternAtoms</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Status <function>XInternAtoms</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>char<parameter> **names</parameter></paramdef> + <paramdef>int<parameter> count</parameter></paramdef> + <paramdef>Bool<parameter> only_if_exists</parameter></paramdef> + <paramdef>Atom<parameter> *atoms_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>names</emphasis> + </term> + <listitem> + <para> +Specifies the array of atom names. +<!-- .ds Cn atom names in the array --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>count</emphasis> + </term> + <listitem> + <para> +Specifies the number of (Cn. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>only_if_exists</emphasis> + </term> + <listitem> + <para> +Specifies a Boolean value that indicates whether the atom must be created. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>atoms_return</emphasis> + </term> + <listitem> + <para> +Returns the atoms. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XInternAtoms</function> +function returns the atom identifiers associated with the specified names. +The atoms are stored in the atoms_return array supplied by the caller. +Calling this function is equivalent to calling +<function>XInternAtom</function> +for each of the names in turn with the specified value of only_if_exists, +but this function minimizes the number of round-trip protocol exchanges +between the client and the X server. +</para> +<para> +<!-- .LP --> +This function returns a nonzero status if atoms are returned for +all of the names; +otherwise, it returns zero. +</para> +<para> +<!-- .LP --> +<function>XInternAtoms</function> +can generate +<errorname>BadAlloc</errorname> +and +<errorname>BadValue</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To return a name for a given atom identifier, use +<function>XGetAtomName</function>. +<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm> +<indexterm significance="preferred"><primary>XGetAtomName</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>char *<function>XGetAtomName</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Atom<parameter> atom</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>atom</emphasis> + </term> + <listitem> + <para> +Specifies the atom for the property name you want returned. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetAtomName</function> +function returns the name associated with the specified atom. +If the data returned by the server is in the Latin Portable Character Encoding, +then the returned string is in the Host Portable Character Encoding. +Otherwise, the result is implementation-dependent. +To free the resulting string, +call +<function>XFree</function>. +</para> +<para> +<!-- .LP --> +<function>XGetAtomName</function> +can generate a +<errorname>BadAtom</errorname> +error. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To return the names for an array of atom identifiers, use +<function>XGetAtomNames</function>. +<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm> +<indexterm significance="preferred"><primary>XGetAtomNames</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Status <function>XGetAtomNames</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Atom<parameter> *atoms</parameter></paramdef> + <paramdef>int<parameter> count</parameter></paramdef> + <paramdef>char<parameter> **names_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>atoms</emphasis> + </term> + <listitem> + <para> +Specifies the array of atoms. +<!-- .ds Cn atoms in the array --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>count</emphasis> + </term> + <listitem> + <para> +Specifies the number of (Cn. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>names_return</emphasis> + </term> + <listitem> + <para> +Returns the atom names. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetAtomNames</function> +function returns the names associated with the specified atoms. +The names are stored in the names_return array supplied by the caller. +Calling this function is equivalent to calling +<function>XGetAtomName</function> +for each of the atoms in turn, +but this function minimizes the number of round-trip protocol exchanges +between the client and the X server. +</para> +<para> +<!-- .LP --> +This function returns a nonzero status if names are returned for +all of the atoms; +otherwise, it returns zero. +</para> +<para> +<!-- .LP --> +<function>XGetAtomNames</function> +can generate a +<errorname>BadAtom</errorname> +error. +</para> +</sect1> +<sect1 id="Obtaining_and_Changing_Window_Properties"> +<title>Obtaining and Changing Window Properties</title> +<!-- .XS --> +<!-- (SN Obtaining and Changing Window Properties --> +<!-- .XE --> +<para> +<!-- .LP --> +You can attach a property list to every window. +Each property has a name, a type, and a value (see section 4.3). <!-- xref --> +The value is an array of 8-bit, 16-bit, or 32-bit quantities, +whose interpretation is left to the clients. The type +<type>char</type> +is used to represent 8-bit quantities, the type +<type>short</type> +is used to represent 16-bit quantities, and the type +<type>long</type> +is used to represent 32-bit quantities. +</para> +<para> +<!-- .LP --> +Xlib provides functions that you can use to obtain, +change, update, or interchange window properties. +In addition, Xlib provides other utility functions for inter-client +communication (see chapter 14). <!-- xref --> +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain the type, format, and value of a property of a given window, use +<function>XGetWindowProperty</function>. +<indexterm><primary>Property</primary><secondary>getting</secondary></indexterm> +</para> +<para> +<!-- .LP --> +<indexterm significance="preferred"><primary>XGetWindowProperty</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>int <function>XGetWindowProperty</function></funcdef> + <paramdef><parameter> display</parameter></paramdef> + <paramdef><parameter> w</parameter></paramdef> + <paramdef><parameter> property</parameter></paramdef> + <paramdef><parameter> long_offset</parameter></paramdef> + <paramdef><parameter> long_length</parameter></paramdef> + <paramdef><parameter> delete</parameter></paramdef> + <paramdef><parameter> req_type</parameter></paramdef> + <paramdef><parameter> actual_type_return</parameter></paramdef> + <paramdef><parameter> actual_format_return</parameter></paramdef> + <paramdef><parameter> nitems_return</parameter></paramdef> + <paramdef><parameter> bytes_after_return</parameter></paramdef> + <paramdef>.br<parameter> prop_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose property you want to obtain --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>property</emphasis> + </term> + <listitem> + <para> +Specifies the property name. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>long_offset</emphasis> + </term> + <listitem> + <para> +Specifies the offset in the specified property (in 32-bit quantities) +where the data is to be retrieved. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>long_length</emphasis> + </term> + <listitem> + <para> +Specifies the length in 32-bit multiples of the data to be retrieved. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>delete</emphasis> + </term> + <listitem> + <para> +Specifies a Boolean value that determines whether the property is deleted. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>req_type</emphasis> + </term> + <listitem> + <para> +Specifies the atom identifier associated with the property type or +<symbol>AnyPropertyType</symbol>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>actual_type_return</emphasis> + </term> + <listitem> + <para> +Returns the atom identifier that defines the actual type of the property. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>actual_format_return</emphasis> + </term> + <listitem> + <para> +Returns the actual format of the property. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>nitems_return</emphasis> + </term> + <listitem> + <para> +Returns the actual number of 8-bit, 16-bit, or 32-bit items +stored in the prop_return data. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>bytes_after_return</emphasis> + </term> + <listitem> + <para> +Returns the number of bytes remaining to be read in the property if +a partial read was performed. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>prop_return</emphasis> + </term> + <listitem> + <para> +Returns the data in the specified format. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetWindowProperty</function> +function returns the actual type of the property; the actual format of the property; +the number of 8-bit, 16-bit, or 32-bit items transferred; the number of bytes remaining +to be read in the property; and a pointer to the data actually returned. +<function>XGetWindowProperty</function> +sets the return arguments as follows: +</para> +<itemizedlist> + <listitem> + <para> +If the specified property does not exist for the specified window, +<function>XGetWindowProperty</function> +returns +<symbol>None</symbol> +to actual_type_return and the value zero to +actual_format_return and bytes_after_return. +The nitems_return argument is empty. +In this case, the delete argument is ignored. + </para> + </listitem> + <listitem> + <para> +If the specified property exists +but its type does not match the specified type, +<function>XGetWindowProperty</function> +returns the actual property type to actual_type_return, +the actual property format (never zero) to actual_format_return, +and the property length in bytes +(even if the actual_format_return is 16 or 32) +to bytes_after_return. +It also ignores the delete argument. +The nitems_return argument is empty. + </para> + </listitem> + <listitem> + <para> +If the specified property exists and either you assign +<symbol>AnyPropertyType</symbol> +to the req_type argument or the specified type matches the actual property type, +<function>XGetWindowProperty</function> +returns the actual property type to actual_type_return and the actual +property format (never zero) to actual_format_return. +It also returns a value to bytes_after_return and nitems_return, by +defining the following +values: + </para> + </listitem> + <listitem> + <para> +<!-- .nf --> + N = actual length of the stored property in bytes + (even if the format is 16 or 32) + I = 4 * long_offset + T = N - I + L = MINIMUM(T, 4 * long_length) + A = N - (I + L) +<!-- .fi --> + </para> + </listitem> + <listitem> + <para> +The returned value starts at byte index I in the property (indexing +from zero), and its length in bytes is L. +If the value for long_offset causes L to be negative, +a +<errorname>BadValue</errorname> +error results. +The value of bytes_after_return is A, +giving the number of trailing unread bytes in the stored property. + </para> + </listitem> +</itemizedlist> +<para> +<!-- .LP --> +If the returned format is 8, the returned data is represented as a +<type>char</type> +array. +If the returned format is 16, the returned data is represented as a +<type>short</type> +array and should be cast to that type to obtain the elements. +If the returned format is 32, the returned data is represented as a +<type>long</type> +array and should be cast to that type to obtain the elements. +</para> +<para> +<!-- .LP --> +<function>XGetWindowProperty</function> +always allocates one extra byte in prop_return +(even if the property is zero length) +and sets it to zero so that simple properties consisting of characters +do not have to be copied into yet another string before use. +</para> +<para> +<!-- .LP --> +If delete is +<symbol>True</symbol> +and bytes_after_return is zero, +<function>XGetWindowProperty</function> +deletes the property +from the window and generates a +<symbol>PropertyNotify</symbol> +event on the window. +</para> +<para> +<!-- .LP --> +The function returns +<symbol>Success</symbol> +if it executes successfully. +To free the resulting data, +use +<function>XFree</function>. +</para> +<para> +<!-- .LP --> +<function>XGetWindowProperty</function> +can generate +<errorname>BadAtom</errorname>, +<errorname>BadValue</errorname>, +and +<errorname>BadWindow</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To obtain a given window's property list, use +<function>XListProperties</function>. +<indexterm><primary>Property</primary><secondary>listing</secondary></indexterm> +<indexterm significance="preferred"><primary>XListProperties</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Atom *<function>XListProperties</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>int<parameter> *num_prop_return</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose property list you want to obtain --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>num_prop_return</emphasis> + </term> + <listitem> + <para> +Returns the length of the properties array. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XListProperties</function> +function returns a pointer to an array of atom properties that are defined for +the specified window or returns NULL if no properties were found. +To free the memory allocated by this function, use +<function>XFree</function>. +</para> +<para> +<!-- .LP --> +<function>XListProperties</function> +can generate a +<errorname>BadWindow</errorname> +error. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To change a property of a given window, use +<function>XChangeProperty</function>. +<indexterm><primary>Property</primary><secondary>changing</secondary></indexterm> +<indexterm><primary>Property</primary><secondary>appending</secondary></indexterm> +<indexterm><primary>Property</primary><secondary>prepending</secondary></indexterm> +<indexterm><primary>Property</primary><secondary>replacing</secondary></indexterm> +<indexterm><primary>Property</primary><secondary>format</secondary></indexterm> +<indexterm><primary>Property</primary><secondary>type</secondary></indexterm> +<indexterm significance="preferred"><primary>XChangeProperty</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef><function>XChangeProperty</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>Atomproperty,<parameter> type</parameter></paramdef> + <paramdef>int<parameter> format</parameter></paramdef> + <paramdef>int<parameter> mode</parameter></paramdef> + <paramdef>unsignedchar<parameter> *data</parameter></paramdef> + <paramdef>int<parameter> nelements</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose property you want to change --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>property</emphasis> + </term> + <listitem> + <para> +Specifies the property name. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>type</emphasis> + </term> + <listitem> + <para> +Specifies the type of the property. +The X server does not interpret the type but simply +passes it back to an application that later calls +<function>XGetWindowProperty</function>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>format</emphasis> + </term> + <listitem> + <para> +Specifies whether the data should be viewed as a list +of 8-bit, 16-bit, or 32-bit quantities. +Possible values are 8, 16, and 32. +This information allows the X server to correctly perform +byte-swap operations as necessary. +If the format is 16-bit or 32-bit, +you must explicitly cast your data pointer to an (unsigned char *) in the call +to +<function>XChangeProperty</function>. +<!-- .\" Changed name of this file to prop_mode.a on 1/13/87 --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>mode</emphasis> + </term> + <listitem> + <para> +Specifies the mode of the operation. +You can pass +<symbol>PropModeReplace</symbol>, +<symbol>PropModePrepend</symbol>, +or +<symbol>PropModeAppend</symbol>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>data</emphasis> + </term> + <listitem> + <para> +Specifies the property data. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>nelements</emphasis> + </term> + <listitem> + <para> +Specifies the number of elements of the specified data format. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XChangeProperty</function> +function alters the property for the specified window and +causes the X server to generate a +<symbol>PropertyNotify</symbol> +event on that window. +<function>XChangeProperty</function> +performs the following: +</para> +<itemizedlist> + <listitem> + <para> +If mode is +<symbol>PropModeReplace</symbol>, +<function>XChangeProperty</function> +discards the previous property value and stores the new data. + </para> + </listitem> + <listitem> + <para> +If mode is +<symbol>PropModePrepend</symbol> +or +<symbol>PropModeAppend</symbol>, +<function>XChangeProperty</function> +inserts the specified data before the beginning of the existing data +or onto the end of the existing data, respectively. +The type and format must match the existing property value, +or a +<errorname>BadMatch</errorname> +error results. +If the property is undefined, +it is treated as defined with the correct type and +format with zero-length data. + </para> + </listitem> +</itemizedlist> +<para> +<!-- .LP --> +If the specified format is 8, the property data must be a +<type>char</type> +array. +If the specified format is 16, the property data must be a +<type>short</type> +array. +If the specified format is 32, the property data must be a +<type>long</type> +array. +</para> +<para> +<!-- .LP --> +The lifetime of a property is not tied to the storing client. +Properties remain until explicitly deleted, until the window is destroyed, +or until the server resets. +For a discussion of what happens when the connection to the X server is closed, +see section 2.6. <!-- xref --> +The maximum size of a property is server dependent and can vary dynamically +depending on the amount of memory the server has available. +(If there is insufficient space, a +<errorname>BadAlloc</errorname> +error results.) +</para> +<para> +<!-- .LP --> +<function>XChangeProperty</function> +can generate +<errorname>BadAlloc</errorname>, +<errorname>BadAtom</errorname>, +<errorname>BadMatch</errorname>, +<errorname>BadValue</errorname>, +and +<errorname>BadWindow</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To rotate a window's property list, use +<function>XRotateWindowProperties</function>. +</para> +<para> +<!-- .LP --> +<indexterm significance="preferred"><primary>XRotateWindowProperties</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef><function>XRotateWindowProperties</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>Atom<parameter> properties[]</parameter></paramdef> + <paramdef>int<parameter> num_prop</parameter></paramdef> + <paramdef>int<parameter> npositions</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>properties</emphasis> + </term> + <listitem> + <para> +Specifies the array of properties that are to be rotated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>num_prop</emphasis> + </term> + <listitem> + <para> +Specifies the length of the properties array. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>npositions</emphasis> + </term> + <listitem> + <para> +Specifies the rotation amount. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XRotateWindowProperties</function> +function allows you to rotate properties on a window and causes +the X server to generate +<symbol>PropertyNotify</symbol> +events. +If the property names in the properties array are viewed as being numbered +starting from zero and if there are num_prop property names in the list, +then the value associated with property name I becomes the value associated +with property name (I + npositions) mod N for all I from zero to N − 1. +The effect is to rotate the states by npositions places around the virtual ring +of property names (right for positive npositions, +left for negative npositions). +If npositions mod N is nonzero, +the X server generates a +<symbol>PropertyNotify</symbol> +event for each property in the order that they are listed in the array. +If an atom occurs more than once in the list or no property with that +name is defined for the window, +a +<errorname>BadMatch</errorname> +error results. +If a +<errorname>BadAtom</errorname> +or +<errorname>BadMatch</errorname> +error results, +no properties are changed. +</para> +<para> +<!-- .LP --> +<function>XRotateWindowProperties</function> +can generate +<errorname>BadAtom</errorname>, +<errorname>BadMatch</errorname>, +and +<errorname>BadWindow</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To delete a property on a given window, use +<function>XDeleteProperty</function>. +<indexterm><primary>Property</primary><secondary>deleting</secondary></indexterm> +<indexterm significance="preferred"><primary>XDeleteProperty</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef><function>XDeleteProperty</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Window<parameter> w</parameter></paramdef> + <paramdef>Atom<parameter> property</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Wi whose property you want to delete --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>w</emphasis> + </term> + <listitem> + <para> +Specifies the window (Wi. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>property</emphasis> + </term> + <listitem> + <para> +Specifies the property name. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XDeleteProperty</function> +function deletes the specified property only if the +property was defined on the specified window +and causes the X server to generate a +<symbol>PropertyNotify</symbol> +event on the window unless the property does not exist. +</para> +<para> +<!-- .LP --> +<function>XDeleteProperty</function> +can generate +<errorname>BadAtom</errorname> +and +<errorname>BadWindow</errorname> +errors. +</para> +</sect1> +<sect1 id="Selections"> +<title>Selections</title> +<!-- .XS --> +<!-- (SN Selections --> +<!-- .XE --> +<para> +<!-- .LP --> +<indexterm><primary>Selection</primary></indexterm> +Selections are one method used by applications to exchange data. +By using the property mechanism, +applications can exchange data of arbitrary types and can negotiate +the type of the data. +A selection can be thought of as an indirect property with a dynamic type. +That is, rather than having the property stored in the X server, +the property is maintained by some client (the owner). +A selection is global in nature (considered to belong to the user +but be maintained by clients) rather than being private to a particular +window subhierarchy or a particular set of clients. +</para> +<para> +<!-- .LP --> +Xlib provides functions that you can use to set, get, or request conversion +of selections. +This allows applications to implement the notion of current selection, +which requires that notification be sent to applications when they no +longer own the selection. +Applications that support selection often highlight the current selection +and so must be informed when another application has +acquired the selection so that they can unhighlight the selection. +</para> +<para> +<!-- .LP --> +When a client asks for the contents of +a selection, it specifies a selection target type. +This target type +can be used to control the transmitted representation of the contents. +For example, if the selection is ``the last thing the user clicked on'' +and that is currently an image, then the target type might specify +whether the contents of the image should be sent in XY format or Z format. +</para> +<para> +<!-- .LP --> +The target type can also be used to control the class of +contents transmitted, for example, +asking for the ``looks'' (fonts, line +spacing, indentation, and so forth) of a paragraph selection, not the +text of the paragraph. +The target type can also be used for other +purposes. +The protocol does not constrain the semantics. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To set the selection owner, use +<function>XSetSelectionOwner</function>. +<indexterm><primary>Selection</primary><secondary>setting the owner</secondary></indexterm> +<indexterm significance="preferred"><primary>XSetSelectionOwner</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef><function>XSetSelectionOwner</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Atom<parameter> selection</parameter></paramdef> + <paramdef>Window<parameter> owner</parameter></paramdef> + <paramdef>Time<parameter> time</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>selection</emphasis> + </term> + <listitem> + <para> +Specifies the selection atom. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>owner</emphasis> + </term> + <listitem> + <para> +Specifies the owner of the specified selection atom. +You can pass a window or +<symbol>None</symbol>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>time</emphasis> + </term> + <listitem> + <para> +Specifies the time. +You can pass either a timestamp or +<symbol>CurrentTime</symbol>. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XSetSelectionOwner</function> +function changes the owner and last-change time for the specified selection +and has no effect if the specified time is earlier than the current +last-change time of the specified selection +or is later than the current X server time. +Otherwise, the last-change time is set to the specified time, +with +<symbol>CurrentTime</symbol> +replaced by the current server time. +If the owner window is specified as +<symbol>None</symbol>, +then the owner of the selection becomes +<symbol>None</symbol> +(that is, no owner). +Otherwise, the owner of the selection becomes the client executing +the request. +</para> +<para> +<!-- .LP --> +If the new owner (whether a client or +<symbol>None</symbol>) +is not +the same as the current owner of the selection and the current +owner is not +<symbol>None</symbol>, +the current owner is sent a +<symbol>SelectionClear</symbol> +event. +If the client that is the owner of a selection is later +terminated (that is, its connection is closed) +or if the owner window it has specified in the request is later +destroyed, +the owner of the selection automatically +reverts to +<symbol>None</symbol>, +but the last-change time is not affected. +The selection atom is uninterpreted by the X server. +<function>XGetSelectionOwner</function> +returns the owner window, which is reported in +<symbol>SelectionRequest</symbol> +and +<symbol>SelectionClear</symbol> +events. +Selections are global to the X server. +</para> +<para> +<!-- .LP --> +<function>XSetSelectionOwner</function> +can generate +<errorname>BadAtom</errorname> +and +<errorname>BadWindow</errorname> +errors. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To return the selection owner, use +<function>XGetSelectionOwner</function>. +<indexterm><primary>Selection</primary><secondary>getting the owner</secondary></indexterm> +<indexterm significance="preferred"><primary>XGetSelectionOwner</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef>Window <function>XGetSelectionOwner</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Atom<parameter> selection</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. +<!-- .ds Se whose owner you want returned --> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>selection</emphasis> + </term> + <listitem> + <para> +Specifies the selection atom (Se. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +The +<function>XGetSelectionOwner</function> +function +returns the window ID associated with the window that currently owns the +specified selection. +If no selection was specified, the function returns the constant +<symbol>None</symbol>. +If +<symbol>None</symbol> +is returned, +there is no owner for the selection. +</para> +<para> +<!-- .LP --> +<function>XGetSelectionOwner</function> +can generate a +<errorname>BadAtom</errorname> +error. +</para> +<para> +<!-- .LP --> +<!-- .sp --> +To request conversion of a selection, use +<function>XConvertSelection</function>. +<indexterm><primary>Selection</primary><secondary>converting</secondary></indexterm> +<indexterm significance="preferred"><primary>XConvertSelection</primary></indexterm> +<!-- .sM --> +<funcsynopsis> +<funcprototype> + <funcdef><function>XConvertSelection</function></funcdef> + <paramdef>Display<parameter> *display</parameter></paramdef> + <paramdef>Atomselection,<parameter> target</parameter></paramdef> + <paramdef>Atom<parameter> property</parameter></paramdef> + <paramdef>Window<parameter> requestor</parameter></paramdef> + <paramdef>Time<parameter> time</parameter></paramdef> +</funcprototype> +</funcsynopsis> +<!-- .FN --> +<variablelist> + <varlistentry> + <term> + <emphasis remap='I'>display</emphasis> + </term> + <listitem> + <para> +Specifies the connection to the X server. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>selection</emphasis> + </term> + <listitem> + <para> +Specifies the selection atom. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>target</emphasis> + </term> + <listitem> + <para> +Specifies the target atom. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>property</emphasis> + </term> + <listitem> + <para> +Specifies the property name. +You also can pass +<symbol>None</symbol>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>requestor</emphasis> + </term> + <listitem> + <para> +Specifies the requestor. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis remap='I'>time</emphasis> + </term> + <listitem> + <para> +Specifies the time. +You can pass either a timestamp or +<symbol>CurrentTime</symbol>. + </para> + </listitem> + </varlistentry> +</variablelist> +</para> +<para> +<!-- .LP --> +<!-- .eM --> +<function>XConvertSelection</function> +requests that the specified selection be converted to the specified target +type: +</para> +<itemizedlist> + <listitem> + <para> +If the specified selection has an owner, the X server sends a +<symbol>SelectionRequest</symbol> +event to that owner. + </para> + </listitem> + <listitem> + <para> +If no owner for the specified +selection exists, the X server generates a +<symbol>SelectionNotify</symbol> +event to the +requestor with property +<symbol>None</symbol>. + </para> + </listitem> +</itemizedlist> +<para> +<!-- .LP --> +The arguments are passed on unchanged in either of the events. +There are two predefined selection atoms: PRIMARY and SECONDARY. +</para> +<para> +<!-- .LP --> +<function>XConvertSelection</function> +can generate +<errorname>BadAtom</errorname> +and +<errorname>BadWindow</errorname> +errors. +<!-- .bp --> + + +</para> +</sect1> +</chapter> diff --git a/libX11/src/IntAtom.c b/libX11/src/IntAtom.c index a06689950..7a5625840 100644 --- a/libX11/src/IntAtom.c +++ b/libX11/src/IntAtom.c @@ -1,297 +1,297 @@ -/*
-
-Copyright 1986, 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "Xlibint.h"
-#include "Xintatom.h"
-
-#define HASH(sig) ((sig) & (TABLESIZE-1))
-#define REHASHVAL(sig) ((((sig) % (TABLESIZE-3)) + 2) | 1)
-#define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1))
-
-void
-_XFreeAtomTable(Display *dpy)
-{
- register Entry *table;
- register int i;
- register Entry e;
-
- if (dpy->atoms) {
- table = dpy->atoms->table;
- for (i = TABLESIZE; --i >= 0; ) {
- if ((e = *table++) && (e != RESERVED))
- Xfree((char *)e);
- }
- Xfree((char *)dpy->atoms);
- }
-}
-
-static
-Atom _XInternAtom(
- Display *dpy,
- _Xconst char *name,
- Bool onlyIfExists,
- unsigned long *psig,
- int *pidx,
- int *pn)
-{
- register AtomTable *atoms;
- register char *s1, c, *s2;
- register unsigned long sig;
- register int idx = 0, i;
- Entry e;
- int n, firstidx, rehash = 0;
- xInternAtomReq *req;
-
- /* look in the cache first */
- if (!(atoms = dpy->atoms)) {
- dpy->atoms = atoms = (AtomTable *)Xcalloc(1, sizeof(AtomTable));
- dpy->free_funcs->atoms = _XFreeAtomTable;
- }
- sig = 0;
- for (s1 = (char *)name; (c = *s1++); )
- sig += c;
- n = s1 - (char *)name - 1;
- if (atoms) {
- firstidx = idx = HASH(sig);
- while ((e = atoms->table[idx])) {
- if (e != RESERVED && e->sig == sig) {
- for (i = n, s1 = (char *)name, s2 = EntryName(e); --i >= 0; ) {
- if (*s1++ != *s2++)
- goto nomatch;
- }
- if (!*s2)
- return e->atom;
- }
-nomatch: if (idx == firstidx)
- rehash = REHASHVAL(sig);
- idx = REHASH(idx, rehash);
- if (idx == firstidx)
- break;
- }
- }
- *psig = sig;
- *pidx = idx;
- if (atoms && !atoms->table[idx])
- atoms->table[idx] = RESERVED; /* reserve slot */
- *pn = n;
- /* not found, go to the server */
- GetReq(InternAtom, req);
- req->nbytes = n;
- req->onlyIfExists = onlyIfExists;
- req->length += (n+3)>>2;
- Data(dpy, name, n);
- return None;
-}
-
-void
-_XUpdateAtomCache(
- Display *dpy,
- const char *name,
- Atom atom,
- unsigned long sig,
- int idx,
- int n)
-{
- Entry e, oe;
- register char *s1;
- register char c;
- int firstidx, rehash;
-
- if (!dpy->atoms) {
- if (idx < 0) {
- dpy->atoms = (AtomTable *)Xcalloc(1, sizeof(AtomTable));
- dpy->free_funcs->atoms = _XFreeAtomTable;
- }
- if (!dpy->atoms)
- return;
- }
- if (!sig) {
- for (s1 = (char *)name; (c = *s1++); )
- sig += c;
- n = s1 - (char *)name - 1;
- if (idx < 0) {
- firstidx = idx = HASH(sig);
- if (dpy->atoms->table[idx]) {
- rehash = REHASHVAL(sig);
- do
- idx = REHASH(idx, rehash);
- while (idx != firstidx && dpy->atoms->table[idx]);
- }
- }
- }
- e = (Entry)Xmalloc(sizeof(EntryRec) + n + 1);
- if (e) {
- e->sig = sig;
- e->atom = atom;
- strcpy(EntryName(e), name);
- if ((oe = dpy->atoms->table[idx]) && (oe != RESERVED))
- Xfree((char *)oe);
- dpy->atoms->table[idx] = e;
- }
-}
-
-Atom
-XInternAtom (
- Display *dpy,
- const char *name,
- Bool onlyIfExists)
-{
- Atom atom;
- unsigned long sig;
- int idx, n;
- xInternAtomReply rep;
-
- if (!name)
- name = "";
- LockDisplay(dpy);
- if ((atom = _XInternAtom(dpy, name, onlyIfExists, &sig, &idx, &n))) {
- UnlockDisplay(dpy);
- return atom;
- }
- if (dpy->atoms && dpy->atoms->table[idx] == RESERVED)
- dpy->atoms->table[idx] = NULL; /* unreserve slot */
- if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
- if ((atom = rep.atom))
- _XUpdateAtomCache(dpy, name, atom, sig, idx, n);
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return (rep.atom);
-}
-
-typedef struct {
- unsigned long start_seq;
- unsigned long stop_seq;
- const char **names;
- Atom *atoms;
- int count;
- Status status;
-} _XIntAtomState;
-
-static
-Bool _XIntAtomHandler(
- register Display *dpy,
- register xReply *rep,
- char *buf,
- int len,
- XPointer data)
-{
- register _XIntAtomState *state;
- register int i, idx = 0;
- xInternAtomReply replbuf;
- register xInternAtomReply *repl;
-
- state = (_XIntAtomState *)data;
- if (dpy->last_request_read < state->start_seq ||
- dpy->last_request_read > state->stop_seq)
- return False;
- for (i = 0; i < state->count; i++) {
- if (state->atoms[i] & 0x80000000) {
- idx = ~state->atoms[i];
- state->atoms[i] = None;
- break;
- }
- }
- if (i >= state->count)
- return False;
- if (rep->generic.type == X_Error) {
- state->status = 0;
- return False;
- }
- repl = (xInternAtomReply *)
- _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len,
- (SIZEOF(xInternAtomReply) - SIZEOF(xReply)) >> 2,
- True);
- if ((state->atoms[i] = repl->atom))
- _XUpdateAtomCache(dpy, state->names[i], (Atom) repl->atom,
- (unsigned long)0, idx, 0);
- return True;
-}
-
-Status
-XInternAtoms (
- Display *dpy,
- const char **names,
- int count,
- Bool onlyIfExists,
- Atom *atoms_return)
-{
- int i, idx, n, tidx;
- unsigned long sig;
- _XAsyncHandler async;
- _XIntAtomState async_state;
- int missed = -1;
- xInternAtomReply rep;
-
- LockDisplay(dpy);
- async_state.start_seq = dpy->request + 1;
- async_state.atoms = atoms_return;
- async_state.names = names;
- async_state.count = count - 1;
- async_state.status = 1;
- async.next = dpy->async_handlers;
- async.handler = _XIntAtomHandler;
- async.data = (XPointer)&async_state;
- dpy->async_handlers = &async;
- for (i = 0; i < count; i++) {
- if (!(atoms_return[i] = _XInternAtom(dpy, names[i], onlyIfExists,
- &sig, &idx, &n))) {
- missed = i;
- atoms_return[i] = ~((Atom)idx);
- async_state.stop_seq = dpy->request;
- }
- }
- if (missed >= 0) {
- if (dpy->atoms) {
- /* unreserve anything we just reserved */
- for (i = 0; i < count; i++) {
- if (atoms_return[i] & 0x80000000) {
- tidx = ~atoms_return[i];
- if (dpy->atoms->table[tidx] == RESERVED)
- dpy->atoms->table[tidx] = NULL;
- }
- }
- }
- if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
- if ((atoms_return[missed] = rep.atom))
- _XUpdateAtomCache(dpy, names[missed], (Atom) rep.atom,
- sig, idx, n);
- } else {
- atoms_return[missed] = None;
- async_state.status = 0;
- }
- }
- DeqAsyncHandler(dpy, &async);
- UnlockDisplay(dpy);
- if (missed >= 0)
- SyncHandle();
- return async_state.status;
-}
+/* + +Copyright 1986, 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include "Xlibint.h" +#include "Xintatom.h" + +#define HASH(sig) ((sig) & (TABLESIZE-1)) +#define REHASHVAL(sig) ((((sig) % (TABLESIZE-3)) + 2) | 1) +#define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1)) + +void +_XFreeAtomTable(Display *dpy) +{ + register Entry *table; + register int i; + register Entry e; + + if (dpy->atoms) { + table = dpy->atoms->table; + for (i = TABLESIZE; --i >= 0; ) { + if ((e = *table++) && (e != RESERVED)) + Xfree((char *)e); + } + Xfree((char *)dpy->atoms); + } +} + +static +Atom _XInternAtom( + Display *dpy, + _Xconst char *name, + Bool onlyIfExists, + unsigned long *psig, + int *pidx, + int *pn) +{ + register AtomTable *atoms; + register char *s1, c, *s2; + register unsigned long sig; + register int idx = 0, i; + Entry e; + int n, firstidx, rehash = 0; + xInternAtomReq *req; + + /* look in the cache first */ + if (!(atoms = dpy->atoms)) { + dpy->atoms = atoms = (AtomTable *)Xcalloc(1, sizeof(AtomTable)); + dpy->free_funcs->atoms = _XFreeAtomTable; + } + sig = 0; + for (s1 = (char *)name; (c = *s1++); ) + sig += c; + n = s1 - (char *)name - 1; + if (atoms) { + firstidx = idx = HASH(sig); + while ((e = atoms->table[idx])) { + if (e != RESERVED && e->sig == sig) { + for (i = n, s1 = (char *)name, s2 = EntryName(e); --i >= 0; ) { + if (*s1++ != *s2++) + goto nomatch; + } + if (!*s2) + return e->atom; + } +nomatch: if (idx == firstidx) + rehash = REHASHVAL(sig); + idx = REHASH(idx, rehash); + if (idx == firstidx) + break; + } + } + *psig = sig; + *pidx = idx; + if (atoms && !atoms->table[idx]) + atoms->table[idx] = RESERVED; /* reserve slot */ + *pn = n; + /* not found, go to the server */ + GetReq(InternAtom, req); + req->nbytes = n; + req->onlyIfExists = onlyIfExists; + req->length += (n+3)>>2; + Data(dpy, name, n); + return None; +} + +void +_XUpdateAtomCache( + Display *dpy, + const char *name, + Atom atom, + unsigned long sig, + int idx, + int n) +{ + Entry e, oe; + register char *s1; + register char c; + int firstidx, rehash; + + if (!dpy->atoms) { + if (idx < 0) { + dpy->atoms = (AtomTable *)Xcalloc(1, sizeof(AtomTable)); + dpy->free_funcs->atoms = _XFreeAtomTable; + } + if (!dpy->atoms) + return; + } + if (!sig) { + for (s1 = (char *)name; (c = *s1++); ) + sig += c; + n = s1 - (char *)name - 1; + if (idx < 0) { + firstidx = idx = HASH(sig); + if (dpy->atoms->table[idx]) { + rehash = REHASHVAL(sig); + do + idx = REHASH(idx, rehash); + while (idx != firstidx && dpy->atoms->table[idx]); + } + } + } + e = (Entry)Xmalloc(sizeof(EntryRec) + n + 1); + if (e) { + e->sig = sig; + e->atom = atom; + strcpy(EntryName(e), name); + if ((oe = dpy->atoms->table[idx]) && (oe != RESERVED)) + Xfree((char *)oe); + dpy->atoms->table[idx] = e; + } +} + +Atom +XInternAtom ( + Display *dpy, + const char *name, + Bool onlyIfExists) +{ + Atom atom; + unsigned long sig; + int idx, n; + xInternAtomReply rep; + + if (!name) + name = ""; + LockDisplay(dpy); + if ((atom = _XInternAtom(dpy, name, onlyIfExists, &sig, &idx, &n))) { + UnlockDisplay(dpy); + return atom; + } + if (dpy->atoms && dpy->atoms->table[idx] == RESERVED) + dpy->atoms->table[idx] = NULL; /* unreserve slot */ + if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) { + if ((atom = rep.atom)) + _XUpdateAtomCache(dpy, name, atom, sig, idx, n); + } + UnlockDisplay(dpy); + SyncHandle(); + return (rep.atom); +} + +typedef struct { + unsigned long start_seq; + unsigned long stop_seq; + char **names; + Atom *atoms; + int count; + Status status; +} _XIntAtomState; + +static +Bool _XIntAtomHandler( + register Display *dpy, + register xReply *rep, + char *buf, + int len, + XPointer data) +{ + register _XIntAtomState *state; + register int i, idx = 0; + xInternAtomReply replbuf; + register xInternAtomReply *repl; + + state = (_XIntAtomState *)data; + if (dpy->last_request_read < state->start_seq || + dpy->last_request_read > state->stop_seq) + return False; + for (i = 0; i < state->count; i++) { + if (state->atoms[i] & 0x80000000) { + idx = ~state->atoms[i]; + state->atoms[i] = None; + break; + } + } + if (i >= state->count) + return False; + if (rep->generic.type == X_Error) { + state->status = 0; + return False; + } + repl = (xInternAtomReply *) + _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len, + (SIZEOF(xInternAtomReply) - SIZEOF(xReply)) >> 2, + True); + if ((state->atoms[i] = repl->atom)) + _XUpdateAtomCache(dpy, state->names[i], (Atom) repl->atom, + (unsigned long)0, idx, 0); + return True; +} + +Status +XInternAtoms ( + Display *dpy, + char **names, + int count, + Bool onlyIfExists, + Atom *atoms_return) +{ + int i, idx, n, tidx; + unsigned long sig; + _XAsyncHandler async; + _XIntAtomState async_state; + int missed = -1; + xInternAtomReply rep; + + LockDisplay(dpy); + async_state.start_seq = dpy->request + 1; + async_state.atoms = atoms_return; + async_state.names = names; + async_state.count = count - 1; + async_state.status = 1; + async.next = dpy->async_handlers; + async.handler = _XIntAtomHandler; + async.data = (XPointer)&async_state; + dpy->async_handlers = &async; + for (i = 0; i < count; i++) { + if (!(atoms_return[i] = _XInternAtom(dpy, names[i], onlyIfExists, + &sig, &idx, &n))) { + missed = i; + atoms_return[i] = ~((Atom)idx); + async_state.stop_seq = dpy->request; + } + } + if (missed >= 0) { + if (dpy->atoms) { + /* unreserve anything we just reserved */ + for (i = 0; i < count; i++) { + if (atoms_return[i] & 0x80000000) { + tidx = ~atoms_return[i]; + if (dpy->atoms->table[tidx] == RESERVED) + dpy->atoms->table[tidx] = NULL; + } + } + } + if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) { + if ((atoms_return[missed] = rep.atom)) + _XUpdateAtomCache(dpy, names[missed], (Atom) rep.atom, + sig, idx, n); + } else { + atoms_return[missed] = None; + async_state.status = 0; + } + } + DeqAsyncHandler(dpy, &async); + UnlockDisplay(dpy); + if (missed >= 0) + SyncHandle(); + return async_state.status; +} |