ruby2d-rpeck-windows 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. checksums.yaml +7 -0
  2. data/assets/README.md +22 -0
  3. data/assets/Rakefile +85 -0
  4. data/assets/app.icns +0 -0
  5. data/assets/include/SDL2/SDL.h +138 -0
  6. data/assets/include/SDL2/SDL_assert.h +293 -0
  7. data/assets/include/SDL2/SDL_atomic.h +295 -0
  8. data/assets/include/SDL2/SDL_audio.h +859 -0
  9. data/assets/include/SDL2/SDL_bits.h +121 -0
  10. data/assets/include/SDL2/SDL_blendmode.h +123 -0
  11. data/assets/include/SDL2/SDL_clipboard.h +71 -0
  12. data/assets/include/SDL2/SDL_config.h +55 -0
  13. data/assets/include/SDL2/SDL_config_android.h +182 -0
  14. data/assets/include/SDL2/SDL_config_iphoneos.h +207 -0
  15. data/assets/include/SDL2/SDL_config_macosx.h +266 -0
  16. data/assets/include/SDL2/SDL_config_minimal.h +85 -0
  17. data/assets/include/SDL2/SDL_config_os2.h +188 -0
  18. data/assets/include/SDL2/SDL_config_pandora.h +135 -0
  19. data/assets/include/SDL2/SDL_config_psp.h +165 -0
  20. data/assets/include/SDL2/SDL_config_windows.h +288 -0
  21. data/assets/include/SDL2/SDL_config_winrt.h +243 -0
  22. data/assets/include/SDL2/SDL_config_wiz.h +149 -0
  23. data/assets/include/SDL2/SDL_copying.h +20 -0
  24. data/assets/include/SDL2/SDL_cpuinfo.h +299 -0
  25. data/assets/include/SDL2/SDL_egl.h +1676 -0
  26. data/assets/include/SDL2/SDL_endian.h +263 -0
  27. data/assets/include/SDL2/SDL_error.h +112 -0
  28. data/assets/include/SDL2/SDL_events.h +827 -0
  29. data/assets/include/SDL2/SDL_filesystem.h +136 -0
  30. data/assets/include/SDL2/SDL_gamecontroller.h +541 -0
  31. data/assets/include/SDL2/SDL_gesture.h +87 -0
  32. data/assets/include/SDL2/SDL_haptic.h +1247 -0
  33. data/assets/include/SDL2/SDL_hints.h +1578 -0
  34. data/assets/include/SDL2/SDL_image.h +161 -0
  35. data/assets/include/SDL2/SDL_joystick.h +499 -0
  36. data/assets/include/SDL2/SDL_keyboard.h +217 -0
  37. data/assets/include/SDL2/SDL_keycode.h +351 -0
  38. data/assets/include/SDL2/SDL_loadso.h +81 -0
  39. data/assets/include/SDL2/SDL_locale.h +101 -0
  40. data/assets/include/SDL2/SDL_log.h +211 -0
  41. data/assets/include/SDL2/SDL_main.h +180 -0
  42. data/assets/include/SDL2/SDL_messagebox.h +146 -0
  43. data/assets/include/SDL2/SDL_metal.h +117 -0
  44. data/assets/include/SDL2/SDL_misc.h +75 -0
  45. data/assets/include/SDL2/SDL_mixer.h +651 -0
  46. data/assets/include/SDL2/SDL_mouse.h +302 -0
  47. data/assets/include/SDL2/SDL_mutex.h +251 -0
  48. data/assets/include/SDL2/SDL_name.h +33 -0
  49. data/assets/include/SDL2/SDL_opengl.h +2183 -0
  50. data/assets/include/SDL2/SDL_opengl_glext.h +11180 -0
  51. data/assets/include/SDL2/SDL_opengles.h +39 -0
  52. data/assets/include/SDL2/SDL_opengles2.h +52 -0
  53. data/assets/include/SDL2/SDL_opengles2_gl2.h +621 -0
  54. data/assets/include/SDL2/SDL_opengles2_gl2ext.h +2050 -0
  55. data/assets/include/SDL2/SDL_opengles2_gl2platform.h +30 -0
  56. data/assets/include/SDL2/SDL_opengles2_khrplatform.h +282 -0
  57. data/assets/include/SDL2/SDL_pixels.h +479 -0
  58. data/assets/include/SDL2/SDL_platform.h +198 -0
  59. data/assets/include/SDL2/SDL_power.h +75 -0
  60. data/assets/include/SDL2/SDL_quit.h +58 -0
  61. data/assets/include/SDL2/SDL_rect.h +174 -0
  62. data/assets/include/SDL2/SDL_render.h +1158 -0
  63. data/assets/include/SDL2/SDL_revision.h +2 -0
  64. data/assets/include/SDL2/SDL_rwops.h +283 -0
  65. data/assets/include/SDL2/SDL_scancode.h +413 -0
  66. data/assets/include/SDL2/SDL_sensor.h +267 -0
  67. data/assets/include/SDL2/SDL_shape.h +144 -0
  68. data/assets/include/SDL2/SDL_stdinc.h +647 -0
  69. data/assets/include/SDL2/SDL_surface.h +563 -0
  70. data/assets/include/SDL2/SDL_system.h +325 -0
  71. data/assets/include/SDL2/SDL_syswm.h +354 -0
  72. data/assets/include/SDL2/SDL_test.h +69 -0
  73. data/assets/include/SDL2/SDL_test_assert.h +105 -0
  74. data/assets/include/SDL2/SDL_test_common.h +218 -0
  75. data/assets/include/SDL2/SDL_test_compare.h +69 -0
  76. data/assets/include/SDL2/SDL_test_crc32.h +124 -0
  77. data/assets/include/SDL2/SDL_test_font.h +81 -0
  78. data/assets/include/SDL2/SDL_test_fuzzer.h +384 -0
  79. data/assets/include/SDL2/SDL_test_harness.h +134 -0
  80. data/assets/include/SDL2/SDL_test_images.h +78 -0
  81. data/assets/include/SDL2/SDL_test_log.h +67 -0
  82. data/assets/include/SDL2/SDL_test_md5.h +129 -0
  83. data/assets/include/SDL2/SDL_test_memory.h +63 -0
  84. data/assets/include/SDL2/SDL_test_random.h +115 -0
  85. data/assets/include/SDL2/SDL_thread.h +366 -0
  86. data/assets/include/SDL2/SDL_timer.h +115 -0
  87. data/assets/include/SDL2/SDL_touch.h +102 -0
  88. data/assets/include/SDL2/SDL_ttf.h +294 -0
  89. data/assets/include/SDL2/SDL_types.h +29 -0
  90. data/assets/include/SDL2/SDL_version.h +162 -0
  91. data/assets/include/SDL2/SDL_video.h +1282 -0
  92. data/assets/include/SDL2/SDL_vulkan.h +276 -0
  93. data/assets/include/SDL2/begin_code.h +166 -0
  94. data/assets/include/SDL2/close_code.h +40 -0
  95. data/assets/include/glew.h +23686 -0
  96. data/assets/ios/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
  97. data/assets/ios/Assets.xcassets/Contents.json +6 -0
  98. data/assets/ios/Base.lproj/LaunchScreen.storyboard +27 -0
  99. data/assets/ios/Info.plist +43 -0
  100. data/assets/ios/MRuby.framework/Headers/mrbconf.h +143 -0
  101. data/assets/ios/MRuby.framework/Headers/mruby/array.h +280 -0
  102. data/assets/ios/MRuby.framework/Headers/mruby/boxing_nan.h +102 -0
  103. data/assets/ios/MRuby.framework/Headers/mruby/boxing_no.h +56 -0
  104. data/assets/ios/MRuby.framework/Headers/mruby/boxing_word.h +144 -0
  105. data/assets/ios/MRuby.framework/Headers/mruby/class.h +97 -0
  106. data/assets/ios/MRuby.framework/Headers/mruby/common.h +77 -0
  107. data/assets/ios/MRuby.framework/Headers/mruby/compile.h +195 -0
  108. data/assets/ios/MRuby.framework/Headers/mruby/data.h +75 -0
  109. data/assets/ios/MRuby.framework/Headers/mruby/debug.h +67 -0
  110. data/assets/ios/MRuby.framework/Headers/mruby/dump.h +196 -0
  111. data/assets/ios/MRuby.framework/Headers/mruby/error.h +75 -0
  112. data/assets/ios/MRuby.framework/Headers/mruby/gc.h +91 -0
  113. data/assets/ios/MRuby.framework/Headers/mruby/hash.h +215 -0
  114. data/assets/ios/MRuby.framework/Headers/mruby/irep.h +75 -0
  115. data/assets/ios/MRuby.framework/Headers/mruby/istruct.h +47 -0
  116. data/assets/ios/MRuby.framework/Headers/mruby/khash.h +274 -0
  117. data/assets/ios/MRuby.framework/Headers/mruby/numeric.h +161 -0
  118. data/assets/ios/MRuby.framework/Headers/mruby/object.h +44 -0
  119. data/assets/ios/MRuby.framework/Headers/mruby/opcode.h +69 -0
  120. data/assets/ios/MRuby.framework/Headers/mruby/ops.h +117 -0
  121. data/assets/ios/MRuby.framework/Headers/mruby/proc.h +131 -0
  122. data/assets/ios/MRuby.framework/Headers/mruby/range.h +49 -0
  123. data/assets/ios/MRuby.framework/Headers/mruby/re.h +16 -0
  124. data/assets/ios/MRuby.framework/Headers/mruby/string.h +444 -0
  125. data/assets/ios/MRuby.framework/Headers/mruby/throw.h +55 -0
  126. data/assets/ios/MRuby.framework/Headers/mruby/value.h +309 -0
  127. data/assets/ios/MRuby.framework/Headers/mruby/variable.h +136 -0
  128. data/assets/ios/MRuby.framework/Headers/mruby/version.h +110 -0
  129. data/assets/ios/MRuby.framework/Headers/mruby.h +1282 -0
  130. data/assets/ios/MRuby.framework/Info.plist +20 -0
  131. data/assets/ios/MRuby.framework/MRuby +0 -0
  132. data/assets/ios/MyApp.xcodeproj/project.pbxproj +368 -0
  133. data/assets/ios/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  134. data/assets/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  135. data/assets/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +30 -0
  136. data/assets/ios/main.c +1 -0
  137. data/assets/macos/lib/libFLAC.a +0 -0
  138. data/assets/macos/lib/libSDL2.a +0 -0
  139. data/assets/macos/lib/libSDL2_image.a +0 -0
  140. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  141. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  142. data/assets/macos/lib/libfreetype.a +0 -0
  143. data/assets/macos/lib/libjpeg.a +0 -0
  144. data/assets/macos/lib/libmodplug.a +0 -0
  145. data/assets/macos/lib/libmpg123.a +0 -0
  146. data/assets/macos/lib/libogg.a +0 -0
  147. data/assets/macos/lib/libpng16.a +0 -0
  148. data/assets/macos/lib/libtiff.a +0 -0
  149. data/assets/macos/lib/libvorbis.a +0 -0
  150. data/assets/macos/lib/libvorbisfile.a +0 -0
  151. data/assets/macos/lib/libwebp.a +0 -0
  152. data/assets/mingw/bin/SDL2.dll +0 -0
  153. data/assets/mingw/bin/SDL2_image.dll +0 -0
  154. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  155. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  156. data/assets/mingw/bin/glew32.dll +0 -0
  157. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  158. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  159. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  160. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  161. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  162. data/assets/mingw/bin/libogg-0.dll +0 -0
  163. data/assets/mingw/bin/libopus-0.dll +0 -0
  164. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  165. data/assets/mingw/bin/libpng16-16.dll +0 -0
  166. data/assets/mingw/bin/libtiff-5.dll +0 -0
  167. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  168. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  169. data/assets/mingw/bin/libwebp-7.dll +0 -0
  170. data/assets/mingw/bin/libwinpthread-1.dll +0 -0
  171. data/assets/mingw/bin/zlib1.dll +0 -0
  172. data/assets/mingw/lib/libSDL2.a +0 -0
  173. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  174. data/assets/mingw/lib/libSDL2_image.a +0 -0
  175. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  176. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  177. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  178. data/assets/mingw/lib/libSDL2_test.a +0 -0
  179. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  180. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  181. data/assets/mingw/lib/libSDL2main.a +0 -0
  182. data/assets/mingw/lib/libglew32.a +0 -0
  183. data/assets/mingw/lib/libglew32.dll.a +0 -0
  184. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +16 -0
  185. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +6 -0
  186. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +17 -0
  187. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +16 -0
  188. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +6 -0
  189. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +16 -0
  190. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +6 -0
  191. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +16 -0
  192. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +6 -0
  193. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +17 -0
  194. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +16 -0
  195. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +6 -0
  196. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +16 -0
  197. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +6 -0
  198. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +32 -0
  199. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +16 -0
  200. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +16 -0
  201. data/assets/tvos/Assets.xcassets/Contents.json +6 -0
  202. data/assets/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +22 -0
  203. data/assets/tvos/Info.plist +30 -0
  204. data/assets/tvos/MRuby.framework/Headers/mrbconf.h +143 -0
  205. data/assets/tvos/MRuby.framework/Headers/mruby/array.h +280 -0
  206. data/assets/tvos/MRuby.framework/Headers/mruby/boxing_nan.h +102 -0
  207. data/assets/tvos/MRuby.framework/Headers/mruby/boxing_no.h +56 -0
  208. data/assets/tvos/MRuby.framework/Headers/mruby/boxing_word.h +144 -0
  209. data/assets/tvos/MRuby.framework/Headers/mruby/class.h +97 -0
  210. data/assets/tvos/MRuby.framework/Headers/mruby/common.h +77 -0
  211. data/assets/tvos/MRuby.framework/Headers/mruby/compile.h +195 -0
  212. data/assets/tvos/MRuby.framework/Headers/mruby/data.h +75 -0
  213. data/assets/tvos/MRuby.framework/Headers/mruby/debug.h +67 -0
  214. data/assets/tvos/MRuby.framework/Headers/mruby/dump.h +196 -0
  215. data/assets/tvos/MRuby.framework/Headers/mruby/error.h +75 -0
  216. data/assets/tvos/MRuby.framework/Headers/mruby/gc.h +91 -0
  217. data/assets/tvos/MRuby.framework/Headers/mruby/hash.h +215 -0
  218. data/assets/tvos/MRuby.framework/Headers/mruby/irep.h +75 -0
  219. data/assets/tvos/MRuby.framework/Headers/mruby/istruct.h +47 -0
  220. data/assets/tvos/MRuby.framework/Headers/mruby/khash.h +274 -0
  221. data/assets/tvos/MRuby.framework/Headers/mruby/numeric.h +161 -0
  222. data/assets/tvos/MRuby.framework/Headers/mruby/object.h +44 -0
  223. data/assets/tvos/MRuby.framework/Headers/mruby/opcode.h +69 -0
  224. data/assets/tvos/MRuby.framework/Headers/mruby/ops.h +117 -0
  225. data/assets/tvos/MRuby.framework/Headers/mruby/proc.h +131 -0
  226. data/assets/tvos/MRuby.framework/Headers/mruby/range.h +49 -0
  227. data/assets/tvos/MRuby.framework/Headers/mruby/re.h +16 -0
  228. data/assets/tvos/MRuby.framework/Headers/mruby/string.h +444 -0
  229. data/assets/tvos/MRuby.framework/Headers/mruby/throw.h +55 -0
  230. data/assets/tvos/MRuby.framework/Headers/mruby/value.h +309 -0
  231. data/assets/tvos/MRuby.framework/Headers/mruby/variable.h +136 -0
  232. data/assets/tvos/MRuby.framework/Headers/mruby/version.h +110 -0
  233. data/assets/tvos/MRuby.framework/Headers/mruby.h +1282 -0
  234. data/assets/tvos/MRuby.framework/Info.plist +20 -0
  235. data/assets/tvos/MRuby.framework/MRuby +0 -0
  236. data/assets/tvos/MyApp.xcodeproj/project.pbxproj +350 -0
  237. data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  238. data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  239. data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +30 -0
  240. data/assets/tvos/main.c +1 -0
  241. data/bin/ruby2d +142 -0
  242. data/ext/ruby2d/common.c +185 -0
  243. data/ext/ruby2d/controllers.c +110 -0
  244. data/ext/ruby2d/extconf.rb +147 -0
  245. data/ext/ruby2d/font.c +35 -0
  246. data/ext/ruby2d/gl.c +398 -0
  247. data/ext/ruby2d/gl2.c +86 -0
  248. data/ext/ruby2d/gl3.c +305 -0
  249. data/ext/ruby2d/gles.c +249 -0
  250. data/ext/ruby2d/image.c +58 -0
  251. data/ext/ruby2d/input.c +48 -0
  252. data/ext/ruby2d/music.c +127 -0
  253. data/ext/ruby2d/ruby2d.c +1374 -0
  254. data/ext/ruby2d/ruby2d.h +656 -0
  255. data/ext/ruby2d/shapes.c +154 -0
  256. data/ext/ruby2d/sound.c +118 -0
  257. data/ext/ruby2d/text.c +22 -0
  258. data/ext/ruby2d/window.c +414 -0
  259. data/lib/ruby2d/circle.rb +43 -0
  260. data/lib/ruby2d/cli/build.rb +237 -0
  261. data/lib/ruby2d/cli/colorize.rb +10 -0
  262. data/lib/ruby2d/cli/console.rb +65 -0
  263. data/lib/ruby2d/cli/enable_console.rb +5 -0
  264. data/lib/ruby2d/cli/launch.rb +50 -0
  265. data/lib/ruby2d/color.rb +136 -0
  266. data/lib/ruby2d/dsl.rb +46 -0
  267. data/lib/ruby2d/entity.rb +17 -0
  268. data/lib/ruby2d/exceptions.rb +6 -0
  269. data/lib/ruby2d/font.rb +96 -0
  270. data/lib/ruby2d/image.rb +58 -0
  271. data/lib/ruby2d/line.rb +89 -0
  272. data/lib/ruby2d/music.rb +67 -0
  273. data/lib/ruby2d/pixel.rb +17 -0
  274. data/lib/ruby2d/quad.rb +96 -0
  275. data/lib/ruby2d/rectangle.rb +65 -0
  276. data/lib/ruby2d/renderable.rb +40 -0
  277. data/lib/ruby2d/ruby2d.so +0 -0
  278. data/lib/ruby2d/sound.rb +55 -0
  279. data/lib/ruby2d/sprite.rb +232 -0
  280. data/lib/ruby2d/square.rb +37 -0
  281. data/lib/ruby2d/text.rb +76 -0
  282. data/lib/ruby2d/texture.rb +28 -0
  283. data/lib/ruby2d/tileset.rb +87 -0
  284. data/lib/ruby2d/triangle.rb +82 -0
  285. data/lib/ruby2d/version.rb +5 -0
  286. data/lib/ruby2d/vertices.rb +84 -0
  287. data/lib/ruby2d/window.rb +673 -0
  288. data/lib/ruby2d.rb +69 -0
  289. metadata +346 -0
@@ -0,0 +1,827 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * \file SDL_events.h
24
+ *
25
+ * Include file for SDL event handling.
26
+ */
27
+
28
+ #ifndef SDL_events_h_
29
+ #define SDL_events_h_
30
+
31
+ #include "SDL_stdinc.h"
32
+ #include "SDL_error.h"
33
+ #include "SDL_video.h"
34
+ #include "SDL_keyboard.h"
35
+ #include "SDL_mouse.h"
36
+ #include "SDL_joystick.h"
37
+ #include "SDL_gamecontroller.h"
38
+ #include "SDL_quit.h"
39
+ #include "SDL_gesture.h"
40
+ #include "SDL_touch.h"
41
+
42
+ #include "begin_code.h"
43
+ /* Set up for C function definitions, even when using C++ */
44
+ #ifdef __cplusplus
45
+ extern "C" {
46
+ #endif
47
+
48
+ /* General keyboard/mouse state definitions */
49
+ #define SDL_RELEASED 0
50
+ #define SDL_PRESSED 1
51
+
52
+ /**
53
+ * \brief The types of events that can be delivered.
54
+ */
55
+ typedef enum
56
+ {
57
+ SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
58
+
59
+ /* Application events */
60
+ SDL_QUIT = 0x100, /**< User-requested quit */
61
+
62
+ /* These application events have special meaning on iOS, see README-ios.md for details */
63
+ SDL_APP_TERMINATING, /**< The application is being terminated by the OS
64
+ Called on iOS in applicationWillTerminate()
65
+ Called on Android in onDestroy()
66
+ */
67
+ SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible.
68
+ Called on iOS in applicationDidReceiveMemoryWarning()
69
+ Called on Android in onLowMemory()
70
+ */
71
+ SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
72
+ Called on iOS in applicationWillResignActive()
73
+ Called on Android in onPause()
74
+ */
75
+ SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
76
+ Called on iOS in applicationDidEnterBackground()
77
+ Called on Android in onPause()
78
+ */
79
+ SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
80
+ Called on iOS in applicationWillEnterForeground()
81
+ Called on Android in onResume()
82
+ */
83
+ SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
84
+ Called on iOS in applicationDidBecomeActive()
85
+ Called on Android in onResume()
86
+ */
87
+
88
+ SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */
89
+
90
+ /* Display events */
91
+ SDL_DISPLAYEVENT = 0x150, /**< Display state change */
92
+
93
+ /* Window events */
94
+ SDL_WINDOWEVENT = 0x200, /**< Window state change */
95
+ SDL_SYSWMEVENT, /**< System specific event */
96
+
97
+ /* Keyboard events */
98
+ SDL_KEYDOWN = 0x300, /**< Key pressed */
99
+ SDL_KEYUP, /**< Key released */
100
+ SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
101
+ SDL_TEXTINPUT, /**< Keyboard text input */
102
+ SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
103
+ input language or keyboard layout change.
104
+ */
105
+
106
+ /* Mouse events */
107
+ SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
108
+ SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
109
+ SDL_MOUSEBUTTONUP, /**< Mouse button released */
110
+ SDL_MOUSEWHEEL, /**< Mouse wheel motion */
111
+
112
+ /* Joystick events */
113
+ SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
114
+ SDL_JOYBALLMOTION, /**< Joystick trackball motion */
115
+ SDL_JOYHATMOTION, /**< Joystick hat position change */
116
+ SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
117
+ SDL_JOYBUTTONUP, /**< Joystick button released */
118
+ SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
119
+ SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
120
+
121
+ /* Game controller events */
122
+ SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
123
+ SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */
124
+ SDL_CONTROLLERBUTTONUP, /**< Game controller button released */
125
+ SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
126
+ SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
127
+ SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
128
+ SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */
129
+ SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
130
+ SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
131
+ SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
132
+
133
+ /* Touch events */
134
+ SDL_FINGERDOWN = 0x700,
135
+ SDL_FINGERUP,
136
+ SDL_FINGERMOTION,
137
+
138
+ /* Gesture events */
139
+ SDL_DOLLARGESTURE = 0x800,
140
+ SDL_DOLLARRECORD,
141
+ SDL_MULTIGESTURE,
142
+
143
+ /* Clipboard events */
144
+ SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
145
+
146
+ /* Drag and drop events */
147
+ SDL_DROPFILE = 0x1000, /**< The system requests a file open */
148
+ SDL_DROPTEXT, /**< text/plain drag-and-drop event */
149
+ SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
150
+ SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
151
+
152
+ /* Audio hotplug events */
153
+ SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
154
+ SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */
155
+
156
+ /* Sensor events */
157
+ SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */
158
+
159
+ /* Render events */
160
+ SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
161
+ SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
162
+
163
+ /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
164
+ * and should be allocated with SDL_RegisterEvents()
165
+ */
166
+ SDL_USEREVENT = 0x8000,
167
+
168
+ /**
169
+ * This last event is only for bounding internal arrays
170
+ */
171
+ SDL_LASTEVENT = 0xFFFF
172
+ } SDL_EventType;
173
+
174
+ /**
175
+ * \brief Fields shared by every event
176
+ */
177
+ typedef struct SDL_CommonEvent
178
+ {
179
+ Uint32 type;
180
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
181
+ } SDL_CommonEvent;
182
+
183
+ /**
184
+ * \brief Display state change event data (event.display.*)
185
+ */
186
+ typedef struct SDL_DisplayEvent
187
+ {
188
+ Uint32 type; /**< ::SDL_DISPLAYEVENT */
189
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
190
+ Uint32 display; /**< The associated display index */
191
+ Uint8 event; /**< ::SDL_DisplayEventID */
192
+ Uint8 padding1;
193
+ Uint8 padding2;
194
+ Uint8 padding3;
195
+ Sint32 data1; /**< event dependent data */
196
+ } SDL_DisplayEvent;
197
+
198
+ /**
199
+ * \brief Window state change event data (event.window.*)
200
+ */
201
+ typedef struct SDL_WindowEvent
202
+ {
203
+ Uint32 type; /**< ::SDL_WINDOWEVENT */
204
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
205
+ Uint32 windowID; /**< The associated window */
206
+ Uint8 event; /**< ::SDL_WindowEventID */
207
+ Uint8 padding1;
208
+ Uint8 padding2;
209
+ Uint8 padding3;
210
+ Sint32 data1; /**< event dependent data */
211
+ Sint32 data2; /**< event dependent data */
212
+ } SDL_WindowEvent;
213
+
214
+ /**
215
+ * \brief Keyboard button event structure (event.key.*)
216
+ */
217
+ typedef struct SDL_KeyboardEvent
218
+ {
219
+ Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
220
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
221
+ Uint32 windowID; /**< The window with keyboard focus, if any */
222
+ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
223
+ Uint8 repeat; /**< Non-zero if this is a key repeat */
224
+ Uint8 padding2;
225
+ Uint8 padding3;
226
+ SDL_Keysym keysym; /**< The key that was pressed or released */
227
+ } SDL_KeyboardEvent;
228
+
229
+ #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
230
+ /**
231
+ * \brief Keyboard text editing event structure (event.edit.*)
232
+ */
233
+ typedef struct SDL_TextEditingEvent
234
+ {
235
+ Uint32 type; /**< ::SDL_TEXTEDITING */
236
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
237
+ Uint32 windowID; /**< The window with keyboard focus, if any */
238
+ char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
239
+ Sint32 start; /**< The start cursor of selected editing text */
240
+ Sint32 length; /**< The length of selected editing text */
241
+ } SDL_TextEditingEvent;
242
+
243
+
244
+ #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
245
+ /**
246
+ * \brief Keyboard text input event structure (event.text.*)
247
+ */
248
+ typedef struct SDL_TextInputEvent
249
+ {
250
+ Uint32 type; /**< ::SDL_TEXTINPUT */
251
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
252
+ Uint32 windowID; /**< The window with keyboard focus, if any */
253
+ char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
254
+ } SDL_TextInputEvent;
255
+
256
+ /**
257
+ * \brief Mouse motion event structure (event.motion.*)
258
+ */
259
+ typedef struct SDL_MouseMotionEvent
260
+ {
261
+ Uint32 type; /**< ::SDL_MOUSEMOTION */
262
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
263
+ Uint32 windowID; /**< The window with mouse focus, if any */
264
+ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
265
+ Uint32 state; /**< The current button state */
266
+ Sint32 x; /**< X coordinate, relative to window */
267
+ Sint32 y; /**< Y coordinate, relative to window */
268
+ Sint32 xrel; /**< The relative motion in the X direction */
269
+ Sint32 yrel; /**< The relative motion in the Y direction */
270
+ } SDL_MouseMotionEvent;
271
+
272
+ /**
273
+ * \brief Mouse button event structure (event.button.*)
274
+ */
275
+ typedef struct SDL_MouseButtonEvent
276
+ {
277
+ Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
278
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
279
+ Uint32 windowID; /**< The window with mouse focus, if any */
280
+ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
281
+ Uint8 button; /**< The mouse button index */
282
+ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
283
+ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
284
+ Uint8 padding1;
285
+ Sint32 x; /**< X coordinate, relative to window */
286
+ Sint32 y; /**< Y coordinate, relative to window */
287
+ } SDL_MouseButtonEvent;
288
+
289
+ /**
290
+ * \brief Mouse wheel event structure (event.wheel.*)
291
+ */
292
+ typedef struct SDL_MouseWheelEvent
293
+ {
294
+ Uint32 type; /**< ::SDL_MOUSEWHEEL */
295
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
296
+ Uint32 windowID; /**< The window with mouse focus, if any */
297
+ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
298
+ Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
299
+ Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
300
+ Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
301
+ } SDL_MouseWheelEvent;
302
+
303
+ /**
304
+ * \brief Joystick axis motion event structure (event.jaxis.*)
305
+ */
306
+ typedef struct SDL_JoyAxisEvent
307
+ {
308
+ Uint32 type; /**< ::SDL_JOYAXISMOTION */
309
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
310
+ SDL_JoystickID which; /**< The joystick instance id */
311
+ Uint8 axis; /**< The joystick axis index */
312
+ Uint8 padding1;
313
+ Uint8 padding2;
314
+ Uint8 padding3;
315
+ Sint16 value; /**< The axis value (range: -32768 to 32767) */
316
+ Uint16 padding4;
317
+ } SDL_JoyAxisEvent;
318
+
319
+ /**
320
+ * \brief Joystick trackball motion event structure (event.jball.*)
321
+ */
322
+ typedef struct SDL_JoyBallEvent
323
+ {
324
+ Uint32 type; /**< ::SDL_JOYBALLMOTION */
325
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
326
+ SDL_JoystickID which; /**< The joystick instance id */
327
+ Uint8 ball; /**< The joystick trackball index */
328
+ Uint8 padding1;
329
+ Uint8 padding2;
330
+ Uint8 padding3;
331
+ Sint16 xrel; /**< The relative motion in the X direction */
332
+ Sint16 yrel; /**< The relative motion in the Y direction */
333
+ } SDL_JoyBallEvent;
334
+
335
+ /**
336
+ * \brief Joystick hat position change event structure (event.jhat.*)
337
+ */
338
+ typedef struct SDL_JoyHatEvent
339
+ {
340
+ Uint32 type; /**< ::SDL_JOYHATMOTION */
341
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
342
+ SDL_JoystickID which; /**< The joystick instance id */
343
+ Uint8 hat; /**< The joystick hat index */
344
+ Uint8 value; /**< The hat position value.
345
+ * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
346
+ * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
347
+ * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
348
+ *
349
+ * Note that zero means the POV is centered.
350
+ */
351
+ Uint8 padding1;
352
+ Uint8 padding2;
353
+ } SDL_JoyHatEvent;
354
+
355
+ /**
356
+ * \brief Joystick button event structure (event.jbutton.*)
357
+ */
358
+ typedef struct SDL_JoyButtonEvent
359
+ {
360
+ Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
361
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
362
+ SDL_JoystickID which; /**< The joystick instance id */
363
+ Uint8 button; /**< The joystick button index */
364
+ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
365
+ Uint8 padding1;
366
+ Uint8 padding2;
367
+ } SDL_JoyButtonEvent;
368
+
369
+ /**
370
+ * \brief Joystick device event structure (event.jdevice.*)
371
+ */
372
+ typedef struct SDL_JoyDeviceEvent
373
+ {
374
+ Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
375
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
376
+ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
377
+ } SDL_JoyDeviceEvent;
378
+
379
+
380
+ /**
381
+ * \brief Game controller axis motion event structure (event.caxis.*)
382
+ */
383
+ typedef struct SDL_ControllerAxisEvent
384
+ {
385
+ Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
386
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
387
+ SDL_JoystickID which; /**< The joystick instance id */
388
+ Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
389
+ Uint8 padding1;
390
+ Uint8 padding2;
391
+ Uint8 padding3;
392
+ Sint16 value; /**< The axis value (range: -32768 to 32767) */
393
+ Uint16 padding4;
394
+ } SDL_ControllerAxisEvent;
395
+
396
+
397
+ /**
398
+ * \brief Game controller button event structure (event.cbutton.*)
399
+ */
400
+ typedef struct SDL_ControllerButtonEvent
401
+ {
402
+ Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
403
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
404
+ SDL_JoystickID which; /**< The joystick instance id */
405
+ Uint8 button; /**< The controller button (SDL_GameControllerButton) */
406
+ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
407
+ Uint8 padding1;
408
+ Uint8 padding2;
409
+ } SDL_ControllerButtonEvent;
410
+
411
+
412
+ /**
413
+ * \brief Controller device event structure (event.cdevice.*)
414
+ */
415
+ typedef struct SDL_ControllerDeviceEvent
416
+ {
417
+ Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
418
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
419
+ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
420
+ } SDL_ControllerDeviceEvent;
421
+
422
+ /**
423
+ * \brief Game controller touchpad event structure (event.ctouchpad.*)
424
+ */
425
+ typedef struct SDL_ControllerTouchpadEvent
426
+ {
427
+ Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
428
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
429
+ SDL_JoystickID which; /**< The joystick instance id */
430
+ Sint32 touchpad; /**< The index of the touchpad */
431
+ Sint32 finger; /**< The index of the finger on the touchpad */
432
+ float x; /**< Normalized in the range 0...1 with 0 being on the left */
433
+ float y; /**< Normalized in the range 0...1 with 0 being at the top */
434
+ float pressure; /**< Normalized in the range 0...1 */
435
+ } SDL_ControllerTouchpadEvent;
436
+
437
+ /**
438
+ * \brief Game controller sensor event structure (event.csensor.*)
439
+ */
440
+ typedef struct SDL_ControllerSensorEvent
441
+ {
442
+ Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
443
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
444
+ SDL_JoystickID which; /**< The joystick instance id */
445
+ Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
446
+ float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
447
+ } SDL_ControllerSensorEvent;
448
+
449
+ /**
450
+ * \brief Audio device event structure (event.adevice.*)
451
+ */
452
+ typedef struct SDL_AudioDeviceEvent
453
+ {
454
+ Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
455
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
456
+ Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
457
+ Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
458
+ Uint8 padding1;
459
+ Uint8 padding2;
460
+ Uint8 padding3;
461
+ } SDL_AudioDeviceEvent;
462
+
463
+
464
+ /**
465
+ * \brief Touch finger event structure (event.tfinger.*)
466
+ */
467
+ typedef struct SDL_TouchFingerEvent
468
+ {
469
+ Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
470
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
471
+ SDL_TouchID touchId; /**< The touch device id */
472
+ SDL_FingerID fingerId;
473
+ float x; /**< Normalized in the range 0...1 */
474
+ float y; /**< Normalized in the range 0...1 */
475
+ float dx; /**< Normalized in the range -1...1 */
476
+ float dy; /**< Normalized in the range -1...1 */
477
+ float pressure; /**< Normalized in the range 0...1 */
478
+ Uint32 windowID; /**< The window underneath the finger, if any */
479
+ } SDL_TouchFingerEvent;
480
+
481
+
482
+ /**
483
+ * \brief Multiple Finger Gesture Event (event.mgesture.*)
484
+ */
485
+ typedef struct SDL_MultiGestureEvent
486
+ {
487
+ Uint32 type; /**< ::SDL_MULTIGESTURE */
488
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
489
+ SDL_TouchID touchId; /**< The touch device id */
490
+ float dTheta;
491
+ float dDist;
492
+ float x;
493
+ float y;
494
+ Uint16 numFingers;
495
+ Uint16 padding;
496
+ } SDL_MultiGestureEvent;
497
+
498
+
499
+ /**
500
+ * \brief Dollar Gesture Event (event.dgesture.*)
501
+ */
502
+ typedef struct SDL_DollarGestureEvent
503
+ {
504
+ Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
505
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
506
+ SDL_TouchID touchId; /**< The touch device id */
507
+ SDL_GestureID gestureId;
508
+ Uint32 numFingers;
509
+ float error;
510
+ float x; /**< Normalized center of gesture */
511
+ float y; /**< Normalized center of gesture */
512
+ } SDL_DollarGestureEvent;
513
+
514
+
515
+ /**
516
+ * \brief An event used to request a file open by the system (event.drop.*)
517
+ * This event is enabled by default, you can disable it with SDL_EventState().
518
+ * \note If this event is enabled, you must free the filename in the event.
519
+ */
520
+ typedef struct SDL_DropEvent
521
+ {
522
+ Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
523
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
524
+ char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
525
+ Uint32 windowID; /**< The window that was dropped on, if any */
526
+ } SDL_DropEvent;
527
+
528
+
529
+ /**
530
+ * \brief Sensor event structure (event.sensor.*)
531
+ */
532
+ typedef struct SDL_SensorEvent
533
+ {
534
+ Uint32 type; /**< ::SDL_SENSORUPDATE */
535
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
536
+ Sint32 which; /**< The instance ID of the sensor */
537
+ float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
538
+ } SDL_SensorEvent;
539
+
540
+ /**
541
+ * \brief The "quit requested" event
542
+ */
543
+ typedef struct SDL_QuitEvent
544
+ {
545
+ Uint32 type; /**< ::SDL_QUIT */
546
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
547
+ } SDL_QuitEvent;
548
+
549
+ /**
550
+ * \brief OS Specific event
551
+ */
552
+ typedef struct SDL_OSEvent
553
+ {
554
+ Uint32 type; /**< ::SDL_QUIT */
555
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
556
+ } SDL_OSEvent;
557
+
558
+ /**
559
+ * \brief A user-defined event type (event.user.*)
560
+ */
561
+ typedef struct SDL_UserEvent
562
+ {
563
+ Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
564
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
565
+ Uint32 windowID; /**< The associated window if any */
566
+ Sint32 code; /**< User defined event code */
567
+ void *data1; /**< User defined data pointer */
568
+ void *data2; /**< User defined data pointer */
569
+ } SDL_UserEvent;
570
+
571
+
572
+ struct SDL_SysWMmsg;
573
+ typedef struct SDL_SysWMmsg SDL_SysWMmsg;
574
+
575
+ /**
576
+ * \brief A video driver dependent system event (event.syswm.*)
577
+ * This event is disabled by default, you can enable it with SDL_EventState()
578
+ *
579
+ * \note If you want to use this event, you should include SDL_syswm.h.
580
+ */
581
+ typedef struct SDL_SysWMEvent
582
+ {
583
+ Uint32 type; /**< ::SDL_SYSWMEVENT */
584
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
585
+ SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
586
+ } SDL_SysWMEvent;
587
+
588
+ /**
589
+ * \brief General event structure
590
+ */
591
+ typedef union SDL_Event
592
+ {
593
+ Uint32 type; /**< Event type, shared with all events */
594
+ SDL_CommonEvent common; /**< Common event data */
595
+ SDL_DisplayEvent display; /**< Display event data */
596
+ SDL_WindowEvent window; /**< Window event data */
597
+ SDL_KeyboardEvent key; /**< Keyboard event data */
598
+ SDL_TextEditingEvent edit; /**< Text editing event data */
599
+ SDL_TextInputEvent text; /**< Text input event data */
600
+ SDL_MouseMotionEvent motion; /**< Mouse motion event data */
601
+ SDL_MouseButtonEvent button; /**< Mouse button event data */
602
+ SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
603
+ SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
604
+ SDL_JoyBallEvent jball; /**< Joystick ball event data */
605
+ SDL_JoyHatEvent jhat; /**< Joystick hat event data */
606
+ SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
607
+ SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
608
+ SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
609
+ SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
610
+ SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
611
+ SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */
612
+ SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */
613
+ SDL_AudioDeviceEvent adevice; /**< Audio device event data */
614
+ SDL_SensorEvent sensor; /**< Sensor event data */
615
+ SDL_QuitEvent quit; /**< Quit request event data */
616
+ SDL_UserEvent user; /**< Custom event data */
617
+ SDL_SysWMEvent syswm; /**< System dependent window event data */
618
+ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
619
+ SDL_MultiGestureEvent mgesture; /**< Gesture event data */
620
+ SDL_DollarGestureEvent dgesture; /**< Gesture event data */
621
+ SDL_DropEvent drop; /**< Drag and drop event data */
622
+
623
+ /* This is necessary for ABI compatibility between Visual C++ and GCC
624
+ Visual C++ will respect the push pack pragma and use 52 bytes for
625
+ this structure, and GCC will use the alignment of the largest datatype
626
+ within the union, which is 8 bytes.
627
+
628
+ So... we'll add padding to force the size to be 56 bytes for both.
629
+ */
630
+ Uint8 padding[56];
631
+ } SDL_Event;
632
+
633
+ /* Make sure we haven't broken binary compatibility */
634
+ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
635
+
636
+
637
+ /* Function prototypes */
638
+
639
+ /**
640
+ * Pumps the event loop, gathering events from the input devices.
641
+ *
642
+ * This function updates the event queue and internal input device state.
643
+ *
644
+ * This should only be run in the thread that sets the video mode.
645
+ */
646
+ extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
647
+
648
+ /* @{ */
649
+ typedef enum
650
+ {
651
+ SDL_ADDEVENT,
652
+ SDL_PEEKEVENT,
653
+ SDL_GETEVENT
654
+ } SDL_eventaction;
655
+
656
+ /**
657
+ * Checks the event queue for messages and optionally returns them.
658
+ *
659
+ * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
660
+ * the back of the event queue.
661
+ *
662
+ * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
663
+ * of the event queue, within the specified minimum and maximum type,
664
+ * will be returned and will not be removed from the queue.
665
+ *
666
+ * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
667
+ * of the event queue, within the specified minimum and maximum type,
668
+ * will be returned and will be removed from the queue.
669
+ *
670
+ * \return The number of events actually stored, or -1 if there was an error.
671
+ *
672
+ * This function is thread-safe.
673
+ */
674
+ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
675
+ SDL_eventaction action,
676
+ Uint32 minType, Uint32 maxType);
677
+ /* @} */
678
+
679
+ /**
680
+ * Checks to see if certain event types are in the event queue.
681
+ */
682
+ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
683
+ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
684
+
685
+ /**
686
+ * This function clears events from the event queue
687
+ * This function only affects currently queued events. If you want to make
688
+ * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
689
+ * on the main thread immediately before the flush call.
690
+ */
691
+ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
692
+ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
693
+
694
+ /**
695
+ * \brief Polls for currently pending events.
696
+ *
697
+ * \return 1 if there are any pending events, or 0 if there are none available.
698
+ *
699
+ * \param event If not NULL, the next event is removed from the queue and
700
+ * stored in that area.
701
+ */
702
+ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
703
+
704
+ /**
705
+ * \brief Waits indefinitely for the next available event.
706
+ *
707
+ * \return 1, or 0 if there was an error while waiting for events.
708
+ *
709
+ * \param event If not NULL, the next event is removed from the queue and
710
+ * stored in that area.
711
+ */
712
+ extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
713
+
714
+ /**
715
+ * \brief Waits until the specified timeout (in milliseconds) for the next
716
+ * available event.
717
+ *
718
+ * \return 1, or 0 if there was an error while waiting for events.
719
+ *
720
+ * \param event If not NULL, the next event is removed from the queue and
721
+ * stored in that area.
722
+ * \param timeout The timeout (in milliseconds) to wait for next event.
723
+ */
724
+ extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
725
+ int timeout);
726
+
727
+ /**
728
+ * \brief Add an event to the event queue.
729
+ *
730
+ * \return 1 on success, 0 if the event was filtered, or -1 if the event queue
731
+ * was full or there was some other error.
732
+ */
733
+ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
734
+
735
+ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
736
+
737
+ /**
738
+ * Sets up a filter to process all events before they change internal state and
739
+ * are posted to the internal event queue.
740
+ *
741
+ * The filter is prototyped as:
742
+ * \code
743
+ * int SDL_EventFilter(void *userdata, SDL_Event * event);
744
+ * \endcode
745
+ *
746
+ * If the filter returns 1, then the event will be added to the internal queue.
747
+ * If it returns 0, then the event will be dropped from the queue, but the
748
+ * internal state will still be updated. This allows selective filtering of
749
+ * dynamically arriving events.
750
+ *
751
+ * \warning Be very careful of what you do in the event filter function, as
752
+ * it may run in a different thread!
753
+ *
754
+ * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
755
+ * event filter is only called when the window manager desires to close the
756
+ * application window. If the event filter returns 1, then the window will
757
+ * be closed, otherwise the window will remain open if possible.
758
+ *
759
+ * If the quit event is generated by an interrupt signal, it will bypass the
760
+ * internal queue and be delivered to the application at the next event poll.
761
+ */
762
+ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
763
+ void *userdata);
764
+
765
+ /**
766
+ * Return the current event filter - can be used to "chain" filters.
767
+ * If there is no event filter set, this function returns SDL_FALSE.
768
+ */
769
+ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
770
+ void **userdata);
771
+
772
+ /**
773
+ * Add a function which is called when an event is added to the queue.
774
+ */
775
+ extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
776
+ void *userdata);
777
+
778
+ /**
779
+ * Remove an event watch function added with SDL_AddEventWatch()
780
+ */
781
+ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
782
+ void *userdata);
783
+
784
+ /**
785
+ * Run the filter function on the current event queue, removing any
786
+ * events for which the filter returns 0.
787
+ */
788
+ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
789
+ void *userdata);
790
+
791
+ /* @{ */
792
+ #define SDL_QUERY -1
793
+ #define SDL_IGNORE 0
794
+ #define SDL_DISABLE 0
795
+ #define SDL_ENABLE 1
796
+
797
+ /**
798
+ * This function allows you to set the state of processing certain events.
799
+ * - If \c state is set to ::SDL_IGNORE, that event will be automatically
800
+ * dropped from the event queue and will not be filtered.
801
+ * - If \c state is set to ::SDL_ENABLE, that event will be processed
802
+ * normally.
803
+ * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
804
+ * current processing state of the specified event.
805
+ */
806
+ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
807
+ /* @} */
808
+ #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
809
+
810
+ /**
811
+ * This function allocates a set of user-defined events, and returns
812
+ * the beginning event number for that set of events.
813
+ *
814
+ * If there aren't enough user-defined events left, this function
815
+ * returns (Uint32)-1
816
+ */
817
+ extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
818
+
819
+ /* Ends C function definitions when using C++ */
820
+ #ifdef __cplusplus
821
+ }
822
+ #endif
823
+ #include "close_code.h"
824
+
825
+ #endif /* SDL_events_h_ */
826
+
827
+ /* vi: set ts=4 sw=4 expandtab: */