aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/Xlibint.h
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11/Xlibint.h')
-rw-r--r--nx-X11/lib/X11/Xlibint.h223
1 files changed, 170 insertions, 53 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index 15dd5cea7..69561f401 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -51,8 +51,9 @@ from The Open Group.
*/
-#ifndef _XLIBINT_H_
-#define _XLIBINT_H_ 1
+#if !defined(_X11_XLIBINT_H_) && !defined(_XLIBINT_H_)
+#define _X11_XLIBINT_H_
+#define _XLIBINT_H_
/*
* Xlibint.h - Header definition and support file for the internal
@@ -139,7 +140,7 @@ struct _XDisplay
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 */
+ volatile unsigned long flags; /* internal connection flags */
int min_keycode; /* minimum defined keycode */
int max_keycode; /* maximum defined keycode */
KeySym *keysyms; /* This server's keysyms */
@@ -152,7 +153,7 @@ struct _XDisplay
struct _XExten *ext_procs; /* extensions initialized on this display */
/*
* the following can be fixed size, as the protocol defines how
- * much address space is available.
+ * much address space is available.
* While this could be done using the extension vector, there
* may be MANY events processed, so a search through the extension
* list to find the right procedure for each event might be
@@ -215,10 +216,29 @@ struct _XDisplay
int xcmisc_opcode; /* major opcode for XC-MISC */
struct _XkbInfoRec *xkb_info; /* XKB info */
struct _XtransConnInfo *trans_conn; /* transport connection object */
+ struct _X11XCBPrivate *xcb; /* XCB glue private data */
+
+ /* Generic event cookie handling */
+ unsigned int next_cookie; /* next event cookie */
+ /* vector for wire to generic event, index is (extension - 128) */
+ Bool (*generic_event_vec[128])(
+ Display * /* dpy */,
+ XGenericEventCookie * /* Xlib event */,
+ xEvent * /* wire event */);
+ /* vector for event copy, index is (extension - 128) */
+ Bool (*generic_event_copy_vec[128])(
+ Display * /* dpy */,
+ XGenericEventCookie * /* in */,
+ XGenericEventCookie * /* out*/);
+ void *cookiejar; /* cookie events returned but not claimed */
};
#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
+/*
+ * define the following if you want the Data macro to be a procedure instead
+ */
+
#ifndef _XEVENT_
/*
* _QEvent datatype for use in input queueing.
@@ -231,9 +251,6 @@ typedef struct _XSQEvent
} _XQEvent;
#endif
-#ifdef XTHREADS /* for xReply */
-#endif
-
#include <nx-X11/Xproto.h>
#ifdef __sgi
#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */
@@ -420,25 +437,9 @@ extern LockInfoPtr _Xglobal_lock;
* X Protocol packetizing macros.
*/
-/* Leftover from CRAY support - was defined empty on all non-Cray systems */
-#define WORD64ALIGN
-
-/**
- * Return a len-sized request buffer for the request type. This function may
- * flush the output queue.
- *
- * @param dpy The display connection
- * @param type The request type
- * @param len Length of the request in bytes
- *
- * @returns A pointer to the request buffer with a few default values
- * initialized.
- */
-extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
-
/*
* GetReq - Get the next available X request packet in the buffer and
- * return it.
+ * return it.
*
* "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
* "req" is the name of the request pointer.
@@ -447,10 +448,23 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
#if !defined(UNIXCPP) || defined(ANSICPP)
#define GetReq(name, req) \
- req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req))
+ if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##name##Req))>>2;\
+ dpy->bufptr += SIZEOF(x##name##Req);\
+ dpy->request++
+
#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
#define GetReq(name, req) \
- req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req))
+ if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/name/**/Req))>>2;\
+ dpy->bufptr += SIZEOF(x/**/name/**/Req);\
+ dpy->request++
#endif
/* GetReqExtra is the same as GetReq, but allocates "n" additional
@@ -458,17 +472,29 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
#if !defined(UNIXCPP) || defined(ANSICPP)
#define GetReqExtra(name, n, req) \
- req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n)
+ if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##name##Req) + n)>>2;\
+ dpy->bufptr += SIZEOF(x##name##Req) + n;\
+ dpy->request++
#else
#define GetReqExtra(name, n, req) \
- req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n)
+ if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\
+ dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\
+ dpy->request++
#endif
/*
- * GetResReq is for those requests that have a resource ID
+ * GetResReq is for those requests that have a resource ID
* (Window, Pixmap, GContext, etc.) as their single argument.
- * "rid" is the name of the resource.
+ * "rid" is the name of the resource.
*/
#if !defined(UNIXCPP) || defined(ANSICPP)
@@ -495,7 +521,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
/*
* GetEmptyReq is for those requests that have no arguments
- * at all.
+ * at all.
*/
#if !defined(UNIXCPP) || defined(ANSICPP)
#define GetEmptyReq(name, req) \
@@ -601,7 +627,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc);
* "ptr" is the pointer being assigned to.
* "n" is the number of bytes to allocate.
*
- * Example:
+ * Example:
* xTextElt *elt;
* BufAlloc (xTextElt *, elt, nbytes)
*/
@@ -646,7 +672,7 @@ extern void _XRead32(
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
-/*
+/*
* CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
@@ -672,7 +698,7 @@ extern void _XRead32(
/*
- * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
+ * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
* column. This is used for fonts that have more than row zero.
*/
#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \
@@ -700,10 +726,12 @@ extern void _XRead32(
}
+
/* srcvar must be a variable for large architecture version */
#define OneDataCard32(dpy,dstaddr,srcvar) \
{ *(CARD32 *)(dstaddr) = (srcvar); }
+
typedef struct _XInternalAsync {
struct _XInternalAsync *next;
/*
@@ -857,6 +885,15 @@ typedef struct _XExten { /* private to extension mechanism */
struct _XExten *next_flush; /* next in list of those with flushes */
} _XExtension;
+/* Temporary definition until we can depend on an xproto release with it */
+#ifdef _X_COLD
+# define _XLIB_COLD _X_COLD
+#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */
+# define _XLIB_COLD __attribute__((__cold__))
+#else
+# define _XLIB_COLD /* nothing */
+#endif
+
/* extension hooks */
#ifdef DataRoutineIsProcedure
@@ -879,11 +916,14 @@ extern int (*_XErrorFunction)(
extern void _XEatData(
Display* /* dpy */,
unsigned long /* n */
-);
+) _XLIB_COLD;
extern void _XEatDataWords(
- Display* /* dpy */,
- unsigned long /* n */
-);
+ Display* /* dpy */,
+ unsigned long /* n */
+) _XLIB_COLD;
+#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */
+# pragma rarely_called(_XEatData, _XEatDataWords)
+#endif
extern char *_XAllocScratch(
Display* /* dpy */,
unsigned long /* nbytes */
@@ -984,6 +1024,19 @@ extern Bool _XUnknownWireEvent(
XEvent* /* re */,
xEvent* /* event */
);
+
+extern Bool _XUnknownWireEventCookie(
+ Display* /* dpy */,
+ XGenericEventCookie* /* re */,
+ xEvent* /* event */
+);
+
+extern Bool _XUnknownCopyEventCookie(
+ Display* /* dpy */,
+ XGenericEventCookie* /* in */,
+ XGenericEventCookie* /* out */
+);
+
extern Status _XUnknownNativeEvent(
Display* /* dpy */,
XEvent* /* re */,
@@ -1021,7 +1074,7 @@ extern int (*XESetCopyGC(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, GC, XExtCodes*
);
@@ -1033,7 +1086,7 @@ extern int (*XESetFlushGC(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, GC, XExtCodes*
);
@@ -1045,7 +1098,7 @@ extern int (*XESetFreeGC(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, GC, XExtCodes*
);
@@ -1057,7 +1110,7 @@ extern int (*XESetCreateFont(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, XFontStruct*, XExtCodes*
);
@@ -1069,10 +1122,10 @@ extern int (*XESetFreeFont(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, XFontStruct*, XExtCodes*
-);
+);
extern int (*XESetCloseDisplay(
Display* /* display */,
@@ -1080,7 +1133,7 @@ extern int (*XESetCloseDisplay(
int (*) (
Display* /* display */,
XExtCodes* /* codes */
- ) /* proc */
+ ) /* proc */
))(
Display*, XExtCodes*
);
@@ -1093,7 +1146,7 @@ extern int (*XESetError(
xError* /* err */,
XExtCodes* /* codes */,
int* /* ret_code */
- ) /* proc */
+ ) /* proc */
))(
Display*, xError*, XExtCodes*, int*
);
@@ -1107,7 +1160,7 @@ extern char* (*XESetErrorString(
XExtCodes* /* codes */,
char* /* buffer */,
int /* nbytes */
- ) /* proc */
+ ) /* proc */
))(
Display*, int, XExtCodes*, char*, int
);
@@ -1131,11 +1184,36 @@ extern Bool (*XESetWireToEvent(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
- ) /* proc */
+ ) /* proc */
))(
Display*, XEvent*, xEvent*
);
+extern Bool (*XESetWireToEventCookie(
+ Display* /* display */,
+ int /* extension */,
+ Bool (*) (
+ Display* /* display */,
+ XGenericEventCookie* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XGenericEventCookie*, xEvent*
+);
+
+extern Bool (*XESetCopyEventCookie(
+ Display* /* display */,
+ int /* extension */,
+ Bool (*) (
+ Display* /* display */,
+ XGenericEventCookie* /* in */,
+ XGenericEventCookie* /* out */
+ ) /* proc */
+))(
+ Display*, XGenericEventCookie*, XGenericEventCookie*
+);
+
+
extern Status (*XESetEventToWire(
Display* /* display */,
int /* event_number */,
@@ -1143,7 +1221,7 @@ extern Status (*XESetEventToWire(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
- ) /* proc */
+ ) /* proc */
))(
Display*, XEvent*, xEvent*
);
@@ -1155,7 +1233,7 @@ extern Bool (*XESetWireToError(
Display* /* display */,
XErrorEvent* /* he */,
xError* /* we */
- ) /* proc */
+ ) /* proc */
))(
Display*, XErrorEvent*, xError*
);
@@ -1168,7 +1246,7 @@ extern void (*XESetBeforeFlush(
XExtCodes* /* codes */,
_Xconst char* /* data */,
long /* len */
- ) /* proc */
+ ) /* proc */
))(
Display*, XExtCodes*, _Xconst char*, long
);
@@ -1194,6 +1272,11 @@ extern void _XUnregisterInternalConnection(
int /* fd */
);
+extern void _XProcessInternalConnection(
+ Display* /* dpy */,
+ struct _XConnectionInfo* /* conn_info */
+);
+
/* Display structure has pointers to these */
struct _XConnectionInfo { /* info from _XRegisterInternalConnection */
@@ -1235,6 +1318,12 @@ extern int _XOpenFile(
int /* flags */
);
+extern int _XOpenFileMode(
+ _Xconst char* /* path */,
+ int /* flags */,
+ mode_t /* mode */
+);
+
extern void* _XFopenFile(
_Xconst char* /* path */,
_Xconst char* /* mode */
@@ -1245,6 +1334,7 @@ extern int _XAccessFile(
);
#else
#define _XOpenFile(path,flags) open(path,flags)
+#define _XOpenFileMode(path,flags,mode) open(path,flags,mode)
#define _XFopenFile(path,mode) fopen(path,mode)
#endif
@@ -1285,9 +1375,36 @@ Status _XGetWindowAttributes(
XWindowAttributes *attr);
int _XPutBackEvent (
- register Display *dpy,
+ register Display *dpy,
register XEvent *event);
+extern Bool _XIsEventCookie(
+ Display *dpy,
+ XEvent *ev);
+
+extern void _XFreeEventCookies(
+ Display *dpy);
+
+extern void _XStoreEventCookie(
+ Display *dpy,
+ XEvent *ev);
+
+extern Bool _XFetchEventCookie(
+ Display *dpy,
+ XGenericEventCookie *ev);
+
+extern Bool _XCopyEventCookie(
+ Display *dpy,
+ XGenericEventCookie *in,
+ XGenericEventCookie *out);
+
+/* lcFile.c */
+
+extern void xlocaledir(
+ char *buf,
+ int buf_len
+);
+
_XFUNCPROTOEND
-#endif /* _XLIBINT_H_ */
+#endif /* !defined(_X11_XLIBINT_H_) && !defined(_XLIBINT_H_) */