annotate src/video/x11/SDL_x11dyn.h @ 1351:82c38796c7ca

Changed X11 header order so it works on Solaris. Fixes Bugzilla #138. --ryan.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 08 Feb 2006 20:29:12 +0000
parents 2b3ebc327017
children 19418e4422cb
rev   line source
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1 /*
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3 Copyright (C) 1997-2004 Sam Lantinga
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
6 modify it under the terms of the GNU Library General Public
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
8 version 2 of the License, or (at your option) any later version.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
9
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
13 Library General Public License for more details.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
14
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
15 You should have received a copy of the GNU Library General Public
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
18
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
19 Sam Lantinga
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
20 slouken@libsdl.org
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
21 */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
22
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23 #ifndef _SDL_x11dyn_h
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 #define _SDL_x11dyn_h
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
25
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
26 #include <X11/Xlib.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 #include <X11/Xutil.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28 #include <X11/Xatom.h>
1351
82c38796c7ca Changed X11 header order so it works on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 1314
diff changeset
29 #include <X11/Xlibint.h>
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
30 #include <X11/Xproto.h>
1169
4b3e2294782d Date: Sun, 06 Nov 2005 18:23:03 +0900
Ryan C. Gordon <icculus@icculus.org>
parents: 1168
diff changeset
31
1306
0c105755b110 Changed references to XFree86 to Xext to match change in directory structure.
Ryan C. Gordon <icculus@icculus.org>
parents: 1299
diff changeset
32 #include <Xext/extensions/extutil.h>
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
33
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34 #ifndef NO_SHARED_MEMORY
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35 #include <sys/ipc.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 #include <sys/shm.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37 #include <X11/extensions/XShm.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
38 #endif
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40 /*
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 * Never reference Xlib directly...we might load it dynamically at runtime.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 * Even if we don't, for readability, we still use the function pointers
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 * (although the symbol resolution will be done by the loader in that case).
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44 *
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45 * We define SDL_X11_SYM and include SDL_x11sym.h to accomplish various
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 * goals, without having to duplicate those function signatures.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47 */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 #ifdef __cplusplus
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 extern "C" {
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50 #endif
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52 /* evil function signatures... */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
53 typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
54 typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
55 typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
1248
d2c6881935be Catch X11 extension errors...since most of these are notifications that we
Ryan C. Gordon <icculus@icculus.org>
parents: 1244
diff changeset
56 typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
57
1235
f60f6f4ffc6f Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents: 1226
diff changeset
58 #define SDL_X11_SYM(req,ret,fn,params) extern ret (*p##fn) params;
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
59 #include "SDL_x11sym.h"
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
60 #undef SDL_X11_SYM
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
61
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
62 /* Macro in the xlib headers, not an actual symbol... */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
63 #define pXDestroyImage XDestroyImage
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
64
1226
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
65 /* Workaround code in headers... */
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
66 #if !__SDL_NO_REDEFINE_X11_HEADER_SYMS
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
67 #define _XFlush p_XFlush
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
68 #define _XFlushGCCache p_XFlushGCCache
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
69 #define _XReply p_XReply
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
70 #define _XSend p_XSend
1299
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
71 #define XFree pXFree
1226
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
72 #define _XData32 p_XData32
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
73
1299
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
74 #if defined(__osf__) && defined(X11_DYNAMIC)
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
75 #define _SmtBufferOverflow p_SmtBufferOverflow
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
76 #define _SmtIpError p_SmtIpError
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
77 #define ipAllocateData pipAllocateData
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
78 #define ipUnallocateAndSendData pipUnallocateAndSendData
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
79 #endif
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
80
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
81 #endif /* !__SDL_NO_REDEFINE_X11_HEADER_SYMS */
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
82
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
83 int SDL_X11_LoadSymbols(void);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
84 void SDL_X11_UnloadSymbols(void);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
85
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
86 #ifdef __cplusplus
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
87 }
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
88 #endif
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
89
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
90 #endif /* !defined _SDL_x11dyn_h */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
91