reflexion 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/reflex/application.cpp +37 -6
  3. data/.doc/ext/reflex/capture_event.cpp +1 -1
  4. data/.doc/ext/reflex/chase_constraint.cpp +1 -1
  5. data/.doc/ext/reflex/clipboard.cpp +1 -1
  6. data/.doc/ext/reflex/color_event.cpp +76 -0
  7. data/.doc/ext/reflex/color_picker.cpp +113 -0
  8. data/.doc/ext/reflex/constraint.cpp +1 -1
  9. data/.doc/ext/reflex/contact_event.cpp +1 -1
  10. data/.doc/ext/reflex/control_change_event.cpp +1 -1
  11. data/.doc/ext/reflex/device.cpp +1 -1
  12. data/.doc/ext/reflex/device_event.cpp +1 -1
  13. data/.doc/ext/reflex/draw_event.cpp +1 -1
  14. data/.doc/ext/reflex/ellipse_shape.cpp +1 -1
  15. data/.doc/ext/reflex/event.cpp +1 -1
  16. data/.doc/ext/reflex/file_dialog.cpp +181 -0
  17. data/.doc/ext/reflex/file_event.cpp +103 -0
  18. data/.doc/ext/reflex/filter.cpp +1 -1
  19. data/.doc/ext/reflex/focus_event.cpp +1 -1
  20. data/.doc/ext/reflex/frame_event.cpp +1 -1
  21. data/.doc/ext/reflex/gamepad.cpp +48 -0
  22. data/.doc/ext/reflex/image_view.cpp +1 -1
  23. data/.doc/ext/reflex/key_event.cpp +1 -274
  24. data/.doc/ext/reflex/line_shape.cpp +1 -1
  25. data/.doc/ext/reflex/link_constraint.cpp +1 -1
  26. data/.doc/ext/reflex/menu.cpp +6 -5
  27. data/.doc/ext/reflex/midi.cpp +9 -2
  28. data/.doc/ext/reflex/midi_event.cpp +1 -1
  29. data/.doc/ext/reflex/motion_event.cpp +1 -1
  30. data/.doc/ext/reflex/native.cpp +18 -6
  31. data/.doc/ext/reflex/note_event.cpp +1 -1
  32. data/.doc/ext/reflex/pin.cpp +1 -1
  33. data/.doc/ext/reflex/pointer.cpp +1 -1
  34. data/.doc/ext/reflex/pointer_event.cpp +2 -2
  35. data/.doc/ext/reflex/polygon_shape.cpp +1 -1
  36. data/.doc/ext/reflex/rect_shape.cpp +1 -1
  37. data/.doc/ext/reflex/reflex.cpp +566 -232
  38. data/.doc/ext/reflex/screen.cpp +27 -1
  39. data/.doc/ext/reflex/scroll_event.cpp +1 -1
  40. data/.doc/ext/reflex/selector.cpp +1 -1
  41. data/.doc/ext/reflex/shape.cpp +1 -1
  42. data/.doc/ext/reflex/snap_constraint.cpp +1 -1
  43. data/.doc/ext/reflex/style.cpp +1 -1
  44. data/.doc/ext/reflex/style_length.cpp +1 -1
  45. data/.doc/ext/reflex/text_event.cpp +104 -0
  46. data/.doc/ext/reflex/timer.cpp +1 -1
  47. data/.doc/ext/reflex/timer_event.cpp +1 -1
  48. data/.doc/ext/reflex/update_event.cpp +1 -1
  49. data/.doc/ext/reflex/view.cpp +110 -56
  50. data/.doc/ext/reflex/wheel_constraint.cpp +1 -1
  51. data/.doc/ext/reflex/wheel_event.cpp +1 -1
  52. data/.doc/ext/reflex/window.cpp +226 -17
  53. data/.github/workflows/release-gem.yml +2 -49
  54. data/.github/workflows/tag.yml +5 -28
  55. data/.github/workflows/test.yml +1 -37
  56. data/ChangeLog.md +54 -0
  57. data/Gemfile.lock +13 -8
  58. data/Rakefile +13 -2
  59. data/Reflex.podspec +2 -2
  60. data/VERSION +1 -1
  61. data/ext/reflex/application.cpp +41 -6
  62. data/ext/reflex/capture_event.cpp +1 -1
  63. data/ext/reflex/chase_constraint.cpp +1 -1
  64. data/ext/reflex/clipboard.cpp +1 -1
  65. data/ext/reflex/color_event.cpp +80 -0
  66. data/ext/reflex/color_picker.cpp +121 -0
  67. data/ext/reflex/constraint.cpp +1 -1
  68. data/ext/reflex/contact_event.cpp +1 -1
  69. data/ext/reflex/control_change_event.cpp +1 -1
  70. data/ext/reflex/device.cpp +1 -1
  71. data/ext/reflex/device_event.cpp +1 -1
  72. data/ext/reflex/draw_event.cpp +1 -1
  73. data/ext/reflex/ellipse_shape.cpp +1 -1
  74. data/ext/reflex/event.cpp +1 -1
  75. data/ext/reflex/extconf.rb +4 -2
  76. data/ext/reflex/file_dialog.cpp +194 -0
  77. data/ext/reflex/file_event.cpp +108 -0
  78. data/ext/reflex/filter.cpp +1 -1
  79. data/ext/reflex/focus_event.cpp +1 -1
  80. data/ext/reflex/frame_event.cpp +1 -1
  81. data/ext/reflex/gamepad.cpp +50 -0
  82. data/ext/reflex/image_view.cpp +1 -1
  83. data/ext/reflex/key_event.cpp +1 -275
  84. data/ext/reflex/line_shape.cpp +1 -1
  85. data/ext/reflex/link_constraint.cpp +1 -1
  86. data/ext/reflex/menu.cpp +8 -7
  87. data/ext/reflex/midi.cpp +11 -3
  88. data/ext/reflex/midi_event.cpp +1 -1
  89. data/ext/reflex/motion_event.cpp +1 -1
  90. data/ext/reflex/native.cpp +18 -6
  91. data/ext/reflex/note_event.cpp +1 -1
  92. data/ext/reflex/pin.cpp +1 -1
  93. data/ext/reflex/pointer.cpp +1 -1
  94. data/ext/reflex/pointer_event.cpp +2 -2
  95. data/ext/reflex/polygon_shape.cpp +1 -1
  96. data/ext/reflex/rect_shape.cpp +1 -1
  97. data/ext/reflex/reflex.cpp +568 -232
  98. data/ext/reflex/screen.cpp +31 -2
  99. data/ext/reflex/scroll_event.cpp +1 -1
  100. data/ext/reflex/selector.cpp +1 -1
  101. data/ext/reflex/selector.h +9 -9
  102. data/ext/reflex/shape.cpp +1 -1
  103. data/ext/reflex/snap_constraint.cpp +1 -1
  104. data/ext/reflex/style.cpp +1 -1
  105. data/ext/reflex/style_length.cpp +1 -1
  106. data/ext/reflex/text_event.cpp +111 -0
  107. data/ext/reflex/timer.cpp +1 -1
  108. data/ext/reflex/timer_event.cpp +1 -1
  109. data/ext/reflex/update_event.cpp +1 -1
  110. data/ext/reflex/view.cpp +121 -61
  111. data/ext/reflex/wheel_constraint.cpp +1 -1
  112. data/ext/reflex/wheel_event.cpp +1 -1
  113. data/ext/reflex/window.cpp +256 -25
  114. data/include/reflex/application.h +10 -0
  115. data/include/reflex/color_picker.h +65 -0
  116. data/include/reflex/event.h +178 -88
  117. data/include/reflex/file_dialog.h +73 -0
  118. data/include/reflex/gamepad.h +3 -0
  119. data/include/reflex/menu.h +3 -3
  120. data/include/reflex/midi.h +3 -0
  121. data/include/reflex/reflex.h +2 -0
  122. data/include/reflex/ruby/application.h +6 -1
  123. data/include/reflex/ruby/color_picker.h +89 -0
  124. data/include/reflex/ruby/event.h +62 -29
  125. data/include/reflex/ruby/file_dialog.h +89 -0
  126. data/include/reflex/ruby/gamepad.h +46 -0
  127. data/include/reflex/ruby/reflex.h +3 -0
  128. data/include/reflex/ruby/view.h +92 -44
  129. data/include/reflex/ruby/window.h +60 -1
  130. data/include/reflex/ruby.h +3 -0
  131. data/include/reflex/screen.h +11 -2
  132. data/include/reflex/view.h +28 -16
  133. data/include/reflex/window.h +40 -8
  134. data/include/reflex.h +3 -0
  135. data/lib/reflex/application.rb +5 -5
  136. data/lib/reflex/autoinit.rb +3 -1
  137. data/lib/reflex/button.rb +3 -3
  138. data/lib/reflex/color_event.rb +16 -0
  139. data/lib/reflex/color_picker.rb +45 -0
  140. data/lib/reflex/control_change_event.rb +17 -0
  141. data/lib/reflex/file_dialog.rb +70 -0
  142. data/lib/reflex/file_event.rb +37 -0
  143. data/lib/reflex/helper.rb +58 -7
  144. data/lib/reflex/key_event.rb +9 -4
  145. data/lib/reflex/menu.rb +17 -1
  146. data/lib/reflex/model.rb +19 -19
  147. data/lib/reflex/note_event.rb +1 -1
  148. data/lib/reflex/pointer.rb +14 -3
  149. data/lib/reflex/pointer_event.rb +12 -1
  150. data/lib/reflex/reflex.rb +5 -0
  151. data/lib/reflex/shape.rb +14 -14
  152. data/lib/reflex/style.rb +16 -16
  153. data/lib/reflex/text_event.rb +40 -0
  154. data/lib/reflex/timer.rb +3 -3
  155. data/lib/reflex/view.rb +29 -14
  156. data/lib/reflex/wheel_event.rb +12 -3
  157. data/lib/reflex/window.rb +25 -13
  158. data/lib/reflex.rb +8 -2
  159. data/reflex.gemspec +4 -4
  160. data/samples/ime.rb +100 -0
  161. data/samples/ios/hello/hello.xcodeproj/project.pbxproj +236 -224
  162. data/samples/menu.rb +4 -1
  163. data/samples/model.rb +3 -3
  164. data/samples/test/alert.rb +93 -0
  165. data/samples/test/always_on.rb +76 -0
  166. data/samples/test/app_background.rb +51 -0
  167. data/samples/test/boundary.rb +75 -0
  168. data/samples/test/callback_exception.rb +101 -0
  169. data/samples/test/cancel.rb +53 -0
  170. data/samples/test/color_picker.rb +63 -0
  171. data/samples/test/file_dialog.rb +102 -0
  172. data/samples/window_style.rb +156 -0
  173. data/src/application.cpp +159 -18
  174. data/src/application.h +92 -7
  175. data/src/color_picker.cpp +113 -0
  176. data/src/color_picker.h +36 -0
  177. data/src/event.cpp +410 -252
  178. data/src/event.h +12 -0
  179. data/src/file_dialog.cpp +163 -0
  180. data/src/file_dialog.h +52 -0
  181. data/src/gamepad.cpp +42 -5
  182. data/src/gamepad.h +4 -0
  183. data/src/ios/app_delegate.mm +5 -3
  184. data/src/ios/application.mm +24 -0
  185. data/src/ios/color_picker.mm +19 -0
  186. data/src/ios/file_dialog.mm +21 -0
  187. data/src/ios/gamepad.mm +4 -4
  188. data/src/ios/menu.mm +5 -0
  189. data/src/ios/reflex.mm +8 -0
  190. data/src/ios/screen.mm +26 -0
  191. data/src/ios/view_controller.mm +2 -30
  192. data/src/ios/window.mm +38 -9
  193. data/src/menu.cpp +66 -4
  194. data/src/menu.h +17 -1
  195. data/src/midi.cpp +61 -31
  196. data/src/osx/app_delegate.h +4 -0
  197. data/src/osx/app_delegate.mm +102 -22
  198. data/src/osx/application.mm +88 -6
  199. data/src/osx/color_picker.mm +112 -0
  200. data/src/osx/event.h +10 -0
  201. data/src/osx/event.mm +84 -30
  202. data/src/osx/file_dialog.mm +168 -0
  203. data/src/osx/gamepad.mm +2 -2
  204. data/src/osx/gamepad_hid.mm +1 -1
  205. data/src/osx/menu.mm +177 -33
  206. data/src/osx/native_window.h +16 -2
  207. data/src/osx/native_window.mm +114 -57
  208. data/src/osx/opengl_view.h +2 -1
  209. data/src/osx/opengl_view.mm +184 -43
  210. data/src/osx/reflex.mm +38 -0
  211. data/src/osx/screen.mm +36 -0
  212. data/src/osx/window.mm +106 -24
  213. data/src/pointer.cpp +13 -4
  214. data/src/pointer.h +4 -0
  215. data/src/rays.h +46 -0
  216. data/src/sdl/application.cpp +68 -8
  217. data/src/sdl/color_picker.cpp +18 -0
  218. data/src/sdl/event.cpp +24 -3
  219. data/src/sdl/event.h +12 -0
  220. data/src/sdl/file_dialog.cpp +20 -0
  221. data/src/sdl/gamepad.cpp +3 -7
  222. data/src/sdl/menu.cpp +5 -0
  223. data/src/sdl/reflex.cpp +20 -0
  224. data/src/sdl/screen.cpp +36 -0
  225. data/src/sdl/window.cpp +142 -29
  226. data/src/shape.cpp +15 -10
  227. data/src/view.cpp +287 -198
  228. data/src/view.h +4 -2
  229. data/src/vk.h +416 -0
  230. data/src/win32/application.cpp +162 -12
  231. data/src/win32/application.h +20 -0
  232. data/src/win32/color_picker.cpp +82 -0
  233. data/src/win32/event.cpp +114 -12
  234. data/src/win32/event.h +21 -4
  235. data/src/win32/file_dialog.cpp +226 -0
  236. data/src/win32/gamepad.cpp +9 -2
  237. data/src/win32/menu.cpp +191 -53
  238. data/src/win32/menu.h +9 -1
  239. data/src/win32/opengl.cpp +2 -9
  240. data/src/win32/reflex.cpp +44 -3
  241. data/src/win32/screen.cpp +164 -3
  242. data/src/win32/screen.h +8 -0
  243. data/src/win32/tray.cpp +191 -0
  244. data/src/win32/tray.h +22 -0
  245. data/src/win32/vk.cpp +11 -0
  246. data/src/win32/window.cpp +809 -148
  247. data/src/win32/window.h +6 -0
  248. data/src/window.cpp +718 -185
  249. data/src/window.h +66 -33
  250. data/src/world.cpp +9 -1
  251. data/test/helper.rb +17 -0
  252. data/test/test_application.rb +90 -1
  253. data/test/test_chase_constraint.rb +1 -3
  254. data/test/test_color_event.rb +36 -0
  255. data/test/test_color_picker.rb +62 -0
  256. data/test/test_constraint.rb +2 -4
  257. data/test/test_event.rb +1 -1
  258. data/test/test_file_dialog.rb +48 -0
  259. data/test/test_file_event.rb +43 -0
  260. data/test/test_has_text_preedit.rb +54 -0
  261. data/test/test_key_event.rb +20 -5
  262. data/test/test_link_constraint.rb +1 -3
  263. data/test/test_menu.rb +40 -10
  264. data/test/test_pointer.rb +33 -23
  265. data/test/test_pointer_event.rb +24 -9
  266. data/test/test_reflex.rb +36 -0
  267. data/test/test_screen.rb +24 -2
  268. data/test/test_snap_constraint.rb +1 -3
  269. data/test/test_text_event.rb +54 -0
  270. data/test/test_view.rb +41 -4
  271. data/test/test_wheel_constraint.rb +1 -3
  272. data/test/test_wheel_event.rb +13 -5
  273. data/test/test_window.rb +196 -44
  274. metadata +80 -10
  275. data/.github/workflows/utils.rb +0 -127
@@ -25,16 +25,12 @@ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FocusEvent)
25
25
 
26
26
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::KeyEvent)
27
27
 
28
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::TextEvent)
29
+
28
30
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::PointerEvent)
29
31
 
30
32
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::WheelEvent)
31
33
 
32
- RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MIDIEvent)
33
-
34
- RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::NoteEvent)
35
-
36
- RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ControlChangeEvent)
37
-
38
34
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::CaptureEvent)
39
35
 
40
36
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::TimerEvent)
@@ -43,6 +39,16 @@ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ContactEvent)
43
39
 
44
40
  RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MotionEvent)
45
41
 
42
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FileEvent)
43
+
44
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ColorEvent)
45
+
46
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MIDIEvent)
47
+
48
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::NoteEvent)
49
+
50
+ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ControlChangeEvent)
51
+
46
52
 
47
53
  namespace Reflex
48
54
  {
@@ -72,21 +78,15 @@ namespace Reflex
72
78
  REFLEX_EXPORT Rucy::Class key_event_class ();
73
79
  // class Reflex::KeyEvent
74
80
 
81
+ REFLEX_EXPORT Rucy::Class text_event_class ();
82
+ // class Reflex::TextEvent
83
+
75
84
  REFLEX_EXPORT Rucy::Class pointer_event_class ();
76
85
  // class Reflex::PointerEvent
77
86
 
78
87
  REFLEX_EXPORT Rucy::Class wheel_event_class ();
79
88
  // class Reflex::WheelEvent
80
89
 
81
- REFLEX_EXPORT Rucy::Class midi_event_class ();
82
- // class Reflex::MIDIEvent
83
-
84
- REFLEX_EXPORT Rucy::Class note_event_class ();
85
- // class Reflex::NoteEvent
86
-
87
- REFLEX_EXPORT Rucy::Class control_change_event_class ();
88
- // class Reflex::ControlChangeEvent
89
-
90
90
  REFLEX_EXPORT Rucy::Class capture_event_class ();
91
91
  // class Reflex::CaptureEvent
92
92
 
@@ -99,6 +99,21 @@ namespace Reflex
99
99
  REFLEX_EXPORT Rucy::Class motion_event_class ();
100
100
  // class Reflex::MotionEvent
101
101
 
102
+ REFLEX_EXPORT Rucy::Class file_event_class ();
103
+ // class Reflex::FileEvent
104
+
105
+ REFLEX_EXPORT Rucy::Class color_event_class ();
106
+ // class Reflex::ColorEvent
107
+
108
+ REFLEX_EXPORT Rucy::Class midi_event_class ();
109
+ // class Reflex::MIDIEvent
110
+
111
+ REFLEX_EXPORT Rucy::Class note_event_class ();
112
+ // class Reflex::NoteEvent
113
+
114
+ REFLEX_EXPORT Rucy::Class control_change_event_class ();
115
+ // class Reflex::ControlChangeEvent
116
+
102
117
 
103
118
  }// Reflex
104
119
 
@@ -155,6 +170,12 @@ namespace Rucy
155
170
  return Reflex::key_event_class();
156
171
  }
157
172
 
173
+ template <> inline Class
174
+ get_ruby_class<Reflex::TextEvent> ()
175
+ {
176
+ return Reflex::text_event_class();
177
+ }
178
+
158
179
  template <> inline Class
159
180
  get_ruby_class<Reflex::PointerEvent> ()
160
181
  {
@@ -168,45 +189,57 @@ namespace Rucy
168
189
  }
169
190
 
170
191
  template <> inline Class
171
- get_ruby_class<Reflex::MIDIEvent> ()
192
+ get_ruby_class<Reflex::CaptureEvent> ()
172
193
  {
173
- return Reflex::midi_event_class();
194
+ return Reflex::capture_event_class();
174
195
  }
175
196
 
176
197
  template <> inline Class
177
- get_ruby_class<Reflex::NoteEvent> ()
198
+ get_ruby_class<Reflex::TimerEvent> ()
178
199
  {
179
- return Reflex::note_event_class();
200
+ return Reflex::timer_event_class();
180
201
  }
181
202
 
182
203
  template <> inline Class
183
- get_ruby_class<Reflex::ControlChangeEvent> ()
204
+ get_ruby_class<Reflex::ContactEvent> ()
184
205
  {
185
- return Reflex::control_change_event_class();
206
+ return Reflex::contact_event_class();
186
207
  }
187
208
 
188
209
  template <> inline Class
189
- get_ruby_class<Reflex::CaptureEvent> ()
210
+ get_ruby_class<Reflex::MotionEvent> ()
190
211
  {
191
- return Reflex::capture_event_class();
212
+ return Reflex::motion_event_class();
192
213
  }
193
214
 
194
215
  template <> inline Class
195
- get_ruby_class<Reflex::TimerEvent> ()
216
+ get_ruby_class<Reflex::FileEvent> ()
196
217
  {
197
- return Reflex::timer_event_class();
218
+ return Reflex::file_event_class();
198
219
  }
199
220
 
200
221
  template <> inline Class
201
- get_ruby_class<Reflex::ContactEvent> ()
222
+ get_ruby_class<Reflex::ColorEvent> ()
202
223
  {
203
- return Reflex::contact_event_class();
224
+ return Reflex::color_event_class();
204
225
  }
205
226
 
206
227
  template <> inline Class
207
- get_ruby_class<Reflex::MotionEvent> ()
228
+ get_ruby_class<Reflex::MIDIEvent> ()
208
229
  {
209
- return Reflex::motion_event_class();
230
+ return Reflex::midi_event_class();
231
+ }
232
+
233
+ template <> inline Class
234
+ get_ruby_class<Reflex::NoteEvent> ()
235
+ {
236
+ return Reflex::note_event_class();
237
+ }
238
+
239
+ template <> inline Class
240
+ get_ruby_class<Reflex::ControlChangeEvent> ()
241
+ {
242
+ return Reflex::control_change_event_class();
210
243
  }
211
244
 
212
245
 
@@ -0,0 +1,89 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __REFLEX_RUBY_FILE_DIALOG_H__
4
+ #define __REFLEX_RUBY_FILE_DIALOG_H__
5
+
6
+
7
+ #include <rucy/class.h>
8
+ #include <rucy/extension.h>
9
+ #include <reflex/file_dialog.h>
10
+ #include <reflex/ruby/event.h>
11
+
12
+
13
+ RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FileDialog)
14
+
15
+
16
+ namespace Reflex
17
+ {
18
+
19
+
20
+ REFLEX_EXPORT Rucy::Class file_dialog_class ();
21
+ // class Reflex::FileDialog
22
+
23
+
24
+ template <typename T>
25
+ class RubyFileDialog : public Rucy::ClassWrapper<T>
26
+ {
27
+
28
+ typedef Rucy::ClassWrapper<T> Super;
29
+
30
+ public:
31
+
32
+ virtual void on_file (FileEvent* e)
33
+ {
34
+ if (this->is_overridable())
35
+ {
36
+ RUCY_SYM(call_file_block);
37
+ this->value.call(call_file_block, Rucy::value(e));
38
+
39
+ if (!e->is_blocked())
40
+ {
41
+ RUCY_SYM(on_file);
42
+ this->value.call(on_file, Rucy::value(e));
43
+ }
44
+ }
45
+ else
46
+ Super::on_file(e);
47
+ }
48
+
49
+ virtual void on_cancel (Event* e)
50
+ {
51
+ if (this->is_overridable())
52
+ {
53
+ RUCY_SYM(call_cancel_block);
54
+ this->value.call(call_cancel_block);
55
+
56
+ RUCY_SYM(on_cancel);
57
+ this->value.call(on_cancel, Rucy::value(e));
58
+ }
59
+ else
60
+ Super::on_cancel(e);
61
+ }
62
+
63
+ };// RubyFileDialog
64
+
65
+
66
+ }// Reflex
67
+
68
+
69
+ namespace Rucy
70
+ {
71
+
72
+
73
+ template <> inline Class
74
+ get_ruby_class<Reflex::FileDialog> ()
75
+ {
76
+ return Reflex::file_dialog_class();
77
+ }
78
+
79
+ inline Value
80
+ value (Reflex::FileDialog::Ref& ref, Value klass = Reflex::file_dialog_class())
81
+ {
82
+ return value(ref.get(), klass);
83
+ }
84
+
85
+
86
+ }// Rucy
87
+
88
+
89
+ #endif//EOH
@@ -0,0 +1,46 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __REFLEX_RUBY_GAMEPAD_H__
4
+ #define __REFLEX_RUBY_GAMEPAD_H__
5
+
6
+
7
+ #include <rucy/class.h>
8
+ #include <rucy/extension.h>
9
+ #include <reflex/gamepad.h>
10
+
11
+
12
+ RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Gamepad)
13
+
14
+
15
+ namespace Reflex
16
+ {
17
+
18
+
19
+ REFLEX_EXPORT Rucy::Class gamepad_class ();
20
+ // class Reflex::Gamepad
21
+
22
+
23
+ }// Reflex
24
+
25
+
26
+ namespace Rucy
27
+ {
28
+
29
+
30
+ template <> inline Class
31
+ get_ruby_class<Reflex::Gamepad> ()
32
+ {
33
+ return Reflex::gamepad_class();
34
+ }
35
+
36
+ inline Value
37
+ value (Reflex::Gamepad::Ref& ref, Value klass = Reflex::gamepad_class())
38
+ {
39
+ return value(ref.get(), klass);
40
+ }
41
+
42
+
43
+ }// Rucy
44
+
45
+
46
+ #endif//EOH
@@ -9,6 +9,9 @@
9
9
  #include <reflex/reflex.h>
10
10
 
11
11
 
12
+ RUCY_DECLARE_CONVERT_TO(REFLEX_EXPORT, Reflex::KeyCode)
13
+
14
+
12
15
  namespace Reflex
13
16
  {
14
17
 
@@ -41,6 +41,27 @@ namespace Reflex
41
41
  return Super::content_bounds();
42
42
  }
43
43
 
44
+ virtual bool accepts_text_input () const
45
+ {
46
+ RUCY_SYM_Q(accepts_text_input);
47
+ if (this->is_overridable())
48
+ return Rucy::to<bool>(this->value.call(accepts_text_input));
49
+ else
50
+ return Super::accepts_text_input();
51
+ }
52
+
53
+ virtual Bounds text_input_bounds () const
54
+ {
55
+ RUCY_SYM(text_input_bounds);
56
+ if (this->is_overridable())
57
+ {
58
+ Rucy::Value ret = this->value.call(text_input_bounds);
59
+ return ret.is_nil() ? Super::text_input_bounds() : Rucy::to<Bounds>(ret);
60
+ }
61
+ else
62
+ return Super::text_input_bounds();
63
+ }
64
+
44
65
  virtual void on_attach (Event* e)
45
66
  {
46
67
  RUCY_SYM(on_attach);
@@ -194,6 +215,33 @@ namespace Reflex
194
215
  Super::on_key_up(e);
195
216
  }
196
217
 
218
+ virtual void on_text (TextEvent* e)
219
+ {
220
+ RUCY_SYM(on_text);
221
+ if (this->is_overridable())
222
+ this->value.call(on_text, Rucy::value(e));
223
+ else
224
+ Super::on_text(e);
225
+ }
226
+
227
+ virtual void on_text_preedit (TextEvent* e)
228
+ {
229
+ RUCY_SYM(on_text_preedit);
230
+ if (this->is_overridable())
231
+ this->value.call(on_text_preedit, Rucy::value(e));
232
+ else
233
+ Super::on_text_preedit(e);
234
+ }
235
+
236
+ virtual void on_text_commit (TextEvent* e)
237
+ {
238
+ RUCY_SYM(on_text_commit);
239
+ if (this->is_overridable())
240
+ this->value.call(on_text_commit, Rucy::value(e));
241
+ else
242
+ Super::on_text_commit(e);
243
+ }
244
+
197
245
  virtual void on_pointer (PointerEvent* e)
198
246
  {
199
247
  RUCY_SYM(on_pointer);
@@ -266,103 +314,103 @@ namespace Reflex
266
314
  Super::on_wheel(e);
267
315
  }
268
316
 
269
- virtual void on_midi (MIDIEvent* e)
317
+ virtual void on_capture (CaptureEvent* e)
270
318
  {
271
- RUCY_SYM(on_midi);
319
+ RUCY_SYM(on_capture);
272
320
  if (this->is_overridable())
273
- this->value.call(on_midi, Rucy::value(e));
321
+ this->value.call(on_capture, Rucy::value(e));
274
322
  else
275
- Super::on_midi(e);
323
+ Super::on_capture(e);
276
324
  }
277
325
 
278
- virtual void on_note (NoteEvent* e)
326
+ virtual void on_timer (TimerEvent* e)
279
327
  {
280
- RUCY_SYM(on_note);
328
+ RUCY_SYM(on_timer);
281
329
  if (this->is_overridable())
282
- this->value.call(on_note, Rucy::value(e));
330
+ this->value.call(on_timer, Rucy::value(e));
283
331
  else
284
- Super::on_note(e);
332
+ Super::on_timer(e);
285
333
  }
286
334
 
287
- virtual void on_note_on (NoteEvent* e)
335
+ virtual bool will_contact (View* v)
288
336
  {
289
- RUCY_SYM(on_note_on);
337
+ RUCY_SYM_Q(will_contact);
290
338
  if (this->is_overridable())
291
- this->value.call(on_note_on, Rucy::value(e));
339
+ return this->value.call(will_contact, Rucy::value(v));
292
340
  else
293
- Super::on_note_on(e);
341
+ return Super::will_contact(v);
294
342
  }
295
343
 
296
- virtual void on_note_off (NoteEvent* e)
344
+ virtual void on_contact (ContactEvent* e)
297
345
  {
298
- RUCY_SYM(on_note_off);
346
+ RUCY_SYM_B(on_contact);
299
347
  if (this->is_overridable())
300
- this->value.call(on_note_off, Rucy::value(e));
348
+ this->value.call(on_contact, Rucy::value(e));
301
349
  else
302
- Super::on_note_off(e);
350
+ Super::on_contact(e);
303
351
  }
304
352
 
305
- virtual void on_control_change (ControlChangeEvent* e)
353
+ virtual void on_contact_begin (ContactEvent* e)
306
354
  {
307
- RUCY_SYM(on_control_change);
355
+ RUCY_SYM_B(on_contact_begin);
308
356
  if (this->is_overridable())
309
- this->value.call(on_control_change, Rucy::value(e));
357
+ this->value.call(on_contact_begin, Rucy::value(e));
310
358
  else
311
- Super::on_control_change(e);
359
+ Super::on_contact_begin(e);
312
360
  }
313
361
 
314
- virtual void on_capture (CaptureEvent* e)
362
+ virtual void on_contact_end (ContactEvent* e)
315
363
  {
316
- RUCY_SYM(on_capture);
364
+ RUCY_SYM_B(on_contact_end);
317
365
  if (this->is_overridable())
318
- this->value.call(on_capture, Rucy::value(e));
366
+ this->value.call(on_contact_end, Rucy::value(e));
319
367
  else
320
- Super::on_capture(e);
368
+ Super::on_contact_end(e);
321
369
  }
322
370
 
323
- virtual void on_timer (TimerEvent* e)
371
+ virtual void on_midi (MIDIEvent* e)
324
372
  {
325
- RUCY_SYM(on_timer);
373
+ RUCY_SYM(on_midi);
326
374
  if (this->is_overridable())
327
- this->value.call(on_timer, Rucy::value(e));
375
+ this->value.call(on_midi, Rucy::value(e));
328
376
  else
329
- Super::on_timer(e);
377
+ Super::on_midi(e);
330
378
  }
331
379
 
332
- virtual bool will_contact (View* v)
380
+ virtual void on_note (NoteEvent* e)
333
381
  {
334
- RUCY_SYM_Q(will_contact);
382
+ RUCY_SYM(on_note);
335
383
  if (this->is_overridable())
336
- return this->value.call(will_contact, Rucy::value(v));
384
+ this->value.call(on_note, Rucy::value(e));
337
385
  else
338
- return Super::will_contact(v);
386
+ Super::on_note(e);
339
387
  }
340
388
 
341
- virtual void on_contact (ContactEvent* e)
389
+ virtual void on_note_on (NoteEvent* e)
342
390
  {
343
- RUCY_SYM_B(on_contact);
391
+ RUCY_SYM(on_note_on);
344
392
  if (this->is_overridable())
345
- this->value.call(on_contact, Rucy::value(e));
393
+ this->value.call(on_note_on, Rucy::value(e));
346
394
  else
347
- Super::on_contact(e);
395
+ Super::on_note_on(e);
348
396
  }
349
397
 
350
- virtual void on_contact_begin (ContactEvent* e)
398
+ virtual void on_note_off (NoteEvent* e)
351
399
  {
352
- RUCY_SYM_B(on_contact_begin);
400
+ RUCY_SYM(on_note_off);
353
401
  if (this->is_overridable())
354
- this->value.call(on_contact_begin, Rucy::value(e));
402
+ this->value.call(on_note_off, Rucy::value(e));
355
403
  else
356
- Super::on_contact_begin(e);
404
+ Super::on_note_off(e);
357
405
  }
358
406
 
359
- virtual void on_contact_end (ContactEvent* e)
407
+ virtual void on_control_change (ControlChangeEvent* e)
360
408
  {
361
- RUCY_SYM_B(on_contact_end);
409
+ RUCY_SYM(on_control_change);
362
410
  if (this->is_overridable())
363
- this->value.call(on_contact_end, Rucy::value(e));
411
+ this->value.call(on_control_change, Rucy::value(e));
364
412
  else
365
- Super::on_contact_end(e);
413
+ Super::on_control_change(e);
366
414
  }
367
415
 
368
416
  };// RubyView
@@ -31,9 +31,14 @@ namespace Reflex
31
31
 
32
32
  virtual void on_show (Event* e)
33
33
  {
34
- RUCY_SYM(on_show);
35
34
  if (this->is_overridable())
35
+ {
36
+ RUCY_SYM(call_show_block);
37
+ this->value.call(call_show_block);
38
+
39
+ RUCY_SYM(on_show);
36
40
  this->value.call(on_show, Rucy::value(e));
41
+ }
37
42
  else
38
43
  return Super::on_show(e);
39
44
  }
@@ -137,6 +142,33 @@ namespace Reflex
137
142
  Super::on_key_up(e);
138
143
  }
139
144
 
145
+ virtual void on_text (TextEvent* e)
146
+ {
147
+ RUCY_SYM(on_text);
148
+ if (this->is_overridable())
149
+ this->value.call(on_text, Rucy::value(e));
150
+ else
151
+ Super::on_text(e);
152
+ }
153
+
154
+ virtual void on_text_preedit (TextEvent* e)
155
+ {
156
+ RUCY_SYM(on_text_preedit);
157
+ if (this->is_overridable())
158
+ this->value.call(on_text_preedit, Rucy::value(e));
159
+ else
160
+ Super::on_text_preedit(e);
161
+ }
162
+
163
+ virtual void on_text_commit (TextEvent* e)
164
+ {
165
+ RUCY_SYM(on_text_commit);
166
+ if (this->is_overridable())
167
+ this->value.call(on_text_commit, Rucy::value(e));
168
+ else
169
+ Super::on_text_commit(e);
170
+ }
171
+
140
172
  virtual void on_pointer (PointerEvent* e)
141
173
  {
142
174
  RUCY_SYM(on_pointer);
@@ -209,6 +241,33 @@ namespace Reflex
209
241
  Super::on_wheel(e);
210
242
  }
211
243
 
244
+ virtual void on_file (FileEvent* e)
245
+ {
246
+ RUCY_SYM(on_file);
247
+ if (this->is_overridable())
248
+ this->value.call(on_file, Rucy::value(e));
249
+ else
250
+ Super::on_file(e);
251
+ }
252
+
253
+ virtual void on_file_open (FileEvent* e)
254
+ {
255
+ RUCY_SYM(on_file_open);
256
+ if (this->is_overridable())
257
+ this->value.call(on_file_open, Rucy::value(e));
258
+ else
259
+ Super::on_file_open(e);
260
+ }
261
+
262
+ virtual void on_file_save (FileEvent* e)
263
+ {
264
+ RUCY_SYM(on_file_save);
265
+ if (this->is_overridable())
266
+ this->value.call(on_file_save, Rucy::value(e));
267
+ else
268
+ Super::on_file_save(e);
269
+ }
270
+
212
271
  virtual void on_midi (MIDIEvent* e)
213
272
  {
214
273
  RUCY_SYM(on_midi);
@@ -20,6 +20,9 @@
20
20
  #include <reflex/ruby/window.h>
21
21
  #include <reflex/ruby/view.h>
22
22
  #include <reflex/ruby/screen.h>
23
+ #include <reflex/ruby/clipboard.h>
24
+ #include <reflex/ruby/file_dialog.h>
25
+ #include <reflex/ruby/color_picker.h>
23
26
 
24
27
  #include <reflex/ruby/image_view.h>
25
28
 
@@ -4,6 +4,7 @@
4
4
  #define __REFLEX_SCREEN_H__
5
5
 
6
6
 
7
+ #include <vector>
7
8
  #include <xot/pimpl.h>
8
9
  #include <rays/bounds.h>
9
10
  #include <reflex/defs.h>
@@ -20,16 +21,24 @@ namespace Reflex
20
21
 
21
22
  public:
22
23
 
24
+ typedef std::vector<Screen> List;
25
+
23
26
  Screen ();
24
27
 
25
- virtual ~Screen ();
28
+ ~Screen ();
29
+
30
+ String name () const;
26
31
 
27
- virtual Bounds frame () const;
32
+ Bounds frame () const;
33
+
34
+ float pixel_density () const;
28
35
 
29
36
  operator bool () const;
30
37
 
31
38
  bool operator ! () const;
32
39
 
40
+ static List all ();
41
+
33
42
  struct Data;
34
43
 
35
44
  Xot::PSharedImpl<Data> self;