src/video/SDL_sysvideo.h
changeset 8477 ad08f0d710f3
parent 8460 f483e8bdae3c
parent 7558 0614504d2265
child 8535 e8ee0708ef5c
equal deleted inserted replaced
8476:25883bdf3cab 8477:ad08f0d710f3
    23 #ifndef _SDL_sysvideo_h
    23 #ifndef _SDL_sysvideo_h
    24 #define _SDL_sysvideo_h
    24 #define _SDL_sysvideo_h
    25 
    25 
    26 #include "SDL_messagebox.h"
    26 #include "SDL_messagebox.h"
    27 #include "SDL_shape.h"
    27 #include "SDL_shape.h"
       
    28 #include "SDL_thread.h"
    28 
    29 
    29 /* The SDL video driver */
    30 /* The SDL video driver */
    30 
    31 
    31 typedef struct SDL_WindowShaper SDL_WindowShaper;
    32 typedef struct SDL_WindowShaper SDL_WindowShaper;
    32 typedef struct SDL_ShapeDriver SDL_ShapeDriver;
    33 typedef struct SDL_ShapeDriver SDL_ShapeDriver;
    33 typedef struct SDL_VideoDisplay SDL_VideoDisplay;
    34 typedef struct SDL_VideoDisplay SDL_VideoDisplay;
    34 typedef struct SDL_VideoDevice SDL_VideoDevice;
    35 typedef struct SDL_VideoDevice SDL_VideoDevice;
    35 
    36 
    36 /* Define the SDL window-shaper structure */
    37 /* Define the SDL window-shaper structure */
    37 struct SDL_WindowShaper
    38 struct SDL_WindowShaper
    38 {   
    39 {
    39     /* The window associated with the shaper */
    40     /* The window associated with the shaper */
    40     SDL_Window *window;
    41     SDL_Window *window;
    41     
    42 
    42     /* The user's specified coordinates for the window, for once we give it a shape. */
    43     /* The user's specified coordinates for the window, for once we give it a shape. */
    43     Uint32 userx,usery;
    44     Uint32 userx,usery;
    44     
    45 
    45     /* The parameters for shape calculation. */
    46     /* The parameters for shape calculation. */
    46     SDL_WindowShapeMode mode;
    47     SDL_WindowShapeMode mode;
    47     
    48 
    48     /* Has this window been assigned a shape? */
    49     /* Has this window been assigned a shape? */
    49     SDL_bool hasshape;
    50     SDL_bool hasshape;
    50     
    51 
    51     void *driverdata;
    52     void *driverdata;
    52 };
    53 };
    53 
    54 
    54 /* Define the SDL shape driver structure */
    55 /* Define the SDL shape driver structure */
    55 struct SDL_ShapeDriver
    56 struct SDL_ShapeDriver
    70 struct SDL_Window
    71 struct SDL_Window
    71 {
    72 {
    72     const void *magic;
    73     const void *magic;
    73     Uint32 id;
    74     Uint32 id;
    74     char *title;
    75     char *title;
       
    76     SDL_Surface *icon;
    75     int x, y;
    77     int x, y;
    76     int w, h;
    78     int w, h;
    77     int min_w, min_h;
    79     int min_w, min_h;
    78     int max_w, max_h;
    80     int max_w, max_h;
    79     Uint32 flags;
    81     Uint32 flags;
    80 
    82 
    81     /* Stored position and size for windowed mode */
    83     /* Stored position and size for windowed mode */
    82     SDL_Rect windowed;
    84     SDL_Rect windowed;
    83 
    85 
    84     SDL_DisplayMode fullscreen_mode;
    86     SDL_DisplayMode fullscreen_mode;
    85     
    87 
    86     float brightness;
    88     float brightness;
    87     Uint16 *gamma;
    89     Uint16 *gamma;
    88     Uint16 *saved_gamma;        /* (just offset into gamma) */
    90     Uint16 *saved_gamma;        /* (just offset into gamma) */
    89 
    91 
    90     SDL_Surface *surface;
    92     SDL_Surface *surface;
   126 
   128 
   127 /* Forward declaration */
   129 /* Forward declaration */
   128 struct SDL_SysWMinfo;
   130 struct SDL_SysWMinfo;
   129 
   131 
   130 /* Define the SDL video driver structure */
   132 /* Define the SDL video driver structure */
   131 #define _THIS	SDL_VideoDevice *_this
   133 #define _THIS   SDL_VideoDevice *_this
   132 
   134 
   133 struct SDL_VideoDevice
   135 struct SDL_VideoDevice
   134 {
   136 {
   135     /* * * */
   137     /* * * */
   136     /* The name of this video driver */
   138     /* The name of this video driver */
   199     void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
   201     void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
   200     void (*DestroyWindow) (_THIS, SDL_Window * window);
   202     void (*DestroyWindow) (_THIS, SDL_Window * window);
   201     int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
   203     int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
   202     int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
   204     int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
   203     void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
   205     void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
       
   206     void (*OnWindowEnter) (_THIS, SDL_Window * window);
   204 
   207 
   205     /* * * */
   208     /* * * */
   206     /*
   209     /*
   207      * Shaped-window functions
   210      * Shaped-window functions
   208      */
   211      */
   239     void (*StartTextInput) (_THIS);
   242     void (*StartTextInput) (_THIS);
   240     void (*StopTextInput) (_THIS);
   243     void (*StopTextInput) (_THIS);
   241     void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
   244     void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
   242 
   245 
   243     /* Screen keyboard */
   246     /* Screen keyboard */
   244     SDL_bool (*SDL_HasScreenKeyboardSupport) (_THIS);
   247     SDL_bool (*HasScreenKeyboardSupport) (_THIS);
   245     void (*SDL_ShowScreenKeyboard) (_THIS, SDL_Window *window);
   248     void (*ShowScreenKeyboard) (_THIS, SDL_Window *window);
   246     void (*SDL_HideScreenKeyboard) (_THIS, SDL_Window *window);
   249     void (*HideScreenKeyboard) (_THIS, SDL_Window *window);
   247     SDL_bool (*SDL_IsScreenKeyboardShown) (_THIS, SDL_Window *window);
   250     SDL_bool (*IsScreenKeyboardShown) (_THIS, SDL_Window *window);
   248 
   251 
   249     /* Clipboard */
   252     /* Clipboard */
   250     int (*SetClipboardText) (_THIS, const char *text);
   253     int (*SetClipboardText) (_THIS, const char *text);
   251     char * (*GetClipboardText) (_THIS);
   254     char * (*GetClipboardText) (_THIS);
   252     SDL_bool (*HasClipboardText) (_THIS);
   255     SDL_bool (*HasClipboardText) (_THIS);
   296         void *dll_handle;
   299         void *dll_handle;
   297     } gl_config;
   300     } gl_config;
   298 
   301 
   299     /* * * */
   302     /* * * */
   300     /* Cache current GL context; don't call the OS when it hasn't changed. */
   303     /* Cache current GL context; don't call the OS when it hasn't changed. */
       
   304     /* We have the global pointers here so Cocoa continues to work the way
       
   305        it always has, and the thread-local storage for the general case.
       
   306      */
   301     SDL_Window *current_glwin;
   307     SDL_Window *current_glwin;
   302     SDL_GLContext current_glctx;
   308     SDL_GLContext current_glctx;
       
   309     SDL_TLSID current_glwin_tls;
       
   310     SDL_TLSID current_glctx_tls;
   303 
   311 
   304     /* * * */
   312     /* * * */
   305     /* Data private to this driver */
   313     /* Data private to this driver */
   306     void *driverdata;
   314     void *driverdata;
   307     struct SDL_GLDriverData *gl_data;
   315     struct SDL_GLDriverData *gl_data;
   368 extern void SDL_OnWindowShown(SDL_Window * window);
   376 extern void SDL_OnWindowShown(SDL_Window * window);
   369 extern void SDL_OnWindowHidden(SDL_Window * window);
   377 extern void SDL_OnWindowHidden(SDL_Window * window);
   370 extern void SDL_OnWindowResized(SDL_Window * window);
   378 extern void SDL_OnWindowResized(SDL_Window * window);
   371 extern void SDL_OnWindowMinimized(SDL_Window * window);
   379 extern void SDL_OnWindowMinimized(SDL_Window * window);
   372 extern void SDL_OnWindowRestored(SDL_Window * window);
   380 extern void SDL_OnWindowRestored(SDL_Window * window);
       
   381 extern void SDL_OnWindowEnter(SDL_Window * window);
       
   382 extern void SDL_OnWindowLeave(SDL_Window * window);
   373 extern void SDL_OnWindowFocusGained(SDL_Window * window);
   383 extern void SDL_OnWindowFocusGained(SDL_Window * window);
   374 extern void SDL_OnWindowFocusLost(SDL_Window * window);
   384 extern void SDL_OnWindowFocusLost(SDL_Window * window);
   375 extern void SDL_UpdateWindowGrab(SDL_Window * window);
   385 extern void SDL_UpdateWindowGrab(SDL_Window * window);
   376 extern SDL_Window * SDL_GetFocusWindow(void);
   386 extern SDL_Window * SDL_GetFocusWindow(void);
   377 
   387 
   378 extern SDL_bool SDL_ShouldAllowTopmost();
   388 extern SDL_bool SDL_ShouldAllowTopmost(void);
   379 
   389 
   380 #endif /* _SDL_sysvideo_h */
   390 #endif /* _SDL_sysvideo_h */
   381 
   391 
   382 /* vi: set ts=4 sw=4 expandtab: */
   392 /* vi: set ts=4 sw=4 expandtab: */