Updated dynamic X11 code. See details in Bugzilla #170.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 22 Mar 2006 05:00:59 +0000
changeset 15753ba88cb7eb1b
parent 1574 0fd72308659e
child 1576 9d586151c20b
Updated dynamic X11 code. See details in Bugzilla #170.
include/SDL_config.h
src/.cvsignore
src/video/Xext/XME/xme.c
src/video/Xext/Xinerama/Xinerama.c
src/video/Xext/Xv/Xv.c
src/video/Xext/Xv/Xvlibint.h
src/video/Xext/Xxf86dga/XF86DGA.c
src/video/Xext/Xxf86dga/XF86DGA2.c
src/video/Xext/Xxf86vm/XF86VMode.c
src/video/Xext/extensions/extutil.h
src/video/dga/SDL_dgaevents.c
src/video/dga/SDL_dgavideo.c
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11dyn.h
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11gamma.c
src/video/x11/SDL_x11gl.c
src/video/x11/SDL_x11image.c
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11mouse.c
src/video/x11/SDL_x11sym.h
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11wm.c
src/video/x11/SDL_x11yuv.c
     1.1 --- a/include/SDL_config.h	Wed Mar 22 04:51:44 2006 +0000
     1.2 +++ b/include/SDL_config.h	Wed Mar 22 05:00:59 2006 +0000
     1.3 @@ -1,3 +1,4 @@
     1.4 +/* include/SDL_config.h.  Generated by configure.  */
     1.5  /*
     1.6      SDL - Simple DirectMedia Layer
     1.7      Copyright (C) 1997-2006 Sam Lantinga
     1.8 @@ -23,56 +24,277 @@
     1.9  #ifndef _SDL_config_h
    1.10  #define _SDL_config_h
    1.11  
    1.12 +/* This is a set of defines to configure the SDL features */
    1.13 +
    1.14 +/* General platform specific identifiers */
    1.15  #include "SDL_platform.h"
    1.16  
    1.17 -/* Add any platform that doesn't build using the configure system */
    1.18 -#if defined(__AMIGA__)
    1.19 -#include "SDL_config_amiga.h"
    1.20 -#elif defined(__DREAMCAST__)
    1.21 -#include "SDL_config_dreamcast.h"
    1.22 -#elif defined(__MACOS__)
    1.23 -#include "SDL_config_macos.h"
    1.24 -#elif defined(__MACOSX__)
    1.25 -#include "SDL_config_macosx.h"
    1.26 -#elif defined(__WIN32__)
    1.27 -#include "SDL_config_win32.h"
    1.28 -#elif defined(__OS2__)
    1.29 -#include "SDL_config_os2.h"
    1.30 +/* C language features */
    1.31 +/* #undef const */
    1.32 +/* #undef inline */
    1.33 +/* #undef volatile */
    1.34 +
    1.35 +/* C datatypes */
    1.36 +/* #undef size_t */
    1.37 +/* #undef int8_t */
    1.38 +/* #undef uint8_t */
    1.39 +/* #undef int16_t */
    1.40 +/* #undef uint16_t */
    1.41 +/* #undef int32_t */
    1.42 +/* #undef uint32_t */
    1.43 +/* #undef int64_t */
    1.44 +/* #undef uint64_t */
    1.45 +/* #undef uintptr_t */
    1.46 +#define SDL_HAS_64BIT_TYPE 1
    1.47 +
    1.48 +/* Endianness */
    1.49 +#define SDL_BYTEORDER 1234
    1.50 +
    1.51 +/* Comment this if you want to build without any C library requirements */
    1.52 +#define HAVE_LIBC 1
    1.53 +#if HAVE_LIBC
    1.54 +
    1.55 +/* Useful headers */
    1.56 +#define HAVE_ALLOCA_H 1
    1.57 +#define HAVE_SYS_TYPES_H 1
    1.58 +#define HAVE_STDIO_H 1
    1.59 +#define STDC_HEADERS 1
    1.60 +#define HAVE_STDLIB_H 1
    1.61 +#define HAVE_STDARG_H 1
    1.62 +#define HAVE_MALLOC_H 1
    1.63 +#define HAVE_MEMORY_H 1
    1.64 +#define HAVE_STRING_H 1
    1.65 +#define HAVE_STRINGS_H 1
    1.66 +#define HAVE_INTTYPES_H 1
    1.67 +#define HAVE_STDINT_H 1
    1.68 +#define HAVE_CTYPE_H 1
    1.69 +#define HAVE_MATH_H 1
    1.70 +#define HAVE_ICONV_H 1
    1.71 +#define HAVE_SIGNAL_H 1
    1.72 +/* #undef HAVE_ALTIVEC_H */
    1.73 +
    1.74 +/* C library functions */
    1.75 +#define HAVE_MALLOC 1
    1.76 +#define HAVE_CALLOC 1
    1.77 +#define HAVE_REALLOC 1
    1.78 +#define HAVE_FREE 1
    1.79 +#define HAVE_ALLOCA 1
    1.80 +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
    1.81 +#define HAVE_GETENV 1
    1.82 +#define HAVE_PUTENV 1
    1.83 +#define HAVE_UNSETENV 1
    1.84 +#endif
    1.85 +#define HAVE_QSORT 1
    1.86 +#define HAVE_ABS 1
    1.87 +#define HAVE_BCOPY 1
    1.88 +#define HAVE_MEMSET 1
    1.89 +#define HAVE_MEMCPY 1
    1.90 +#define HAVE_MEMMOVE 1
    1.91 +#define HAVE_MEMCMP 1
    1.92 +#define HAVE_STRLEN 1
    1.93 +/* #undef HAVE_STRLCPY */
    1.94 +/* #undef HAVE_STRLCAT */
    1.95 +#define HAVE_STRDUP 1
    1.96 +/* #undef HAVE__STRREV */
    1.97 +/* #undef HAVE__STRUPR */
    1.98 +/* #undef HAVE__STRLWR */
    1.99 +/* #undef HAVE_INDEX */
   1.100 +/* #undef HAVE_RINDEX */
   1.101 +#define HAVE_STRCHR 1
   1.102 +#define HAVE_STRRCHR 1
   1.103 +#define HAVE_STRSTR 1
   1.104 +/* #undef HAVE_ITOA */
   1.105 +/* #undef HAVE__LTOA */
   1.106 +/* #undef HAVE__UITOA */
   1.107 +/* #undef HAVE__ULTOA */
   1.108 +#define HAVE_STRTOL 1
   1.109 +#define HAVE_STRTOUL 1
   1.110 +/* #undef HAVE__I64TOA */
   1.111 +/* #undef HAVE__UI64TOA */
   1.112 +#define HAVE_STRTOLL 1
   1.113 +#define HAVE_STRTOULL 1
   1.114 +#define HAVE_STRTOD 1
   1.115 +#define HAVE_ATOI 1
   1.116 +#define HAVE_ATOF 1
   1.117 +#define HAVE_STRCMP 1
   1.118 +#define HAVE_STRNCMP 1
   1.119 +/* #undef HAVE__STRICMP */
   1.120 +#define HAVE_STRCASECMP 1
   1.121 +/* #undef HAVE__STRNICMP */
   1.122 +#define HAVE_STRNCASECMP 1
   1.123 +#define HAVE_SSCANF 1
   1.124 +#define HAVE_SNPRINTF 1
   1.125 +#define HAVE_VSNPRINTF 1
   1.126 +#define HAVE_ICONV 1
   1.127 +#define HAVE_SIGACTION 1
   1.128 +#define HAVE_SETJMP 1
   1.129 +#define HAVE_NANOSLEEP 1
   1.130 +/* #undef HAVE_CLOCK_GETTIME */
   1.131 +#define HAVE_DLVSYM 1
   1.132 +
   1.133  #else
   1.134 -/* This is the minimal configuration that can be used to build SDL */
   1.135 +/* We may need some replacement for stdarg.h here */
   1.136 +#include <stdarg.h>
   1.137 +#endif /* HAVE_LIBC */
   1.138  
   1.139 -#include <stdarg.h>
   1.140 +/* Allow disabling of core subsystems */
   1.141 +/* #undef SDL_AUDIO_DISABLED */
   1.142 +/* #undef SDL_CDROM_DISABLED */
   1.143 +/* #undef SDL_CPUINFO_DISABLED */
   1.144 +/* #undef SDL_EVENTS_DISABLED */
   1.145 +/* #undef SDL_FILE_DISABLED */
   1.146 +/* #undef SDL_JOYSTICK_DISABLED */
   1.147 +/* #undef SDL_LOADSO_DISABLED */
   1.148 +/* #undef SDL_THREADS_DISABLED */
   1.149 +/* #undef SDL_TIMERS_DISABLED */
   1.150 +/* #undef SDL_VIDEO_DISABLED */
   1.151  
   1.152 -typedef signed char int8_t;
   1.153 -typedef unsigned char uint8_t;
   1.154 -typedef signed short int16_t;
   1.155 -typedef unsigned short uint16_t;
   1.156 -typedef signed int int32_t;
   1.157 -typedef unsigned int uint32_t;
   1.158 -typedef unsigned int size_t;
   1.159 -typedef unsigned long uintptr_t;
   1.160 +/* Enable various audio drivers */
   1.161 +/* #undef SDL_AUDIO_DRIVER_AHI */
   1.162 +#define SDL_AUDIO_DRIVER_ALSA 1
   1.163 +#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2"
   1.164 +/* #undef SDL_AUDIO_DRIVER_ARTS */
   1.165 +/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
   1.166 +/* #undef SDL_AUDIO_DRIVER_BAUDIO */
   1.167 +/* #undef SDL_AUDIO_DRIVER_BSD */
   1.168 +/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
   1.169 +/* #undef SDL_AUDIO_DRIVER_DART */
   1.170 +/* #undef SDL_AUDIO_DRIVER_DC */
   1.171 +#define SDL_AUDIO_DRIVER_DISK 1
   1.172 +#define SDL_AUDIO_DRIVER_DUMMY 1
   1.173 +/* #undef SDL_AUDIO_DRIVER_DMEDIA */
   1.174 +/* #undef SDL_AUDIO_DRIVER_DSOUND */
   1.175 +/* #undef SDL_AUDIO_DRIVER_ESD */
   1.176 +/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
   1.177 +/* #undef SDL_AUDIO_DRIVER_MINT */
   1.178 +/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
   1.179 +/* #undef SDL_AUDIO_DRIVER_NAS */
   1.180 +#define SDL_AUDIO_DRIVER_OSS 1
   1.181 +/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
   1.182 +/* #undef SDL_AUDIO_DRIVER_PAUD */
   1.183 +/* #undef SDL_AUDIO_DRIVER_QNXNTO */
   1.184 +/* #undef SDL_AUDIO_DRIVER_SNDMGR */
   1.185 +/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
   1.186 +/* #undef SDL_AUDIO_DRIVER_WAVEOUT */
   1.187  
   1.188 -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
   1.189 -#define SDL_AUDIO_DRIVER_DUMMY	1
   1.190 +/* Enable various cdrom drivers */
   1.191 +/* #undef SDL_CDROM_AIX */
   1.192 +/* #undef SDL_CDROM_BEOS */
   1.193 +/* #undef SDL_CDROM_BSDI */
   1.194 +/* #undef SDL_CDROM_DC */
   1.195 +/* #undef SDL_CDROM_DUMMY */
   1.196 +/* #undef SDL_CDROM_FREEBSD */
   1.197 +#define SDL_CDROM_LINUX 1
   1.198 +/* #undef SDL_CDROM_MACOS */
   1.199 +/* #undef SDL_CDROM_MACOSX */
   1.200 +/* #undef SDL_CDROM_MINT */
   1.201 +/* #undef SDL_CDROM_OPENBSD */
   1.202 +/* #undef SDL_CDROM_OS2 */
   1.203 +/* #undef SDL_CDROM_OSF */
   1.204 +/* #undef SDL_CDROM_QNX */
   1.205 +/* #undef SDL_CDROM_WIN32 */
   1.206  
   1.207 -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
   1.208 -#define SDL_CDROM_DISABLED	1
   1.209 +/* Enable various input drivers */
   1.210 +/* #undef SDL_INPUT_TSLIB */
   1.211 +/* #undef SDL_JOYSTICK_AMIGA */
   1.212 +/* #undef SDL_JOYSTICK_BEOS */
   1.213 +/* #undef SDL_JOYSTICK_DC */
   1.214 +/* #undef SDL_JOYSTICK_DUMMY */
   1.215 +/* #undef SDL_JOYSTICK_IOKIT */
   1.216 +#define SDL_JOYSTICK_LINUX 1
   1.217 +/* #undef SDL_JOYSTICK_LINUXEV */
   1.218 +/* #undef SDL_JOYSTICK_MACOS */
   1.219 +/* #undef SDL_JOYSTICK_MINT */
   1.220 +/* #undef SDL_JOYSTICK_OS2 */
   1.221 +/* #undef SDL_JOYSTICK_RISCOS */
   1.222 +/* #undef SDL_JOYSTICK_WINMM */
   1.223 +/* #undef SDL_JOYSTICK_USBHID */
   1.224 +/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
   1.225  
   1.226 -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
   1.227 -#define SDL_JOYSTICK_DISABLED	1
   1.228 +/* Enable various shared object loading systems */
   1.229 +/* #undef SDL_LOADSO_BEOS */
   1.230 +/* #undef SDL_LOADSO_DLCOMPAT */
   1.231 +#define SDL_LOADSO_DLOPEN 1
   1.232 +/* #undef SDL_LOADSO_LDG */
   1.233 +/* #undef SDL_LOADSO_MACOS */
   1.234 +/* #undef SDL_LOADSO_OS2 */
   1.235 +/* #undef SDL_LOADSO_WIN32 */
   1.236  
   1.237 -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
   1.238 -#define SDL_LOADSO_DISABLED	1
   1.239 +/* Enable various threading systems */
   1.240 +/* #undef SDL_THREAD_AMIGA */
   1.241 +/* #undef SDL_THREAD_BEOS */
   1.242 +/* #undef SDL_THREAD_DC */
   1.243 +/* #undef SDL_THREAD_EPOC */
   1.244 +/* #undef SDL_THREAD_OS2 */
   1.245 +/* #undef SDL_THREAD_PTH */
   1.246 +#define SDL_THREAD_PTHREAD 1
   1.247 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
   1.248 +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
   1.249 +/* #undef SDL_THREAD_SPROC */
   1.250 +/* #undef SDL_THREAD_WIN32 */
   1.251  
   1.252 -/* Enable the stub thread support (src/thread/generic/\*.c) */
   1.253 -#define SDL_THREADS_DISABLED	1
   1.254 +/* Enable various timer systems */
   1.255 +/* #undef SDL_TIMER_AMIGA */
   1.256 +/* #undef SDL_TIMER_BEOS */
   1.257 +/* #undef SDL_TIMER_DC */
   1.258 +/* #undef SDL_TIMER_EPOC */
   1.259 +/* #undef SDL_TIMER_MACOS */
   1.260 +/* #undef SDL_TIMER_MINT */
   1.261 +/* #undef SDL_TIMER_OS2 */
   1.262 +/* #undef SDL_TIMER_RISCOS */
   1.263 +#define SDL_TIMER_UNIX 1
   1.264 +/* #undef SDL_TIMER_WIN32 */
   1.265 +/* #undef SDL_TIMER_WINCE */
   1.266  
   1.267 -/* Enable the stub timer support (src/timer/dummy/\*.c) */
   1.268 -#define SDL_TIMERS_DISABLED	1
   1.269 +/* Enable various video drivers */
   1.270 +/* #undef SDL_VIDEO_DRIVER_AALIB */
   1.271 +/* #undef SDL_VIDEO_DRIVER_BWINDOW */
   1.272 +/* #undef SDL_VIDEO_DRIVER_CYBERGRAPHICS */
   1.273 +/* #undef SDL_VIDEO_DRIVER_DC */
   1.274 +/* #undef SDL_VIDEO_DRIVER_DDRAW */
   1.275 +#define SDL_VIDEO_DRIVER_DGA 1
   1.276 +/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
   1.277 +/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */
   1.278 +#define SDL_VIDEO_DRIVER_DUMMY 1
   1.279 +/* #undef SDL_VIDEO_DRIVER_EPOC */
   1.280 +#define SDL_VIDEO_DRIVER_FBCON 1
   1.281 +/* #undef SDL_VIDEO_DRIVER_GAPI */
   1.282 +/* #undef SDL_VIDEO_DRIVER_GEM */
   1.283 +/* #undef SDL_VIDEO_DRIVER_GGI */
   1.284 +/* #undef SDL_VIDEO_DRIVER_IPOD */
   1.285 +/* #undef SDL_VIDEO_DRIVER_NANOX */
   1.286 +/* #undef SDL_VIDEO_DRIVER_OS2FS */
   1.287 +/* #undef SDL_VIDEO_DRIVER_PHOTON */
   1.288 +/* #undef SDL_VIDEO_DRIVER_PICOGUI */
   1.289 +/* #undef SDL_VIDEO_DRIVER_PS2GS */
   1.290 +/* #undef SDL_VIDEO_DRIVER_QTOPIA */
   1.291 +/* #undef SDL_VIDEO_DRIVER_QUARTZ */
   1.292 +/* #undef SDL_VIDEO_DRIVER_RISCOS */
   1.293 +/* #undef SDL_VIDEO_DRIVER_SVGALIB */
   1.294 +/* #undef SDL_VIDEO_DRIVER_TOOLBOX */
   1.295 +/* #undef SDL_VIDEO_DRIVER_VGL */
   1.296 +/* #undef SDL_VIDEO_DRIVER_WINDIB */
   1.297 +/* #undef SDL_VIDEO_DRIVER_WSCONS */
   1.298 +#define SDL_VIDEO_DRIVER_X11 1
   1.299 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
   1.300 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
   1.301 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
   1.302 +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
   1.303 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
   1.304 +#define SDL_VIDEO_DRIVER_X11_XME 1
   1.305 +#define SDL_VIDEO_DRIVER_X11_XV 1
   1.306 +/* #undef SDL_VIDEO_DRIVER_XBIOS */
   1.307  
   1.308 -/* Enable the dummy video driver (src/video/dummy/\*.c) */
   1.309 -#define SDL_VIDEO_DRIVER_DUMMY	1
   1.310 +/* Enable OpenGL support */
   1.311 +#define SDL_VIDEO_OPENGL 1
   1.312 +#define SDL_VIDEO_OPENGL_GLX 1
   1.313 +/* #undef SDL_VIDEO_OPENGL_WGL */
   1.314 +/* #undef SDL_VIDEO_OPENGL_OSMESA */
   1.315 +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
   1.316  
   1.317 -#endif /* platform config */
   1.318 +/* Enable assembly routines */
   1.319 +#define SDL_ASSEMBLY_ROUTINES 1
   1.320 +/* #undef SDL_HERMES_BLITTERS */
   1.321 +/* #undef SDL_ALTIVEC_BLITTERS */
   1.322  
   1.323  #endif /* _SDL_config_h */
     2.1 --- a/src/.cvsignore	Wed Mar 22 04:51:44 2006 +0000
     2.2 +++ b/src/.cvsignore	Wed Mar 22 05:00:59 2006 +0000
     2.3 @@ -4,3 +4,4 @@
     2.4  *.o
     2.5  *.lo
     2.6  *.la
     2.7 +SDL_config.h
     3.1 --- a/src/video/Xext/XME/xme.c	Wed Mar 22 04:51:44 2006 +0000
     3.2 +++ b/src/video/Xext/XME/xme.c	Wed Mar 22 05:00:59 2006 +0000
     3.3 @@ -236,7 +236,7 @@
     3.4    xXiGMiscQueryVersionReply rep;
     3.5    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
     3.6  
     3.7 -  if (!pXQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error))
     3.8 +  if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error))
     3.9      return xFalse;
    3.10  
    3.11    XiGMiscCheckExtension(dpy, info, xFalse);
    3.12 @@ -247,7 +247,7 @@
    3.13    req->major = XIGMISC_MAJOR_VERSION;
    3.14    req->minor = XIGMISC_MINOR_VERSION;
    3.15  
    3.16 -  if (!p_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
    3.17 +  if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
    3.18      UnlockDisplay(dpy);
    3.19      SyncHandle();
    3.20      return xFalse;
    3.21 @@ -274,7 +274,7 @@
    3.22    XiGMiscGetReq (XiGMiscQueryViews, req, info);
    3.23    req->screen = screen;
    3.24  
    3.25 -  if (!p_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
    3.26 +  if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
    3.27      UnlockDisplay(dpy);
    3.28      SyncHandle();
    3.29      return 0;
    3.30 @@ -286,13 +286,13 @@
    3.31      size = sizeof(XiGMiscViewInfo) * n;
    3.32      views = (XiGMiscViewInfo*)Xmalloc(size);
    3.33      if (!views) {
    3.34 -      p_XEatData(dpy, (unsigned long)size);
    3.35 +      _XEatData(dpy, (unsigned long)size);
    3.36        UnlockDisplay(dpy);
    3.37        SyncHandle();
    3.38        return 0;
    3.39      }
    3.40  
    3.41 -    p_XReadPad(dpy, (void*)views, size);
    3.42 +    _XReadPad(dpy, (void*)views, size);
    3.43  
    3.44      *pviews = views;
    3.45    }
    3.46 @@ -317,7 +317,7 @@
    3.47    req->screen = screen;
    3.48    req->view   = view;
    3.49  
    3.50 -  if (!p_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
    3.51 +  if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
    3.52      UnlockDisplay(dpy);
    3.53      SyncHandle();
    3.54      return 0;
    3.55 @@ -329,13 +329,13 @@
    3.56      size = sizeof(XiGMiscResolutionInfo) * n;
    3.57      resolutions = (XiGMiscResolutionInfo*)Xmalloc(size);
    3.58      if (!resolutions) {
    3.59 -      p_XEatData(dpy, (unsigned long)size);
    3.60 +      _XEatData(dpy, (unsigned long)size);
    3.61        UnlockDisplay(dpy);
    3.62        SyncHandle();
    3.63        return 0;
    3.64      }
    3.65  
    3.66 -    p_XReadPad(dpy, (void*)resolutions, size);
    3.67 +    _XReadPad(dpy, (void*)resolutions, size);
    3.68  
    3.69      *presolutions = resolutions;
    3.70      *pactive = rep.active;
    3.71 @@ -383,7 +383,7 @@
    3.72    req->window = window;
    3.73    req->cmap = cmap;
    3.74  
    3.75 -  if (!p_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
    3.76 +  if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
    3.77      UnlockDisplay(dpy);
    3.78      SyncHandle();
    3.79      return xFalse;
     4.1 --- a/src/video/Xext/Xinerama/Xinerama.c	Wed Mar 22 04:51:44 2006 +0000
     4.2 +++ b/src/video/Xext/Xinerama/Xinerama.c	Wed Mar 22 05:00:59 2006 +0000
     4.3 @@ -113,7 +113,7 @@
     4.4      req->panoramiXReqType = X_PanoramiXQueryVersion;
     4.5      req->clientMajor = PANORAMIX_MAJOR_VERSION;
     4.6      req->clientMinor = PANORAMIX_MINOR_VERSION;
     4.7 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
     4.8 +    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
     4.9  	UnlockDisplay (dpy);
    4.10  	SyncHandle ();
    4.11  	return 0;
    4.12 @@ -147,7 +147,7 @@
    4.13      req->reqType = info->codes->major_opcode;
    4.14      req->panoramiXReqType = X_PanoramiXGetState;
    4.15      req->window = drawable;
    4.16 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.17 +    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.18  	UnlockDisplay (dpy);
    4.19  	SyncHandle ();
    4.20  	return 0;
    4.21 @@ -176,7 +176,7 @@
    4.22      req->reqType = info->codes->major_opcode;
    4.23      req->panoramiXReqType = X_PanoramiXGetScreenCount;
    4.24      req->window = drawable;
    4.25 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.26 +    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.27  	UnlockDisplay (dpy);
    4.28  	SyncHandle ();
    4.29  	return 0;
    4.30 @@ -207,7 +207,7 @@
    4.31      req->panoramiXReqType = X_PanoramiXGetScreenSize;
    4.32      req->window = drawable;
    4.33      req->screen = screen_num;			/* need to define */ 
    4.34 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.35 +    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
    4.36  	UnlockDisplay (dpy);
    4.37  	SyncHandle ();
    4.38  	return 0;
    4.39 @@ -287,7 +287,7 @@
    4.40      GetReq (XineramaQueryScreens, req);
    4.41      req->reqType = info->codes->major_opcode;
    4.42      req->panoramiXReqType = X_XineramaQueryScreens;
    4.43 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
    4.44 +    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
    4.45  	UnlockDisplay (dpy);
    4.46  	SyncHandle ();
    4.47  	return NULL;
    4.48 @@ -299,7 +299,7 @@
    4.49  	    int i;
    4.50  
    4.51  	    for(i = 0; i < rep.number; i++) {
    4.52 -		p_XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
    4.53 +		_XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
    4.54  		scrnInfo[i].screen_number = i;
    4.55  		scrnInfo[i].x_org 	  = scratch.x_org;
    4.56  		scrnInfo[i].y_org 	  = scratch.y_org;
    4.57 @@ -309,7 +309,7 @@
    4.58  
    4.59  	    *number = rep.number;
    4.60  	} else
    4.61 -	    p_XEatData(dpy, rep.length << 2);
    4.62 +	    _XEatData(dpy, rep.length << 2);
    4.63      }
    4.64  
    4.65      UnlockDisplay (dpy);
     5.1 --- a/src/video/Xext/Xv/Xv.c	Wed Mar 22 04:51:44 2006 +0000
     5.2 +++ b/src/video/Xext/Xv/Xv.c	Wed Mar 22 05:00:59 2006 +0000
     5.3 @@ -121,7 +121,7 @@
     5.4  
     5.5    XvGetReq(QueryExtension, req);
     5.6  
     5.7 -  if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     5.8 +  if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     5.9       UnlockDisplay(dpy);
    5.10       SyncHandle();
    5.11       return XvBadExtension;
    5.12 @@ -171,7 +171,7 @@
    5.13  
    5.14    /* READ THE REPLY */
    5.15  
    5.16 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.17 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.18        UnlockDisplay(dpy);
    5.19        SyncHandle();
    5.20        return(XvBadReply);
    5.21 @@ -183,7 +183,7 @@
    5.22        SyncHandle();
    5.23        return(XvBadAlloc);
    5.24    }
    5.25 -  p_XRead (dpy, buffer, size);
    5.26 +  _XRead (dpy, buffer, size);
    5.27  
    5.28    u.buffer = buffer;
    5.29  
    5.30 @@ -330,7 +330,7 @@
    5.31  
    5.32    /* READ THE REPLY */
    5.33  
    5.34 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.35 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.36        UnlockDisplay(dpy);
    5.37        SyncHandle();
    5.38        return(XvBadReply);
    5.39 @@ -342,7 +342,7 @@
    5.40        SyncHandle();
    5.41        return(XvBadAlloc);
    5.42    }
    5.43 -  p_XRead (dpy, buffer, size);
    5.44 +  _XRead (dpy, buffer, size);
    5.45  
    5.46    u.buffer = buffer;
    5.47  
    5.48 @@ -617,7 +617,7 @@
    5.49    req->port = port;
    5.50    req->time = time;
    5.51  
    5.52 -  if (p_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0) 
    5.53 +  if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0) 
    5.54      rep.result = GrabSuccess;
    5.55  
    5.56    result = rep.result;
    5.57 @@ -745,7 +745,7 @@
    5.58  
    5.59    /* READ THE REPLY */
    5.60  
    5.61 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.62 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.63        UnlockDisplay(dpy);
    5.64        SyncHandle();
    5.65        return(XvBadReply);
    5.66 @@ -790,7 +790,7 @@
    5.67  
    5.68    /* READ THE REPLY */
    5.69  
    5.70 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.71 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.72        UnlockDisplay(dpy);
    5.73        SyncHandle();
    5.74        return(XvBadReply);
    5.75 @@ -825,7 +825,7 @@
    5.76  
    5.77    /* READ THE REPLY */
    5.78  
    5.79 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.80 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
    5.81        UnlockDisplay(dpy);
    5.82        SyncHandle();
    5.83        return ret;
    5.84 @@ -840,17 +840,17 @@
    5.85  	  int i;
    5.86  	
    5.87  	  for(i = 0; i < rep.num_attributes; i++) {
    5.88 -             p_XRead(dpy, (char*)(&Info), sz_xvAttributeInfo);
    5.89 +             _XRead(dpy, (char*)(&Info), sz_xvAttributeInfo);
    5.90  	      ret[i].flags = (int)Info.flags;	      
    5.91  	      ret[i].min_value = Info.min;	      
    5.92  	      ret[i].max_value = Info.max;	      
    5.93  	      ret[i].name = marker;
    5.94 -	      p_XRead(dpy, marker, Info.size);
    5.95 +	      _XRead(dpy, marker, Info.size);
    5.96  	      marker += Info.size;
    5.97  	      (*num)++;
    5.98  	  }
    5.99        } else
   5.100 -	p_XEatData(dpy, rep.length << 2);
   5.101 +	_XEatData(dpy, rep.length << 2);
   5.102    }
   5.103  
   5.104    UnlockDisplay(dpy);
   5.105 @@ -880,7 +880,7 @@
   5.106  
   5.107    /* READ THE REPLY */
   5.108  
   5.109 -  if (p_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
   5.110 +  if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
   5.111        UnlockDisplay(dpy);
   5.112        SyncHandle();
   5.113        return NULL;
   5.114 @@ -894,7 +894,7 @@
   5.115  	  int i;
   5.116  	
   5.117  	  for(i = 0; i < rep.num_formats; i++) {
   5.118 -              p_XRead(dpy, (char*)(&Info), sz_xvImageFormatInfo);
   5.119 +              _XRead(dpy, (char*)(&Info), sz_xvImageFormatInfo);
   5.120  	      ret[i].id = Info.id;	      
   5.121  	      ret[i].type = Info.type;	      
   5.122  	      ret[i].byte_order = Info.byte_order;	      
   5.123 @@ -920,7 +920,7 @@
   5.124  	      (*num)++;
   5.125  	  }
   5.126        } else
   5.127 -	p_XEatData(dpy, rep.length << 2);
   5.128 +	_XEatData(dpy, rep.length << 2);
   5.129    }
   5.130  
   5.131    UnlockDisplay(dpy);
   5.132 @@ -954,7 +954,7 @@
   5.133  
   5.134     /* READ THE REPLY */
   5.135  
   5.136 -   if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   5.137 +   if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   5.138         UnlockDisplay(dpy);
   5.139         SyncHandle();
   5.140        return NULL;
   5.141 @@ -970,10 +970,10 @@
   5.142  	ret->offsets = ret->pitches + rep.num_planes;
   5.143  	ret->data = data;
   5.144  	ret->obdata = NULL;
   5.145 -  	p_XRead(dpy, (char*)(ret->pitches), rep.num_planes << 2);
   5.146 -	p_XRead(dpy, (char*)(ret->offsets), rep.num_planes << 2);
   5.147 +  	_XRead(dpy, (char*)(ret->pitches), rep.num_planes << 2);
   5.148 +	_XRead(dpy, (char*)(ret->offsets), rep.num_planes << 2);
   5.149     } else
   5.150 -	p_XEatData(dpy, rep.length << 2);
   5.151 +	_XEatData(dpy, rep.length << 2);
   5.152  
   5.153     UnlockDisplay(dpy);
   5.154     SyncHandle();
   5.155 @@ -1122,7 +1122,7 @@
   5.156      case XvVideoNotify:
   5.157        re->xvvideo.type = event->u.u.type & 0x7f;
   5.158        re->xvvideo.serial = 
   5.159 -	p_XSetLastRequestRead(dpy, (xGenericReply *)event);
   5.160 +	_XSetLastRequestRead(dpy, (xGenericReply *)event);
   5.161        re->xvvideo.send_event = ((event->u.u.type & 0x80) != 0);
   5.162        re->xvvideo.display = dpy;
   5.163        re->xvvideo.time = event->u.videoNotify.time;
   5.164 @@ -1133,7 +1133,7 @@
   5.165      case XvPortNotify:
   5.166        re->xvport.type = event->u.u.type & 0x7f;
   5.167        re->xvport.serial = 
   5.168 -	p_XSetLastRequestRead(dpy, (xGenericReply *)event);
   5.169 +	_XSetLastRequestRead(dpy, (xGenericReply *)event);
   5.170        re->xvport.send_event = ((event->u.u.type & 0x80) != 0);
   5.171        re->xvport.display = dpy;
   5.172        re->xvport.time = event->u.portNotify.time;
     6.1 --- a/src/video/Xext/Xv/Xvlibint.h	Wed Mar 22 04:51:44 2006 +0000
     6.2 +++ b/src/video/Xext/Xv/Xvlibint.h	Wed Mar 22 05:00:59 2006 +0000
     6.3 @@ -53,7 +53,7 @@
     6.4  #define XvGetReq(name, req) \
     6.5          WORD64ALIGN\
     6.6  	if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\
     6.7 -		p_XFlush(dpy);\
     6.8 +		_XFlush(dpy);\
     6.9  	req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\
    6.10  	req->reqType = info->codes->major_opcode;\
    6.11          req->xvReqType = xv_##name; \
    6.12 @@ -65,7 +65,7 @@
    6.13  #define XvGetReq(name, req) \
    6.14          WORD64ALIGN\
    6.15  	if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\
    6.16 -		p_XFlush(dpy);\
    6.17 +		_XFlush(dpy);\
    6.18  	req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
    6.19  	req->reqType = info->codes->major_opcode;\
    6.20  	req->xvReqType = xv_/**/name;\
     7.1 --- a/src/video/Xext/Xxf86dga/XF86DGA.c	Wed Mar 22 04:51:44 2006 +0000
     7.2 +++ b/src/video/Xext/Xxf86dga/XF86DGA.c	Wed Mar 22 05:00:59 2006 +0000
     7.3 @@ -114,7 +114,7 @@
     7.4      req->reqType = info->codes->major_opcode;
     7.5      req->dgaReqType = X_XF86DGAGetVideoLL;
     7.6      req->screen = screen;
     7.7 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     7.8 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     7.9  	UnlockDisplay(dpy);
    7.10  	SyncHandle();
    7.11  	return False;
    7.12 @@ -149,7 +149,7 @@
    7.13      req->enable = enable;
    7.14      UnlockDisplay(dpy);
    7.15      SyncHandle();
    7.16 -    pXSync(dpy,False);
    7.17 +    XSync(dpy,False);
    7.18      return True;
    7.19  }
    7.20  
    7.21 @@ -170,7 +170,7 @@
    7.22      req->reqType = info->codes->major_opcode;
    7.23      req->dgaReqType = X_XF86DGAGetViewPortSize;
    7.24      req->screen = screen;
    7.25 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.26 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.27  	UnlockDisplay(dpy);
    7.28  	SyncHandle();
    7.29  	return False;
    7.30 @@ -205,7 +205,7 @@
    7.31      req->y = y;
    7.32      UnlockDisplay(dpy);
    7.33      SyncHandle();
    7.34 -    pXSync(dpy,False);
    7.35 +    XSync(dpy,False);
    7.36      return True;
    7.37  }
    7.38  
    7.39 @@ -226,7 +226,7 @@
    7.40      req->reqType = info->codes->major_opcode;
    7.41      req->dgaReqType = X_XF86DGAGetVidPage;
    7.42      req->screen = screen;
    7.43 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.44 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.45  	UnlockDisplay(dpy);
    7.46  	SyncHandle();
    7.47  	return False;
    7.48 @@ -257,7 +257,7 @@
    7.49      req->vpage = vpage;
    7.50      UnlockDisplay(dpy);
    7.51      SyncHandle();
    7.52 -    pXSync(dpy,False);
    7.53 +    XSync(dpy,False);
    7.54      return True;
    7.55  }
    7.56  
    7.57 @@ -279,7 +279,7 @@
    7.58      req->id = cmap;
    7.59      UnlockDisplay(dpy);
    7.60      SyncHandle();
    7.61 -    pXSync(dpy,False);
    7.62 +    XSync(dpy,False);
    7.63      return True;
    7.64  }
    7.65  
    7.66 @@ -299,7 +299,7 @@
    7.67      req->reqType = info->codes->major_opcode;
    7.68      req->dgaReqType = X_XF86DGAQueryDirectVideo;
    7.69      req->screen = screen;
    7.70 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.71 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.72  	UnlockDisplay(dpy);
    7.73  	SyncHandle();
    7.74  	return False;
    7.75 @@ -327,7 +327,7 @@
    7.76      req->dgaReqType = X_XF86DGAViewPortChanged;
    7.77      req->screen = screen;
    7.78      req->n = n;
    7.79 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.80 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    7.81  	UnlockDisplay(dpy);
    7.82  	SyncHandle();
    7.83  	return False;
    7.84 @@ -600,7 +600,7 @@
    7.85  	for (i = 0; i < numScrs; i++) {
    7.86  	    sp = scrList[i];
    7.87  	    SDL_NAME(XF86DGADirectVideoLL)(sp->display, sp->screen, 0);
    7.88 -	    pXSync(sp->display, False);
    7.89 +	    XSync(sp->display, False);
    7.90  	}
    7.91          if (WIFEXITED(status))
    7.92  	    _exit(0);
    7.93 @@ -660,7 +660,7 @@
    7.94      for (i = 0; i < numScrs; i++) {
    7.95  	sp = scrList[i];
    7.96  	SDL_NAME(XF86DGADirectVideo)(sp->display, sp->screen, 0);
    7.97 -	pXSync(sp->display, False);
    7.98 +	XSync(sp->display, False);
    7.99      }
   7.100      _exit(3);
   7.101  }
     8.1 --- a/src/video/Xext/Xxf86dga/XF86DGA2.c	Wed Mar 22 04:51:44 2006 +0000
     8.2 +++ b/src/video/Xext/Xxf86dga/XF86DGA2.c	Wed Mar 22 05:00:59 2006 +0000
     8.3 @@ -107,7 +107,7 @@
     8.4    case MotionNotify:
     8.5  	mevent = (SDL_NAME(XDGAMotionEvent)*)event;
     8.6  	mevent->type = wire->u.u.type & 0x7F;
     8.7 -	mevent->serial = p_XSetLastRequestRead(dpy, (xGenericReply *)wire);
     8.8 +	mevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
     8.9  	mevent->display = dpy;
    8.10  	mevent->screen = wire->u.event.screen;
    8.11  	mevent->time = wire->u.event.time;
    8.12 @@ -119,7 +119,7 @@
    8.13    case ButtonRelease:
    8.14  	bevent = (SDL_NAME(XDGAButtonEvent)*)event;
    8.15  	bevent->type = wire->u.u.type & 0x7F;
    8.16 -	bevent->serial = p_XSetLastRequestRead(dpy, (xGenericReply *)wire);
    8.17 +	bevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
    8.18  	bevent->display = dpy;
    8.19  	bevent->screen = wire->u.event.screen;
    8.20  	bevent->time = wire->u.event.time;
    8.21 @@ -130,7 +130,7 @@
    8.22    case KeyRelease:
    8.23  	kevent = (SDL_NAME(XDGAKeyEvent)*)event;
    8.24  	kevent->type = wire->u.u.type & 0x7F;
    8.25 -	kevent->serial = p_XSetLastRequestRead(dpy, (xGenericReply *)wire);
    8.26 +	kevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
    8.27  	kevent->display = dpy;
    8.28  	kevent->screen = wire->u.event.screen;
    8.29  	kevent->time = wire->u.event.time;
    8.30 @@ -175,7 +175,7 @@
    8.31      GetReq(XDGAQueryVersion, req);
    8.32      req->reqType = info->codes->major_opcode;
    8.33      req->dgaReqType = X_XDGAQueryVersion;
    8.34 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.35 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.36  	UnlockDisplay(dpy);
    8.37  	SyncHandle();
    8.38  	return False;
    8.39 @@ -192,8 +192,8 @@
    8.40  	     i < XF86DGANumberEvents;
    8.41  	     i++, j++) 
    8.42  	{
    8.43 -	    pXESetWireToEvent(dpy, j, xdga_wire_to_event);
    8.44 -	    pXESetEventToWire(dpy, j, xdga_event_to_wire);
    8.45 +	    XESetWireToEvent(dpy, j, xdga_wire_to_event);
    8.46 +	    XESetEventToWire(dpy, j, xdga_event_to_wire);
    8.47  	}
    8.48  	SDL_NAME(XDGASetClientVersion)(dpy);
    8.49      }
    8.50 @@ -236,7 +236,7 @@
    8.51      req->reqType = info->codes->major_opcode;
    8.52      req->dgaReqType = X_XDGAOpenFramebuffer;
    8.53      req->screen = screen;
    8.54 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.55 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.56  	UnlockDisplay(dpy);
    8.57  	SyncHandle();
    8.58  	return False;
    8.59 @@ -244,7 +244,7 @@
    8.60  
    8.61      if(rep.length) {
    8.62  	deviceName = Xmalloc(rep.length << 2);
    8.63 -	p_XRead(dpy, deviceName, rep.length << 2);
    8.64 +	_XRead(dpy, deviceName, rep.length << 2);
    8.65      }
    8.66  
    8.67      ret = SDL_NAME(XDGAMapFramebuffer)(screen, deviceName,
    8.68 @@ -301,7 +301,7 @@
    8.69      req->dgaReqType = X_XDGAQueryModes;
    8.70      req->screen = screen;
    8.71  
    8.72 -    if (p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.73 +    if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    8.74  	if(rep.length) {
    8.75  	   xXDGAModeInfo info;
    8.76  	   int i, size;
    8.77 @@ -315,7 +315,7 @@
    8.78  
    8.79  	   if(modes) {	
    8.80  	      for(i = 0; i < rep.number; i++) {
    8.81 -		p_XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
    8.82 +		_XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
    8.83  
    8.84  		modes[i].num = info.num;
    8.85  		modes[i].verticalRefresh = 
    8.86 @@ -343,13 +343,13 @@
    8.87  		modes[i].reserved1 = info.reserved1;
    8.88  		modes[i].reserved2 = info.reserved2;	
    8.89  
    8.90 -		p_XRead(dpy, offset, info.name_size);
    8.91 +		_XRead(dpy, offset, info.name_size);
    8.92  		modes[i].name = offset;
    8.93  		offset += info.name_size;
    8.94  	      }
    8.95  	      *num = rep.number;
    8.96  	   } else
    8.97 -		p_XEatData(dpy, rep.length << 2);
    8.98 +		_XEatData(dpy, rep.length << 2);
    8.99  	}
   8.100      }
   8.101  
   8.102 @@ -382,7 +382,7 @@
   8.103      req->mode = mode;
   8.104      req->pid = pid = XAllocID(dpy);
   8.105      
   8.106 -    if (p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   8.107 +    if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   8.108  	if(rep.length) {
   8.109  	   xXDGAModeInfo info;
   8.110  	   int size;
   8.111 @@ -393,7 +393,7 @@
   8.112  	   dev = (SDL_NAME(XDGADevice)*)Xmalloc(sizeof(SDL_NAME(XDGADevice)) + size);
   8.113  	    
   8.114  	   if(dev) {
   8.115 -		p_XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
   8.116 +		_XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
   8.117  
   8.118  		dev->mode.num = info.num;
   8.119  		dev->mode.verticalRefresh = 
   8.120 @@ -422,7 +422,7 @@
   8.121  		dev->mode.reserved2 = info.reserved2;
   8.122  
   8.123  		dev->mode.name = (char*)(&dev[1]);	
   8.124 -		p_XRead(dpy, dev->mode.name, info.name_size);
   8.125 +		_XRead(dpy, dev->mode.name, info.name_size);
   8.126  
   8.127  		dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0;
   8.128  		dev->data = SDL_NAME(XDGAGetMappedMemory)(screen);
   8.129 @@ -613,7 +613,7 @@
   8.130      req->reqType = info->codes->major_opcode;
   8.131      req->dgaReqType = X_XDGAGetViewportStatus;
   8.132      req->screen = screen;
   8.133 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse))
   8.134 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse))
   8.135  	status = rep.status;
   8.136      UnlockDisplay(dpy);
   8.137      SyncHandle();
   8.138 @@ -635,7 +635,7 @@
   8.139      req->reqType = info->codes->major_opcode;
   8.140      req->dgaReqType = X_XDGASync;
   8.141      req->screen = screen;
   8.142 -    p_XReply(dpy, (xReply *)&rep, 0, xFalse);
   8.143 +    _XReply(dpy, (xReply *)&rep, 0, xFalse);
   8.144      UnlockDisplay(dpy);
   8.145      SyncHandle();
   8.146  }
   8.147 @@ -662,7 +662,7 @@
   8.148      req->x = *x;
   8.149      req->y = *y;
   8.150      req->flags = mode;
   8.151 -    p_XReply(dpy, (xReply *)&rep, 0, xFalse);
   8.152 +    _XReply(dpy, (xReply *)&rep, 0, xFalse);
   8.153      *x = rep.x;
   8.154      *y = rep.y;
   8.155      UnlockDisplay(dpy);
     9.1 --- a/src/video/Xext/Xxf86vm/XF86VMode.c	Wed Mar 22 04:51:44 2006 +0000
     9.2 +++ b/src/video/Xext/Xxf86vm/XF86VMode.c	Wed Mar 22 05:00:59 2006 +0000
     9.3 @@ -132,7 +132,7 @@
     9.4      GetReq(XF86VidModeQueryVersion, req);
     9.5      req->reqType = info->codes->major_opcode;
     9.6      req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
     9.7 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     9.8 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
     9.9  	UnlockDisplay(dpy);
    9.10  	SyncHandle();
    9.11  	return False;
    9.12 @@ -200,7 +200,7 @@
    9.13      req->reqType = info->codes->major_opcode;
    9.14      req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
    9.15      req->screen = screen;
    9.16 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    9.17 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
    9.18  	UnlockDisplay(dpy);
    9.19  	SyncHandle();
    9.20  	return False;
    9.21 @@ -236,7 +236,7 @@
    9.22      req->screen = screen;
    9.23      
    9.24      if (majorVersion < 2) {
    9.25 -	if (!p_XReply(dpy, (xReply *)&oldrep, 
    9.26 +	if (!_XReply(dpy, (xReply *)&oldrep, 
    9.27              (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
    9.28  	    UnlockDisplay(dpy);
    9.29  	    SyncHandle();
    9.30 @@ -255,7 +255,7 @@
    9.31  	modeline->flags      = oldrep.flags;
    9.32  	modeline->privsize   = oldrep.privsize;
    9.33      } else {
    9.34 -	if (!p_XReply(dpy, (xReply *)&rep, 
    9.35 +	if (!_XReply(dpy, (xReply *)&rep, 
    9.36              (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
    9.37  	    UnlockDisplay(dpy);
    9.38  	    SyncHandle();
    9.39 @@ -277,11 +277,11 @@
    9.40      
    9.41      if (modeline->privsize > 0) {
    9.42  	if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
    9.43 -	    p_XEatData(dpy, (modeline->privsize) * sizeof(INT32));
    9.44 +	    _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
    9.45  	    Xfree(modeline->private);
    9.46  	    return False;
    9.47  	}
    9.48 -	p_XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
    9.49 +	_XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
    9.50      } else {
    9.51  	modeline->private = NULL;
    9.52      }
    9.53 @@ -330,7 +330,7 @@
    9.54      req->reqType = info->codes->major_opcode;
    9.55      req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
    9.56      req->screen = screen;
    9.57 -    if (!p_XReply(dpy, (xReply *)&rep, 
    9.58 +    if (!_XReply(dpy, (xReply *)&rep, 
    9.59          (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) {
    9.60          UnlockDisplay(dpy);
    9.61  	SyncHandle();
    9.62 @@ -343,9 +343,9 @@
    9.63                                            sizeof(SDL_NAME(XF86VidModeModeInfo) *)
    9.64                                            +sizeof(SDL_NAME(XF86VidModeModeInfo))))) {
    9.65  	if (majorVersion < 2)
    9.66 -            p_XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
    9.67 +            _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
    9.68  	else
    9.69 -            p_XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
    9.70 +            _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
    9.71          Xfree(modelines);
    9.72          UnlockDisplay(dpy);
    9.73          SyncHandle();
    9.74 @@ -359,7 +359,7 @@
    9.75      for (i = 0; i < rep.modecount; i++) {
    9.76          modelines[i] = mdinfptr++;
    9.77  	if (majorVersion < 2) {
    9.78 -            p_XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
    9.79 +            _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
    9.80  	    modelines[i]->dotclock   = oldxmdline.dotclock;
    9.81  	    modelines[i]->hdisplay   = oldxmdline.hdisplay;
    9.82  	    modelines[i]->hsyncstart = oldxmdline.hsyncstart;
    9.83 @@ -379,10 +379,10 @@
    9.84  		if (oldxmdline.privsize > 0) {
    9.85  	            if (!(modelines[i]->private =
    9.86  			    Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
    9.87 -			p_XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
    9.88 +			_XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
    9.89  			Xfree(modelines[i]->private);
    9.90  		    } else {
    9.91 -			p_XRead(dpy, (char*)modelines[i]->private,
    9.92 +			_XRead(dpy, (char*)modelines[i]->private,
    9.93  			     oldxmdline.privsize * sizeof(INT32));
    9.94  		    }
    9.95  		} else {
    9.96 @@ -390,7 +390,7 @@
    9.97  		}
    9.98  	    }
    9.99  	} else {
   9.100 -            p_XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
   9.101 +            _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
   9.102  	    modelines[i]->dotclock   = xmdline.dotclock;
   9.103  	    modelines[i]->hdisplay   = xmdline.hdisplay;
   9.104  	    modelines[i]->hsyncstart = xmdline.hsyncstart;
   9.105 @@ -410,10 +410,10 @@
   9.106  		if (xmdline.privsize > 0) {
   9.107  		    if (!(modelines[i]->private =
   9.108  			    Xcalloc(xmdline.privsize, sizeof(INT32)))) {
   9.109 -			p_XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
   9.110 +			_XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
   9.111  			Xfree(modelines[i]->private);
   9.112  		    } else {
   9.113 -			p_XRead(dpy, (char*)modelines[i]->private,
   9.114 +			_XRead(dpy, (char*)modelines[i]->private,
   9.115  			     xmdline.privsize * sizeof(INT32));
   9.116  		    }
   9.117  		} else {
   9.118 @@ -435,7 +435,7 @@
   9.119  #define GetOldReq(name, oldname, req) \
   9.120          WORD64ALIGN\
   9.121  	if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
   9.122 -		p_XFlush(dpy);\
   9.123 +		_XFlush(dpy);\
   9.124  	req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
   9.125  	req->reqType = X_##name;\
   9.126  	req->length = (SIZEOF(x##oldname##Req))>>2;\
   9.127 @@ -446,7 +446,7 @@
   9.128  #define GetOldReq(name, oldname, req) \
   9.129          WORD64ALIGN\
   9.130  	if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
   9.131 -		p_XFlush(dpy);\
   9.132 +		_XFlush(dpy);\
   9.133  	req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
   9.134  	req->reqType = X_/**/name;\
   9.135  	req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
   9.136 @@ -754,7 +754,7 @@
   9.137  	       modeline->privsize * sizeof(INT32));
   9.138  	}
   9.139      }
   9.140 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.141 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.142  	UnlockDisplay(dpy);
   9.143  	SyncHandle();
   9.144  	return MODE_BAD;
   9.145 @@ -916,7 +916,7 @@
   9.146      req->reqType = info->codes->major_opcode;
   9.147      req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
   9.148      req->screen = screen;
   9.149 -    if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.150 +    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.151  	UnlockDisplay(dpy);
   9.152  	SyncHandle();
   9.153  	return False;
   9.154 @@ -928,7 +928,7 @@
   9.155  #endif
   9.156      if (rep.vendorLength) {
   9.157  	if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
   9.158 -	    p_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.159 +	    _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.160  		      ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
   9.161              UnlockDisplay(dpy);
   9.162              SyncHandle();
   9.163 @@ -939,7 +939,7 @@
   9.164      }
   9.165      if (rep.modelLength) {
   9.166  	if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
   9.167 -	    p_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.168 +	    _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.169  		      ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
   9.170  	    if (monitor->vendor)
   9.171  		Xfree(monitor->vendor);
   9.172 @@ -951,7 +951,7 @@
   9.173  	monitor->model = NULL;
   9.174      }
   9.175      if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
   9.176 -	p_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.177 +	_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.178  		  ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
   9.179  	
   9.180  	if (monitor->vendor)
   9.181 @@ -963,7 +963,7 @@
   9.182  	return False;
   9.183      }
   9.184      if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
   9.185 -	p_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.186 +	_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
   9.187  		  ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
   9.188  	if (monitor->vendor)
   9.189  	    Xfree(monitor->vendor);
   9.190 @@ -975,21 +975,21 @@
   9.191  	return False;
   9.192      }
   9.193      for (i = 0; i < rep.nhsync; i++) {
   9.194 -	p_XRead(dpy, (char *)&syncrange, 4);
   9.195 +	_XRead(dpy, (char *)&syncrange, 4);
   9.196  	monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
   9.197  	monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0;
   9.198      }
   9.199      for (i = 0; i < rep.nvsync; i++) {
   9.200 -	p_XRead(dpy, (char *)&syncrange, 4);
   9.201 +	_XRead(dpy, (char *)&syncrange, 4);
   9.202  	monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
   9.203  	monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0;
   9.204      }
   9.205      if (rep.vendorLength)
   9.206 -	p_XReadPad(dpy, monitor->vendor, rep.vendorLength);
   9.207 +	_XReadPad(dpy, monitor->vendor, rep.vendorLength);
   9.208      else
   9.209  	monitor->vendor = "";
   9.210      if (rep.modelLength)
   9.211 -	p_XReadPad(dpy, monitor->model, rep.modelLength);
   9.212 +	_XReadPad(dpy, monitor->model, rep.modelLength);
   9.213      else
   9.214  	monitor->model = "";
   9.215  	
   9.216 @@ -1037,7 +1037,7 @@
   9.217  	*x = 0;
   9.218  	*y = 0;
   9.219      } else {
   9.220 -	if (!p_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.221 +	if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
   9.222  	    UnlockDisplay(dpy);
   9.223  	    SyncHandle();
   9.224  	    return False;
   9.225 @@ -1095,7 +1095,7 @@
   9.226      req->reqType = info->codes->major_opcode;
   9.227      req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
   9.228      req->screen = screen;
   9.229 -    if (!p_XReply(dpy, (xReply *)&rep, 
   9.230 +    if (!_XReply(dpy, (xReply *)&rep, 
   9.231          (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse))
   9.232      {
   9.233          UnlockDisplay(dpy);
   9.234 @@ -1107,7 +1107,7 @@
   9.235      *flagsPtr     = rep.flags;
   9.236  
   9.237      if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
   9.238 -        p_XEatData(dpy, (rep.clocks) * 4);
   9.239 +        _XEatData(dpy, (rep.clocks) * 4);
   9.240          Xfree(dotclocks);
   9.241          UnlockDisplay(dpy);
   9.242          SyncHandle();
   9.243 @@ -1115,7 +1115,7 @@
   9.244      }
   9.245  
   9.246      for (i = 0; i < rep.clocks; i++) {
   9.247 -        p_XRead(dpy, (char*)&dotclk, 4);
   9.248 +        _XRead(dpy, (char*)&dotclk, 4);
   9.249  	dotclocks[i] = dotclk;
   9.250      }
   9.251      *clocksPtr = dotclocks;
   9.252 @@ -1146,9 +1146,9 @@
   9.253      req->screen = screen;
   9.254      req->length += (length >> 1) * 3;
   9.255      req->size = size;
   9.256 -    p_XSend(dpy, (char*)red, size * 2);
   9.257 -    p_XSend(dpy, (char*)green, size * 2);
   9.258 -    p_XSend(dpy, (char*)blue, size * 2);
   9.259 +    _XSend(dpy, (char*)red, size * 2);
   9.260 +    _XSend(dpy, (char*)green, size * 2);
   9.261 +    _XSend(dpy, (char*)blue, size * 2);
   9.262      UnlockDisplay(dpy);
   9.263      SyncHandle();
   9.264      return True;
   9.265 @@ -1177,15 +1177,15 @@
   9.266      req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
   9.267      req->screen = screen;
   9.268      req->size = size;
   9.269 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
   9.270 +    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
   9.271          UnlockDisplay (dpy);
   9.272          SyncHandle ();
   9.273          return False;
   9.274      }
   9.275      if(rep.size) {
   9.276 -	p_XRead(dpy, (char*)red, rep.size << 1);
   9.277 -	p_XRead(dpy, (char*)green, rep.size << 1);
   9.278 -	p_XRead(dpy, (char*)blue, rep.size << 1);
   9.279 +	_XRead(dpy, (char*)red, rep.size << 1);
   9.280 +	_XRead(dpy, (char*)green, rep.size << 1);
   9.281 +	_XRead(dpy, (char*)blue, rep.size << 1);
   9.282      }
   9.283  
   9.284      UnlockDisplay(dpy);
   9.285 @@ -1212,7 +1212,7 @@
   9.286      req->reqType = info->codes->major_opcode;
   9.287      req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
   9.288      req->screen = screen;
   9.289 -    if (!p_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
   9.290 +    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
   9.291          UnlockDisplay (dpy);
   9.292          SyncHandle ();
   9.293          return False; 
    10.1 --- a/src/video/Xext/extensions/extutil.h	Wed Mar 22 04:51:44 2006 +0000
    10.2 +++ b/src/video/Xext/extensions/extutil.h	Wed Mar 22 05:00:59 2006 +0000
    10.3 @@ -175,9 +175,9 @@
    10.4  
    10.5  #define XextHasExtension(i) ((i) && ((i)->codes))
    10.6  #define XextCheckExtension(dpy,i,name,val) \
    10.7 -  if (!XextHasExtension(i)) { pXMissingExtension (dpy, name); return val; }
    10.8 +  if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
    10.9  #define XextSimpleCheckExtension(dpy,i,name) \
   10.10 -  if (!XextHasExtension(i)) { pXMissingExtension (dpy, name); return; }
   10.11 +  if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
   10.12  
   10.13  
   10.14  /*
   10.15 @@ -190,9 +190,9 @@
   10.16  XExtDisplayInfo *proc (Display *dpy) \
   10.17  { \
   10.18      XExtDisplayInfo *dpyinfo; \
   10.19 -    if (!extinfo) { if (!(extinfo = pXextCreateExtension())) return NULL; } \
   10.20 -    if (!(dpyinfo = pXextFindDisplay (extinfo, dpy))) \
   10.21 -      dpyinfo = pXextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
   10.22 +    if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
   10.23 +    if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
   10.24 +      dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
   10.25      return dpyinfo; \
   10.26  }
   10.27  
   10.28 @@ -202,7 +202,7 @@
   10.29  #define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
   10.30  int proc (Display *dpy, XExtCodes *codes) \
   10.31  { \
   10.32 -    return pXextRemoveDisplay (extinfo, dpy); \
   10.33 +    return XextRemoveDisplay (extinfo, dpy); \
   10.34  }
   10.35  
   10.36  #define XEXT_CLOSE_DISPLAY_PROTO(proc) \
   10.37 @@ -215,7 +215,7 @@
   10.38      if (code >= 0 && code < nerr) { \
   10.39  	char tmp[256]; \
   10.40  	SDL_snprintf (tmp, SDL_arraysize(tmp), "%s.%d", extname, code); \
   10.41 -	pXGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
   10.42 +	XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
   10.43  	return buf; \
   10.44      } \
   10.45      return (char *)0; \
    11.1 --- a/src/video/dga/SDL_dgaevents.c	Wed Mar 22 04:51:44 2006 +0000
    11.2 +++ b/src/video/dga/SDL_dgaevents.c	Wed Mar 22 05:00:59 2006 +0000
    11.3 @@ -45,7 +45,7 @@
    11.4  	int posted;
    11.5  	SDL_NAME(XDGAEvent) xevent;
    11.6  
    11.7 -	pXNextEvent(DGA_Display, (XEvent *)&xevent);
    11.8 +	XNextEvent(DGA_Display, (XEvent *)&xevent);
    11.9  
   11.10  	posted = 0;
   11.11  	xevent.type -= DGA_event_base;
   11.12 @@ -96,7 +96,7 @@
   11.13  			static XComposeStatus state;
   11.14  			char keybuf[32];
   11.15  
   11.16 -			if ( pXLookupString(&xkey, keybuf, sizeof(keybuf), NULL, &state) ) {
   11.17 +			if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, &state) ) {
   11.18  				/*
   11.19  				* FIXME: XLookupString() may yield more than one
   11.20  				* character, so we need a mechanism to allow for
    12.1 --- a/src/video/dga/SDL_dgavideo.c	Wed Mar 22 04:51:44 2006 +0000
    12.2 +++ b/src/video/dga/SDL_dgavideo.c	Wed Mar 22 05:00:59 2006 +0000
    12.3 @@ -73,9 +73,9 @@
    12.4  	   and the DGA 2.0+ extension is available, and we can map mem.
    12.5  	*/
    12.6  	if ( SDL_X11_LoadSymbols() ) {
    12.7 -		if ( (SDL_strncmp(pXDisplayName(display), ":", 1) == 0) ||
    12.8 -		     (SDL_strncmp(pXDisplayName(display), "unix:", 5) == 0) ) {
    12.9 -			dpy = pXOpenDisplay(display);
   12.10 +		if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
   12.11 +		     (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
   12.12 +			dpy = XOpenDisplay(display);
   12.13  			if ( dpy ) {
   12.14  				int events, errors, major, minor;
   12.15  
   12.16 @@ -90,7 +90,7 @@
   12.17  						SDL_NAME(XDGACloseFramebuffer)(dpy, screen);
   12.18  					}
   12.19  				}
   12.20 -				pXCloseDisplay(dpy);
   12.21 +				XCloseDisplay(dpy);
   12.22  			}
   12.23  		}
   12.24  		SDL_X11_UnloadSymbols();
   12.25 @@ -329,7 +329,7 @@
   12.26  	/* Open the X11 display */
   12.27  	display = NULL;		/* Get it from DISPLAY environment variable */
   12.28  
   12.29 -	DGA_Display = pXOpenDisplay(display);
   12.30 +	DGA_Display = XOpenDisplay(display);
   12.31  	if ( DGA_Display == NULL ) {
   12.32  		SDL_SetError("Couldn't open X11 display");
   12.33  		return(-1);
   12.34 @@ -339,12 +339,12 @@
   12.35  	if ( ! SDL_NAME(XDGAQueryExtension)(DGA_Display, &event_base, &error_base) ||
   12.36  	     ! SDL_NAME(XDGAQueryVersion)(DGA_Display, &major_version, &minor_version) ) {
   12.37  		SDL_SetError("DGA extension not available");
   12.38 -		pXCloseDisplay(DGA_Display);
   12.39 +		XCloseDisplay(DGA_Display);
   12.40  		return(-1);
   12.41  	}
   12.42  	if ( major_version < 2 ) {
   12.43  		SDL_SetError("DGA driver requires DGA 2.0 or newer");
   12.44 -		pXCloseDisplay(DGA_Display);
   12.45 +		XCloseDisplay(DGA_Display);
   12.46  		return(-1);
   12.47  	}
   12.48  	DGA_event_base = event_base;
   12.49 @@ -360,10 +360,10 @@
   12.50  		int i, num_formats;
   12.51  
   12.52  		vformat->BitsPerPixel = DefaultDepth(DGA_Display, DGA_Screen);
   12.53 -		pix_format = pXListPixmapFormats(DGA_Display, &num_formats);
   12.54 +		pix_format = XListPixmapFormats(DGA_Display, &num_formats);
   12.55  		if ( pix_format == NULL ) {
   12.56  			SDL_SetError("Couldn't determine screen formats");
   12.57 -			pXCloseDisplay(DGA_Display);
   12.58 +			XCloseDisplay(DGA_Display);
   12.59  			return(-1);
   12.60  		}
   12.61  		for ( i=0; i<num_formats; ++i ) {
   12.62 @@ -372,7 +372,7 @@
   12.63  		}
   12.64  		if ( i != num_formats )
   12.65  			vformat->BitsPerPixel = pix_format[i].bits_per_pixel;
   12.66 -		pXFree((char *)pix_format);
   12.67 +		XFree((char *)pix_format);
   12.68  	}
   12.69  	if ( vformat->BitsPerPixel > 8 ) {
   12.70  		vformat->Rmask = visual->red_mask;
   12.71 @@ -383,7 +383,7 @@
   12.72  	/* Open access to the framebuffer */
   12.73  	if ( ! SDL_NAME(XDGAOpenFramebuffer)(DGA_Display, DGA_Screen) ) {
   12.74  		SDL_SetError("Unable to map the video memory");
   12.75 -		pXCloseDisplay(DGA_Display);
   12.76 +		XCloseDisplay(DGA_Display);
   12.77  		return(-1);
   12.78  	}
   12.79  
   12.80 @@ -403,7 +403,7 @@
   12.81  		}
   12.82  	}
   12.83  	UpdateHWInfo(this, modes);
   12.84 -	pXFree(modes);
   12.85 +	XFree(modes);
   12.86  
   12.87  	/* Create the hardware surface lock mutex */
   12.88  	hw_lock = SDL_CreateMutex();
   12.89 @@ -442,7 +442,7 @@
   12.90  
   12.91  	/* Free any previous colormap */
   12.92  	if ( DGA_colormap ) {
   12.93 -		pXFreeColormap(DGA_Display, DGA_colormap);
   12.94 +		XFreeColormap(DGA_Display, DGA_colormap);
   12.95  		DGA_colormap = 0;
   12.96  	}
   12.97  
   12.98 @@ -473,7 +473,7 @@
   12.99  
  12.100  	/* Set the video mode */
  12.101  	mode = SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, modes[i].num);
  12.102 -	pXFree(modes);
  12.103 +	XFree(modes);
  12.104  	if ( mode == NULL ) {
  12.105  		SDL_SetError("Unable to switch to requested mode");
  12.106  		return(NULL);
  12.107 @@ -821,7 +821,7 @@
  12.108  #endif
  12.109  	SDL_NAME(XDGAFillRectangle)(DGA_Display, DGA_Screen, x, y, w, h, color);
  12.110  	if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
  12.111 -		pXFlush(DGA_Display);
  12.112 +		XFlush(DGA_Display);
  12.113  	}
  12.114  	DGA_AddBusySurface(dst);
  12.115  	UNLOCK_DISPLAY();
  12.116 @@ -863,7 +863,7 @@
  12.117  			srcx, srcy, w, h, dstx, dsty);
  12.118  	}
  12.119  	if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
  12.120 -		pXFlush(DGA_Display);
  12.121 +		XFlush(DGA_Display);
  12.122  	}
  12.123  	DGA_AddBusySurface(src);
  12.124  	DGA_AddBusySurface(dst);
  12.125 @@ -943,7 +943,7 @@
  12.126  	DGA_WaitFlip(this);
  12.127  	SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen,
  12.128  	                0, flip_yoffset[flip_page], XDGAFlipRetrace);
  12.129 -	pXFlush(DGA_Display);
  12.130 +	XFlush(DGA_Display);
  12.131  	UNLOCK_DISPLAY();
  12.132  	was_flipped = 1;
  12.133  	flip_page = !flip_page;
  12.134 @@ -976,8 +976,8 @@
  12.135  		xcmap[i].flags = (DoRed|DoGreen|DoBlue);
  12.136  	}
  12.137  	LOCK_DISPLAY();
  12.138 -	pXStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
  12.139 -	pXSync(DGA_Display, False);
  12.140 +	XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
  12.141 +	XSync(DGA_Display, False);
  12.142  	UNLOCK_DISPLAY();
  12.143  	SDL_stack_free(xcmap);
  12.144  
  12.145 @@ -1011,8 +1011,8 @@
  12.146  		xcmap[i].flags = (DoRed|DoGreen|DoBlue);
  12.147  	}
  12.148  	LOCK_DISPLAY();
  12.149 -	pXStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
  12.150 -	pXSync(DGA_Display, False);
  12.151 +	XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
  12.152 +	XSync(DGA_Display, False);
  12.153  	UNLOCK_DISPLAY();
  12.154  	return(0);
  12.155  }
  12.156 @@ -1024,7 +1024,7 @@
  12.157  	if ( DGA_Display ) {
  12.158  		/* Free colormap, if necessary */
  12.159  		if ( DGA_colormap ) {
  12.160 -			pXFreeColormap(DGA_Display, DGA_colormap);
  12.161 +			XFreeColormap(DGA_Display, DGA_colormap);
  12.162  			DGA_colormap = 0;
  12.163  		}
  12.164  
  12.165 @@ -1064,6 +1064,6 @@
  12.166  		DGA_FreeHWSurfaces(this);
  12.167  
  12.168  		/* Close up the display */
  12.169 -		pXCloseDisplay(DGA_Display);
  12.170 +		XCloseDisplay(DGA_Display);
  12.171  	}
  12.172  }
    13.1 --- a/src/video/x11/SDL_x11dyn.c	Wed Mar 22 04:51:44 2006 +0000
    13.2 +++ b/src/video/x11/SDL_x11dyn.c	Wed Mar 22 05:00:59 2006 +0000
    13.3 @@ -21,11 +21,10 @@
    13.4  */
    13.5  #include "SDL_config.h"
    13.6  
    13.7 -#if 0
    13.8 +#if 1
    13.9  #define DEBUG_DYNAMIC_X11 1
   13.10  #endif
   13.11  
   13.12 -#define __SDL_NO_REDEFINE_X11_HEADER_SYMS 1
   13.13  #include "SDL_x11dyn.h"
   13.14  
   13.15  #ifdef DEBUG_DYNAMIC_X11
   13.16 @@ -41,51 +40,88 @@
   13.17  static const char *x11ext_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT;
   13.18  static void *x11ext_handle = NULL;
   13.19  
   13.20 -static void *X11_GetSym(int required, const char *fnname, int *rc)
   13.21 +typedef struct
   13.22  {
   13.23 +    void *lib;
   13.24 +    const char *libname;
   13.25 +} x11libitem;
   13.26 +
   13.27 +static void *X11_GetSym(const char *fnname, int *rc)
   13.28 +{
   13.29 +	int i;
   13.30  	void *fn = NULL;
   13.31 -	if (*rc) {  /* haven't already failed on a previous lookup? */
   13.32 -		fn = SDL_LoadFunction(x11_handle, fnname);
   13.33 -		#if DEBUG_DYNAMIC_X11
   13.34 -		if (fn != NULL)
   13.35 -			printf("X11: Found '%s' in libX11 (%p)\n", fnname, fn);
   13.36 -		#endif
   13.37 +	const x11libitem libs[] =
   13.38 +	{
   13.39 +		{ x11_handle, "libX11" },
   13.40 +		{ x11ext_handle, "libX11ext" },
   13.41 +	};
   13.42  
   13.43 -		if (fn == NULL) {  /* not found? Check libX11ext ... */
   13.44 -			fn = SDL_LoadFunction(x11ext_handle, fnname);
   13.45 -			#if DEBUG_DYNAMIC_X11
   13.46 +	for (i = 0; i < (sizeof (libs) / sizeof (libs[0])); i++)
   13.47 +	{
   13.48 +		if (libs[i].lib != NULL)
   13.49 +		{
   13.50 +			fn = SDL_LoadFunction(libs[i].lib, fnname);
   13.51  			if (fn != NULL)
   13.52 -				printf("X11: Found '%s' in libXext (%p)\n", fnname, fn);
   13.53 -			else
   13.54 -				printf("X11: Symbol '%s' NOT FOUND!%s\n", fnname,
   13.55 -				       required ? "" : " (...but not required!)");
   13.56 -			#endif
   13.57 +				break;
   13.58  		}
   13.59 -		*rc = ((fn != NULL) || (!required));
   13.60  	}
   13.61  
   13.62 +	#if DEBUG_DYNAMIC_X11
   13.63 +	if (fn != NULL)
   13.64 +	    printf("X11: Found '%s' in %s (%p)\n", fnname, libs[i].libname, fn);
   13.65 +	else
   13.66 +		printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
   13.67 +	#endif
   13.68 +
   13.69 +	if (fn == NULL)
   13.70 +		*rc = 0;  /* kill this module. */
   13.71 +
   13.72  	return fn;
   13.73  }
   13.74 +
   13.75 +
   13.76 +/* Define all the function pointers and wrappers... */
   13.77 +#define SDL_X11_MODULE(modname)
   13.78 +#define SDL_X11_SYM(rc,fn,params,args,ret) \
   13.79 +	static rc (*p##fn) params = NULL; \
   13.80 +	rc fn params { ret p##fn args ; }
   13.81 +#include "SDL_x11sym.h"
   13.82 +#undef SDL_X11_MODULE
   13.83 +#undef SDL_X11_SYM
   13.84  #endif  /* SDL_VIDEO_DRIVER_X11_DYNAMIC */
   13.85  
   13.86 -/* Define all the function pointers... */
   13.87 -#define SDL_X11_SYM(req,ret,fn,params) ret (*p##fn) params = NULL;
   13.88 +/* Annoying varargs entry point... */
   13.89 +#ifdef X_HAVE_UTF8_STRING
   13.90 +XIC (*pXCreateIC)(XIM,...) = NULL;
   13.91 +#endif
   13.92 +
   13.93 +/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
   13.94 +#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 1;
   13.95 +#define SDL_X11_SYM(rc,fn,params,args,ret)
   13.96  #include "SDL_x11sym.h"
   13.97 +#undef SDL_X11_MODULE
   13.98  #undef SDL_X11_SYM
   13.99  
  13.100 +
  13.101  static int x11_load_refcount = 0;
  13.102  
  13.103  void SDL_X11_UnloadSymbols(void)
  13.104  {
  13.105 +	#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
  13.106  	/* Don't actually unload if more than one module is using the libs... */
  13.107  	if (x11_load_refcount > 0) {
  13.108  		if (--x11_load_refcount == 0) {
  13.109  			/* set all the function pointers to NULL. */
  13.110 -			#define SDL_X11_SYM(req,ret,fn,params) p##fn = NULL;
  13.111 +			#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1;
  13.112 +			#define SDL_X11_SYM(rc,fn,params,args,ret) p##fn = NULL;
  13.113  			#include "SDL_x11sym.h"
  13.114 +			#undef SDL_X11_MODULE
  13.115  			#undef SDL_X11_SYM
  13.116  
  13.117 -			#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
  13.118 +            #ifdef X_HAVE_UTF8_STRING
  13.119 +            pXCreateIC = NULL;
  13.120 +            #endif
  13.121 +
  13.122  			if (x11_handle != NULL) {
  13.123  				SDL_UnloadObject(x11_handle);
  13.124  				x11_handle = NULL;
  13.125 @@ -94,35 +130,41 @@
  13.126  				SDL_UnloadObject(x11ext_handle);
  13.127  				x11ext_handle = NULL;
  13.128  			}
  13.129 -			#endif
  13.130  		}
  13.131  	}
  13.132 +	#endif
  13.133  }
  13.134  
  13.135  /* returns non-zero if all needed symbols were loaded. */
  13.136  int SDL_X11_LoadSymbols(void)
  13.137  {
  13.138 -	int rc = 1;
  13.139 +	int rc = 1;  /* always succeed if not using Dynamic X11 stuff. */
  13.140  
  13.141 -    /* deal with multiple modules (dga, x11, etc) needing these symbols... */
  13.142 +	#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
  13.143 +	/* deal with multiple modules (dga, x11, etc) needing these symbols... */
  13.144  	if (x11_load_refcount++ == 0) {
  13.145 -		#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
  13.146 -			x11_handle = SDL_LoadObject(x11_library);
  13.147 -			x11ext_handle = SDL_LoadObject(x11ext_library);
  13.148 -			rc = ((x11_handle != NULL) && (x11ext_handle != NULL));
  13.149 -			#define SDL_X11_SYM(req,r,fn,arg) p##fn = X11_GetSym(req,#fn, &rc);
  13.150 -			#include "SDL_x11sym.h"
  13.151 -			#undef SDL_X11_SYM
  13.152 +		int *thismod = NULL;
  13.153 +		x11_handle = SDL_LoadObject(x11_library);
  13.154 +		x11ext_handle = SDL_LoadObject(x11ext_library);
  13.155 +		#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
  13.156 +		#define SDL_X11_SYM(a,fn,x,y,z) p##fn = X11_GetSym(#fn,thismod);
  13.157 +		#include "SDL_x11sym.h"
  13.158 +		#undef SDL_X11_MODULE
  13.159 +		#undef SDL_X11_SYM
  13.160  
  13.161 -			if (!rc)
  13.162 -				SDL_X11_UnloadSymbols();  /* in case one of these loaded... */
  13.163 +		#ifdef X_HAVE_UTF8_STRING
  13.164 +		pXCreateIC = X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8);
  13.165 +		#endif
  13.166  
  13.167 -		#else
  13.168 -			#define SDL_X11_SYM(req,r,fn,arg) p##fn = fn;
  13.169 -			#include "SDL_x11sym.h"
  13.170 -			#undef SDL_X11_SYM
  13.171 +		if (!SDL_X11_HAVE_BASEXLIB) {  /* some required symbol didn't load. */
  13.172 +			SDL_X11_UnloadSymbols();  /* in case something got loaded... */
  13.173 +		}
  13.174 +	}
  13.175 +	#else
  13.176 +		#ifdef X_HAVE_UTF8_STRING
  13.177 +		pXCreateIC = XCreateIC;
  13.178  		#endif
  13.179 -	}
  13.180 +	#endif
  13.181  
  13.182  	return rc;
  13.183  }
    14.1 --- a/src/video/x11/SDL_x11dyn.h	Wed Mar 22 04:51:44 2006 +0000
    14.2 +++ b/src/video/x11/SDL_x11dyn.h	Wed Mar 22 05:00:59 2006 +0000
    14.3 @@ -39,59 +39,40 @@
    14.4  #endif
    14.5  
    14.6  /*
    14.7 - * Never reference Xlib directly...we might load it dynamically at runtime.
    14.8 - *  Even if we don't, for readability, we still use the function pointers
    14.9 - *  (although the symbol resolution will be done by the loader in that case).
   14.10 + * When using the "dynamic X11" functionality, we duplicate all the Xlib
   14.11 + *  symbols that would be referenced by SDL inside of SDL itself.
   14.12 + *  These duplicated symbols just serve as passthroughs to the functions
   14.13 + *  in Xlib, that was dynamically loaded.
   14.14   *
   14.15 - * We define SDL_X11_SYM and include SDL_x11sym.h to accomplish various
   14.16 - *  goals, without having to duplicate those function signatures.
   14.17 + * This allows us to use Xlib as-is when linking against it directly, but
   14.18 + *  also handles all the strange cases where there was code in the Xlib
   14.19 + *  headers that may or may not exist or vary on a given platform.
   14.20   */
   14.21  #ifdef __cplusplus
   14.22  extern "C" {
   14.23  #endif
   14.24  
   14.25 -#ifdef __osf__
   14.26 -extern int _XData32(Display *,register long *,unsigned);
   14.27 -extern void _XRead32(Display *,register long *,long);
   14.28 -extern void _SmtBufferOverflow(Display *,register smtDisplayPtr);
   14.29 -extern void _SmtIpError(Display *,register smtDisplayPtr, int);
   14.30 -extern int ipAllocateData(ChannelPtr, IPCard, IPDataPtr *);
   14.31 -extern int ipUnallocateAndSendData(ChannelPtr, IPCard);
   14.32 -#endif
   14.33 -
   14.34  /* evil function signatures... */
   14.35  typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
   14.36  typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
   14.37  typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
   14.38  typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
   14.39  
   14.40 -#define SDL_X11_SYM(req,ret,fn,params) extern ret (*p##fn) params;
   14.41 +int SDL_X11_LoadSymbols(void);
   14.42 +void SDL_X11_UnloadSymbols(void);
   14.43 +
   14.44 +/* That's really annoying...make this a function pointer no matter what. */
   14.45 +#ifdef X_HAVE_UTF8_STRING
   14.46 +extern XIC (*pXCreateIC)(XIM,...);
   14.47 +#endif
   14.48 +
   14.49 +/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
   14.50 +#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
   14.51 +#define SDL_X11_SYM(rc,fn,params,args,ret)
   14.52  #include "SDL_x11sym.h"
   14.53 +#undef SDL_X11_MODULE
   14.54  #undef SDL_X11_SYM
   14.55  
   14.56 -/* Macro in the xlib headers, not an actual symbol... */
   14.57 -#define pXDestroyImage XDestroyImage
   14.58 -
   14.59 -/* Workaround code in headers... */
   14.60 -#if !__SDL_NO_REDEFINE_X11_HEADER_SYMS
   14.61 -#define _XFlush p_XFlush
   14.62 -#define _XFlushGCCache p_XFlushGCCache
   14.63 -#define _XReply p_XReply
   14.64 -#define _XSend p_XSend
   14.65 -#define XFree pXFree
   14.66 -#define _XData32 p_XData32
   14.67 -
   14.68 -#if defined(__osf__)
   14.69 -#define _SmtBufferOverflow p_SmtBufferOverflow
   14.70 -#define _SmtIpError p_SmtIpError
   14.71 -#define ipAllocateData pipAllocateData
   14.72 -#define ipUnallocateAndSendData pipUnallocateAndSendData
   14.73 -#endif
   14.74 -
   14.75 -#endif /* !__SDL_NO_REDEFINE_X11_HEADER_SYMS */
   14.76 -
   14.77 -int SDL_X11_LoadSymbols(void);
   14.78 -void SDL_X11_UnloadSymbols(void);
   14.79  
   14.80  #ifdef __cplusplus
   14.81  }
    15.1 --- a/src/video/x11/SDL_x11events.c	Wed Mar 22 04:51:44 2006 +0000
    15.2 +++ b/src/video/x11/SDL_x11events.c	Wed Mar 22 05:00:59 2006 +0000
    15.3 @@ -187,13 +187,13 @@
    15.4  	int repeated;
    15.5  
    15.6  	repeated = 0;
    15.7 -	if ( pXPending(display) ) {
    15.8 -		pXPeekEvent(display, &peekevent);
    15.9 +	if ( XPending(display) ) {
   15.10 +		XPeekEvent(display, &peekevent);
   15.11  		if ( (peekevent.type == KeyPress) &&
   15.12  		     (peekevent.xkey.keycode == event->xkey.keycode) &&
   15.13  		     ((peekevent.xkey.time-event->xkey.time) < 2) ) {
   15.14  			repeated = 1;
   15.15 -			pXNextEvent(display, &peekevent);
   15.16 +			XNextEvent(display, &peekevent);
   15.17  		}
   15.18  	}
   15.19  	return(repeated);
   15.20 @@ -228,7 +228,7 @@
   15.21  	     (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) ||
   15.22  	     (xevent->xmotion.y > (h-MOUSE_FUDGE_FACTOR)) ) {
   15.23  		/* Get the events that have accumulated */
   15.24 -		while ( pXCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
   15.25 +		while ( XCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
   15.26  			deltax = xevent->xmotion.x - mouse_last.x;
   15.27  			deltay = xevent->xmotion.y - mouse_last.y;
   15.28  #ifdef DEBUG_MOTION
   15.29 @@ -240,10 +240,10 @@
   15.30  		}
   15.31  		mouse_last.x = w/2;
   15.32  		mouse_last.y = h/2;
   15.33 -		pXWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
   15.34 +		XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
   15.35  					mouse_last.x, mouse_last.y);
   15.36  		for ( i=0; i<10; ++i ) {
   15.37 -        		pXMaskEvent(SDL_Display, PointerMotionMask, xevent);
   15.38 +        		XMaskEvent(SDL_Display, PointerMotionMask, xevent);
   15.39  			if ( (xevent->xmotion.x >
   15.40  			          (mouse_last.x-MOUSE_FUDGE_FACTOR)) &&
   15.41  			     (xevent->xmotion.x <
   15.42 @@ -273,7 +273,7 @@
   15.43  	XEvent xevent;
   15.44  
   15.45  	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
   15.46 -	pXNextEvent(SDL_Display, &xevent);
   15.47 +	XNextEvent(SDL_Display, &xevent);
   15.48  
   15.49  	posted = 0;
   15.50  	switch (xevent.type) {
   15.51 @@ -332,7 +332,7 @@
   15.52  
   15.53  #ifdef X_HAVE_UTF8_STRING
   15.54  		if ( SDL_IC != NULL ) {
   15.55 -			pXSetICFocus(SDL_IC);
   15.56 +			XSetICFocus(SDL_IC);
   15.57  		}
   15.58  #endif
   15.59  		/* Queue entry into fullscreen mode */
   15.60 @@ -350,7 +350,7 @@
   15.61  
   15.62  #ifdef X_HAVE_UTF8_STRING
   15.63  		if ( SDL_IC != NULL ) {
   15.64 -			pXUnsetICFocus(SDL_IC);
   15.65 +			XUnsetICFocus(SDL_IC);
   15.66  		}
   15.67  #endif
   15.68  		/* Queue leaving fullscreen mode */
   15.69 @@ -433,7 +433,7 @@
   15.70  			break;
   15.71  		}
   15.72  
   15.73 -		if ( pXFilterEvent(&xevent, None) ) {
   15.74 +		if ( XFilterEvent(&xevent, None) ) {
   15.75  			if ( xevent.xkey.keycode ) {
   15.76  				posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
   15.77  			} else {
   15.78 @@ -450,7 +450,7 @@
   15.79  			static Status state;
   15.80  			/* A UTF-8 character can be at most 6 bytes */
   15.81  			char keybuf[6];
   15.82 -			if ( pXutf8LookupString(SDL_IC, &xevent.xkey,
   15.83 +			if ( Xutf8LookupString(SDL_IC, &xevent.xkey,
   15.84  			                        keybuf, sizeof(keybuf),
   15.85  			                        NULL, &state) ) {
   15.86  				keysym.unicode = Utf8ToUcs4((Uint8*)keybuf);
   15.87 @@ -462,7 +462,7 @@
   15.88  			static XComposeStatus state;
   15.89  			char keybuf[32];
   15.90  
   15.91 -			if ( pXLookupString(&xevent.xkey,
   15.92 +			if ( XLookupString(&xevent.xkey,
   15.93  			                    keybuf, sizeof(keybuf),
   15.94  			                    NULL, &state) ) {
   15.95  				/*
   15.96 @@ -622,8 +622,8 @@
   15.97  int X11_Pending(Display *display)
   15.98  {
   15.99  	/* Flush the display connection and look to see if events are queued */
  15.100 -	pXFlush(display);
  15.101 -	if ( pXEventsQueued(display, QueuedAlready) ) {
  15.102 +	XFlush(display);
  15.103 +	if ( XEventsQueued(display, QueuedAlready) ) {
  15.104  		return(1);
  15.105  	}
  15.106  
  15.107 @@ -637,7 +637,7 @@
  15.108  		FD_ZERO(&fdset);
  15.109  		FD_SET(x11_fd, &fdset);
  15.110  		if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
  15.111 -			return(pXPending(display));
  15.112 +			return(XPending(display));
  15.113  		}
  15.114  	}
  15.115  
  15.116 @@ -827,7 +827,7 @@
  15.117  	KeySym xsym;
  15.118  	SDLKey key;
  15.119  
  15.120 -	xsym = pXKeycodeToKeysym(display, kc, 0);
  15.121 +	xsym = XKeycodeToKeysym(display, kc, 0);
  15.122  #ifdef DEBUG_KEYS
  15.123  	fprintf(stderr, "Translating key code %d -> 0x%.4x\n", kc, xsym);
  15.124  #endif
  15.125 @@ -914,12 +914,12 @@
  15.126  	if(got_masks)
  15.127  		return;
  15.128  
  15.129 -	xmods = pXGetModifierMapping(display);
  15.130 +	xmods = XGetModifierMapping(display);
  15.131  	n = xmods->max_keypermod;
  15.132  	for(i = 3; i < 8; i++) {
  15.133  		for(j = 0; j < n; j++) {
  15.134  			KeyCode kc = xmods->modifiermap[i * n + j];
  15.135 -			KeySym ks = pXKeycodeToKeysym(display, kc, 0);
  15.136 +			KeySym ks = XKeycodeToKeysym(display, kc, 0);
  15.137  			unsigned mask = 1 << i;
  15.138  			switch(ks) {
  15.139  			case XK_Num_Lock:
  15.140 @@ -937,7 +937,7 @@
  15.141  			}
  15.142  		}
  15.143  	}
  15.144 -	pXFreeModifiermap(xmods);
  15.145 +	XFreeModifiermap(xmods);
  15.146  	got_masks = 1;
  15.147  }
  15.148  
  15.149 @@ -979,7 +979,7 @@
  15.150  		}
  15.151  	}
  15.152  
  15.153 -	xkey.keycode = pXKeysymToKeycode(xkey.display, xsym);
  15.154 +	xkey.keycode = XKeysymToKeycode(xkey.display, xsym);
  15.155  
  15.156  	get_modifier_masks(SDL_Display);
  15.157  	if(modifiers & KMOD_SHIFT)
  15.158 @@ -1002,7 +1002,7 @@
  15.159  		xkey.state |= num_mask;
  15.160  
  15.161  	unicode = 0;
  15.162 -	if ( pXLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
  15.163 +	if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
  15.164  		unicode = (unsigned char)keybuf[0];
  15.165  	return(unicode);
  15.166  }
  15.167 @@ -1025,14 +1025,14 @@
  15.168  
  15.169  	/* The first time the window is mapped, we initialize key state */
  15.170  	if ( ! key_vec ) {
  15.171 -		pXQueryKeymap(display, keys_return);
  15.172 +		XQueryKeymap(display, keys_return);
  15.173  		key_vec = keys_return;
  15.174  	}
  15.175  
  15.176  	/* Get the keyboard modifier state */
  15.177  	modstate = 0;
  15.178  	get_modifier_masks(display);
  15.179 -	if ( pXQueryPointer(display, DefaultRootWindow(display),
  15.180 +	if ( XQueryPointer(display, DefaultRootWindow(display),
  15.181  		&junk_window, &junk_window, &x, &y, &x, &y, &mask) ) {
  15.182  		if ( mask & LockMask ) {
  15.183  			modstate |= KMOD_CAPS;
    16.1 --- a/src/video/x11/SDL_x11gamma.c	Wed Mar 22 04:51:44 2006 +0000
    16.2 +++ b/src/video/x11/SDL_x11gamma.c	Wed Mar 22 05:00:59 2006 +0000
    16.3 @@ -64,7 +64,7 @@
    16.4  	}
    16.5          if ( SDL_GetAppState() & SDL_APPACTIVE ) {
    16.6              succeeded = SDL_NAME(XF86VidModeSetGamma)(SDL_Display, SDL_Screen, &gamma);
    16.7 -            pXSync(SDL_Display, False);
    16.8 +            XSync(SDL_Display, False);
    16.9          } else {
   16.10              gamma_saved[0] = gamma.red;
   16.11              gamma_saved[1] = gamma.green;
    17.1 --- a/src/video/x11/SDL_x11gl.c	Wed Mar 22 04:51:44 2006 +0000
    17.2 +++ b/src/video/x11/SDL_x11gl.c	Wed Mar 22 05:00:59 2006 +0000
    17.3 @@ -64,10 +64,10 @@
    17.4  		XVisualInfo vi_in;
    17.5  		int out_count;
    17.6  
    17.7 -		pXGetWindowAttributes(SDL_Display, SDL_Window, &a);
    17.8 +		XGetWindowAttributes(SDL_Display, SDL_Window, &a);
    17.9  		vi_in.screen = SDL_Screen;
   17.10 -		vi_in.visualid = pXVisualIDFromVisual(a.visual);
   17.11 -		glx_visualinfo = pXGetVisualInfo(SDL_Display,
   17.12 +		vi_in.visualid = XVisualIDFromVisual(a.visual);
   17.13 +		glx_visualinfo = XGetVisualInfo(SDL_Display,
   17.14  	                     VisualScreenMask|VisualIDMask, &vi_in, &out_count);
   17.15  		return glx_visualinfo;
   17.16  	}
   17.17 @@ -186,7 +186,7 @@
   17.18  	attributes.colormap = SDL_XColorMap;
   17.19  	mask = CWBackPixel | CWBorderPixel | CWColormap;
   17.20  
   17.21 -	SDL_Window = pXCreateWindow(SDL_Display, WMwindow,
   17.22 +	SDL_Window = XCreateWindow(SDL_Display, WMwindow,
   17.23  			0, 0, w, h, 0, glx_visualinfo->depth,
   17.24  			InputOutput, glx_visualinfo->visual,
   17.25  			mask, &attributes);
   17.26 @@ -207,10 +207,10 @@
   17.27  	int retval;
   17.28  #if SDL_VIDEO_OPENGL_GLX
   17.29  	/* We do this to create a clean separation between X and GLX errors. */
   17.30 -	pXSync( SDL_Display, False );
   17.31 +	XSync( SDL_Display, False );
   17.32  	glx_context = this->gl_data->glXCreateContext(GFX_Display, 
   17.33  				     glx_visualinfo, NULL, True);
   17.34 -	pXSync( GFX_Display, False );
   17.35 +	XSync( GFX_Display, False );
   17.36  
   17.37  	if (glx_context == NULL) {
   17.38  		SDL_SetError("Could not create GL context");
   17.39 @@ -258,7 +258,7 @@
   17.40  		SDL_SetError("Unable to make GL context current");
   17.41  		retval = -1;
   17.42  	}
   17.43 -	pXSync( GFX_Display, False );
   17.44 +	XSync( GFX_Display, False );
   17.45  
   17.46  	/* More Voodoo X server workarounds... Grr... */
   17.47  	SDL_Lock_EventThread();
    18.1 --- a/src/video/x11/SDL_x11image.c	Wed Mar 22 04:51:44 2006 +0000
    18.2 +++ b/src/video/x11/SDL_x11image.c	Wed Mar 22 05:00:59 2006 +0000
    18.3 @@ -44,6 +44,10 @@
    18.4  
    18.5  static void try_mitshm(_THIS, SDL_Surface *screen)
    18.6  {
    18.7 +	/* Dynamic X11 may not have SHM entry points on this box. */
    18.8 +	if ((use_mitshm) && (!SDL_X11_HAVE_SHM))
    18.9 +		use_mitshm = 0;
   18.10 +
   18.11  	if(!use_mitshm)
   18.12  		return;
   18.13  	shminfo.shmid = shmget(IPC_PRIVATE, screen->h*screen->pitch,
   18.14 @@ -53,10 +57,10 @@
   18.15  		shminfo.readOnly = False;
   18.16  		if ( shminfo.shmaddr != (char *)-1 ) {
   18.17  			shm_error = False;
   18.18 -			X_handler = pXSetErrorHandler(shm_errhandler);
   18.19 -			pXShmAttach(SDL_Display, &shminfo);
   18.20 -			pXSync(SDL_Display, True);
   18.21 -			pXSetErrorHandler(X_handler);
   18.22 +			X_handler = XSetErrorHandler(shm_errhandler);
   18.23 +			XShmAttach(SDL_Display, &shminfo);
   18.24 +			XSync(SDL_Display, True);
   18.25 +			XSetErrorHandler(X_handler);
   18.26  			if ( shm_error )
   18.27  				shmdt(shminfo.shmaddr);
   18.28  		} else {
   18.29 @@ -82,13 +86,13 @@
   18.30  #ifndef NO_SHARED_MEMORY
   18.31  	try_mitshm(this, screen);
   18.32  	if(use_mitshm) {
   18.33 -		SDL_Ximage = pXShmCreateImage(SDL_Display, SDL_Visual,
   18.34 +		SDL_Ximage = XShmCreateImage(SDL_Display, SDL_Visual,
   18.35  					     this->hidden->depth, ZPixmap,
   18.36  					     shminfo.shmaddr, &shminfo, 
   18.37  					     screen->w, screen->h);
   18.38  		if(!SDL_Ximage) {
   18.39 -			pXShmDetach(SDL_Display, &shminfo);
   18.40 -			pXSync(SDL_Display, False);
   18.41 +			XShmDetach(SDL_Display, &shminfo);
   18.42 +			XSync(SDL_Display, False);
   18.43  			shmdt(shminfo.shmaddr);
   18.44  			screen->pixels = NULL;
   18.45  			goto error;
   18.46 @@ -105,7 +109,7 @@
   18.47  			return -1;
   18.48  		}
   18.49   	        bpp = screen->format->BytesPerPixel;
   18.50 -		SDL_Ximage = pXCreateImage(SDL_Display, SDL_Visual,
   18.51 +		SDL_Ximage = XCreateImage(SDL_Display, SDL_Visual,
   18.52  					  this->hidden->depth, ZPixmap, 0,
   18.53  					  (char *)screen->pixels, 
   18.54  					  screen->w, screen->h,
   18.55 @@ -128,11 +132,11 @@
   18.56  void X11_DestroyImage(_THIS, SDL_Surface *screen)
   18.57  {
   18.58  	if ( SDL_Ximage ) {
   18.59 -		pXDestroyImage(SDL_Ximage);
   18.60 +		XDestroyImage(SDL_Ximage);
   18.61  #ifndef NO_SHARED_MEMORY
   18.62  		if ( use_mitshm ) {
   18.63 -			pXShmDetach(SDL_Display, &shminfo);
   18.64 -			pXSync(SDL_Display, False);
   18.65 +			XShmDetach(SDL_Display, &shminfo);
   18.66 +			XSync(SDL_Display, False);
   18.67  			shmdt(shminfo.shmaddr);
   18.68  		}
   18.69  #endif /* ! NO_SHARED_MEMORY */
   18.70 @@ -213,7 +217,7 @@
   18.71  int X11_LockHWSurface(_THIS, SDL_Surface *surface)
   18.72  {
   18.73  	if ( (surface == SDL_VideoSurface) && blit_queued ) {
   18.74 -		pXSync(GFX_Display, False);
   18.75 +		XSync(GFX_Display, False);
   18.76  		blit_queued = 0;
   18.77  	}
   18.78  	return(0);
   18.79 @@ -236,15 +240,15 @@
   18.80  		if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
   18.81  			continue;
   18.82  		}
   18.83 -		pXPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
   18.84 +		XPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
   18.85  			  rects[i].x, rects[i].y,
   18.86  			  rects[i].x, rects[i].y, rects[i].w, rects[i].h);
   18.87  	}
   18.88  	if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
   18.89 -		pXFlush(GFX_Display);
   18.90 +		XFlush(GFX_Display);
   18.91  		blit_queued = 1;
   18.92  	} else {
   18.93 -		pXSync(GFX_Display, False);
   18.94 +		XSync(GFX_Display, False);
   18.95  	}
   18.96  }
   18.97  
   18.98 @@ -257,16 +261,16 @@
   18.99  		if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
  18.100  			continue;
  18.101  		}
  18.102 -		pXShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.103 +		XShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.104  				rects[i].x, rects[i].y,
  18.105  				rects[i].x, rects[i].y, rects[i].w, rects[i].h,
  18.106  									False);
  18.107  	}
  18.108  	if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
  18.109 -		pXFlush(GFX_Display);
  18.110 +		XFlush(GFX_Display);
  18.111  		blit_queued = 1;
  18.112  	} else {
  18.113 -		pXSync(GFX_Display, False);
  18.114 +		XSync(GFX_Display, False);
  18.115  	}
  18.116  #endif /* ! NO_SHARED_MEMORY */
  18.117  }
  18.118 @@ -300,14 +304,15 @@
  18.119  	}
  18.120  #ifndef NO_SHARED_MEMORY
  18.121  	if ( this->UpdateRects == X11_MITSHMUpdate ) {
  18.122 -		pXShmPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.123 +		XShmPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.124  				0, 0, 0, 0, this->screen->w, this->screen->h,
  18.125  				False);
  18.126  	} else
  18.127  #endif /* ! NO_SHARED_MEMORY */
  18.128  	{
  18.129 -		pXPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.130 +		XPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
  18.131  			  0, 0, 0, 0, this->screen->w, this->screen->h);
  18.132  	}
  18.133 -	pXSync(SDL_Display, False);
  18.134 +	XSync(SDL_Display, False);
  18.135  }
  18.136 +
    19.1 --- a/src/video/x11/SDL_x11modes.c	Wed Mar 22 04:51:44 2006 +0000
    19.2 +++ b/src/video/x11/SDL_x11modes.c	Wed Mar 22 05:00:59 2006 +0000
    19.3 @@ -135,7 +135,7 @@
    19.4                   (modes[i]->vdisplay != mode.vdisplay) ) {
    19.5                  SDL_NAME(XF86VidModeSwitchToMode)(SDL_Display, SDL_Screen, modes[i]);
    19.6              }
    19.7 -            pXFree(modes);
    19.8 +            XFree(modes);
    19.9          }
   19.10      }
   19.11  #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
   19.12 @@ -174,7 +174,7 @@
   19.13                                          SDL_modelist[i]->w, 
   19.14                                          SDL_modelist[i]->h, 
   19.15                                          0);
   19.16 -                pXSync(SDL_Display, False);
   19.17 +                XSync(SDL_Display, False);
   19.18              }
   19.19          }
   19.20      }
   19.21 @@ -224,7 +224,7 @@
   19.22  {
   19.23      XEvent event;
   19.24      do {
   19.25 -        pXMaskEvent(SDL_Display, StructureNotifyMask, &event);
   19.26 +        XMaskEvent(SDL_Display, StructureNotifyMask, &event);
   19.27      } while ( (event.type != MapNotify) || (event.xmap.event != win) );
   19.28  }
   19.29  
   19.30 @@ -233,19 +233,19 @@
   19.31  {
   19.32      XEvent event;
   19.33      do {
   19.34 -        pXMaskEvent(SDL_Display, StructureNotifyMask, &event);
   19.35 +        XMaskEvent(SDL_Display, StructureNotifyMask, &event);
   19.36      } while ( (event.type != UnmapNotify) || (event.xunmap.event != win) );
   19.37  }
   19.38  
   19.39  static void move_cursor_to(_THIS, int x, int y)
   19.40  {
   19.41 -    pXWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
   19.42 +    XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
   19.43  }
   19.44  
   19.45  static int add_visual(_THIS, int depth, int class)
   19.46  {
   19.47      XVisualInfo vi;
   19.48 -    if(pXMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
   19.49 +    if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
   19.50          int n = this->hidden->nvisuals;
   19.51          this->hidden->visuals[n].depth = vi.depth;
   19.52          this->hidden->visuals[n].visual = vi.visual;
   19.53 @@ -261,13 +261,13 @@
   19.54      if ( visual_id ) {
   19.55          SDL_memset(&template, 0, (sizeof template));
   19.56          template.visualid = SDL_strtol(visual_id, NULL, 0);
   19.57 -        vi = pXGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis);
   19.58 +        vi = XGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis);
   19.59          if ( vi ) {
   19.60              int n = this->hidden->nvisuals;
   19.61              this->hidden->visuals[n].depth = vi->depth;
   19.62              this->hidden->visuals[n].visual = vi->visual;
   19.63              this->hidden->nvisuals++;
   19.64 -            pXFree(vi);
   19.65 +            XFree(vi);
   19.66          }
   19.67      }
   19.68      return(this->hidden->nvisuals);
   19.69 @@ -403,7 +403,7 @@
   19.70              }
   19.71              SDL_modelist[n] = NULL;
   19.72          }
   19.73 -        pXFree(modes);
   19.74 +        XFree(modes);
   19.75  
   19.76          use_vidmode = vm_major * 100 + vm_minor;
   19.77          save_mode(this);
   19.78 @@ -477,7 +477,7 @@
   19.79          use_xme = 0;
   19.80      }
   19.81      if ( modelist ) {
   19.82 -        pXFree(modelist);
   19.83 +        XFree(modelist);
   19.84      }
   19.85  #endif /* SDL_VIDEO_DRIVER_X11_XME */
   19.86  
   19.87 @@ -512,7 +512,7 @@
   19.88          }
   19.89              
   19.90          /* look up the pixel quantum for each depth */
   19.91 -        pf = pXListPixmapFormats(SDL_Display, &np);
   19.92 +        pf = XListPixmapFormats(SDL_Display, &np);
   19.93          for(i = 0; i < this->hidden->nvisuals; i++) {
   19.94              int d = this->hidden->visuals[i].depth;
   19.95              for(j = 0; j < np; j++)
   19.96 @@ -521,7 +521,7 @@
   19.97              this->hidden->visuals[i].bpp = j < np ? pf[j].bits_per_pixel : d;
   19.98          }
   19.99  
  19.100 -        pXFree(pf);
  19.101 +        XFree(pf);
  19.102      }
  19.103  
  19.104      if ( SDL_modelist == NULL ) {
  19.105 @@ -595,7 +595,7 @@
  19.106                  xinerama_y = xinerama[i].y_org;
  19.107              }
  19.108          }
  19.109 -        pXFree(xinerama);
  19.110 +        XFree(xinerama);
  19.111      }
  19.112  #endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
  19.113  
  19.114 @@ -661,15 +661,15 @@
  19.115          if ( window_h > real_h ) {
  19.116              real_h = MAX(real_h, screen_h);
  19.117          }
  19.118 -        pXMoveResizeWindow(SDL_Display, FSwindow, x, y, real_w, real_h);
  19.119 +        XMoveResizeWindow(SDL_Display, FSwindow, x, y, real_w, real_h);
  19.120          move_cursor_to(this, real_w/2, real_h/2);
  19.121  
  19.122          /* Center and reparent the drawing window */
  19.123          x = (real_w - window_w)/2;
  19.124          y = (real_h - window_h)/2;
  19.125 -        pXReparentWindow(SDL_Display, SDL_Window, FSwindow, x, y);
  19.126 +        XReparentWindow(SDL_Display, SDL_Window, FSwindow, x, y);
  19.127          /* FIXME: move the mouse to the old relative location */
  19.128 -        pXSync(SDL_Display, True);   /* Flush spurious mode change events */
  19.129 +        XSync(SDL_Display, True);   /* Flush spurious mode change events */
  19.130      }
  19.131      return(1);
  19.132  }
  19.133 @@ -679,7 +679,7 @@
  19.134      switch_waiting = 0x01 | SDL_FULLSCREEN;
  19.135      switch_time = SDL_GetTicks() + 1500;
  19.136  #if 0 /* This causes a BadMatch error if the window is iconified (not needed) */
  19.137 -    pXSetInputFocus(SDL_Display, WMwindow, RevertToNone, CurrentTime);
  19.138 +    XSetInputFocus(SDL_Display, WMwindow, RevertToNone, CurrentTime);
  19.139  #endif
  19.140  }
  19.141  
  19.142 @@ -712,14 +712,14 @@
  19.143      if ( window_h > real_h ) {
  19.144          real_h = MAX(real_h, screen_h);
  19.145      }
  19.146 -    pXMoveResizeWindow(SDL_Display, FSwindow,
  19.147 +    XMoveResizeWindow(SDL_Display, FSwindow,
  19.148                        xinerama_x, xinerama_y, real_w, real_h);
  19.149 -    pXMapRaised(SDL_Display, FSwindow);
  19.150 +    XMapRaised(SDL_Display, FSwindow);
  19.151      X11_WaitMapped(this, FSwindow);
  19.152  
  19.153  #if 0 /* This seems to break WindowMaker in focus-follows-mouse mode */
  19.154      /* Make sure we got to the top of the window stack */
  19.155 -    if ( pXQueryTree(SDL_Display, SDL_Root, &tmpwin, &tmpwin,
  19.156 +    if ( XQueryTree(SDL_Display, SDL_Root, &tmpwin, &tmpwin,
  19.157                              &windows, &nwindows) && windows ) {
  19.158          /* If not, try to put us there - if fail... oh well */
  19.159          if ( windows[nwindows-1] != FSwindow ) {
  19.160 @@ -732,13 +732,13 @@
  19.161                  }
  19.162              }
  19.163              windows[nwindows-1] = FSwindow;
  19.164 -            pXRestackWindows(SDL_Display, windows, nwindows);
  19.165 -            pXSync(SDL_Display, False);
  19.166 +            XRestackWindows(SDL_Display, windows, nwindows);
  19.167 +            XSync(SDL_Display, False);
  19.168          }
  19.169 -        pXFree(windows);
  19.170 +        XFree(windows);
  19.171      }
  19.172  #else
  19.173 -    pXRaiseWindow(SDL_Display, FSwindow);
  19.174 +    XRaiseWindow(SDL_Display, FSwindow);
  19.175  #endif
  19.176  
  19.177  #if SDL_VIDEO_DRIVER_X11_VIDMODE
  19.178 @@ -756,7 +756,7 @@
  19.179      }
  19.180      /* Set the colormap */
  19.181      if ( SDL_XColorMap ) {
  19.182 -        pXInstallColormap(SDL_Display, SDL_XColorMap);
  19.183 +        XInstallColormap(SDL_Display, SDL_XColorMap);
  19.184      }
  19.185      if ( okay )
  19.186          X11_GrabInputNoLock(this, this->input_grab | SDL_GRAB_FULLSCREEN);
  19.187 @@ -777,7 +777,7 @@
  19.188  int X11_LeaveFullScreen(_THIS)
  19.189  {
  19.190      if ( currently_fullscreen ) {
  19.191 -        pXReparentWindow(SDL_Display, SDL_Window, WMwindow, 0, 0);
  19.192 +        XReparentWindow(SDL_Display, SDL_Window, WMwindow, 0, 0);
  19.193  #if SDL_VIDEO_DRIVER_X11_VIDMODE
  19.194          if ( use_vidmode ) {
  19.195              restore_mode(this);
  19.196 @@ -799,14 +799,14 @@
  19.197                                          saved_res.width, 
  19.198                                          saved_res.height,
  19.199                                          0);
  19.200 -                pXSync(SDL_Display, False);
  19.201 +                XSync(SDL_Display, False);
  19.202              }
  19.203          }
  19.204  #endif
  19.205  
  19.206 -        pXUnmapWindow(SDL_Display, FSwindow);
  19.207 +        XUnmapWindow(SDL_Display, FSwindow);
  19.208          X11_WaitUnmapped(this, FSwindow);
  19.209 -        pXSync(SDL_Display, True);   /* Flush spurious mode change events */
  19.210 +        XSync(SDL_Display, True);   /* Flush spurious mode change events */
  19.211          currently_fullscreen = 0;
  19.212      }
  19.213      /* If we get popped out of fullscreen mode for some reason, input_grab
    20.1 --- a/src/video/x11/SDL_x11mouse.c	Wed Mar 22 04:51:44 2006 +0000
    20.2 +++ b/src/video/x11/SDL_x11mouse.c	Wed Mar 22 05:00:59 2006 +0000
    20.3 @@ -41,8 +41,8 @@
    20.4  {
    20.5  	if ( SDL_Display != NULL ) {
    20.6  		SDL_Lock_EventThread();
    20.7 -		pXFreeCursor(SDL_Display, cursor->x_cursor);
    20.8 -		pXSync(SDL_Display, False);
    20.9 +		XFreeCursor(SDL_Display, cursor->x_cursor);
   20.10 +		XSync(SDL_Display, False);
   20.11  		SDL_Unlock_EventThread();
   20.12  	}
   20.13  	SDL_free(cursor);
   20.14 @@ -96,48 +96,48 @@
   20.15  	SDL_Lock_EventThread();
   20.16  
   20.17  	/* Create the data image */
   20.18 -	data_image = pXCreateImage(SDL_Display, 
   20.19 +	data_image = XCreateImage(SDL_Display, 
   20.20  			DefaultVisual(SDL_Display, SDL_Screen),
   20.21  					1, XYBitmap, 0, x_data, w, h, 8, w/8);
   20.22  	data_image->byte_order = MSBFirst;
   20.23  	data_image->bitmap_bit_order = MSBFirst;
   20.24 -	data_pixmap = pXCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
   20.25 +	data_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
   20.26  
   20.27  	/* Create the data mask */
   20.28 -	mask_image = pXCreateImage(SDL_Display, 
   20.29 +	mask_image = XCreateImage(SDL_Display, 
   20.30  			DefaultVisual(SDL_Display, SDL_Screen),
   20.31  					1, XYBitmap, 0, x_mask, w, h, 8, w/8);
   20.32  	mask_image->byte_order = MSBFirst;
   20.33  	mask_image->bitmap_bit_order = MSBFirst;
   20.34 -	mask_pixmap = pXCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
   20.35 +	mask_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
   20.36  
   20.37  	/* Create the graphics context */
   20.38  	GCvalues.function = GXcopy;
   20.39  	GCvalues.foreground = ~0;
   20.40  	GCvalues.background =  0;
   20.41  	GCvalues.plane_mask = AllPlanes;
   20.42 -	GCcursor = pXCreateGC(SDL_Display, data_pixmap,
   20.43 +	GCcursor = XCreateGC(SDL_Display, data_pixmap,
   20.44  			(GCFunction|GCForeground|GCBackground|GCPlaneMask),
   20.45  								&GCvalues);
   20.46  
   20.47  	/* Blit the images to the pixmaps */
   20.48 -	pXPutImage(SDL_Display, data_pixmap, GCcursor, data_image,
   20.49 +	XPutImage(SDL_Display, data_pixmap, GCcursor, data_image,
   20.50  							0, 0, 0, 0, w, h);
   20.51 -	pXPutImage(SDL_Display, mask_pixmap, GCcursor, mask_image,
   20.52 +	XPutImage(SDL_Display, mask_pixmap, GCcursor, mask_image,
   20.53  							0, 0, 0, 0, w, h);
   20.54 -	pXFreeGC(SDL_Display, GCcursor);
   20.55 +	XFreeGC(SDL_Display, GCcursor);
   20.56  	/* These free the x_data and x_mask memory pointers */
   20.57 -	pXDestroyImage(data_image);
   20.58 -	pXDestroyImage(mask_image);
   20.59 +	XDestroyImage(data_image);
   20.60 +	XDestroyImage(mask_image);
   20.61  
   20.62  	/* Create the cursor */
   20.63 -	cursor->x_cursor = pXCreatePixmapCursor(SDL_Display, data_pixmap,
   20.64 +	cursor->x_cursor = XCreatePixmapCursor(SDL_Display, data_pixmap,
   20.65  				mask_pixmap, &black, &white, hot_x, hot_y);
   20.66 -	pXFreePixmap(SDL_Display, data_pixmap);
   20.67 -	pXFreePixmap(SDL_Display, mask_pixmap);
   20.68 +	XFreePixmap(SDL_Display, data_pixmap);
   20.69 +	XFreePixmap(SDL_Display, mask_pixmap);
   20.70  
   20.71  	/* Release the event thread */
   20.72 -	pXSync(SDL_Display, False);
   20.73 +	XSync(SDL_Display, False);
   20.74  	SDL_Unlock_EventThread();
   20.75  
   20.76  	return(cursor);
   20.77 @@ -155,13 +155,13 @@
   20.78  		SDL_Lock_EventThread();
   20.79  		if ( cursor == NULL ) {
   20.80  			if ( SDL_BlankCursor != NULL ) {
   20.81 -				pXDefineCursor(SDL_Display, SDL_Window,
   20.82 +				XDefineCursor(SDL_Display, SDL_Window,
   20.83  					SDL_BlankCursor->x_cursor);
   20.84  			}
   20.85  		} else {
   20.86 -			pXDefineCursor(SDL_Display, SDL_Window, cursor->x_cursor);
   20.87 +			XDefineCursor(SDL_Display, SDL_Window, cursor->x_cursor);
   20.88  		}
   20.89 -		pXSync(SDL_Display, False);
   20.90 +		XSync(SDL_Display, False);
   20.91  		SDL_Unlock_EventThread();
   20.92  	}
   20.93  	return(1);
   20.94 @@ -178,8 +178,8 @@
   20.95  		SDL_PrivateMouseMotion(0, 0, x, y);
   20.96  	} else {
   20.97  		SDL_Lock_EventThread();
   20.98 -		pXWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
   20.99 -		pXSync(SDL_Display, False);
  20.100 +		XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
  20.101 +		XSync(SDL_Display, False);
  20.102  		SDL_Unlock_EventThread();
  20.103  	}
  20.104  }
  20.105 @@ -217,7 +217,7 @@
  20.106  		}
  20.107  	}
  20.108  	if ( mouse_param_buf ) {
  20.109 -		pXChangePointerControl(SDL_Display, True, True,
  20.110 +		XChangePointerControl(SDL_Display, True, True,
  20.111  			accel_value[0], accel_value[1], accel_value[2]);
  20.112  		SDL_free(mouse_param_buf);
  20.113  	}
  20.114 @@ -250,7 +250,7 @@
  20.115  
  20.116  				SDL_GetMouseState(&mouse_last.x, &mouse_last.y);
  20.117  				/* Use as raw mouse mickeys as possible */
  20.118 -				pXGetPointerControl(SDL_Display,
  20.119 +				XGetPointerControl(SDL_Display,
  20.120  						&mouse_accel.numerator, 
  20.121  						&mouse_accel.denominator,
  20.122  						&mouse_accel.threshold);
  20.123 @@ -266,7 +266,7 @@
  20.124  			if ( using_dga & DGA_MOUSE ) {
  20.125  				X11_DisableDGAMouse(this);
  20.126  			} else {
  20.127 -				pXChangePointerControl(SDL_Display, True, True,
  20.128 +				XChangePointerControl(SDL_Display, True, True,
  20.129  						mouse_accel.numerator, 
  20.130  						mouse_accel.denominator,
  20.131  						mouse_accel.threshold);
    21.1 --- a/src/video/x11/SDL_x11sym.h	Wed Mar 22 04:51:44 2006 +0000
    21.2 +++ b/src/video/x11/SDL_x11sym.h	Wed Mar 22 05:00:59 2006 +0000
    21.3 @@ -20,154 +20,159 @@
    21.4      slouken@libsdl.org
    21.5  */
    21.6  
    21.7 -SDL_X11_SYM(1,XClassHint*,XAllocClassHint,(void))
    21.8 -SDL_X11_SYM(1,Status,XAllocColor,(Display*,Colormap,XColor*))
    21.9 -SDL_X11_SYM(1,XSizeHints*,XAllocSizeHints,(void))
   21.10 -SDL_X11_SYM(1,XWMHints*,XAllocWMHints,(void))
   21.11 -SDL_X11_SYM(1,int,XChangePointerControl,(Display*,Bool,Bool,int,int,int))
   21.12 -SDL_X11_SYM(1,int,XChangeProperty,(Display*,Window,Atom,Atom,int,int,_Xconst unsigned char*,int))
   21.13 -SDL_X11_SYM(1,int,XChangeWindowAttributes,(Display*,Window,unsigned long,XSetWindowAttributes*))
   21.14 -SDL_X11_SYM(1,Bool,XCheckTypedEvent,(Display*,int,XEvent*))
   21.15 -SDL_X11_SYM(1,int,XClearWindow,(Display*,Window))
   21.16 -SDL_X11_SYM(1,int,XCloseDisplay,(Display*))
   21.17 -SDL_X11_SYM(1,Colormap,XCreateColormap,(Display*,Window,Visual*,int))
   21.18 -SDL_X11_SYM(1,Cursor,XCreatePixmapCursor,(Display*,Pixmap,Pixmap,XColor*,XColor*,unsigned int,unsigned int))
   21.19 -SDL_X11_SYM(1,GC,XCreateGC,(Display*,Drawable,unsigned long,XGCValues*))
   21.20 -SDL_X11_SYM(1,XImage*,XCreateImage,(Display*,Visual*,unsigned int,int,int,char*,unsigned int,unsigned int,int,int))
   21.21 -SDL_X11_SYM(1,Pixmap,XCreatePixmap,(Display*,Drawable,unsigned int,unsigned int,unsigned int))
   21.22 -SDL_X11_SYM(1,Pixmap,XCreatePixmapFromBitmapData,(Display*,Drawable,char*,unsigned int,unsigned int,unsigned long,unsigned long,unsigned int))
   21.23 -SDL_X11_SYM(1,Window,XCreateSimpleWindow,(Display*,Window,int,int,unsigned int,unsigned int,unsigned int,unsigned long,unsigned long))
   21.24 -SDL_X11_SYM(1,Window,XCreateWindow,(Display*,Window,int,int,unsigned int,unsigned int,unsigned int,int,unsigned int,Visual*,unsigned long,XSetWindowAttributes*))
   21.25 -SDL_X11_SYM(1,int,XDefineCursor,(Display*,Window,Cursor))
   21.26 -SDL_X11_SYM(1,int,XDeleteProperty,(Display*,Window,Atom))
   21.27 -SDL_X11_SYM(1,int,XDestroyWindow,(Display*,Window))
   21.28 -SDL_X11_SYM(1,char*,XDisplayName,(_Xconst char*))
   21.29 -SDL_X11_SYM(1,int,XEventsQueued,(Display*,int))
   21.30 -SDL_X11_SYM(1,Bool,XFilterEvent,(XEvent *event, Window w))
   21.31 -SDL_X11_SYM(1,int,XFlush,(Display*))
   21.32 -SDL_X11_SYM(1,int,XFree,(void*))
   21.33 -SDL_X11_SYM(1,int,XFreeColormap,(Display*,Colormap))
   21.34 -SDL_X11_SYM(1,int,XFreeColors,(Display*,Colormap,unsigned long*,int,unsigned long))
   21.35 -SDL_X11_SYM(1,int,XFreeCursor,(Display*,Cursor))
   21.36 -SDL_X11_SYM(1,int,XFreeGC,(Display*,GC))
   21.37 -SDL_X11_SYM(1,int,XFreeModifiermap,(XModifierKeymap*))
   21.38 -SDL_X11_SYM(1,int,XFreePixmap,(Display*,Pixmap))
   21.39 -SDL_X11_SYM(1,int,XGetErrorDatabaseText,(Display*,_Xconst char*,_Xconst char*,_Xconst char*,char*,int))
   21.40 -SDL_X11_SYM(1,XModifierKeymap*,XGetModifierMapping,(Display*))
   21.41 -SDL_X11_SYM(1,int,XGetPointerControl,(Display*,int*,int*,int*))
   21.42 -SDL_X11_SYM(1,XVisualInfo*,XGetVisualInfo,(Display*,long,XVisualInfo*,int*))
   21.43 -SDL_X11_SYM(1,XWMHints*,XGetWMHints,(Display*,Window))
   21.44 -SDL_X11_SYM(1,Status,XGetTextProperty,(Display*,Window,XTextProperty*,Atom))
   21.45 -SDL_X11_SYM(1,Status,XGetWindowAttributes,(Display*,Window,XWindowAttributes*))
   21.46 -SDL_X11_SYM(1,int,XGrabKeyboard,(Display*,Window,Bool,int,int,Time))
   21.47 -SDL_X11_SYM(1,int,XGrabPointer,(Display*,Window,Bool,unsigned int,int,int,Window,Cursor,Time))
   21.48 -SDL_X11_SYM(1,Status,XIconifyWindow,(Display*,Window,int))
   21.49 -SDL_X11_SYM(1,int,XInstallColormap,(Display*,Colormap))
   21.50 -SDL_X11_SYM(1,KeyCode,XKeysymToKeycode,(Display*,KeySym))
   21.51 -SDL_X11_SYM(1,Atom,XInternAtom,(Display*,_Xconst char*,Bool))
   21.52 -SDL_X11_SYM(1,XPixmapFormatValues*,XListPixmapFormats,(Display*,int*))
   21.53 -SDL_X11_SYM(1,int,XLookupString,(XKeyEvent*,char*,int,KeySym*,XComposeStatus*))
   21.54 -SDL_X11_SYM(1,int,XMapRaised,(Display*,Window))
   21.55 -SDL_X11_SYM(1,int,XMapWindow,(Display*,Window))
   21.56 -SDL_X11_SYM(1,int,XMaskEvent,(Display*,long,XEvent*))
   21.57 -SDL_X11_SYM(1,Status,XMatchVisualInfo,(Display*,int,int,int,XVisualInfo*))
   21.58 -SDL_X11_SYM(1,int,XMissingExtension,(Display*,_Xconst char*))
   21.59 -SDL_X11_SYM(1,int,XMoveResizeWindow,(Display*,Window,int,int,unsigned int,unsigned int))
   21.60 -SDL_X11_SYM(1,int,XMoveWindow,(Display*,Window,int,int))
   21.61 -SDL_X11_SYM(1,int,XNextEvent,(Display*,XEvent*))
   21.62 -SDL_X11_SYM(1,Display*,XOpenDisplay,(_Xconst char*))
   21.63 -SDL_X11_SYM(1,int,XPeekEvent,(Display*,XEvent*))
   21.64 -SDL_X11_SYM(1,int,XPending,(Display*))
   21.65 -SDL_X11_SYM(1,int,XPutImage,(Display*,Drawable,GC,XImage*,int,int,int,int,unsigned int,unsigned int))
   21.66 -SDL_X11_SYM(1,int,XQueryColors,(Display*,Colormap,XColor*,int))
   21.67 -SDL_X11_SYM(1,int,XQueryKeymap,(Display*,char [32]))
   21.68 -SDL_X11_SYM(1,Bool,XQueryPointer,(Display*,Window,Window*,Window*,int*,int*,int*,int*,unsigned int*))
   21.69 -SDL_X11_SYM(1,int,XRaiseWindow,(Display*,Window))
   21.70 -SDL_X11_SYM(1,int,XReparentWindow,(Display*,Window,Window,int,int))
   21.71 -SDL_X11_SYM(1,int,XResizeWindow,(Display*,Window,unsigned int,unsigned int))
   21.72 -SDL_X11_SYM(1,int,XSelectInput,(Display*,Window,long))
   21.73 -SDL_X11_SYM(1,Status,XSendEvent,(Display*,Window,Bool,long,XEvent*))
   21.74 -SDL_X11_SYM(1,int,XSetClassHint,(Display*,Window,XClassHint*))
   21.75 -SDL_X11_SYM(1,XErrorHandler,XSetErrorHandler,(XErrorHandler))
   21.76 -SDL_X11_SYM(1,XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler))
   21.77 -SDL_X11_SYM(1,int,XSetTransientForHint,(Display*,Window,Window))
   21.78 -SDL_X11_SYM(1,int,XSetWMHints,(Display*,Window,XWMHints*))
   21.79 -SDL_X11_SYM(1,void,XSetTextProperty,(Display*,Window,XTextProperty*,Atom))
   21.80 -SDL_X11_SYM(1,void,XSetWMNormalHints,(Display*,Window,XSizeHints*))
   21.81 -SDL_X11_SYM(1,Status,XSetWMProtocols,(Display*,Window,Atom*,int))
   21.82 -SDL_X11_SYM(1,int,XSetWindowBackground,(Display*,Window,unsigned long))
   21.83 -SDL_X11_SYM(1,int,XSetWindowBackgroundPixmap,(Display*,Window,Pixmap))
   21.84 -SDL_X11_SYM(1,int,XSetWindowColormap,(Display*,Window,Colormap))
   21.85 -SDL_X11_SYM(1,int,XStoreColors,(Display*,Colormap,XColor*,int))
   21.86 -SDL_X11_SYM(1,Status,XStringListToTextProperty,(char**,int,XTextProperty*))
   21.87 -SDL_X11_SYM(1,int,XSync,(Display*,Bool))
   21.88 -SDL_X11_SYM(1,int,XUngrabKeyboard,(Display*,Time))
   21.89 -SDL_X11_SYM(1,int,XUngrabPointer,(Display*,Time))
   21.90 -SDL_X11_SYM(1,int,XUnmapWindow,(Display*,Window))
   21.91 -SDL_X11_SYM(1,int,XWarpPointer,(Display*,Window,Window,int,int,unsigned int,unsigned int,int,int))
   21.92 -SDL_X11_SYM(1,VisualID,XVisualIDFromVisual,(Visual*))
   21.93 -SDL_X11_SYM(1,XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo*,Display*,char*,XExtensionHooks*,int,XPointer))
   21.94 -SDL_X11_SYM(1,XExtensionInfo*,XextCreateExtension,(void))
   21.95 -SDL_X11_SYM(1,void,XextDestroyExtension,(XExtensionInfo*))
   21.96 -SDL_X11_SYM(1,XExtDisplayInfo*,XextFindDisplay,(XExtensionInfo*,Display*))
   21.97 -SDL_X11_SYM(1,int,XextRemoveDisplay,(XExtensionInfo*,Display*))
   21.98 -SDL_X11_SYM(1,Bool,XQueryExtension,(Display*,_Xconst char*,int*,int*,int*))
   21.99 -SDL_X11_SYM(1,char *,XDisplayString,(Display*))
  21.100 -SDL_X11_SYM(1,int,XGetErrorText,(Display*,int,char*,int))
  21.101 +SDL_X11_MODULE(BASEXLIB)
  21.102 +SDL_X11_SYM(XClassHint*,XAllocClassHint,(void),(),return)
  21.103 +SDL_X11_SYM(Status,XAllocColor,(Display* a,Colormap b,XColor* c),(a,b,c),return)
  21.104 +SDL_X11_SYM(XSizeHints*,XAllocSizeHints,(void),(),return)
  21.105 +SDL_X11_SYM(XWMHints*,XAllocWMHints,(void),(),return)
  21.106 +SDL_X11_SYM(int,XChangePointerControl,(Display* a,Bool b,Bool c,int d,int e,int f),(a,b,c,d,e,f),return)
  21.107 +SDL_X11_SYM(int,XChangeProperty,(Display* a,Window b,Atom c,Atom d,int e,int f,_Xconst unsigned char* g,int h),(a,b,c,d,e,f,g,h),return)
  21.108 +SDL_X11_SYM(int,XChangeWindowAttributes,(Display* a,Window b,unsigned long c,XSetWindowAttributes* d),(a,b,c,d),return)
  21.109 +SDL_X11_SYM(Bool,XCheckTypedEvent,(Display* a,int b,XEvent* c),(a,b,c),return)
  21.110 +SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return)
  21.111 +SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return)
  21.112 +SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
  21.113 +SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
  21.114 +SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
  21.115 +SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
  21.116 +SDL_X11_SYM(Pixmap,XCreatePixmap,(Display* a,Drawable b,unsigned int c,unsigned int d,unsigned int e),(a,b,c,d,e),return)
  21.117 +SDL_X11_SYM(Pixmap,XCreatePixmapFromBitmapData,(Display* a,Drawable b,char* c,unsigned int d,unsigned int e,unsigned long f,unsigned long g,unsigned int h),(a,b,c,d,e,f,g,h),return)
  21.118 +SDL_X11_SYM(Window,XCreateSimpleWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,unsigned long h,unsigned long i),(a,b,c,d,e,f,g,h,i),return)
  21.119 +SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
  21.120 +SDL_X11_SYM(int,XDefineCursor,(Display* a,Window b,Cursor c),(a,b,c),return)
  21.121 +SDL_X11_SYM(int,XDeleteProperty,(Display* a,Window b,Atom c),(a,b,c),return)
  21.122 +SDL_X11_SYM(int,XDestroyWindow,(Display* a,Window b),(a,b),return)
  21.123 +SDL_X11_SYM(char*,XDisplayName,(_Xconst char* a),(a),return)
  21.124 +SDL_X11_SYM(int,XEventsQueued,(Display* a,int b),(a,b),return)
  21.125 +SDL_X11_SYM(Bool,XFilterEvent,(XEvent *event, Window w),(event,w),return)
  21.126 +SDL_X11_SYM(int,XFlush,(Display* a),(a),return)
  21.127 +SDL_X11_SYM(int,XFree,(void*a),(a),return)
  21.128 +SDL_X11_SYM(int,XFreeColormap,(Display* a,Colormap b),(a,b),return)
  21.129 +SDL_X11_SYM(int,XFreeColors,(Display* a,Colormap b,unsigned long* c,int d,unsigned long e),(a,b,c,d,e),return)
  21.130 +SDL_X11_SYM(int,XFreeCursor,(Display* a,Cursor b),(a,b),return)
  21.131 +SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return)
  21.132 +SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return)
  21.133 +SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return)
  21.134 +SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return)
  21.135 +SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return)
  21.136 +SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return)
  21.137 +SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return)
  21.138 +SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
  21.139 +SDL_X11_SYM(Status,XGetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),return)
  21.140 +SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return)
  21.141 +SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return)
  21.142 +SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return)
  21.143 +SDL_X11_SYM(Status,XIconifyWindow,(Display* a,Window b,int c),(a,b,c),return)
  21.144 +SDL_X11_SYM(int,XInstallColormap,(Display* a,Colormap b),(a,b),return)
  21.145 +SDL_X11_SYM(KeyCode,XKeysymToKeycode,(Display* a,KeySym b),(a,b),return)
  21.146 +SDL_X11_SYM(Atom,XInternAtom,(Display* a,_Xconst char* b,Bool c),(a,b,c),return)
  21.147 +SDL_X11_SYM(XPixmapFormatValues*,XListPixmapFormats,(Display* a,int* b),(a,b),return)
  21.148 +SDL_X11_SYM(int,XLookupString,(XKeyEvent* a,char* b,int c,KeySym* d,XComposeStatus* e),(a,b,c,d,e),return)
  21.149 +SDL_X11_SYM(int,XMapRaised,(Display* a,Window b),(a,b),return)
  21.150 +SDL_X11_SYM(int,XMapWindow,(Display* a,Window b),(a,b),return)
  21.151 +SDL_X11_SYM(int,XMaskEvent,(Display* a,long b,XEvent* c),(a,b,c),return)
  21.152 +SDL_X11_SYM(Status,XMatchVisualInfo,(Display* a,int b,int c,int d,XVisualInfo* e),(a,b,c,d,e),return)
  21.153 +SDL_X11_SYM(int,XMissingExtension,(Display* a,_Xconst char* b),(a,b),return)
  21.154 +SDL_X11_SYM(int,XMoveResizeWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f),(a,b,c,d,e,f),return)
  21.155 +SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
  21.156 +SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
  21.157 +SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
  21.158 +SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
  21.159 +SDL_X11_SYM(int,XPending,(Display* a),(a),return)
  21.160 +SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
  21.161 +SDL_X11_SYM(int,XQueryColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
  21.162 +SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
  21.163 +SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
  21.164 +SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return)
  21.165 +SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return)
  21.166 +SDL_X11_SYM(int,XResizeWindow,(Display* a,Window b,unsigned int c,unsigned int d),(a,b,c,d),return)
  21.167 +SDL_X11_SYM(int,XSelectInput,(Display* a,Window b,long c),(a,b,c),return)
  21.168 +SDL_X11_SYM(Status,XSendEvent,(Display* a,Window b,Bool c,long d,XEvent* e),(a,b,c,d,e),return)
  21.169 +SDL_X11_SYM(int,XSetClassHint,(Display* a,Window b,XClassHint* c),(a,b,c),return)
  21.170 +SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return)
  21.171 +SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return)
  21.172 +SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return)
  21.173 +SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return)
  21.174 +SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),)
  21.175 +SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
  21.176 +SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
  21.177 +SDL_X11_SYM(int,XSetWindowBackground,(Display* a,Window b,unsigned long c),(a,b,c),return)
  21.178 +SDL_X11_SYM(int,XSetWindowBackgroundPixmap,(Display* a,Window b,Pixmap c),(a,b,c),return)
  21.179 +SDL_X11_SYM(int,XSetWindowColormap,(Display* a,Window b,Colormap c),(a,b,c),return)
  21.180 +SDL_X11_SYM(int,XStoreColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
  21.181 +SDL_X11_SYM(Status,XStringListToTextProperty,(char** a,int b,XTextProperty* c),(a,b,c),return)
  21.182 +SDL_X11_SYM(int,XSync,(Display* a,Bool b),(a,b),return)
  21.183 +SDL_X11_SYM(int,XUngrabKeyboard,(Display* a,Time b),(a,b),return)
  21.184 +SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time b),(a,b),return)
  21.185 +SDL_X11_SYM(int,XUnmapWindow,(Display* a,Window b),(a,b),return)
  21.186 +SDL_X11_SYM(int,XWarpPointer,(Display* a,Window b,Window c,int d,int e,unsigned int f,unsigned int g,int h, int i),(a,b,c,d,e,f,g,h,i),return)
  21.187 +SDL_X11_SYM(VisualID,XVisualIDFromVisual,(Visual* a),(a),return)
  21.188 +SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return)
  21.189 +SDL_X11_SYM(XExtensionInfo*,XextCreateExtension,(void),(),return)
  21.190 +SDL_X11_SYM(void,XextDestroyExtension,(XExtensionInfo* a),(a),)
  21.191 +SDL_X11_SYM(XExtDisplayInfo*,XextFindDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
  21.192 +SDL_X11_SYM(int,XextRemoveDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
  21.193 +SDL_X11_SYM(Bool,XQueryExtension,(Display* a,_Xconst char* b,int* c,int* d,int* e),(a,b,c,d,e),return)
  21.194 +SDL_X11_SYM(char *,XDisplayString,(Display* a),(a),return)
  21.195 +SDL_X11_SYM(int,XGetErrorText,(Display* a,int b,char* c,int d),(a,b,c,d),return)
  21.196 +SDL_X11_SYM(void,_XEatData,(Display* a,unsigned long b),(a,b),)
  21.197 +SDL_X11_SYM(void,_XFlush,(Display* a),(a),)
  21.198 +SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),)
  21.199 +SDL_X11_SYM(int,_XRead,(Display* a,char* b,long c),(a,b,c),return)
  21.200 +SDL_X11_SYM(void,_XReadPad,(Display* a,char* b,long c),(a,b,c),)
  21.201 +SDL_X11_SYM(void,_XSend,(Display* a,_Xconst char* b,long c),(a,b,c),)
  21.202 +SDL_X11_SYM(Status,_XReply,(Display* a,xReply* b,int c,Bool d),(a,b,c,d),return)
  21.203 +SDL_X11_SYM(unsigned long,_XSetLastRequestRead,(Display* a,xGenericReply* b),(a,b),return)
  21.204 +SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),return)
  21.205 +SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return)
  21.206 +SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return)
  21.207 +SDL_X11_SYM(SDL_X11_XSetExtensionErrorHandlerType,XSetExtensionErrorHandler,(SDL_X11_XSetExtensionErrorHandlerType a),(a),return)
  21.208 +
  21.209 +#if NeedWidePrototypes
  21.210 +SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return)
  21.211 +#else
  21.212 +SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return)
  21.213 +#endif
  21.214  
  21.215  #ifdef X_HAVE_UTF8_STRING
  21.216 -SDL_X11_SYM(1,int,Xutf8TextListToTextProperty,(Display*,char**,int,XICCEncodingStyle,XTextProperty*))
  21.217 -SDL_X11_SYM(1,int,Xutf8LookupString,(XIC,XKeyPressedEvent*,char*,int,KeySym*,Status*))
  21.218 -SDL_X11_SYM(1,XIC,XCreateIC,(XIM, ...))
  21.219 -SDL_X11_SYM(1,void,XDestroyIC,(XIC))
  21.220 -SDL_X11_SYM(1,void,XSetICFocus,(XIC))
  21.221 -SDL_X11_SYM(1,void,XUnsetICFocus,(XIC))
  21.222 -SDL_X11_SYM(1,XIM,XOpenIM,(Display*,struct _XrmHashBucketRec*,char*,char*))
  21.223 -SDL_X11_SYM(1,Status,XCloseIM,(XIM))
  21.224 -#endif
  21.225 -SDL_X11_SYM(1,void,_XEatData,(Display*,unsigned long))
  21.226 -SDL_X11_SYM(1,void,_XFlush,(Display*))
  21.227 -SDL_X11_SYM(1,void,_XFlushGCCache,(Display*,GC))
  21.228 -SDL_X11_SYM(1,int,_XRead,(Display*,char*,long))
  21.229 -SDL_X11_SYM(1,void,_XReadPad,(Display*,char*,long))
  21.230 -SDL_X11_SYM(1,void,_XSend,(Display*,_Xconst char*,long))
  21.231 -SDL_X11_SYM(1,Status,_XReply,(Display*,xReply*,int,Bool))
  21.232 -SDL_X11_SYM(1,unsigned long,_XSetLastRequestRead,(Display*,xGenericReply*))
  21.233 -
  21.234 -/*
  21.235 - * These don't exist in 32-bit versions and are removed by Xlib macros, but
  21.236 - *  64+ bit systems will use them.
  21.237 - */
  21.238 -#if defined(LONG64)
  21.239 -SDL_X11_SYM(1,int,_XData32,(Display *dpy,register long *data,unsigned len))
  21.240 -SDL_X11_SYM(1,void,_XRead32,(Display *dpy,register long *data,long len))
  21.241 -#endif
  21.242 -
  21.243 -#if defined(__osf__)
  21.244 -SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
  21.245 -SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))
  21.246 -SDL_X11_SYM(1,int,ipAllocateData,(ChannelPtr, IPCard, IPDataPtr *))
  21.247 -SDL_X11_SYM(1,int,ipUnallocateAndSendData,(ChannelPtr, IPCard))
  21.248 -#endif
  21.249 -
  21.250 -#if NeedWidePrototypes
  21.251 -SDL_X11_SYM(1,KeySym,XKeycodeToKeysym,(Display*,unsigned int,int))
  21.252 -#else
  21.253 -SDL_X11_SYM(1,KeySym,XKeycodeToKeysym,(Display*,KeyCode,int))
  21.254 +SDL_X11_MODULE(UTF8)
  21.255 +SDL_X11_SYM(int,Xutf8TextListToTextProperty,(Display* a,char** b,int c,XICCEncodingStyle d,XTextProperty* e),(a,b,c,d,e),return)
  21.256 +SDL_X11_SYM(int,Xutf8LookupString,(XIC a,XKeyPressedEvent* b,char* c,int d,KeySym* e,Status* f),(a,b,c,d,e,f),return)
  21.257 +/*SDL_X11_SYM(XIC,XCreateIC,(XIM, ...),return)  !!! ARGH! */
  21.258 +SDL_X11_SYM(void,XDestroyIC,(XIC a),(a),)
  21.259 +SDL_X11_SYM(void,XSetICFocus,(XIC a),(a),)
  21.260 +SDL_X11_SYM(void,XUnsetICFocus,(XIC a),(a),)
  21.261 +SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
  21.262 +SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
  21.263  #endif
  21.264  
  21.265  #ifndef NO_SHARED_MEMORY
  21.266 -SDL_X11_SYM(1,Status,XShmAttach,(Display*,XShmSegmentInfo*))
  21.267 -SDL_X11_SYM(1,Status,XShmDetach,(Display*,XShmSegmentInfo*))
  21.268 -SDL_X11_SYM(1,Status,XShmPutImage,(Display*,Drawable,GC,XImage*,int,int,int,int,unsigned int,unsigned int,Bool))
  21.269 -SDL_X11_SYM(1,XImage*,XShmCreateImage,(Display*,Visual*,unsigned int,int,char*,XShmSegmentInfo*,unsigned int,unsigned int))
  21.270 -SDL_X11_SYM(1,Bool,XShmQueryExtension,(Display*))
  21.271 +SDL_X11_MODULE(SHM)
  21.272 +SDL_X11_SYM(Status,XShmAttach,(Display* a,XShmSegmentInfo* b),(a,b),return)
  21.273 +SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return)
  21.274 +SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return)
  21.275 +SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return)
  21.276 +SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
  21.277  #endif
  21.278  
  21.279 -SDL_X11_SYM(1,SDL_X11_XSynchronizeRetType,XSynchronize,(Display*,Bool))
  21.280 -SDL_X11_SYM(1,SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display*,int,SDL_X11_XESetWireToEventRetType))
  21.281 -SDL_X11_SYM(1,SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display*,int,SDL_X11_XESetEventToWireRetType))
  21.282 -SDL_X11_SYM(1,SDL_X11_XSetExtensionErrorHandlerType,XSetExtensionErrorHandler,(SDL_X11_XSetExtensionErrorHandlerType))
  21.283 +/*
  21.284 + * Not required...these only exist in code in headers on some 64-bit platforms,
  21.285 + *  and are removed via macros elsewhere, so it's safe for them to be missing.
  21.286 + */
  21.287 +SDL_X11_MODULE(IO_32BIT)
  21.288 +SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
  21.289 +SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
  21.290 +
  21.291 +/*
  21.292 + * These only show up on some variants of Unix.
  21.293 + */
  21.294 +#if defined(__osf__)
  21.295 +SDL_X11_MODULE(OSF_ENTRY_POINTS)
  21.296 +SDL_X11_SYM(void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr p),(dpy,p),)
  21.297 +SDL_X11_SYM(void,_SmtIpError,(Display *dpy,register smtDisplayPtr p, int i),(dpy,p,i),)
  21.298 +SDL_X11_SYM(int,ipAllocateData,(ChannelPtr a, IPCard b, IPDataPtr * c),(a,b,c),return)
  21.299 +SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a, IPCard b),(a,b),return)
  21.300 +#endif
  21.301  
  21.302  /* end of SDL_x11sym.h ... */
  21.303  
    22.1 --- a/src/video/x11/SDL_x11video.c	Wed Mar 22 04:51:44 2006 +0000
    22.2 +++ b/src/video/x11/SDL_x11video.c	Wed Mar 22 05:00:59 2006 +0000
    22.3 @@ -71,9 +71,9 @@
    22.4  {
    22.5  	Display *display = NULL;
    22.6  	if ( SDL_X11_LoadSymbols() ) {
    22.7 -		display = pXOpenDisplay(NULL);
    22.8 +		display = XOpenDisplay(NULL);
    22.9  		if ( display != NULL ) {
   22.10 -			pXCloseDisplay(display);
   22.11 +			XCloseDisplay(display);
   22.12  		}
   22.13  		SDL_X11_UnloadSymbols();
   22.14  	}
   22.15 @@ -199,7 +199,7 @@
   22.16  	       (e->error_code <= (vm_error+XF86VidModeNumberErrors)))) ) {
   22.17  #ifdef XFREE86_DEBUG
   22.18  { char errmsg[1024];
   22.19 -  pXGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
   22.20 +  XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
   22.21  printf("VidMode error: %s\n", errmsg);
   22.22  }
   22.23  #endif
   22.24 @@ -214,7 +214,7 @@
   22.25  	      (e->error_code <= (dga_error+XF86DGANumberErrors))) ) {
   22.26  #ifdef XFREE86_DEBUG
   22.27  { char errmsg[1024];
   22.28 -  pXGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
   22.29 +  XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
   22.30  printf("DGA error: %s\n", errmsg);
   22.31  }
   22.32  #endif
   22.33 @@ -247,7 +247,7 @@
   22.34  #ifdef XFREE86_DEBUG
   22.35  	printf("Xext error inside SDL (may be harmless):\n");
   22.36  	printf("  Extension \"%s\" %s on display \"%s\".\n",
   22.37 -	       ext_name, reason, pXDisplayString(d));
   22.38 +	       ext_name, reason, XDisplayString(d));
   22.39  #endif
   22.40  
   22.41  	if (SDL_strcmp(reason, "missing") == 0) {
   22.42 @@ -319,9 +319,9 @@
   22.43      int def_vis = (SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen));
   22.44  
   22.45      /* Look up some useful Atoms */
   22.46 -    WM_DELETE_WINDOW = pXInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);
   22.47 -    _NET_WM_NAME = pXInternAtom(SDL_Display, "_NET_WM_NAME", False);
   22.48 -    _NET_WM_ICON_NAME = pXInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
   22.49 +    WM_DELETE_WINDOW = XInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);
   22.50 +    _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
   22.51 +    _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
   22.52  
   22.53      /* Don't create any extra windows if we are being managed */
   22.54      if ( SDL_windowid ) {
   22.55 @@ -331,21 +331,21 @@
   22.56      }
   22.57  
   22.58      if(FSwindow)
   22.59 -	pXDestroyWindow(SDL_Display, FSwindow);
   22.60 +	XDestroyWindow(SDL_Display, FSwindow);
   22.61  
   22.62      xattr.override_redirect = True;
   22.63      xattr.background_pixel = def_vis ? BlackPixel(SDL_Display, SDL_Screen) : 0;
   22.64      xattr.border_pixel = 0;
   22.65      xattr.colormap = SDL_XColorMap;
   22.66  
   22.67 -    FSwindow = pXCreateWindow(SDL_Display, SDL_Root,
   22.68 +    FSwindow = XCreateWindow(SDL_Display, SDL_Root,
   22.69                               xinerama_x, xinerama_y, 32, 32, 0,
   22.70  			     this->hidden->depth, InputOutput, SDL_Visual,
   22.71  			     CWOverrideRedirect | CWBackPixel | CWBorderPixel
   22.72  			     | CWColormap,
   22.73  			     &xattr);
   22.74  
   22.75 -    pXSelectInput(SDL_Display, FSwindow, StructureNotifyMask);
   22.76 +    XSelectInput(SDL_Display, FSwindow, StructureNotifyMask);
   22.77  
   22.78      /* Tell KDE to keep the fullscreen window on top */
   22.79      {
   22.80 @@ -355,13 +355,13 @@
   22.81  	SDL_memset(&ev, 0, sizeof(ev));
   22.82  	ev.xclient.type = ClientMessage;
   22.83  	ev.xclient.window = SDL_Root;
   22.84 -	ev.xclient.message_type = pXInternAtom(SDL_Display,
   22.85 +	ev.xclient.message_type = XInternAtom(SDL_Display,
   22.86  					      "KWM_KEEP_ON_TOP", False);
   22.87  	ev.xclient.format = 32;
   22.88  	ev.xclient.data.l[0] = FSwindow;
   22.89  	ev.xclient.data.l[1] = CurrentTime;
   22.90  	mask = SubstructureRedirectMask;
   22.91 -	pXSendEvent(SDL_Display, SDL_Root, False, mask, &ev);
   22.92 +	XSendEvent(SDL_Display, SDL_Root, False, mask, &ev);
   22.93      }
   22.94  
   22.95      hints = NULL;
   22.96 @@ -369,47 +369,47 @@
   22.97      iconprop.value = iconpropUTF8.value = NULL;
   22.98      if(WMwindow) {
   22.99  	/* All window attributes must survive the recreation */
  22.100 -	hints = pXGetWMHints(SDL_Display, WMwindow);
  22.101 -	pXGetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  22.102 -	pXGetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
  22.103 -	pXGetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  22.104 -	pXGetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
  22.105 -	pXDestroyWindow(SDL_Display, WMwindow);
  22.106 +	hints = XGetWMHints(SDL_Display, WMwindow);
  22.107 +	XGetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  22.108 +	XGetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
  22.109 +	XGetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  22.110 +	XGetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
  22.111 +	XDestroyWindow(SDL_Display, WMwindow);
  22.112      }
  22.113  
  22.114      /* Create the window for windowed management */
  22.115      /* (reusing the xattr structure above) */
  22.116 -    WMwindow = pXCreateWindow(SDL_Display, SDL_Root, 0, 0, 32, 32, 0,
  22.117 +    WMwindow = XCreateWindow(SDL_Display, SDL_Root, 0, 0, 32, 32, 0,
  22.118  			     this->hidden->depth, InputOutput, SDL_Visual,
  22.119  			     CWBackPixel | CWBorderPixel | CWColormap,
  22.120  			     &xattr);
  22.121  
  22.122      /* Set the input hints so we get keyboard input */
  22.123      if(!hints) {
  22.124 -	hints = pXAllocWMHints();
  22.125 +	hints = XAllocWMHints();
  22.126  	hints->input = True;
  22.127  	hints->flags = InputHint;
  22.128      }
  22.129 -    pXSetWMHints(SDL_Display, WMwindow, hints);
  22.130 -    pXFree(hints);
  22.131 +    XSetWMHints(SDL_Display, WMwindow, hints);
  22.132 +    XFree(hints);
  22.133      if(titleprop.value) {
  22.134 -	pXSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  22.135 -	pXFree(titleprop.value);
  22.136 +	XSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  22.137 +	XFree(titleprop.value);
  22.138      }
  22.139      if(titlepropUTF8.value) {
  22.140 -	pXSetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
  22.141 -	pXFree(titlepropUTF8.value);
  22.142 +	XSetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
  22.143 +	XFree(titlepropUTF8.value);
  22.144      }
  22.145      if(iconprop.value) {
  22.146 -	pXSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  22.147 -	pXFree(iconprop.value);
  22.148 +	XSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  22.149 +	XFree(iconprop.value);
  22.150      }
  22.151      if(iconpropUTF8.value) {
  22.152 -	pXSetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
  22.153 -	pXFree(iconpropUTF8.value);
  22.154 +	XSetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
  22.155 +	XFree(iconpropUTF8.value);
  22.156      }
  22.157  
  22.158 -    pXSelectInput(SDL_Display, WMwindow,
  22.159 +    XSelectInput(SDL_Display, WMwindow,
  22.160  		 FocusChangeMask | KeyPressMask | KeyReleaseMask
  22.161  		 | PropertyChangeMask | StructureNotifyMask | KeymapStateMask);
  22.162  
  22.163 @@ -417,41 +417,44 @@
  22.164      get_classname(classname, sizeof(classname));
  22.165      {
  22.166  	XClassHint *classhints;
  22.167 -	classhints = pXAllocClassHint();
  22.168 +	classhints = XAllocClassHint();
  22.169  	if(classhints != NULL) {
  22.170  	    classhints->res_name = classname;
  22.171  	    classhints->res_class = classname;
  22.172 -	    pXSetClassHint(SDL_Display, WMwindow, classhints);
  22.173 -	    pXFree(classhints);
  22.174 +	    XSetClassHint(SDL_Display, WMwindow, classhints);
  22.175 +	    XFree(classhints);
  22.176  	}
  22.177      }
  22.178  
  22.179      /* Setup the communication with the IM server */
  22.180 -    SDL_IM = NULL;
  22.181 -    SDL_IC = NULL;
  22.182 +	SDL_IM = NULL;
  22.183 +	SDL_IC = NULL;
  22.184  
  22.185 -    #ifdef X_HAVE_UTF8_STRING
  22.186 -    SDL_IM = pXOpenIM(SDL_Display, NULL, classname, classname);
  22.187 -    if (SDL_IM == NULL) {
  22.188 -	SDL_SetError("no input method could be opened");
  22.189 -    } else {
  22.190 -	SDL_IC = pXCreateIC(SDL_IM,
  22.191 -			XNClientWindow, WMwindow,
  22.192 -			XNFocusWindow, WMwindow,
  22.193 -			XNInputStyle, XIMPreeditNothing  | XIMStatusNothing,
  22.194 -			XNResourceName, classname,
  22.195 -			XNResourceClass, classname,
  22.196 -			NULL);
  22.197 -	if (SDL_IC == NULL) {
  22.198 -		SDL_SetError("no input context could be created");
  22.199 -		pXCloseIM(SDL_IM);
  22.200 -		SDL_IM = NULL;
  22.201 +	#ifdef X_HAVE_UTF8_STRING
  22.202 +	if (SDL_X11_HAVE_UTF8) {
  22.203 +		SDL_IM = XOpenIM(SDL_Display, NULL, classname, classname);
  22.204 +		if (SDL_IM == NULL) {
  22.205 +			SDL_SetError("no input method could be opened");
  22.206 +		} else {
  22.207 +			SDL_IC = pXCreateIC(SDL_IM,
  22.208 +					XNClientWindow, WMwindow,
  22.209 +					XNFocusWindow, WMwindow,
  22.210 +					XNInputStyle, XIMPreeditNothing  | XIMStatusNothing,
  22.211 +					XNResourceName, classname,
  22.212 +					XNResourceClass, classname,
  22.213 +					NULL);
  22.214 +
  22.215 +			if (SDL_IC == NULL) {
  22.216 +				SDL_SetError("no input context could be created");
  22.217 +				XCloseIM(SDL_IM);
  22.218 +				SDL_IM = NULL;
  22.219 +			}
  22.220 +		}
  22.221  	}
  22.222 -    }
  22.223 -    #endif
  22.224 +	#endif
  22.225  
  22.226 -    /* Allow the window to be deleted by the window manager */
  22.227 -    pXSetWMProtocols(SDL_Display, WMwindow, &WM_DELETE_WINDOW, 1);
  22.228 +	/* Allow the window to be deleted by the window manager */
  22.229 +	XSetWMProtocols(SDL_Display, WMwindow, &WM_DELETE_WINDOW, 1);
  22.230  }
  22.231  
  22.232  static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
  22.233 @@ -462,13 +465,13 @@
  22.234  	/* Open the X11 display */
  22.235  	display = NULL;		/* Get it from DISPLAY environment variable */
  22.236  
  22.237 -	if ( (SDL_strncmp(pXDisplayName(display), ":", 1) == 0) ||
  22.238 -	     (SDL_strncmp(pXDisplayName(display), "unix:", 5) == 0) ) {
  22.239 +	if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
  22.240 +	     (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
  22.241  		local_X11 = 1;
  22.242  	} else {
  22.243  		local_X11 = 0;
  22.244  	}
  22.245 -	SDL_Display = pXOpenDisplay(display);
  22.246 +	SDL_Display = XOpenDisplay(display);
  22.247  #if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
  22.248  	/* On Tru64 if linking without -lX11, it fails and you get following message.
  22.249  	 * Xlib: connection to ":0.0" refused by server
  22.250 @@ -480,7 +483,7 @@
  22.251  	 */
  22.252  	if ( SDL_Display == NULL ) {
  22.253  		SDL_Delay(1000);
  22.254 -		SDL_Display = pXOpenDisplay(display);
  22.255 +		SDL_Display = XOpenDisplay(display);
  22.256  	}
  22.257  #endif
  22.258  	if ( SDL_Display == NULL ) {
  22.259 @@ -488,27 +491,27 @@
  22.260  		return(-1);
  22.261  	}
  22.262  #ifdef X11_DEBUG
  22.263 -	pXSynchronize(SDL_Display, True);
  22.264 +	XSynchronize(SDL_Display, True);
  22.265  #endif
  22.266  
  22.267  	/* Create an alternate X display for graphics updates -- allows us
  22.268  	   to do graphics updates in a separate thread from event handling.
  22.269  	   Thread-safe X11 doesn't seem to exist.
  22.270  	 */
  22.271 -	GFX_Display = pXOpenDisplay(display);
  22.272 +	GFX_Display = XOpenDisplay(display);
  22.273  	if ( GFX_Display == NULL ) {
  22.274  		SDL_SetError("Couldn't open X11 display");
  22.275  		return(-1);
  22.276  	}
  22.277  
  22.278  	/* Set the normal X error handler */
  22.279 -	X_handler = pXSetErrorHandler(x_errhandler);
  22.280 +	X_handler = XSetErrorHandler(x_errhandler);
  22.281  
  22.282  	/* Set the error handler if we lose the X display */
  22.283 -	XIO_handler = pXSetIOErrorHandler(xio_errhandler);
  22.284 +	XIO_handler = XSetIOErrorHandler(xio_errhandler);
  22.285  
  22.286  	/* Set the X extension error handler */
  22.287 -	Xext_handler = pXSetExtensionErrorHandler(xext_errhandler);
  22.288 +	Xext_handler = XSetExtensionErrorHandler(xext_errhandler);
  22.289  
  22.290  	/* use default screen (from $DISPLAY) */
  22.291  	SDL_Screen = DefaultScreen(SDL_Display);
  22.292 @@ -517,7 +520,7 @@
  22.293  	/* Check for MIT shared memory extension */
  22.294  	use_mitshm = 0;
  22.295  	if ( local_X11 ) {
  22.296 -		use_mitshm = pXShmQueryExtension(SDL_Display);
  22.297 +		use_mitshm = XShmQueryExtension(SDL_Display);
  22.298  	}
  22.299  #endif /* NO_SHARED_MEMORY */
  22.300  
  22.301 @@ -544,7 +547,7 @@
  22.302  	if ( SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen) ) {
  22.303  	    SDL_XColorMap = SDL_DisplayColormap;
  22.304  	} else {
  22.305 -	    SDL_XColorMap = pXCreateColormap(SDL_Display, SDL_Root,
  22.306 +	    SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
  22.307  					    SDL_Visual, AllocNone);
  22.308  	}
  22.309  	this->hidden->depth = this->hidden->visuals[i].depth;
  22.310 @@ -571,7 +574,7 @@
  22.311  	this->info.wm_available = 1;
  22.312  
  22.313  	/* We're done! */
  22.314 -	pXFlush(SDL_Display);
  22.315 +	XFlush(SDL_Display);
  22.316  	return(0);
  22.317  }
  22.318  
  22.319 @@ -586,7 +589,7 @@
  22.320  	if ( ! SDL_windowid ) {
  22.321  		/* Hide the managed window */
  22.322  		if ( WMwindow ) {
  22.323 -			pXUnmapWindow(SDL_Display, WMwindow);
  22.324 +			XUnmapWindow(SDL_Display, WMwindow);
  22.325  		}
  22.326  		if ( screen && (screen->flags & SDL_FULLSCREEN) ) {
  22.327  			screen->flags &= ~SDL_FULLSCREEN;
  22.328 @@ -595,7 +598,7 @@
  22.329  
  22.330  		/* Destroy the output window */
  22.331  		if ( SDL_Window ) {
  22.332 -			pXDestroyWindow(SDL_Display, SDL_Window);
  22.333 +			XDestroyWindow(SDL_Display, SDL_Window);
  22.334  		}
  22.335  
  22.336  		/* Free the colormap entries */
  22.337 @@ -605,7 +608,7 @@
  22.338  			numcolors = SDL_Visual->map_entries;
  22.339  			for ( pixel=0; pixel<numcolors; ++pixel ) {
  22.340  				while ( SDL_XPixels[pixel] > 0 ) {
  22.341 -					pXFreeColors(GFX_Display,
  22.342 +					XFreeColors(GFX_Display,
  22.343  						SDL_DisplayColormap,&pixel,1,0);
  22.344  					--SDL_XPixels[pixel];
  22.345  				}
  22.346 @@ -616,7 +619,7 @@
  22.347  
  22.348  		/* Free the graphics context */
  22.349  		if ( SDL_GC ) {
  22.350 -			pXFreeGC(SDL_Display, SDL_GC);
  22.351 +			XFreeGC(SDL_Display, SDL_GC);
  22.352  			SDL_GC = 0;
  22.353  		}
  22.354  	}
  22.355 @@ -646,7 +649,7 @@
  22.356  {
  22.357  	XSizeHints *hints;
  22.358  
  22.359 -	hints = pXAllocSizeHints();
  22.360 +	hints = XAllocSizeHints();
  22.361  	if ( hints ) {
  22.362  		if ( flags & SDL_RESIZABLE ) {
  22.363  			hints->min_width = 32;
  22.364 @@ -666,13 +669,13 @@
  22.365  		/* Center it, if desired */
  22.366  		if ( X11_WindowPosition(this, &hints->x, &hints->y, w, h) ) {
  22.367  			hints->flags |= USPosition;
  22.368 -			pXMoveWindow(SDL_Display, WMwindow, hints->x, hints->y);
  22.369 +			XMoveWindow(SDL_Display, WMwindow, hints->x, hints->y);
  22.370  
  22.371  			/* Flush the resize event so we don't catch it later */
  22.372 -			pXSync(SDL_Display, True);
  22.373 +			XSync(SDL_Display, True);
  22.374  		}
  22.375 -		pXSetWMNormalHints(SDL_Display, WMwindow, hints);
  22.376 -		pXFree(hints);
  22.377 +		XSetWMNormalHints(SDL_Display, WMwindow, hints);
  22.378 +		XFree(hints);
  22.379  	}
  22.380  
  22.381  	/* Respect the window caption style */
  22.382 @@ -684,7 +687,7 @@
  22.383  		set = SDL_FALSE;
  22.384  
  22.385  		/* First try to set MWM hints */
  22.386 -		WM_HINTS = pXInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
  22.387 +		WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
  22.388  		if ( WM_HINTS != None ) {
  22.389  			/* Hints used by Motif compliant window managers */
  22.390  			struct {
  22.391 @@ -695,7 +698,7 @@
  22.392  				unsigned long status;
  22.393  			} MWMHints = { (1L << 1), 0, 0, 0, 0 };
  22.394  
  22.395 -			pXChangeProperty(SDL_Display, WMwindow,
  22.396 +			XChangeProperty(SDL_Display, WMwindow,
  22.397  			                WM_HINTS, WM_HINTS, 32,
  22.398  			                PropModeReplace,
  22.399  					(unsigned char *)&MWMHints,
  22.400 @@ -703,11 +706,11 @@
  22.401  			set = SDL_TRUE;
  22.402  		}
  22.403  		/* Now try to set KWM hints */
  22.404 -		WM_HINTS = pXInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
  22.405 +		WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
  22.406  		if ( WM_HINTS != None ) {
  22.407  			long KWMHints = 0;
  22.408  
  22.409 -			pXChangeProperty(SDL_Display, WMwindow,
  22.410 +			XChangeProperty(SDL_Display, WMwindow,
  22.411  			                WM_HINTS, WM_HINTS, 32,
  22.412  			                PropModeReplace,
  22.413  					(unsigned char *)&KWMHints,
  22.414 @@ -715,11 +718,11 @@
  22.415  			set = SDL_TRUE;
  22.416  		}
  22.417  		/* Now try to set GNOME hints */
  22.418 -		WM_HINTS = pXInternAtom(SDL_Display, "_WIN_HINTS", True);
  22.419 +		WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
  22.420  		if ( WM_HINTS != None ) {
  22.421  			long GNOMEHints = 0;
  22.422  
  22.423 -			pXChangeProperty(SDL_Display, WMwindow,
  22.424 +			XChangeProperty(SDL_Display, WMwindow,
  22.425  			                WM_HINTS, WM_HINTS, 32,
  22.426  			                PropModeReplace,
  22.427  					(unsigned char *)&GNOMEHints,
  22.428 @@ -728,7 +731,7 @@
  22.429  		}
  22.430  		/* Finally set the transient hints if necessary */
  22.431  		if ( ! set ) {
  22.432 -			pXSetTransientForHint(SDL_Display, WMwindow, SDL_Root);
  22.433 +			XSetTransientForHint(SDL_Display, WMwindow, SDL_Root);
  22.434  		}
  22.435  	} else {
  22.436  		SDL_bool set;
  22.437 @@ -738,27 +741,27 @@
  22.438  		set = SDL_FALSE;
  22.439  
  22.440  		/* First try to unset MWM hints */
  22.441 -		WM_HINTS = pXInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
  22.442 +		WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
  22.443  		if ( WM_HINTS != None ) {
  22.444 -			pXDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.445 +			XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.446  			set = SDL_TRUE;
  22.447  		}
  22.448  		/* Now try to unset KWM hints */
  22.449 -		WM_HINTS = pXInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
  22.450 +		WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
  22.451  		if ( WM_HINTS != None ) {
  22.452 -			pXDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.453 +			XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.454  			set = SDL_TRUE;
  22.455  		}
  22.456  		/* Now try to unset GNOME hints */
  22.457 -		WM_HINTS = pXInternAtom(SDL_Display, "_WIN_HINTS", True);
  22.458 +		WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
  22.459  		if ( WM_HINTS != None ) {
  22.460 -			pXDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.461 +			XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
  22.462  			set = SDL_TRUE;
  22.463  		}
  22.464  		/* Finally unset the transient hints if necessary */
  22.465  		if ( ! set ) {
  22.466  			/* NOTE: Does this work? */
  22.467 -			pXSetTransientForHint(SDL_Display, WMwindow, None);
  22.468 +			XSetTransientForHint(SDL_Display, WMwindow, None);
  22.469  		}
  22.470  	}
  22.471  }
  22.472 @@ -796,7 +799,7 @@
  22.473  	} else if ( SDL_windowid ) {
  22.474  		XWindowAttributes a;
  22.475  
  22.476 -		pXGetWindowAttributes(SDL_Display, SDL_Window, &a);
  22.477 +		XGetWindowAttributes(SDL_Display, SDL_Window, &a);
  22.478  		vis = a.visual;
  22.479  		depth = a.depth;
  22.480  	} else {
  22.481 @@ -825,7 +828,7 @@
  22.482  
  22.483  	/* Create the appropriate colormap */
  22.484  	if ( SDL_XColorMap != SDL_DisplayColormap ) {
  22.485 -		pXFreeColormap(SDL_Display, SDL_XColorMap);
  22.486 +		XFreeColormap(SDL_Display, SDL_XColorMap);
  22.487  	}
  22.488  	if ( SDL_Visual->class == PseudoColor ) {
  22.489  	    int ncolors;
  22.490 @@ -845,7 +848,7 @@
  22.491  	    }
  22.492  	    if ( flags & SDL_HWPALETTE ) {
  22.493  		screen->flags |= SDL_HWPALETTE;
  22.494 -		SDL_XColorMap = pXCreateColormap(SDL_Display, SDL_Root,
  22.495 +		SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
  22.496  		                                SDL_Visual, AllocAll);
  22.497  	    } else {
  22.498  		SDL_XColorMap = SDL_DisplayColormap;
  22.499 @@ -853,9 +856,9 @@
  22.500  	} else if ( SDL_Visual->class == DirectColor ) {
  22.501  
  22.502  	    /* Create a colormap which we can manipulate for gamma */
  22.503 -	    SDL_XColorMap = pXCreateColormap(SDL_Display, SDL_Root,
  22.504 +	    SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
  22.505  		                            SDL_Visual, AllocAll);
  22.506 -            pXSync(SDL_Display, False);
  22.507 +            XSync(SDL_Display, False);
  22.508  
  22.509  	    /* Initialize the colormap to the identity mapping */
  22.510  	    SDL_GetGammaRamp(0, 0, 0);
  22.511 @@ -864,7 +867,7 @@
  22.512  	    this->screen = NULL;
  22.513  	} else {
  22.514  	    /* Create a read-only colormap for our window */
  22.515 -	    SDL_XColorMap = pXCreateColormap(SDL_Display, SDL_Root,
  22.516 +	    SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
  22.517  	                                    SDL_Visual, AllocNone);
  22.518  	}
  22.519  
  22.520 @@ -877,8 +880,8 @@
  22.521  	       colour (0 is white on some displays), we should reset the
  22.522  	       background to 0 here since that is what the user expects
  22.523  	       with a private colormap */
  22.524 -	    pXSetWindowBackground(SDL_Display, FSwindow, 0);
  22.525 -	    pXClearWindow(SDL_Display, FSwindow);
  22.526 +	    XSetWindowBackground(SDL_Display, FSwindow, 0);
  22.527 +	    XClearWindow(SDL_Display, FSwindow);
  22.528  	}
  22.529  
  22.530  	/* resize the (possibly new) window manager window */
  22.531 @@ -886,7 +889,7 @@
  22.532  	        X11_SetSizeHints(this, w, h, flags);
  22.533  		window_w = w;
  22.534  		window_h = h;
  22.535 -		pXResizeWindow(SDL_Display, WMwindow, w, h);
  22.536 +		XResizeWindow(SDL_Display, WMwindow, w, h);
  22.537  	}
  22.538  
  22.539  	/* Create (or use) the X11 display window */
  22.540 @@ -901,14 +904,14 @@
  22.541  			swa.background_pixel = 0;
  22.542  			swa.border_pixel = 0;
  22.543  			swa.colormap = SDL_XColorMap;
  22.544 -			SDL_Window = pXCreateWindow(SDL_Display, WMwindow,
  22.545 +			SDL_Window = XCreateWindow(SDL_Display, WMwindow,
  22.546  		                           	0, 0, w, h, 0, depth,
  22.547  		                           	InputOutput, SDL_Visual,
  22.548  		                           	CWBackPixel | CWBorderPixel
  22.549  		                           	| CWColormap, &swa);
  22.550  		}
  22.551  		/* Only manage our input if we own the window */
  22.552 -		pXSelectInput(SDL_Display, SDL_Window,
  22.553 +		XSelectInput(SDL_Display, SDL_Window,
  22.554  					( EnterWindowMask | LeaveWindowMask
  22.555  					| ButtonPressMask | ButtonReleaseMask
  22.556  					| PointerMotionMask | ExposureMask ));
  22.557 @@ -924,7 +927,7 @@
  22.558  		XGCValues gcv;
  22.559  
  22.560  		gcv.graphics_exposures = False;
  22.561 -		SDL_GC = pXCreateGC(SDL_Display, SDL_Window,
  22.562 +		SDL_GC = XCreateGC(SDL_Display, SDL_Window,
  22.563  		                   GCGraphicsExposures, &gcv);
  22.564  		if ( ! SDL_GC ) {
  22.565  			SDL_SetError("Couldn't create graphics context");
  22.566 @@ -934,10 +937,10 @@
  22.567  
  22.568  	/* Set our colormaps when not setting a GL mode */
  22.569  	if ( ! (flags & SDL_OPENGL) ) {
  22.570 -		pXSetWindowColormap(SDL_Display, SDL_Window, SDL_XColorMap);
  22.571 +		XSetWindowColormap(SDL_Display, SDL_Window, SDL_XColorMap);
  22.572  		if( !SDL_windowid ) {
  22.573 -		    pXSetWindowColormap(SDL_Display, FSwindow, SDL_XColorMap);
  22.574 -		    pXSetWindowColormap(SDL_Display, WMwindow, SDL_XColorMap);
  22.575 +		    XSetWindowColormap(SDL_Display, FSwindow, SDL_XColorMap);
  22.576 +		    XSetWindowColormap(SDL_Display, WMwindow, SDL_XColorMap);
  22.577  		}
  22.578  	}
  22.579  
  22.580 @@ -952,7 +955,7 @@
  22.581  		xscreen = ScreenOfDisplay(SDL_Display, SDL_Screen);
  22.582  		a.backing_store = DoesBackingStore(xscreen);
  22.583  		if ( a.backing_store != NotUseful ) {
  22.584 -			pXChangeWindowAttributes(SDL_Display, SDL_Window,
  22.585 +			XChangeWindowAttributes(SDL_Display, SDL_Window,
  22.586  			                        CWBackingStore, &a);
  22.587  		}
  22.588  	}
  22.589 @@ -986,8 +989,8 @@
  22.590  
  22.591  	/* Map them both and go fullscreen, if requested */
  22.592  	if ( ! SDL_windowid ) {
  22.593 -		pXMapWindow(SDL_Display, SDL_Window);
  22.594 -		pXMapWindow(SDL_Display, WMwindow);
  22.595 +		XMapWindow(SDL_Display, SDL_Window);
  22.596 +		XMapWindow(SDL_Display, WMwindow);
  22.597  		X11_WaitMapped(this, WMwindow);
  22.598  		if ( flags & SDL_FULLSCREEN ) {
  22.599  			screen->flags |= SDL_FULLSCREEN;
  22.600 @@ -1008,7 +1011,7 @@
  22.601  		X11_SetSizeHints(this, w, h, flags);
  22.602  		window_w = w;
  22.603  		window_h = h;
  22.604 -		pXResizeWindow(SDL_Display, WMwindow, w, h);
  22.605 +		XResizeWindow(SDL_Display, WMwindow, w, h);
  22.606  
  22.607  		/* Resize the fullscreen and display windows */
  22.608  		if ( flags & SDL_FULLSCREEN ) {
  22.609 @@ -1024,7 +1027,7 @@
  22.610  				X11_LeaveFullScreen(this);
  22.611  			}
  22.612  		}
  22.613 -		pXResizeWindow(SDL_Display, SDL_Window, w, h);
  22.614 +		XResizeWindow(SDL_Display, SDL_Window, w, h);
  22.615  	}
  22.616  	return(0);
  22.617  }
  22.618 @@ -1046,7 +1049,7 @@
  22.619  	}
  22.620  
  22.621  	/* Flush any delayed updates */
  22.622 -	pXSync(GFX_Display, False);
  22.623 +	XSync(GFX_Display, False);
  22.624  
  22.625  	/* Set up the X11 window */
  22.626  	saved_flags = current->flags;
  22.627 @@ -1076,7 +1079,7 @@
  22.628  
  22.629    done:
  22.630  	/* Release the event thread */
  22.631 -	pXSync(SDL_Display, False);
  22.632 +	XSync(SDL_Display, False);
  22.633  	SDL_Unlock_EventThread();
  22.634  
  22.635  	/* We're done! */
  22.636 @@ -1125,7 +1128,7 @@
  22.637  
  22.638  	/* Lock the event thread, in multi-threading environments */
  22.639  	SDL_Lock_EventThread();
  22.640 -	if ( pXQueryPointer(SDL_Display, SDL_Window, &u1, &current_win,
  22.641 +	if ( XQueryPointer(SDL_Display, SDL_Window, &u1, &current_win,
  22.642  	                   &u2, &u2, &x, &y, &mask) ) {
  22.643  		if ( (x >= 0) && (x < SDL_VideoSurface->w) &&
  22.644  		     (y >= 0) && (y < SDL_VideoSurface->h) ) {
  22.645 @@ -1162,7 +1165,7 @@
  22.646  	 * XQueryColors sets the flags in the XColor struct, so we use
  22.647  	 * that to keep track of which colours are available
  22.648  	 */
  22.649 -	pXQueryColors(GFX_Display, SDL_XColorMap, all, 256);
  22.650 +	XQueryColors(GFX_Display, SDL_XColorMap, all, 256);
  22.651  
  22.652  	for(i = 0; i < nwant; i++) {
  22.653  		XColor *c;
  22.654 @@ -1188,7 +1191,7 @@
  22.655  		if(SDL_XPixels[best])
  22.656  			continue; /* already allocated, waste no more time */
  22.657  		c = all + best;
  22.658 -		if(pXAllocColor(GFX_Display, SDL_XColorMap, c)) {
  22.659 +		if(XAllocColor(GFX_Display, SDL_XColorMap, c)) {
  22.660  			/* got it */
  22.661  			colors[c->pixel].r = c->red >> 8;
  22.662  			colors[c->pixel].g = c->green >> 8;
  22.663 @@ -1230,8 +1233,8 @@
  22.664  			xcmap[i].blue  = (colors[i].b<<8)|colors[i].b;
  22.665  			xcmap[i].flags = (DoRed|DoGreen|DoBlue);
  22.666  		}
  22.667 -		pXStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
  22.668 -		pXSync(GFX_Display, False);
  22.669 +		XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
  22.670 +		XSync(GFX_Display, False);
  22.671  		SDL_stack_free(xcmap);
  22.672  	} else {
  22.673  	        /*
  22.674 @@ -1259,7 +1262,7 @@
  22.675  				--SDL_XPixels[pixel];
  22.676  			}
  22.677  		}
  22.678 -		pXFreeColors(GFX_Display, SDL_XColorMap, freelist, nfree, 0);
  22.679 +		XFreeColors(GFX_Display, SDL_XColorMap, freelist, nfree, 0);
  22.680  		SDL_stack_free(freelist);
  22.681  
  22.682  		want = SDL_stack_alloc(SDL_Color, ncolors);
  22.683 @@ -1276,7 +1279,7 @@
  22.684  			col.green = want[i].g << 8;
  22.685  			col.blue = want[i].b << 8;
  22.686  			col.flags = DoRed | DoGreen | DoBlue;
  22.687 -			if(pXAllocColor(GFX_Display, SDL_XColorMap, &col)) {
  22.688 +			if(XAllocColor(GFX_Display, SDL_XColorMap, &col)) {
  22.689  			        /* We got the colour, or at least the nearest
  22.690  				   the hardware could get. */
  22.691  			        colors[col.pixel].r = col.red >> 8;
  22.692 @@ -1320,8 +1323,8 @@
  22.693  		xcmap[i].blue  = ramp[2*256+c];
  22.694  		xcmap[i].flags = (DoRed|DoGreen|DoBlue);
  22.695  	}
  22.696 -	pXStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
  22.697 -	pXSync(GFX_Display, False);
  22.698 +	XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
  22.699 +	XSync(GFX_Display, False);
  22.700  	return(0);
  22.701  }
  22.702  
  22.703 @@ -1334,16 +1337,16 @@
  22.704  	/* The event thread should be done, so we can touch SDL_Display */
  22.705  	if ( SDL_Display != NULL ) {
  22.706  		/* Flush any delayed updates */
  22.707 -		pXSync(GFX_Display, False);
  22.708 +		XSync(GFX_Display, False);
  22.709  
  22.710  		/* Close the connection with the IM server */
  22.711  		#ifdef X_HAVE_UTF8_STRING
  22.712  		if (SDL_IC != NULL) {
  22.713 -			pXDestroyIC(SDL_IC);
  22.714 +			XDestroyIC(SDL_IC);
  22.715  			SDL_IC = NULL;
  22.716  		}
  22.717  		if (SDL_IM != NULL) {
  22.718 -			pXCloseIM(SDL_IM);
  22.719 +			XCloseIM(SDL_IM);
  22.720  			SDL_IM = NULL;
  22.721  		}
  22.722  		#endif
  22.723 @@ -1353,7 +1356,7 @@
  22.724  		X11_DestroyWindow(this, this->screen);
  22.725  		X11_FreeVideoModes(this);
  22.726  		if ( SDL_XColorMap != SDL_DisplayColormap ) {
  22.727 -			pXFreeColormap(SDL_Display, SDL_XColorMap);
  22.728 +			XFreeColormap(SDL_Display, SDL_XColorMap);
  22.729  		}
  22.730  		if ( SDL_iconcolors ) {
  22.731  			unsigned long pixel;
  22.732 @@ -1361,7 +1364,7 @@
  22.733  							 SDL_Screen);
  22.734  			for(pixel = 0; pixel < 256; ++pixel) {
  22.735  				while(SDL_iconcolors[pixel] > 0) {
  22.736 -					pXFreeColors(GFX_Display,
  22.737 +					XFreeColors(GFX_Display,
  22.738  						    dcmap, &pixel, 1, 0);
  22.739  					--SDL_iconcolors[pixel];
  22.740  				}
  22.741 @@ -1382,20 +1385,20 @@
  22.742  
  22.743  		/* Close the X11 graphics connection */
  22.744  		if ( GFX_Display != NULL ) {
  22.745 -			pXCloseDisplay(GFX_Display);
  22.746 +			XCloseDisplay(GFX_Display);
  22.747  			GFX_Display = NULL;
  22.748  		}
  22.749  
  22.750  		/* Close the X11 display connection */
  22.751 -		pXCloseDisplay(SDL_Display);
  22.752 +		XCloseDisplay(SDL_Display);
  22.753  		SDL_Display = NULL;
  22.754  
  22.755  		/* Reset the X11 error handlers */
  22.756  		if ( XIO_handler ) {
  22.757 -			pXSetIOErrorHandler(XIO_handler);
  22.758 +			XSetIOErrorHandler(XIO_handler);
  22.759  		}
  22.760  		if ( X_handler ) {
  22.761 -			pXSetErrorHandler(X_handler);
  22.762 +			XSetErrorHandler(X_handler);
  22.763  		}
  22.764  
  22.765  		/* Unload GL library after X11 shuts down */
    23.1 --- a/src/video/x11/SDL_x11wm.c	Wed Mar 22 04:51:44 2006 +0000
    23.2 +++ b/src/video/x11/SDL_x11wm.c	Wed Mar 22 05:00:59 2006 +0000
    23.3 @@ -116,7 +116,7 @@
    23.4  					SDL_iconcolors[i]--;
    23.5  				}
    23.6  			}
    23.7 -			pXFreeColors(GFX_Display, dcmap, freelist, nfree, 0);
    23.8 +			XFreeColors(GFX_Display, dcmap, freelist, nfree, 0);
    23.9  		}
   23.10  		if(!SDL_iconcolors)
   23.11  			SDL_iconcolors = SDL_malloc(256 * sizeof *SDL_iconcolors);
   23.12 @@ -131,7 +131,7 @@
   23.13  			c.green = want[i].g << 8;
   23.14  			c.blue = want[i].b << 8;
   23.15  			c.flags = DoRed | DoGreen | DoBlue;
   23.16 -			if(pXAllocColor(GFX_Display, dcmap, &c)) {
   23.17 +			if(XAllocColor(GFX_Display, dcmap, &c)) {
   23.18  				/* got the colour */
   23.19  				SDL_iconcolors[c.pixel]++;
   23.20  				got[c.pixel] = want[i];
   23.21 @@ -145,13 +145,13 @@
   23.22  			XColor cols[256];
   23.23  			for(i = 0; i < 256; i++)
   23.24  				cols[i].pixel = i;
   23.25 -			pXQueryColors(GFX_Display, dcmap, cols, 256);
   23.26 +			XQueryColors(GFX_Display, dcmap, cols, 256);
   23.27  			for(i = 0; i < 256; i++) {
   23.28  				got[i].r = cols[i].red >> 8;
   23.29  				got[i].g = cols[i].green >> 8;
   23.30  				got[i].b = cols[i].blue >> 8;
   23.31  				if(!SDL_iconcolors[i]) {
   23.32 -					if(pXAllocColor(GFX_Display, dcmap,
   23.33 +					if(XAllocColor(GFX_Display, dcmap,
   23.34  							cols + i)) {
   23.35  						SDL_iconcolors[i] = 1;
   23.36  					} else {
   23.37 @@ -184,13 +184,13 @@
   23.38  	SDL_memset(LSBmask, 0, masksize);
   23.39  	for(i = 0; i < masksize; i++)
   23.40  		LSBmask[i] = reverse_byte(mask[i]);
   23.41 -	mask_pixmap = pXCreatePixmapFromBitmapData(SDL_Display, WMwindow,
   23.42 +	mask_pixmap = XCreatePixmapFromBitmapData(SDL_Display, WMwindow,
   23.43  						  (char *)LSBmask,
   23.44  						  sicon->w, sicon->h,
   23.45  						  1L, 0L, 1);
   23.46  
   23.47  	/* Transfer the image to an X11 pixmap */
   23.48 -	icon_image = pXCreateImage(SDL_Display,
   23.49 +	icon_image = XCreateImage(SDL_Display,
   23.50  				  DefaultVisual(SDL_Display, SDL_Screen),
   23.51  				  DefaultDepth(SDL_Display, SDL_Screen),
   23.52  				  ZPixmap, 0, sicon->pixels,
   23.53 @@ -198,13 +198,13 @@
   23.54  				  32, 0);
   23.55  	icon_image->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)
   23.56  		                 ? MSBFirst : LSBFirst;
   23.57 -	icon_pixmap = pXCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h,
   23.58 +	icon_pixmap = XCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h,
   23.59  				    DefaultDepth(SDL_Display, SDL_Screen));
   23.60 -	gc = pXCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues);
   23.61 -	pXPutImage(SDL_Display, icon_pixmap, gc, icon_image,
   23.62 +	gc = XCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues);
   23.63 +	XPutImage(SDL_Display, icon_pixmap, gc, icon_image,
   23.64  		  0, 0, 0, 0, sicon->w, sicon->h);
   23.65 -	pXFreeGC(SDL_Display, gc);
   23.66 -	pXDestroyImage(icon_image);
   23.67 +	XFreeGC(SDL_Display, gc);
   23.68 +	XDestroyImage(icon_image);
   23.69  	SDL_free(LSBmask);
   23.70  	sicon->pixels = NULL;
   23.71  
   23.72 @@ -213,17 +213,17 @@
   23.73  	   it screws up others. The default is only to use a pixmap. */
   23.74  	p = SDL_getenv("SDL_VIDEO_X11_ICONWIN");
   23.75  	if(p && *p) {
   23.76 -		icon_window = pXCreateSimpleWindow(SDL_Display, SDL_Root,
   23.77 +		icon_window = XCreateSimpleWindow(SDL_Display, SDL_Root,
   23.78  						  0, 0, sicon->w, sicon->h, 0,
   23.79  						  CopyFromParent,
   23.80  						  CopyFromParent);
   23.81 -		pXSetWindowBackgroundPixmap(SDL_Display, icon_window,
   23.82 +		XSetWindowBackgroundPixmap(SDL_Display, icon_window,
   23.83  					   icon_pixmap);
   23.84 -		pXClearWindow(SDL_Display, icon_window);
   23.85 +		XClearWindow(SDL_Display, icon_window);
   23.86  	}
   23.87  
   23.88  	/* Set the window icon to the icon pixmap (and icon window) */
   23.89 -	wmhints = pXAllocWMHints();
   23.90 +	wmhints = XAllocWMHints();
   23.91  	wmhints->flags = (IconPixmapHint | IconMaskHint);
   23.92  	wmhints->icon_pixmap = icon_pixmap;
   23.93  	wmhints->icon_mask = mask_pixmap;
   23.94 @@ -231,9 +231,9 @@
   23.95  		wmhints->flags |= IconWindowHint;
   23.96  		wmhints->icon_window = icon_window;
   23.97  	}
   23.98 -	pXSetWMHints(SDL_Display, WMwindow, wmhints);
   23.99 -	pXFree(wmhints);
  23.100 -	pXSync(SDL_Display, False);
  23.101 +	XSetWMHints(SDL_Display, WMwindow, wmhints);
  23.102 +	XFree(wmhints);
  23.103 +	XSync(SDL_Display, False);
  23.104  
  23.105    done:
  23.106  	SDL_Unlock_EventThread();
  23.107 @@ -250,8 +250,10 @@
  23.108  	Atom _NET_WM_ICON_NAME;
  23.109  
  23.110  	/* Look up some useful Atoms */
  23.111 -	_NET_WM_NAME = pXInternAtom(SDL_Display, "_NET_WM_NAME", False);
  23.112 -	_NET_WM_ICON_NAME = pXInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
  23.113 +	if (SDL_X11_HAVE_UTF8) {
  23.114 +		_NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
  23.115 +		_NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
  23.116 +	}
  23.117  #endif
  23.118  
  23.119  	/* Lock the event thread, in multi-threading environments */
  23.120 @@ -263,18 +265,20 @@
  23.121  			SDL_OutOfMemory();
  23.122  			return;
  23.123  		}
  23.124 -		status = pXStringListToTextProperty(&title_latin1, 1, &titleprop);
  23.125 +		status = XStringListToTextProperty(&title_latin1, 1, &titleprop);
  23.126  		SDL_free(title_latin1);
  23.127  		if ( status ) {
  23.128 -			pXSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  23.129 -			pXFree(titleprop.value);
  23.130 +			XSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
  23.131 +			XFree(titleprop.value);
  23.132  		}
  23.133  #ifdef X_HAVE_UTF8_STRING
  23.134 -		status = pXutf8TextListToTextProperty(SDL_Display,
  23.135 -				(char **)&title, 1, XUTF8StringStyle, &titleprop);
  23.136 -		if ( status == Success ) {
  23.137 -			pXSetTextProperty(SDL_Display, WMwindow, &titleprop, _NET_WM_NAME);
  23.138 -			pXFree(titleprop.value);
  23.139 +		if (SDL_X11_HAVE_UTF8) {
  23.140 +			status = Xutf8TextListToTextProperty(SDL_Display,
  23.141 +					(char **)&title, 1, XUTF8StringStyle, &titleprop);
  23.142 +			if ( status == Success ) {
  23.143 +				XSetTextProperty(SDL_Display, WMwindow, &titleprop, _NET_WM_NAME);
  23.144 +				XFree(titleprop.value);
  23.145 +			}
  23.146  		}
  23.147  #endif
  23.148  	}
  23.149 @@ -284,22 +288,24 @@
  23.150  			SDL_OutOfMemory();
  23.151  			return;
  23.152  		}
  23.153 -		status = pXStringListToTextProperty(&icon_latin1, 1, &iconprop);
  23.154 +		status = XStringListToTextProperty(&icon_latin1, 1, &iconprop);
  23.155  		SDL_free(icon_latin1);
  23.156  		if ( status ) {
  23.157 -			pXSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  23.158 -			pXFree(iconprop.value);
  23.159 +			XSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
  23.160 +			XFree(iconprop.value);
  23.161  		}
  23.162  #ifdef X_HAVE_UTF8_STRING
  23.163 -		status = pXutf8TextListToTextProperty(SDL_Display,
  23.164 -				(char **)&icon, 1, XUTF8StringStyle, &iconprop);
  23.165 -		if ( status == Success ) {
  23.166 -			pXSetTextProperty(SDL_Display, WMwindow, &iconprop, _NET_WM_ICON_NAME);
  23.167 -			pXFree(iconprop.value);
  23.168 +		if (SDL_X11_HAVE_UTF8) {
  23.169 +			status = Xutf8TextListToTextProperty(SDL_Display,
  23.170 +					(char **)&icon, 1, XUTF8StringStyle, &iconprop);
  23.171 +			if ( status == Success ) {
  23.172 +				XSetTextProperty(SDL_Display, WMwindow, &iconprop, _NET_WM_ICON_NAME);
  23.173 +				XFree(iconprop.value);
  23.174 +			}
  23.175  		}
  23.176  #endif
  23.177  	}
  23.178 -	pXSync(SDL_Display, False);
  23.179 +	XSync(SDL_Display, False);
  23.180  
  23.181  	SDL_Unlock_EventThread();
  23.182  }
  23.183 @@ -310,8 +316,8 @@
  23.184  	int result;
  23.185  
  23.186  	SDL_Lock_EventThread();
  23.187 -	result = pXIconifyWindow(SDL_Display, WMwindow, SDL_Screen);
  23.188 -	pXSync(SDL_Display, False);
  23.189 +	result = XIconifyWindow(SDL_Display, WMwindow, SDL_Screen);
  23.190 +	XSync(SDL_Display, False);
  23.191  	SDL_Unlock_EventThread();
  23.192  	return(result);
  23.193  }
  23.194 @@ -327,12 +333,12 @@
  23.195  		return(mode);	/* Will be set later on mode switch */
  23.196  	}
  23.197  	if ( mode == SDL_GRAB_OFF ) {
  23.198 -		pXUngrabPointer(SDL_Display, CurrentTime);
  23.199 -		pXUngrabKeyboard(SDL_Display, CurrentTime);
  23.200 +		XUngrabPointer(SDL_Display, CurrentTime);
  23.201 +		XUngrabKeyboard(SDL_Display, CurrentTime);
  23.202  	} else {
  23.203  		if ( this->screen->flags & SDL_FULLSCREEN ) {
  23.204  			/* Unbind the mouse from the fullscreen window */
  23.205 -			pXUngrabPointer(SDL_Display, CurrentTime);
  23.206 +			XUngrabPointer(SDL_Display, CurrentTime);
  23.207  		}
  23.208  		/* Try to grab the mouse */
  23.209  #if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */
  23.210 @@ -340,7 +346,7 @@
  23.211  #else
  23.212  		while ( 1 ) {
  23.213  #endif
  23.214 -			result = pXGrabPointer(SDL_Display, SDL_Window, True, 0,
  23.215 +			result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
  23.216  						GrabModeAsync, GrabModeAsync,
  23.217  						SDL_Window, None, CurrentTime);
  23.218  			if ( result == GrabSuccess ) {
  23.219 @@ -352,17 +358,17 @@
  23.220  			/* Uh, oh, what do we do here? */ ;
  23.221  		}
  23.222  		/* Now grab the keyboard */
  23.223 -		pXGrabKeyboard(SDL_Display, WMwindow, True,
  23.224 +		XGrabKeyboard(SDL_Display, WMwindow, True,
  23.225  				GrabModeAsync, GrabModeAsync, CurrentTime);
  23.226  
  23.227  		/* Raise the window if we grab the mouse */
  23.228  		if ( !(this->screen->flags & SDL_FULLSCREEN) )
  23.229 -			pXRaiseWindow(SDL_Display, WMwindow);
  23.230 +			XRaiseWindow(SDL_Display, WMwindow);
  23.231  
  23.232  		/* Make sure we register input focus */
  23.233  		SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
  23.234  	}
  23.235 -	pXSync(SDL_Display, False);
  23.236 +	XSync(SDL_Display, False);
  23.237  
  23.238  	return(mode);
  23.239  }
  23.240 @@ -387,7 +393,7 @@
  23.241  {
  23.242  	/* Make sure any X11 transactions are completed */
  23.243  	SDL_VideoDevice *this = current_video;
  23.244 -	pXSync(SDL_Display, False);
  23.245 +	XSync(SDL_Display, False);
  23.246  	SDL_Unlock_EventThread();
  23.247  }
  23.248  int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
    24.1 --- a/src/video/x11/SDL_x11yuv.c	Wed Mar 22 04:51:44 2006 +0000
    24.2 +++ b/src/video/x11/SDL_x11yuv.c	Wed Mar 22 05:00:59 2006 +0000
    24.3 @@ -151,7 +151,7 @@
    24.4  					}
    24.5  				}
    24.6  				if ( formats ) {
    24.7 -					pXFree(formats);
    24.8 +					XFree(formats);
    24.9  				}
   24.10  			}
   24.11  		}
   24.12 @@ -200,21 +200,21 @@
   24.13  		unsigned int i;
   24.14  
   24.15  		SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, True);
   24.16 -		X_handler = pXSetErrorHandler(xv_errhandler);
   24.17 +		X_handler = XSetErrorHandler(xv_errhandler);
   24.18  		for ( i=0; i < sizeof(attr)/(sizeof attr[0]); ++i ) {
   24.19  			Atom a;
   24.20  
   24.21  			xv_error = False;
   24.22 -			a = pXInternAtom(GFX_Display, attr[i], True);
   24.23 +			a = XInternAtom(GFX_Display, attr[i], True);
   24.24  			if ( a != None ) {
   24.25       				SDL_NAME(XvSetPortAttribute)(GFX_Display, xv_port, a, 1);
   24.26 -				pXSync(GFX_Display, True);
   24.27 +				XSync(GFX_Display, True);
   24.28  				if ( ! xv_error ) {
   24.29  					break;
   24.30  				}
   24.31  			}
   24.32  		}
   24.33 -		pXSetErrorHandler(X_handler);
   24.34 +		XSetErrorHandler(X_handler);
   24.35  		SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, False);
   24.36  	}
   24.37  
   24.38 @@ -254,7 +254,7 @@
   24.39  #ifdef PITCH_WORKAROUND
   24.40  	if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
   24.41  		/* Ajust overlay width according to pitch */ 
   24.42 -		pXFree(hwdata->image);
   24.43 +		XFree(hwdata->image);
   24.44  		width = hwdata->image->pitches[0] / bpp;
   24.45  		hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
   24.46  							   0, width, height, yuvshm);
   24.47 @@ -269,10 +269,10 @@
   24.48  			yuvshm->readOnly = False;
   24.49  			if ( yuvshm->shmaddr != (char *)-1 ) {
   24.50  				shm_error = False;
   24.51 -				X_handler = pXSetErrorHandler(shm_errhandler);
   24.52 -				pXShmAttach(GFX_Display, yuvshm);
   24.53 -				pXSync(GFX_Display, True);
   24.54 -				pXSetErrorHandler(X_handler);
   24.55 +				X_handler = XSetErrorHandler(shm_errhandler);
   24.56 +				XShmAttach(GFX_Display, yuvshm);
   24.57 +				XSync(GFX_Display, True);
   24.58 +				XSetErrorHandler(X_handler);
   24.59  				if ( shm_error )
   24.60  					shmdt(yuvshm->shmaddr);
   24.61  			} else {
   24.62 @@ -283,7 +283,7 @@
   24.63  			shm_error = True;
   24.64  		}
   24.65  		if ( shm_error ) {
   24.66 -			pXFree(hwdata->image);
   24.67 +			XFree(hwdata->image);
   24.68  			hwdata->yuv_use_mitshm = 0;
   24.69  		} else {
   24.70  			hwdata->image->data = yuvshm->shmaddr;
   24.71 @@ -298,7 +298,7 @@
   24.72  #ifdef PITCH_WORKAROUND
   24.73  		if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
   24.74  			/* Ajust overlay width according to pitch */ 
   24.75 -			pXFree(hwdata->image);
   24.76 +			XFree(hwdata->image);
   24.77  			width = hwdata->image->pitches[0] / bpp;
   24.78  			hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
   24.79  								0, width, height);
   24.80 @@ -372,7 +372,7 @@
   24.81  				     hwdata->image, 0, 0, overlay->w, overlay->h,
   24.82  				     dstrect->x, dstrect->y, dstrect->w, dstrect->h);
   24.83  	}
   24.84 -	pXSync(GFX_Display, False);
   24.85 +	XSync(GFX_Display, False);
   24.86  	return(0);
   24.87  }
   24.88  
   24.89 @@ -385,12 +385,12 @@
   24.90  		SDL_NAME(XvUngrabPort)(GFX_Display, hwdata->port, CurrentTime);
   24.91  #ifndef NO_SHARED_MEMORY
   24.92  		if ( hwdata->yuv_use_mitshm ) {
   24.93 -			pXShmDetach(GFX_Display, &hwdata->yuvshm);
   24.94 +			XShmDetach(GFX_Display, &hwdata->yuvshm);
   24.95  			shmdt(hwdata->yuvshm.shmaddr);
   24.96  		}
   24.97  #endif
   24.98  		if ( hwdata->image ) {
   24.99 -			pXFree(hwdata->image);
  24.100 +			XFree(hwdata->image);
  24.101  		}
  24.102  		SDL_free(hwdata);
  24.103  	}