comparison src/video/SDL_sysvideo.h @ 2742:b86247d21929

Added retained backing attribute, reference to UIKit renderer
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Tue, 02 Sep 2008 19:53:56 +0000
parents 204be4fc2726
children 0969758c8809
comparison
equal deleted inserted replaced
2741:6d6c89513529 2742:b86247d21929
35 typedef struct SDL_RenderDriver SDL_RenderDriver; 35 typedef struct SDL_RenderDriver SDL_RenderDriver;
36 typedef struct SDL_VideoDisplay SDL_VideoDisplay; 36 typedef struct SDL_VideoDisplay SDL_VideoDisplay;
37 typedef struct SDL_VideoDevice SDL_VideoDevice; 37 typedef struct SDL_VideoDevice SDL_VideoDevice;
38 38
39 /* Define the SDL texture structure */ 39 /* Define the SDL texture structure */
40 struct SDL_Texture 40 struct SDL_Texture {
41 { 41 Uint32 id;
42 Uint32 id; 42
43 43 Uint32 format; /**< The pixel format of the texture */
44 Uint32 format; /**< The pixel format of the texture */ 44 int access; /**< SDL_TextureAccess */
45 int access; /**< SDL_TextureAccess */ 45 int w; /**< The width of the texture */
46 int w; /**< The width of the texture */ 46 int h; /**< The height of the texture */
47 int h; /**< The height of the texture */ 47 int modMode;/**< The texture modulation mode */
48 int modMode; /**< The texture modulation mode */ 48 int blendMode; /**< The texture blend mode */
49 int blendMode; /**< The texture blend mode */ 49 int scaleMode; /**< The texture scale mode */
50 int scaleMode; /**< The texture scale mode */ 50 Uint8 r, g, b, a; /**< Texture modulation values */
51 Uint8 r, g, b, a; /**< Texture modulation values */ 51
52 52 SDL_Renderer *renderer;
53 SDL_Renderer *renderer; 53
54 54 void *driverdata; /**< Driver specific texture representation */
55 void *driverdata; /**< Driver specific texture representation */ 55
56 56 SDL_Texture *next;
57 SDL_Texture *next;
58 }; 57 };
59 58
60 /* Define the SDL renderer structure */ 59 /* Define the SDL renderer structure */
61 struct SDL_Renderer 60 struct SDL_Renderer {
62 { 61 int (*ActivateRenderer) (SDL_Renderer * renderer);
63 int (*ActivateRenderer) (SDL_Renderer * renderer); 62 int (*DisplayModeChanged) (SDL_Renderer * renderer);
64 int (*DisplayModeChanged) (SDL_Renderer * renderer); 63 int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
65 int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); 64 int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
66 int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture, 65 void **pixels, int *pitch);
67 void **pixels, int *pitch); 66 int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
68 int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, 67 const SDL_Color * colors, int firstcolor,
69 const SDL_Color * colors, int firstcolor, 68 int ncolors);
70 int ncolors); 69 int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
71 int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, 70 SDL_Color * colors, int firstcolor,
72 SDL_Color * colors, int firstcolor, 71 int ncolors);
73 int ncolors); 72 int (*SetTextureColorMod) (SDL_Renderer * renderer,
74 int (*SetTextureColorMod) (SDL_Renderer * renderer, 73 SDL_Texture * texture);
75 SDL_Texture * texture); 74 int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
76 int (*SetTextureAlphaMod) (SDL_Renderer * renderer, 75 SDL_Texture * texture);
77 SDL_Texture * texture); 76 int (*SetTextureBlendMode) (SDL_Renderer * renderer,
78 int (*SetTextureBlendMode) (SDL_Renderer * renderer, 77 SDL_Texture * texture);
79 SDL_Texture * texture); 78 int (*SetTextureScaleMode) (SDL_Renderer * renderer,
80 int (*SetTextureScaleMode) (SDL_Renderer * renderer, 79 SDL_Texture * texture);
81 SDL_Texture * texture); 80 int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
82 int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, 81 const SDL_Rect * rect, const void *pixels,
83 const SDL_Rect * rect, const void *pixels, 82 int pitch);
84 int pitch); 83 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
85 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, 84 const SDL_Rect * rect, int markDirty, void **pixels,
86 const SDL_Rect * rect, int markDirty, void **pixels, 85 int *pitch);
87 int *pitch); 86 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
88 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); 87 void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
89 void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture, 88 int numrects, const SDL_Rect * rects);
90 int numrects, const SDL_Rect * rects); 89 int (*RenderFill) (SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
91 int (*RenderFill) (SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, 90 Uint8 a, const SDL_Rect * rect);
92 Uint8 a, const SDL_Rect * rect); 91 int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
93 int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, 92 const SDL_Rect * srcrect, const SDL_Rect * dstrect);
94 const SDL_Rect * srcrect, const SDL_Rect * dstrect); 93 void (*RenderPresent) (SDL_Renderer * renderer);
95 void (*RenderPresent) (SDL_Renderer * renderer); 94 void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
96 void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); 95
97 96 void (*DestroyRenderer) (SDL_Renderer * renderer);
98 void (*DestroyRenderer) (SDL_Renderer * renderer); 97
99 98 /* The current renderer info */
100 /* The current renderer info */ 99 SDL_RendererInfo info;
101 SDL_RendererInfo info; 100
102 101 /* The window associated with the renderer */
103 /* The window associated with the renderer */ 102 SDL_WindowID window;
104 SDL_WindowID window; 103
105 104 void *driverdata;
106 void *driverdata;
107 }; 105 };
108 106
109 /* Define the SDL render driver structure */ 107 /* Define the SDL render driver structure */
110 struct SDL_RenderDriver 108 struct SDL_RenderDriver {
111 { 109 SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
112 SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags); 110
113 111 /* Info about the renderer capabilities */
114 /* Info about the renderer capabilities */ 112 SDL_RendererInfo info;
115 SDL_RendererInfo info;
116 }; 113 };
117 114
118 /* Define the SDL window structure, corresponding to toplevel windows */ 115 /* Define the SDL window structure, corresponding to toplevel windows */
119 struct SDL_Window 116 struct SDL_Window {
120 { 117 Uint32 id;
121 Uint32 id; 118
122 119 char *title;
123 char *title; 120 int x, y;
124 int x, y; 121 int w, h;
125 int w, h; 122 Uint32 flags;
126 Uint32 flags; 123
127 124 int display;
128 int display; 125 SDL_Renderer *renderer;
129 SDL_Renderer *renderer; 126
130 127 void *userdata;
131 void *userdata; 128 void *driverdata;
132 void *driverdata;
133 }; 129 };
134 #define FULLSCREEN_VISIBLE(W) \ 130 #define FULLSCREEN_VISIBLE(W) \
135 (((W)->flags & SDL_WINDOW_FULLSCREEN) && \ 131 (((W)->flags & SDL_WINDOW_FULLSCREEN) && \
136 ((W)->flags & SDL_WINDOW_SHOWN) && \ 132 ((W)->flags & SDL_WINDOW_SHOWN) && \
137 !((W)->flags & SDL_WINDOW_MINIMIZED)) 133 !((W)->flags & SDL_WINDOW_MINIMIZED))
138 134
139 /* Define the SDL display structure 135 /*
140 This corresponds to physical monitors attached to the system. 136 * Define the SDL display structure This corresponds to physical monitors
137 * attached to the system.
141 */ 138 */
142 struct SDL_VideoDisplay 139 struct SDL_VideoDisplay {
143 { 140 int max_display_modes;
144 int max_display_modes; 141 int num_display_modes;
145 int num_display_modes; 142 SDL_DisplayMode *display_modes;
146 SDL_DisplayMode *display_modes; 143 SDL_DisplayMode desktop_mode;
147 SDL_DisplayMode desktop_mode; 144 SDL_DisplayMode current_mode;
148 SDL_DisplayMode current_mode; 145 SDL_DisplayMode fullscreen_mode;
149 SDL_DisplayMode fullscreen_mode; 146 SDL_Palette *palette;
150 SDL_Palette *palette; 147
151 148 Uint16 *gamma;
152 Uint16 *gamma; 149 Uint16 *saved_gamma; /* (just offset into gamma) */
153 Uint16 *saved_gamma; /* (just offset into gamma) */ 150
154 151 int num_render_drivers;
155 int num_render_drivers; 152 SDL_RenderDriver *render_drivers;
156 SDL_RenderDriver *render_drivers; 153
157 154 int num_windows;
158 int num_windows; 155 SDL_Window *windows;
159 SDL_Window *windows; 156
160 157 SDL_Renderer *current_renderer;
161 SDL_Renderer *current_renderer; 158
162 159 /* The hash list of textures */
163 /* The hash list of textures */ 160 SDL_Texture *textures[64];
164 SDL_Texture *textures[64]; 161
165 162 SDL_VideoDevice *device;
166 SDL_VideoDevice *device; 163
167 164 void *driverdata;
168 void *driverdata;
169 }; 165 };
170 166
171 /* Define the SDL video driver structure */ 167 /* Define the SDL video driver structure */
172 #define _THIS SDL_VideoDevice *_this 168 #define _THIS SDL_VideoDevice *_this
173 169
174 struct SDL_VideoDevice 170 struct SDL_VideoDevice {
175 { 171 /* * * */
176 /* * * */ 172 /* The name of this video driver */
177 /* The name of this video driver */ 173 const char *name;
178 const char *name; 174
179 175 /* * * */
180 /* * * */ 176 /* Initialization/Query functions */
181 /* Initialization/Query functions */ 177
182 178 /*
183 /* Initialize the native video subsystem, filling in the list 179 * Initialize the native video subsystem, filling in the list of
184 of displays for this driver, returning 0 or -1 if there's an error. 180 * displays for this driver, returning 0 or -1 if there's an error.
185 */ 181 */
186 int (*VideoInit) (_THIS); 182 int (*VideoInit) (_THIS);
187 183
188 /* Reverse the effects VideoInit() -- called if VideoInit() fails 184 /*
189 or if the application is shutting down the video subsystem. 185 * Reverse the effects VideoInit() -- called if VideoInit() fails or
190 */ 186 * if the application is shutting down the video subsystem.
191 void (*VideoQuit) (_THIS); 187 */
192 188 void (*VideoQuit) (_THIS);
193 /* * * */ 189
194 /* Display functions 190 /* * * */
195 */ 191 /*
196 192 * Display functions
197 /* Get a list of the available display modes. 193 */
198 * e.g. SDL_AddDisplayMode(_this->current_display, mode) 194
199 */ 195 /*
200 void (*GetDisplayModes) (_THIS); 196 * Get a list of the available display modes. e.g.
201 197 * SDL_AddDisplayMode(_this->current_display, mode)
202 /* Setting the display mode is independent of creating windows, 198 */
203 * so when the display mode is changed, all existing windows 199 void (*GetDisplayModes) (_THIS);
204 * should have their data updated accordingly, including the 200
205 * display surfaces associated with them. 201 /*
206 */ 202 * Setting the display mode is independent of creating windows, so
207 int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode); 203 * when the display mode is changed, all existing windows should have
208 204 * their data updated accordingly, including the display surfaces
209 /* Set the color entries of the display palette */ 205 * associated with them.
210 int (*SetDisplayPalette) (_THIS, SDL_Palette * palette); 206 */
211 207 int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode);
212 /* Get the color entries of the display palette */ 208
213 int (*GetDisplayPalette) (_THIS, SDL_Palette * palette); 209 /* Set the color entries of the display palette */
214 210 int (*SetDisplayPalette) (_THIS, SDL_Palette * palette);
215 /* Set the gamma ramp */ 211
216 int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp); 212 /* Get the color entries of the display palette */
217 213 int (*GetDisplayPalette) (_THIS, SDL_Palette * palette);
218 /* Get the gamma ramp */ 214
219 int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp); 215 /* Set the gamma ramp */
220 216 int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp);
221 /* * * */ 217
222 /* Window functions 218 /* Get the gamma ramp */
223 */ 219 int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp);
224 int (*CreateWindow) (_THIS, SDL_Window * window); 220
225 int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data); 221 /* * * */
226 void (*SetWindowTitle) (_THIS, SDL_Window * window); 222 /*
227 void (*SetWindowPosition) (_THIS, SDL_Window * window); 223 * Window functions
228 void (*SetWindowSize) (_THIS, SDL_Window * window); 224 */
229 void (*ShowWindow) (_THIS, SDL_Window * window); 225 int (*CreateWindow) (_THIS, SDL_Window * window);
230 void (*HideWindow) (_THIS, SDL_Window * window); 226 int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
231 void (*RaiseWindow) (_THIS, SDL_Window * window); 227 void (*SetWindowTitle) (_THIS, SDL_Window * window);
232 void (*MaximizeWindow) (_THIS, SDL_Window * window); 228 void (*SetWindowPosition) (_THIS, SDL_Window * window);
233 void (*MinimizeWindow) (_THIS, SDL_Window * window); 229 void (*SetWindowSize) (_THIS, SDL_Window * window);
234 void (*RestoreWindow) (_THIS, SDL_Window * window); 230 void (*ShowWindow) (_THIS, SDL_Window * window);
235 void (*SetWindowGrab) (_THIS, SDL_Window * window); 231 void (*HideWindow) (_THIS, SDL_Window * window);
236 void (*DestroyWindow) (_THIS, SDL_Window * window); 232 void (*RaiseWindow) (_THIS, SDL_Window * window);
237 233 void (*MaximizeWindow) (_THIS, SDL_Window * window);
238 /* Get some platform dependent window information */ 234 void (*MinimizeWindow) (_THIS, SDL_Window * window);
239 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window, 235 void (*RestoreWindow) (_THIS, SDL_Window * window);
240 struct SDL_SysWMinfo * info); 236 void (*SetWindowGrab) (_THIS, SDL_Window * window);
241 237 void (*DestroyWindow) (_THIS, SDL_Window * window);
242 /* * * */ 238
243 /* OpenGL support 239 /* Get some platform dependent window information */
244 */ 240 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
245 int (*GL_LoadLibrary) (_THIS, const char *path); 241 struct SDL_SysWMinfo * info);
246 void *(*GL_GetProcAddress) (_THIS, const char *proc); 242
247 SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window); 243 /* * * */
248 int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context); 244 /*
249 int (*GL_SetSwapInterval) (_THIS, int interval); 245 * OpenGL support
250 int (*GL_GetSwapInterval) (_THIS); 246 */
251 void (*GL_SwapWindow) (_THIS, SDL_Window * window); 247 int (*GL_LoadLibrary) (_THIS, const char *path);
252 void (*GL_DeleteContext) (_THIS, SDL_GLContext context); 248 void *(*GL_GetProcAddress) (_THIS, const char *proc);
253 249 SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
254 /* * * */ 250 int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
255 /* Event manager functions 251 int (*GL_SetSwapInterval) (_THIS, int interval);
256 */ 252 int (*GL_GetSwapInterval) (_THIS);
257 void (*PumpEvents) (_THIS); 253 void (*GL_SwapWindow) (_THIS, SDL_Window * window);
258 254 void (*GL_DeleteContext) (_THIS, SDL_GLContext context);
259 /* * * */ 255
260 /* Data common to all drivers */ 256 /* * * */
261 int num_displays; 257 /*
262 SDL_VideoDisplay *displays; 258 * Event manager functions
263 int current_display; 259 */
264 Uint32 next_object_id; 260 void (*PumpEvents) (_THIS);
265 261
266 /* * * */ 262 /* * * */
267 /* Data used by the GL drivers */ 263 /* Data common to all drivers */
268 struct 264 int num_displays;
269 { 265 SDL_VideoDisplay *displays;
270 int red_size; 266 int current_display;
271 int green_size; 267 Uint32 next_object_id;
272 int blue_size; 268
273 int alpha_size; 269 /* * * */
274 int depth_size; 270 /* Data used by the GL drivers */
275 int buffer_size; 271 struct {
276 int stencil_size; 272 int red_size;
277 int double_buffer; 273 int green_size;
278 int accum_red_size; 274 int blue_size;
279 int accum_green_size; 275 int alpha_size;
280 int accum_blue_size; 276 int depth_size;
281 int accum_alpha_size; 277 int buffer_size;
282 int stereo; 278 int stencil_size;
283 int multisamplebuffers; 279 int double_buffer;
284 int multisamplesamples; 280 int accum_red_size;
285 int accelerated; 281 int accum_green_size;
286 int driver_loaded; 282 int accum_blue_size;
287 char driver_path[256]; 283 int accum_alpha_size;
288 void *dll_handle; 284 int stereo;
289 } gl_config; 285 int multisamplebuffers;
290 286 int multisamplesamples;
291 /* * * */ 287 int accelerated;
292 /* Data private to this driver */ 288 int retained_backing;
293 void *driverdata; 289 int driver_loaded;
294 struct SDL_GLDriverData *gl_data; 290 char driver_path[256];
295 291 void *dll_handle;
296 /* * * */ 292 } gl_config;
297 /* The function used to dispose of this structure */ 293
298 void (*free) (_THIS); 294 /* * * */
299 }; 295 /* Data private to this driver */
300 296 void *driverdata;
301 typedef struct VideoBootStrap 297 struct SDL_GLDriverData *gl_data;
302 { 298
303 const char *name; 299 /* * * */
304 const char *desc; 300 /* The function used to dispose of this structure */
305 int (*available) (void); 301 void (*free) (_THIS);
306 SDL_VideoDevice *(*create) (int devindex); 302 };
307 } VideoBootStrap; 303
304 typedef struct VideoBootStrap {
305 const char *name;
306 const char *desc;
307 int (*available) (void);
308 SDL_VideoDevice *(*create) (int devindex);
309 } VideoBootStrap;
308 310
309 #if SDL_VIDEO_DRIVER_COCOA 311 #if SDL_VIDEO_DRIVER_COCOA
310 extern VideoBootStrap COCOA_bootstrap; 312 extern VideoBootStrap COCOA_bootstrap;
311 #endif 313 #endif
312 #if SDL_VIDEO_DRIVER_X11 314 #if SDL_VIDEO_DRIVER_X11
364 extern VideoBootStrap RISCOS_bootstrap; 366 extern VideoBootStrap RISCOS_bootstrap;
365 #endif 367 #endif
366 #if SDL_VIDEO_DRIVER_OS2FS 368 #if SDL_VIDEO_DRIVER_OS2FS
367 extern VideoBootStrap OS2FSLib_bootstrap; 369 extern VideoBootStrap OS2FSLib_bootstrap;
368 #endif 370 #endif
371 #if SDL_VIDEO_DRIVER_UIKIT
372 extern VideoBootStrap UIKIT_bootstrap;
373 #endif
369 #if SDL_VIDEO_DRIVER_DUMMY 374 #if SDL_VIDEO_DRIVER_DUMMY
370 extern VideoBootStrap DUMMY_bootstrap; 375 extern VideoBootStrap DUMMY_bootstrap;
371 #endif 376 #endif
372 #if SDL_VIDEO_DRIVER_NDS 377 #if SDL_VIDEO_DRIVER_NDS
373 extern VideoBootStrap NDS_bootstrap; 378 extern VideoBootStrap NDS_bootstrap;
374 #endif 379 #endif
375 380
376 #define SDL_CurrentDisplay (_this->displays[_this->current_display]) 381 #define SDL_CurrentDisplay (_this->displays[_this->current_display])
377 382
378 extern SDL_VideoDevice *SDL_GetVideoDevice(); 383 extern SDL_VideoDevice *SDL_GetVideoDevice();
379 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); 384 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
380 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); 385 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
381 extern SDL_bool SDL_AddDisplayMode(int displayIndex, 386 extern SDL_bool
382 const SDL_DisplayMode * mode); 387 SDL_AddDisplayMode(int displayIndex,
383 extern void SDL_AddRenderDriver(int displayIndex, 388 const SDL_DisplayMode * mode);
384 const SDL_RenderDriver * driver); 389 extern void
385 390 SDL_AddRenderDriver(int displayIndex,
386 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); 391 const SDL_RenderDriver * driver);
392
393 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
387 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID); 394 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID);
388 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window); 395 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window);
389 396
390 extern void SDL_OnWindowShown(SDL_Window * window); 397 extern void SDL_OnWindowShown(SDL_Window * window);
391 extern void SDL_OnWindowHidden(SDL_Window * window); 398 extern void SDL_OnWindowHidden(SDL_Window * window);
392 extern void SDL_OnWindowResized(SDL_Window * window); 399 extern void SDL_OnWindowResized(SDL_Window * window);
393 extern void SDL_OnWindowFocusGained(SDL_Window * window); 400 extern void SDL_OnWindowFocusGained(SDL_Window * window);
394 extern void SDL_OnWindowFocusLost(SDL_Window * window); 401 extern void SDL_OnWindowFocusLost(SDL_Window * window);
395 extern SDL_WindowID SDL_GetFocusWindow(void); 402 extern SDL_WindowID SDL_GetFocusWindow(void);
396 403
397 #endif /* _SDL_sysvideo_h */ 404 #endif /* _SDL_sysvideo_h */
398 405
399 /* vi: set ts=4 sw=4 expandtab: */ 406 /* vi: set ts=4 sw=4 expandtab: */