summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-26 09:29:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-26 09:29:12 (GMT)
commit9eba774dc974fb9cb00823f0a69cec8d608f0809 (patch)
treecd9c89adf4226a545f19a87d7e8944bd218d612a /xlib
parent6087f4e597069ea8db9e2553044111e51d1d9af7 (diff)
downloadtk-9eba774dc974fb9cb00823f0a69cec8d608f0809.zip
tk-9eba774dc974fb9cb00823f0a69cec8d608f0809.tar.gz
tk-9eba774dc974fb9cb00823f0a69cec8d608f0809.tar.bz2
Some updates from latest X11 headers
Diffstat (limited to 'xlib')
-rw-r--r--xlib/X11/X.h48
-rw-r--r--xlib/X11/Xlib.h33
2 files changed, 53 insertions, 28 deletions
diff --git a/xlib/X11/X.h b/xlib/X11/X.h
index 0e2d152..1cc488f 100644
--- a/xlib/X11/X.h
+++ b/xlib/X11/X.h
@@ -55,10 +55,46 @@ SOFTWARE.
/* Resources */
-#ifdef _WIN64
+/*
+ * _XSERVER64 must ONLY be defined when compiling X server sources on
+ * systems where unsigned long is not 32 bits, must NOT be used in
+ * client or library code.
+ */
+#ifndef _XSERVER64
+# ifndef _XTYPEDEF_XID
+# define _XTYPEDEF_XID
+# ifdef _WIN64
typedef unsigned __int64 XID;
-#else
+# else
typedef unsigned long XID;
+# endif
+# endif
+# ifndef _XTYPEDEF_MASK
+# define _XTYPEDEF_MASK
+typedef unsigned long Mask;
+# endif
+# ifndef _XTYPEDEF_ATOM
+# define _XTYPEDEF_ATOM
+typedef unsigned long Atom; /* Also in Xdefs.h */
+# endif
+typedef unsigned long VisualID;
+typedef unsigned long Time;
+#else
+# include <X11/Xmd.h>
+# ifndef _XTYPEDEF_XID
+# define _XTYPEDEF_XID
+typedef CARD32 XID;
+# endif
+# ifndef _XTYPEDEF_MASK
+# define _XTYPEDEF_MASK
+typedef CARD32 Mask;
+# endif
+# ifndef _XTYPEDEF_ATOM
+# define _XTYPEDEF_ATOM
+typedef CARD32 Atom;
+# endif
+typedef CARD32 VisualID;
+typedef CARD32 Time;
#endif
typedef XID Window;
@@ -73,14 +109,6 @@ typedef XID Colormap;
typedef XID GContext;
typedef XID KeySym;
-typedef unsigned long Mask;
-
-typedef unsigned long Atom;
-
-typedef unsigned long VisualID;
-
-typedef unsigned long Time;
-
typedef unsigned int KeyCode; /* In order to use IME, the Macintosh needs
* to pack 3 bytes into the keyCode field in
* the XEvent. In the real X.h, a KeyCode is
diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h
index c071438..8bfb14c 100644
--- a/xlib/X11/Xlib.h
+++ b/xlib/X11/Xlib.h
@@ -106,29 +106,29 @@ typedef int Status;
#define QueuedAfterFlush 2
#define ConnectionNumber(dpy) ((dpy)->fd)
-#define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root)
+#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root)
#define DefaultScreen(dpy) ((dpy)->default_screen)
-#define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root)
-#define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
-#define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc)
-#define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel)
-#define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel)
+#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) ((dpy)->qlen)
-#define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width)
-#define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
-#define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
-#define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
-#define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
-#define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries)
+#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) ((dpy)->nscreens)
#define ServerVendor(dpy) ((dpy)->vendor)
#define ProtocolVersion(dpy) ((dpy)->proto_major_version)
#define ProtocolRevision(dpy) ((dpy)->proto_minor_version)
#define VendorRelease(dpy) ((dpy)->release)
#define DisplayString(dpy) ((dpy)->display_name)
-#define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
-#define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
+#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
+#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
#define BitmapUnit(dpy) ((dpy)->bitmap_unit)
#define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order)
#define BitmapPad(dpy) ((dpy)->bitmap_pad)
@@ -138,7 +138,7 @@ typedef int Status;
/* macros for screen oriented applications (toolkit) */
#define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
-#define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
+#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
#define DisplayOfScreen(s) ((s)->display)
#define RootWindowOfScreen(s) ((s)->root)
#define BlackPixelOfScreen(s) ((s)->black_pixel)
@@ -581,11 +581,8 @@ typedef struct _XDisplay {
int (*savedsynchandler)(void); /* user synchandler when Xlib usurps */
} Display;
-#if NeedFunctionPrototypes /* prototypes require event type definitions */
#undef _XEVENT_
-#endif
#ifndef _XEVENT_
-
/*
* Definitions of specific events.
*/