include/SDL_syswm.h
branchSDL-1.2
changeset 11979 d684a767e240
parent 6137 4720145f848b
     1.1 --- a/include/SDL_syswm.h	Sun Mar 25 01:21:10 2018 +0300
     1.2 +++ b/include/SDL_syswm.h	Thu May 10 08:47:00 2018 +0300
     1.3 @@ -31,6 +31,29 @@
     1.4  #include "SDL_error.h"
     1.5  #include "SDL_version.h"
     1.6  
     1.7 +#ifndef SDL_PROTOTYPES_ONLY
     1.8 +# if defined(SDL_VIDEO_DRIVER_X11)
     1.9 +#  if defined(__APPLE__) && defined(__MACH__)
    1.10 +#   define Cursor X11Cursor /* conflicts with Quickdraw.h */
    1.11 +#  endif
    1.12 +#  include <X11/Xlib.h>
    1.13 +#  include <X11/Xatom.h>
    1.14 +#  if defined(__APPLE__) && defined(__MACH__)
    1.15 +#   undef Cursor
    1.16 +#  endif
    1.17 +# elif defined(SDL_VIDEO_DRIVER_NANOX)
    1.18 +#  include <microwin/nano-X.h>
    1.19 +# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
    1.20 +#  ifndef WIN32_LEAN_AND_MEAN
    1.21 +#  define WIN32_LEAN_AND_MEAN
    1.22 +#  endif
    1.23 +#  include <windows.h>
    1.24 +# elif defined(SDL_VIDEO_DRIVER_PHOTON)
    1.25 +#  include <sys/neutrino.h>
    1.26 +#  include <Ph.h>
    1.27 +# endif
    1.28 +#endif
    1.29 +
    1.30  #include "begin_code.h"
    1.31  /* Set up for C function definitions, even when using C++ */
    1.32  #ifdef __cplusplus
    1.33 @@ -43,25 +66,13 @@
    1.34   *  an unhandled window event occurs.  This event is ignored by default, but
    1.35   *  you can enable it with SDL_EventState()
    1.36   */
    1.37 -#ifdef SDL_PROTOTYPES_ONLY
    1.38  struct SDL_SysWMinfo;
    1.39  typedef struct SDL_SysWMinfo SDL_SysWMinfo;
    1.40 -#else
    1.41 +
    1.42 +#ifndef SDL_PROTOTYPES_ONLY
    1.43  
    1.44  /* This is the structure for custom window manager events */
    1.45  #if defined(SDL_VIDEO_DRIVER_X11)
    1.46 -#if defined(__APPLE__) && defined(__MACH__)
    1.47 -/* conflicts with Quickdraw.h */
    1.48 -#define Cursor X11Cursor
    1.49 -#endif
    1.50 -
    1.51 -#include <X11/Xlib.h>
    1.52 -#include <X11/Xatom.h>
    1.53 -
    1.54 -#if defined(__APPLE__) && defined(__MACH__)
    1.55 -/* matches the re-define above */
    1.56 -#undef Cursor
    1.57 -#endif
    1.58  
    1.59  /** These are the various supported subsystems under UNIX */
    1.60  typedef enum {
    1.61 @@ -81,7 +92,7 @@
    1.62   *  When this structure is returned, it holds information about which
    1.63   *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
    1.64   */
    1.65 -typedef struct SDL_SysWMinfo {
    1.66 +struct SDL_SysWMinfo {
    1.67  	SDL_version version;
    1.68  	SDL_SYSWM_TYPE subsystem;
    1.69  	union {
    1.70 @@ -111,10 +122,9 @@
    1.71                  /*@}*/
    1.72  	    } x11;
    1.73  	} info;
    1.74 -} SDL_SysWMinfo;
    1.75 +};
    1.76  
    1.77  #elif defined(SDL_VIDEO_DRIVER_NANOX)
    1.78 -#include <microwin/nano-X.h>
    1.79  
    1.80  /** The generic custom event structure */
    1.81  struct SDL_SysWMmsg {
    1.82 @@ -123,14 +133,12 @@
    1.83  };
    1.84  
    1.85  /** The windows custom window manager information structure */
    1.86 -typedef struct SDL_SysWMinfo {
    1.87 +struct SDL_SysWMinfo {
    1.88  	SDL_version version ;
    1.89  	GR_WINDOW_ID window ;	/* The display window */
    1.90 -} SDL_SysWMinfo;
    1.91 +};
    1.92  
    1.93  #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
    1.94 -#define WIN32_LEAN_AND_MEAN
    1.95 -#include <windows.h>
    1.96  
    1.97  /** The windows custom event structure */
    1.98  struct SDL_SysWMmsg {
    1.99 @@ -142,11 +150,11 @@
   1.100  };
   1.101  
   1.102  /** The windows custom window manager information structure */
   1.103 -typedef struct SDL_SysWMinfo {
   1.104 +struct SDL_SysWMinfo {
   1.105  	SDL_version version;
   1.106  	HWND window;			/**< The Win32 display window */
   1.107  	HGLRC hglrc;			/**< The OpenGL context, if any */
   1.108 -} SDL_SysWMinfo;
   1.109 +};
   1.110  
   1.111  #elif defined(SDL_VIDEO_DRIVER_RISCOS)
   1.112  
   1.113 @@ -158,16 +166,14 @@
   1.114  };
   1.115  
   1.116  /** The RISC OS custom window manager information structure */
   1.117 -typedef struct SDL_SysWMinfo {
   1.118 +struct SDL_SysWMinfo {
   1.119  	SDL_version version;
   1.120  	int wimpVersion;    /**< Wimp version running under */
   1.121  	int taskHandle;     /**< The RISC OS task handle */
   1.122  	int window;		/**< The RISC OS display window */
   1.123 -} SDL_SysWMinfo;
   1.124 +};
   1.125  
   1.126  #elif defined(SDL_VIDEO_DRIVER_PHOTON)
   1.127 -#include <sys/neutrino.h>
   1.128 -#include <Ph.h>
   1.129  
   1.130  /** The QNX custom event structure */
   1.131  struct SDL_SysWMmsg {
   1.132 @@ -176,10 +182,10 @@
   1.133  };
   1.134  
   1.135  /** The QNX custom window manager information structure */
   1.136 -typedef struct SDL_SysWMinfo {
   1.137 +struct SDL_SysWMinfo {
   1.138  	SDL_version version;
   1.139  	int data;
   1.140 -} SDL_SysWMinfo;
   1.141 +};
   1.142  
   1.143  #else
   1.144  
   1.145 @@ -190,10 +196,10 @@
   1.146  };
   1.147  
   1.148  /** The generic custom window manager information structure */
   1.149 -typedef struct SDL_SysWMinfo {
   1.150 +struct SDL_SysWMinfo {
   1.151  	SDL_version version;
   1.152  	int data;
   1.153 -} SDL_SysWMinfo;
   1.154 +};
   1.155  
   1.156  #endif /* video driver type */
   1.157