comparison src/video/x11/SDL_x11video.h @ 1895:c121d94672cb

SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jul 2006 21:04:37 +0000
parents 5652192b9c8b
children
comparison
equal deleted inserted replaced
1894:c69cee13dd76 1895:c121d94672cb
34 #if SDL_VIDEO_DRIVER_X11_DGAMOUSE 34 #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
35 #include "../Xext/extensions/xf86dga.h" 35 #include "../Xext/extensions/xf86dga.h"
36 #endif 36 #endif
37 #if SDL_VIDEO_DRIVER_X11_XINERAMA 37 #if SDL_VIDEO_DRIVER_X11_XINERAMA
38 #include "../Xext/extensions/Xinerama.h" 38 #include "../Xext/extensions/Xinerama.h"
39 #endif 39 #endif
40 #if SDL_VIDEO_DRIVER_X11_XRANDR 40 #if SDL_VIDEO_DRIVER_X11_XRANDR
41 #include <X11/extensions/Xrandr.h> 41 #include <X11/extensions/Xrandr.h>
42 #endif 42 #endif
43 #if SDL_VIDEO_DRIVER_X11_VIDMODE 43 #if SDL_VIDEO_DRIVER_X11_VIDMODE
44 #include "../Xext/extensions/xf86vmode.h" 44 #include "../Xext/extensions/xf86vmode.h"
54 54
55 /* Hidden "this" pointer for the video functions */ 55 /* Hidden "this" pointer for the video functions */
56 #define _THIS SDL_VideoDevice *this 56 #define _THIS SDL_VideoDevice *this
57 57
58 /* Private display data */ 58 /* Private display data */
59 struct SDL_PrivateVideoData { 59 struct SDL_PrivateVideoData
60 int local_X11; /* Flag: true if local display */ 60 {
61 Display *X11_Display; /* Used for events and window management */ 61 int local_X11; /* Flag: true if local display */
62 Display *GFX_Display; /* Used for graphics and colormap stuff */ 62 Display *X11_Display; /* Used for events and window management */
63 Visual *SDL_Visual; /* The visual used by our window */ 63 Display *GFX_Display; /* Used for graphics and colormap stuff */
64 Window WMwindow; /* Input window, managed by window manager */ 64 Visual *SDL_Visual; /* The visual used by our window */
65 Window FSwindow; /* Fullscreen window, completely unmanaged */ 65 Window WMwindow; /* Input window, managed by window manager */
66 Window SDL_Window; /* Shared by both displays (no X security?) */ 66 Window FSwindow; /* Fullscreen window, completely unmanaged */
67 Atom WM_DELETE_WINDOW; /* "close-window" protocol atom */ 67 Window SDL_Window; /* Shared by both displays (no X security?) */
68 WMcursor *BlankCursor; /* The invisible cursor */ 68 Atom WM_DELETE_WINDOW; /* "close-window" protocol atom */
69 XIM X11_IM; /* Used to communicate with the input method (IM) server */ 69 WMcursor *BlankCursor; /* The invisible cursor */
70 XIC X11_IC; /* Used for retaining the state, properties, and semantics of communication with the input method (IM) server */ 70 XIM X11_IM; /* Used to communicate with the input method (IM) server */
71 71 XIC X11_IC; /* Used for retaining the state, properties, and semantics of communication with the input method (IM) server */
72 char *SDL_windowid; /* Flag: true if we have been passed a window */ 72
73 char *SDL_windowid; /* Flag: true if we have been passed a window */
73 74
74 /* Direct Graphics Access extension information */ 75 /* Direct Graphics Access extension information */
75 int using_dga; 76 int using_dga;
76 77
77 #ifndef NO_SHARED_MEMORY 78 #ifndef NO_SHARED_MEMORY
79 int use_mitshm; 80 int use_mitshm;
80 XShmSegmentInfo shminfo; 81 XShmSegmentInfo shminfo;
81 #endif 82 #endif
82 83
83 /* The variables used for displaying graphics */ 84 /* The variables used for displaying graphics */
84 XImage *Ximage; /* The X image for our window */ 85 XImage *Ximage; /* The X image for our window */
85 GC gc; /* The graphic context for drawing */ 86 GC gc; /* The graphic context for drawing */
86 87
87 /* The current width and height of the fullscreen mode */ 88 /* The current width and height of the fullscreen mode */
88 int window_w; 89 int window_w;
89 int window_h; 90 int window_h;
90 91
91 /* Support for internal mouse warping */ 92 /* Support for internal mouse warping */
92 struct { 93 struct
94 {
93 int x; 95 int x;
94 int y; 96 int y;
95 } mouse_last; 97 } mouse_last;
96 struct { 98 struct
99 {
97 int numerator; 100 int numerator;
98 int denominator; 101 int denominator;
99 int threshold; 102 int threshold;
100 } mouse_accel; 103 } mouse_accel;
101 int mouse_relative; 104 int mouse_relative;
102 105
103 /* The current list of available video modes */
104 SDL_Rect **modelist;
105
106 /* available visuals of interest to us, sorted deepest first */ 106 /* available visuals of interest to us, sorted deepest first */
107 struct { 107 struct
108 Visual *visual; 108 {
109 int depth; /* number of significant bits/pixel */ 109 Visual *visual;
110 int bpp; /* pixel quantum in bits */ 110 int depth; /* number of significant bits/pixel */
111 } visuals[2*5]; /* at most 2 entries for 8, 15, 16, 24, 32 */ 111 int bpp; /* pixel quantum in bits */
112 } visuals[2 * 5]; /* at most 2 entries for 8, 15, 16, 24, 32 */
112 int nvisuals; 113 int nvisuals;
113 114
114 Visual *vis; /* current visual in use */ 115 Visual *vis; /* current visual in use */
115 int depth; /* current visual depth (not bpp) */ 116 int depth; /* current visual depth (not bpp) */
116 117
117 /* Variables used by the X11 video mode code */ 118 /* Variables used by the X11 video mode code */
118 #if SDL_VIDEO_DRIVER_X11_XINERAMA 119 #if SDL_VIDEO_DRIVER_X11_XINERAMA
119 SDL_NAME(XineramaScreenInfo) xinerama_info; 120 SDL_NAME(XineramaScreenInfo) * xinerama;
120 #endif 121 #endif
121 #if SDL_VIDEO_DRIVER_X11_XRANDR 122 #if SDL_VIDEO_DRIVER_X11_XRANDR
122 XRRScreenConfiguration* screen_config; 123 XRRScreenConfiguration *screen_config;
123 int saved_size_id; 124 int saved_size_id;
124 Rotation saved_rotation; 125 Rotation saved_rotation;
125 #endif 126 #endif
126 #if SDL_VIDEO_DRIVER_X11_VIDMODE 127 #if SDL_VIDEO_DRIVER_X11_VIDMODE
127 SDL_NAME(XF86VidModeModeInfo) saved_mode; 128 SDL_NAME(XF86VidModeModeInfo) saved_mode;
128 struct { 129 struct
130 {
129 int x, y; 131 int x, y;
130 } saved_view; 132 } saved_view;
131 #endif 133 #endif
132 #if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */ 134 #if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */
133 XiGMiscResolutionInfo saved_res; 135 XiGMiscResolutionInfo saved_res;
134 #endif 136 #endif
135 137
136 int use_xinerama; 138 int use_xinerama;
137 int use_xrandr; 139 int use_xrandr;
145 147
146 /* Prevent too many XSync() calls */ 148 /* Prevent too many XSync() calls */
147 int blit_queued; 149 int blit_queued;
148 150
149 /* Colormap handling */ 151 /* Colormap handling */
150 Colormap DisplayColormap; /* The default display colormap */ 152 Colormap DisplayColormap; /* The default display colormap */
151 Colormap XColorMap; /* The current window colormap */ 153 Colormap XColorMap; /* The current window colormap */
152 int *XPixels; /* pixels value allocation counts */ 154 int *XPixels; /* pixels value allocation counts */
153 float gamma_saved[3]; /* Saved gamma values for VidMode gamma */ 155 float gamma_saved[3]; /* Saved gamma values for VidMode gamma */
154 int gamma_changed; /* flag: has VidMode gamma been modified? */ 156 int gamma_changed; /* flag: has VidMode gamma been modified? */
155 157
156 short *iconcolors; /* List of colors used by the icon */ 158 short *iconcolors; /* List of colors used by the icon */
157 159
158 /* Screensaver settings */ 160 /* Screensaver settings */
159 int screensaver_timeout; 161 int screensaver_timeout;
160 BOOL dpms_enabled; 162 BOOL dpms_enabled;
161 }; 163 };
184 #define window_h (this->hidden->window_h) 186 #define window_h (this->hidden->window_h)
185 #define mouse_last (this->hidden->mouse_last) 187 #define mouse_last (this->hidden->mouse_last)
186 #define mouse_accel (this->hidden->mouse_accel) 188 #define mouse_accel (this->hidden->mouse_accel)
187 #define mouse_relative (this->hidden->mouse_relative) 189 #define mouse_relative (this->hidden->mouse_relative)
188 #define SDL_modelist (this->hidden->modelist) 190 #define SDL_modelist (this->hidden->modelist)
189 #define xinerama_info (this->hidden->xinerama_info) 191 #define xinerama (this->hidden->xinerama)
190 #define saved_mode (this->hidden->saved_mode) 192 #define saved_mode (this->hidden->saved_mode)
191 #define saved_view (this->hidden->saved_view) 193 #define saved_view (this->hidden->saved_view)
192 #define saved_res (this->hidden->saved_res) 194 #define saved_res (this->hidden->saved_res)
193 #define screen_config (this->hidden->screen_config) 195 #define screen_config (this->hidden->screen_config)
194 #define saved_size_id (this->hidden->saved_size_id) 196 #define saved_size_id (this->hidden->saved_size_id)
214 #define BUGGY_XFREE86(condition, buggy_version) \ 216 #define BUGGY_XFREE86(condition, buggy_version) \
215 ((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \ 217 ((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \
216 (VendorRelease(SDL_Display) condition buggy_version)) 218 (VendorRelease(SDL_Display) condition buggy_version))
217 219
218 #endif /* _SDL_x11video_h */ 220 #endif /* _SDL_x11video_h */
221 /* vi: set ts=4 sw=4 expandtab: */