summaryrefslogtreecommitdiffstats
path: root/xlib/X11/Xlib.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-14 19:01:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-14 19:01:11 (GMT)
commit9e820e33748c509efab8acd409bce3b2606d291c (patch)
tree9485c552472db2fc7810a70e2ae9f77401ef60e7 /xlib/X11/Xlib.h
parent2dc42aa8807ae45d9d238ace0f30c753aa0d016b (diff)
downloadtk-9e820e33748c509efab8acd409bce3b2606d291c.zip
tk-9e820e33748c509efab8acd409bce3b2606d291c.tar.gz
tk-9e820e33748c509efab8acd409bce3b2606d291c.tar.bz2
Experiment: Upgrade X11 header files from X11 R5 to X11 R6. This opens the way to implement more (e.g. XIM support) for Win32 and MacOSX.
Diffstat (limited to 'xlib/X11/Xlib.h')
-rw-r--r--xlib/X11/Xlib.h400
1 files changed, 323 insertions, 77 deletions
diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h
index b4b04d7..7f44596 100644
--- a/xlib/X11/Xlib.h
+++ b/xlib/X11/Xlib.h
@@ -1,20 +1,28 @@
-/* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */
/*
- * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * X Window System is a Trademark of MIT.
- *
- */
+
+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.
+
+*/
/*
@@ -22,16 +30,19 @@
* interface library (Xlib) to the X Window System Protocol (V11).
* Structures and symbols starting with "_" are private to the library.
*/
-#ifndef _XLIB_H_
-#define _XLIB_H_
+#ifndef _X11_XLIB_H_
+#define _X11_XLIB_H_
+
+#define XlibSpecificationRelease 6
-#define XlibSpecificationRelease 5
+#include <sys/types.h>
-#if !defined(MAC_OSX_TK)
-# include <X11/X.h>
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <stdint.h>
#endif
+
+#include <X11/X.h>
#ifdef MAC_OSX_TK
-# include <X11/X.h>
# define Cursor XCursor
# define Region XRegion
#endif
@@ -45,6 +56,25 @@
#endif
#endif
+
+extern int
+_Xmblen(
+ char *str,
+ int len
+ );
+
+/* 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
+
+/* The Xlib structs are full of implicit padding to properly align members.
+ We can't clean that up without breaking ABI, so tell clang not to bother
+ complaining about it. */
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
typedef char *XPointer;
#define Bool int
@@ -121,7 +151,9 @@ typedef int Status;
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 */
+ int (*free_private)( /* called to free private storage */
+ struct _XExtData *extension
+ );
XPointer private_data; /* data private to this extension. */
} XExtData;
@@ -214,6 +246,9 @@ typedef struct {
* 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 */
@@ -305,6 +340,16 @@ typedef struct {
} 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 {
@@ -327,20 +372,22 @@ typedef struct _XImage {
int pixelpower; /* n such that pixels are 2^n x 2^n blocks*/
#endif
struct funcs { /* image manipulation routines */
- struct _XImage *(*create_image)();
-#if NeedFunctionPrototypes
+ 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);
-#else
- int (*destroy_image)();
- unsigned long (*get_pixel)();
- int (*put_pixel)();
- struct _XImage *(*sub_image)();
- int (*add_pixel)();
-#endif
} f;
} XImage;
@@ -436,46 +483,51 @@ typedef struct {
*/
typedef struct _XDisplay {
XExtData *ext_data; /* hook for extension to hang data */
- struct _XFreeFuncs *free_funcs; /* internal free functions */
+ struct _XPrivate *private1;
int fd; /* Network socket. */
- int conn_checker; /* ugly thing used by _XEventsQueued */
- int proto_major_version;/* maj. version of server's X protocol */
+ 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 resource_base; /* resource ID base */
- XID resource_mask; /* resource ID mask bits */
- XID resource_id; /* allocator current ID */
- int resource_shift; /* allocator shift to correct bits */
- XID (*resource_alloc)(); /* allocator function */
+ 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 vnumber; /* Xlib's X protocol version number. */
+ int private8;
int release; /* release of the server */
- struct _XSQEvent *head, *tail; /* Input event queue. */
+ 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. */
- char *last_req; /* beginning of last request, or dummy */
- char *buffer; /* Output buffer starting address. */
- char *bufptr; /* Output buffer index pointer. */
- char *bufmax; /* Output buffer maximum+1 address. */
+ XPointer private11;
+ XPointer private12;
+ XPointer private13;
+ XPointer private14;
unsigned max_request_size; /* maximum number 32 bit words in request*/
struct _XrmHashBucketRec *db;
- int (*synchandler)(); /* Synchronization handler */
+ 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 flags; /* internal connection flags */
+ unsigned long private16;
int min_keycode; /* minimum defined keycode */
int max_keycode; /* maximum defined keycode */
- KeySym *keysyms; /* This server's keysyms */
- XModifierKeymap *modifiermap; /* This server's modifier keymap */
- int keysyms_per_keycode;/* number of rows */
+ XPointer private17;
+ XPointer private18;
+ int private19;
char *xdefaults; /* contents of defaults from server */
char *scratch_buffer; /* place to hang scratch buffer */
unsigned long scratch_length; /* length of scratch buffer */
@@ -542,7 +594,7 @@ typedef struct {
unsigned int state; /* key or button mask */
unsigned int keycode; /* detail */
Bool same_screen; /* same screen flag */
- char trans_chars[XMaxTransChars];
+ char trans_chars[XMaxTransChars];
/* translated characters */
int nbytes;
} XKeyEvent;
@@ -614,7 +666,8 @@ typedef struct {
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, NotifyGrab, NotifyUngrab */
+ int mode; /* NotifyNormal, NotifyWhileGrabbed,
+ NotifyGrab, NotifyUngrab */
int detail;
/*
* NotifyAncestor, NotifyVirtual, NotifyInferior,
@@ -915,6 +968,33 @@ typedef struct {
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.
@@ -952,6 +1032,8 @@ typedef union _XEvent {
XMappingEvent xmapping;
XErrorEvent xerror;
XKeymapEvent xkeymap;
+ XGenericEvent xgeneric;
+ XGenericEventCookie xcookie;
long pad[24];
} XEvent;
#endif
@@ -1033,7 +1115,12 @@ typedef struct {
XRectangle max_logical_extent;
} XFontSetExtents;
-typedef struct _XFontSet *XFontSet;
+/* unused:
+typedef void (*XOMProc)();
+ */
+
+typedef struct _XOM *XOM;
+typedef struct _XOC *XOC, *XFontSet;
typedef struct {
char *chars;
@@ -1042,11 +1129,69 @@ typedef struct {
XFontSet font_set;
} XmbTextItem;
-typedef void (*XIMProc)();
+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 {
@@ -1065,17 +1210,20 @@ typedef struct {
#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"
@@ -1093,31 +1241,47 @@ typedef struct {
#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
-#if NeedFunctionPrototypes
typedef void *XVaNestedList;
-#else
-typedef XPointer XVaNestedList;
-#endif
typedef struct {
XPointer client_data;
XIMProc callback;
} XIMCallback;
+typedef struct {
+ XPointer client_data;
+ XICProc callback;
+} XICCallback;
+
typedef unsigned long XIMFeedback;
-#define XIMReverse 1
-#define XIMUnderline (1<<1)
-#define XIMHighlight (1<<2)
-#define XIMPrimary (1<<5)
-#define XIMSecondary (1<<6)
-#define XIMTertiary (1<<7)
+#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;
@@ -1128,12 +1292,53 @@ typedef struct _XIMText {
} string;
} XIMText;
-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 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,
@@ -1145,6 +1350,21 @@ typedef enum {
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 */
@@ -1170,19 +1390,45 @@ typedef struct _XIMStatusDrawCallbackStruct {
} 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
+
typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
-#if NeedFunctionPrototypes
Display* /* display */,
XErrorEvent* /* error_event */
-#endif
);
-_XFUNCPROTOBEGIN
-
-
#include "tkIntXlibDecls.h"
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
_XFUNCPROTOEND
#if defined(MAC_OSX_TK)
@@ -1190,4 +1436,4 @@ _XFUNCPROTOEND
# undef Region
#endif
-#endif /* _XLIB_H_ */
+#endif /* _X11_XLIB_H_ */