ruby2d 0.10.0 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +108 -14
  3. data/assets/include/SDL2/SDL_assert.h +81 -50
  4. data/assets/include/SDL2/SDL_atomic.h +135 -35
  5. data/assets/include/SDL2/SDL_audio.h +960 -355
  6. data/assets/include/SDL2/SDL_bits.h +11 -6
  7. data/assets/include/SDL2/SDL_blendmode.h +91 -14
  8. data/assets/include/SDL2/SDL_clipboard.h +30 -7
  9. data/assets/include/SDL2/SDL_config.h +3 -1
  10. data/assets/include/SDL2/SDL_config_android.h +11 -1
  11. data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
  12. data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
  13. data/assets/include/SDL2/SDL_config_macosx.h +16 -2
  14. data/assets/include/SDL2/SDL_config_minimal.h +4 -1
  15. data/assets/include/SDL2/SDL_config_os2.h +37 -20
  16. data/assets/include/SDL2/SDL_config_pandora.h +6 -1
  17. data/assets/include/SDL2/SDL_config_psp.h +8 -8
  18. data/assets/include/SDL2/SDL_config_windows.h +39 -22
  19. data/assets/include/SDL2/SDL_config_winrt.h +23 -8
  20. data/assets/include/SDL2/SDL_config_wiz.h +6 -1
  21. data/assets/include/SDL2/SDL_copying.h +1 -1
  22. data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
  23. data/assets/include/SDL2/SDL_egl.h +906 -280
  24. data/assets/include/SDL2/SDL_endian.h +101 -47
  25. data/assets/include/SDL2/SDL_error.h +70 -19
  26. data/assets/include/SDL2/SDL_events.h +387 -79
  27. data/assets/include/SDL2/SDL_filesystem.h +73 -64
  28. data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
  29. data/assets/include/SDL2/SDL_gesture.h +36 -6
  30. data/assets/include/SDL2/SDL_haptic.h +304 -210
  31. data/assets/include/SDL2/SDL_hidapi.h +451 -0
  32. data/assets/include/SDL2/SDL_hints.h +1286 -897
  33. data/assets/include/SDL2/SDL_joystick.h +577 -130
  34. data/assets/include/SDL2/SDL_keyboard.h +162 -63
  35. data/assets/include/SDL2/SDL_keycode.h +7 -5
  36. data/assets/include/SDL2/SDL_loadso.h +42 -8
  37. data/assets/include/SDL2/SDL_locale.h +34 -32
  38. data/assets/include/SDL2/SDL_log.h +212 -19
  39. data/assets/include/SDL2/SDL_main.h +72 -17
  40. data/assets/include/SDL2/SDL_messagebox.h +70 -23
  41. data/assets/include/SDL2/SDL_metal.h +27 -32
  42. data/assets/include/SDL2/SDL_misc.h +19 -15
  43. data/assets/include/SDL2/SDL_mouse.h +262 -110
  44. data/assets/include/SDL2/SDL_mutex.h +286 -66
  45. data/assets/include/SDL2/SDL_name.h +1 -1
  46. data/assets/include/SDL2/SDL_opengl.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles.h +1 -1
  48. data/assets/include/SDL2/SDL_opengles2.h +2 -2
  49. data/assets/include/SDL2/SDL_pixels.h +199 -34
  50. data/assets/include/SDL2/SDL_platform.h +39 -2
  51. data/assets/include/SDL2/SDL_power.h +23 -10
  52. data/assets/include/SDL2/SDL_quit.h +1 -1
  53. data/assets/include/SDL2/SDL_rect.h +78 -28
  54. data/assets/include/SDL2/SDL_render.h +1204 -472
  55. data/assets/include/SDL2/SDL_revision.h +2 -2
  56. data/assets/include/SDL2/SDL_rwops.h +605 -33
  57. data/assets/include/SDL2/SDL_scancode.h +1 -1
  58. data/assets/include/SDL2/SDL_sensor.h +76 -42
  59. data/assets/include/SDL2/SDL_shape.h +38 -27
  60. data/assets/include/SDL2/SDL_stdinc.h +96 -24
  61. data/assets/include/SDL2/SDL_surface.h +571 -139
  62. data/assets/include/SDL2/SDL_system.h +339 -101
  63. data/assets/include/SDL2/SDL_syswm.h +50 -20
  64. data/assets/include/SDL2/SDL_test.h +1 -1
  65. data/assets/include/SDL2/SDL_test_assert.h +2 -2
  66. data/assets/include/SDL2/SDL_test_common.h +23 -6
  67. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  68. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  69. data/assets/include/SDL2/SDL_test_font.h +3 -3
  70. data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
  71. data/assets/include/SDL2/SDL_test_harness.h +6 -6
  72. data/assets/include/SDL2/SDL_test_images.h +1 -1
  73. data/assets/include/SDL2/SDL_test_log.h +1 -1
  74. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  75. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  76. data/assets/include/SDL2/SDL_test_random.h +2 -2
  77. data/assets/include/SDL2/SDL_thread.h +226 -128
  78. data/assets/include/SDL2/SDL_timer.h +129 -22
  79. data/assets/include/SDL2/SDL_touch.h +48 -8
  80. data/assets/include/SDL2/SDL_ttf.h +102 -9
  81. data/assets/include/SDL2/SDL_types.h +1 -1
  82. data/assets/include/SDL2/SDL_version.h +72 -46
  83. data/assets/include/SDL2/SDL_video.h +1266 -460
  84. data/assets/include/SDL2/SDL_vulkan.h +100 -161
  85. data/assets/include/SDL2/begin_code.h +22 -1
  86. data/assets/include/SDL2/close_code.h +1 -1
  87. data/assets/include/mrbconf.h +234 -0
  88. data/assets/include/mruby/array.h +317 -0
  89. data/assets/include/mruby/boxing_nan.h +130 -0
  90. data/assets/include/mruby/boxing_no.h +58 -0
  91. data/assets/include/mruby/boxing_word.h +205 -0
  92. data/assets/include/mruby/class.h +108 -0
  93. data/assets/include/mruby/common.h +92 -0
  94. data/assets/include/mruby/compile.h +210 -0
  95. data/assets/include/mruby/data.h +76 -0
  96. data/assets/include/mruby/debug.h +66 -0
  97. data/assets/include/mruby/dump.h +158 -0
  98. data/assets/include/mruby/endian.h +44 -0
  99. data/assets/include/mruby/error.h +137 -0
  100. data/assets/include/mruby/gc.h +92 -0
  101. data/assets/include/mruby/hash.h +242 -0
  102. data/assets/include/mruby/irep.h +147 -0
  103. data/assets/include/mruby/istruct.h +50 -0
  104. data/assets/include/mruby/khash.h +284 -0
  105. data/assets/include/mruby/numeric.h +169 -0
  106. data/assets/include/mruby/object.h +43 -0
  107. data/assets/include/mruby/opcode.h +43 -0
  108. data/assets/include/mruby/ops.h +122 -0
  109. data/assets/include/mruby/presym/disable.h +70 -0
  110. data/assets/include/mruby/presym/enable.h +37 -0
  111. data/assets/include/mruby/presym/scanning.h +73 -0
  112. data/assets/include/mruby/presym.h +40 -0
  113. data/assets/include/mruby/proc.h +209 -0
  114. data/assets/include/mruby/range.h +79 -0
  115. data/assets/include/mruby/re.h +16 -0
  116. data/assets/include/mruby/string.h +469 -0
  117. data/assets/include/mruby/throw.h +66 -0
  118. data/assets/include/mruby/value.h +400 -0
  119. data/assets/include/mruby/variable.h +140 -0
  120. data/assets/include/mruby/version.h +143 -0
  121. data/assets/include/mruby.h +1444 -0
  122. data/assets/macos/universal/bin/mrbc +0 -0
  123. data/assets/macos/universal/lib/libFLAC.a +0 -0
  124. data/assets/macos/universal/lib/libSDL2.a +0 -0
  125. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  126. data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
  127. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  128. data/assets/macos/universal/lib/libfreetype.a +0 -0
  129. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  130. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  131. data/assets/macos/universal/lib/libjpeg.a +0 -0
  132. data/assets/macos/universal/lib/libmodplug.a +0 -0
  133. data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
  134. data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
  135. data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
  136. data/assets/macos/universal/lib/libpng16.a +0 -0
  137. data/assets/macos/universal/lib/libtiff.a +0 -0
  138. data/assets/macos/universal/lib/libvorbis.a +0 -0
  139. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  140. data/assets/macos/universal/lib/libwebp.a +0 -0
  141. data/assets/test_media/README.md +3 -0
  142. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
  143. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  144. data/assets/test_media/boom.png +0 -0
  145. data/assets/test_media/coin.png +0 -0
  146. data/assets/test_media/colors.png +0 -0
  147. data/assets/test_media/controller.png +0 -0
  148. data/assets/test_media/dial.wav +0 -0
  149. data/assets/test_media/hero.png +0 -0
  150. data/assets/test_media/image.bmp +0 -0
  151. data/assets/test_media/image.jpg +0 -0
  152. data/assets/test_media/image.png +0 -0
  153. data/assets/test_media/music.flac +0 -0
  154. data/assets/test_media/music.mp3 +0 -0
  155. data/assets/test_media/music.ogg +0 -0
  156. data/assets/test_media/music.wav +0 -0
  157. data/assets/test_media/originals/boom.pxm +0 -0
  158. data/assets/test_media/originals/coin.pxm +0 -0
  159. data/assets/test_media/originals/controller.sketch +0 -0
  160. data/assets/test_media/originals/hero.pxm +0 -0
  161. data/assets/test_media/originals/image.pxm +0 -0
  162. data/assets/test_media/originals/music.caf +0 -0
  163. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  164. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  165. data/assets/test_media/sound.flac +0 -0
  166. data/assets/test_media/sound.mp3 +0 -0
  167. data/assets/test_media/sound.ogg +0 -0
  168. data/assets/test_media/sound.wav +0 -0
  169. data/assets/test_media/sprite_sheet.png +0 -0
  170. data/assets/test_media/texture_atlas.png +0 -0
  171. data/assets/wasm/build_config.rb +13 -0
  172. data/assets/wasm/libmruby.a +0 -0
  173. data/assets/wasm/template.html +17 -0
  174. data/assets/windows/glew/README.md +10 -0
  175. data/assets/windows/glew/glew.h +23686 -0
  176. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  177. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  178. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  179. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  180. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  181. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  182. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  183. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  184. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  185. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  186. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  187. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  188. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  189. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  190. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  191. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  192. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  193. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  194. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  195. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  196. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  197. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  198. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  199. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  200. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  201. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  202. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  203. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  204. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  205. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  206. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  207. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  208. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  209. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  211. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  212. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  213. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  214. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  215. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  216. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  217. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  218. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  219. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  220. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  221. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  222. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  223. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  224. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  225. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  226. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  227. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  228. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  229. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  230. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  231. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  232. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  233. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  234. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  235. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  236. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  237. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  238. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  239. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  240. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  241. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  242. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  243. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  244. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  245. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  246. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  247. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  248. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  249. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  250. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  251. data/assets/{ios → xcode/ios}/main.c +0 -0
  252. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  253. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  254. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  255. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  256. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  257. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  258. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  259. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  260. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  261. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  262. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  263. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  264. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  265. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  266. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  267. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  268. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  269. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  270. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  271. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  272. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  273. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  274. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  275. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  276. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  277. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  278. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  279. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  280. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  281. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  282. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  283. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  284. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  285. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  286. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  287. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  288. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  289. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  290. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  291. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  292. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  293. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  294. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  295. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  296. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  297. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  298. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  299. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  300. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  301. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  302. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  303. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  304. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  305. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  306. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  307. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  308. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  309. data/bin/ruby2d +3 -4
  310. data/ext/ruby2d/extconf.rb +68 -46
  311. data/ext/ruby2d/font.c +35 -0
  312. data/ext/ruby2d/gl.c +9 -58
  313. data/ext/ruby2d/gl2.c +8 -83
  314. data/ext/ruby2d/gl3.c +57 -116
  315. data/ext/ruby2d/gles.c +130 -151
  316. data/ext/ruby2d/image.c +16 -96
  317. data/ext/ruby2d/ruby2d.c +265 -298
  318. data/ext/ruby2d/ruby2d.h +69 -159
  319. data/ext/ruby2d/sound.c +1 -1
  320. data/ext/ruby2d/text.c +20 -114
  321. data/ext/ruby2d/window.c +257 -219
  322. data/lib/ruby2d/circle.rb +3 -1
  323. data/lib/ruby2d/cli/build.rb +239 -59
  324. data/lib/ruby2d/cli/colorize.rb +5 -4
  325. data/lib/ruby2d/cli/platform.rb +17 -0
  326. data/lib/ruby2d/font.rb +26 -1
  327. data/lib/ruby2d/image.rb +22 -17
  328. data/lib/ruby2d/line.rb +3 -1
  329. data/lib/ruby2d/quad.rb +3 -1
  330. data/lib/ruby2d/rectangle.rb +1 -1
  331. data/lib/ruby2d/renderable.rb +0 -12
  332. data/lib/ruby2d/sound.rb +25 -0
  333. data/lib/ruby2d/sprite.rb +44 -89
  334. data/lib/ruby2d/square.rb +1 -1
  335. data/lib/ruby2d/text.rb +40 -20
  336. data/lib/ruby2d/texture.rb +28 -0
  337. data/lib/ruby2d/tileset.rb +47 -28
  338. data/lib/ruby2d/triangle.rb +3 -1
  339. data/lib/ruby2d/version.rb +1 -1
  340. data/lib/ruby2d/vertices.rb +89 -0
  341. data/lib/ruby2d/window.rb +13 -3
  342. data/lib/ruby2d.rb +16 -20
  343. metadata +249 -153
  344. data/assets/README.md +0 -22
  345. data/assets/Rakefile +0 -85
  346. data/assets/macos/lib/libFLAC.a +0 -0
  347. data/assets/macos/lib/libSDL2.a +0 -0
  348. data/assets/macos/lib/libSDL2_image.a +0 -0
  349. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  350. data/assets/macos/lib/libfreetype.a +0 -0
  351. data/assets/macos/lib/libjpeg.a +0 -0
  352. data/assets/macos/lib/libpng16.a +0 -0
  353. data/assets/macos/lib/libtiff.a +0 -0
  354. data/assets/macos/lib/libvorbis.a +0 -0
  355. data/assets/macos/lib/libvorbisfile.a +0 -0
  356. data/assets/macos/lib/libwebp.a +0 -0
  357. data/assets/mingw/bin/SDL2.dll +0 -0
  358. data/assets/mingw/bin/SDL2_image.dll +0 -0
  359. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  360. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  361. data/assets/mingw/bin/glew32.dll +0 -0
  362. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  363. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  364. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  365. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  366. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  367. data/assets/mingw/bin/libogg-0.dll +0 -0
  368. data/assets/mingw/bin/libopus-0.dll +0 -0
  369. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  370. data/assets/mingw/bin/libpng16-16.dll +0 -0
  371. data/assets/mingw/bin/libtiff-5.dll +0 -0
  372. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  373. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  374. data/assets/mingw/bin/libwebp-7.dll +0 -0
  375. data/assets/mingw/bin/zlib1.dll +0 -0
  376. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  377. data/assets/mingw/lib/libSDL2_image.a +0 -0
  378. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  379. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  380. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  381. data/assets/mingw/lib/libSDL2_test.a +0 -0
  382. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  383. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  384. data/assets/mingw/lib/libSDL2main.a +0 -0
  385. data/assets/mingw/lib/libglew32.dll.a +0 -0
  386. data/ext/ruby2d/sprite.c +0 -147
  387. data/ext/ruby2d/tileset.c +0 -30
@@ -0,0 +1,70 @@
1
+ /**
2
+ ** @file mruby/presym/disable.h - Disable Preallocated Symbols
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_PRESYM_DISABLE_H
8
+ #define MRUBY_PRESYM_DISABLE_H
9
+
10
+ #include <string.h>
11
+
12
+ #define MRB_PRESYM_MAX 0
13
+
14
+ #define MRB_OPSYM(name) MRB_OPSYM__##name(mrb)
15
+ #define MRB_CVSYM(name) mrb_intern_lit(mrb, "@@" #name)
16
+ #define MRB_IVSYM(name) mrb_intern_lit(mrb, "@" #name)
17
+ #define MRB_SYM_B(name) mrb_intern_lit(mrb, #name "!")
18
+ #define MRB_SYM_Q(name) mrb_intern_lit(mrb, #name "?")
19
+ #define MRB_SYM_E(name) mrb_intern_lit(mrb, #name "=")
20
+ #define MRB_SYM(name) mrb_intern_lit(mrb, #name)
21
+
22
+ #define MRB_OPSYM_2(mrb, name) MRB_OPSYM__##name(mrb)
23
+ #define MRB_CVSYM_2(mrb, name) mrb_intern_lit(mrb, "@@" #name)
24
+ #define MRB_IVSYM_2(mrb, name) mrb_intern_lit(mrb, "@" #name)
25
+ #define MRB_SYM_B_2(mrb, name) mrb_intern_lit(mrb, #name "!")
26
+ #define MRB_SYM_Q_2(mrb, name) mrb_intern_lit(mrb, #name "?")
27
+ #define MRB_SYM_E_2(mrb, name) mrb_intern_lit(mrb, #name "=")
28
+ #define MRB_SYM_2(mrb, name) mrb_intern_lit(mrb, #name)
29
+
30
+ #define MRB_OPSYM__not(mrb) mrb_intern_lit(mrb, "!")
31
+ #define MRB_OPSYM__mod(mrb) mrb_intern_lit(mrb, "%")
32
+ #define MRB_OPSYM__and(mrb) mrb_intern_lit(mrb, "&")
33
+ #define MRB_OPSYM__mul(mrb) mrb_intern_lit(mrb, "*")
34
+ #define MRB_OPSYM__add(mrb) mrb_intern_lit(mrb, "+")
35
+ #define MRB_OPSYM__sub(mrb) mrb_intern_lit(mrb, "-")
36
+ #define MRB_OPSYM__div(mrb) mrb_intern_lit(mrb, "/")
37
+ #define MRB_OPSYM__lt(mrb) mrb_intern_lit(mrb, "<")
38
+ #define MRB_OPSYM__gt(mrb) mrb_intern_lit(mrb, ">")
39
+ #define MRB_OPSYM__xor(mrb) mrb_intern_lit(mrb, "^")
40
+ #define MRB_OPSYM__tick(mrb) mrb_intern_lit(mrb, "`")
41
+ #define MRB_OPSYM__or(mrb) mrb_intern_lit(mrb, "|")
42
+ #define MRB_OPSYM__neg(mrb) mrb_intern_lit(mrb, "~")
43
+ #define MRB_OPSYM__neq(mrb) mrb_intern_lit(mrb, "!=")
44
+ #define MRB_OPSYM__nmatch(mrb) mrb_intern_lit(mrb, "!~")
45
+ #define MRB_OPSYM__andand(mrb) mrb_intern_lit(mrb, "&&")
46
+ #define MRB_OPSYM__pow(mrb) mrb_intern_lit(mrb, "**")
47
+ #define MRB_OPSYM__plus(mrb) mrb_intern_lit(mrb, "+@")
48
+ #define MRB_OPSYM__minus(mrb) mrb_intern_lit(mrb, "-@")
49
+ #define MRB_OPSYM__lshift(mrb) mrb_intern_lit(mrb, "<<")
50
+ #define MRB_OPSYM__le(mrb) mrb_intern_lit(mrb, "<=")
51
+ #define MRB_OPSYM__eq(mrb) mrb_intern_lit(mrb, "==")
52
+ #define MRB_OPSYM__match(mrb) mrb_intern_lit(mrb, "=~")
53
+ #define MRB_OPSYM__ge(mrb) mrb_intern_lit(mrb, ">=")
54
+ #define MRB_OPSYM__rshift(mrb) mrb_intern_lit(mrb, ">>")
55
+ #define MRB_OPSYM__aref(mrb) mrb_intern_lit(mrb, "[]")
56
+ #define MRB_OPSYM__oror(mrb) mrb_intern_lit(mrb, "||")
57
+ #define MRB_OPSYM__cmp(mrb) mrb_intern_lit(mrb, "<=>")
58
+ #define MRB_OPSYM__eqq(mrb) mrb_intern_lit(mrb, "===")
59
+ #define MRB_OPSYM__aset(mrb) mrb_intern_lit(mrb, "[]=")
60
+
61
+ #define MRB_PRESYM_DEFINE_VAR_AND_INITER(name, size, ...) \
62
+ static mrb_sym name[size]; \
63
+ static void presym_init_##name(mrb_state *mrb) { \
64
+ mrb_sym name__[] = {__VA_ARGS__}; \
65
+ memcpy(name, name__, sizeof(name)); \
66
+ }
67
+
68
+ #define MRB_PRESYM_INIT_SYMBOLS(mrb, name) presym_init_##name(mrb)
69
+
70
+ #endif /* MRUBY_PRESYM_DISABLE_H */
@@ -0,0 +1,37 @@
1
+ /**
2
+ ** @file mruby/presym/enable.h - Enable Preallocated Symbols
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_PRESYM_ENABLE_H
8
+ #define MRUBY_PRESYM_ENABLE_H
9
+
10
+ #include <mruby/presym/id.h>
11
+
12
+ #define MRB_OPSYM(name) MRB_OPSYM__##name
13
+ #define MRB_CVSYM(name) MRB_CVSYM__##name
14
+ #define MRB_IVSYM(name) MRB_IVSYM__##name
15
+ #define MRB_SYM_B(name) MRB_SYM_B__##name
16
+ #define MRB_SYM_Q(name) MRB_SYM_Q__##name
17
+ #define MRB_SYM_E(name) MRB_SYM_E__##name
18
+ #define MRB_SYM(name) MRB_SYM__##name
19
+
20
+ #define MRB_OPSYM_2(mrb, name) MRB_OPSYM__##name
21
+ #define MRB_CVSYM_2(mrb, name) MRB_CVSYM__##name
22
+ #define MRB_IVSYM_2(mrb, name) MRB_IVSYM__##name
23
+ #define MRB_SYM_B_2(mrb, name) MRB_SYM_B__##name
24
+ #define MRB_SYM_Q_2(mrb, name) MRB_SYM_Q__##name
25
+ #define MRB_SYM_E_2(mrb, name) MRB_SYM_E__##name
26
+ #define MRB_SYM_2(mrb, name) MRB_SYM__##name
27
+
28
+ #define MRB_PRESYM_DEFINE_VAR_AND_INITER(name, size, ...) \
29
+ static const mrb_sym name[] = {__VA_ARGS__};
30
+
31
+ #define MRB_PRESYM_INIT_SYMBOLS(mrb, name) (void)(mrb)
32
+
33
+ /* use MRB_SYM() for E_RUNTIME_ERROR etc. */
34
+ #undef MRB_ERROR_SYM
35
+ #define MRB_ERROR_SYM(sym) MRB_SYM(sym)
36
+
37
+ #endif /* MRUBY_PRESYM_ENABLE_H */
@@ -0,0 +1,73 @@
1
+ /**
2
+ ** @file mruby/presym/scanning.h - Scanning Preallocated Symbols
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_PRESYM_SCANNING_H
8
+ #define MRUBY_PRESYM_SCANNING_H
9
+
10
+ #define MRB_PRESYM_SCANNING_TAGGED(arg) <@! arg !@>
11
+
12
+ #undef mrb_intern_lit
13
+ #define mrb_intern_lit(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name)
14
+ #define mrb_intern_cstr(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name)
15
+ #define mrb_define_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name)
16
+ #define mrb_define_class_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name)
17
+ #define mrb_define_singleton_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name)
18
+ #define mrb_define_class(mrb, name, s) MRB_PRESYM_SCANNING_TAGGED(name)
19
+ #define mrb_define_class_under(mrb, o, name, s) MRB_PRESYM_SCANNING_TAGGED(name)
20
+ #define mrb_define_module(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name)
21
+ #define mrb_define_module_under(mrb, o, name) MRB_PRESYM_SCANNING_TAGGED(name)
22
+ #define mrb_define_module_function(mrb, c, name, f, s) MRB_PRESYM_SCANNING_TAGGED(name)
23
+ #define mrb_define_const(mrb, c, name, v) MRB_PRESYM_SCANNING_TAGGED(name)
24
+ #define mrb_define_global_const(mrb, name, v) MRB_PRESYM_SCANNING_TAGGED(name)
25
+
26
+ #define MRB_OPSYM(name) MRB_OPSYM__##name(mrb)
27
+ #define MRB_CVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@@" #name)
28
+ #define MRB_IVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@" #name)
29
+ #define MRB_SYM_B(name) MRB_PRESYM_SCANNING_TAGGED(#name "!")
30
+ #define MRB_SYM_Q(name) MRB_PRESYM_SCANNING_TAGGED(#name "?")
31
+ #define MRB_SYM_E(name) MRB_PRESYM_SCANNING_TAGGED(#name "=")
32
+ #define MRB_SYM(name) MRB_PRESYM_SCANNING_TAGGED(#name)
33
+
34
+ #define MRB_OPSYM_2(mrb, name) MRB_OPSYM__##name(mrb)
35
+ #define MRB_CVSYM_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED("@@" #name)
36
+ #define MRB_IVSYM_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED("@" #name)
37
+ #define MRB_SYM_B_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED(#name "!")
38
+ #define MRB_SYM_Q_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED(#name "?")
39
+ #define MRB_SYM_E_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED(#name "=")
40
+ #define MRB_SYM_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED(#name)
41
+
42
+ #define MRB_OPSYM__not(mrb) MRB_PRESYM_SCANNING_TAGGED("!")
43
+ #define MRB_OPSYM__mod(mrb) MRB_PRESYM_SCANNING_TAGGED("%")
44
+ #define MRB_OPSYM__and(mrb) MRB_PRESYM_SCANNING_TAGGED("&")
45
+ #define MRB_OPSYM__mul(mrb) MRB_PRESYM_SCANNING_TAGGED("*")
46
+ #define MRB_OPSYM__add(mrb) MRB_PRESYM_SCANNING_TAGGED("+")
47
+ #define MRB_OPSYM__sub(mrb) MRB_PRESYM_SCANNING_TAGGED("-")
48
+ #define MRB_OPSYM__div(mrb) MRB_PRESYM_SCANNING_TAGGED("/")
49
+ #define MRB_OPSYM__lt(mrb) MRB_PRESYM_SCANNING_TAGGED("<")
50
+ #define MRB_OPSYM__gt(mrb) MRB_PRESYM_SCANNING_TAGGED(">")
51
+ #define MRB_OPSYM__xor(mrb) MRB_PRESYM_SCANNING_TAGGED("^")
52
+ #define MRB_OPSYM__tick(mrb) MRB_PRESYM_SCANNING_TAGGED("`")
53
+ #define MRB_OPSYM__or(mrb) MRB_PRESYM_SCANNING_TAGGED("|")
54
+ #define MRB_OPSYM__neg(mrb) MRB_PRESYM_SCANNING_TAGGED("~")
55
+ #define MRB_OPSYM__neq(mrb) MRB_PRESYM_SCANNING_TAGGED("!=")
56
+ #define MRB_OPSYM__nmatch(mrb) MRB_PRESYM_SCANNING_TAGGED("!~")
57
+ #define MRB_OPSYM__andand(mrb) MRB_PRESYM_SCANNING_TAGGED("&&")
58
+ #define MRB_OPSYM__pow(mrb) MRB_PRESYM_SCANNING_TAGGED("**")
59
+ #define MRB_OPSYM__plus(mrb) MRB_PRESYM_SCANNING_TAGGED("+@")
60
+ #define MRB_OPSYM__minus(mrb) MRB_PRESYM_SCANNING_TAGGED("-@")
61
+ #define MRB_OPSYM__lshift(mrb) MRB_PRESYM_SCANNING_TAGGED("<<")
62
+ #define MRB_OPSYM__le(mrb) MRB_PRESYM_SCANNING_TAGGED("<=")
63
+ #define MRB_OPSYM__eq(mrb) MRB_PRESYM_SCANNING_TAGGED("==")
64
+ #define MRB_OPSYM__match(mrb) MRB_PRESYM_SCANNING_TAGGED("=~")
65
+ #define MRB_OPSYM__ge(mrb) MRB_PRESYM_SCANNING_TAGGED(">=")
66
+ #define MRB_OPSYM__rshift(mrb) MRB_PRESYM_SCANNING_TAGGED(">>")
67
+ #define MRB_OPSYM__aref(mrb) MRB_PRESYM_SCANNING_TAGGED("[]")
68
+ #define MRB_OPSYM__oror(mrb) MRB_PRESYM_SCANNING_TAGGED("||")
69
+ #define MRB_OPSYM__cmp(mrb) MRB_PRESYM_SCANNING_TAGGED("<=>")
70
+ #define MRB_OPSYM__eqq(mrb) MRB_PRESYM_SCANNING_TAGGED("===")
71
+ #define MRB_OPSYM__aset(mrb) MRB_PRESYM_SCANNING_TAGGED("[]=")
72
+
73
+ #endif /* MRUBY_PRESYM_SCANNING_H */
@@ -0,0 +1,40 @@
1
+ /**
2
+ ** @file mruby/presym.h - Preallocated Symbols
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_PRESYM_H
8
+ #define MRUBY_PRESYM_H
9
+
10
+ #if defined(MRB_NO_PRESYM)
11
+ # include <mruby/presym/disable.h>
12
+ #elif !defined(MRB_PRESYM_SCANNING)
13
+ # include <mruby/presym/enable.h>
14
+ #endif
15
+
16
+ /*
17
+ * Where `mrb_intern_lit` is allowed for symbol interning, it is directly
18
+ * replaced by the symbol ID if presym is enabled by using the following
19
+ * macros.
20
+ *
21
+ * MRB_OPSYM(xor) //=> ^ (Operator)
22
+ * MRB_CVSYM(xor) //=> @@xor (Class Variable)
23
+ * MRB_IVSYM(xor) //=> @xor (Instance Variable)
24
+ * MRB_SYM_B(xor) //=> xor! (Method with Bang)
25
+ * MRB_SYM_Q(xor) //=> xor? (Method with Question mark)
26
+ * MRB_SYM_E(xor) //=> xor= (Method with Equal)
27
+ * MRB_SYM(xor) //=> xor (Word characters)
28
+ *
29
+ * For `MRB_OPSYM`, specify the names corresponding to operators (see
30
+ * `MRuby::Presym::OPERATORS` in `lib/mruby/presym.rb` for the names that
31
+ * can be specified for it). Other than that, describe only word characters
32
+ * excluding leading and ending punctuations.
33
+ *
34
+ * These macros are expanded to `mrb_intern_lit` if presym is disabled,
35
+ * therefore the mruby state variable is required. The above macros can be
36
+ * used when the variable name is `mrb`. If you want to use other variable
37
+ * names, you need to use macros with `_2` suffix, such as `MRB_SYM_2`.
38
+ */
39
+
40
+ #endif /* MRUBY_PRESYM_H */
@@ -0,0 +1,209 @@
1
+ /**
2
+ ** @file mruby/proc.h - Proc class
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_PROC_H
8
+ #define MRUBY_PROC_H
9
+
10
+ #include "common.h"
11
+ #include <mruby/irep.h>
12
+
13
+ /**
14
+ * Proc class
15
+ */
16
+ MRB_BEGIN_DECL
17
+
18
+ struct REnv {
19
+ MRB_OBJECT_HEADER;
20
+ mrb_value *stack;
21
+ struct mrb_context *cxt;
22
+ mrb_sym mid;
23
+ };
24
+
25
+ /* flags (21bits): 1(close):1(touched):1(heap):8(cioff/bidx):8(stack_len) */
26
+ #define MRB_ENV_SET_LEN(e,len) ((e)->flags = (((e)->flags & ~0xff)|((unsigned int)(len) & 0xff)))
27
+ #define MRB_ENV_LEN(e) ((mrb_int)((e)->flags & 0xff))
28
+ #define MRB_ENV_CLOSED (1<<20)
29
+ #define MRB_ENV_TOUCHED (1<<19)
30
+ #define MRB_ENV_HEAPED (1<<18)
31
+ #define MRB_ENV_CLOSE(e) ((e)->flags |= MRB_ENV_CLOSED)
32
+ #define MRB_ENV_TOUCH(e) ((e)->flags |= MRB_ENV_TOUCHED)
33
+ #define MRB_ENV_HEAP(e) ((e)->flags |= MRB_ENV_HEAPED)
34
+ #define MRB_ENV_HEAP_P(e) ((e)->flags & MRB_ENV_HEAPED)
35
+ #define MRB_ENV_ONSTACK_P(e) (((e)->flags & MRB_ENV_CLOSED) == 0)
36
+ #define MRB_ENV_BIDX(e) (((e)->flags >> 8) & 0xff)
37
+ #define MRB_ENV_SET_BIDX(e,idx) ((e)->flags = (((e)->flags & ~(0xff<<8))|((unsigned int)(idx) & 0xff)<<8))
38
+
39
+ void mrb_env_unshare(mrb_state*, struct REnv*);
40
+
41
+ struct RProc {
42
+ MRB_OBJECT_HEADER;
43
+ union {
44
+ const mrb_irep *irep;
45
+ mrb_func_t func;
46
+ } body;
47
+ const struct RProc *upper;
48
+ union {
49
+ struct RClass *target_class;
50
+ struct REnv *env;
51
+ } e;
52
+ };
53
+
54
+ /* aspec access */
55
+ #define MRB_ASPEC_REQ(a) (((a) >> 18) & 0x1f)
56
+ #define MRB_ASPEC_OPT(a) (((a) >> 13) & 0x1f)
57
+ #define MRB_ASPEC_REST(a) (((a) >> 12) & 0x1)
58
+ #define MRB_ASPEC_POST(a) (((a) >> 7) & 0x1f)
59
+ #define MRB_ASPEC_KEY(a) (((a) >> 2) & 0x1f)
60
+ #define MRB_ASPEC_KDICT(a) (((a) >> 1) & 0x1)
61
+ #define MRB_ASPEC_BLOCK(a) ((a) & 1)
62
+
63
+ #define MRB_PROC_CFUNC_FL 128
64
+ #define MRB_PROC_CFUNC_P(p) (((p)->flags & MRB_PROC_CFUNC_FL) != 0)
65
+ #define MRB_PROC_CFUNC(p) (p)->body.func
66
+ #define MRB_PROC_STRICT 256
67
+ #define MRB_PROC_STRICT_P(p) (((p)->flags & MRB_PROC_STRICT) != 0)
68
+ #define MRB_PROC_ORPHAN 512
69
+ #define MRB_PROC_ORPHAN_P(p) (((p)->flags & MRB_PROC_ORPHAN) != 0)
70
+ #define MRB_PROC_ENVSET 1024
71
+ #define MRB_PROC_ENV_P(p) (((p)->flags & MRB_PROC_ENVSET) != 0)
72
+ #define MRB_PROC_ENV(p) (MRB_PROC_ENV_P(p) ? (p)->e.env : NULL)
73
+ #define MRB_PROC_TARGET_CLASS(p) (MRB_PROC_ENV_P(p) ? (p)->e.env->c : (p)->e.target_class)
74
+ #define MRB_PROC_SET_TARGET_CLASS(p,tc) do {\
75
+ if (MRB_PROC_ENV_P(p)) {\
76
+ (p)->e.env->c = (tc);\
77
+ mrb_field_write_barrier(mrb, (struct RBasic*)(p)->e.env, (struct RBasic*)(tc));\
78
+ }\
79
+ else {\
80
+ (p)->e.target_class = (tc);\
81
+ mrb_field_write_barrier(mrb, (struct RBasic*)p, (struct RBasic*)(tc));\
82
+ }\
83
+ } while (0)
84
+ #define MRB_PROC_SCOPE 2048
85
+ #define MRB_PROC_SCOPE_P(p) (((p)->flags & MRB_PROC_SCOPE) != 0)
86
+
87
+ #define mrb_proc_ptr(v) ((struct RProc*)(mrb_ptr(v)))
88
+
89
+ struct RProc *mrb_proc_new(mrb_state*, const mrb_irep*);
90
+ struct RProc *mrb_closure_new(mrb_state*, const mrb_irep*);
91
+ MRB_API struct RProc *mrb_proc_new_cfunc(mrb_state*, mrb_func_t);
92
+ MRB_API struct RProc *mrb_closure_new_cfunc(mrb_state *mrb, mrb_func_t func, int nlocals);
93
+ void mrb_proc_copy(struct RProc *a, struct RProc *b);
94
+ mrb_int mrb_proc_arity(const struct RProc *p);
95
+
96
+ /* following functions are defined in mruby-proc-ext so please include it when using */
97
+ MRB_API struct RProc *mrb_proc_new_cfunc_with_env(mrb_state *mrb, mrb_func_t func, mrb_int argc, const mrb_value *argv);
98
+ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state *mrb, mrb_int idx);
99
+ /* old name */
100
+ #define mrb_cfunc_env_get(mrb, idx) mrb_proc_cfunc_env_get(mrb, idx)
101
+
102
+ #define MRB_METHOD_FUNC_FL 1
103
+ #define MRB_METHOD_NOARG_FL 2
104
+
105
+ #ifndef MRB_USE_METHOD_T_STRUCT
106
+
107
+ #define MRB_METHOD_FUNC_P(m) (((uintptr_t)(m))&MRB_METHOD_FUNC_FL)
108
+ #define MRB_METHOD_NOARG_P(m) ((((uintptr_t)(m))&MRB_METHOD_NOARG_FL)?1:0)
109
+ #define MRB_METHOD_NOARG_SET(m) ((m)=(mrb_method_t)(((uintptr_t)(m))|MRB_METHOD_NOARG_FL))
110
+ #define MRB_METHOD_FUNC(m) ((mrb_func_t)((uintptr_t)(m)>>2))
111
+ #define MRB_METHOD_FROM_FUNC(m,fn) ((m)=(mrb_method_t)((((uintptr_t)(fn))<<2)|MRB_METHOD_FUNC_FL))
112
+ #define MRB_METHOD_FROM_PROC(m,pr) ((m)=(mrb_method_t)(pr))
113
+ #define MRB_METHOD_PROC_P(m) (!MRB_METHOD_FUNC_P(m))
114
+ #define MRB_METHOD_PROC(m) ((struct RProc*)(m))
115
+ #define MRB_METHOD_UNDEF_P(m) ((m)==0)
116
+
117
+ #else
118
+
119
+ #define MRB_METHOD_FUNC_P(m) ((m).flags&MRB_METHOD_FUNC_FL)
120
+ #define MRB_METHOD_NOARG_P(m) (((m).flags&MRB_METHOD_NOARG_FL)?1:0)
121
+ #define MRB_METHOD_FUNC(m) ((m).func)
122
+ #define MRB_METHOD_NOARG_SET(m) do{(m).flags|=MRB_METHOD_NOARG_FL;}while(0)
123
+ #define MRB_METHOD_FROM_FUNC(m,fn) do{(m).flags=MRB_METHOD_FUNC_FL;(m).func=(fn);}while(0)
124
+ #define MRB_METHOD_FROM_PROC(m,pr) do{(m).flags=0;(m).proc=(pr);}while(0)
125
+ #define MRB_METHOD_PROC_P(m) (!MRB_METHOD_FUNC_P(m))
126
+ #define MRB_METHOD_PROC(m) ((m).proc)
127
+ #define MRB_METHOD_UNDEF_P(m) ((m).proc==NULL)
128
+
129
+ #endif /* MRB_USE_METHOD_T_STRUCT */
130
+
131
+ #define MRB_METHOD_CFUNC_P(m) (MRB_METHOD_FUNC_P(m)?TRUE:(MRB_METHOD_PROC(m)?(MRB_PROC_CFUNC_P(MRB_METHOD_PROC(m))):FALSE))
132
+ #define MRB_METHOD_CFUNC(m) (MRB_METHOD_FUNC_P(m)?MRB_METHOD_FUNC(m):((MRB_METHOD_PROC(m)&&MRB_PROC_CFUNC_P(MRB_METHOD_PROC(m)))?MRB_PROC_CFUNC(MRB_METHOD_PROC(m)):NULL))
133
+
134
+
135
+ #include <mruby/khash.h>
136
+
137
+ MRB_API mrb_value mrb_load_proc(mrb_state *mrb, const struct RProc *proc);
138
+
139
+ static inline void
140
+ mrb_vm_ci_proc_set(mrb_callinfo *ci, const struct RProc *p)
141
+ {
142
+ ci->proc = p;
143
+ ci->pc = (p && !MRB_PROC_CFUNC_P(p)) ? p->body.irep->iseq : NULL;
144
+ }
145
+
146
+ static inline struct RClass *
147
+ mrb_vm_ci_target_class(const mrb_callinfo *ci)
148
+ {
149
+ if (ci->u.env && ci->u.env->tt == MRB_TT_ENV) {
150
+ return ci->u.env->c;
151
+ }
152
+ else {
153
+ return ci->u.target_class;
154
+ }
155
+ }
156
+
157
+ static inline void
158
+ mrb_vm_ci_target_class_set(mrb_callinfo *ci, struct RClass *tc)
159
+ {
160
+ struct REnv *e = ci->u.env;
161
+ if (e) {
162
+ if (e->tt == MRB_TT_ENV) {
163
+ e->c = tc;
164
+ }
165
+ else {
166
+ ci->u.target_class = tc;
167
+ }
168
+ }
169
+ }
170
+
171
+ static inline struct REnv *
172
+ mrb_vm_ci_env(const mrb_callinfo *ci)
173
+ {
174
+ if (ci->u.env && ci->u.env->tt == MRB_TT_ENV) {
175
+ return ci->u.env;
176
+ }
177
+ else {
178
+ return NULL;
179
+ }
180
+ }
181
+
182
+ static inline void
183
+ mrb_vm_ci_env_set(mrb_callinfo *ci, struct REnv *e)
184
+ {
185
+ if (ci->u.env) {
186
+ if (ci->u.env->tt == MRB_TT_ENV) {
187
+ if (e) {
188
+ e->c = ci->u.env->c;
189
+ ci->u.env = e;
190
+ }
191
+ else {
192
+ ci->u.target_class = ci->u.env->c;
193
+ }
194
+ }
195
+ else {
196
+ if (e) {
197
+ e->c = ci->u.target_class;
198
+ ci->u.env = e;
199
+ }
200
+ }
201
+ }
202
+ else {
203
+ ci->u.env = e;
204
+ }
205
+ }
206
+
207
+ MRB_END_DECL
208
+
209
+ #endif /* MRUBY_PROC_H */
@@ -0,0 +1,79 @@
1
+ /**
2
+ ** @file mruby/range.h - Range class
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_RANGE_H
8
+ #define MRUBY_RANGE_H
9
+
10
+ #include "common.h"
11
+
12
+ /**
13
+ * Range class
14
+ */
15
+ MRB_BEGIN_DECL
16
+
17
+ #if defined(MRB_NAN_BOXING) && defined(MRB_64BIT) || defined(MRB_WORD_BOXING)
18
+ # define MRB_RANGE_EMBED
19
+ #endif
20
+
21
+ #ifdef MRB_RANGE_EMBED
22
+ struct RRange {
23
+ MRB_OBJECT_HEADER;
24
+ mrb_value beg;
25
+ mrb_value end;
26
+ mrb_bool excl;
27
+ };
28
+ # define mrb_gc_free_range(mrb, p) ((void)0)
29
+ # define RANGE_BEG(p) ((p)->beg)
30
+ # define RANGE_END(p) ((p)->end)
31
+ #else
32
+ typedef struct mrb_range_edges {
33
+ mrb_value beg;
34
+ mrb_value end;
35
+ } mrb_range_edges;
36
+ struct RRange {
37
+ MRB_OBJECT_HEADER;
38
+ mrb_range_edges *edges;
39
+ mrb_bool excl;
40
+ };
41
+ # define mrb_gc_free_range(mrb, p) mrb_free(mrb, (p)->edges)
42
+ # define RANGE_BEG(p) ((p)->edges->beg)
43
+ # define RANGE_END(p) ((p)->edges->end)
44
+ #endif
45
+
46
+ #define mrb_range_beg(mrb, r) RANGE_BEG(mrb_range_ptr(mrb, r))
47
+ #define mrb_range_end(mrb, r) RANGE_END(mrb_range_ptr(mrb, r))
48
+ #define mrb_range_excl_p(mrb, r) RANGE_EXCL(mrb_range_ptr(mrb, r))
49
+ #define mrb_range_raw_ptr(r) ((struct RRange*)mrb_ptr(r))
50
+ #define mrb_range_value(p) mrb_obj_value((void*)(p))
51
+ #define RANGE_EXCL(p) ((p)->excl)
52
+
53
+ MRB_API struct RRange* mrb_range_ptr(mrb_state *mrb, mrb_value range);
54
+
55
+ /*
56
+ * Initializes a Range.
57
+ *
58
+ * If the third parameter is FALSE then it includes the last value in the range.
59
+ * If the third parameter is TRUE then it excludes the last value in the range.
60
+ *
61
+ * @param start the beginning value.
62
+ * @param end the ending value.
63
+ * @param exclude represents the inclusion or exclusion of the last value.
64
+ */
65
+ MRB_API mrb_value mrb_range_new(mrb_state *mrb, mrb_value start, mrb_value end, mrb_bool exclude);
66
+
67
+ enum mrb_range_beg_len {
68
+ MRB_RANGE_TYPE_MISMATCH = 0, /* (failure) not range */
69
+ MRB_RANGE_OK = 1, /* (success) range */
70
+ MRB_RANGE_OUT = 2 /* (failure) out of range */
71
+ };
72
+
73
+ MRB_API enum mrb_range_beg_len mrb_range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, mrb_int len, mrb_bool trunc);
74
+ mrb_value mrb_get_values_at(mrb_state *mrb, mrb_value obj, mrb_int olen, mrb_int argc, const mrb_value *argv, mrb_value (*func)(mrb_state*, mrb_value, mrb_int));
75
+ void mrb_gc_mark_range(mrb_state *mrb, struct RRange *r);
76
+
77
+ MRB_END_DECL
78
+
79
+ #endif /* MRUBY_RANGE_H */
@@ -0,0 +1,16 @@
1
+ /**
2
+ ** @file mruby/re.h - Regexp class
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_RE_H
8
+ #define MRUBY_RE_H
9
+
10
+ MRB_BEGIN_DECL
11
+
12
+ #define REGEXP_CLASS "Regexp"
13
+
14
+ MRB_END_DECL
15
+
16
+ #endif /* RE_H */