comparison include/SDL_syswm.h @ 4899:5d529386db73

attached is a patch to support DirectFB in include/SDL_syswm.h. It defines SDL_SYSWM_DIRECTFB as a subsystem. This allows developers to e.g. access DirectFB's video and picture providers. Kind regards, André
author Sam Lantinga <slouken@libsdl.org>
date Mon, 27 Sep 2010 00:50:46 -0700
parents fd27410a5db0
children 69d9db65f248
comparison
equal deleted inserted replaced
4898:164bee619400 4899:5d529386db73
53 #ifdef SDL_PROTOTYPES_ONLY 53 #ifdef SDL_PROTOTYPES_ONLY
54 struct SDL_SysWMinfo; 54 struct SDL_SysWMinfo;
55 #else 55 #else
56 56
57 /* This is the structure for custom window manager events */ 57 /* This is the structure for custom window manager events */
58 #if defined(SDL_VIDEO_DRIVER_X11) || defined(SDL_VIDEO_DRIVER_DIRECTFB)
58 #if defined(SDL_VIDEO_DRIVER_X11) 59 #if defined(SDL_VIDEO_DRIVER_X11)
59 #if defined(__APPLE__) && defined(__MACH__) 60 #if defined(__APPLE__) && defined(__MACH__)
60 /* conflicts with Quickdraw.h */ 61 /* conflicts with Quickdraw.h */
61 #define Cursor X11Cursor 62 #define Cursor X11Cursor
62 #endif 63 #endif
67 #if defined(__APPLE__) && defined(__MACH__) 68 #if defined(__APPLE__) && defined(__MACH__)
68 /* matches the re-define above */ 69 /* matches the re-define above */
69 #undef Cursor 70 #undef Cursor
70 #endif 71 #endif
71 72
73 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
74
75 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
76 #include <directfb/directfb.h>
77 #endif
72 /** 78 /**
73 * These are the various supported subsystems under UNIX. 79 * These are the various supported subsystems under UNIX.
74 */ 80 */
75 typedef enum 81 typedef enum
76 { 82 {
77 SDL_SYSWM_X11 83 #if defined(SDL_VIDEO_DRIVER_X11)
84 SDL_SYSWM_X11,
85 #endif
86 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
87 SDL_SYSWM_DIRECTFB,
88 #endif
78 } SDL_SYSWM_TYPE; 89 } SDL_SYSWM_TYPE;
79 90
80 /** 91 /**
81 * The UNIX custom event structure. 92 * The UNIX custom event structure.
82 */ 93 */
84 { 95 {
85 SDL_version version; 96 SDL_version version;
86 SDL_SYSWM_TYPE subsystem; 97 SDL_SYSWM_TYPE subsystem;
87 union 98 union
88 { 99 {
100 #if defined(SDL_VIDEO_DRIVER_X11)
89 XEvent xevent; 101 XEvent xevent;
102 #endif
103 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
104 DFBEvent dfb_event;
105 #endif
90 } event; 106 } event;
91 }; 107 };
92 108
93 /** 109 /**
94 * The UNIX custom window manager information structure. 110 * The UNIX custom window manager information structure.
100 { 116 {
101 SDL_version version; 117 SDL_version version;
102 SDL_SYSWM_TYPE subsystem; 118 SDL_SYSWM_TYPE subsystem;
103 union 119 union
104 { 120 {
121 #if defined(SDL_VIDEO_DRIVER_X11)
105 struct 122 struct
106 { 123 {
107 Display *display; /**< The X11 display */ 124 Display *display; /**< The X11 display */
108 Window window; /**< The X11 display window */ 125 Window window; /**< The X11 display window */
109 } x11; 126 } x11;
127 #endif
128 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
129 struct
130 {
131 IDirectFB *dfb; /**< The directfb main interface */
132 IDirectFBWindow *window; /**< The directfb window handle */
133 IDirectFBSurface *surface; /**< The directfb client surface */
134 } directfb;
135 #endif
110 } info; 136 } info;
111 }; 137 };
112 138
113 #elif defined(SDL_VIDEO_DRIVER_WIN32) 139 #elif defined(SDL_VIDEO_DRIVER_WIN32)
114 #define WIN32_LEAN_AND_MEAN 140 #define WIN32_LEAN_AND_MEAN