Mercurial > sdl-ios-xcode
annotate src/video/x11/SDL_x11video.h @ 659:e3d0517bf67e
*** empty log message ***
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 26 Jul 2003 19:50:00 +0000 |
parents | f6ffac90895c |
children | b8d311d90021 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
297
f6ffac90895c
Updated copyright information for 2002
Sam Lantinga <slouken@libsdl.org>
parents:
292
diff
changeset
|
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
242
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #ifndef _SDL_x11video_h | |
29 #define _SDL_x11video_h | |
30 | |
31 #include <X11/Xlib.h> | |
32 #include <X11/Xutil.h> | |
33 #include <X11/Xatom.h> | |
34 #ifndef NO_SHARED_MEMORY | |
35 #include <sys/ipc.h> | |
36 #include <sys/shm.h> | |
37 #include <X11/extensions/XShm.h> | |
38 #endif | |
39 #ifdef XFREE86_DGAMOUSE | |
292
eadc0746dfaf
Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
270
diff
changeset
|
40 #include <XFree86/extensions/xf86dga.h> |
0 | 41 #endif |
42 #ifdef XFREE86_VM | |
292
eadc0746dfaf
Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
270
diff
changeset
|
43 #include <XFree86/extensions/xf86vmode.h> |
0 | 44 #endif |
242
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
45 #ifdef HAVE_XIGXME |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
46 #include <X11/extensions/xme.h> |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
47 #endif |
227
24878c14b391
Added X11 Xinerama support - fullscreen starts on screen 0
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
48 |
0 | 49 #include <string.h> |
50 | |
51 #include "SDL_mouse.h" | |
52 #include "SDL_sysvideo.h" | |
53 | |
54 /* Hidden "this" pointer for the video functions */ | |
55 #define _THIS SDL_VideoDevice *this | |
56 | |
57 /* Private display data */ | |
58 struct SDL_PrivateVideoData { | |
59 int local_X11; /* Flag: true if local display */ | |
60 Display *X11_Display; /* Used for events and window management */ | |
61 Display *GFX_Display; /* Used for graphics and colormap stuff */ | |
62 Visual *SDL_Visual; /* The visual used by our window */ | |
63 Window WMwindow; /* Input window, managed by window manager */ | |
64 Window FSwindow; /* Fullscreen window, completely unmanaged */ | |
65 Window SDL_Window; /* Shared by both displays (no X security?) */ | |
66 Atom WM_DELETE_WINDOW; /* "close-window" protocol atom */ | |
67 WMcursor *BlankCursor; /* The invisible cursor */ | |
68 | |
69 char *SDL_windowid; /* Flag: true if we have been passed a window */ | |
70 | |
71 /* Direct Graphics Access extension information */ | |
72 int using_dga; | |
73 | |
74 #ifndef NO_SHARED_MEMORY | |
75 /* MIT shared memory extension information */ | |
76 int use_mitshm; | |
77 XShmSegmentInfo shminfo; | |
78 #endif | |
79 | |
80 /* The variables used for displaying graphics */ | |
81 XImage *Ximage; /* The X image for our window */ | |
82 GC gc; /* The graphic context for drawing */ | |
83 | |
84 /* The current width and height of the fullscreen mode */ | |
85 int current_w; | |
86 int current_h; | |
87 | |
88 /* Support for internal mouse warping */ | |
89 struct { | |
90 int x; | |
91 int y; | |
92 } mouse_last; | |
93 struct { | |
94 int numerator; | |
95 int denominator; | |
96 int threshold; | |
97 } mouse_accel; | |
98 int mouse_relative; | |
99 | |
100 /* The current list of available video modes */ | |
101 SDL_Rect **modelist; | |
102 | |
103 /* available visuals of interest to us, sorted deepest first */ | |
104 struct { | |
105 Visual *visual; | |
106 int depth; /* number of significant bits/pixel */ | |
107 int bpp; /* pixel quantum in bits */ | |
108 } visuals[2*5]; /* at most 2 entries for 8, 15, 16, 24, 32 */ | |
109 int nvisuals; | |
110 | |
111 Visual *vis; /* current visual in use */ | |
112 int depth; /* current visual depth (not bpp) */ | |
113 | |
114 /* Variables used by the X11 video mode code */ | |
115 #ifdef XFREE86_VM | |
292
eadc0746dfaf
Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
270
diff
changeset
|
116 SDL_NAME(XF86VidModeModeInfo) saved_mode; |
0 | 117 struct { |
118 int x, y; | |
119 } saved_view; | |
120 #endif | |
242
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
121 #ifdef HAVE_XIGXME /* XiG XME fullscreen */ |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
122 int use_xme; |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
123 XiGMiscResolutionInfo saved_res; |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
124 #endif |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
125 |
227
24878c14b391
Added X11 Xinerama support - fullscreen starts on screen 0
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
126 int xinerama_x; |
24878c14b391
Added X11 Xinerama support - fullscreen starts on screen 0
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
127 int xinerama_y; |
0 | 128 int use_vidmode; |
129 int currently_fullscreen; | |
130 | |
131 /* Automatic mode switching support (entering/leaving fullscreen) */ | |
132 Uint32 switch_waiting; | |
133 Uint32 switch_time; | |
134 | |
135 /* Prevent too many XSync() calls */ | |
136 int blit_queued; | |
137 | |
138 /* Colormap handling */ | |
139 Colormap DisplayColormap; /* The default display colormap */ | |
140 Colormap XColorMap; /* The current window colormap */ | |
141 int *XPixels; /* pixels value allocation counts */ | |
142 float gamma_saved[3]; /* Saved gamma values for VidMode gamma */ | |
143 int gamma_changed; /* flag: has VidMode gamma been modified? */ | |
144 | |
145 short *iconcolors; /* List of colors used by the icon */ | |
146 }; | |
147 | |
148 /* Old variable names */ | |
149 #define local_X11 (this->hidden->local_X11) | |
150 #define SDL_Display (this->hidden->X11_Display) | |
151 #define GFX_Display (this->hidden->GFX_Display) | |
152 #define SDL_Screen DefaultScreen(this->hidden->X11_Display) | |
153 | |
154 #define SDL_Visual (this->hidden->vis) | |
155 | |
156 #define SDL_Root RootWindow(SDL_Display, SDL_Screen) | |
157 #define WMwindow (this->hidden->WMwindow) | |
158 #define FSwindow (this->hidden->FSwindow) | |
159 #define SDL_Window (this->hidden->SDL_Window) | |
160 #define WM_DELETE_WINDOW (this->hidden->WM_DELETE_WINDOW) | |
161 #define SDL_BlankCursor (this->hidden->BlankCursor) | |
162 #define SDL_windowid (this->hidden->SDL_windowid) | |
163 #define using_dga (this->hidden->using_dga) | |
164 #define use_mitshm (this->hidden->use_mitshm) | |
165 #define shminfo (this->hidden->shminfo) | |
166 #define SDL_Ximage (this->hidden->Ximage) | |
167 #define SDL_GC (this->hidden->gc) | |
168 #define current_w (this->hidden->current_w) | |
169 #define current_h (this->hidden->current_h) | |
170 #define mouse_last (this->hidden->mouse_last) | |
171 #define mouse_accel (this->hidden->mouse_accel) | |
172 #define mouse_relative (this->hidden->mouse_relative) | |
173 #define SDL_modelist (this->hidden->modelist) | |
174 #define saved_mode (this->hidden->saved_mode) | |
175 #define saved_view (this->hidden->saved_view) | |
242
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
176 #define use_xme (this->hidden->use_xme) |
4bcb29d3769c
Added support for Xi Graphics XME fullscreen extension
Sam Lantinga <slouken@libsdl.org>
parents:
227
diff
changeset
|
177 #define saved_res (this->hidden->saved_res) |
227
24878c14b391
Added X11 Xinerama support - fullscreen starts on screen 0
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
178 #define xinerama_x (this->hidden->xinerama_x) |
24878c14b391
Added X11 Xinerama support - fullscreen starts on screen 0
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
179 #define xinerama_y (this->hidden->xinerama_y) |
0 | 180 #define use_vidmode (this->hidden->use_vidmode) |
181 #define currently_fullscreen (this->hidden->currently_fullscreen) | |
182 #define switch_waiting (this->hidden->switch_waiting) | |
183 #define switch_time (this->hidden->switch_time) | |
184 #define blit_queued (this->hidden->blit_queued) | |
185 #define SDL_DisplayColormap (this->hidden->DisplayColormap) | |
186 #define SDL_PrivateColormap (this->hidden->PrivateColormap) | |
187 #define SDL_XColorMap (this->hidden->XColorMap) | |
188 #define SDL_XPixels (this->hidden->XPixels) | |
189 #define gamma_saved (this->hidden->gamma_saved) | |
190 #define gamma_changed (this->hidden->gamma_changed) | |
191 #define SDL_iconcolors (this->hidden->iconcolors) | |
192 | |
193 /* Some versions of XFree86 have bugs - detect if this is one of them */ | |
194 #define BUGGY_XFREE86(condition, buggy_version) \ | |
195 ((strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \ | |
196 (VendorRelease(SDL_Display) condition buggy_version)) | |
197 | |
198 #endif /* _SDL_x11video_h */ |