ruby2d 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/assets/README.md +20 -7
  3. data/assets/include/SDL2/SDL.h +135 -0
  4. data/assets/include/SDL2/SDL_assert.h +291 -0
  5. data/assets/include/SDL2/SDL_atomic.h +277 -0
  6. data/assets/include/SDL2/SDL_audio.h +826 -0
  7. data/assets/include/SDL2/SDL_bits.h +112 -0
  8. data/assets/include/SDL2/SDL_blendmode.h +120 -0
  9. data/assets/include/SDL2/SDL_clipboard.h +71 -0
  10. data/assets/include/SDL2/SDL_config.h +421 -0
  11. data/assets/include/SDL2/SDL_cpuinfo.h +188 -0
  12. data/assets/include/SDL2/SDL_egl.h +1673 -0
  13. data/assets/include/SDL2/SDL_endian.h +260 -0
  14. data/assets/include/SDL2/SDL_error.h +76 -0
  15. data/assets/include/SDL2/SDL_events.h +788 -0
  16. data/assets/include/SDL2/SDL_filesystem.h +136 -0
  17. data/assets/include/SDL2/SDL_gamecontroller.h +390 -0
  18. data/assets/include/SDL2/SDL_gesture.h +87 -0
  19. data/assets/include/SDL2/SDL_haptic.h +1238 -0
  20. data/assets/include/SDL2/SDL_hints.h +1135 -0
  21. data/assets/include/SDL2/SDL_image.h +161 -0
  22. data/assets/include/SDL2/SDL_joystick.h +408 -0
  23. data/assets/include/SDL2/SDL_keyboard.h +217 -0
  24. data/assets/include/SDL2/SDL_keycode.h +349 -0
  25. data/assets/include/SDL2/SDL_loadso.h +81 -0
  26. data/assets/include/SDL2/SDL_log.h +211 -0
  27. data/assets/include/SDL2/SDL_main.h +168 -0
  28. data/assets/include/SDL2/SDL_messagebox.h +144 -0
  29. data/assets/include/SDL2/SDL_mixer.h +651 -0
  30. data/assets/include/SDL2/SDL_mouse.h +302 -0
  31. data/assets/include/SDL2/SDL_mutex.h +251 -0
  32. data/assets/include/SDL2/SDL_name.h +33 -0
  33. data/assets/include/SDL2/SDL_opengl.h +2183 -0
  34. data/assets/include/SDL2/SDL_opengl_glext.h +11177 -0
  35. data/assets/include/SDL2/SDL_opengles.h +39 -0
  36. data/assets/include/SDL2/SDL_opengles2.h +52 -0
  37. data/assets/include/SDL2/SDL_opengles2_gl2.h +621 -0
  38. data/assets/include/SDL2/SDL_opengles2_gl2ext.h +2050 -0
  39. data/assets/include/SDL2/SDL_opengles2_gl2platform.h +30 -0
  40. data/assets/include/SDL2/SDL_opengles2_khrplatform.h +282 -0
  41. data/assets/include/SDL2/SDL_pixels.h +470 -0
  42. data/assets/include/SDL2/SDL_platform.h +198 -0
  43. data/assets/include/SDL2/SDL_power.h +75 -0
  44. data/assets/include/SDL2/SDL_quit.h +58 -0
  45. data/assets/include/SDL2/SDL_rect.h +148 -0
  46. data/assets/include/SDL2/SDL_render.h +931 -0
  47. data/assets/include/SDL2/SDL_revision.h +2 -0
  48. data/assets/include/SDL2/SDL_rwops.h +254 -0
  49. data/assets/include/SDL2/SDL_scancode.h +413 -0
  50. data/assets/include/SDL2/SDL_sensor.h +251 -0
  51. data/assets/include/SDL2/SDL_shape.h +144 -0
  52. data/assets/include/SDL2/SDL_stdinc.h +607 -0
  53. data/assets/include/SDL2/SDL_surface.h +553 -0
  54. data/assets/include/SDL2/SDL_system.h +279 -0
  55. data/assets/include/SDL2/SDL_syswm.h +324 -0
  56. data/assets/include/SDL2/SDL_test.h +69 -0
  57. data/assets/include/SDL2/SDL_test_assert.h +105 -0
  58. data/assets/include/SDL2/SDL_test_common.h +188 -0
  59. data/assets/include/SDL2/SDL_test_compare.h +69 -0
  60. data/assets/include/SDL2/SDL_test_crc32.h +124 -0
  61. data/assets/include/SDL2/SDL_test_font.h +81 -0
  62. data/assets/include/SDL2/SDL_test_fuzzer.h +384 -0
  63. data/assets/include/SDL2/SDL_test_harness.h +134 -0
  64. data/assets/include/SDL2/SDL_test_images.h +78 -0
  65. data/assets/include/SDL2/SDL_test_log.h +67 -0
  66. data/assets/include/SDL2/SDL_test_md5.h +129 -0
  67. data/assets/include/SDL2/SDL_test_memory.h +63 -0
  68. data/assets/include/SDL2/SDL_test_random.h +115 -0
  69. data/assets/include/SDL2/SDL_thread.h +343 -0
  70. data/assets/include/SDL2/SDL_timer.h +115 -0
  71. data/assets/include/SDL2/SDL_touch.h +86 -0
  72. data/assets/include/SDL2/SDL_ttf.h +294 -0
  73. data/assets/include/SDL2/SDL_types.h +29 -0
  74. data/assets/include/SDL2/SDL_version.h +162 -0
  75. data/assets/include/SDL2/SDL_video.h +1276 -0
  76. data/assets/include/SDL2/SDL_vulkan.h +278 -0
  77. data/assets/include/SDL2/begin_code.h +167 -0
  78. data/assets/include/SDL2/close_code.h +37 -0
  79. data/assets/include/glew.h +23686 -0
  80. data/assets/include/simple2d.h +735 -0
  81. data/assets/ios/MRuby.framework/Headers/mrbconf.h +3 -5
  82. data/assets/ios/MRuby.framework/Headers/mruby.h +35 -32
  83. data/assets/ios/MRuby.framework/Headers/mruby/array.h +1 -0
  84. data/assets/ios/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
  85. data/assets/ios/MRuby.framework/Headers/mruby/class.h +14 -11
  86. data/assets/ios/MRuby.framework/Headers/mruby/common.h +5 -0
  87. data/assets/ios/MRuby.framework/Headers/mruby/compile.h +4 -3
  88. data/assets/ios/MRuby.framework/Headers/mruby/debug.h +3 -2
  89. data/assets/ios/MRuby.framework/Headers/mruby/dump.h +2 -2
  90. data/assets/ios/MRuby.framework/Headers/mruby/hash.h +38 -5
  91. data/assets/ios/MRuby.framework/Headers/mruby/irep.h +17 -4
  92. data/assets/ios/MRuby.framework/Headers/mruby/object.h +4 -5
  93. data/assets/ios/MRuby.framework/Headers/mruby/opcode.h +47 -139
  94. data/assets/ios/MRuby.framework/Headers/mruby/ops.h +117 -0
  95. data/assets/ios/MRuby.framework/Headers/mruby/proc.h +4 -4
  96. data/assets/ios/MRuby.framework/Headers/mruby/string.h +11 -7
  97. data/assets/ios/MRuby.framework/Headers/mruby/throw.h +4 -4
  98. data/assets/ios/MRuby.framework/Headers/mruby/variable.h +2 -4
  99. data/assets/ios/MRuby.framework/Headers/mruby/version.h +6 -6
  100. data/assets/ios/MRuby.framework/MRuby +0 -0
  101. data/assets/ios/MyApp.xcodeproj/project.pbxproj +24 -18
  102. data/assets/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  103. data/assets/ios/main.c +1 -1
  104. data/assets/macos/lib/libFLAC.a +0 -0
  105. data/assets/macos/lib/libSDL2.a +0 -0
  106. data/assets/macos/lib/libSDL2_image.a +0 -0
  107. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  108. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  109. data/assets/macos/lib/libfreetype.a +0 -0
  110. data/assets/macos/lib/libjpeg.a +0 -0
  111. data/assets/macos/lib/libmpg123.a +0 -0
  112. data/assets/macos/lib/libogg.a +0 -0
  113. data/assets/macos/lib/libpng16.a +0 -0
  114. data/assets/macos/lib/libsimple2d.a +0 -0
  115. data/assets/macos/lib/libtiff.a +0 -0
  116. data/assets/macos/lib/libvorbis.a +0 -0
  117. data/assets/macos/lib/libvorbisfile.a +0 -0
  118. data/assets/macos/lib/libwebp.a +0 -0
  119. data/assets/mingw/bin/SDL2.dll +0 -0
  120. data/assets/mingw/bin/SDL2_image.dll +0 -0
  121. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  122. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  123. data/assets/mingw/bin/glew32.dll +0 -0
  124. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  125. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  126. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  127. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  128. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  129. data/assets/mingw/bin/libogg-0.dll +0 -0
  130. data/assets/mingw/bin/libopus-0.dll +0 -0
  131. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  132. data/assets/mingw/bin/libpng16-16.dll +0 -0
  133. data/assets/mingw/bin/libtiff-5.dll +0 -0
  134. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  135. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  136. data/assets/mingw/bin/libwebp-7.dll +0 -0
  137. data/assets/mingw/bin/zlib1.dll +0 -0
  138. data/assets/mingw/lib/libSDL2.a +0 -0
  139. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  140. data/assets/mingw/lib/libSDL2_image.a +0 -0
  141. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  142. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  143. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  144. data/assets/mingw/lib/libSDL2_test.a +0 -0
  145. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  146. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  147. data/assets/mingw/lib/libSDL2main.a +0 -0
  148. data/assets/mingw/lib/libglew32.a +0 -0
  149. data/assets/mingw/lib/libglew32.dll.a +0 -0
  150. data/assets/mingw/lib/libsimple2d.a +0 -0
  151. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
  152. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
  153. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
  154. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
  155. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
  156. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
  157. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +4 -0
  158. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +4 -0
  159. data/assets/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +7 -0
  160. data/assets/tvos/MRuby.framework/Headers/mrbconf.h +3 -5
  161. data/assets/tvos/MRuby.framework/Headers/mruby.h +35 -32
  162. data/assets/tvos/MRuby.framework/Headers/mruby/array.h +1 -0
  163. data/assets/tvos/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
  164. data/assets/tvos/MRuby.framework/Headers/mruby/class.h +14 -11
  165. data/assets/tvos/MRuby.framework/Headers/mruby/common.h +5 -0
  166. data/assets/tvos/MRuby.framework/Headers/mruby/compile.h +4 -3
  167. data/assets/tvos/MRuby.framework/Headers/mruby/debug.h +3 -2
  168. data/assets/tvos/MRuby.framework/Headers/mruby/dump.h +2 -2
  169. data/assets/tvos/MRuby.framework/Headers/mruby/hash.h +38 -5
  170. data/assets/tvos/MRuby.framework/Headers/mruby/irep.h +17 -4
  171. data/assets/tvos/MRuby.framework/Headers/mruby/object.h +4 -5
  172. data/assets/tvos/MRuby.framework/Headers/mruby/opcode.h +47 -139
  173. data/assets/tvos/MRuby.framework/Headers/mruby/ops.h +117 -0
  174. data/assets/tvos/MRuby.framework/Headers/mruby/proc.h +4 -4
  175. data/assets/tvos/MRuby.framework/Headers/mruby/string.h +11 -7
  176. data/assets/tvos/MRuby.framework/Headers/mruby/throw.h +4 -4
  177. data/assets/tvos/MRuby.framework/Headers/mruby/variable.h +2 -4
  178. data/assets/tvos/MRuby.framework/Headers/mruby/version.h +6 -6
  179. data/assets/tvos/MRuby.framework/MRuby +0 -0
  180. data/assets/tvos/MyApp.xcodeproj/project.pbxproj +25 -19
  181. data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  182. data/assets/tvos/main.c +1 -1
  183. data/ext/ruby2d/extconf.rb +59 -50
  184. data/ext/ruby2d/ruby2d.c +0 -1
  185. data/lib/ruby2d.rb +1 -7
  186. data/lib/ruby2d/cli/launch.rb +1 -1
  187. data/lib/ruby2d/font.rb +32 -7
  188. data/lib/ruby2d/version.rb +1 -1
  189. metadata +132 -6
  190. data/assets/opal.js +0 -21637
  191. data/assets/simple2d.js +0 -1379
  192. data/assets/template.html +0 -18
@@ -0,0 +1,2 @@
1
+ #define SDL_REVISION "hg-12373:8feb5da6f2fb"
2
+ #define SDL_REVISION_NUMBER 12373
@@ -0,0 +1,254 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * \file SDL_rwops.h
24
+ *
25
+ * This file provides a general interface for SDL to read and write
26
+ * data streams. It can easily be extended to files, memory, etc.
27
+ */
28
+
29
+ #ifndef SDL_rwops_h_
30
+ #define SDL_rwops_h_
31
+
32
+ #include "SDL_stdinc.h"
33
+ #include "SDL_error.h"
34
+
35
+ #include "begin_code.h"
36
+ /* Set up for C function definitions, even when using C++ */
37
+ #ifdef __cplusplus
38
+ extern "C" {
39
+ #endif
40
+
41
+ /* RWops Types */
42
+ #define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
43
+ #define SDL_RWOPS_WINFILE 1U /**< Win32 file */
44
+ #define SDL_RWOPS_STDFILE 2U /**< Stdio file */
45
+ #define SDL_RWOPS_JNIFILE 3U /**< Android asset */
46
+ #define SDL_RWOPS_MEMORY 4U /**< Memory stream */
47
+ #define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
48
+
49
+ /**
50
+ * This is the read/write operation structure -- very basic.
51
+ */
52
+ typedef struct SDL_RWops
53
+ {
54
+ /**
55
+ * Return the size of the file in this rwops, or -1 if unknown
56
+ */
57
+ Sint64 (SDLCALL * size) (struct SDL_RWops * context);
58
+
59
+ /**
60
+ * Seek to \c offset relative to \c whence, one of stdio's whence values:
61
+ * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
62
+ *
63
+ * \return the final offset in the data stream, or -1 on error.
64
+ */
65
+ Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
66
+ int whence);
67
+
68
+ /**
69
+ * Read up to \c maxnum objects each of size \c size from the data
70
+ * stream to the area pointed at by \c ptr.
71
+ *
72
+ * \return the number of objects read, or 0 at error or end of file.
73
+ */
74
+ size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
75
+ size_t size, size_t maxnum);
76
+
77
+ /**
78
+ * Write exactly \c num objects each of size \c size from the area
79
+ * pointed at by \c ptr to data stream.
80
+ *
81
+ * \return the number of objects written, or 0 at error or end of file.
82
+ */
83
+ size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
84
+ size_t size, size_t num);
85
+
86
+ /**
87
+ * Close and free an allocated SDL_RWops structure.
88
+ *
89
+ * \return 0 if successful or -1 on write error when flushing data.
90
+ */
91
+ int (SDLCALL * close) (struct SDL_RWops * context);
92
+
93
+ Uint32 type;
94
+ union
95
+ {
96
+ #if defined(__ANDROID__)
97
+ struct
98
+ {
99
+ void *fileNameRef;
100
+ void *inputStreamRef;
101
+ void *readableByteChannelRef;
102
+ void *readMethod;
103
+ void *assetFileDescriptorRef;
104
+ long position;
105
+ long size;
106
+ long offset;
107
+ int fd;
108
+ } androidio;
109
+ #elif defined(__WIN32__)
110
+ struct
111
+ {
112
+ SDL_bool append;
113
+ void *h;
114
+ struct
115
+ {
116
+ void *data;
117
+ size_t size;
118
+ size_t left;
119
+ } buffer;
120
+ } windowsio;
121
+ #endif
122
+
123
+ #ifdef HAVE_STDIO_H
124
+ struct
125
+ {
126
+ SDL_bool autoclose;
127
+ FILE *fp;
128
+ } stdio;
129
+ #endif
130
+ struct
131
+ {
132
+ Uint8 *base;
133
+ Uint8 *here;
134
+ Uint8 *stop;
135
+ } mem;
136
+ struct
137
+ {
138
+ void *data1;
139
+ void *data2;
140
+ } unknown;
141
+ } hidden;
142
+
143
+ } SDL_RWops;
144
+
145
+
146
+ /**
147
+ * \name RWFrom functions
148
+ *
149
+ * Functions to create SDL_RWops structures from various data streams.
150
+ */
151
+ /* @{ */
152
+
153
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
154
+ const char *mode);
155
+
156
+ #ifdef HAVE_STDIO_H
157
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
158
+ SDL_bool autoclose);
159
+ #else
160
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
161
+ SDL_bool autoclose);
162
+ #endif
163
+
164
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
165
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
166
+ int size);
167
+
168
+ /* @} *//* RWFrom functions */
169
+
170
+
171
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
172
+ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
173
+
174
+ #define RW_SEEK_SET 0 /**< Seek from the beginning of data */
175
+ #define RW_SEEK_CUR 1 /**< Seek relative to current read point */
176
+ #define RW_SEEK_END 2 /**< Seek relative to the end of data */
177
+
178
+ /**
179
+ * \name Read/write macros
180
+ *
181
+ * Macros to easily read and write from an SDL_RWops structure.
182
+ */
183
+ /* @{ */
184
+ #define SDL_RWsize(ctx) (ctx)->size(ctx)
185
+ #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
186
+ #define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
187
+ #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
188
+ #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
189
+ #define SDL_RWclose(ctx) (ctx)->close(ctx)
190
+ /* @} *//* Read/write macros */
191
+
192
+
193
+ /**
194
+ * Load all the data from an SDL data stream.
195
+ *
196
+ * The data is allocated with a zero byte at the end (null terminated)
197
+ *
198
+ * If \c datasize is not NULL, it is filled with the size of the data read.
199
+ *
200
+ * If \c freesrc is non-zero, the stream will be closed after being read.
201
+ *
202
+ * The data should be freed with SDL_free().
203
+ *
204
+ * \return the data, or NULL if there was an error.
205
+ */
206
+ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
207
+ int freesrc);
208
+
209
+ /**
210
+ * Load an entire file.
211
+ *
212
+ * Convenience macro.
213
+ */
214
+ #define SDL_LoadFile(file, datasize) SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1)
215
+
216
+ /**
217
+ * \name Read endian functions
218
+ *
219
+ * Read an item of the specified endianness and return in native format.
220
+ */
221
+ /* @{ */
222
+ extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
223
+ extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
224
+ extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
225
+ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
226
+ extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
227
+ extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
228
+ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
229
+ /* @} *//* Read endian functions */
230
+
231
+ /**
232
+ * \name Write endian functions
233
+ *
234
+ * Write an item of native format to the specified endianness.
235
+ */
236
+ /* @{ */
237
+ extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
238
+ extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
239
+ extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
240
+ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
241
+ extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
242
+ extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
243
+ extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
244
+ /* @} *//* Write endian functions */
245
+
246
+ /* Ends C function definitions when using C++ */
247
+ #ifdef __cplusplus
248
+ }
249
+ #endif
250
+ #include "close_code.h"
251
+
252
+ #endif /* SDL_rwops_h_ */
253
+
254
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,413 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * \file SDL_scancode.h
24
+ *
25
+ * Defines keyboard scancodes.
26
+ */
27
+
28
+ #ifndef SDL_scancode_h_
29
+ #define SDL_scancode_h_
30
+
31
+ #include "SDL_stdinc.h"
32
+
33
+ /**
34
+ * \brief The SDL keyboard scancode representation.
35
+ *
36
+ * Values of this type are used to represent keyboard keys, among other places
37
+ * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
38
+ * SDL_Event structure.
39
+ *
40
+ * The values in this enumeration are based on the USB usage page standard:
41
+ * http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
42
+ */
43
+ typedef enum
44
+ {
45
+ SDL_SCANCODE_UNKNOWN = 0,
46
+
47
+ /**
48
+ * \name Usage page 0x07
49
+ *
50
+ * These values are from usage page 0x07 (USB keyboard page).
51
+ */
52
+ /* @{ */
53
+
54
+ SDL_SCANCODE_A = 4,
55
+ SDL_SCANCODE_B = 5,
56
+ SDL_SCANCODE_C = 6,
57
+ SDL_SCANCODE_D = 7,
58
+ SDL_SCANCODE_E = 8,
59
+ SDL_SCANCODE_F = 9,
60
+ SDL_SCANCODE_G = 10,
61
+ SDL_SCANCODE_H = 11,
62
+ SDL_SCANCODE_I = 12,
63
+ SDL_SCANCODE_J = 13,
64
+ SDL_SCANCODE_K = 14,
65
+ SDL_SCANCODE_L = 15,
66
+ SDL_SCANCODE_M = 16,
67
+ SDL_SCANCODE_N = 17,
68
+ SDL_SCANCODE_O = 18,
69
+ SDL_SCANCODE_P = 19,
70
+ SDL_SCANCODE_Q = 20,
71
+ SDL_SCANCODE_R = 21,
72
+ SDL_SCANCODE_S = 22,
73
+ SDL_SCANCODE_T = 23,
74
+ SDL_SCANCODE_U = 24,
75
+ SDL_SCANCODE_V = 25,
76
+ SDL_SCANCODE_W = 26,
77
+ SDL_SCANCODE_X = 27,
78
+ SDL_SCANCODE_Y = 28,
79
+ SDL_SCANCODE_Z = 29,
80
+
81
+ SDL_SCANCODE_1 = 30,
82
+ SDL_SCANCODE_2 = 31,
83
+ SDL_SCANCODE_3 = 32,
84
+ SDL_SCANCODE_4 = 33,
85
+ SDL_SCANCODE_5 = 34,
86
+ SDL_SCANCODE_6 = 35,
87
+ SDL_SCANCODE_7 = 36,
88
+ SDL_SCANCODE_8 = 37,
89
+ SDL_SCANCODE_9 = 38,
90
+ SDL_SCANCODE_0 = 39,
91
+
92
+ SDL_SCANCODE_RETURN = 40,
93
+ SDL_SCANCODE_ESCAPE = 41,
94
+ SDL_SCANCODE_BACKSPACE = 42,
95
+ SDL_SCANCODE_TAB = 43,
96
+ SDL_SCANCODE_SPACE = 44,
97
+
98
+ SDL_SCANCODE_MINUS = 45,
99
+ SDL_SCANCODE_EQUALS = 46,
100
+ SDL_SCANCODE_LEFTBRACKET = 47,
101
+ SDL_SCANCODE_RIGHTBRACKET = 48,
102
+ SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
103
+ * key on ISO keyboards and at the right end
104
+ * of the QWERTY row on ANSI keyboards.
105
+ * Produces REVERSE SOLIDUS (backslash) and
106
+ * VERTICAL LINE in a US layout, REVERSE
107
+ * SOLIDUS and VERTICAL LINE in a UK Mac
108
+ * layout, NUMBER SIGN and TILDE in a UK
109
+ * Windows layout, DOLLAR SIGN and POUND SIGN
110
+ * in a Swiss German layout, NUMBER SIGN and
111
+ * APOSTROPHE in a German layout, GRAVE
112
+ * ACCENT and POUND SIGN in a French Mac
113
+ * layout, and ASTERISK and MICRO SIGN in a
114
+ * French Windows layout.
115
+ */
116
+ SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
117
+ * instead of 49 for the same key, but all
118
+ * OSes I've seen treat the two codes
119
+ * identically. So, as an implementor, unless
120
+ * your keyboard generates both of those
121
+ * codes and your OS treats them differently,
122
+ * you should generate SDL_SCANCODE_BACKSLASH
123
+ * instead of this code. As a user, you
124
+ * should not rely on this code because SDL
125
+ * will never generate it with most (all?)
126
+ * keyboards.
127
+ */
128
+ SDL_SCANCODE_SEMICOLON = 51,
129
+ SDL_SCANCODE_APOSTROPHE = 52,
130
+ SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
131
+ * and ISO keyboards). Produces GRAVE ACCENT and
132
+ * TILDE in a US Windows layout and in US and UK
133
+ * Mac layouts on ANSI keyboards, GRAVE ACCENT
134
+ * and NOT SIGN in a UK Windows layout, SECTION
135
+ * SIGN and PLUS-MINUS SIGN in US and UK Mac
136
+ * layouts on ISO keyboards, SECTION SIGN and
137
+ * DEGREE SIGN in a Swiss German layout (Mac:
138
+ * only on ISO keyboards), CIRCUMFLEX ACCENT and
139
+ * DEGREE SIGN in a German layout (Mac: only on
140
+ * ISO keyboards), SUPERSCRIPT TWO and TILDE in a
141
+ * French Windows layout, COMMERCIAL AT and
142
+ * NUMBER SIGN in a French Mac layout on ISO
143
+ * keyboards, and LESS-THAN SIGN and GREATER-THAN
144
+ * SIGN in a Swiss German, German, or French Mac
145
+ * layout on ANSI keyboards.
146
+ */
147
+ SDL_SCANCODE_COMMA = 54,
148
+ SDL_SCANCODE_PERIOD = 55,
149
+ SDL_SCANCODE_SLASH = 56,
150
+
151
+ SDL_SCANCODE_CAPSLOCK = 57,
152
+
153
+ SDL_SCANCODE_F1 = 58,
154
+ SDL_SCANCODE_F2 = 59,
155
+ SDL_SCANCODE_F3 = 60,
156
+ SDL_SCANCODE_F4 = 61,
157
+ SDL_SCANCODE_F5 = 62,
158
+ SDL_SCANCODE_F6 = 63,
159
+ SDL_SCANCODE_F7 = 64,
160
+ SDL_SCANCODE_F8 = 65,
161
+ SDL_SCANCODE_F9 = 66,
162
+ SDL_SCANCODE_F10 = 67,
163
+ SDL_SCANCODE_F11 = 68,
164
+ SDL_SCANCODE_F12 = 69,
165
+
166
+ SDL_SCANCODE_PRINTSCREEN = 70,
167
+ SDL_SCANCODE_SCROLLLOCK = 71,
168
+ SDL_SCANCODE_PAUSE = 72,
169
+ SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
170
+ does send code 73, not 117) */
171
+ SDL_SCANCODE_HOME = 74,
172
+ SDL_SCANCODE_PAGEUP = 75,
173
+ SDL_SCANCODE_DELETE = 76,
174
+ SDL_SCANCODE_END = 77,
175
+ SDL_SCANCODE_PAGEDOWN = 78,
176
+ SDL_SCANCODE_RIGHT = 79,
177
+ SDL_SCANCODE_LEFT = 80,
178
+ SDL_SCANCODE_DOWN = 81,
179
+ SDL_SCANCODE_UP = 82,
180
+
181
+ SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
182
+ */
183
+ SDL_SCANCODE_KP_DIVIDE = 84,
184
+ SDL_SCANCODE_KP_MULTIPLY = 85,
185
+ SDL_SCANCODE_KP_MINUS = 86,
186
+ SDL_SCANCODE_KP_PLUS = 87,
187
+ SDL_SCANCODE_KP_ENTER = 88,
188
+ SDL_SCANCODE_KP_1 = 89,
189
+ SDL_SCANCODE_KP_2 = 90,
190
+ SDL_SCANCODE_KP_3 = 91,
191
+ SDL_SCANCODE_KP_4 = 92,
192
+ SDL_SCANCODE_KP_5 = 93,
193
+ SDL_SCANCODE_KP_6 = 94,
194
+ SDL_SCANCODE_KP_7 = 95,
195
+ SDL_SCANCODE_KP_8 = 96,
196
+ SDL_SCANCODE_KP_9 = 97,
197
+ SDL_SCANCODE_KP_0 = 98,
198
+ SDL_SCANCODE_KP_PERIOD = 99,
199
+
200
+ SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
201
+ * keyboards have over ANSI ones,
202
+ * located between left shift and Y.
203
+ * Produces GRAVE ACCENT and TILDE in a
204
+ * US or UK Mac layout, REVERSE SOLIDUS
205
+ * (backslash) and VERTICAL LINE in a
206
+ * US or UK Windows layout, and
207
+ * LESS-THAN SIGN and GREATER-THAN SIGN
208
+ * in a Swiss German, German, or French
209
+ * layout. */
210
+ SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
211
+ SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
212
+ * not a physical key - but some Mac keyboards
213
+ * do have a power key. */
214
+ SDL_SCANCODE_KP_EQUALS = 103,
215
+ SDL_SCANCODE_F13 = 104,
216
+ SDL_SCANCODE_F14 = 105,
217
+ SDL_SCANCODE_F15 = 106,
218
+ SDL_SCANCODE_F16 = 107,
219
+ SDL_SCANCODE_F17 = 108,
220
+ SDL_SCANCODE_F18 = 109,
221
+ SDL_SCANCODE_F19 = 110,
222
+ SDL_SCANCODE_F20 = 111,
223
+ SDL_SCANCODE_F21 = 112,
224
+ SDL_SCANCODE_F22 = 113,
225
+ SDL_SCANCODE_F23 = 114,
226
+ SDL_SCANCODE_F24 = 115,
227
+ SDL_SCANCODE_EXECUTE = 116,
228
+ SDL_SCANCODE_HELP = 117,
229
+ SDL_SCANCODE_MENU = 118,
230
+ SDL_SCANCODE_SELECT = 119,
231
+ SDL_SCANCODE_STOP = 120,
232
+ SDL_SCANCODE_AGAIN = 121, /**< redo */
233
+ SDL_SCANCODE_UNDO = 122,
234
+ SDL_SCANCODE_CUT = 123,
235
+ SDL_SCANCODE_COPY = 124,
236
+ SDL_SCANCODE_PASTE = 125,
237
+ SDL_SCANCODE_FIND = 126,
238
+ SDL_SCANCODE_MUTE = 127,
239
+ SDL_SCANCODE_VOLUMEUP = 128,
240
+ SDL_SCANCODE_VOLUMEDOWN = 129,
241
+ /* not sure whether there's a reason to enable these */
242
+ /* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
243
+ /* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
244
+ /* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
245
+ SDL_SCANCODE_KP_COMMA = 133,
246
+ SDL_SCANCODE_KP_EQUALSAS400 = 134,
247
+
248
+ SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
249
+ footnotes in USB doc */
250
+ SDL_SCANCODE_INTERNATIONAL2 = 136,
251
+ SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
252
+ SDL_SCANCODE_INTERNATIONAL4 = 138,
253
+ SDL_SCANCODE_INTERNATIONAL5 = 139,
254
+ SDL_SCANCODE_INTERNATIONAL6 = 140,
255
+ SDL_SCANCODE_INTERNATIONAL7 = 141,
256
+ SDL_SCANCODE_INTERNATIONAL8 = 142,
257
+ SDL_SCANCODE_INTERNATIONAL9 = 143,
258
+ SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
259
+ SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
260
+ SDL_SCANCODE_LANG3 = 146, /**< Katakana */
261
+ SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
262
+ SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
263
+ SDL_SCANCODE_LANG6 = 149, /**< reserved */
264
+ SDL_SCANCODE_LANG7 = 150, /**< reserved */
265
+ SDL_SCANCODE_LANG8 = 151, /**< reserved */
266
+ SDL_SCANCODE_LANG9 = 152, /**< reserved */
267
+
268
+ SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
269
+ SDL_SCANCODE_SYSREQ = 154,
270
+ SDL_SCANCODE_CANCEL = 155,
271
+ SDL_SCANCODE_CLEAR = 156,
272
+ SDL_SCANCODE_PRIOR = 157,
273
+ SDL_SCANCODE_RETURN2 = 158,
274
+ SDL_SCANCODE_SEPARATOR = 159,
275
+ SDL_SCANCODE_OUT = 160,
276
+ SDL_SCANCODE_OPER = 161,
277
+ SDL_SCANCODE_CLEARAGAIN = 162,
278
+ SDL_SCANCODE_CRSEL = 163,
279
+ SDL_SCANCODE_EXSEL = 164,
280
+
281
+ SDL_SCANCODE_KP_00 = 176,
282
+ SDL_SCANCODE_KP_000 = 177,
283
+ SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
284
+ SDL_SCANCODE_DECIMALSEPARATOR = 179,
285
+ SDL_SCANCODE_CURRENCYUNIT = 180,
286
+ SDL_SCANCODE_CURRENCYSUBUNIT = 181,
287
+ SDL_SCANCODE_KP_LEFTPAREN = 182,
288
+ SDL_SCANCODE_KP_RIGHTPAREN = 183,
289
+ SDL_SCANCODE_KP_LEFTBRACE = 184,
290
+ SDL_SCANCODE_KP_RIGHTBRACE = 185,
291
+ SDL_SCANCODE_KP_TAB = 186,
292
+ SDL_SCANCODE_KP_BACKSPACE = 187,
293
+ SDL_SCANCODE_KP_A = 188,
294
+ SDL_SCANCODE_KP_B = 189,
295
+ SDL_SCANCODE_KP_C = 190,
296
+ SDL_SCANCODE_KP_D = 191,
297
+ SDL_SCANCODE_KP_E = 192,
298
+ SDL_SCANCODE_KP_F = 193,
299
+ SDL_SCANCODE_KP_XOR = 194,
300
+ SDL_SCANCODE_KP_POWER = 195,
301
+ SDL_SCANCODE_KP_PERCENT = 196,
302
+ SDL_SCANCODE_KP_LESS = 197,
303
+ SDL_SCANCODE_KP_GREATER = 198,
304
+ SDL_SCANCODE_KP_AMPERSAND = 199,
305
+ SDL_SCANCODE_KP_DBLAMPERSAND = 200,
306
+ SDL_SCANCODE_KP_VERTICALBAR = 201,
307
+ SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
308
+ SDL_SCANCODE_KP_COLON = 203,
309
+ SDL_SCANCODE_KP_HASH = 204,
310
+ SDL_SCANCODE_KP_SPACE = 205,
311
+ SDL_SCANCODE_KP_AT = 206,
312
+ SDL_SCANCODE_KP_EXCLAM = 207,
313
+ SDL_SCANCODE_KP_MEMSTORE = 208,
314
+ SDL_SCANCODE_KP_MEMRECALL = 209,
315
+ SDL_SCANCODE_KP_MEMCLEAR = 210,
316
+ SDL_SCANCODE_KP_MEMADD = 211,
317
+ SDL_SCANCODE_KP_MEMSUBTRACT = 212,
318
+ SDL_SCANCODE_KP_MEMMULTIPLY = 213,
319
+ SDL_SCANCODE_KP_MEMDIVIDE = 214,
320
+ SDL_SCANCODE_KP_PLUSMINUS = 215,
321
+ SDL_SCANCODE_KP_CLEAR = 216,
322
+ SDL_SCANCODE_KP_CLEARENTRY = 217,
323
+ SDL_SCANCODE_KP_BINARY = 218,
324
+ SDL_SCANCODE_KP_OCTAL = 219,
325
+ SDL_SCANCODE_KP_DECIMAL = 220,
326
+ SDL_SCANCODE_KP_HEXADECIMAL = 221,
327
+
328
+ SDL_SCANCODE_LCTRL = 224,
329
+ SDL_SCANCODE_LSHIFT = 225,
330
+ SDL_SCANCODE_LALT = 226, /**< alt, option */
331
+ SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
332
+ SDL_SCANCODE_RCTRL = 228,
333
+ SDL_SCANCODE_RSHIFT = 229,
334
+ SDL_SCANCODE_RALT = 230, /**< alt gr, option */
335
+ SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
336
+
337
+ SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
338
+ * by any of the above, but since there's a
339
+ * special KMOD_MODE for it I'm adding it here
340
+ */
341
+
342
+ /* @} *//* Usage page 0x07 */
343
+
344
+ /**
345
+ * \name Usage page 0x0C
346
+ *
347
+ * These values are mapped from usage page 0x0C (USB consumer page).
348
+ */
349
+ /* @{ */
350
+
351
+ SDL_SCANCODE_AUDIONEXT = 258,
352
+ SDL_SCANCODE_AUDIOPREV = 259,
353
+ SDL_SCANCODE_AUDIOSTOP = 260,
354
+ SDL_SCANCODE_AUDIOPLAY = 261,
355
+ SDL_SCANCODE_AUDIOMUTE = 262,
356
+ SDL_SCANCODE_MEDIASELECT = 263,
357
+ SDL_SCANCODE_WWW = 264,
358
+ SDL_SCANCODE_MAIL = 265,
359
+ SDL_SCANCODE_CALCULATOR = 266,
360
+ SDL_SCANCODE_COMPUTER = 267,
361
+ SDL_SCANCODE_AC_SEARCH = 268,
362
+ SDL_SCANCODE_AC_HOME = 269,
363
+ SDL_SCANCODE_AC_BACK = 270,
364
+ SDL_SCANCODE_AC_FORWARD = 271,
365
+ SDL_SCANCODE_AC_STOP = 272,
366
+ SDL_SCANCODE_AC_REFRESH = 273,
367
+ SDL_SCANCODE_AC_BOOKMARKS = 274,
368
+
369
+ /* @} *//* Usage page 0x0C */
370
+
371
+ /**
372
+ * \name Walther keys
373
+ *
374
+ * These are values that Christian Walther added (for mac keyboard?).
375
+ */
376
+ /* @{ */
377
+
378
+ SDL_SCANCODE_BRIGHTNESSDOWN = 275,
379
+ SDL_SCANCODE_BRIGHTNESSUP = 276,
380
+ SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
381
+ switch, video mode switch */
382
+ SDL_SCANCODE_KBDILLUMTOGGLE = 278,
383
+ SDL_SCANCODE_KBDILLUMDOWN = 279,
384
+ SDL_SCANCODE_KBDILLUMUP = 280,
385
+ SDL_SCANCODE_EJECT = 281,
386
+ SDL_SCANCODE_SLEEP = 282,
387
+
388
+ SDL_SCANCODE_APP1 = 283,
389
+ SDL_SCANCODE_APP2 = 284,
390
+
391
+ /* @} *//* Walther keys */
392
+
393
+ /**
394
+ * \name Usage page 0x0C (additional media keys)
395
+ *
396
+ * These values are mapped from usage page 0x0C (USB consumer page).
397
+ */
398
+ /* @{ */
399
+
400
+ SDL_SCANCODE_AUDIOREWIND = 285,
401
+ SDL_SCANCODE_AUDIOFASTFORWARD = 286,
402
+
403
+ /* @} *//* Usage page 0x0C (additional media keys) */
404
+
405
+ /* Add any other keys here. */
406
+
407
+ SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
408
+ for array bounds */
409
+ } SDL_Scancode;
410
+
411
+ #endif /* SDL_scancode_h_ */
412
+
413
+ /* vi: set ts=4 sw=4 expandtab: */