Mercurial > sdl-ios-xcode
annotate src/video/x11/SDL_x11dyn.h @ 4586:e479c1e57c52
SDL_Textures should work with XRender now provided that the texture format and screen format match. This is only a temporary limitation.
author | Sunny Sachanandani <sunnysachanandani@gmail.com> |
---|---|
date | Wed, 16 Jun 2010 10:50:01 +0530 |
parents | cfea5b007bc7 |
children | d7535d7a40ea |
rev | line source |
---|---|
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
3697 | 3 Copyright (C) 1997-2010 Sam Lantinga |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
3697 | 6 modify it under the terms of the GNU Lesser General Public |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
3697 | 8 version 2.1 of the License, or (at your option) any later version. |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3697 | 13 Lesser General Public License for more details. |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
3697 | 15 You should have received a copy of the GNU Lesser General Public |
16 License along with this library; if not, write to the Free Software | |
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 */ |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 #include "SDL_config.h" |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 #ifndef _SDL_x11dyn_h |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 #define _SDL_x11dyn_h |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 #include <X11/Xlib.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 #include <X11/Xutil.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 #include <X11/Xatom.h> |
3633
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
30 |
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
31 /* Apparently some X11 systems can't include this multiple times... */ |
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
32 #ifndef SDL_INCLUDED_XLIBINT_H |
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
33 #define SDL_INCLUDED_XLIBINT_H 1 |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 #include <X11/Xlibint.h> |
3633
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
35 #endif |
81dde1b00bf1
Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
2859
diff
changeset
|
36 |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
37 #include <X11/Xproto.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
38 #include "../Xext/extensions/Xext.h" |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
39 #include "../Xext/extensions/extutil.h" |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 #ifndef NO_SHARED_MEMORY |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
42 #include <sys/ipc.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
43 #include <sys/shm.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
44 #include <X11/extensions/XShm.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
45 #endif |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
46 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
47 #if SDL_VIDEO_DRIVER_X11_XRANDR |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
48 #include <X11/extensions/Xrandr.h> |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
49 #endif |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
50 |
2763
6fc50bdd88c0
Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents:
2710
diff
changeset
|
51 #if SDL_VIDEO_DRIVER_X11_XINPUT |
6fc50bdd88c0
Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents:
2710
diff
changeset
|
52 #include <X11/extensions/XInput.h> |
6fc50bdd88c0
Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents:
2710
diff
changeset
|
53 #endif |
6fc50bdd88c0
Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents:
2710
diff
changeset
|
54 |
4570
36fad921c97f
Adding a few #defines for Xrender support.
Sunny Sachanandani <sunnysachanandani@gmail.com>
parents:
3697
diff
changeset
|
55 #if SDL_VIDEO_DRIVER_X11_XRENDER |
4580
cfea5b007bc7
Fix the rendering color channels to be premultiplied with the alpha channel as thats what Xrender expects. Small fixes in X11_CreateTexture. Add some new functions in SDL_x11sym.h as well as support for Xrender.
Sunny Sachanandani <sunnysachanandani@gmail.com>
parents:
4570
diff
changeset
|
56 #include <X11/extensions/Xrender.h> |
4570
36fad921c97f
Adding a few #defines for Xrender support.
Sunny Sachanandani <sunnysachanandani@gmail.com>
parents:
3697
diff
changeset
|
57 #endif |
36fad921c97f
Adding a few #defines for Xrender support.
Sunny Sachanandani <sunnysachanandani@gmail.com>
parents:
3697
diff
changeset
|
58 |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
59 /* |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
60 * When using the "dynamic X11" functionality, we duplicate all the Xlib |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 * symbols that would be referenced by SDL inside of SDL itself. |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 * These duplicated symbols just serve as passthroughs to the functions |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 * in Xlib, that was dynamically loaded. |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 * |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 * This allows us to use Xlib as-is when linking against it directly, but |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 * also handles all the strange cases where there was code in the Xlib |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
67 * headers that may or may not exist or vary on a given platform. |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 */ |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 #ifdef __cplusplus |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 extern "C" |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
71 { |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 #endif |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
74 /* evil function signatures... */ |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
75 typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *, |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
76 xEvent *); |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 typedef int (*SDL_X11_XSynchronizeRetType) (Display *); |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *, |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
79 xEvent *); |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
80 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
81 int SDL_X11_LoadSymbols(void); |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 void SDL_X11_UnloadSymbols(void); |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
83 |
2325
c7bcf84ba1b9
Next version of internationalized input for X11. On my machine (famous last words :-) with a US English keyboard and locale I can compose ` and e and get a text
Bob Pendleton <bob@pendleton.com>
parents:
1950
diff
changeset
|
84 /* That's really annoying...make these function pointers no matter what. */ |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
85 #ifdef X_HAVE_UTF8_STRING |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
86 extern XIC(*pXCreateIC) (XIM, ...); |
2325
c7bcf84ba1b9
Next version of internationalized input for X11. On my machine (famous last words :-) with a US English keyboard and locale I can compose ` and e and get a text
Bob Pendleton <bob@pendleton.com>
parents:
1950
diff
changeset
|
87 extern char *(*pXGetICValues) (XIC, ...); |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
88 #endif |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
89 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 /* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */ |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
91 #define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname; |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 #define SDL_X11_SYM(rc,fn,params,args,ret) |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 #include "SDL_x11sym.h" |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
94 #undef SDL_X11_MODULE |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
95 #undef SDL_X11_SYM |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
97 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
98 #ifdef __cplusplus |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
99 } |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 #endif |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
101 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
102 #endif /* !defined _SDL_x11dyn_h */ |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
103 /* vi: set ts=4 sw=4 expandtab: */ |