ruby2d 0.11.0 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (404) 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/libmruby.a +0 -0
  172. data/assets/wasm/template.html +64 -0
  173. data/assets/windows/glew/README.md +10 -0
  174. data/assets/windows/glew/glew.h +23686 -0
  175. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  176. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  177. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  178. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  179. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  180. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  181. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  182. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  183. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  184. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  185. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  186. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  187. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  188. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  189. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  190. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  191. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  192. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  193. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  194. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  195. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  196. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  197. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  198. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  199. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  200. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng16.a +0 -0
  201. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  202. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -0
  203. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  204. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  205. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  206. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  207. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  208. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  209. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  211. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  212. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  213. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  214. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  215. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  216. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  217. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  218. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  219. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  220. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  221. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  222. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  223. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  224. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  225. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  226. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  227. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  228. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  229. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  230. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  231. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  232. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  233. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  234. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  235. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  236. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  237. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  238. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  239. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  240. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  241. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  242. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  243. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  244. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  245. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  246. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  247. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  248. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  249. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  250. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  251. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  252. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  253. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  254. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  255. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  256. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  257. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  258. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  259. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  260. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  261. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  262. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  263. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  264. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  265. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  266. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  267. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  268. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  269. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  270. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  271. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  272. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  273. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  274. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  275. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  276. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  277. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  278. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  279. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  280. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  281. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  282. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  283. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  284. data/assets/{ios → xcode/ios}/main.c +0 -0
  285. 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
  286. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  287. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  288. 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
  289. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  290. 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
  291. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  292. 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
  293. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  294. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  295. 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
  296. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  297. 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
  298. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  299. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  300. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  301. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  302. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  303. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  304. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  305. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  306. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  307. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  308. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  309. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  310. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  311. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  312. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  313. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  314. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  315. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  316. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  317. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  318. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  319. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  320. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  321. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  322. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  323. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  324. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  325. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  326. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  327. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  328. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  329. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  330. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  331. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  332. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  333. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  334. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  335. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  336. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  337. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  338. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  339. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  340. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  341. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  342. data/bin/ruby2d +3 -4
  343. data/ext/ruby2d/extconf.rb +44 -25
  344. data/ext/ruby2d/gl.c +1 -1
  345. data/ext/ruby2d/gl3.c +0 -1
  346. data/ext/ruby2d/gles.c +137 -84
  347. data/ext/ruby2d/ruby2d.c +126 -32
  348. data/ext/ruby2d/ruby2d.h +53 -6
  349. data/ext/ruby2d/text.c +14 -1
  350. data/ext/ruby2d/window.c +253 -215
  351. data/lib/ruby2d/cli/build.rb +242 -59
  352. data/lib/ruby2d/cli/colorize.rb +5 -4
  353. data/lib/ruby2d/cli/platform.rb +17 -0
  354. data/lib/ruby2d/font.rb +7 -1
  355. data/lib/ruby2d/sprite.rb +7 -2
  356. data/lib/ruby2d/text.rb +1 -3
  357. data/lib/ruby2d/texture.rb +21 -21
  358. data/lib/ruby2d/tileset.rb +34 -33
  359. data/lib/ruby2d/version.rb +1 -1
  360. data/lib/ruby2d/vertices.rb +11 -6
  361. data/lib/ruby2d.rb +14 -20
  362. metadata +279 -151
  363. data/assets/README.md +0 -22
  364. data/assets/Rakefile +0 -85
  365. data/assets/macos/lib/libFLAC.a +0 -0
  366. data/assets/macos/lib/libSDL2.a +0 -0
  367. data/assets/macos/lib/libSDL2_image.a +0 -0
  368. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  369. data/assets/macos/lib/libfreetype.a +0 -0
  370. data/assets/macos/lib/libjpeg.a +0 -0
  371. data/assets/macos/lib/libpng16.a +0 -0
  372. data/assets/macos/lib/libtiff.a +0 -0
  373. data/assets/macos/lib/libvorbis.a +0 -0
  374. data/assets/macos/lib/libvorbisfile.a +0 -0
  375. data/assets/macos/lib/libwebp.a +0 -0
  376. data/assets/mingw/bin/SDL2.dll +0 -0
  377. data/assets/mingw/bin/SDL2_image.dll +0 -0
  378. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  379. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  380. data/assets/mingw/bin/glew32.dll +0 -0
  381. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  382. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  383. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  384. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  385. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  386. data/assets/mingw/bin/libogg-0.dll +0 -0
  387. data/assets/mingw/bin/libopus-0.dll +0 -0
  388. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  389. data/assets/mingw/bin/libpng16-16.dll +0 -0
  390. data/assets/mingw/bin/libtiff-5.dll +0 -0
  391. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  392. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  393. data/assets/mingw/bin/libwebp-7.dll +0 -0
  394. data/assets/mingw/bin/zlib1.dll +0 -0
  395. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  396. data/assets/mingw/lib/libSDL2_image.a +0 -0
  397. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  398. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  399. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  400. data/assets/mingw/lib/libSDL2_test.a +0 -0
  401. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  402. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  403. data/assets/mingw/lib/libSDL2main.a +0 -0
  404. data/assets/mingw/lib/libglew32.dll.a +0 -0
@@ -0,0 +1,400 @@
1
+ /**
2
+ ** @file mruby/value.h - mruby value definitions
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_VALUE_H
8
+ #define MRUBY_VALUE_H
9
+
10
+ #include "common.h"
11
+
12
+ /*
13
+ * MRuby Value definition functions and macros.
14
+ */
15
+ MRB_BEGIN_DECL
16
+
17
+ /**
18
+ * mruby Symbol.
19
+ * @class mrb_sym
20
+ *
21
+ * You can create an mrb_sym by simply using mrb_str_intern() or mrb_intern_cstr()
22
+ */
23
+ typedef uint32_t mrb_sym;
24
+
25
+ /**
26
+ * mruby Boolean.
27
+ * @class mrb_bool
28
+ *
29
+ *
30
+ * Used internally to represent boolean. Can be TRUE or FALSE.
31
+ * Not to be confused with Ruby's boolean classes, which can be
32
+ * obtained using mrb_false_value() and mrb_true_value()
33
+ */
34
+ typedef uint8_t mrb_bool;
35
+ struct mrb_state;
36
+
37
+ #if defined _MSC_VER && _MSC_VER < 1800
38
+ # define PRIo64 "llo"
39
+ # define PRId64 "lld"
40
+ # define PRIu64 "llu"
41
+ # define PRIx64 "llx"
42
+ # define PRIo16 "ho"
43
+ # define PRId16 "hd"
44
+ # define PRIu16 "hu"
45
+ # define PRIx16 "hx"
46
+ # define PRIo32 "o"
47
+ # define PRId32 "d"
48
+ # define PRIu32 "u"
49
+ # define PRIx32 "x"
50
+ #else
51
+ # include <inttypes.h>
52
+ #endif
53
+
54
+ #if defined(MRB_INT64)
55
+ typedef int64_t mrb_int;
56
+ typedef uint64_t mrb_uint;
57
+ # define MRB_INT_BIT 64
58
+ # define MRB_INT_MIN INT64_MIN
59
+ # define MRB_INT_MAX INT64_MAX
60
+ # define MRB_PRIo PRIo64
61
+ # define MRB_PRId PRId64
62
+ # define MRB_PRIx PRIx64
63
+ #else
64
+ typedef int32_t mrb_int;
65
+ typedef uint32_t mrb_uint;
66
+ # define MRB_INT_BIT 32
67
+ # define MRB_INT_MIN INT32_MIN
68
+ # define MRB_INT_MAX INT32_MAX
69
+ # define MRB_PRIo PRIo32
70
+ # define MRB_PRId PRId32
71
+ # define MRB_PRIx PRIx32
72
+ #endif
73
+
74
+ #ifdef MRB_ENDIAN_BIG
75
+ # define MRB_ENDIAN_LOHI(a,b) a b
76
+ #else
77
+ # define MRB_ENDIAN_LOHI(a,b) b a
78
+ #endif
79
+
80
+ #ifndef MRB_NO_FLOAT
81
+ MRB_API double mrb_float_read(const char*, char**);
82
+ #ifdef MRB_USE_FLOAT32
83
+ typedef float mrb_float;
84
+ #else
85
+ typedef double mrb_float;
86
+ #endif
87
+ #endif
88
+
89
+ #if defined _MSC_VER && _MSC_VER < 1900
90
+ # include <stdarg.h>
91
+ MRB_API int mrb_msvc_vsnprintf(char *s, size_t n, const char *format, va_list arg);
92
+ MRB_API int mrb_msvc_snprintf(char *s, size_t n, const char *format, ...);
93
+ # define vsnprintf(s, n, format, arg) mrb_msvc_vsnprintf(s, n, format, arg)
94
+ # define snprintf(s, n, format, ...) mrb_msvc_snprintf(s, n, format, __VA_ARGS__)
95
+ # if _MSC_VER < 1800 && !defined MRB_NO_FLOAT
96
+ # include <float.h>
97
+ # define isfinite(n) _finite(n)
98
+ # define isnan _isnan
99
+ # define isinf(n) (!_finite(n) && !_isnan(n))
100
+ # define signbit(n) (_copysign(1.0, (n)) < 0.0)
101
+ static const unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000;
102
+ # define INFINITY (*(float *)&IEEE754_INFINITY_BITS_SINGLE)
103
+ # define NAN ((float)(INFINITY - INFINITY))
104
+ # endif
105
+ #endif
106
+
107
+ enum mrb_vtype {
108
+ MRB_TT_FALSE = 0,
109
+ MRB_TT_TRUE,
110
+ MRB_TT_FLOAT,
111
+ MRB_TT_INTEGER,
112
+ MRB_TT_SYMBOL,
113
+ MRB_TT_UNDEF,
114
+ MRB_TT_CPTR,
115
+ MRB_TT_FREE,
116
+ MRB_TT_OBJECT,
117
+ MRB_TT_CLASS,
118
+ MRB_TT_MODULE,
119
+ MRB_TT_ICLASS,
120
+ MRB_TT_SCLASS,
121
+ MRB_TT_PROC,
122
+ MRB_TT_ARRAY,
123
+ MRB_TT_HASH,
124
+ MRB_TT_STRING,
125
+ MRB_TT_RANGE,
126
+ MRB_TT_EXCEPTION,
127
+ MRB_TT_ENV,
128
+ MRB_TT_DATA,
129
+ MRB_TT_FIBER,
130
+ MRB_TT_ISTRUCT,
131
+ MRB_TT_BREAK,
132
+ MRB_TT_MAXDEFINE
133
+ };
134
+
135
+ /* for compatibility */
136
+ #define MRB_TT_FIXNUM MRB_TT_INTEGER
137
+
138
+ #include <mruby/object.h>
139
+
140
+ #ifdef MRB_DOCUMENTATION_BLOCK
141
+
142
+ /**
143
+ * @abstract
144
+ * MRuby value boxing.
145
+ *
146
+ * Actual implementation depends on configured boxing type.
147
+ *
148
+ * @see mruby/boxing_no.h Default boxing representation
149
+ * @see mruby/boxing_word.h Word representation
150
+ * @see mruby/boxing_nan.h Boxed double representation
151
+ */
152
+ typedef void mrb_value;
153
+
154
+ #endif
155
+
156
+ #if defined(MRB_WORD_BOXING) || (defined(MRB_NAN_BOXING) && defined(MRB_64BIT))
157
+ struct RCptr {
158
+ MRB_OBJECT_HEADER;
159
+ void *p;
160
+ };
161
+ #endif
162
+
163
+ #if defined(MRB_NAN_BOXING)
164
+ #include "boxing_nan.h"
165
+ #elif defined(MRB_WORD_BOXING)
166
+ #include "boxing_word.h"
167
+ #else
168
+ #include "boxing_no.h"
169
+ #endif
170
+
171
+ #if INTPTR_MAX < MRB_INT_MAX
172
+ typedef intptr_t mrb_ssize;
173
+ # define MRB_SSIZE_MAX INTPTR_MAX
174
+ #else
175
+ typedef mrb_int mrb_ssize;
176
+ # define MRB_SSIZE_MAX MRB_INT_MAX
177
+ #endif
178
+
179
+ #ifndef mrb_immediate_p
180
+ #define mrb_immediate_p(o) (mrb_type(o) < MRB_TT_FREE)
181
+ #endif
182
+ #ifndef mrb_integer_p
183
+ #define mrb_integer_p(o) (mrb_type(o) == MRB_TT_INTEGER)
184
+ #endif
185
+ #ifndef mrb_fixnum_p
186
+ #define mrb_fixnum_p(o) mrb_integer_p(o)
187
+ #endif
188
+ #ifndef mrb_symbol_p
189
+ #define mrb_symbol_p(o) (mrb_type(o) == MRB_TT_SYMBOL)
190
+ #endif
191
+ #ifndef mrb_undef_p
192
+ #define mrb_undef_p(o) (mrb_type(o) == MRB_TT_UNDEF)
193
+ #endif
194
+ #ifndef mrb_nil_p
195
+ #define mrb_nil_p(o) (mrb_type(o) == MRB_TT_FALSE && !mrb_fixnum(o))
196
+ #endif
197
+ #ifndef mrb_false_p
198
+ #define mrb_false_p(o) (mrb_type(o) == MRB_TT_FALSE && !!mrb_fixnum(o))
199
+ #endif
200
+ #ifndef mrb_true_p
201
+ #define mrb_true_p(o) (mrb_type(o) == MRB_TT_TRUE)
202
+ #endif
203
+ #ifndef MRB_NO_FLOAT
204
+ #ifndef mrb_float_p
205
+ #define mrb_float_p(o) (mrb_type(o) == MRB_TT_FLOAT)
206
+ #endif
207
+ #endif
208
+ #ifndef mrb_array_p
209
+ #define mrb_array_p(o) (mrb_type(o) == MRB_TT_ARRAY)
210
+ #endif
211
+ #ifndef mrb_string_p
212
+ #define mrb_string_p(o) (mrb_type(o) == MRB_TT_STRING)
213
+ #endif
214
+ #ifndef mrb_hash_p
215
+ #define mrb_hash_p(o) (mrb_type(o) == MRB_TT_HASH)
216
+ #endif
217
+ #ifndef mrb_cptr_p
218
+ #define mrb_cptr_p(o) (mrb_type(o) == MRB_TT_CPTR)
219
+ #endif
220
+ #ifndef mrb_exception_p
221
+ #define mrb_exception_p(o) (mrb_type(o) == MRB_TT_EXCEPTION)
222
+ #endif
223
+ #ifndef mrb_free_p
224
+ #define mrb_free_p(o) (mrb_type(o) == MRB_TT_FREE)
225
+ #endif
226
+ #ifndef mrb_object_p
227
+ #define mrb_object_p(o) (mrb_type(o) == MRB_TT_OBJECT)
228
+ #endif
229
+ #ifndef mrb_class_p
230
+ #define mrb_class_p(o) (mrb_type(o) == MRB_TT_CLASS)
231
+ #endif
232
+ #ifndef mrb_module_p
233
+ #define mrb_module_p(o) (mrb_type(o) == MRB_TT_MODULE)
234
+ #endif
235
+ #ifndef mrb_iclass_p
236
+ #define mrb_iclass_p(o) (mrb_type(o) == MRB_TT_ICLASS)
237
+ #endif
238
+ #ifndef mrb_sclass_p
239
+ #define mrb_sclass_p(o) (mrb_type(o) == MRB_TT_SCLASS)
240
+ #endif
241
+ #ifndef mrb_proc_p
242
+ #define mrb_proc_p(o) (mrb_type(o) == MRB_TT_PROC)
243
+ #endif
244
+ #ifndef mrb_range_p
245
+ #define mrb_range_p(o) (mrb_type(o) == MRB_TT_RANGE)
246
+ #endif
247
+ #ifndef mrb_env_p
248
+ #define mrb_env_p(o) (mrb_type(o) == MRB_TT_ENV)
249
+ #endif
250
+ #ifndef mrb_data_p
251
+ #define mrb_data_p(o) (mrb_type(o) == MRB_TT_DATA)
252
+ #endif
253
+ #ifndef mrb_fiber_p
254
+ #define mrb_fiber_p(o) (mrb_type(o) == MRB_TT_FIBER)
255
+ #endif
256
+ #ifndef mrb_istruct_p
257
+ #define mrb_istruct_p(o) (mrb_type(o) == MRB_TT_ISTRUCT)
258
+ #endif
259
+ #ifndef mrb_break_p
260
+ #define mrb_break_p(o) (mrb_type(o) == MRB_TT_BREAK)
261
+ #endif
262
+ #ifndef mrb_bool
263
+ #define mrb_bool(o) (mrb_type(o) != MRB_TT_FALSE)
264
+ #endif
265
+ #define mrb_test(o) mrb_bool(o)
266
+
267
+ /**
268
+ * Returns a float in Ruby.
269
+ *
270
+ * Takes a float and boxes it into an mrb_value
271
+ */
272
+ #ifndef MRB_NO_FLOAT
273
+ MRB_INLINE mrb_value mrb_float_value(struct mrb_state *mrb, mrb_float f)
274
+ {
275
+ mrb_value v;
276
+ (void) mrb;
277
+ SET_FLOAT_VALUE(mrb, v, f);
278
+ return v;
279
+ }
280
+ #endif
281
+
282
+ MRB_INLINE mrb_value
283
+ mrb_cptr_value(struct mrb_state *mrb, void *p)
284
+ {
285
+ mrb_value v;
286
+ (void) mrb;
287
+ SET_CPTR_VALUE(mrb,v,p);
288
+ return v;
289
+ }
290
+
291
+ /**
292
+ * Returns an integer in Ruby.
293
+ */
294
+ MRB_INLINE mrb_value mrb_int_value(struct mrb_state *mrb, mrb_int i)
295
+ {
296
+ mrb_value v;
297
+ SET_INT_VALUE(mrb, v, i);
298
+ return v;
299
+ }
300
+
301
+ MRB_INLINE mrb_value mrb_fixnum_value(mrb_int i)
302
+ {
303
+ mrb_value v;
304
+ SET_FIXNUM_VALUE(v, i);
305
+ return v;
306
+ }
307
+
308
+ MRB_INLINE mrb_value
309
+ mrb_symbol_value(mrb_sym i)
310
+ {
311
+ mrb_value v;
312
+ SET_SYM_VALUE(v, i);
313
+ return v;
314
+ }
315
+
316
+ MRB_INLINE mrb_value
317
+ mrb_obj_value(void *p)
318
+ {
319
+ mrb_value v;
320
+ SET_OBJ_VALUE(v, (struct RBasic*)p);
321
+ mrb_assert(p == mrb_ptr(v));
322
+ mrb_assert(((struct RBasic*)p)->tt == mrb_type(v));
323
+ return v;
324
+ }
325
+
326
+ /**
327
+ * Get a nil mrb_value object.
328
+ *
329
+ * @return
330
+ * nil mrb_value object reference.
331
+ */
332
+ MRB_INLINE mrb_value mrb_nil_value(void)
333
+ {
334
+ mrb_value v;
335
+ SET_NIL_VALUE(v);
336
+ return v;
337
+ }
338
+
339
+ /**
340
+ * Returns false in Ruby.
341
+ */
342
+ MRB_INLINE mrb_value mrb_false_value(void)
343
+ {
344
+ mrb_value v;
345
+ SET_FALSE_VALUE(v);
346
+ return v;
347
+ }
348
+
349
+ /**
350
+ * Returns true in Ruby.
351
+ */
352
+ MRB_INLINE mrb_value mrb_true_value(void)
353
+ {
354
+ mrb_value v;
355
+ SET_TRUE_VALUE(v);
356
+ return v;
357
+ }
358
+
359
+ MRB_INLINE mrb_value
360
+ mrb_bool_value(mrb_bool boolean)
361
+ {
362
+ mrb_value v;
363
+ SET_BOOL_VALUE(v, boolean);
364
+ return v;
365
+ }
366
+
367
+ MRB_INLINE mrb_value
368
+ mrb_undef_value(void)
369
+ {
370
+ mrb_value v;
371
+ SET_UNDEF_VALUE(v);
372
+ return v;
373
+ }
374
+
375
+ #if defined(MRB_USE_ETEXT_EDATA) && !defined(MRB_USE_LINK_TIME_RO_DATA_P)
376
+ # ifdef __GNUC__
377
+ # warning MRB_USE_ETEXT_EDATA is deprecated. Define MRB_USE_LINK_TIME_RO_DATA_P instead.
378
+ # endif
379
+ # define MRB_USE_LINK_TIME_RO_DATA_P
380
+ #endif
381
+
382
+ #if defined(MRB_USE_CUSTOM_RO_DATA_P)
383
+ /* If you define `MRB_USE_CUSTOM_RO_DATA_P`, you must implement `mrb_ro_data_p()`. */
384
+ mrb_bool mrb_ro_data_p(const char *p);
385
+ #elif defined(MRB_USE_LINK_TIME_RO_DATA_P)
386
+ extern char __ehdr_start[];
387
+ extern char __init_array_start[];
388
+
389
+ static inline mrb_bool
390
+ mrb_ro_data_p(const char *p)
391
+ {
392
+ return __ehdr_start < p && p < __init_array_start;
393
+ }
394
+ #else
395
+ # define mrb_ro_data_p(p) FALSE
396
+ #endif
397
+
398
+ MRB_END_DECL
399
+
400
+ #endif /* MRUBY_VALUE_H */
@@ -0,0 +1,140 @@
1
+ /**
2
+ ** @file mruby/variable.h - mruby variables
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_VARIABLE_H
8
+ #define MRUBY_VARIABLE_H
9
+
10
+ #include "common.h"
11
+
12
+ /**
13
+ * Functions to access mruby variables.
14
+ */
15
+ MRB_BEGIN_DECL
16
+
17
+ typedef struct global_variable {
18
+ int counter;
19
+ mrb_value *data;
20
+ mrb_value (*getter)(void);
21
+ void (*setter)(void);
22
+ /* void (*marker)(); */
23
+ /* int block_trace; */
24
+ /* struct trace_var *trace; */
25
+ } global_variable;
26
+
27
+ struct global_entry {
28
+ global_variable *var;
29
+ mrb_sym id;
30
+ };
31
+
32
+ mrb_value mrb_vm_special_get(mrb_state*, mrb_sym);
33
+ void mrb_vm_special_set(mrb_state*, mrb_sym, mrb_value);
34
+ mrb_value mrb_vm_cv_get(mrb_state*, mrb_sym);
35
+ void mrb_vm_cv_set(mrb_state*, mrb_sym, mrb_value);
36
+ mrb_value mrb_vm_const_get(mrb_state*, mrb_sym);
37
+ void mrb_vm_const_set(mrb_state*, mrb_sym, mrb_value);
38
+ size_t mrb_obj_iv_tbl_memsize(mrb_value);
39
+ MRB_API mrb_value mrb_const_get(mrb_state*, mrb_value, mrb_sym);
40
+ MRB_API void mrb_const_set(mrb_state*, mrb_value, mrb_sym, mrb_value);
41
+ MRB_API mrb_bool mrb_const_defined(mrb_state*, mrb_value, mrb_sym);
42
+ MRB_API void mrb_const_remove(mrb_state*, mrb_value, mrb_sym);
43
+
44
+ MRB_API mrb_bool mrb_iv_name_sym_p(mrb_state *mrb, mrb_sym sym);
45
+ MRB_API void mrb_iv_name_sym_check(mrb_state *mrb, mrb_sym sym);
46
+ MRB_API mrb_value mrb_obj_iv_get(mrb_state *mrb, struct RObject *obj, mrb_sym sym);
47
+ MRB_API void mrb_obj_iv_set(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v);
48
+ MRB_API mrb_bool mrb_obj_iv_defined(mrb_state *mrb, struct RObject *obj, mrb_sym sym);
49
+ MRB_API mrb_value mrb_iv_get(mrb_state *mrb, mrb_value obj, mrb_sym sym);
50
+ MRB_API void mrb_iv_set(mrb_state *mrb, mrb_value obj, mrb_sym sym, mrb_value v);
51
+ MRB_API mrb_bool mrb_iv_defined(mrb_state*, mrb_value, mrb_sym);
52
+ MRB_API mrb_value mrb_iv_remove(mrb_state *mrb, mrb_value obj, mrb_sym sym);
53
+ MRB_API void mrb_iv_copy(mrb_state *mrb, mrb_value dst, mrb_value src);
54
+ MRB_API mrb_bool mrb_const_defined_at(mrb_state *mrb, mrb_value mod, mrb_sym id);
55
+
56
+ /**
57
+ * Get a global variable. Will return nil if the var does not exist
58
+ *
59
+ * Example:
60
+ *
61
+ * !!!ruby
62
+ * # Ruby style
63
+ * var = $value
64
+ *
65
+ * !!!c
66
+ * // C style
67
+ * mrb_sym sym = mrb_intern_lit(mrb, "$value");
68
+ * mrb_value var = mrb_gv_get(mrb, sym);
69
+ *
70
+ * @param mrb The mruby state reference
71
+ * @param sym The name of the global variable
72
+ * @return The value of that global variable. May be nil
73
+ */
74
+ MRB_API mrb_value mrb_gv_get(mrb_state *mrb, mrb_sym sym);
75
+
76
+ /**
77
+ * Set a global variable
78
+ *
79
+ * Example:
80
+ *
81
+ * !!!ruby
82
+ * # Ruby style
83
+ * $value = "foo"
84
+ *
85
+ * !!!c
86
+ * // C style
87
+ * mrb_sym sym = mrb_intern_lit(mrb, "$value");
88
+ * mrb_gv_set(mrb, sym, mrb_str_new_lit("foo"));
89
+ *
90
+ * @param mrb The mruby state reference
91
+ * @param sym The name of the global variable
92
+ * @param val The value of the global variable
93
+ */
94
+ MRB_API void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val);
95
+
96
+ /**
97
+ * Remove a global variable.
98
+ *
99
+ * Example:
100
+ *
101
+ * # Ruby style
102
+ * $value = nil
103
+ *
104
+ * // C style
105
+ * mrb_sym sym = mrb_intern_lit(mrb, "$value");
106
+ * mrb_gv_remove(mrb, sym);
107
+ *
108
+ * @param mrb The mruby state reference
109
+ * @param sym The name of the global variable
110
+ */
111
+ MRB_API void mrb_gv_remove(mrb_state *mrb, mrb_sym sym);
112
+
113
+ MRB_API mrb_value mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym);
114
+ MRB_API void mrb_mod_cv_set(mrb_state *mrb, struct RClass * c, mrb_sym sym, mrb_value v);
115
+ MRB_API void mrb_cv_set(mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v);
116
+ MRB_API mrb_bool mrb_cv_defined(mrb_state *mrb, mrb_value mod, mrb_sym sym);
117
+ mrb_value mrb_obj_iv_inspect(mrb_state*, struct RObject*);
118
+ void mrb_obj_iv_set_force(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v);
119
+ mrb_value mrb_mod_constants(mrb_state *mrb, mrb_value mod);
120
+ mrb_value mrb_f_global_variables(mrb_state *mrb, mrb_value self);
121
+ mrb_value mrb_obj_instance_variables(mrb_state*, mrb_value);
122
+ mrb_value mrb_mod_class_variables(mrb_state*, mrb_value);
123
+ mrb_value mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym);
124
+ mrb_bool mrb_mod_cv_defined(mrb_state *mrb, struct RClass * c, mrb_sym sym);
125
+ mrb_bool mrb_ident_p(const char *s, mrb_int len);
126
+
127
+ /* GC functions */
128
+ void mrb_gc_mark_gv(mrb_state*);
129
+ void mrb_gc_free_gv(mrb_state*);
130
+ void mrb_gc_mark_iv(mrb_state*, struct RObject*);
131
+ size_t mrb_gc_mark_iv_size(mrb_state*, struct RObject*);
132
+ void mrb_gc_free_iv(mrb_state*, struct RObject*);
133
+
134
+ /* return non zero to break the loop */
135
+ typedef int (mrb_iv_foreach_func)(mrb_state*,mrb_sym,mrb_value,void*);
136
+ MRB_API void mrb_iv_foreach(mrb_state *mrb, mrb_value obj, mrb_iv_foreach_func *func, void *p);
137
+
138
+ MRB_END_DECL
139
+
140
+ #endif /* MRUBY_VARIABLE_H */
@@ -0,0 +1,143 @@
1
+ /**
2
+ ** @file mruby/version.h - mruby version definition
3
+ **
4
+ ** See Copyright Notice in mruby.h
5
+ */
6
+
7
+ #ifndef MRUBY_VERSION_H
8
+ #define MRUBY_VERSION_H
9
+
10
+ #include "common.h"
11
+
12
+ /**
13
+ * mruby version definition macros
14
+ */
15
+ MRB_BEGIN_DECL
16
+
17
+ /*
18
+ * A passed in expression.
19
+ */
20
+ #define MRB_STRINGIZE0(expr) #expr
21
+
22
+ /*
23
+ * Passes in an expression to MRB_STRINGIZE0.
24
+ */
25
+ #define MRB_STRINGIZE(expr) MRB_STRINGIZE0(expr)
26
+
27
+ /*
28
+ * The version of Ruby used by mruby.
29
+ */
30
+ #define MRUBY_RUBY_VERSION "3.0"
31
+
32
+ /*
33
+ * Ruby engine.
34
+ */
35
+ #define MRUBY_RUBY_ENGINE "mruby"
36
+
37
+ /*
38
+ * Major release version number.
39
+ */
40
+ #define MRUBY_RELEASE_MAJOR 3
41
+
42
+ /*
43
+ * Minor release version number.
44
+ */
45
+ #define MRUBY_RELEASE_MINOR 0
46
+
47
+ /*
48
+ * Tiny release version number.
49
+ */
50
+ #define MRUBY_RELEASE_TEENY 0
51
+
52
+ /*
53
+ * Patch level.
54
+ */
55
+ #define MRUBY_PATCHLEVEL -1
56
+
57
+ /*
58
+ * Patch level string. (optional)
59
+ */
60
+ #define MRUBY_PATCHLEVEL_STR ""
61
+
62
+ #ifndef MRUBY_PATCHLEVEL_STR
63
+ # if MRUBY_PATCHLEVEL < 0
64
+ # define MRUBY_PATCHLEVEL_STR "dev"
65
+ # else
66
+ # define MRUBY_PATCHLEVEL_STR "p"MRB_STRINGIZE(MRUBY_PATCHLEVEL)
67
+ # endif
68
+ #endif
69
+
70
+ /*
71
+ * The mruby version.
72
+ */
73
+ #define MRUBY_VERSION MRB_STRINGIZE(MRUBY_RELEASE_MAJOR) "." MRB_STRINGIZE(MRUBY_RELEASE_MINOR) "." MRB_STRINGIZE(MRUBY_RELEASE_TEENY)
74
+
75
+ /*
76
+ * Release number.
77
+ */
78
+ #define MRUBY_RELEASE_NO (MRUBY_RELEASE_MAJOR * 100 * 100 + MRUBY_RELEASE_MINOR * 100 + MRUBY_RELEASE_TEENY)
79
+
80
+ /*
81
+ * Release year.
82
+ */
83
+ #define MRUBY_RELEASE_YEAR 2021
84
+
85
+ /*
86
+ * Release month.
87
+ */
88
+ #define MRUBY_RELEASE_MONTH 3
89
+
90
+ /*
91
+ * Release day.
92
+ */
93
+ #define MRUBY_RELEASE_DAY 5
94
+
95
+ /*
96
+ * Release date as a string.
97
+ */
98
+ #define MRUBY_RELEASE_DATE \
99
+ MRUBY_RELEASE_YEAR_STR "-" \
100
+ MRUBY_RELEASE_MONTH_STR "-" \
101
+ MRUBY_RELEASE_DAY_STR
102
+ #define MRUBY_RELEASE_YEAR_STR MRB_STRINGIZE(MRUBY_RELEASE_YEAR)
103
+ #if MRUBY_RELEASE_MONTH < 10
104
+ #define MRUBY_RELEASE_MONTH_STR "0" MRB_STRINGIZE(MRUBY_RELEASE_MONTH)
105
+ #else
106
+ #define MRUBY_RELEASE_MONTH_STR MRB_STRINGIZE(MRUBY_RELEASE_MONTH)
107
+ #endif
108
+ #if MRUBY_RELEASE_DAY < 10
109
+ #define MRUBY_RELEASE_DAY_STR "0" MRB_STRINGIZE(MRUBY_RELEASE_DAY)
110
+ #else
111
+ #define MRUBY_RELEASE_DAY_STR MRB_STRINGIZE(MRUBY_RELEASE_DAY)
112
+ #endif
113
+
114
+ /*
115
+ * The year mruby was first created.
116
+ */
117
+ #define MRUBY_BIRTH_YEAR 2010
118
+
119
+ /*
120
+ * MRuby's authors.
121
+ */
122
+ #define MRUBY_AUTHOR "mruby developers"
123
+
124
+ /*
125
+ * mruby's version, and release date.
126
+ */
127
+ #define MRUBY_DESCRIPTION \
128
+ "mruby " MRUBY_VERSION \
129
+ MRUBY_PATCHLEVEL_STR \
130
+ " (" MRUBY_RELEASE_DATE ")" \
131
+
132
+ /*
133
+ * mruby's copyright information.
134
+ */
135
+ #define MRUBY_COPYRIGHT \
136
+ "mruby - Copyright (c) " \
137
+ MRB_STRINGIZE(MRUBY_BIRTH_YEAR)"-" \
138
+ MRB_STRINGIZE(MRUBY_RELEASE_YEAR)" " \
139
+ MRUBY_AUTHOR \
140
+
141
+ MRB_END_DECL
142
+
143
+ #endif /* MRUBY_VERSION_H */