alphatau 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1362) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +11 -0
  3. data/bin/console +14 -0
  4. data/bin/setup +8 -0
  5. data/ext/alphatau/native/alphatau_native.cpp +141 -0
  6. data/ext/alphatau/native/extconf.rb +18 -0
  7. data/ext/alphatau/native/sdl/Android.mk +110 -0
  8. data/ext/alphatau/native/sdl/BUGS.txt +16 -0
  9. data/ext/alphatau/native/sdl/CMakeLists.txt +1877 -0
  10. data/ext/alphatau/native/sdl/COPYING.txt +20 -0
  11. data/ext/alphatau/native/sdl/CREDITS.txt +53 -0
  12. data/ext/alphatau/native/sdl/INSTALL.txt +40 -0
  13. data/ext/alphatau/native/sdl/Makefile.in +240 -0
  14. data/ext/alphatau/native/sdl/Makefile.minimal +44 -0
  15. data/ext/alphatau/native/sdl/Makefile.pandora +60 -0
  16. data/ext/alphatau/native/sdl/Makefile.psp +95 -0
  17. data/ext/alphatau/native/sdl/Makefile.wiz +80 -0
  18. data/ext/alphatau/native/sdl/README-SDL.txt +13 -0
  19. data/ext/alphatau/native/sdl/README.txt +21 -0
  20. data/ext/alphatau/native/sdl/SDL2.spec.in +118 -0
  21. data/ext/alphatau/native/sdl/SDL2Config.cmake +1 -0
  22. data/ext/alphatau/native/sdl/TODO.txt +10 -0
  23. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.nuspec +23 -0
  24. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.targets +38 -0
  25. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec +22 -0
  26. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets +10 -0
  27. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln +34 -0
  28. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj +575 -0
  29. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +774 -0
  30. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln +28 -0
  31. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +466 -0
  32. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +735 -0
  33. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln +34 -0
  34. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +571 -0
  35. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +771 -0
  36. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png +0 -0
  37. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png +0 -0
  38. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png +0 -0
  39. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png +0 -0
  40. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest +42 -0
  41. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +170 -0
  42. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx +0 -0
  43. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png +0 -0
  44. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png +0 -0
  45. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png +0 -0
  46. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png +0 -0
  47. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest +42 -0
  48. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +160 -0
  49. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx +0 -0
  50. data/ext/alphatau/native/sdl/VisualC.html +146 -0
  51. data/ext/alphatau/native/sdl/VisualC/SDL.sln +291 -0
  52. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj +559 -0
  53. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj.filters +479 -0
  54. data/ext/alphatau/native/sdl/VisualC/SDLmain/SDLmain.vcxproj +162 -0
  55. data/ext/alphatau/native/sdl/VisualC/SDLtest/SDLtest.vcxproj +177 -0
  56. data/ext/alphatau/native/sdl/VisualC/clean.sh +4 -0
  57. data/ext/alphatau/native/sdl/VisualC/tests/checkkeys/checkkeys.vcxproj +218 -0
  58. data/ext/alphatau/native/sdl/VisualC/tests/controllermap/controllermap.vcxproj +259 -0
  59. data/ext/alphatau/native/sdl/VisualC/tests/loopwave/loopwave.vcxproj +229 -0
  60. data/ext/alphatau/native/sdl/VisualC/tests/testatomic/testatomic.vcxproj +203 -0
  61. data/ext/alphatau/native/sdl/VisualC/tests/testautomation/testautomation.vcxproj +230 -0
  62. data/ext/alphatau/native/sdl/VisualC/tests/testdraw2/testdraw2.vcxproj +209 -0
  63. data/ext/alphatau/native/sdl/VisualC/tests/testfile/testfile.vcxproj +203 -0
  64. data/ext/alphatau/native/sdl/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +259 -0
  65. data/ext/alphatau/native/sdl/VisualC/tests/testgesture/testgesture.vcxproj +203 -0
  66. data/ext/alphatau/native/sdl/VisualC/tests/testgl2/testgl2.vcxproj +213 -0
  67. data/ext/alphatau/native/sdl/VisualC/tests/testgles2/testgles2.vcxproj +209 -0
  68. data/ext/alphatau/native/sdl/VisualC/tests/testjoystick/testjoystick.vcxproj +203 -0
  69. data/ext/alphatau/native/sdl/VisualC/tests/testoverlay2/testoverlay2.vcxproj +224 -0
  70. data/ext/alphatau/native/sdl/VisualC/tests/testplatform/testplatform.vcxproj +231 -0
  71. data/ext/alphatau/native/sdl/VisualC/tests/testpower/testpower.vcxproj +203 -0
  72. data/ext/alphatau/native/sdl/VisualC/tests/testrendertarget/testrendertarget.vcxproj +247 -0
  73. data/ext/alphatau/native/sdl/VisualC/tests/testrumble/testrumble.vcxproj +203 -0
  74. data/ext/alphatau/native/sdl/VisualC/tests/testscale/testscale.vcxproj +247 -0
  75. data/ext/alphatau/native/sdl/VisualC/tests/testshape/testshape.vcxproj +203 -0
  76. data/ext/alphatau/native/sdl/VisualC/tests/testsprite2/testsprite2.vcxproj +229 -0
  77. data/ext/alphatau/native/sdl/VisualC/tests/testvulkan/testvulkan.vcxproj +203 -0
  78. data/ext/alphatau/native/sdl/VisualC/tests/testyuv/testyuv.vcxproj +233 -0
  79. data/ext/alphatau/native/sdl/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +216 -0
  80. data/ext/alphatau/native/sdl/VisualC/visualtest/visualtest_VS2012.vcxproj +304 -0
  81. data/ext/alphatau/native/sdl/WhatsNew.txt +401 -0
  82. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Default.png +0 -0
  83. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +1299 -0
  84. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Icon.png +0 -0
  85. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Info.plist +32 -0
  86. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/README +43 -0
  87. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp +0 -0
  88. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt +258 -0
  89. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav +0 -0
  90. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav +0 -0
  91. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav +0 -0
  92. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav +0 -0
  93. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/icon.bmp +0 -0
  94. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/ship.bmp +0 -0
  95. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/space.bmp +0 -0
  96. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/stroke.bmp +0 -0
  97. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/iOS Launch Screen.storyboard +40 -0
  98. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/accelerometer.c +226 -0
  99. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.c +56 -0
  100. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.h +10 -0
  101. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/fireworks.c +474 -0
  102. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/happy.c +180 -0
  103. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/keyboard.c +301 -0
  104. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/mixer.c +344 -0
  105. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/rectangles.c +92 -0
  106. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/touch.c +129 -0
  107. data/ext/alphatau/native/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +2047 -0
  108. data/ext/alphatau/native/sdl/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj +422 -0
  109. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png +0 -0
  110. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png +0 -0
  111. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png +0 -0
  112. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist +28 -0
  113. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns +0 -0
  114. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +10 -0
  115. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +308 -0
  116. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  117. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/main.c +100 -0
  118. data/ext/alphatau/native/sdl/Xcode-iOS/Test/Info.plist +26 -0
  119. data/ext/alphatau/native/sdl/Xcode-iOS/Test/README +11 -0
  120. data/ext/alphatau/native/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +3095 -0
  121. data/ext/alphatau/native/sdl/Xcode/SDL/Info-Framework.plist +28 -0
  122. data/ext/alphatau/native/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +3384 -0
  123. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/SDL.info +15 -0
  124. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/License.txt +19 -0
  125. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt +32 -0
  126. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store +0 -0
  127. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf +0 -0
  128. data/ext/alphatau/native/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +4995 -0
  129. data/ext/alphatau/native/sdl/Xcode/SDLTest/TestDropFile-Info.plist +35 -0
  130. data/ext/alphatau/native/sdl/Xcode/XcodeDocSet/Doxyfile +1558 -0
  131. data/ext/alphatau/native/sdl/acinclude/ac_check_define.m4 +14 -0
  132. data/ext/alphatau/native/sdl/acinclude/alsa.m4 +145 -0
  133. data/ext/alphatau/native/sdl/acinclude/ax_check_compiler_flags.m4 +76 -0
  134. data/ext/alphatau/native/sdl/acinclude/ax_gcc_archflag.m4 +215 -0
  135. data/ext/alphatau/native/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm +79 -0
  136. data/ext/alphatau/native/sdl/acinclude/esd.m4 +168 -0
  137. data/ext/alphatau/native/sdl/acinclude/libtool.m4 +7998 -0
  138. data/ext/alphatau/native/sdl/acinclude/ltoptions.m4 +384 -0
  139. data/ext/alphatau/native/sdl/acinclude/ltsugar.m4 +123 -0
  140. data/ext/alphatau/native/sdl/acinclude/ltversion.m4 +23 -0
  141. data/ext/alphatau/native/sdl/acinclude/lt~obsolete.m4 +98 -0
  142. data/ext/alphatau/native/sdl/android-project-ant/AndroidManifest.xml +1 -0
  143. data/ext/alphatau/native/sdl/android-project-ant/ant.properties +17 -0
  144. data/ext/alphatau/native/sdl/android-project-ant/build.properties +17 -0
  145. data/ext/alphatau/native/sdl/android-project-ant/build.xml +93 -0
  146. data/ext/alphatau/native/sdl/android-project-ant/default.properties +11 -0
  147. data/ext/alphatau/native/sdl/android-project-ant/jni/Android.mk +1 -0
  148. data/ext/alphatau/native/sdl/android-project-ant/jni/Application.mk +10 -0
  149. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android.mk +18 -0
  150. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android_static.mk +12 -0
  151. data/ext/alphatau/native/sdl/android-project-ant/proguard-project.txt +20 -0
  152. data/ext/alphatau/native/sdl/android-project-ant/project.properties +14 -0
  153. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-hdpi/ic_launcher.png +0 -0
  154. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-mdpi/ic_launcher.png +0 -0
  155. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xhdpi/ic_launcher.png +0 -0
  156. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xxhdpi/ic_launcher.png +0 -0
  157. data/ext/alphatau/native/sdl/android-project-ant/res/layout/main.xml +13 -0
  158. data/ext/alphatau/native/sdl/android-project-ant/res/values/strings.xml +4 -0
  159. data/ext/alphatau/native/sdl/android-project-ant/src +1 -0
  160. data/ext/alphatau/native/sdl/android-project/app/build.gradle +69 -0
  161. data/ext/alphatau/native/sdl/android-project/app/jni/Android.mk +1 -0
  162. data/ext/alphatau/native/sdl/android-project/app/jni/Application.mk +9 -0
  163. data/ext/alphatau/native/sdl/android-project/app/jni/src/Android.mk +18 -0
  164. data/ext/alphatau/native/sdl/android-project/app/proguard-rules.pro +17 -0
  165. data/ext/alphatau/native/sdl/android-project/app/src/main/AndroidManifest.xml +77 -0
  166. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDevice.java +19 -0
  167. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +640 -0
  168. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +624 -0
  169. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +298 -0
  170. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDL.java +37 -0
  171. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +2103 -0
  172. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +178 -0
  173. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java +812 -0
  174. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  175. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  176. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  177. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  178. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  179. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/colors.xml +6 -0
  180. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/strings.xml +3 -0
  181. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/styles.xml +8 -0
  182. data/ext/alphatau/native/sdl/android-project/build.gradle +23 -0
  183. data/ext/alphatau/native/sdl/android-project/gradle.properties +17 -0
  184. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.jar +0 -0
  185. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.properties +6 -0
  186. data/ext/alphatau/native/sdl/android-project/gradlew +160 -0
  187. data/ext/alphatau/native/sdl/android-project/gradlew.bat +90 -0
  188. data/ext/alphatau/native/sdl/android-project/settings.gradle +1 -0
  189. data/ext/alphatau/native/sdl/autogen.sh +23 -0
  190. data/ext/alphatau/native/sdl/build-scripts/androidbuild.sh +100 -0
  191. data/ext/alphatau/native/sdl/build-scripts/androidbuildlibs.sh +74 -0
  192. data/ext/alphatau/native/sdl/build-scripts/checker-buildbot.sh +103 -0
  193. data/ext/alphatau/native/sdl/build-scripts/config.guess +1476 -0
  194. data/ext/alphatau/native/sdl/build-scripts/config.sub +1868 -0
  195. data/ext/alphatau/native/sdl/build-scripts/config.sub.patch +72 -0
  196. data/ext/alphatau/native/sdl/build-scripts/emscripten-buildbot.sh +77 -0
  197. data/ext/alphatau/native/sdl/build-scripts/g++-fat.sh +101 -0
  198. data/ext/alphatau/native/sdl/build-scripts/gcc-fat.sh +102 -0
  199. data/ext/alphatau/native/sdl/build-scripts/install-sh +323 -0
  200. data/ext/alphatau/native/sdl/build-scripts/iosbuild.sh +188 -0
  201. data/ext/alphatau/native/sdl/build-scripts/ltmain.sh +9658 -0
  202. data/ext/alphatau/native/sdl/build-scripts/mkinstalldirs +99 -0
  203. data/ext/alphatau/native/sdl/build-scripts/nacl-buildbot.sh +61 -0
  204. data/ext/alphatau/native/sdl/build-scripts/naclbuild.sh +105 -0
  205. data/ext/alphatau/native/sdl/build-scripts/raspberrypi-buildbot.sh +60 -0
  206. data/ext/alphatau/native/sdl/build-scripts/showrev.sh +5 -0
  207. data/ext/alphatau/native/sdl/build-scripts/strip_fPIC.sh +21 -0
  208. data/ext/alphatau/native/sdl/build-scripts/update-copyright.sh +8 -0
  209. data/ext/alphatau/native/sdl/build-scripts/updaterev.sh +20 -0
  210. data/ext/alphatau/native/sdl/build-scripts/windows-buildbot-zipper.bat +40 -0
  211. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.bat +8 -0
  212. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.ps1 +302 -0
  213. data/ext/alphatau/native/sdl/cmake/macros.cmake +73 -0
  214. data/ext/alphatau/native/sdl/cmake/sdlchecks.cmake +1184 -0
  215. data/ext/alphatau/native/sdl/cmake_uninstall.cmake.in +18 -0
  216. data/ext/alphatau/native/sdl/configure +27540 -0
  217. data/ext/alphatau/native/sdl/configure.in +4236 -0
  218. data/ext/alphatau/native/sdl/debian/changelog +114 -0
  219. data/ext/alphatau/native/sdl/debian/compat +1 -0
  220. data/ext/alphatau/native/sdl/debian/control +76 -0
  221. data/ext/alphatau/native/sdl/debian/copyright +351 -0
  222. data/ext/alphatau/native/sdl/debian/docs +4 -0
  223. data/ext/alphatau/native/sdl/debian/libsdl2-dev.install +8 -0
  224. data/ext/alphatau/native/sdl/debian/libsdl2-dev.manpages +1 -0
  225. data/ext/alphatau/native/sdl/debian/libsdl2.install +1 -0
  226. data/ext/alphatau/native/sdl/debian/rules +41 -0
  227. data/ext/alphatau/native/sdl/debian/sdl2-config.1 +86 -0
  228. data/ext/alphatau/native/sdl/debian/source/format +1 -0
  229. data/ext/alphatau/native/sdl/debian/watch +2 -0
  230. data/ext/alphatau/native/sdl/docs/README-android.md +432 -0
  231. data/ext/alphatau/native/sdl/docs/README-cmake.md +32 -0
  232. data/ext/alphatau/native/sdl/docs/README-directfb.md +107 -0
  233. data/ext/alphatau/native/sdl/docs/README-dynapi.md +130 -0
  234. data/ext/alphatau/native/sdl/docs/README-emscripten.md +35 -0
  235. data/ext/alphatau/native/sdl/docs/README-gesture.md +71 -0
  236. data/ext/alphatau/native/sdl/docs/README-hg.md +22 -0
  237. data/ext/alphatau/native/sdl/docs/README-ios.md +284 -0
  238. data/ext/alphatau/native/sdl/docs/README-linux.md +90 -0
  239. data/ext/alphatau/native/sdl/docs/README-macosx.md +240 -0
  240. data/ext/alphatau/native/sdl/docs/README-nacl.md +103 -0
  241. data/ext/alphatau/native/sdl/docs/README-pandora.md +17 -0
  242. data/ext/alphatau/native/sdl/docs/README-platforms.md +8 -0
  243. data/ext/alphatau/native/sdl/docs/README-porting.md +68 -0
  244. data/ext/alphatau/native/sdl/docs/README-psp.md +19 -0
  245. data/ext/alphatau/native/sdl/docs/README-raspberrypi.md +188 -0
  246. data/ext/alphatau/native/sdl/docs/README-touch.md +86 -0
  247. data/ext/alphatau/native/sdl/docs/README-wince.md +10 -0
  248. data/ext/alphatau/native/sdl/docs/README-windows.md +45 -0
  249. data/ext/alphatau/native/sdl/docs/README-winrt.md +544 -0
  250. data/ext/alphatau/native/sdl/docs/README.md +63 -0
  251. data/ext/alphatau/native/sdl/docs/doxyfile +1560 -0
  252. data/ext/alphatau/native/sdl/include/SDL.h +135 -0
  253. data/ext/alphatau/native/sdl/include/SDL_assert.h +291 -0
  254. data/ext/alphatau/native/sdl/include/SDL_atomic.h +277 -0
  255. data/ext/alphatau/native/sdl/include/SDL_audio.h +825 -0
  256. data/ext/alphatau/native/sdl/include/SDL_bits.h +112 -0
  257. data/ext/alphatau/native/sdl/include/SDL_blendmode.h +120 -0
  258. data/ext/alphatau/native/sdl/include/SDL_clipboard.h +71 -0
  259. data/ext/alphatau/native/sdl/include/SDL_config.h +53 -0
  260. data/ext/alphatau/native/sdl/include/SDL_config.h.cmake +471 -0
  261. data/ext/alphatau/native/sdl/include/SDL_config.h.in +417 -0
  262. data/ext/alphatau/native/sdl/include/SDL_config_android.h +177 -0
  263. data/ext/alphatau/native/sdl/include/SDL_config_iphoneos.h +201 -0
  264. data/ext/alphatau/native/sdl/include/SDL_config_macosx.h +240 -0
  265. data/ext/alphatau/native/sdl/include/SDL_config_minimal.h +85 -0
  266. data/ext/alphatau/native/sdl/include/SDL_config_pandora.h +133 -0
  267. data/ext/alphatau/native/sdl/include/SDL_config_psp.h +164 -0
  268. data/ext/alphatau/native/sdl/include/SDL_config_windows.h +254 -0
  269. data/ext/alphatau/native/sdl/include/SDL_config_winrt.h +235 -0
  270. data/ext/alphatau/native/sdl/include/SDL_config_wiz.h +146 -0
  271. data/ext/alphatau/native/sdl/include/SDL_copying.h +20 -0
  272. data/ext/alphatau/native/sdl/include/SDL_cpuinfo.h +188 -0
  273. data/ext/alphatau/native/sdl/include/SDL_egl.h +1673 -0
  274. data/ext/alphatau/native/sdl/include/SDL_endian.h +260 -0
  275. data/ext/alphatau/native/sdl/include/SDL_error.h +76 -0
  276. data/ext/alphatau/native/sdl/include/SDL_events.h +788 -0
  277. data/ext/alphatau/native/sdl/include/SDL_filesystem.h +136 -0
  278. data/ext/alphatau/native/sdl/include/SDL_gamecontroller.h +383 -0
  279. data/ext/alphatau/native/sdl/include/SDL_gesture.h +87 -0
  280. data/ext/alphatau/native/sdl/include/SDL_haptic.h +1227 -0
  281. data/ext/alphatau/native/sdl/include/SDL_hints.h +1106 -0
  282. data/ext/alphatau/native/sdl/include/SDL_joystick.h +395 -0
  283. data/ext/alphatau/native/sdl/include/SDL_keyboard.h +217 -0
  284. data/ext/alphatau/native/sdl/include/SDL_keycode.h +349 -0
  285. data/ext/alphatau/native/sdl/include/SDL_loadso.h +81 -0
  286. data/ext/alphatau/native/sdl/include/SDL_log.h +211 -0
  287. data/ext/alphatau/native/sdl/include/SDL_main.h +168 -0
  288. data/ext/alphatau/native/sdl/include/SDL_messagebox.h +144 -0
  289. data/ext/alphatau/native/sdl/include/SDL_mouse.h +302 -0
  290. data/ext/alphatau/native/sdl/include/SDL_mutex.h +251 -0
  291. data/ext/alphatau/native/sdl/include/SDL_name.h +33 -0
  292. data/ext/alphatau/native/sdl/include/SDL_opengl.h +2183 -0
  293. data/ext/alphatau/native/sdl/include/SDL_opengl_glext.h +11177 -0
  294. data/ext/alphatau/native/sdl/include/SDL_opengles.h +39 -0
  295. data/ext/alphatau/native/sdl/include/SDL_opengles2.h +52 -0
  296. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2.h +621 -0
  297. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2ext.h +2050 -0
  298. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2platform.h +30 -0
  299. data/ext/alphatau/native/sdl/include/SDL_opengles2_khrplatform.h +282 -0
  300. data/ext/alphatau/native/sdl/include/SDL_pixels.h +470 -0
  301. data/ext/alphatau/native/sdl/include/SDL_platform.h +198 -0
  302. data/ext/alphatau/native/sdl/include/SDL_power.h +75 -0
  303. data/ext/alphatau/native/sdl/include/SDL_quit.h +58 -0
  304. data/ext/alphatau/native/sdl/include/SDL_rect.h +148 -0
  305. data/ext/alphatau/native/sdl/include/SDL_render.h +931 -0
  306. data/ext/alphatau/native/sdl/include/SDL_revision.h +2 -0
  307. data/ext/alphatau/native/sdl/include/SDL_rwops.h +254 -0
  308. data/ext/alphatau/native/sdl/include/SDL_scancode.h +413 -0
  309. data/ext/alphatau/native/sdl/include/SDL_sensor.h +251 -0
  310. data/ext/alphatau/native/sdl/include/SDL_shape.h +144 -0
  311. data/ext/alphatau/native/sdl/include/SDL_stdinc.h +607 -0
  312. data/ext/alphatau/native/sdl/include/SDL_surface.h +546 -0
  313. data/ext/alphatau/native/sdl/include/SDL_system.h +279 -0
  314. data/ext/alphatau/native/sdl/include/SDL_syswm.h +324 -0
  315. data/ext/alphatau/native/sdl/include/SDL_test.h +69 -0
  316. data/ext/alphatau/native/sdl/include/SDL_test_assert.h +105 -0
  317. data/ext/alphatau/native/sdl/include/SDL_test_common.h +188 -0
  318. data/ext/alphatau/native/sdl/include/SDL_test_compare.h +69 -0
  319. data/ext/alphatau/native/sdl/include/SDL_test_crc32.h +124 -0
  320. data/ext/alphatau/native/sdl/include/SDL_test_font.h +81 -0
  321. data/ext/alphatau/native/sdl/include/SDL_test_fuzzer.h +384 -0
  322. data/ext/alphatau/native/sdl/include/SDL_test_harness.h +134 -0
  323. data/ext/alphatau/native/sdl/include/SDL_test_images.h +78 -0
  324. data/ext/alphatau/native/sdl/include/SDL_test_log.h +67 -0
  325. data/ext/alphatau/native/sdl/include/SDL_test_md5.h +129 -0
  326. data/ext/alphatau/native/sdl/include/SDL_test_memory.h +63 -0
  327. data/ext/alphatau/native/sdl/include/SDL_test_random.h +115 -0
  328. data/ext/alphatau/native/sdl/include/SDL_thread.h +309 -0
  329. data/ext/alphatau/native/sdl/include/SDL_timer.h +115 -0
  330. data/ext/alphatau/native/sdl/include/SDL_touch.h +86 -0
  331. data/ext/alphatau/native/sdl/include/SDL_types.h +29 -0
  332. data/ext/alphatau/native/sdl/include/SDL_version.h +162 -0
  333. data/ext/alphatau/native/sdl/include/SDL_video.h +1276 -0
  334. data/ext/alphatau/native/sdl/include/SDL_vulkan.h +278 -0
  335. data/ext/alphatau/native/sdl/include/begin_code.h +167 -0
  336. data/ext/alphatau/native/sdl/include/close_code.h +37 -0
  337. data/ext/alphatau/native/sdl/sdl2-config.cmake.in +11 -0
  338. data/ext/alphatau/native/sdl/sdl2-config.in +60 -0
  339. data/ext/alphatau/native/sdl/sdl2.m4 +234 -0
  340. data/ext/alphatau/native/sdl/sdl2.pc.in +15 -0
  341. data/ext/alphatau/native/sdl/src/SDL.c +514 -0
  342. data/ext/alphatau/native/sdl/src/SDL_assert.c +451 -0
  343. data/ext/alphatau/native/sdl/src/SDL_assert_c.h +24 -0
  344. data/ext/alphatau/native/sdl/src/SDL_dataqueue.c +339 -0
  345. data/ext/alphatau/native/sdl/src/SDL_dataqueue.h +55 -0
  346. data/ext/alphatau/native/sdl/src/SDL_error.c +319 -0
  347. data/ext/alphatau/native/sdl/src/SDL_error_c.h +65 -0
  348. data/ext/alphatau/native/sdl/src/SDL_hints.c +236 -0
  349. data/ext/alphatau/native/sdl/src/SDL_internal.h +52 -0
  350. data/ext/alphatau/native/sdl/src/SDL_log.c +450 -0
  351. data/ext/alphatau/native/sdl/src/atomic/SDL_atomic.c +303 -0
  352. data/ext/alphatau/native/sdl/src/atomic/SDL_spinlock.c +176 -0
  353. data/ext/alphatau/native/sdl/src/audio/SDL_audio.c +1647 -0
  354. data/ext/alphatau/native/sdl/src/audio/SDL_audio_c.h +79 -0
  355. data/ext/alphatau/native/sdl/src/audio/SDL_audiocvt.c +1673 -0
  356. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev.c +124 -0
  357. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev_c.h +38 -0
  358. data/ext/alphatau/native/sdl/src/audio/SDL_audiotypecvt.c +1430 -0
  359. data/ext/alphatau/native/sdl/src/audio/SDL_mixer.c +369 -0
  360. data/ext/alphatau/native/sdl/src/audio/SDL_sysaudio.h +211 -0
  361. data/ext/alphatau/native/sdl/src/audio/SDL_wave.c +694 -0
  362. data/ext/alphatau/native/sdl/src/audio/SDL_wave.h +77 -0
  363. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.c +990 -0
  364. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.h +48 -0
  365. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.c +226 -0
  366. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.h +42 -0
  367. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.c +365 -0
  368. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.h +53 -0
  369. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.h +66 -0
  370. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.m +861 -0
  371. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.c +604 -0
  372. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.h +47 -0
  373. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.c +207 -0
  374. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.h +41 -0
  375. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.c +320 -0
  376. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.h +43 -0
  377. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.c +65 -0
  378. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.h +41 -0
  379. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.c +379 -0
  380. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.h +38 -0
  381. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.c +335 -0
  382. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.h +51 -0
  383. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.c +328 -0
  384. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.h +50 -0
  385. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.cc +248 -0
  386. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.h +38 -0
  387. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.c +446 -0
  388. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.h +41 -0
  389. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.c +165 -0
  390. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.h +43 -0
  391. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.c +463 -0
  392. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.h +56 -0
  393. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.c +412 -0
  394. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.h +48 -0
  395. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.c +516 -0
  396. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.h +48 -0
  397. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.c +181 -0
  398. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.h +45 -0
  399. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.c +782 -0
  400. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.h +52 -0
  401. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.c +666 -0
  402. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.h +57 -0
  403. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.c +382 -0
  404. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.h +49 -0
  405. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.c +419 -0
  406. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.h +47 -0
  407. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.c +779 -0
  408. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.h +85 -0
  409. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_win32.c +417 -0
  410. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_winrt.cpp +276 -0
  411. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.c +457 -0
  412. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.h +45 -0
  413. data/ext/alphatau/native/sdl/src/core/android/SDL_android.c +2285 -0
  414. data/ext/alphatau/native/sdl/src/core/android/SDL_android.h +122 -0
  415. data/ext/alphatau/native/sdl/src/core/android/keyinfotable.h +175 -0
  416. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.c +347 -0
  417. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.h +97 -0
  418. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.c +698 -0
  419. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.h +39 -0
  420. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.c +840 -0
  421. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.h +29 -0
  422. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_accents.h +284 -0
  423. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_keymap.h +4763 -0
  424. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.c +373 -0
  425. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.h +40 -0
  426. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.c +584 -0
  427. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.h +58 -0
  428. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.c +152 -0
  429. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.h +40 -0
  430. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.c +553 -0
  431. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.h +121 -0
  432. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.c +87 -0
  433. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.h +34 -0
  434. data/ext/alphatau/native/sdl/src/core/windows/SDL_directx.h +111 -0
  435. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.c +233 -0
  436. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.h +75 -0
  437. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.c +139 -0
  438. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.h +177 -0
  439. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.cpp +66 -0
  440. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.h +31 -0
  441. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.cpp +855 -0
  442. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.h +92 -0
  443. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.cpp +160 -0
  444. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.h +33 -0
  445. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_cpuinfo.c +855 -0
  446. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_simd.h +88 -0
  447. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.c +331 -0
  448. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.h +67 -0
  449. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_overrides.h +698 -0
  450. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_procs.h +740 -0
  451. data/ext/alphatau/native/sdl/src/dynapi/gendynapi.pl +141 -0
  452. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents.c +46 -0
  453. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents_c.h +30 -0
  454. data/ext/alphatau/native/sdl/src/events/SDL_displayevents.c +60 -0
  455. data/ext/alphatau/native/sdl/src/events/SDL_displayevents_c.h +30 -0
  456. data/ext/alphatau/native/sdl/src/events/SDL_dropevents.c +98 -0
  457. data/ext/alphatau/native/sdl/src/events/SDL_dropevents_c.h +32 -0
  458. data/ext/alphatau/native/sdl/src/events/SDL_events.c +976 -0
  459. data/ext/alphatau/native/sdl/src/events/SDL_events_c.h +52 -0
  460. data/ext/alphatau/native/sdl/src/events/SDL_gesture.c +700 -0
  461. data/ext/alphatau/native/sdl/src/events/SDL_gesture_c.h +35 -0
  462. data/ext/alphatau/native/sdl/src/events/SDL_keyboard.c +1033 -0
  463. data/ext/alphatau/native/sdl/src/events/SDL_keyboard_c.h +70 -0
  464. data/ext/alphatau/native/sdl/src/events/SDL_mouse.c +1031 -0
  465. data/ext/alphatau/native/sdl/src/events/SDL_mouse_c.h +141 -0
  466. data/ext/alphatau/native/sdl/src/events/SDL_quit.c +152 -0
  467. data/ext/alphatau/native/sdl/src/events/SDL_sysevents.h +36 -0
  468. data/ext/alphatau/native/sdl/src/events/SDL_touch.c +375 -0
  469. data/ext/alphatau/native/sdl/src/events/SDL_touch_c.h +61 -0
  470. data/ext/alphatau/native/sdl/src/events/SDL_windowevents.c +227 -0
  471. data/ext/alphatau/native/sdl/src/events/SDL_windowevents_c.h +31 -0
  472. data/ext/alphatau/native/sdl/src/events/blank_cursor.h +33 -0
  473. data/ext/alphatau/native/sdl/src/events/default_cursor.h +114 -0
  474. data/ext/alphatau/native/sdl/src/events/scancodes_darwin.h +159 -0
  475. data/ext/alphatau/native/sdl/src/events/scancodes_linux.h +263 -0
  476. data/ext/alphatau/native/sdl/src/events/scancodes_windows.h +55 -0
  477. data/ext/alphatau/native/sdl/src/events/scancodes_xfree86.h +506 -0
  478. data/ext/alphatau/native/sdl/src/file/SDL_rwops.c +867 -0
  479. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.h +30 -0
  480. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +62 -0
  481. data/ext/alphatau/native/sdl/src/filesystem/android/SDL_sysfilesystem.c +62 -0
  482. data/ext/alphatau/native/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m +117 -0
  483. data/ext/alphatau/native/sdl/src/filesystem/dummy/SDL_sysfilesystem.c +47 -0
  484. data/ext/alphatau/native/sdl/src/filesystem/emscripten/SDL_sysfilesystem.c +81 -0
  485. data/ext/alphatau/native/sdl/src/filesystem/haiku/SDL_sysfilesystem.cc +110 -0
  486. data/ext/alphatau/native/sdl/src/filesystem/nacl/SDL_sysfilesystem.c +43 -0
  487. data/ext/alphatau/native/sdl/src/filesystem/unix/SDL_sysfilesystem.c +250 -0
  488. data/ext/alphatau/native/sdl/src/filesystem/windows/SDL_sysfilesystem.c +192 -0
  489. data/ext/alphatau/native/sdl/src/filesystem/winrt/SDL_sysfilesystem.cpp +233 -0
  490. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic.c +850 -0
  491. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic_c.h +25 -0
  492. data/ext/alphatau/native/sdl/src/haptic/SDL_syshaptic.h +208 -0
  493. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic.c +358 -0
  494. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic_c.h +12 -0
  495. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic.c +1417 -0
  496. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic_c.h +26 -0
  497. data/ext/alphatau/native/sdl/src/haptic/dummy/SDL_syshaptic.c +186 -0
  498. data/ext/alphatau/native/sdl/src/haptic/linux/SDL_syshaptic.c +1165 -0
  499. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic.c +1305 -0
  500. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic_c.h +47 -0
  501. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic.c +456 -0
  502. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic_c.h +88 -0
  503. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic.c +487 -0
  504. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic_c.h +47 -0
  505. data/ext/alphatau/native/sdl/src/hidapi/AUTHORS.txt +16 -0
  506. data/ext/alphatau/native/sdl/src/hidapi/HACKING.txt +15 -0
  507. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-bsd.txt +26 -0
  508. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-gpl3.txt +674 -0
  509. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-orig.txt +9 -0
  510. data/ext/alphatau/native/sdl/src/hidapi/LICENSE.txt +13 -0
  511. data/ext/alphatau/native/sdl/src/hidapi/Makefile.am +85 -0
  512. data/ext/alphatau/native/sdl/src/hidapi/README.txt +339 -0
  513. data/ext/alphatau/native/sdl/src/hidapi/android/hid.cpp +1079 -0
  514. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Android.mk +16 -0
  515. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Application.mk +2 -0
  516. data/ext/alphatau/native/sdl/src/hidapi/android/project.properties +14 -0
  517. data/ext/alphatau/native/sdl/src/hidapi/bootstrap +2 -0
  518. data/ext/alphatau/native/sdl/src/hidapi/configure.ac +236 -0
  519. data/ext/alphatau/native/sdl/src/hidapi/doxygen/Doxyfile +1630 -0
  520. data/ext/alphatau/native/sdl/src/hidapi/hidapi/hidapi.h +398 -0
  521. data/ext/alphatau/native/sdl/src/hidapi/hidtest/Makefile.am +20 -0
  522. data/ext/alphatau/native/sdl/src/hidapi/hidtest/hidtest.cpp +194 -0
  523. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile-manual +32 -0
  524. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile.am +9 -0
  525. data/ext/alphatau/native/sdl/src/hidapi/ios/hid.m +909 -0
  526. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile-manual +18 -0
  527. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.am +27 -0
  528. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.freebsd +46 -0
  529. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.linux +49 -0
  530. data/ext/alphatau/native/sdl/src/hidapi/libusb/hid.c +1615 -0
  531. data/ext/alphatau/native/sdl/src/hidapi/libusb/hidusb.cpp +3 -0
  532. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile-manual +49 -0
  533. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile.am +10 -0
  534. data/ext/alphatau/native/sdl/src/hidapi/linux/README.txt +59 -0
  535. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.c +893 -0
  536. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.cpp +333 -0
  537. data/ext/alphatau/native/sdl/src/hidapi/linux/hidraw.cpp +3 -0
  538. data/ext/alphatau/native/sdl/src/hidapi/m4/ax_pthread.m4 +309 -0
  539. data/ext/alphatau/native/sdl/src/hidapi/m4/pkg.m4 +157 -0
  540. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile-manual +32 -0
  541. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile.am +9 -0
  542. data/ext/alphatau/native/sdl/src/hidapi/mac/hid.c +1186 -0
  543. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-hidraw.pc.in +10 -0
  544. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-libusb.pc.in +10 -0
  545. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi.pc.in +10 -0
  546. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile-manual +26 -0
  547. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.am +43 -0
  548. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.freebsd +33 -0
  549. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.linux +32 -0
  550. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mac +46 -0
  551. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mingw +32 -0
  552. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Info.plist +28 -0
  553. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/PkgInfo +1 -0
  554. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/English.lproj/InfoPlist.strings +0 -0
  555. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/Signal11.icns +0 -0
  556. data/ext/alphatau/native/sdl/src/hidapi/testgui/copy_to_bundle.sh +97 -0
  557. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.cpp +134 -0
  558. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.h +17 -0
  559. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support_cocoa.m +94 -0
  560. data/ext/alphatau/native/sdl/src/hidapi/testgui/start.sh +2 -0
  561. data/ext/alphatau/native/sdl/src/hidapi/testgui/test.cpp +532 -0
  562. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.sln +20 -0
  563. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.vcproj +217 -0
  564. data/ext/alphatau/native/sdl/src/hidapi/udev/99-hid.rules +33 -0
  565. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile-manual +14 -0
  566. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.am +16 -0
  567. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.mingw +35 -0
  568. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/hidapi.def +17 -0
  569. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/makefile +49 -0
  570. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/sources +23 -0
  571. data/ext/alphatau/native/sdl/src/hidapi/windows/hid.c +983 -0
  572. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.sln +29 -0
  573. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.vcproj +201 -0
  574. data/ext/alphatau/native/sdl/src/hidapi/windows/hidtest.vcproj +196 -0
  575. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontroller.c +2066 -0
  576. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontrollerdb.h +583 -0
  577. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick.c +1547 -0
  578. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick_c.h +94 -0
  579. data/ext/alphatau/native/sdl/src/joystick/SDL_sysjoystick.h +153 -0
  580. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick.c +703 -0
  581. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick_c.h +59 -0
  582. data/ext/alphatau/native/sdl/src/joystick/bsd/SDL_sysjoystick.c +701 -0
  583. data/ext/alphatau/native/sdl/src/joystick/controller_type.h +457 -0
  584. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick.c +1012 -0
  585. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick_c.h +79 -0
  586. data/ext/alphatau/native/sdl/src/joystick/dummy/SDL_sysjoystick.c +113 -0
  587. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick.c +406 -0
  588. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick_c.h +52 -0
  589. data/ext/alphatau/native/sdl/src/joystick/haiku/SDL_haikujoystick.cc +272 -0
  590. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_ps4.c +545 -0
  591. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_switch.c +905 -0
  592. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xbox360.c +461 -0
  593. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xboxone.c +318 -0
  594. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick.c +1021 -0
  595. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick_c.h +72 -0
  596. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick.m +727 -0
  597. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick_c.h +57 -0
  598. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick.c +1116 -0
  599. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick_c.h +64 -0
  600. data/ext/alphatau/native/sdl/src/joystick/psp/SDL_sysjoystick.c +264 -0
  601. data/ext/alphatau/native/sdl/src/joystick/sort_controllers.py +78 -0
  602. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.c +52 -0
  603. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.h +33 -0
  604. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick.c +1155 -0
  605. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick_c.h +31 -0
  606. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_mmjoystick.c +452 -0
  607. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick.c +558 -0
  608. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick_c.h +95 -0
  609. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick.c +558 -0
  610. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick_c.h +34 -0
  611. data/ext/alphatau/native/sdl/src/libm/e_atan2.c +134 -0
  612. data/ext/alphatau/native/sdl/src/libm/e_exp.c +187 -0
  613. data/ext/alphatau/native/sdl/src/libm/e_fmod.c +144 -0
  614. data/ext/alphatau/native/sdl/src/libm/e_log.c +152 -0
  615. data/ext/alphatau/native/sdl/src/libm/e_log10.c +106 -0
  616. data/ext/alphatau/native/sdl/src/libm/e_pow.c +343 -0
  617. data/ext/alphatau/native/sdl/src/libm/e_rem_pio2.c +161 -0
  618. data/ext/alphatau/native/sdl/src/libm/e_sqrt.c +457 -0
  619. data/ext/alphatau/native/sdl/src/libm/k_cos.c +82 -0
  620. data/ext/alphatau/native/sdl/src/libm/k_rem_pio2.c +317 -0
  621. data/ext/alphatau/native/sdl/src/libm/k_sin.c +65 -0
  622. data/ext/alphatau/native/sdl/src/libm/k_tan.c +118 -0
  623. data/ext/alphatau/native/sdl/src/libm/math_libm.h +41 -0
  624. data/ext/alphatau/native/sdl/src/libm/math_private.h +227 -0
  625. data/ext/alphatau/native/sdl/src/libm/s_atan.c +114 -0
  626. data/ext/alphatau/native/sdl/src/libm/s_copysign.c +29 -0
  627. data/ext/alphatau/native/sdl/src/libm/s_cos.c +73 -0
  628. data/ext/alphatau/native/sdl/src/libm/s_fabs.c +29 -0
  629. data/ext/alphatau/native/sdl/src/libm/s_floor.c +71 -0
  630. data/ext/alphatau/native/sdl/src/libm/s_scalbn.c +69 -0
  631. data/ext/alphatau/native/sdl/src/libm/s_sin.c +73 -0
  632. data/ext/alphatau/native/sdl/src/libm/s_tan.c +67 -0
  633. data/ext/alphatau/native/sdl/src/loadso/dlopen/SDL_sysloadso.c +88 -0
  634. data/ext/alphatau/native/sdl/src/loadso/dummy/SDL_sysloadso.c +54 -0
  635. data/ext/alphatau/native/sdl/src/loadso/windows/SDL_sysloadso.c +80 -0
  636. data/ext/alphatau/native/sdl/src/main/android/SDL_android_main.c +7 -0
  637. data/ext/alphatau/native/sdl/src/main/dummy/SDL_dummy_main.c +28 -0
  638. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BApp.h +399 -0
  639. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.cc +157 -0
  640. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.h +38 -0
  641. data/ext/alphatau/native/sdl/src/main/nacl/SDL_nacl_main.c +93 -0
  642. data/ext/alphatau/native/sdl/src/main/psp/SDL_psp_main.c +70 -0
  643. data/ext/alphatau/native/sdl/src/main/windows/SDL_windows_main.c +207 -0
  644. data/ext/alphatau/native/sdl/src/main/windows/version.rc +38 -0
  645. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur +0 -0
  646. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResources.rc +3 -0
  647. data/ext/alphatau/native/sdl/src/main/winrt/SDL_winrt_main_NonXAML.cpp +54 -0
  648. data/ext/alphatau/native/sdl/src/power/SDL_power.c +116 -0
  649. data/ext/alphatau/native/sdl/src/power/SDL_syspower.h +47 -0
  650. data/ext/alphatau/native/sdl/src/power/android/SDL_syspower.c +64 -0
  651. data/ext/alphatau/native/sdl/src/power/emscripten/SDL_syspower.c +62 -0
  652. data/ext/alphatau/native/sdl/src/power/haiku/SDL_syspower.c +128 -0
  653. data/ext/alphatau/native/sdl/src/power/linux/SDL_syspower.c +642 -0
  654. data/ext/alphatau/native/sdl/src/power/macosx/SDL_syspower.c +192 -0
  655. data/ext/alphatau/native/sdl/src/power/psp/SDL_syspower.c +68 -0
  656. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.h +32 -0
  657. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.m +113 -0
  658. data/ext/alphatau/native/sdl/src/power/windows/SDL_syspower.c +76 -0
  659. data/ext/alphatau/native/sdl/src/power/winrt/SDL_syspower.cpp +44 -0
  660. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.c +136 -0
  661. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.h +72 -0
  662. data/ext/alphatau/native/sdl/src/render/SDL_render.c +2292 -0
  663. data/ext/alphatau/native/sdl/src/render/SDL_sysrender.h +214 -0
  664. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw.c +414 -0
  665. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw_c.h +67 -0
  666. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_render_d3d.c +1813 -0
  667. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.c +274 -0
  668. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.h +34 -0
  669. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_d3d11.c +2559 -0
  670. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.cpp +116 -0
  671. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.h +40 -0
  672. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.c +1957 -0
  673. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.h +43 -0
  674. data/ext/alphatau/native/sdl/src/render/metal/SDL_render_metal.m +1428 -0
  675. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal.metal +109 -0
  676. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_ios.h +1899 -0
  677. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_osx.h +1903 -0
  678. data/ext/alphatau/native/sdl/src/render/metal/build-metal-shaders.sh +18 -0
  679. data/ext/alphatau/native/sdl/src/render/opengl/SDL_glfuncs.h +478 -0
  680. data/ext/alphatau/native/sdl/src/render/opengl/SDL_render_gl.c +1678 -0
  681. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.c +524 -0
  682. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.h +47 -0
  683. data/ext/alphatau/native/sdl/src/render/opengles/SDL_glesfuncs.h +65 -0
  684. data/ext/alphatau/native/sdl/src/render/opengles/SDL_render_gles.c +1278 -0
  685. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_gles2funcs.h +80 -0
  686. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_render_gles2.c +2256 -0
  687. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.c +569 -0
  688. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.h +70 -0
  689. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/Makefile +41 -0
  690. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_c.sno +181 -0
  691. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_h.sno +116 -0
  692. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2funcs_h.sno +82 -0
  693. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gles2funcs_into_gles2_define_overs_h.sno +42 -0
  694. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/gl2.h +686 -0
  695. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/readme.txt +70 -0
  696. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/testgles2.c +725 -0
  697. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/triangle.c +147 -0
  698. data/ext/alphatau/native/sdl/src/render/psp/SDL_render_psp.c +1016 -0
  699. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.c +336 -0
  700. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.h +27 -0
  701. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.c +777 -0
  702. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.h +27 -0
  703. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.c +341 -0
  704. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.h +27 -0
  705. data/ext/alphatau/native/sdl/src/render/software/SDL_draw.h +576 -0
  706. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.c +209 -0
  707. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.h +27 -0
  708. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.c +114 -0
  709. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.h +27 -0
  710. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw.c +882 -0
  711. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw_c.h +24 -0
  712. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.c +530 -0
  713. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.h +28 -0
  714. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor.c +546 -0
  715. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor_c.h +38 -0
  716. data/ext/alphatau/native/sdl/src/sensor/SDL_syssensor.h +99 -0
  717. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.c +211 -0
  718. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.h +31 -0
  719. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.h +30 -0
  720. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.m +234 -0
  721. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.c +110 -0
  722. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.h +23 -0
  723. data/ext/alphatau/native/sdl/src/stdlib/SDL_getenv.c +315 -0
  724. data/ext/alphatau/native/sdl/src/stdlib/SDL_iconv.c +934 -0
  725. data/ext/alphatau/native/sdl/src/stdlib/SDL_malloc.c +5376 -0
  726. data/ext/alphatau/native/sdl/src/stdlib/SDL_qsort.c +534 -0
  727. data/ext/alphatau/native/sdl/src/stdlib/SDL_stdlib.c +1155 -0
  728. data/ext/alphatau/native/sdl/src/stdlib/SDL_string.c +1737 -0
  729. data/ext/alphatau/native/sdl/src/test/SDL_test_assert.c +152 -0
  730. data/ext/alphatau/native/sdl/src/test/SDL_test_common.c +1826 -0
  731. data/ext/alphatau/native/sdl/src/test/SDL_test_compare.c +117 -0
  732. data/ext/alphatau/native/sdl/src/test/SDL_test_crc32.c +166 -0
  733. data/ext/alphatau/native/sdl/src/test/SDL_test_font.c +3250 -0
  734. data/ext/alphatau/native/sdl/src/test/SDL_test_fuzzer.c +534 -0
  735. data/ext/alphatau/native/sdl/src/test/SDL_test_harness.c +683 -0
  736. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlit.c +1559 -0
  737. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlitBlend.c +2845 -0
  738. data/ext/alphatau/native/sdl/src/test/SDL_test_imageFace.c +247 -0
  739. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitives.c +514 -0
  740. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitivesBlend.c +696 -0
  741. data/ext/alphatau/native/sdl/src/test/SDL_test_log.c +118 -0
  742. data/ext/alphatau/native/sdl/src/test/SDL_test_md5.c +338 -0
  743. data/ext/alphatau/native/sdl/src/test/SDL_test_memory.c +274 -0
  744. data/ext/alphatau/native/sdl/src/test/SDL_test_random.c +96 -0
  745. data/ext/alphatau/native/sdl/src/thread/SDL_systhread.h +70 -0
  746. data/ext/alphatau/native/sdl/src/thread/SDL_thread.c +503 -0
  747. data/ext/alphatau/native/sdl/src/thread/SDL_thread_c.h +95 -0
  748. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syscond.c +220 -0
  749. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex.c +165 -0
  750. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex_c.h +22 -0
  751. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syssem.c +217 -0
  752. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread.c +71 -0
  753. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread_c.h +26 -0
  754. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systls.c +38 -0
  755. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syscond.c +224 -0
  756. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex.c +136 -0
  757. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex_c.h +22 -0
  758. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syssem.c +161 -0
  759. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread.c +114 -0
  760. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread_c.h +24 -0
  761. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syscond.c +158 -0
  762. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex.c +195 -0
  763. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex_c.h +32 -0
  764. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syssem.c +209 -0
  765. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread.c +324 -0
  766. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread_c.h +27 -0
  767. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systls.c +70 -0
  768. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_syscond.cpp +164 -0
  769. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex.cpp +111 -0
  770. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex_c.h +30 -0
  771. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread.cpp +168 -0
  772. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread_c.h +26 -0
  773. data/ext/alphatau/native/sdl/src/thread/windows/SDL_sysmutex.c +110 -0
  774. data/ext/alphatau/native/sdl/src/thread/windows/SDL_syssem.c +152 -0
  775. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread.c +260 -0
  776. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread_c.h +32 -0
  777. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systls.c +72 -0
  778. data/ext/alphatau/native/sdl/src/timer/SDL_timer.c +373 -0
  779. data/ext/alphatau/native/sdl/src/timer/SDL_timer_c.h +34 -0
  780. data/ext/alphatau/native/sdl/src/timer/dummy/SDL_systimer.c +75 -0
  781. data/ext/alphatau/native/sdl/src/timer/haiku/SDL_systimer.c +80 -0
  782. data/ext/alphatau/native/sdl/src/timer/psp/SDL_systimer.c +91 -0
  783. data/ext/alphatau/native/sdl/src/timer/unix/SDL_systimer.c +232 -0
  784. data/ext/alphatau/native/sdl/src/timer/windows/SDL_systimer.c +200 -0
  785. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel.c +1581 -0
  786. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel_c.h +31 -0
  787. data/ext/alphatau/native/sdl/src/video/SDL_blit.c +296 -0
  788. data/ext/alphatau/native/sdl/src/video/SDL_blit.h +553 -0
  789. data/ext/alphatau/native/sdl/src/video/SDL_blit_0.c +483 -0
  790. data/ext/alphatau/native/sdl/src/video/SDL_blit_1.c +552 -0
  791. data/ext/alphatau/native/sdl/src/video/SDL_blit_A.c +1388 -0
  792. data/ext/alphatau/native/sdl/src/video/SDL_blit_N.c +2647 -0
  793. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.c +7419 -0
  794. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.h +30 -0
  795. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.c +162 -0
  796. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.h +24 -0
  797. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.c +164 -0
  798. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.h +25 -0
  799. data/ext/alphatau/native/sdl/src/video/SDL_bmp.c +702 -0
  800. data/ext/alphatau/native/sdl/src/video/SDL_clipboard.c +90 -0
  801. data/ext/alphatau/native/sdl/src/video/SDL_egl.c +899 -0
  802. data/ext/alphatau/native/sdl/src/video/SDL_egl_c.h +149 -0
  803. data/ext/alphatau/native/sdl/src/video/SDL_fillrect.c +343 -0
  804. data/ext/alphatau/native/sdl/src/video/SDL_pixels.c +1125 -0
  805. data/ext/alphatau/native/sdl/src/video/SDL_pixels_c.h +40 -0
  806. data/ext/alphatau/native/sdl/src/video/SDL_rect.c +531 -0
  807. data/ext/alphatau/native/sdl/src/video/SDL_rect_c.h +25 -0
  808. data/ext/alphatau/native/sdl/src/video/SDL_shape.c +309 -0
  809. data/ext/alphatau/native/sdl/src/video/SDL_shape_internals.h +69 -0
  810. data/ext/alphatau/native/sdl/src/video/SDL_stretch.c +353 -0
  811. data/ext/alphatau/native/sdl/src/video/SDL_surface.c +1232 -0
  812. data/ext/alphatau/native/sdl/src/video/SDL_sysvideo.h +467 -0
  813. data/ext/alphatau/native/sdl/src/video/SDL_video.c +4160 -0
  814. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_internal.h +91 -0
  815. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_utils.c +172 -0
  816. data/ext/alphatau/native/sdl/src/video/SDL_yuv.c +1834 -0
  817. data/ext/alphatau/native/sdl/src/video/SDL_yuv_c.h +30 -0
  818. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.c +48 -0
  819. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.h +32 -0
  820. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.c +123 -0
  821. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.h +27 -0
  822. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.c +62 -0
  823. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.h +34 -0
  824. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.c +391 -0
  825. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.h +36 -0
  826. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.c +37 -0
  827. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.h +29 -0
  828. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.c +266 -0
  829. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.h +33 -0
  830. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.c +151 -0
  831. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.h +29 -0
  832. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.c +259 -0
  833. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.h +51 -0
  834. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.c +175 -0
  835. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.h +52 -0
  836. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.c +175 -0
  837. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.h +45 -0
  838. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.h +36 -0
  839. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.m +103 -0
  840. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.h +32 -0
  841. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.m +483 -0
  842. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.h +36 -0
  843. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.m +720 -0
  844. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.h +29 -0
  845. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.m +145 -0
  846. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.h +63 -0
  847. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.m +134 -0
  848. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.h +46 -0
  849. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.m +490 -0
  850. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.h +52 -0
  851. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.m +477 -0
  852. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.h +34 -0
  853. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.m +279 -0
  854. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.h +68 -0
  855. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.m +428 -0
  856. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.h +49 -0
  857. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.m +132 -0
  858. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.h +45 -0
  859. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.m +113 -0
  860. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.h +118 -0
  861. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.m +254 -0
  862. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.h +55 -0
  863. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.m +231 -0
  864. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.h +155 -0
  865. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.m +1885 -0
  866. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.c +413 -0
  867. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.h +56 -0
  868. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.c +117 -0
  869. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.h +41 -0
  870. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.c +748 -0
  871. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.h +34 -0
  872. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.c +414 -0
  873. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.h +59 -0
  874. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.c +389 -0
  875. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.h +44 -0
  876. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.c +332 -0
  877. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.h +64 -0
  878. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.c +1335 -0
  879. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.h +25 -0
  880. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.c +131 -0
  881. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.h +38 -0
  882. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.c +418 -0
  883. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.h +170 -0
  884. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.c +565 -0
  885. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.h +82 -0
  886. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents.c +41 -0
  887. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents_c.h +27 -0
  888. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer.c +89 -0
  889. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer_c.h +27 -0
  890. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.c +144 -0
  891. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.h +30 -0
  892. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.c +716 -0
  893. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.h +40 -0
  894. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.c +178 -0
  895. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.h +32 -0
  896. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.c +275 -0
  897. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.h +42 -0
  898. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.c +119 -0
  899. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.h +49 -0
  900. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.c +354 -0
  901. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.h +58 -0
  902. data/ext/alphatau/native/sdl/src/video/haiku/SDL_BWin.h +679 -0
  903. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.cc +95 -0
  904. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.h +33 -0
  905. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.cc +41 -0
  906. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.h +39 -0
  907. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.cc +259 -0
  908. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.h +47 -0
  909. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.cc +190 -0
  910. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.h +44 -0
  911. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.cc +333 -0
  912. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.h +48 -0
  913. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.cc +176 -0
  914. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.h +55 -0
  915. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.cc +178 -0
  916. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.h +44 -0
  917. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.cc +233 -0
  918. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.h +55 -0
  919. data/ext/alphatau/native/sdl/src/video/khronos/EGL/egl.h +303 -0
  920. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglext.h +1241 -0
  921. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglplatform.h +132 -0
  922. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2.h +675 -0
  923. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2ext.h +3505 -0
  924. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2platform.h +38 -0
  925. data/ext/alphatau/native/sdl/src/video/khronos/KHR/khrplatform.h +284 -0
  926. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vk_platform.h +120 -0
  927. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vulkan.h +6458 -0
  928. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.c +171 -0
  929. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.h +53 -0
  930. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.c +42 -0
  931. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.h +31 -0
  932. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.c +501 -0
  933. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.h +45 -0
  934. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.c +189 -0
  935. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.h +48 -0
  936. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmsym.h +99 -0
  937. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.c +664 -0
  938. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.h +124 -0
  939. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.c +170 -0
  940. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.h +53 -0
  941. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.c +321 -0
  942. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.h +37 -0
  943. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.c +134 -0
  944. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.h +47 -0
  945. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.c +292 -0
  946. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.h +37 -0
  947. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.c +78 -0
  948. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.h +53 -0
  949. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirsym.h +143 -0
  950. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.c +423 -0
  951. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.h +49 -0
  952. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.c +176 -0
  953. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.h +52 -0
  954. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.c +374 -0
  955. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.h +93 -0
  956. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents.c +438 -0
  957. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents_c.h +30 -0
  958. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclglue.c +24 -0
  959. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.c +174 -0
  960. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.h +38 -0
  961. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.c +183 -0
  962. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.h +67 -0
  963. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.c +79 -0
  964. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.h +32 -0
  965. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.c +838 -0
  966. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.h +101 -0
  967. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.c +38 -0
  968. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.h +25 -0
  969. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents.c +290 -0
  970. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents_c.h +31 -0
  971. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl.c +210 -0
  972. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl_c.h +54 -0
  973. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse.c +41 -0
  974. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse_c.h +24 -0
  975. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.c +333 -0
  976. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.h +102 -0
  977. data/ext/alphatau/native/sdl/src/video/qnx/gl.c +285 -0
  978. data/ext/alphatau/native/sdl/src/video/qnx/keyboard.c +133 -0
  979. data/ext/alphatau/native/sdl/src/video/qnx/sdl_qnx.h +48 -0
  980. data/ext/alphatau/native/sdl/src/video/qnx/video.c +364 -0
  981. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents.c +45 -0
  982. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents_c.h +31 -0
  983. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.c +386 -0
  984. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.h +43 -0
  985. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.c +71 -0
  986. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.h +49 -0
  987. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.c +442 -0
  988. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.h +104 -0
  989. data/ext/alphatau/native/sdl/src/video/sdlgenblit.pl +535 -0
  990. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.h +47 -0
  991. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.m +516 -0
  992. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.h +35 -0
  993. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.m +111 -0
  994. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.h +30 -0
  995. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.m +73 -0
  996. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.h +31 -0
  997. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.m +208 -0
  998. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.h +58 -0
  999. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.m +131 -0
  1000. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.h +54 -0
  1001. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.m +378 -0
  1002. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.h +40 -0
  1003. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.m +250 -0
  1004. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.h +60 -0
  1005. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.m +384 -0
  1006. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.h +46 -0
  1007. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.m +249 -0
  1008. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.h +41 -0
  1009. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.m +328 -0
  1010. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.h +91 -0
  1011. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.m +532 -0
  1012. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.h +54 -0
  1013. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.m +222 -0
  1014. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.h +56 -0
  1015. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.m +465 -0
  1016. data/ext/alphatau/native/sdl/src/video/uikit/keyinfotable.h +174 -0
  1017. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.c +47 -0
  1018. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.h +48 -0
  1019. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.c +54 -0
  1020. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.h +47 -0
  1021. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.c +409 -0
  1022. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.h +91 -0
  1023. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.c +123 -0
  1024. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.h +32 -0
  1025. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.c +468 -0
  1026. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.h +103 -0
  1027. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.c +178 -0
  1028. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.h +107 -0
  1029. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents.c +1134 -0
  1030. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents_c.h +51 -0
  1031. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.c +396 -0
  1032. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.h +31 -0
  1033. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.c +93 -0
  1034. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.h +49 -0
  1035. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandsym.h +127 -0
  1036. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.c +265 -0
  1037. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.h +352 -0
  1038. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.c +517 -0
  1039. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.h +85 -0
  1040. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.c +176 -0
  1041. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.h +52 -0
  1042. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.c +684 -0
  1043. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.h +88 -0
  1044. data/ext/alphatau/native/sdl/src/video/windows/SDL_msctf.h +242 -0
  1045. data/ext/alphatau/native/sdl/src/video/windows/SDL_vkeys.h +76 -0
  1046. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.c +160 -0
  1047. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.h +36 -0
  1048. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.c +1229 -0
  1049. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.h +36 -0
  1050. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.c +127 -0
  1051. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.h +27 -0
  1052. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.c +1579 -0
  1053. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.h +40 -0
  1054. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.c +905 -0
  1055. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.h +29 -0
  1056. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.c +407 -0
  1057. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.h +47 -0
  1058. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.c +322 -0
  1059. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.h +33 -0
  1060. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.c +895 -0
  1061. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.h +142 -0
  1062. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.c +131 -0
  1063. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.h +49 -0
  1064. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.c +110 -0
  1065. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.h +40 -0
  1066. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowstaskdialog.h +156 -0
  1067. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.c +442 -0
  1068. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.h +199 -0
  1069. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.c +176 -0
  1070. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.h +52 -0
  1071. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.c +992 -0
  1072. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.h +86 -0
  1073. data/ext/alphatau/native/sdl/src/video/windows/wmmsg.h +1052 -0
  1074. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents.cpp +154 -0
  1075. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents_c.h +82 -0
  1076. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar.cpp +196 -0
  1077. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar_cpp.h +35 -0
  1078. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtkeyboard.cpp +430 -0
  1079. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.cpp +112 -0
  1080. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.h +29 -0
  1081. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse.cpp +224 -0
  1082. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse_c.h +40 -0
  1083. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.cpp +203 -0
  1084. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.h +70 -0
  1085. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtpointerinput.cpp +415 -0
  1086. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo.cpp +842 -0
  1087. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo_cpp.h +106 -0
  1088. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.c +199 -0
  1089. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.h +33 -0
  1090. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.c +212 -0
  1091. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.h +111 -0
  1092. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.c +1500 -0
  1093. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.h +31 -0
  1094. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.c +257 -0
  1095. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.h +31 -0
  1096. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.c +543 -0
  1097. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.h +36 -0
  1098. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.c +853 -0
  1099. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.h +28 -0
  1100. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.c +1112 -0
  1101. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.h +85 -0
  1102. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.c +448 -0
  1103. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.h +31 -0
  1104. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.c +946 -0
  1105. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.h +84 -0
  1106. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.c +109 -0
  1107. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.h +56 -0
  1108. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.c +115 -0
  1109. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.h +39 -0
  1110. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11sym.h +337 -0
  1111. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.c +54 -0
  1112. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.h +32 -0
  1113. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.c +497 -0
  1114. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.h +156 -0
  1115. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.c +243 -0
  1116. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.h +48 -0
  1117. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.c +1619 -0
  1118. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.h +111 -0
  1119. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.c +313 -0
  1120. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.h +42 -0
  1121. data/ext/alphatau/native/sdl/src/video/x11/edid-parse.c +754 -0
  1122. data/ext/alphatau/native/sdl/src/video/x11/edid.h +167 -0
  1123. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.c +350 -0
  1124. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.h +32 -0
  1125. data/ext/alphatau/native/sdl/src/video/yuv2rgb/LICENSE +27 -0
  1126. data/ext/alphatau/native/sdl/src/video/yuv2rgb/README.md +63 -0
  1127. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.c +687 -0
  1128. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.h +381 -0
  1129. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_sse_func.h +498 -0
  1130. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_std_func.h +228 -0
  1131. data/ext/alphatau/native/sdl/test/CMakeLists.txt +122 -0
  1132. data/ext/alphatau/native/sdl/test/COPYING +8 -0
  1133. data/ext/alphatau/native/sdl/test/Makefile.in +328 -0
  1134. data/ext/alphatau/native/sdl/test/README +47 -0
  1135. data/ext/alphatau/native/sdl/test/acinclude.m4 +359 -0
  1136. data/ext/alphatau/native/sdl/test/aclocal.m4 +359 -0
  1137. data/ext/alphatau/native/sdl/test/autogen.sh +12 -0
  1138. data/ext/alphatau/native/sdl/test/axis.bmp +0 -0
  1139. data/ext/alphatau/native/sdl/test/button.bmp +0 -0
  1140. data/ext/alphatau/native/sdl/test/checkkeys.c +248 -0
  1141. data/ext/alphatau/native/sdl/test/configure +5124 -0
  1142. data/ext/alphatau/native/sdl/test/configure.in +191 -0
  1143. data/ext/alphatau/native/sdl/test/controllermap.bmp +0 -0
  1144. data/ext/alphatau/native/sdl/test/controllermap.c +781 -0
  1145. data/ext/alphatau/native/sdl/test/emscripten/joystick-pre.js +25 -0
  1146. data/ext/alphatau/native/sdl/test/gcc-fat.sh +110 -0
  1147. data/ext/alphatau/native/sdl/test/icon.bmp +0 -0
  1148. data/ext/alphatau/native/sdl/test/loopwave.c +179 -0
  1149. data/ext/alphatau/native/sdl/test/loopwavequeue.c +149 -0
  1150. data/ext/alphatau/native/sdl/test/moose.dat +0 -0
  1151. data/ext/alphatau/native/sdl/test/nacl/Makefile +63 -0
  1152. data/ext/alphatau/native/sdl/test/nacl/background.js +40 -0
  1153. data/ext/alphatau/native/sdl/test/nacl/common.js +474 -0
  1154. data/ext/alphatau/native/sdl/test/nacl/index.html +21 -0
  1155. data/ext/alphatau/native/sdl/test/nacl/manifest.json +22 -0
  1156. data/ext/alphatau/native/sdl/test/picture.xbm +14 -0
  1157. data/ext/alphatau/native/sdl/test/relative_mode.markdown +58 -0
  1158. data/ext/alphatau/native/sdl/test/sample.bmp +0 -0
  1159. data/ext/alphatau/native/sdl/test/sample.wav +0 -0
  1160. data/ext/alphatau/native/sdl/test/shapes/p01_shape24.bmp +0 -0
  1161. data/ext/alphatau/native/sdl/test/shapes/p01_shape32alpha.bmp +0 -0
  1162. data/ext/alphatau/native/sdl/test/shapes/p01_shape8.bmp +0 -0
  1163. data/ext/alphatau/native/sdl/test/shapes/p02_shape24.bmp +0 -0
  1164. data/ext/alphatau/native/sdl/test/shapes/p02_shape32alpha.bmp +0 -0
  1165. data/ext/alphatau/native/sdl/test/shapes/p02_shape8.bmp +0 -0
  1166. data/ext/alphatau/native/sdl/test/shapes/p03_shape24.bmp +0 -0
  1167. data/ext/alphatau/native/sdl/test/shapes/p03_shape8.bmp +0 -0
  1168. data/ext/alphatau/native/sdl/test/shapes/p04_shape1.bmp +0 -0
  1169. data/ext/alphatau/native/sdl/test/shapes/p04_shape24.bmp +0 -0
  1170. data/ext/alphatau/native/sdl/test/shapes/p04_shape32alpha.bmp +0 -0
  1171. data/ext/alphatau/native/sdl/test/shapes/p04_shape8.bmp +0 -0
  1172. data/ext/alphatau/native/sdl/test/shapes/p05_shape8.bmp +0 -0
  1173. data/ext/alphatau/native/sdl/test/shapes/p06_shape1alpha.bmp +0 -0
  1174. data/ext/alphatau/native/sdl/test/shapes/p06_shape24.bmp +0 -0
  1175. data/ext/alphatau/native/sdl/test/shapes/p06_shape32alpha.bmp +0 -0
  1176. data/ext/alphatau/native/sdl/test/shapes/p06_shape8.bmp +0 -0
  1177. data/ext/alphatau/native/sdl/test/shapes/p07_shape24.bmp +0 -0
  1178. data/ext/alphatau/native/sdl/test/shapes/p07_shape32alpha.bmp +0 -0
  1179. data/ext/alphatau/native/sdl/test/shapes/p07_shape8.bmp +0 -0
  1180. data/ext/alphatau/native/sdl/test/shapes/p08_shape24.bmp +0 -0
  1181. data/ext/alphatau/native/sdl/test/shapes/p08_shape32alpha.bmp +0 -0
  1182. data/ext/alphatau/native/sdl/test/shapes/p08_shape8.bmp +0 -0
  1183. data/ext/alphatau/native/sdl/test/shapes/p09_shape24.bmp +0 -0
  1184. data/ext/alphatau/native/sdl/test/shapes/p09_shape32alpha.bmp +0 -0
  1185. data/ext/alphatau/native/sdl/test/shapes/p09_shape8.bmp +0 -0
  1186. data/ext/alphatau/native/sdl/test/shapes/p10_shape1.bmp +0 -0
  1187. data/ext/alphatau/native/sdl/test/shapes/p10_shape24.bmp +0 -0
  1188. data/ext/alphatau/native/sdl/test/shapes/p10_shape32alpha.bmp +0 -0
  1189. data/ext/alphatau/native/sdl/test/shapes/p10_shape8.bmp +0 -0
  1190. data/ext/alphatau/native/sdl/test/shapes/p11_shape24.bmp +0 -0
  1191. data/ext/alphatau/native/sdl/test/shapes/p11_shape32alpha.bmp +0 -0
  1192. data/ext/alphatau/native/sdl/test/shapes/p11_shape8.bmp +0 -0
  1193. data/ext/alphatau/native/sdl/test/shapes/p12_shape24.bmp +0 -0
  1194. data/ext/alphatau/native/sdl/test/shapes/p12_shape8.bmp +0 -0
  1195. data/ext/alphatau/native/sdl/test/shapes/p13_shape24.bmp +0 -0
  1196. data/ext/alphatau/native/sdl/test/shapes/p13_shape32alpha.bmp +0 -0
  1197. data/ext/alphatau/native/sdl/test/shapes/p13_shape8.bmp +0 -0
  1198. data/ext/alphatau/native/sdl/test/shapes/p14_shape24.bmp +0 -0
  1199. data/ext/alphatau/native/sdl/test/shapes/p14_shape8.bmp +0 -0
  1200. data/ext/alphatau/native/sdl/test/shapes/p15_shape24.bmp +0 -0
  1201. data/ext/alphatau/native/sdl/test/shapes/p15_shape32alpha.bmp +0 -0
  1202. data/ext/alphatau/native/sdl/test/shapes/p15_shape8.bmp +0 -0
  1203. data/ext/alphatau/native/sdl/test/shapes/p16_shape1.bmp +0 -0
  1204. data/ext/alphatau/native/sdl/test/shapes/p16_shape24.bmp +0 -0
  1205. data/ext/alphatau/native/sdl/test/shapes/p16_shape8.bmp +0 -0
  1206. data/ext/alphatau/native/sdl/test/shapes/trollface_24.bmp +0 -0
  1207. data/ext/alphatau/native/sdl/test/shapes/trollface_32alpha.bmp +0 -0
  1208. data/ext/alphatau/native/sdl/test/testatomic.c +727 -0
  1209. data/ext/alphatau/native/sdl/test/testaudiocapture.c +165 -0
  1210. data/ext/alphatau/native/sdl/test/testaudiohotplug.c +203 -0
  1211. data/ext/alphatau/native/sdl/test/testaudioinfo.c +74 -0
  1212. data/ext/alphatau/native/sdl/test/testautomation.c +124 -0
  1213. data/ext/alphatau/native/sdl/test/testautomation_audio.c +1038 -0
  1214. data/ext/alphatau/native/sdl/test/testautomation_clipboard.c +184 -0
  1215. data/ext/alphatau/native/sdl/test/testautomation_events.c +201 -0
  1216. data/ext/alphatau/native/sdl/test/testautomation_hints.c +168 -0
  1217. data/ext/alphatau/native/sdl/test/testautomation_keyboard.c +713 -0
  1218. data/ext/alphatau/native/sdl/test/testautomation_main.c +157 -0
  1219. data/ext/alphatau/native/sdl/test/testautomation_mouse.c +606 -0
  1220. data/ext/alphatau/native/sdl/test/testautomation_pixels.c +529 -0
  1221. data/ext/alphatau/native/sdl/test/testautomation_platform.c +584 -0
  1222. data/ext/alphatau/native/sdl/test/testautomation_rect.c +1696 -0
  1223. data/ext/alphatau/native/sdl/test/testautomation_render.c +1099 -0
  1224. data/ext/alphatau/native/sdl/test/testautomation_rwops.c +748 -0
  1225. data/ext/alphatau/native/sdl/test/testautomation_sdltest.c +1319 -0
  1226. data/ext/alphatau/native/sdl/test/testautomation_stdlib.c +319 -0
  1227. data/ext/alphatau/native/sdl/test/testautomation_suites.h +54 -0
  1228. data/ext/alphatau/native/sdl/test/testautomation_surface.c +647 -0
  1229. data/ext/alphatau/native/sdl/test/testautomation_syswm.c +61 -0
  1230. data/ext/alphatau/native/sdl/test/testautomation_timer.c +201 -0
  1231. data/ext/alphatau/native/sdl/test/testautomation_video.c +1811 -0
  1232. data/ext/alphatau/native/sdl/test/testbounds.c +40 -0
  1233. data/ext/alphatau/native/sdl/test/testcustomcursor.c +259 -0
  1234. data/ext/alphatau/native/sdl/test/testdisplayinfo.c +96 -0
  1235. data/ext/alphatau/native/sdl/test/testdraw2.c +305 -0
  1236. data/ext/alphatau/native/sdl/test/testdrawchessboard.c +147 -0
  1237. data/ext/alphatau/native/sdl/test/testdropfile.c +98 -0
  1238. data/ext/alphatau/native/sdl/test/testerror.c +76 -0
  1239. data/ext/alphatau/native/sdl/test/testfile.c +283 -0
  1240. data/ext/alphatau/native/sdl/test/testfilesystem.c +60 -0
  1241. data/ext/alphatau/native/sdl/test/testgamecontroller.c +375 -0
  1242. data/ext/alphatau/native/sdl/test/testgesture.c +309 -0
  1243. data/ext/alphatau/native/sdl/test/testgl2.c +416 -0
  1244. data/ext/alphatau/native/sdl/test/testgles.c +355 -0
  1245. data/ext/alphatau/native/sdl/test/testgles2.c +732 -0
  1246. data/ext/alphatau/native/sdl/test/testhaptic.c +369 -0
  1247. data/ext/alphatau/native/sdl/test/testhittesting.c +134 -0
  1248. data/ext/alphatau/native/sdl/test/testhotplug.c +162 -0
  1249. data/ext/alphatau/native/sdl/test/testiconv.c +88 -0
  1250. data/ext/alphatau/native/sdl/test/testime.c +801 -0
  1251. data/ext/alphatau/native/sdl/test/testintersections.c +363 -0
  1252. data/ext/alphatau/native/sdl/test/testjoystick.c +387 -0
  1253. data/ext/alphatau/native/sdl/test/testkeys.c +40 -0
  1254. data/ext/alphatau/native/sdl/test/testloadso.c +82 -0
  1255. data/ext/alphatau/native/sdl/test/testlock.c +128 -0
  1256. data/ext/alphatau/native/sdl/test/testmessage.c +193 -0
  1257. data/ext/alphatau/native/sdl/test/testmultiaudio.c +199 -0
  1258. data/ext/alphatau/native/sdl/test/testnative.c +237 -0
  1259. data/ext/alphatau/native/sdl/test/testnative.h +46 -0
  1260. data/ext/alphatau/native/sdl/test/testnativecocoa.m +51 -0
  1261. data/ext/alphatau/native/sdl/test/testnativew32.c +86 -0
  1262. data/ext/alphatau/native/sdl/test/testnativex11.c +53 -0
  1263. data/ext/alphatau/native/sdl/test/testoverlay2.c +408 -0
  1264. data/ext/alphatau/native/sdl/test/testplatform.c +442 -0
  1265. data/ext/alphatau/native/sdl/test/testpower.c +80 -0
  1266. data/ext/alphatau/native/sdl/test/testqsort.c +108 -0
  1267. data/ext/alphatau/native/sdl/test/testrelative.c +126 -0
  1268. data/ext/alphatau/native/sdl/test/testrendercopyex.c +233 -0
  1269. data/ext/alphatau/native/sdl/test/testrendertarget.c +335 -0
  1270. data/ext/alphatau/native/sdl/test/testresample.c +120 -0
  1271. data/ext/alphatau/native/sdl/test/testrumble.c +153 -0
  1272. data/ext/alphatau/native/sdl/test/testscale.c +224 -0
  1273. data/ext/alphatau/native/sdl/test/testsem.c +130 -0
  1274. data/ext/alphatau/native/sdl/test/testsensor.c +117 -0
  1275. data/ext/alphatau/native/sdl/test/testshader.c +500 -0
  1276. data/ext/alphatau/native/sdl/test/testshape.c +200 -0
  1277. data/ext/alphatau/native/sdl/test/testsprite2.c +409 -0
  1278. data/ext/alphatau/native/sdl/test/testspriteminimal.c +194 -0
  1279. data/ext/alphatau/native/sdl/test/teststreaming.c +190 -0
  1280. data/ext/alphatau/native/sdl/test/testthread.c +130 -0
  1281. data/ext/alphatau/native/sdl/test/testtimer.c +122 -0
  1282. data/ext/alphatau/native/sdl/test/testver.c +47 -0
  1283. data/ext/alphatau/native/sdl/test/testviewport.c +217 -0
  1284. data/ext/alphatau/native/sdl/test/testvulkan.c +1201 -0
  1285. data/ext/alphatau/native/sdl/test/testwm2.c +174 -0
  1286. data/ext/alphatau/native/sdl/test/testyuv.bmp +0 -0
  1287. data/ext/alphatau/native/sdl/test/testyuv.c +455 -0
  1288. data/ext/alphatau/native/sdl/test/testyuv_cvt.c +300 -0
  1289. data/ext/alphatau/native/sdl/test/testyuv_cvt.h +16 -0
  1290. data/ext/alphatau/native/sdl/test/torturethread.c +113 -0
  1291. data/ext/alphatau/native/sdl/test/utf8.txt +287 -0
  1292. data/ext/alphatau/native/sdl/visualtest/COPYING.txt +18 -0
  1293. data/ext/alphatau/native/sdl/visualtest/Makefile.in +37 -0
  1294. data/ext/alphatau/native/sdl/visualtest/README.txt +214 -0
  1295. data/ext/alphatau/native/sdl/visualtest/acinclude.m4 +359 -0
  1296. data/ext/alphatau/native/sdl/visualtest/autogen.sh +12 -0
  1297. data/ext/alphatau/native/sdl/visualtest/compile +1 -0
  1298. data/ext/alphatau/native/sdl/visualtest/config.h +23 -0
  1299. data/ext/alphatau/native/sdl/visualtest/config.h.in +22 -0
  1300. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +3 -0
  1301. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +5 -0
  1302. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +5 -0
  1303. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +1 -0
  1304. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +5 -0
  1305. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +24 -0
  1306. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +3 -0
  1307. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +5 -0
  1308. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +5 -0
  1309. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +3 -0
  1310. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +5 -0
  1311. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +5 -0
  1312. data/ext/alphatau/native/sdl/visualtest/configure +5203 -0
  1313. data/ext/alphatau/native/sdl/visualtest/configure.in +166 -0
  1314. data/ext/alphatau/native/sdl/visualtest/depcomp +1 -0
  1315. data/ext/alphatau/native/sdl/visualtest/docs/Doxyfile +1936 -0
  1316. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_action_configparser.h +149 -0
  1317. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_exhaustive_variator.h +64 -0
  1318. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_harness_argparser.h +75 -0
  1319. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_mischelper.h +28 -0
  1320. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_parsehelper.h +46 -0
  1321. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_process.h +112 -0
  1322. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_random_variator.h +61 -0
  1323. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_rwhelper.h +87 -0
  1324. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_screenshot.h +52 -0
  1325. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_sut_configparser.h +105 -0
  1326. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variator_common.h +122 -0
  1327. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variators.h +66 -0
  1328. data/ext/alphatau/native/sdl/visualtest/install-sh +1 -0
  1329. data/ext/alphatau/native/sdl/visualtest/launch_harness.cmd +2 -0
  1330. data/ext/alphatau/native/sdl/visualtest/launch_harness.sh +6 -0
  1331. data/ext/alphatau/native/sdl/visualtest/missing +1 -0
  1332. data/ext/alphatau/native/sdl/visualtest/src/action_configparser.c +396 -0
  1333. data/ext/alphatau/native/sdl/visualtest/src/harness_argparser.c +358 -0
  1334. data/ext/alphatau/native/sdl/visualtest/src/linux/linux_process.c +199 -0
  1335. data/ext/alphatau/native/sdl/visualtest/src/mischelper.c +28 -0
  1336. data/ext/alphatau/native/sdl/visualtest/src/parsehelper.c +231 -0
  1337. data/ext/alphatau/native/sdl/visualtest/src/rwhelper.c +131 -0
  1338. data/ext/alphatau/native/sdl/visualtest/src/screenshot.c +136 -0
  1339. data/ext/alphatau/native/sdl/visualtest/src/sut_configparser.c +232 -0
  1340. data/ext/alphatau/native/sdl/visualtest/src/testharness.c +533 -0
  1341. data/ext/alphatau/native/sdl/visualtest/src/variator_common.c +225 -0
  1342. data/ext/alphatau/native/sdl/visualtest/src/variator_exhaustive.c +132 -0
  1343. data/ext/alphatau/native/sdl/visualtest/src/variator_random.c +111 -0
  1344. data/ext/alphatau/native/sdl/visualtest/src/variators.c +93 -0
  1345. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_process.c +284 -0
  1346. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_screenshot.c +349 -0
  1347. data/ext/alphatau/native/sdl/visualtest/stamp-h1 +1 -0
  1348. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.actions +3 -0
  1349. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.config +6 -0
  1350. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.parameters +29 -0
  1351. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.actions +1 -0
  1352. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.c +101 -0
  1353. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.config +5 -0
  1354. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.parameters +3 -0
  1355. data/ext/alphatau/native/sdl/wayland-protocols/pointer-constraints-unstable-v1.xml +339 -0
  1356. data/ext/alphatau/native/sdl/wayland-protocols/relative-pointer-unstable-v1.xml +136 -0
  1357. data/ext/alphatau/native/sdl/wayland-protocols/wayland.xml +2746 -0
  1358. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell-unstable-v6.xml +1044 -0
  1359. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell.xml +1120 -0
  1360. data/lib/alphatau.rb +12 -0
  1361. data/lib/alphatau/version.rb +3 -0
  1362. metadata +1465 -0
@@ -0,0 +1,298 @@
1
+ package org.libsdl.app;
2
+
3
+ import android.hardware.usb.*;
4
+ import android.os.Build;
5
+ import android.util.Log;
6
+ import java.util.Arrays;
7
+
8
+ class HIDDeviceUSB implements HIDDevice {
9
+
10
+ private static final String TAG = "hidapi";
11
+
12
+ protected HIDDeviceManager mManager;
13
+ protected UsbDevice mDevice;
14
+ protected int mInterface;
15
+ protected int mDeviceId;
16
+ protected UsbDeviceConnection mConnection;
17
+ protected UsbEndpoint mInputEndpoint;
18
+ protected UsbEndpoint mOutputEndpoint;
19
+ protected InputThread mInputThread;
20
+ protected boolean mRunning;
21
+ protected boolean mFrozen;
22
+
23
+ public HIDDeviceUSB(HIDDeviceManager manager, UsbDevice usbDevice, int interface_number) {
24
+ mManager = manager;
25
+ mDevice = usbDevice;
26
+ mInterface = interface_number;
27
+ mDeviceId = manager.getDeviceIDForIdentifier(getIdentifier());
28
+ mRunning = false;
29
+ }
30
+
31
+ public String getIdentifier() {
32
+ return String.format("%s/%x/%x", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId());
33
+ }
34
+
35
+ @Override
36
+ public int getId() {
37
+ return mDeviceId;
38
+ }
39
+
40
+ @Override
41
+ public int getVendorId() {
42
+ return mDevice.getVendorId();
43
+ }
44
+
45
+ @Override
46
+ public int getProductId() {
47
+ return mDevice.getProductId();
48
+ }
49
+
50
+ @Override
51
+ public String getSerialNumber() {
52
+ String result = null;
53
+ if (Build.VERSION.SDK_INT >= 21) {
54
+ result = mDevice.getSerialNumber();
55
+ }
56
+ if (result == null) {
57
+ result = "";
58
+ }
59
+ return result;
60
+ }
61
+
62
+ @Override
63
+ public int getVersion() {
64
+ return 0;
65
+ }
66
+
67
+ @Override
68
+ public String getManufacturerName() {
69
+ String result = null;
70
+ if (Build.VERSION.SDK_INT >= 21) {
71
+ result = mDevice.getManufacturerName();
72
+ }
73
+ if (result == null) {
74
+ result = String.format("%x", getVendorId());
75
+ }
76
+ return result;
77
+ }
78
+
79
+ @Override
80
+ public String getProductName() {
81
+ String result = null;
82
+ if (Build.VERSION.SDK_INT >= 21) {
83
+ result = mDevice.getProductName();
84
+ }
85
+ if (result == null) {
86
+ result = String.format("%x", getProductId());
87
+ }
88
+ return result;
89
+ }
90
+
91
+ public UsbDevice getDevice() {
92
+ return mDevice;
93
+ }
94
+
95
+ public String getDeviceName() {
96
+ return getManufacturerName() + " " + getProductName() + "(0x" + String.format("%x", getVendorId()) + "/0x" + String.format("%x", getProductId()) + ")";
97
+ }
98
+
99
+ @Override
100
+ public boolean open() {
101
+ mConnection = mManager.getUSBManager().openDevice(mDevice);
102
+ if (mConnection == null) {
103
+ Log.w(TAG, "Unable to open USB device " + getDeviceName());
104
+ return false;
105
+ }
106
+
107
+ // Force claim all interfaces
108
+ for (int i = 0; i < mDevice.getInterfaceCount(); i++) {
109
+ UsbInterface iface = mDevice.getInterface(i);
110
+
111
+ if (!mConnection.claimInterface(iface, true)) {
112
+ Log.w(TAG, "Failed to claim interfaces on USB device " + getDeviceName());
113
+ close();
114
+ return false;
115
+ }
116
+ }
117
+
118
+ // Find the endpoints
119
+ UsbInterface iface = mDevice.getInterface(mInterface);
120
+ for (int j = 0; j < iface.getEndpointCount(); j++) {
121
+ UsbEndpoint endpt = iface.getEndpoint(j);
122
+ switch (endpt.getDirection()) {
123
+ case UsbConstants.USB_DIR_IN:
124
+ if (mInputEndpoint == null) {
125
+ mInputEndpoint = endpt;
126
+ }
127
+ break;
128
+ case UsbConstants.USB_DIR_OUT:
129
+ if (mOutputEndpoint == null) {
130
+ mOutputEndpoint = endpt;
131
+ }
132
+ break;
133
+ }
134
+ }
135
+
136
+ // Make sure the required endpoints were present
137
+ if (mInputEndpoint == null || mOutputEndpoint == null) {
138
+ Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());
139
+ close();
140
+ return false;
141
+ }
142
+
143
+ // Start listening for input
144
+ mRunning = true;
145
+ mInputThread = new InputThread();
146
+ mInputThread.start();
147
+
148
+ return true;
149
+ }
150
+
151
+ @Override
152
+ public int sendFeatureReport(byte[] report) {
153
+ int res = -1;
154
+ int offset = 0;
155
+ int length = report.length;
156
+ boolean skipped_report_id = false;
157
+ byte report_number = report[0];
158
+
159
+ if (report_number == 0x0) {
160
+ ++offset;
161
+ --length;
162
+ skipped_report_id = true;
163
+ }
164
+
165
+ res = mConnection.controlTransfer(
166
+ UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_OUT,
167
+ 0x09/*HID set_report*/,
168
+ (3/*HID feature*/ << 8) | report_number,
169
+ 0,
170
+ report, offset, length,
171
+ 1000/*timeout millis*/);
172
+
173
+ if (res < 0) {
174
+ Log.w(TAG, "sendFeatureReport() returned " + res + " on device " + getDeviceName());
175
+ return -1;
176
+ }
177
+
178
+ if (skipped_report_id) {
179
+ ++length;
180
+ }
181
+ return length;
182
+ }
183
+
184
+ @Override
185
+ public int sendOutputReport(byte[] report) {
186
+ int r = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);
187
+ if (r != report.length) {
188
+ Log.w(TAG, "sendOutputReport() returned " + r + " on device " + getDeviceName());
189
+ }
190
+ return r;
191
+ }
192
+
193
+ @Override
194
+ public boolean getFeatureReport(byte[] report) {
195
+ int res = -1;
196
+ int offset = 0;
197
+ int length = report.length;
198
+ boolean skipped_report_id = false;
199
+ byte report_number = report[0];
200
+
201
+ if (report_number == 0x0) {
202
+ /* Offset the return buffer by 1, so that the report ID
203
+ will remain in byte 0. */
204
+ ++offset;
205
+ --length;
206
+ skipped_report_id = true;
207
+ }
208
+
209
+ res = mConnection.controlTransfer(
210
+ UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_IN,
211
+ 0x01/*HID get_report*/,
212
+ (3/*HID feature*/ << 8) | report_number,
213
+ 0,
214
+ report, offset, length,
215
+ 1000/*timeout millis*/);
216
+
217
+ if (res < 0) {
218
+ Log.w(TAG, "getFeatureReport() returned " + res + " on device " + getDeviceName());
219
+ return false;
220
+ }
221
+
222
+ if (skipped_report_id) {
223
+ ++res;
224
+ ++length;
225
+ }
226
+
227
+ byte[] data;
228
+ if (res == length) {
229
+ data = report;
230
+ } else {
231
+ data = Arrays.copyOfRange(report, 0, res);
232
+ }
233
+ mManager.HIDDeviceFeatureReport(mDeviceId, data);
234
+
235
+ return true;
236
+ }
237
+
238
+ @Override
239
+ public void close() {
240
+ mRunning = false;
241
+ if (mInputThread != null) {
242
+ while (mInputThread.isAlive()) {
243
+ mInputThread.interrupt();
244
+ try {
245
+ mInputThread.join();
246
+ } catch (InterruptedException e) {
247
+ // Keep trying until we're done
248
+ }
249
+ }
250
+ mInputThread = null;
251
+ }
252
+ if (mConnection != null) {
253
+ for (int i = 0; i < mDevice.getInterfaceCount(); i++) {
254
+ UsbInterface iface = mDevice.getInterface(i);
255
+ mConnection.releaseInterface(iface);
256
+ }
257
+ mConnection.close();
258
+ mConnection = null;
259
+ }
260
+ }
261
+
262
+ @Override
263
+ public void shutdown() {
264
+ close();
265
+ mManager = null;
266
+ }
267
+
268
+ @Override
269
+ public void setFrozen(boolean frozen) {
270
+ mFrozen = frozen;
271
+ }
272
+
273
+ protected class InputThread extends Thread {
274
+ @Override
275
+ public void run() {
276
+ int packetSize = mInputEndpoint.getMaxPacketSize();
277
+ byte[] packet = new byte[packetSize];
278
+ while (mRunning) {
279
+ int r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
280
+ if (r < 0) {
281
+ // Could be a timeout or an I/O error
282
+ }
283
+ if (r > 0) {
284
+ byte[] data;
285
+ if (r == packetSize) {
286
+ data = packet;
287
+ } else {
288
+ data = Arrays.copyOfRange(packet, 0, r);
289
+ }
290
+
291
+ if (!mFrozen) {
292
+ mManager.HIDDeviceInputReport(mDeviceId, data);
293
+ }
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
@@ -0,0 +1,37 @@
1
+ package org.libsdl.app;
2
+
3
+ import android.content.Context;
4
+
5
+ /**
6
+ SDL library initialization
7
+ */
8
+ public class SDL {
9
+
10
+ // This function should be called first and sets up the native code
11
+ // so it can call into the Java classes
12
+ public static void setupJNI() {
13
+ SDLActivity.nativeSetupJNI();
14
+ SDLAudioManager.nativeSetupJNI();
15
+ SDLControllerManager.nativeSetupJNI();
16
+ }
17
+
18
+ // This function should be called each time the activity is started
19
+ public static void initialize() {
20
+ setContext(null);
21
+
22
+ SDLActivity.initialize();
23
+ SDLAudioManager.initialize();
24
+ SDLControllerManager.initialize();
25
+ }
26
+
27
+ // This function stores the current activity (SDL or not)
28
+ public static void setContext(Context context) {
29
+ mContext = context;
30
+ }
31
+
32
+ public static Context getContext() {
33
+ return mContext;
34
+ }
35
+
36
+ protected static Context mContext;
37
+ }
@@ -0,0 +1,2103 @@
1
+ package org.libsdl.app;
2
+
3
+ import java.io.IOException;
4
+ import java.io.InputStream;
5
+ import java.util.Arrays;
6
+ import java.util.Hashtable;
7
+ import java.lang.reflect.Method;
8
+ import java.lang.Math;
9
+
10
+ import android.app.*;
11
+ import android.content.*;
12
+ import android.content.res.Configuration;
13
+ import android.text.InputType;
14
+ import android.view.*;
15
+ import android.view.inputmethod.BaseInputConnection;
16
+ import android.view.inputmethod.EditorInfo;
17
+ import android.view.inputmethod.InputConnection;
18
+ import android.view.inputmethod.InputMethodManager;
19
+ import android.widget.RelativeLayout;
20
+ import android.widget.Button;
21
+ import android.widget.LinearLayout;
22
+ import android.widget.TextView;
23
+ import android.os.*;
24
+ import android.util.DisplayMetrics;
25
+ import android.util.Log;
26
+ import android.util.SparseArray;
27
+ import android.graphics.*;
28
+ import android.graphics.drawable.Drawable;
29
+ import android.hardware.*;
30
+ import android.content.pm.ActivityInfo;
31
+ import android.content.pm.PackageManager;
32
+ import android.content.pm.ApplicationInfo;
33
+
34
+ /**
35
+ SDL Activity
36
+ */
37
+ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
38
+ private static final String TAG = "SDL";
39
+
40
+ public static boolean mIsResumedCalled, mIsSurfaceReady, mHasFocus;
41
+
42
+ // Cursor types
43
+ private static final int SDL_SYSTEM_CURSOR_NONE = -1;
44
+ private static final int SDL_SYSTEM_CURSOR_ARROW = 0;
45
+ private static final int SDL_SYSTEM_CURSOR_IBEAM = 1;
46
+ private static final int SDL_SYSTEM_CURSOR_WAIT = 2;
47
+ private static final int SDL_SYSTEM_CURSOR_CROSSHAIR = 3;
48
+ private static final int SDL_SYSTEM_CURSOR_WAITARROW = 4;
49
+ private static final int SDL_SYSTEM_CURSOR_SIZENWSE = 5;
50
+ private static final int SDL_SYSTEM_CURSOR_SIZENESW = 6;
51
+ private static final int SDL_SYSTEM_CURSOR_SIZEWE = 7;
52
+ private static final int SDL_SYSTEM_CURSOR_SIZENS = 8;
53
+ private static final int SDL_SYSTEM_CURSOR_SIZEALL = 9;
54
+ private static final int SDL_SYSTEM_CURSOR_NO = 10;
55
+ private static final int SDL_SYSTEM_CURSOR_HAND = 11;
56
+
57
+ protected static final int SDL_ORIENTATION_UNKNOWN = 0;
58
+ protected static final int SDL_ORIENTATION_LANDSCAPE = 1;
59
+ protected static final int SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2;
60
+ protected static final int SDL_ORIENTATION_PORTRAIT = 3;
61
+ protected static final int SDL_ORIENTATION_PORTRAIT_FLIPPED = 4;
62
+
63
+ protected static int mCurrentOrientation;
64
+
65
+ // Handle the state of the native layer
66
+ public enum NativeState {
67
+ INIT, RESUMED, PAUSED
68
+ }
69
+
70
+ public static NativeState mNextNativeState;
71
+ public static NativeState mCurrentNativeState;
72
+
73
+ public static boolean mExitCalledFromJava;
74
+
75
+ /** If shared libraries (e.g. SDL or the native application) could not be loaded. */
76
+ public static boolean mBrokenLibraries;
77
+
78
+ // If we want to separate mouse and touch events.
79
+ // This is only toggled in native code when a hint is set!
80
+ public static boolean mSeparateMouseAndTouch;
81
+
82
+ // Main components
83
+ protected static SDLActivity mSingleton;
84
+ protected static SDLSurface mSurface;
85
+ protected static View mTextEdit;
86
+ protected static boolean mScreenKeyboardShown;
87
+ protected static ViewGroup mLayout;
88
+ protected static SDLClipboardHandler mClipboardHandler;
89
+ protected static Hashtable<Integer, Object> mCursors;
90
+ protected static int mLastCursorID;
91
+ protected static SDLGenericMotionListener_API12 mMotionListener;
92
+ protected static HIDDeviceManager mHIDDeviceManager;
93
+
94
+ // This is what SDL runs in. It invokes SDL_main(), eventually
95
+ protected static Thread mSDLThread;
96
+
97
+ protected static SDLGenericMotionListener_API12 getMotionListener() {
98
+ if (mMotionListener == null) {
99
+ if (Build.VERSION.SDK_INT >= 26) {
100
+ mMotionListener = new SDLGenericMotionListener_API26();
101
+ } else
102
+ if (Build.VERSION.SDK_INT >= 24) {
103
+ mMotionListener = new SDLGenericMotionListener_API24();
104
+ } else {
105
+ mMotionListener = new SDLGenericMotionListener_API12();
106
+ }
107
+ }
108
+
109
+ return mMotionListener;
110
+ }
111
+
112
+ /**
113
+ * This method returns the name of the shared object with the application entry point
114
+ * It can be overridden by derived classes.
115
+ */
116
+ protected String getMainSharedObject() {
117
+ String library;
118
+ String[] libraries = SDLActivity.mSingleton.getLibraries();
119
+ if (libraries.length > 0) {
120
+ library = "lib" + libraries[libraries.length - 1] + ".so";
121
+ } else {
122
+ library = "libmain.so";
123
+ }
124
+ return library;
125
+ }
126
+
127
+ /**
128
+ * This method returns the name of the application entry point
129
+ * It can be overridden by derived classes.
130
+ */
131
+ protected String getMainFunction() {
132
+ return "SDL_main";
133
+ }
134
+
135
+ /**
136
+ * This method is called by SDL before loading the native shared libraries.
137
+ * It can be overridden to provide names of shared libraries to be loaded.
138
+ * The default implementation returns the defaults. It never returns null.
139
+ * An array returned by a new implementation must at least contain "SDL2".
140
+ * Also keep in mind that the order the libraries are loaded may matter.
141
+ * @return names of shared libraries to be loaded (e.g. "SDL2", "main").
142
+ */
143
+ protected String[] getLibraries() {
144
+ return new String[] {
145
+ "SDL2",
146
+ // "SDL2_image",
147
+ // "SDL2_mixer",
148
+ // "SDL2_net",
149
+ // "SDL2_ttf",
150
+ "main"
151
+ };
152
+ }
153
+
154
+ // Load the .so
155
+ public void loadLibraries() {
156
+ for (String lib : getLibraries()) {
157
+ System.loadLibrary(lib);
158
+ }
159
+ }
160
+
161
+ /**
162
+ * This method is called by SDL before starting the native application thread.
163
+ * It can be overridden to provide the arguments after the application name.
164
+ * The default implementation returns an empty array. It never returns null.
165
+ * @return arguments for the native application.
166
+ */
167
+ protected String[] getArguments() {
168
+ return new String[0];
169
+ }
170
+
171
+ public static void initialize() {
172
+ // The static nature of the singleton and Android quirkyness force us to initialize everything here
173
+ // Otherwise, when exiting the app and returning to it, these variables *keep* their pre exit values
174
+ mSingleton = null;
175
+ mSurface = null;
176
+ mTextEdit = null;
177
+ mLayout = null;
178
+ mClipboardHandler = null;
179
+ mCursors = new Hashtable<Integer, Object>();
180
+ mLastCursorID = 0;
181
+ mSDLThread = null;
182
+ mExitCalledFromJava = false;
183
+ mBrokenLibraries = false;
184
+ mIsResumedCalled = false;
185
+ mIsSurfaceReady = false;
186
+ mHasFocus = true;
187
+ mNextNativeState = NativeState.INIT;
188
+ mCurrentNativeState = NativeState.INIT;
189
+ }
190
+
191
+ // Setup
192
+ @Override
193
+ protected void onCreate(Bundle savedInstanceState) {
194
+ Log.v(TAG, "Device: " + android.os.Build.DEVICE);
195
+ Log.v(TAG, "Model: " + android.os.Build.MODEL);
196
+ Log.v(TAG, "onCreate()");
197
+ super.onCreate(savedInstanceState);
198
+
199
+ // Load shared libraries
200
+ String errorMsgBrokenLib = "";
201
+ try {
202
+ loadLibraries();
203
+ } catch(UnsatisfiedLinkError e) {
204
+ System.err.println(e.getMessage());
205
+ mBrokenLibraries = true;
206
+ errorMsgBrokenLib = e.getMessage();
207
+ } catch(Exception e) {
208
+ System.err.println(e.getMessage());
209
+ mBrokenLibraries = true;
210
+ errorMsgBrokenLib = e.getMessage();
211
+ }
212
+
213
+ if (mBrokenLibraries)
214
+ {
215
+ mSingleton = this;
216
+ AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
217
+ dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall."
218
+ + System.getProperty("line.separator")
219
+ + System.getProperty("line.separator")
220
+ + "Error: " + errorMsgBrokenLib);
221
+ dlgAlert.setTitle("SDL Error");
222
+ dlgAlert.setPositiveButton("Exit",
223
+ new DialogInterface.OnClickListener() {
224
+ @Override
225
+ public void onClick(DialogInterface dialog,int id) {
226
+ // if this button is clicked, close current activity
227
+ SDLActivity.mSingleton.finish();
228
+ }
229
+ });
230
+ dlgAlert.setCancelable(false);
231
+ dlgAlert.create().show();
232
+
233
+ return;
234
+ }
235
+
236
+ // Set up JNI
237
+ SDL.setupJNI();
238
+
239
+ // Initialize state
240
+ SDL.initialize();
241
+
242
+ // So we can call stuff from static callbacks
243
+ mSingleton = this;
244
+ SDL.setContext(this);
245
+
246
+ if (Build.VERSION.SDK_INT >= 11) {
247
+ mClipboardHandler = new SDLClipboardHandler_API11();
248
+ } else {
249
+ /* Before API 11, no clipboard notification (eg no SDL_CLIPBOARDUPDATE) */
250
+ mClipboardHandler = new SDLClipboardHandler_Old();
251
+ }
252
+
253
+ mHIDDeviceManager = new HIDDeviceManager(this);
254
+
255
+ // Set up the surface
256
+ mSurface = new SDLSurface(getApplication());
257
+
258
+ mLayout = new RelativeLayout(this);
259
+ mLayout.addView(mSurface);
260
+
261
+ // Get our current screen orientation and pass it down.
262
+ mCurrentOrientation = SDLActivity.getCurrentOrientation();
263
+ SDLActivity.onNativeOrientationChanged(mCurrentOrientation);
264
+
265
+ setContentView(mLayout);
266
+
267
+ setWindowStyle(false);
268
+
269
+ getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);
270
+
271
+ // Get filename from "Open with" of another application
272
+ Intent intent = getIntent();
273
+ if (intent != null && intent.getData() != null) {
274
+ String filename = intent.getData().getPath();
275
+ if (filename != null) {
276
+ Log.v(TAG, "Got filename: " + filename);
277
+ SDLActivity.onNativeDropFile(filename);
278
+ }
279
+ }
280
+ }
281
+
282
+ // Events
283
+ @Override
284
+ protected void onPause() {
285
+ Log.v(TAG, "onPause()");
286
+ super.onPause();
287
+ mNextNativeState = NativeState.PAUSED;
288
+ mIsResumedCalled = false;
289
+
290
+ if (SDLActivity.mBrokenLibraries) {
291
+ return;
292
+ }
293
+
294
+ if (mHIDDeviceManager != null) {
295
+ mHIDDeviceManager.setFrozen(true);
296
+ }
297
+
298
+ SDLActivity.handleNativeState();
299
+ }
300
+
301
+ @Override
302
+ protected void onResume() {
303
+ Log.v(TAG, "onResume()");
304
+ super.onResume();
305
+ mNextNativeState = NativeState.RESUMED;
306
+ mIsResumedCalled = true;
307
+
308
+ if (SDLActivity.mBrokenLibraries) {
309
+ return;
310
+ }
311
+
312
+ if (mHIDDeviceManager != null) {
313
+ mHIDDeviceManager.setFrozen(false);
314
+ }
315
+
316
+ SDLActivity.handleNativeState();
317
+ }
318
+
319
+ public static int getCurrentOrientation() {
320
+ final Context context = SDLActivity.getContext();
321
+ final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
322
+
323
+ int result = SDL_ORIENTATION_UNKNOWN;
324
+
325
+ switch (display.getRotation()) {
326
+ case Surface.ROTATION_0:
327
+ result = SDL_ORIENTATION_PORTRAIT;
328
+ break;
329
+
330
+ case Surface.ROTATION_90:
331
+ result = SDL_ORIENTATION_LANDSCAPE;
332
+ break;
333
+
334
+ case Surface.ROTATION_180:
335
+ result = SDL_ORIENTATION_PORTRAIT_FLIPPED;
336
+ break;
337
+
338
+ case Surface.ROTATION_270:
339
+ result = SDL_ORIENTATION_LANDSCAPE_FLIPPED;
340
+ break;
341
+ }
342
+
343
+ return result;
344
+ }
345
+
346
+ @Override
347
+ public void onWindowFocusChanged(boolean hasFocus) {
348
+ super.onWindowFocusChanged(hasFocus);
349
+ Log.v(TAG, "onWindowFocusChanged(): " + hasFocus);
350
+
351
+ if (SDLActivity.mBrokenLibraries) {
352
+ return;
353
+ }
354
+
355
+ SDLActivity.mHasFocus = hasFocus;
356
+ if (hasFocus) {
357
+ mNextNativeState = NativeState.RESUMED;
358
+ SDLActivity.getMotionListener().reclaimRelativeMouseModeIfNeeded();
359
+ } else {
360
+ mNextNativeState = NativeState.PAUSED;
361
+ }
362
+
363
+ SDLActivity.handleNativeState();
364
+ }
365
+
366
+ @Override
367
+ public void onLowMemory() {
368
+ Log.v(TAG, "onLowMemory()");
369
+ super.onLowMemory();
370
+
371
+ if (SDLActivity.mBrokenLibraries) {
372
+ return;
373
+ }
374
+
375
+ SDLActivity.nativeLowMemory();
376
+ }
377
+
378
+ @Override
379
+ protected void onDestroy() {
380
+ Log.v(TAG, "onDestroy()");
381
+
382
+ if (mHIDDeviceManager != null) {
383
+ mHIDDeviceManager.close();
384
+ mHIDDeviceManager = null;
385
+ }
386
+
387
+ if (SDLActivity.mBrokenLibraries) {
388
+ super.onDestroy();
389
+ // Reset everything in case the user re opens the app
390
+ SDLActivity.initialize();
391
+ return;
392
+ }
393
+
394
+ mNextNativeState = NativeState.PAUSED;
395
+ SDLActivity.handleNativeState();
396
+
397
+ // Send a quit message to the application
398
+ SDLActivity.mExitCalledFromJava = true;
399
+ SDLActivity.nativeQuit();
400
+
401
+ // Now wait for the SDL thread to quit
402
+ if (SDLActivity.mSDLThread != null) {
403
+ try {
404
+ SDLActivity.mSDLThread.join();
405
+ } catch(Exception e) {
406
+ Log.v(TAG, "Problem stopping thread: " + e);
407
+ }
408
+ SDLActivity.mSDLThread = null;
409
+
410
+ //Log.v(TAG, "Finished waiting for SDL thread");
411
+ }
412
+
413
+ super.onDestroy();
414
+
415
+ // Reset everything in case the user re opens the app
416
+ SDLActivity.initialize();
417
+ }
418
+
419
+ @Override
420
+ public void onBackPressed() {
421
+ // Check if we want to block the back button in case of mouse right click.
422
+ //
423
+ // If we do, the normal hardware back button will no longer work and people have to use home,
424
+ // but the mouse right click will work.
425
+ //
426
+ String trapBack = SDLActivity.nativeGetHint("SDL_ANDROID_TRAP_BACK_BUTTON");
427
+ if ((trapBack != null) && trapBack.equals("1")) {
428
+ // Exit and let the mouse handler handle this button (if appropriate)
429
+ return;
430
+ }
431
+
432
+ // Default system back button behavior.
433
+ super.onBackPressed();
434
+ }
435
+
436
+ // Called by JNI from SDL.
437
+ public static void manualBackButton() {
438
+ mSingleton.pressBackButton();
439
+ }
440
+
441
+ // Used to get us onto the activity's main thread
442
+ public void pressBackButton() {
443
+ runOnUiThread(new Runnable() {
444
+ @Override
445
+ public void run() {
446
+ SDLActivity.this.superOnBackPressed();
447
+ }
448
+ });
449
+ }
450
+
451
+ // Used to access the system back behavior.
452
+ public void superOnBackPressed() {
453
+ super.onBackPressed();
454
+ }
455
+
456
+ @Override
457
+ public boolean dispatchKeyEvent(KeyEvent event) {
458
+
459
+ if (SDLActivity.mBrokenLibraries) {
460
+ return false;
461
+ }
462
+
463
+ int keyCode = event.getKeyCode();
464
+ // Ignore certain special keys so they're handled by Android
465
+ if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
466
+ keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
467
+ keyCode == KeyEvent.KEYCODE_CAMERA ||
468
+ keyCode == KeyEvent.KEYCODE_ZOOM_IN || /* API 11 */
469
+ keyCode == KeyEvent.KEYCODE_ZOOM_OUT /* API 11 */
470
+ ) {
471
+ return false;
472
+ }
473
+ return super.dispatchKeyEvent(event);
474
+ }
475
+
476
+ /* Transition to next state */
477
+ public static void handleNativeState() {
478
+
479
+ if (mNextNativeState == mCurrentNativeState) {
480
+ // Already in same state, discard.
481
+ return;
482
+ }
483
+
484
+ // Try a transition to init state
485
+ if (mNextNativeState == NativeState.INIT) {
486
+
487
+ mCurrentNativeState = mNextNativeState;
488
+ return;
489
+ }
490
+
491
+ // Try a transition to paused state
492
+ if (mNextNativeState == NativeState.PAUSED) {
493
+ nativePause();
494
+ if (mSurface != null)
495
+ mSurface.handlePause();
496
+ mCurrentNativeState = mNextNativeState;
497
+ return;
498
+ }
499
+
500
+ // Try a transition to resumed state
501
+ if (mNextNativeState == NativeState.RESUMED) {
502
+ if (mIsSurfaceReady && mHasFocus && mIsResumedCalled) {
503
+ if (mSDLThread == null) {
504
+ // This is the entry point to the C app.
505
+ // Start up the C app thread and enable sensor input for the first time
506
+ // FIXME: Why aren't we enabling sensor input at start?
507
+
508
+ mSDLThread = new Thread(new SDLMain(), "SDLThread");
509
+ mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
510
+ mSDLThread.start();
511
+ }
512
+
513
+ nativeResume();
514
+ mSurface.handleResume();
515
+ mCurrentNativeState = mNextNativeState;
516
+ }
517
+ }
518
+ }
519
+
520
+ /* The native thread has finished */
521
+ public static void handleNativeExit() {
522
+ SDLActivity.mSDLThread = null;
523
+ mSingleton.finish();
524
+ }
525
+
526
+
527
+ // Messages from the SDLMain thread
528
+ static final int COMMAND_CHANGE_TITLE = 1;
529
+ static final int COMMAND_CHANGE_WINDOW_STYLE = 2;
530
+ static final int COMMAND_TEXTEDIT_HIDE = 3;
531
+ static final int COMMAND_SET_KEEP_SCREEN_ON = 5;
532
+
533
+ protected static final int COMMAND_USER = 0x8000;
534
+
535
+ protected static boolean mFullscreenModeActive;
536
+
537
+ /**
538
+ * This method is called by SDL if SDL did not handle a message itself.
539
+ * This happens if a received message contains an unsupported command.
540
+ * Method can be overwritten to handle Messages in a different class.
541
+ * @param command the command of the message.
542
+ * @param param the parameter of the message. May be null.
543
+ * @return if the message was handled in overridden method.
544
+ */
545
+ protected boolean onUnhandledMessage(int command, Object param) {
546
+ return false;
547
+ }
548
+
549
+ /**
550
+ * A Handler class for Messages from native SDL applications.
551
+ * It uses current Activities as target (e.g. for the title).
552
+ * static to prevent implicit references to enclosing object.
553
+ */
554
+ protected static class SDLCommandHandler extends Handler {
555
+ @Override
556
+ public void handleMessage(Message msg) {
557
+ Context context = SDL.getContext();
558
+ if (context == null) {
559
+ Log.e(TAG, "error handling message, getContext() returned null");
560
+ return;
561
+ }
562
+ switch (msg.arg1) {
563
+ case COMMAND_CHANGE_TITLE:
564
+ if (context instanceof Activity) {
565
+ ((Activity) context).setTitle((String)msg.obj);
566
+ } else {
567
+ Log.e(TAG, "error handling message, getContext() returned no Activity");
568
+ }
569
+ break;
570
+ case COMMAND_CHANGE_WINDOW_STYLE:
571
+ if (Build.VERSION.SDK_INT < 19) {
572
+ // This version of Android doesn't support the immersive fullscreen mode
573
+ break;
574
+ }
575
+ if (context instanceof Activity) {
576
+ Window window = ((Activity) context).getWindow();
577
+ if (window != null) {
578
+ if ((msg.obj instanceof Integer) && (((Integer) msg.obj).intValue() != 0)) {
579
+ int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
580
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
581
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
582
+ View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
583
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
584
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
585
+ window.getDecorView().setSystemUiVisibility(flags);
586
+ window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
587
+ window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
588
+ SDLActivity.mFullscreenModeActive = true;
589
+ } else {
590
+ int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
591
+ window.getDecorView().setSystemUiVisibility(flags);
592
+ window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
593
+ window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
594
+ SDLActivity.mFullscreenModeActive = false;
595
+ }
596
+ }
597
+ } else {
598
+ Log.e(TAG, "error handling message, getContext() returned no Activity");
599
+ }
600
+ break;
601
+ case COMMAND_TEXTEDIT_HIDE:
602
+ if (mTextEdit != null) {
603
+ // Note: On some devices setting view to GONE creates a flicker in landscape.
604
+ // Setting the View's sizes to 0 is similar to GONE but without the flicker.
605
+ // The sizes will be set to useful values when the keyboard is shown again.
606
+ mTextEdit.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
607
+
608
+ InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
609
+ imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
610
+
611
+ mScreenKeyboardShown = false;
612
+ }
613
+ break;
614
+ case COMMAND_SET_KEEP_SCREEN_ON:
615
+ {
616
+ if (context instanceof Activity) {
617
+ Window window = ((Activity) context).getWindow();
618
+ if (window != null) {
619
+ if ((msg.obj instanceof Integer) && (((Integer) msg.obj).intValue() != 0)) {
620
+ window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
621
+ } else {
622
+ window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
623
+ }
624
+ }
625
+ }
626
+ break;
627
+ }
628
+ default:
629
+ if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
630
+ Log.e(TAG, "error handling message, command is " + msg.arg1);
631
+ }
632
+ }
633
+ }
634
+ }
635
+
636
+ // Handler for the messages
637
+ Handler commandHandler = new SDLCommandHandler();
638
+
639
+ // Send a message from the SDLMain thread
640
+ boolean sendCommand(int command, Object data) {
641
+ Message msg = commandHandler.obtainMessage();
642
+ msg.arg1 = command;
643
+ msg.obj = data;
644
+ return commandHandler.sendMessage(msg);
645
+ }
646
+
647
+ // C functions we call
648
+ public static native int nativeSetupJNI();
649
+ public static native int nativeRunMain(String library, String function, Object arguments);
650
+ public static native void nativeLowMemory();
651
+ public static native void nativeQuit();
652
+ public static native void nativePause();
653
+ public static native void nativeResume();
654
+ public static native void onNativeDropFile(String filename);
655
+ public static native void onNativeResize(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, int format, float rate);
656
+ public static native void onNativeKeyDown(int keycode);
657
+ public static native void onNativeKeyUp(int keycode);
658
+ public static native void onNativeKeyboardFocusLost();
659
+ public static native void onNativeMouse(int button, int action, float x, float y, boolean relative);
660
+ public static native void onNativeTouch(int touchDevId, int pointerFingerId,
661
+ int action, float x,
662
+ float y, float p);
663
+ public static native void onNativeAccel(float x, float y, float z);
664
+ public static native void onNativeClipboardChanged();
665
+ public static native void onNativeSurfaceChanged();
666
+ public static native void onNativeSurfaceDestroyed();
667
+ public static native String nativeGetHint(String name);
668
+ public static native void nativeSetenv(String name, String value);
669
+ public static native void onNativeOrientationChanged(int orientation);
670
+
671
+ /**
672
+ * This method is called by SDL using JNI.
673
+ */
674
+ public static boolean setActivityTitle(String title) {
675
+ // Called from SDLMain() thread and can't directly affect the view
676
+ return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
677
+ }
678
+
679
+ /**
680
+ * This method is called by SDL using JNI.
681
+ */
682
+ public static void setWindowStyle(boolean fullscreen) {
683
+ // Called from SDLMain() thread and can't directly affect the view
684
+ mSingleton.sendCommand(COMMAND_CHANGE_WINDOW_STYLE, fullscreen ? 1 : 0);
685
+ }
686
+
687
+ /**
688
+ * This method is called by SDL using JNI.
689
+ * This is a static method for JNI convenience, it calls a non-static method
690
+ * so that is can be overridden
691
+ */
692
+ public static void setOrientation(int w, int h, boolean resizable, String hint)
693
+ {
694
+ if (mSingleton != null) {
695
+ mSingleton.setOrientationBis(w, h, resizable, hint);
696
+ }
697
+ }
698
+
699
+ /**
700
+ * This can be overridden
701
+ */
702
+ public void setOrientationBis(int w, int h, boolean resizable, String hint)
703
+ {
704
+ int orientation = -1;
705
+
706
+ if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
707
+ orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
708
+ } else if (hint.contains("LandscapeRight")) {
709
+ orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
710
+ } else if (hint.contains("LandscapeLeft")) {
711
+ orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
712
+ } else if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {
713
+ orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
714
+ } else if (hint.contains("Portrait")) {
715
+ orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
716
+ } else if (hint.contains("PortraitUpsideDown")) {
717
+ orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
718
+ }
719
+
720
+ /* no valid hint */
721
+ if (orientation == -1) {
722
+ if (resizable) {
723
+ /* no fixed orientation */
724
+ } else {
725
+ if (w > h) {
726
+ orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
727
+ } else {
728
+ orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
729
+ }
730
+ }
731
+ }
732
+
733
+ Log.v("SDL", "setOrientation() orientation=" + orientation + " width=" + w +" height="+ h +" resizable=" + resizable + " hint=" + hint);
734
+ if (orientation != -1) {
735
+ mSingleton.setRequestedOrientation(orientation);
736
+ }
737
+ }
738
+
739
+ /**
740
+ * This method is called by SDL using JNI.
741
+ */
742
+ public static boolean isScreenKeyboardShown()
743
+ {
744
+ if (mTextEdit == null) {
745
+ return false;
746
+ }
747
+
748
+ if (!mScreenKeyboardShown) {
749
+ return false;
750
+ }
751
+
752
+ InputMethodManager imm = (InputMethodManager) SDL.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
753
+ return imm.isAcceptingText();
754
+
755
+ }
756
+
757
+ /**
758
+ * This method is called by SDL using JNI.
759
+ */
760
+ public static boolean supportsRelativeMouse()
761
+ {
762
+ // ChromeOS doesn't provide relative mouse motion via the Android 7 APIs
763
+ if (isChromebook()) {
764
+ return false;
765
+ }
766
+
767
+ // Samsung DeX mode doesn't support relative mice properly under Android 7 APIs,
768
+ // and simply returns no data under Android 8 APIs.
769
+ if (isDeXMode()) {
770
+ return false;
771
+ }
772
+
773
+ return SDLActivity.getMotionListener().supportsRelativeMouse();
774
+ }
775
+
776
+ /**
777
+ * This method is called by SDL using JNI.
778
+ */
779
+ public static boolean setRelativeMouseEnabled(boolean enabled)
780
+ {
781
+ if (enabled && !supportsRelativeMouse()) {
782
+ return false;
783
+ }
784
+
785
+ return SDLActivity.getMotionListener().setRelativeMouseEnabled(enabled);
786
+ }
787
+
788
+ /**
789
+ * This method is called by SDL using JNI.
790
+ */
791
+ public static boolean sendMessage(int command, int param) {
792
+ if (mSingleton == null) {
793
+ return false;
794
+ }
795
+ return mSingleton.sendCommand(command, Integer.valueOf(param));
796
+ }
797
+
798
+ /**
799
+ * This method is called by SDL using JNI.
800
+ */
801
+ public static Context getContext() {
802
+ return SDL.getContext();
803
+ }
804
+
805
+ /**
806
+ * This method is called by SDL using JNI.
807
+ */
808
+ public static boolean isAndroidTV() {
809
+ UiModeManager uiModeManager = (UiModeManager) getContext().getSystemService(UI_MODE_SERVICE);
810
+ if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
811
+ return true;
812
+ }
813
+ if (Build.MANUFACTURER.equals("MINIX") && Build.MODEL.equals("NEO-U1")) {
814
+ return true;
815
+ }
816
+ return false;
817
+ }
818
+
819
+ /**
820
+ * This method is called by SDL using JNI.
821
+ */
822
+ public static boolean isTablet() {
823
+ DisplayMetrics metrics = new DisplayMetrics();
824
+ Activity sdlActivity = (Activity)getContext();
825
+ sdlActivity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
826
+
827
+ double dWidthInches = metrics.widthPixels / (double)metrics.densityDpi;
828
+ double dHeightInches = metrics.heightPixels / (double)metrics.densityDpi;
829
+
830
+ double dDiagonal = Math.sqrt((dWidthInches * dWidthInches) + (dHeightInches * dHeightInches));
831
+
832
+ // If our diagonal size is seven inches or greater, we consider ourselves a tablet.
833
+ return (dDiagonal > 7.0);
834
+ }
835
+
836
+ /**
837
+ * This method is called by SDL using JNI.
838
+ */
839
+ public static boolean isChromebook() {
840
+ return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
841
+ }
842
+
843
+ /**
844
+ * This method is called by SDL using JNI.
845
+ */
846
+ public static boolean isDeXMode() {
847
+ if (Build.VERSION.SDK_INT < 24) {
848
+ return false;
849
+ }
850
+ try {
851
+ final Configuration config = getContext().getResources().getConfiguration();
852
+ final Class configClass = config.getClass();
853
+ return configClass.getField("SEM_DESKTOP_MODE_ENABLED").getInt(configClass)
854
+ == configClass.getField("semDesktopModeEnabled").getInt(config);
855
+ } catch(Exception ignored) {
856
+ return false;
857
+ }
858
+ }
859
+
860
+ /**
861
+ * This method is called by SDL using JNI.
862
+ */
863
+ public static DisplayMetrics getDisplayDPI() {
864
+ return getContext().getResources().getDisplayMetrics();
865
+ }
866
+
867
+ /**
868
+ * This method is called by SDL using JNI.
869
+ */
870
+ public static boolean getManifestEnvironmentVariables() {
871
+ try {
872
+ ApplicationInfo applicationInfo = getContext().getPackageManager().getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA);
873
+ Bundle bundle = applicationInfo.metaData;
874
+ if (bundle == null) {
875
+ return false;
876
+ }
877
+ String prefix = "SDL_ENV.";
878
+ final int trimLength = prefix.length();
879
+ for (String key : bundle.keySet()) {
880
+ if (key.startsWith(prefix)) {
881
+ String name = key.substring(trimLength);
882
+ String value = bundle.get(key).toString();
883
+ nativeSetenv(name, value);
884
+ }
885
+ }
886
+ /* environment variables set! */
887
+ return true;
888
+ } catch (Exception e) {
889
+ Log.v("SDL", "exception " + e.toString());
890
+ }
891
+ return false;
892
+ }
893
+
894
+ // This method is called by SDLControllerManager's API 26 Generic Motion Handler.
895
+ public static View getContentView()
896
+ {
897
+ return mSingleton.mLayout;
898
+ }
899
+
900
+ static class ShowTextInputTask implements Runnable {
901
+ /*
902
+ * This is used to regulate the pan&scan method to have some offset from
903
+ * the bottom edge of the input region and the top edge of an input
904
+ * method (soft keyboard)
905
+ */
906
+ static final int HEIGHT_PADDING = 15;
907
+
908
+ public int x, y, w, h;
909
+
910
+ public ShowTextInputTask(int x, int y, int w, int h) {
911
+ this.x = x;
912
+ this.y = y;
913
+ this.w = w;
914
+ this.h = h;
915
+ }
916
+
917
+ @Override
918
+ public void run() {
919
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w, h + HEIGHT_PADDING);
920
+ params.leftMargin = x;
921
+ params.topMargin = y;
922
+
923
+ if (mTextEdit == null) {
924
+ mTextEdit = new DummyEdit(SDL.getContext());
925
+
926
+ mLayout.addView(mTextEdit, params);
927
+ } else {
928
+ mTextEdit.setLayoutParams(params);
929
+ }
930
+
931
+ mTextEdit.setVisibility(View.VISIBLE);
932
+ mTextEdit.requestFocus();
933
+
934
+ InputMethodManager imm = (InputMethodManager) SDL.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
935
+ imm.showSoftInput(mTextEdit, 0);
936
+
937
+ mScreenKeyboardShown = true;
938
+ }
939
+ }
940
+
941
+ /**
942
+ * This method is called by SDL using JNI.
943
+ */
944
+ public static boolean showTextInput(int x, int y, int w, int h) {
945
+ // Transfer the task to the main thread as a Runnable
946
+ return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
947
+ }
948
+
949
+ public static boolean isTextInputEvent(KeyEvent event) {
950
+
951
+ // Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT
952
+ if (Build.VERSION.SDK_INT >= 11) {
953
+ if (event.isCtrlPressed()) {
954
+ return false;
955
+ }
956
+ }
957
+
958
+ return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;
959
+ }
960
+
961
+ /**
962
+ * This method is called by SDL using JNI.
963
+ */
964
+ public static Surface getNativeSurface() {
965
+ if (SDLActivity.mSurface == null) {
966
+ return null;
967
+ }
968
+ return SDLActivity.mSurface.getNativeSurface();
969
+ }
970
+
971
+ // Input
972
+
973
+ /**
974
+ * This method is called by SDL using JNI.
975
+ * @return an array which may be empty but is never null.
976
+ */
977
+ public static int[] inputGetInputDeviceIds(int sources) {
978
+ int[] ids = InputDevice.getDeviceIds();
979
+ int[] filtered = new int[ids.length];
980
+ int used = 0;
981
+ for (int i = 0; i < ids.length; ++i) {
982
+ InputDevice device = InputDevice.getDevice(ids[i]);
983
+ if ((device != null) && ((device.getSources() & sources) != 0)) {
984
+ filtered[used++] = device.getId();
985
+ }
986
+ }
987
+ return Arrays.copyOf(filtered, used);
988
+ }
989
+
990
+ // APK expansion files support
991
+
992
+ /** com.android.vending.expansion.zipfile.ZipResourceFile object or null. */
993
+ private static Object expansionFile;
994
+
995
+ /** com.android.vending.expansion.zipfile.ZipResourceFile's getInputStream() or null. */
996
+ private static Method expansionFileMethod;
997
+
998
+ /**
999
+ * This method is called by SDL using JNI.
1000
+ * @return an InputStream on success or null if no expansion file was used.
1001
+ * @throws IOException on errors. Message is set for the SDL error message.
1002
+ */
1003
+ public static InputStream openAPKExpansionInputStream(String fileName) throws IOException {
1004
+ // Get a ZipResourceFile representing a merger of both the main and patch files
1005
+ if (expansionFile == null) {
1006
+ String mainHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION");
1007
+ if (mainHint == null) {
1008
+ return null; // no expansion use if no main version was set
1009
+ }
1010
+ String patchHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION");
1011
+ if (patchHint == null) {
1012
+ return null; // no expansion use if no patch version was set
1013
+ }
1014
+
1015
+ Integer mainVersion;
1016
+ Integer patchVersion;
1017
+ try {
1018
+ mainVersion = Integer.valueOf(mainHint);
1019
+ patchVersion = Integer.valueOf(patchHint);
1020
+ } catch (NumberFormatException ex) {
1021
+ ex.printStackTrace();
1022
+ throw new IOException("No valid file versions set for APK expansion files", ex);
1023
+ }
1024
+
1025
+ try {
1026
+ // To avoid direct dependency on Google APK expansion library that is
1027
+ // not a part of Android SDK we access it using reflection
1028
+ expansionFile = Class.forName("com.android.vending.expansion.zipfile.APKExpansionSupport")
1029
+ .getMethod("getAPKExpansionZipFile", Context.class, int.class, int.class)
1030
+ .invoke(null, SDL.getContext(), mainVersion, patchVersion);
1031
+
1032
+ expansionFileMethod = expansionFile.getClass()
1033
+ .getMethod("getInputStream", String.class);
1034
+ } catch (Exception ex) {
1035
+ ex.printStackTrace();
1036
+ expansionFile = null;
1037
+ expansionFileMethod = null;
1038
+ throw new IOException("Could not access APK expansion support library", ex);
1039
+ }
1040
+ }
1041
+
1042
+ // Get an input stream for a known file inside the expansion file ZIPs
1043
+ InputStream fileStream;
1044
+ try {
1045
+ fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName);
1046
+ } catch (Exception ex) {
1047
+ // calling "getInputStream" failed
1048
+ ex.printStackTrace();
1049
+ throw new IOException("Could not open stream from APK expansion file", ex);
1050
+ }
1051
+
1052
+ if (fileStream == null) {
1053
+ // calling "getInputStream" was successful but null was returned
1054
+ throw new IOException("Could not find path in APK expansion file");
1055
+ }
1056
+
1057
+ return fileStream;
1058
+ }
1059
+
1060
+ // Messagebox
1061
+
1062
+ /** Result of current messagebox. Also used for blocking the calling thread. */
1063
+ protected final int[] messageboxSelection = new int[1];
1064
+
1065
+ /** Id of current dialog. */
1066
+ protected int dialogs = 0;
1067
+
1068
+ /**
1069
+ * This method is called by SDL using JNI.
1070
+ * Shows the messagebox from UI thread and block calling thread.
1071
+ * buttonFlags, buttonIds and buttonTexts must have same length.
1072
+ * @param buttonFlags array containing flags for every button.
1073
+ * @param buttonIds array containing id for every button.
1074
+ * @param buttonTexts array containing text for every button.
1075
+ * @param colors null for default or array of length 5 containing colors.
1076
+ * @return button id or -1.
1077
+ */
1078
+ public int messageboxShowMessageBox(
1079
+ final int flags,
1080
+ final String title,
1081
+ final String message,
1082
+ final int[] buttonFlags,
1083
+ final int[] buttonIds,
1084
+ final String[] buttonTexts,
1085
+ final int[] colors) {
1086
+
1087
+ messageboxSelection[0] = -1;
1088
+
1089
+ // sanity checks
1090
+
1091
+ if ((buttonFlags.length != buttonIds.length) && (buttonIds.length != buttonTexts.length)) {
1092
+ return -1; // implementation broken
1093
+ }
1094
+
1095
+ // collect arguments for Dialog
1096
+
1097
+ final Bundle args = new Bundle();
1098
+ args.putInt("flags", flags);
1099
+ args.putString("title", title);
1100
+ args.putString("message", message);
1101
+ args.putIntArray("buttonFlags", buttonFlags);
1102
+ args.putIntArray("buttonIds", buttonIds);
1103
+ args.putStringArray("buttonTexts", buttonTexts);
1104
+ args.putIntArray("colors", colors);
1105
+
1106
+ // trigger Dialog creation on UI thread
1107
+
1108
+ runOnUiThread(new Runnable() {
1109
+ @Override
1110
+ public void run() {
1111
+ showDialog(dialogs++, args);
1112
+ }
1113
+ });
1114
+
1115
+ // block the calling thread
1116
+
1117
+ synchronized (messageboxSelection) {
1118
+ try {
1119
+ messageboxSelection.wait();
1120
+ } catch (InterruptedException ex) {
1121
+ ex.printStackTrace();
1122
+ return -1;
1123
+ }
1124
+ }
1125
+
1126
+ // return selected value
1127
+
1128
+ return messageboxSelection[0];
1129
+ }
1130
+
1131
+ @Override
1132
+ protected Dialog onCreateDialog(int ignore, Bundle args) {
1133
+
1134
+ // TODO set values from "flags" to messagebox dialog
1135
+
1136
+ // get colors
1137
+
1138
+ int[] colors = args.getIntArray("colors");
1139
+ int backgroundColor;
1140
+ int textColor;
1141
+ int buttonBorderColor;
1142
+ int buttonBackgroundColor;
1143
+ int buttonSelectedColor;
1144
+ if (colors != null) {
1145
+ int i = -1;
1146
+ backgroundColor = colors[++i];
1147
+ textColor = colors[++i];
1148
+ buttonBorderColor = colors[++i];
1149
+ buttonBackgroundColor = colors[++i];
1150
+ buttonSelectedColor = colors[++i];
1151
+ } else {
1152
+ backgroundColor = Color.TRANSPARENT;
1153
+ textColor = Color.TRANSPARENT;
1154
+ buttonBorderColor = Color.TRANSPARENT;
1155
+ buttonBackgroundColor = Color.TRANSPARENT;
1156
+ buttonSelectedColor = Color.TRANSPARENT;
1157
+ }
1158
+
1159
+ // create dialog with title and a listener to wake up calling thread
1160
+
1161
+ final Dialog dialog = new Dialog(this);
1162
+ dialog.setTitle(args.getString("title"));
1163
+ dialog.setCancelable(false);
1164
+ dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
1165
+ @Override
1166
+ public void onDismiss(DialogInterface unused) {
1167
+ synchronized (messageboxSelection) {
1168
+ messageboxSelection.notify();
1169
+ }
1170
+ }
1171
+ });
1172
+
1173
+ // create text
1174
+
1175
+ TextView message = new TextView(this);
1176
+ message.setGravity(Gravity.CENTER);
1177
+ message.setText(args.getString("message"));
1178
+ if (textColor != Color.TRANSPARENT) {
1179
+ message.setTextColor(textColor);
1180
+ }
1181
+
1182
+ // create buttons
1183
+
1184
+ int[] buttonFlags = args.getIntArray("buttonFlags");
1185
+ int[] buttonIds = args.getIntArray("buttonIds");
1186
+ String[] buttonTexts = args.getStringArray("buttonTexts");
1187
+
1188
+ final SparseArray<Button> mapping = new SparseArray<Button>();
1189
+
1190
+ LinearLayout buttons = new LinearLayout(this);
1191
+ buttons.setOrientation(LinearLayout.HORIZONTAL);
1192
+ buttons.setGravity(Gravity.CENTER);
1193
+ for (int i = 0; i < buttonTexts.length; ++i) {
1194
+ Button button = new Button(this);
1195
+ final int id = buttonIds[i];
1196
+ button.setOnClickListener(new View.OnClickListener() {
1197
+ @Override
1198
+ public void onClick(View v) {
1199
+ messageboxSelection[0] = id;
1200
+ dialog.dismiss();
1201
+ }
1202
+ });
1203
+ if (buttonFlags[i] != 0) {
1204
+ // see SDL_messagebox.h
1205
+ if ((buttonFlags[i] & 0x00000001) != 0) {
1206
+ mapping.put(KeyEvent.KEYCODE_ENTER, button);
1207
+ }
1208
+ if ((buttonFlags[i] & 0x00000002) != 0) {
1209
+ mapping.put(KeyEvent.KEYCODE_ESCAPE, button); /* API 11 */
1210
+ }
1211
+ }
1212
+ button.setText(buttonTexts[i]);
1213
+ if (textColor != Color.TRANSPARENT) {
1214
+ button.setTextColor(textColor);
1215
+ }
1216
+ if (buttonBorderColor != Color.TRANSPARENT) {
1217
+ // TODO set color for border of messagebox button
1218
+ }
1219
+ if (buttonBackgroundColor != Color.TRANSPARENT) {
1220
+ Drawable drawable = button.getBackground();
1221
+ if (drawable == null) {
1222
+ // setting the color this way removes the style
1223
+ button.setBackgroundColor(buttonBackgroundColor);
1224
+ } else {
1225
+ // setting the color this way keeps the style (gradient, padding, etc.)
1226
+ drawable.setColorFilter(buttonBackgroundColor, PorterDuff.Mode.MULTIPLY);
1227
+ }
1228
+ }
1229
+ if (buttonSelectedColor != Color.TRANSPARENT) {
1230
+ // TODO set color for selected messagebox button
1231
+ }
1232
+ buttons.addView(button);
1233
+ }
1234
+
1235
+ // create content
1236
+
1237
+ LinearLayout content = new LinearLayout(this);
1238
+ content.setOrientation(LinearLayout.VERTICAL);
1239
+ content.addView(message);
1240
+ content.addView(buttons);
1241
+ if (backgroundColor != Color.TRANSPARENT) {
1242
+ content.setBackgroundColor(backgroundColor);
1243
+ }
1244
+
1245
+ // add content to dialog and return
1246
+
1247
+ dialog.setContentView(content);
1248
+ dialog.setOnKeyListener(new Dialog.OnKeyListener() {
1249
+ @Override
1250
+ public boolean onKey(DialogInterface d, int keyCode, KeyEvent event) {
1251
+ Button button = mapping.get(keyCode);
1252
+ if (button != null) {
1253
+ if (event.getAction() == KeyEvent.ACTION_UP) {
1254
+ button.performClick();
1255
+ }
1256
+ return true; // also for ignored actions
1257
+ }
1258
+ return false;
1259
+ }
1260
+ });
1261
+
1262
+ return dialog;
1263
+ }
1264
+
1265
+ private final Runnable rehideSystemUi = new Runnable() {
1266
+ @Override
1267
+ public void run() {
1268
+ int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
1269
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
1270
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
1271
+ View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
1272
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
1273
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
1274
+
1275
+ SDLActivity.this.getWindow().getDecorView().setSystemUiVisibility(flags);
1276
+ }
1277
+ };
1278
+
1279
+ public void onSystemUiVisibilityChange(int visibility) {
1280
+ if (SDLActivity.mFullscreenModeActive && (visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 || (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
1281
+
1282
+ Handler handler = getWindow().getDecorView().getHandler();
1283
+ if (handler != null) {
1284
+ handler.removeCallbacks(rehideSystemUi); // Prevent a hide loop.
1285
+ handler.postDelayed(rehideSystemUi, 2000);
1286
+ }
1287
+
1288
+ }
1289
+ }
1290
+
1291
+ /**
1292
+ * This method is called by SDL using JNI.
1293
+ */
1294
+ public static boolean clipboardHasText() {
1295
+ return mClipboardHandler.clipboardHasText();
1296
+ }
1297
+
1298
+ /**
1299
+ * This method is called by SDL using JNI.
1300
+ */
1301
+ public static String clipboardGetText() {
1302
+ return mClipboardHandler.clipboardGetText();
1303
+ }
1304
+
1305
+ /**
1306
+ * This method is called by SDL using JNI.
1307
+ */
1308
+ public static void clipboardSetText(String string) {
1309
+ mClipboardHandler.clipboardSetText(string);
1310
+ }
1311
+
1312
+ /**
1313
+ * This method is called by SDL using JNI.
1314
+ */
1315
+ public static int createCustomCursor(int[] colors, int width, int height, int hotSpotX, int hotSpotY) {
1316
+ Bitmap bitmap = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);
1317
+ ++mLastCursorID;
1318
+ // This requires API 24, so use reflection to implement this
1319
+ try {
1320
+ Class PointerIconClass = Class.forName("android.view.PointerIcon");
1321
+ Class[] arg_types = new Class[] { Bitmap.class, float.class, float.class };
1322
+ Method create = PointerIconClass.getMethod("create", arg_types);
1323
+ mCursors.put(mLastCursorID, create.invoke(null, bitmap, hotSpotX, hotSpotY));
1324
+ } catch (Exception e) {
1325
+ return 0;
1326
+ }
1327
+ return mLastCursorID;
1328
+ }
1329
+
1330
+ /**
1331
+ * This method is called by SDL using JNI.
1332
+ */
1333
+ public static boolean setCustomCursor(int cursorID) {
1334
+ // This requires API 24, so use reflection to implement this
1335
+ try {
1336
+ Class PointerIconClass = Class.forName("android.view.PointerIcon");
1337
+ Method setPointerIcon = SDLSurface.class.getMethod("setPointerIcon", PointerIconClass);
1338
+ setPointerIcon.invoke(mSurface, mCursors.get(cursorID));
1339
+ } catch (Exception e) {
1340
+ return false;
1341
+ }
1342
+ return true;
1343
+ }
1344
+
1345
+ /**
1346
+ * This method is called by SDL using JNI.
1347
+ */
1348
+ public static boolean setSystemCursor(int cursorID) {
1349
+ int cursor_type = 0; //PointerIcon.TYPE_NULL;
1350
+ switch (cursorID) {
1351
+ case SDL_SYSTEM_CURSOR_ARROW:
1352
+ cursor_type = 1000; //PointerIcon.TYPE_ARROW;
1353
+ break;
1354
+ case SDL_SYSTEM_CURSOR_IBEAM:
1355
+ cursor_type = 1008; //PointerIcon.TYPE_TEXT;
1356
+ break;
1357
+ case SDL_SYSTEM_CURSOR_WAIT:
1358
+ cursor_type = 1004; //PointerIcon.TYPE_WAIT;
1359
+ break;
1360
+ case SDL_SYSTEM_CURSOR_CROSSHAIR:
1361
+ cursor_type = 1007; //PointerIcon.TYPE_CROSSHAIR;
1362
+ break;
1363
+ case SDL_SYSTEM_CURSOR_WAITARROW:
1364
+ cursor_type = 1004; //PointerIcon.TYPE_WAIT;
1365
+ break;
1366
+ case SDL_SYSTEM_CURSOR_SIZENWSE:
1367
+ cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
1368
+ break;
1369
+ case SDL_SYSTEM_CURSOR_SIZENESW:
1370
+ cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
1371
+ break;
1372
+ case SDL_SYSTEM_CURSOR_SIZEWE:
1373
+ cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
1374
+ break;
1375
+ case SDL_SYSTEM_CURSOR_SIZENS:
1376
+ cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
1377
+ break;
1378
+ case SDL_SYSTEM_CURSOR_SIZEALL:
1379
+ cursor_type = 1020; //PointerIcon.TYPE_GRAB;
1380
+ break;
1381
+ case SDL_SYSTEM_CURSOR_NO:
1382
+ cursor_type = 1012; //PointerIcon.TYPE_NO_DROP;
1383
+ break;
1384
+ case SDL_SYSTEM_CURSOR_HAND:
1385
+ cursor_type = 1002; //PointerIcon.TYPE_HAND;
1386
+ break;
1387
+ }
1388
+ // This requires API 24, so use reflection to implement this
1389
+ try {
1390
+ Class PointerIconClass = Class.forName("android.view.PointerIcon");
1391
+ Class[] arg_types = new Class[] { Context.class, int.class };
1392
+ Method getSystemIcon = PointerIconClass.getMethod("getSystemIcon", arg_types);
1393
+ Method setPointerIcon = SDLSurface.class.getMethod("setPointerIcon", PointerIconClass);
1394
+ setPointerIcon.invoke(mSurface, getSystemIcon.invoke(null, SDL.getContext(), cursor_type));
1395
+ } catch (Exception e) {
1396
+ return false;
1397
+ }
1398
+ return true;
1399
+ }
1400
+ }
1401
+
1402
+ /**
1403
+ Simple runnable to start the SDL application
1404
+ */
1405
+ class SDLMain implements Runnable {
1406
+ @Override
1407
+ public void run() {
1408
+ // Runs SDL_main()
1409
+ String library = SDLActivity.mSingleton.getMainSharedObject();
1410
+ String function = SDLActivity.mSingleton.getMainFunction();
1411
+ String[] arguments = SDLActivity.mSingleton.getArguments();
1412
+
1413
+ Log.v("SDL", "Running main function " + function + " from library " + library);
1414
+ SDLActivity.nativeRunMain(library, function, arguments);
1415
+
1416
+ Log.v("SDL", "Finished main function");
1417
+
1418
+ // Native thread has finished, let's finish the Activity
1419
+ if (!SDLActivity.mExitCalledFromJava) {
1420
+ SDLActivity.handleNativeExit();
1421
+ }
1422
+ }
1423
+ }
1424
+
1425
+
1426
+ /**
1427
+ SDLSurface. This is what we draw on, so we need to know when it's created
1428
+ in order to do anything useful.
1429
+
1430
+ Because of this, that's where we set up the SDL thread
1431
+ */
1432
+ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
1433
+ View.OnKeyListener, View.OnTouchListener, SensorEventListener {
1434
+
1435
+ // Sensors
1436
+ protected static SensorManager mSensorManager;
1437
+ protected static Display mDisplay;
1438
+
1439
+ // Keep track of the surface size to normalize touch events
1440
+ protected static float mWidth, mHeight;
1441
+
1442
+ // Startup
1443
+ public SDLSurface(Context context) {
1444
+ super(context);
1445
+ getHolder().addCallback(this);
1446
+
1447
+ setFocusable(true);
1448
+ setFocusableInTouchMode(true);
1449
+ requestFocus();
1450
+ setOnKeyListener(this);
1451
+ setOnTouchListener(this);
1452
+
1453
+ mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
1454
+ mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
1455
+
1456
+ if (Build.VERSION.SDK_INT >= 12) {
1457
+ setOnGenericMotionListener(SDLActivity.getMotionListener());
1458
+ }
1459
+
1460
+ // Some arbitrary defaults to avoid a potential division by zero
1461
+ mWidth = 1.0f;
1462
+ mHeight = 1.0f;
1463
+ }
1464
+
1465
+ public void handlePause() {
1466
+ enableSensor(Sensor.TYPE_ACCELEROMETER, false);
1467
+ }
1468
+
1469
+ public void handleResume() {
1470
+ setFocusable(true);
1471
+ setFocusableInTouchMode(true);
1472
+ requestFocus();
1473
+ setOnKeyListener(this);
1474
+ setOnTouchListener(this);
1475
+ enableSensor(Sensor.TYPE_ACCELEROMETER, true);
1476
+ }
1477
+
1478
+ public Surface getNativeSurface() {
1479
+ return getHolder().getSurface();
1480
+ }
1481
+
1482
+ // Called when we have a valid drawing surface
1483
+ @Override
1484
+ public void surfaceCreated(SurfaceHolder holder) {
1485
+ Log.v("SDL", "surfaceCreated()");
1486
+ holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
1487
+ }
1488
+
1489
+ // Called when we lose the surface
1490
+ @Override
1491
+ public void surfaceDestroyed(SurfaceHolder holder) {
1492
+ Log.v("SDL", "surfaceDestroyed()");
1493
+
1494
+ // Transition to pause, if needed
1495
+ SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;
1496
+ SDLActivity.handleNativeState();
1497
+
1498
+ SDLActivity.mIsSurfaceReady = false;
1499
+ SDLActivity.onNativeSurfaceDestroyed();
1500
+ }
1501
+
1502
+ // Called when the surface is resized
1503
+ @Override
1504
+ public void surfaceChanged(SurfaceHolder holder,
1505
+ int format, int width, int height) {
1506
+ Log.v("SDL", "surfaceChanged()");
1507
+
1508
+ int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
1509
+ switch (format) {
1510
+ case PixelFormat.A_8:
1511
+ Log.v("SDL", "pixel format A_8");
1512
+ break;
1513
+ case PixelFormat.LA_88:
1514
+ Log.v("SDL", "pixel format LA_88");
1515
+ break;
1516
+ case PixelFormat.L_8:
1517
+ Log.v("SDL", "pixel format L_8");
1518
+ break;
1519
+ case PixelFormat.RGBA_4444:
1520
+ Log.v("SDL", "pixel format RGBA_4444");
1521
+ sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
1522
+ break;
1523
+ case PixelFormat.RGBA_5551:
1524
+ Log.v("SDL", "pixel format RGBA_5551");
1525
+ sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
1526
+ break;
1527
+ case PixelFormat.RGBA_8888:
1528
+ Log.v("SDL", "pixel format RGBA_8888");
1529
+ sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
1530
+ break;
1531
+ case PixelFormat.RGBX_8888:
1532
+ Log.v("SDL", "pixel format RGBX_8888");
1533
+ sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
1534
+ break;
1535
+ case PixelFormat.RGB_332:
1536
+ Log.v("SDL", "pixel format RGB_332");
1537
+ sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
1538
+ break;
1539
+ case PixelFormat.RGB_565:
1540
+ Log.v("SDL", "pixel format RGB_565");
1541
+ sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
1542
+ break;
1543
+ case PixelFormat.RGB_888:
1544
+ Log.v("SDL", "pixel format RGB_888");
1545
+ // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
1546
+ sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
1547
+ break;
1548
+ default:
1549
+ Log.v("SDL", "pixel format unknown " + format);
1550
+ break;
1551
+ }
1552
+
1553
+ mWidth = width;
1554
+ mHeight = height;
1555
+ int nDeviceWidth = width;
1556
+ int nDeviceHeight = height;
1557
+ try
1558
+ {
1559
+ if ( android.os.Build.VERSION.SDK_INT >= 17 )
1560
+ {
1561
+ android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();
1562
+ mDisplay.getRealMetrics( realMetrics );
1563
+ nDeviceWidth = realMetrics.widthPixels;
1564
+ nDeviceHeight = realMetrics.heightPixels;
1565
+ }
1566
+ }
1567
+ catch ( java.lang.Throwable throwable ) {}
1568
+
1569
+ Log.v("SDL", "Window size: " + width + "x" + height);
1570
+ Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
1571
+ SDLActivity.onNativeResize(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
1572
+
1573
+
1574
+ boolean skip = false;
1575
+ int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
1576
+
1577
+ if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
1578
+ {
1579
+ // Accept any
1580
+ }
1581
+ else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT)
1582
+ {
1583
+ if (mWidth > mHeight) {
1584
+ skip = true;
1585
+ }
1586
+ } else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
1587
+ if (mWidth < mHeight) {
1588
+ skip = true;
1589
+ }
1590
+ }
1591
+
1592
+ // Special Patch for Square Resolution: Black Berry Passport
1593
+ if (skip) {
1594
+ double min = Math.min(mWidth, mHeight);
1595
+ double max = Math.max(mWidth, mHeight);
1596
+
1597
+ if (max / min < 1.20) {
1598
+ Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");
1599
+ skip = false;
1600
+ }
1601
+ }
1602
+
1603
+ if (skip) {
1604
+ Log.v("SDL", "Skip .. Surface is not ready.");
1605
+ SDLActivity.mIsSurfaceReady = false;
1606
+ return;
1607
+ }
1608
+
1609
+ /* Surface is ready */
1610
+ SDLActivity.mIsSurfaceReady = true;
1611
+
1612
+ /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
1613
+ SDLActivity.onNativeSurfaceChanged();
1614
+
1615
+ SDLActivity.handleNativeState();
1616
+ }
1617
+
1618
+ // Key events
1619
+ @Override
1620
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
1621
+ // Dispatch the different events depending on where they come from
1622
+ // Some SOURCE_JOYSTICK, SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD
1623
+ // So, we try to process them as JOYSTICK/DPAD/GAMEPAD events first, if that fails we try them as KEYBOARD
1624
+ //
1625
+ // Furthermore, it's possible a game controller has SOURCE_KEYBOARD and
1626
+ // SOURCE_JOYSTICK, while its key events arrive from the keyboard source
1627
+ // So, retrieve the device itself and check all of its sources
1628
+ if (SDLControllerManager.isDeviceSDLJoystick(event.getDeviceId())) {
1629
+ // Note that we process events with specific key codes here
1630
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
1631
+ if (SDLControllerManager.onNativePadDown(event.getDeviceId(), keyCode) == 0) {
1632
+ return true;
1633
+ }
1634
+ } else if (event.getAction() == KeyEvent.ACTION_UP) {
1635
+ if (SDLControllerManager.onNativePadUp(event.getDeviceId(), keyCode) == 0) {
1636
+ return true;
1637
+ }
1638
+ }
1639
+ }
1640
+
1641
+ if ((event.getSource() & InputDevice.SOURCE_KEYBOARD) != 0) {
1642
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
1643
+ //Log.v("SDL", "key down: " + keyCode);
1644
+ if (SDLActivity.isTextInputEvent(event)) {
1645
+ SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
1646
+ }
1647
+ SDLActivity.onNativeKeyDown(keyCode);
1648
+ return true;
1649
+ }
1650
+ else if (event.getAction() == KeyEvent.ACTION_UP) {
1651
+ //Log.v("SDL", "key up: " + keyCode);
1652
+ SDLActivity.onNativeKeyUp(keyCode);
1653
+ return true;
1654
+ }
1655
+ }
1656
+
1657
+ if ((event.getSource() & InputDevice.SOURCE_MOUSE) != 0) {
1658
+ // on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
1659
+ // they are ignored here because sending them as mouse input to SDL is messy
1660
+ if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
1661
+ switch (event.getAction()) {
1662
+ case KeyEvent.ACTION_DOWN:
1663
+ case KeyEvent.ACTION_UP:
1664
+ // mark the event as handled or it will be handled by system
1665
+ // handling KEYCODE_BACK by system will call onBackPressed()
1666
+ return true;
1667
+ }
1668
+ }
1669
+ }
1670
+
1671
+ return false;
1672
+ }
1673
+
1674
+ // Touch events
1675
+ @Override
1676
+ public boolean onTouch(View v, MotionEvent event) {
1677
+ /* Ref: http://developer.android.com/training/gestures/multi.html */
1678
+ final int touchDevId = event.getDeviceId();
1679
+ final int pointerCount = event.getPointerCount();
1680
+ int action = event.getActionMasked();
1681
+ int pointerFingerId;
1682
+ int mouseButton;
1683
+ int i = -1;
1684
+ float x,y,p;
1685
+
1686
+ // !!! FIXME: dump this SDK check after 2.0.4 ships and require API14.
1687
+ // 12290 = Samsung DeX mode desktop mouse
1688
+ if ((event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == 12290) && SDLActivity.mSeparateMouseAndTouch) {
1689
+ if (Build.VERSION.SDK_INT < 14) {
1690
+ mouseButton = 1; // all mouse buttons are the left button
1691
+ } else {
1692
+ try {
1693
+ mouseButton = (Integer) event.getClass().getMethod("getButtonState").invoke(event);
1694
+ } catch(Exception e) {
1695
+ mouseButton = 1; // oh well.
1696
+ }
1697
+ }
1698
+
1699
+ // We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
1700
+ // if we are. We'll leverage our existing mouse motion listener
1701
+ SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
1702
+ x = motionListener.getEventX(event);
1703
+ y = motionListener.getEventY(event);
1704
+
1705
+ SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
1706
+ } else {
1707
+ switch(action) {
1708
+ case MotionEvent.ACTION_MOVE:
1709
+ for (i = 0; i < pointerCount; i++) {
1710
+ pointerFingerId = event.getPointerId(i);
1711
+ x = event.getX(i) / mWidth;
1712
+ y = event.getY(i) / mHeight;
1713
+ p = event.getPressure(i);
1714
+ if (p > 1.0f) {
1715
+ // may be larger than 1.0f on some devices
1716
+ // see the documentation of getPressure(i)
1717
+ p = 1.0f;
1718
+ }
1719
+ SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
1720
+ }
1721
+ break;
1722
+
1723
+ case MotionEvent.ACTION_UP:
1724
+ case MotionEvent.ACTION_DOWN:
1725
+ // Primary pointer up/down, the index is always zero
1726
+ i = 0;
1727
+ case MotionEvent.ACTION_POINTER_UP:
1728
+ case MotionEvent.ACTION_POINTER_DOWN:
1729
+ // Non primary pointer up/down
1730
+ if (i == -1) {
1731
+ i = event.getActionIndex();
1732
+ }
1733
+
1734
+ pointerFingerId = event.getPointerId(i);
1735
+ x = event.getX(i) / mWidth;
1736
+ y = event.getY(i) / mHeight;
1737
+ p = event.getPressure(i);
1738
+ if (p > 1.0f) {
1739
+ // may be larger than 1.0f on some devices
1740
+ // see the documentation of getPressure(i)
1741
+ p = 1.0f;
1742
+ }
1743
+ SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
1744
+ break;
1745
+
1746
+ case MotionEvent.ACTION_CANCEL:
1747
+ for (i = 0; i < pointerCount; i++) {
1748
+ pointerFingerId = event.getPointerId(i);
1749
+ x = event.getX(i) / mWidth;
1750
+ y = event.getY(i) / mHeight;
1751
+ p = event.getPressure(i);
1752
+ if (p > 1.0f) {
1753
+ // may be larger than 1.0f on some devices
1754
+ // see the documentation of getPressure(i)
1755
+ p = 1.0f;
1756
+ }
1757
+ SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
1758
+ }
1759
+ break;
1760
+
1761
+ default:
1762
+ break;
1763
+ }
1764
+ }
1765
+
1766
+ return true;
1767
+ }
1768
+
1769
+ // Sensor events
1770
+ public void enableSensor(int sensortype, boolean enabled) {
1771
+ // TODO: This uses getDefaultSensor - what if we have >1 accels?
1772
+ if (enabled) {
1773
+ mSensorManager.registerListener(this,
1774
+ mSensorManager.getDefaultSensor(sensortype),
1775
+ SensorManager.SENSOR_DELAY_GAME, null);
1776
+ } else {
1777
+ mSensorManager.unregisterListener(this,
1778
+ mSensorManager.getDefaultSensor(sensortype));
1779
+ }
1780
+ }
1781
+
1782
+ @Override
1783
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
1784
+ // TODO
1785
+ }
1786
+
1787
+ @Override
1788
+ public void onSensorChanged(SensorEvent event) {
1789
+ if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
1790
+
1791
+ // Since we may have an orientation set, we won't receive onConfigurationChanged events.
1792
+ // We thus should check here.
1793
+ int newOrientation = SDLActivity.SDL_ORIENTATION_UNKNOWN;
1794
+
1795
+ float x, y;
1796
+ switch (mDisplay.getRotation()) {
1797
+ case Surface.ROTATION_90:
1798
+ x = -event.values[1];
1799
+ y = event.values[0];
1800
+ newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;
1801
+ break;
1802
+ case Surface.ROTATION_270:
1803
+ x = event.values[1];
1804
+ y = -event.values[0];
1805
+ newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
1806
+ break;
1807
+ case Surface.ROTATION_180:
1808
+ x = -event.values[1];
1809
+ y = -event.values[0];
1810
+ newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
1811
+ break;
1812
+ default:
1813
+ x = event.values[0];
1814
+ y = event.values[1];
1815
+ newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;
1816
+ break;
1817
+ }
1818
+
1819
+ if (newOrientation != SDLActivity.mCurrentOrientation) {
1820
+ SDLActivity.mCurrentOrientation = newOrientation;
1821
+ SDLActivity.onNativeOrientationChanged(newOrientation);
1822
+ }
1823
+
1824
+ SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
1825
+ y / SensorManager.GRAVITY_EARTH,
1826
+ event.values[2] / SensorManager.GRAVITY_EARTH);
1827
+
1828
+
1829
+ }
1830
+ }
1831
+
1832
+ // Captured pointer events for API 26.
1833
+ public boolean onCapturedPointerEvent(MotionEvent event)
1834
+ {
1835
+ int action = event.getActionMasked();
1836
+
1837
+ float x, y;
1838
+ switch (action) {
1839
+ case MotionEvent.ACTION_SCROLL:
1840
+ x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
1841
+ y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
1842
+ SDLActivity.onNativeMouse(0, action, x, y, false);
1843
+ return true;
1844
+
1845
+ case MotionEvent.ACTION_HOVER_MOVE:
1846
+ case MotionEvent.ACTION_MOVE:
1847
+ x = event.getX(0);
1848
+ y = event.getY(0);
1849
+ SDLActivity.onNativeMouse(0, action, x, y, true);
1850
+ return true;
1851
+
1852
+ case MotionEvent.ACTION_BUTTON_PRESS:
1853
+ case MotionEvent.ACTION_BUTTON_RELEASE:
1854
+
1855
+ // Change our action value to what SDL's code expects.
1856
+ if (action == MotionEvent.ACTION_BUTTON_PRESS) {
1857
+ action = MotionEvent.ACTION_DOWN;
1858
+ }
1859
+ else if (action == MotionEvent.ACTION_BUTTON_RELEASE) {
1860
+ action = MotionEvent.ACTION_UP;
1861
+ }
1862
+
1863
+ x = event.getX(0);
1864
+ y = event.getY(0);
1865
+ int button = event.getButtonState();
1866
+
1867
+ SDLActivity.onNativeMouse(button, action, x, y, true);
1868
+ return true;
1869
+ }
1870
+
1871
+ return false;
1872
+ }
1873
+
1874
+ }
1875
+
1876
+ /* This is a fake invisible editor view that receives the input and defines the
1877
+ * pan&scan region
1878
+ */
1879
+ class DummyEdit extends View implements View.OnKeyListener {
1880
+ InputConnection ic;
1881
+
1882
+ public DummyEdit(Context context) {
1883
+ super(context);
1884
+ setFocusableInTouchMode(true);
1885
+ setFocusable(true);
1886
+ setOnKeyListener(this);
1887
+ }
1888
+
1889
+ @Override
1890
+ public boolean onCheckIsTextEditor() {
1891
+ return true;
1892
+ }
1893
+
1894
+ @Override
1895
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
1896
+ /*
1897
+ * This handles the hardware keyboard input
1898
+ */
1899
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
1900
+ if (SDLActivity.isTextInputEvent(event)) {
1901
+ ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
1902
+ return true;
1903
+ }
1904
+ SDLActivity.onNativeKeyDown(keyCode);
1905
+ return true;
1906
+ } else if (event.getAction() == KeyEvent.ACTION_UP) {
1907
+ SDLActivity.onNativeKeyUp(keyCode);
1908
+ return true;
1909
+ }
1910
+ return false;
1911
+ }
1912
+
1913
+ //
1914
+ @Override
1915
+ public boolean onKeyPreIme (int keyCode, KeyEvent event) {
1916
+ // As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
1917
+ // FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
1918
+ // FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
1919
+ // FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout
1920
+ // FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
1921
+ // FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
1922
+ if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
1923
+ if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
1924
+ SDLActivity.onNativeKeyboardFocusLost();
1925
+ }
1926
+ }
1927
+ return super.onKeyPreIme(keyCode, event);
1928
+ }
1929
+
1930
+ @Override
1931
+ public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
1932
+ ic = new SDLInputConnection(this, true);
1933
+
1934
+ outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
1935
+ outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
1936
+ | EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
1937
+
1938
+ return ic;
1939
+ }
1940
+ }
1941
+
1942
+ class SDLInputConnection extends BaseInputConnection {
1943
+
1944
+ public SDLInputConnection(View targetView, boolean fullEditor) {
1945
+ super(targetView, fullEditor);
1946
+
1947
+ }
1948
+
1949
+ @Override
1950
+ public boolean sendKeyEvent(KeyEvent event) {
1951
+ /*
1952
+ * This used to handle the keycodes from soft keyboard (and IME-translated input from hardkeyboard)
1953
+ * However, as of Ice Cream Sandwich and later, almost all soft keyboard doesn't generate key presses
1954
+ * and so we need to generate them ourselves in commitText. To avoid duplicates on the handful of keys
1955
+ * that still do, we empty this out.
1956
+ */
1957
+
1958
+ /*
1959
+ * Return DOES still generate a key event, however. So rather than using it as the 'click a button' key
1960
+ * as we do with physical keyboards, let's just use it to hide the keyboard.
1961
+ */
1962
+
1963
+ if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
1964
+ String imeHide = SDLActivity.nativeGetHint("SDL_RETURN_KEY_HIDES_IME");
1965
+ if ((imeHide != null) && imeHide.equals("1")) {
1966
+ Context c = SDL.getContext();
1967
+ if (c instanceof SDLActivity) {
1968
+ SDLActivity activity = (SDLActivity)c;
1969
+ activity.sendCommand(SDLActivity.COMMAND_TEXTEDIT_HIDE, null);
1970
+ return true;
1971
+ }
1972
+ }
1973
+ }
1974
+
1975
+
1976
+ return super.sendKeyEvent(event);
1977
+ }
1978
+
1979
+ @Override
1980
+ public boolean commitText(CharSequence text, int newCursorPosition) {
1981
+
1982
+ for (int i = 0; i < text.length(); i++) {
1983
+ char c = text.charAt(i);
1984
+ nativeGenerateScancodeForUnichar(c);
1985
+ }
1986
+
1987
+ SDLInputConnection.nativeCommitText(text.toString(), newCursorPosition);
1988
+
1989
+ return super.commitText(text, newCursorPosition);
1990
+ }
1991
+
1992
+ @Override
1993
+ public boolean setComposingText(CharSequence text, int newCursorPosition) {
1994
+
1995
+ nativeSetComposingText(text.toString(), newCursorPosition);
1996
+
1997
+ return super.setComposingText(text, newCursorPosition);
1998
+ }
1999
+
2000
+ public static native void nativeCommitText(String text, int newCursorPosition);
2001
+
2002
+ public native void nativeGenerateScancodeForUnichar(char c);
2003
+
2004
+ public native void nativeSetComposingText(String text, int newCursorPosition);
2005
+
2006
+ @Override
2007
+ public boolean deleteSurroundingText(int beforeLength, int afterLength) {
2008
+ // Workaround to capture backspace key. Ref: http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection
2009
+ // and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
2010
+ if (beforeLength > 0 && afterLength == 0) {
2011
+ boolean ret = true;
2012
+ // backspace(s)
2013
+ while (beforeLength-- > 0) {
2014
+ boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
2015
+ && sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
2016
+ ret = ret && ret_key;
2017
+ }
2018
+ return ret;
2019
+ }
2020
+
2021
+ return super.deleteSurroundingText(beforeLength, afterLength);
2022
+ }
2023
+ }
2024
+
2025
+ interface SDLClipboardHandler {
2026
+
2027
+ public boolean clipboardHasText();
2028
+ public String clipboardGetText();
2029
+ public void clipboardSetText(String string);
2030
+
2031
+ }
2032
+
2033
+
2034
+ class SDLClipboardHandler_API11 implements
2035
+ SDLClipboardHandler,
2036
+ android.content.ClipboardManager.OnPrimaryClipChangedListener {
2037
+
2038
+ protected android.content.ClipboardManager mClipMgr;
2039
+
2040
+ SDLClipboardHandler_API11() {
2041
+ mClipMgr = (android.content.ClipboardManager) SDL.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
2042
+ mClipMgr.addPrimaryClipChangedListener(this);
2043
+ }
2044
+
2045
+ @Override
2046
+ public boolean clipboardHasText() {
2047
+ return mClipMgr.hasText();
2048
+ }
2049
+
2050
+ @Override
2051
+ public String clipboardGetText() {
2052
+ CharSequence text;
2053
+ text = mClipMgr.getText();
2054
+ if (text != null) {
2055
+ return text.toString();
2056
+ }
2057
+ return null;
2058
+ }
2059
+
2060
+ @Override
2061
+ public void clipboardSetText(String string) {
2062
+ mClipMgr.removePrimaryClipChangedListener(this);
2063
+ mClipMgr.setText(string);
2064
+ mClipMgr.addPrimaryClipChangedListener(this);
2065
+ }
2066
+
2067
+ @Override
2068
+ public void onPrimaryClipChanged() {
2069
+ SDLActivity.onNativeClipboardChanged();
2070
+ }
2071
+
2072
+ }
2073
+
2074
+ class SDLClipboardHandler_Old implements
2075
+ SDLClipboardHandler {
2076
+
2077
+ protected android.text.ClipboardManager mClipMgrOld;
2078
+
2079
+ SDLClipboardHandler_Old() {
2080
+ mClipMgrOld = (android.text.ClipboardManager) SDL.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
2081
+ }
2082
+
2083
+ @Override
2084
+ public boolean clipboardHasText() {
2085
+ return mClipMgrOld.hasText();
2086
+ }
2087
+
2088
+ @Override
2089
+ public String clipboardGetText() {
2090
+ CharSequence text;
2091
+ text = mClipMgrOld.getText();
2092
+ if (text != null) {
2093
+ return text.toString();
2094
+ }
2095
+ return null;
2096
+ }
2097
+
2098
+ @Override
2099
+ public void clipboardSetText(String string) {
2100
+ mClipMgrOld.setText(string);
2101
+ }
2102
+ }
2103
+