misc/winutils/include/SDL_syswm.h
changeset 10017 de822cd3df3a
parent 7809 7d4fb2f35f4f
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    63 #undef Cursor
    63 #undef Cursor
    64 #endif
    64 #endif
    65 
    65 
    66 /** These are the various supported subsystems under UNIX */
    66 /** These are the various supported subsystems under UNIX */
    67 typedef enum {
    67 typedef enum {
    68 	SDL_SYSWM_X11
    68     SDL_SYSWM_X11
    69 } SDL_SYSWM_TYPE;
    69 } SDL_SYSWM_TYPE;
    70 
    70 
    71 /** The UNIX custom event structure */
    71 /** The UNIX custom event structure */
    72 struct SDL_SysWMmsg {
    72 struct SDL_SysWMmsg {
    73 	SDL_version version;
    73     SDL_version version;
    74 	SDL_SYSWM_TYPE subsystem;
    74     SDL_SYSWM_TYPE subsystem;
    75 	union {
    75     union {
    76 	    XEvent xevent;
    76         XEvent xevent;
    77 	} event;
    77     } event;
    78 };
    78 };
    79 
    79 
    80 /** The UNIX custom window manager information structure.
    80 /** The UNIX custom window manager information structure.
    81  *  When this structure is returned, it holds information about which
    81  *  When this structure is returned, it holds information about which
    82  *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
    82  *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
    83  */
    83  */
    84 typedef struct SDL_SysWMinfo {
    84 typedef struct SDL_SysWMinfo {
    85 	SDL_version version;
    85     SDL_version version;
    86 	SDL_SYSWM_TYPE subsystem;
    86     SDL_SYSWM_TYPE subsystem;
    87 	union {
    87     union {
    88 	    struct {
    88         struct {
    89 	    	Display *display;	/**< The X11 display */
    89             Display *display;   /**< The X11 display */
    90 	    	Window window;		/**< The X11 display window */
    90             Window window;      /**< The X11 display window */
    91 		/** These locking functions should be called around
    91         /** These locking functions should be called around
    92                  *  any X11 functions using the display variable, 
    92                  *  any X11 functions using the display variable,
    93                  *  but not the gfxdisplay variable.
    93                  *  but not the gfxdisplay variable.
    94                  *  They lock the event thread, so should not be
    94                  *  They lock the event thread, so should not be
    95 		 *  called around event functions or from event filters.
    95          *  called around event functions or from event filters.
    96 		 */
    96          */
    97                 /*@{*/
    97                 /*@{*/
    98 		void (*lock_func)(void);
    98         void (*lock_func)(void);
    99 		void (*unlock_func)(void);
    99         void (*unlock_func)(void);
   100                 /*@}*/
   100                 /*@}*/
   101 
   101 
   102 		/** @name Introduced in SDL 1.0.2 */
   102         /** @name Introduced in SDL 1.0.2 */
   103                 /*@{*/
   103                 /*@{*/
   104 	    	Window fswindow;	/**< The X11 fullscreen window */
   104             Window fswindow;    /**< The X11 fullscreen window */
   105 	    	Window wmwindow;	/**< The X11 managed input window */
   105             Window wmwindow;    /**< The X11 managed input window */
   106                 /*@}*/
   106                 /*@}*/
   107 
   107 
   108 		/** @name Introduced in SDL 1.2.12 */
   108         /** @name Introduced in SDL 1.2.12 */
   109                 /*@{*/
   109                 /*@{*/
   110 		Display *gfxdisplay;	/**< The X11 display to which rendering is done */
   110         Display *gfxdisplay;    /**< The X11 display to which rendering is done */
   111                 /*@}*/
   111                 /*@}*/
   112 	    } x11;
   112         } x11;
   113 	} info;
   113     } info;
   114 } SDL_SysWMinfo;
   114 } SDL_SysWMinfo;
   115 
   115 
   116 #elif defined(SDL_VIDEO_DRIVER_NANOX)
   116 #elif defined(SDL_VIDEO_DRIVER_NANOX)
   117 #include <microwin/nano-X.h>
   117 #include <microwin/nano-X.h>
   118 
   118 
   119 /** The generic custom event structure */
   119 /** The generic custom event structure */
   120 struct SDL_SysWMmsg {
   120 struct SDL_SysWMmsg {
   121 	SDL_version version;
   121     SDL_version version;
   122 	int data;
   122     int data;
   123 };
   123 };
   124 
   124 
   125 /** The windows custom window manager information structure */
   125 /** The windows custom window manager information structure */
   126 typedef struct SDL_SysWMinfo {
   126 typedef struct SDL_SysWMinfo {
   127 	SDL_version version ;
   127     SDL_version version ;
   128 	GR_WINDOW_ID window ;	/* The display window */
   128     GR_WINDOW_ID window ;   /* The display window */
   129 } SDL_SysWMinfo;
   129 } SDL_SysWMinfo;
   130 
   130 
   131 #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
   131 #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
   132 #define WIN32_LEAN_AND_MEAN
   132 #define WIN32_LEAN_AND_MEAN
   133 #include <windows.h>
   133 #include <windows.h>
   134 
   134 
   135 /** The windows custom event structure */
   135 /** The windows custom event structure */
   136 struct SDL_SysWMmsg {
   136 struct SDL_SysWMmsg {
   137 	SDL_version version;
   137     SDL_version version;
   138 	HWND hwnd;			/**< The window for the message */
   138     HWND hwnd;          /**< The window for the message */
   139 	UINT msg;			/**< The type of message */
   139     UINT msg;           /**< The type of message */
   140 	WPARAM wParam;			/**< WORD message parameter */
   140     WPARAM wParam;          /**< WORD message parameter */
   141 	LPARAM lParam;			/**< LONG message parameter */
   141     LPARAM lParam;          /**< LONG message parameter */
   142 };
   142 };
   143 
   143 
   144 /** The windows custom window manager information structure */
   144 /** The windows custom window manager information structure */
   145 typedef struct SDL_SysWMinfo {
   145 typedef struct SDL_SysWMinfo {
   146 	SDL_version version;
   146     SDL_version version;
   147 	HWND window;			/**< The Win32 display window */
   147     HWND window;            /**< The Win32 display window */
   148 	HGLRC hglrc;			/**< The OpenGL context, if any */
   148     HGLRC hglrc;            /**< The OpenGL context, if any */
   149 } SDL_SysWMinfo;
   149 } SDL_SysWMinfo;
   150 
   150 
   151 #elif defined(SDL_VIDEO_DRIVER_RISCOS)
   151 #elif defined(SDL_VIDEO_DRIVER_RISCOS)
   152 
   152 
   153 /** RISC OS custom event structure */
   153 /** RISC OS custom event structure */
   154 struct SDL_SysWMmsg {
   154 struct SDL_SysWMmsg {
   155 	SDL_version version;
   155     SDL_version version;
   156 	int eventCode;		/**< The window for the message */
   156     int eventCode;      /**< The window for the message */
   157 	int pollBlock[64];
   157     int pollBlock[64];
   158 };
   158 };
   159 
   159 
   160 /** The RISC OS custom window manager information structure */
   160 /** The RISC OS custom window manager information structure */
   161 typedef struct SDL_SysWMinfo {
   161 typedef struct SDL_SysWMinfo {
   162 	SDL_version version;
   162     SDL_version version;
   163 	int wimpVersion;    /**< Wimp version running under */
   163     int wimpVersion;    /**< Wimp version running under */
   164 	int taskHandle;     /**< The RISC OS task handle */
   164     int taskHandle;     /**< The RISC OS task handle */
   165 	int window;		/**< The RISC OS display window */
   165     int window;     /**< The RISC OS display window */
   166 } SDL_SysWMinfo;
   166 } SDL_SysWMinfo;
   167 
   167 
   168 #elif defined(SDL_VIDEO_DRIVER_PHOTON)
   168 #elif defined(SDL_VIDEO_DRIVER_PHOTON)
   169 #include <sys/neutrino.h>
   169 #include <sys/neutrino.h>
   170 #include <Ph.h>
   170 #include <Ph.h>
   171 
   171 
   172 /** The QNX custom event structure */
   172 /** The QNX custom event structure */
   173 struct SDL_SysWMmsg {
   173 struct SDL_SysWMmsg {
   174 	SDL_version version;
   174     SDL_version version;
   175 	int data;
   175     int data;
   176 };
   176 };
   177 
   177 
   178 /** The QNX custom window manager information structure */
   178 /** The QNX custom window manager information structure */
   179 typedef struct SDL_SysWMinfo {
   179 typedef struct SDL_SysWMinfo {
   180 	SDL_version version;
   180     SDL_version version;
   181 	int data;
   181     int data;
   182 } SDL_SysWMinfo;
   182 } SDL_SysWMinfo;
   183 
   183 
   184 #else
   184 #else
   185 
   185 
   186 /** The generic custom event structure */
   186 /** The generic custom event structure */
   187 struct SDL_SysWMmsg {
   187 struct SDL_SysWMmsg {
   188 	SDL_version version;
   188     SDL_version version;
   189 	int data;
   189     int data;
   190 };
   190 };
   191 
   191 
   192 /** The generic custom window manager information structure */
   192 /** The generic custom window manager information structure */
   193 typedef struct SDL_SysWMinfo {
   193 typedef struct SDL_SysWMinfo {
   194 	SDL_version version;
   194     SDL_version version;
   195 	int data;
   195     int data;
   196 } SDL_SysWMinfo;
   196 } SDL_SysWMinfo;
   197 
   197 
   198 #endif /* video driver type */
   198 #endif /* video driver type */
   199 
   199 
   200 #endif /* SDL_PROTOTYPES_ONLY */
   200 #endif /* SDL_PROTOTYPES_ONLY */
   201 
   201 
   202 /* Function prototypes */
   202 /* Function prototypes */
   203 /**
   203 /**
   204  * This function gives you custom hooks into the window manager information.
   204  * This function gives you custom hooks into the window manager information.
   205  * It fills the structure pointed to by 'info' with custom information and
   205  * It fills the structure pointed to by 'info' with custom information and
   206  * returns 0 if the function is not implemented, 1 if the function is 
   206  * returns 0 if the function is not implemented, 1 if the function is
   207  * implemented and no error occurred, and -1 if the version member of
   207  * implemented and no error occurred, and -1 if the version member of
   208  * the 'info' structure is not filled in or not supported.
   208  * the 'info' structure is not filled in or not supported.
   209  *
   209  *
   210  * You typically use this function like this:
   210  * You typically use this function like this:
   211  * @code
   211  * @code