SDL_syswm.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #ifndef _SDL_syswm_h
  2. #define _SDL_syswm_h
  3. #include "SDL_stdinc.h"
  4. #include "SDL_error.h"
  5. #include "SDL_video.h"
  6. #include "SDL_version.h"
  7. #include "begin_code.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifdef SDL_PROTOTYPES_ONLY
  12. struct SDL_SysWMinfo;
  13. #else
  14. #if defined(SDL_VIDEO_DRIVER_WINDOWS)
  15. #define WIN32_LEAN_AND_MEAN
  16. #include <windows.h>
  17. #endif
  18. #if defined(SDL_VIDEO_DRIVER_X11)
  19. #if defined(__APPLE__) && defined(__MACH__)
  20. #define Cursor X11Cursor
  21. #endif
  22. #include <X11/Xlib.h>
  23. #include <X11/Xatom.h>
  24. #if defined(__APPLE__) && defined(__MACH__)
  25. #undef Cursor
  26. #endif
  27. #endif
  28. #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
  29. #include <directfb.h>
  30. #endif
  31. #if defined(SDL_VIDEO_DRIVER_COCOA)
  32. #ifdef __OBJC__
  33. #include <Cocoa/Cocoa.h>
  34. #else
  35. typedef struct _NSWindow NSWindow;
  36. #endif
  37. #endif
  38. #if defined(SDL_VIDEO_DRIVER_UIKIT)
  39. #ifdef __OBJC__
  40. #include <UIKit/UIKit.h>
  41. #else
  42. typedef struct _UIWindow UIWindow;
  43. #endif
  44. #endif
  45. typedef enum
  46. {
  47. SDL_SYSWM_UNKNOWN,
  48. SDL_SYSWM_WINDOWS,
  49. SDL_SYSWM_X11,
  50. SDL_SYSWM_DIRECTFB,
  51. SDL_SYSWM_COCOA,
  52. SDL_SYSWM_UIKIT,
  53. } SDL_SYSWM_TYPE;
  54. struct SDL_SysWMmsg
  55. {
  56. SDL_version version;
  57. SDL_SYSWM_TYPE subsystem;
  58. union
  59. {
  60. #if defined(SDL_VIDEO_DRIVER_WINDOWS)
  61. struct {
  62. HWND hwnd;
  63. UINT msg;
  64. WPARAM wParam;
  65. LPARAM lParam;
  66. } win;
  67. #endif
  68. #if defined(SDL_VIDEO_DRIVER_X11)
  69. struct {
  70. XEvent event;
  71. } x11;
  72. #endif
  73. #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
  74. struct {
  75. DFBEvent event;
  76. } dfb;
  77. #endif
  78. #if defined(SDL_VIDEO_DRIVER_COCOA)
  79. struct
  80. {
  81. } cocoa;
  82. #endif
  83. #if defined(SDL_VIDEO_DRIVER_UIKIT)
  84. struct
  85. {
  86. } uikit;
  87. #endif
  88. int dummy;
  89. } msg;
  90. };
  91. struct SDL_SysWMinfo
  92. {
  93. SDL_version version;
  94. SDL_SYSWM_TYPE subsystem;
  95. union
  96. {
  97. #if defined(SDL_VIDEO_DRIVER_WINDOWS)
  98. struct
  99. {
  100. HWND window;
  101. } win;
  102. #endif
  103. #if defined(SDL_VIDEO_DRIVER_X11)
  104. struct
  105. {
  106. Display *display;
  107. Window window;
  108. } x11;
  109. #endif
  110. #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
  111. struct
  112. {
  113. IDirectFB *dfb;
  114. IDirectFBWindow *window;
  115. IDirectFBSurface *surface;
  116. } dfb;
  117. #endif
  118. #if defined(SDL_VIDEO_DRIVER_COCOA)
  119. struct
  120. {
  121. NSWindow *window;
  122. } cocoa;
  123. #endif
  124. #if defined(SDL_VIDEO_DRIVER_UIKIT)
  125. struct
  126. {
  127. UIWindow *window;
  128. } uikit;
  129. #endif
  130. int dummy;
  131. } info;
  132. };
  133. #endif
  134. typedef struct SDL_SysWMinfo SDL_SysWMinfo;
  135. typedef SDL_bool SDLCALL tSDL_GetWindowWMInfo(SDL_Window * window,
  136. SDL_SysWMinfo * info);
  137. extern tSDL_GetWindowWMInfo *SDL_GetWindowWMInfo;
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #include "close_code.h"
  142. #endif