reflexion 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (329) hide show
  1. checksums.yaml +5 -5
  2. data/.doc/ext/reflex/application.cpp +9 -5
  3. data/.doc/ext/reflex/capture_event.cpp +0 -4
  4. data/.doc/ext/reflex/contact_event.cpp +17 -10
  5. data/.doc/ext/reflex/draw_event.cpp +1 -5
  6. data/.doc/ext/reflex/ellipse_shape.cpp +51 -24
  7. data/.doc/ext/reflex/event.cpp +0 -4
  8. data/.doc/ext/reflex/filter.cpp +81 -0
  9. data/.doc/ext/reflex/focus_event.cpp +9 -13
  10. data/.doc/ext/reflex/frame_event.cpp +40 -6
  11. data/.doc/ext/reflex/image_view.cpp +1 -10
  12. data/.doc/ext/reflex/key_event.cpp +2 -6
  13. data/.doc/ext/reflex/line_shape.cpp +99 -0
  14. data/.doc/ext/reflex/motion_event.cpp +75 -0
  15. data/.doc/ext/reflex/native.cpp +18 -18
  16. data/.doc/ext/reflex/pointer_event.cpp +5 -11
  17. data/.doc/ext/reflex/polygon_shape.cpp +65 -0
  18. data/.doc/ext/reflex/rect_shape.cpp +102 -23
  19. data/.doc/ext/reflex/reflex.cpp +21 -2
  20. data/.doc/ext/reflex/scroll_event.cpp +0 -6
  21. data/.doc/ext/reflex/selector.cpp +43 -15
  22. data/.doc/ext/reflex/shape.cpp +211 -0
  23. data/.doc/ext/reflex/style.cpp +359 -185
  24. data/.doc/ext/reflex/style_length.cpp +163 -35
  25. data/.doc/ext/reflex/timer.cpp +101 -0
  26. data/.doc/ext/reflex/timer_event.cpp +123 -0
  27. data/.doc/ext/reflex/update_event.cpp +11 -6
  28. data/.doc/ext/reflex/view.cpp +548 -144
  29. data/.doc/ext/reflex/wheel_event.cpp +0 -22
  30. data/.doc/ext/reflex/window.cpp +7 -15
  31. data/README.md +1 -1
  32. data/Rakefile +14 -12
  33. data/VERSION +1 -1
  34. data/ext/reflex/application.cpp +10 -5
  35. data/ext/reflex/capture_event.cpp +1 -5
  36. data/ext/reflex/contact_event.cpp +19 -11
  37. data/ext/reflex/defs.h +5 -2
  38. data/ext/reflex/draw_event.cpp +2 -6
  39. data/ext/reflex/ellipse_shape.cpp +56 -25
  40. data/ext/reflex/event.cpp +0 -4
  41. data/ext/reflex/extconf.rb +1 -2
  42. data/ext/reflex/filter.cpp +86 -0
  43. data/ext/reflex/focus_event.cpp +11 -15
  44. data/ext/reflex/frame_event.cpp +46 -7
  45. data/ext/reflex/image_view.cpp +1 -10
  46. data/ext/reflex/key_event.cpp +3 -7
  47. data/ext/reflex/line_shape.cpp +104 -0
  48. data/ext/reflex/motion_event.cpp +79 -0
  49. data/ext/reflex/native.cpp +18 -18
  50. data/ext/reflex/pointer_event.cpp +6 -12
  51. data/ext/reflex/polygon_shape.cpp +68 -0
  52. data/ext/reflex/rect_shape.cpp +113 -24
  53. data/ext/reflex/reflex.cpp +21 -2
  54. data/ext/reflex/scroll_event.cpp +1 -7
  55. data/ext/reflex/selector.cpp +46 -16
  56. data/ext/reflex/selector.h +130 -0
  57. data/ext/reflex/shape.cpp +231 -0
  58. data/ext/reflex/style.cpp +363 -192
  59. data/ext/reflex/style_length.cpp +164 -37
  60. data/ext/reflex/timer.cpp +108 -0
  61. data/ext/reflex/timer_event.cpp +133 -0
  62. data/ext/reflex/update_event.cpp +13 -7
  63. data/ext/reflex/view.cpp +594 -150
  64. data/ext/reflex/wheel_event.cpp +1 -25
  65. data/ext/reflex/window.cpp +7 -15
  66. data/include/reflex/application.h +2 -0
  67. data/include/reflex/debug.h +22 -0
  68. data/include/reflex/defs.h +45 -0
  69. data/include/reflex/event.h +60 -16
  70. data/include/reflex/exception.h +9 -0
  71. data/include/reflex/filter.h +56 -0
  72. data/include/reflex/image_view.h +1 -1
  73. data/include/reflex/ruby/application.h +17 -9
  74. data/include/reflex/ruby/event.h +22 -0
  75. data/include/reflex/ruby/filter.h +69 -0
  76. data/include/reflex/ruby/selector.h +1 -1
  77. data/include/reflex/ruby/shape.h +140 -0
  78. data/include/reflex/ruby/style.h +1 -1
  79. data/include/reflex/ruby/timer.h +69 -0
  80. data/include/reflex/ruby/view.h +43 -76
  81. data/include/reflex/ruby/window.h +17 -32
  82. data/include/reflex/ruby.h +6 -4
  83. data/include/reflex/selector.h +54 -2
  84. data/include/reflex/shape.h +211 -0
  85. data/include/reflex/style.h +111 -77
  86. data/include/reflex/timer.h +73 -0
  87. data/include/reflex/view.h +181 -59
  88. data/include/reflex/window.h +4 -3
  89. data/include/reflex.h +5 -4
  90. data/lib/reflex/application.rb +6 -3
  91. data/lib/reflex/button.rb +2 -2
  92. data/lib/reflex/capture_event.rb +7 -6
  93. data/lib/reflex/contact_event.rb +10 -12
  94. data/lib/reflex/draw_event.rb +6 -1
  95. data/lib/reflex/ellipse_shape.rb +27 -0
  96. data/lib/reflex/filter.rb +18 -0
  97. data/lib/reflex/fixture.rb +4 -0
  98. data/lib/reflex/focus_event.rb +10 -12
  99. data/lib/reflex/frame_event.rb +1 -1
  100. data/lib/reflex/helper.rb +17 -29
  101. data/lib/reflex/key_event.rb +13 -11
  102. data/lib/reflex/line_shape.rb +18 -0
  103. data/lib/reflex/{texture.rb → matrix.rb} +2 -2
  104. data/lib/reflex/module.rb +4 -19
  105. data/lib/reflex/pointer_event.rb +26 -37
  106. data/lib/reflex/polygon.rb +14 -0
  107. data/lib/reflex/polygon_shape.rb +23 -0
  108. data/lib/reflex/polyline.rb +13 -0
  109. data/lib/reflex/rect_shape.rb +20 -0
  110. data/lib/reflex/reflex.rb +1 -3
  111. data/lib/reflex/scroll_event.rb +1 -1
  112. data/lib/reflex/selector.rb +2 -2
  113. data/lib/reflex/shape.rb +62 -0
  114. data/lib/reflex/style.rb +78 -11
  115. data/lib/reflex/style_length.rb +0 -11
  116. data/lib/reflex/text_view.rb +7 -24
  117. data/lib/reflex/timer.rb +30 -0
  118. data/lib/reflex/timer_event.rb +29 -0
  119. data/lib/reflex/update_event.rb +1 -1
  120. data/lib/reflex/view.rb +127 -32
  121. data/lib/reflex/wheel_event.rb +9 -1
  122. data/lib/reflex/window.rb +29 -9
  123. data/lib/reflex.rb +11 -5
  124. data/lib/reflexion.rb +23 -7
  125. data/reflex.gemspec +8 -10
  126. data/samples/bats.rb +4 -4
  127. data/samples/fans.rb +1 -1
  128. data/samples/fps.rb +5 -3
  129. data/samples/hello.rb +4 -6
  130. data/samples/image.rb +5 -4
  131. data/samples/ios/hello/hello.xcodeproj/project.pbxproj +0 -2
  132. data/samples/layout.rb +16 -7
  133. data/samples/model.rb +10 -7
  134. data/samples/physics.rb +22 -20
  135. data/samples/reflexion/breakout.rb +4 -5
  136. data/samples/reflexion/hello.rb +2 -2
  137. data/samples/reflexion/jump_action.rb +191 -0
  138. data/samples/reflexion/noise.rb +23 -0
  139. data/samples/reflexion/paint.rb +7 -6
  140. data/samples/reflexion/physics.rb +15 -8
  141. data/samples/reflexion/pulse.rb +24 -10
  142. data/samples/shader.rb +8 -6
  143. data/samples/shapes.rb +63 -14
  144. data/samples/tree.rb +9 -10
  145. data/samples/views.rb +3 -3
  146. data/samples/visuals.rb +2 -5
  147. data/src/body.cpp +146 -345
  148. data/src/body.h +91 -0
  149. data/src/event.cpp +66 -16
  150. data/src/exception.cpp +13 -3
  151. data/src/filter.cpp +76 -0
  152. data/src/fixture.cpp +164 -39
  153. data/src/fixture.h +85 -0
  154. data/src/image_view.cpp +4 -4
  155. data/src/ios/app_delegate.h +5 -10
  156. data/src/ios/app_delegate.mm +79 -41
  157. data/src/ios/application.h +32 -0
  158. data/src/ios/application.mm +35 -25
  159. data/src/ios/event.mm +8 -4
  160. data/src/ios/reflex.mm +0 -7
  161. data/src/ios/view_controller.h +33 -0
  162. data/src/ios/view_controller.mm +436 -0
  163. data/src/ios/window.h +40 -0
  164. data/src/ios/window.mm +59 -250
  165. data/src/osx/app_delegate.h +5 -10
  166. data/src/osx/app_delegate.mm +52 -55
  167. data/src/osx/application.h +32 -0
  168. data/src/osx/application.mm +44 -39
  169. data/src/osx/native_window.h +0 -15
  170. data/src/osx/native_window.mm +131 -115
  171. data/src/osx/opengl_view.h +0 -2
  172. data/src/osx/opengl_view.mm +12 -3
  173. data/src/osx/reflex.mm +0 -9
  174. data/src/osx/window.h +42 -0
  175. data/src/osx/window.mm +45 -252
  176. data/src/selector.cpp +232 -7
  177. data/src/selector.h +52 -0
  178. data/src/shape.cpp +1191 -0
  179. data/src/shape.h +61 -0
  180. data/src/style.cpp +571 -374
  181. data/src/style.h +39 -0
  182. data/src/timer.cpp +291 -0
  183. data/src/timer.h +55 -0
  184. data/src/view.cpp +1624 -984
  185. data/src/view.h +56 -0
  186. data/src/win32/window.cpp +3 -4
  187. data/src/window.cpp +275 -20
  188. data/src/window.h +92 -0
  189. data/src/world.cpp +112 -111
  190. data/src/world.h +34 -53
  191. data/task/box2d.rake +31 -10
  192. data/test/test_capture_event.rb +8 -6
  193. data/test/test_pointer_event.rb +85 -0
  194. data/test/test_selector.rb +1 -1
  195. data/test/test_shape.rb +71 -0
  196. data/test/test_style.rb +77 -11
  197. data/test/test_style_length.rb +42 -13
  198. data/test/test_view.rb +138 -14
  199. metadata +109 -210
  200. data/.doc/ext/reflex/arc_shape.cpp +0 -89
  201. data/.doc/ext/reflex/body.cpp +0 -299
  202. data/.doc/ext/reflex/fixture.cpp +0 -101
  203. data/.doc/ext/reflex/shape_view.cpp +0 -153
  204. data/ext/reflex/arc_shape.cpp +0 -94
  205. data/ext/reflex/body.cpp +0 -328
  206. data/ext/reflex/fixture.cpp +0 -108
  207. data/ext/reflex/shape_view.cpp +0 -161
  208. data/include/reflex/bitmap.h +0 -20
  209. data/include/reflex/body.h +0 -128
  210. data/include/reflex/bounds.h +0 -20
  211. data/include/reflex/color.h +0 -20
  212. data/include/reflex/color_space.h +0 -20
  213. data/include/reflex/fixture.h +0 -117
  214. data/include/reflex/font.h +0 -20
  215. data/include/reflex/image.h +0 -20
  216. data/include/reflex/matrix.h +0 -20
  217. data/include/reflex/painter.h +0 -20
  218. data/include/reflex/point.h +0 -24
  219. data/include/reflex/ruby/body.h +0 -41
  220. data/include/reflex/ruby/fixture.h +0 -41
  221. data/include/reflex/ruby/shape_view.h +0 -96
  222. data/include/reflex/shader.h +0 -20
  223. data/include/reflex/shape_view.h +0 -146
  224. data/include/reflex/texture.h +0 -20
  225. data/lib/reflex/body.rb +0 -22
  226. data/lib/reflex/flags.rb +0 -18
  227. data/lib/reflex/shape_view.rb +0 -25
  228. data/src/ios/application_data.h +0 -45
  229. data/src/ios/native_window.h +0 -39
  230. data/src/ios/native_window.mm +0 -224
  231. data/src/ios/opengl_view.h +0 -13
  232. data/src/ios/opengl_view.mm +0 -139
  233. data/src/ios/window_data.h +0 -75
  234. data/src/osx/application_data.h +0 -45
  235. data/src/osx/window_data.h +0 -75
  236. data/src/physics/Box2D/Box2D.h +0 -68
  237. data/src/physics/Box2D/Collision/Shapes/b2ChainShape.cpp +0 -193
  238. data/src/physics/Box2D/Collision/Shapes/b2ChainShape.h +0 -105
  239. data/src/physics/Box2D/Collision/Shapes/b2CircleShape.cpp +0 -99
  240. data/src/physics/Box2D/Collision/Shapes/b2CircleShape.h +0 -91
  241. data/src/physics/Box2D/Collision/Shapes/b2EdgeShape.cpp +0 -138
  242. data/src/physics/Box2D/Collision/Shapes/b2EdgeShape.h +0 -74
  243. data/src/physics/Box2D/Collision/Shapes/b2PolygonShape.cpp +0 -467
  244. data/src/physics/Box2D/Collision/Shapes/b2PolygonShape.h +0 -101
  245. data/src/physics/Box2D/Collision/Shapes/b2Shape.h +0 -101
  246. data/src/physics/Box2D/Collision/b2BroadPhase.cpp +0 -119
  247. data/src/physics/Box2D/Collision/b2BroadPhase.h +0 -257
  248. data/src/physics/Box2D/Collision/b2CollideCircle.cpp +0 -154
  249. data/src/physics/Box2D/Collision/b2CollideEdge.cpp +0 -698
  250. data/src/physics/Box2D/Collision/b2CollidePolygon.cpp +0 -239
  251. data/src/physics/Box2D/Collision/b2Collision.cpp +0 -252
  252. data/src/physics/Box2D/Collision/b2Collision.h +0 -277
  253. data/src/physics/Box2D/Collision/b2Distance.cpp +0 -603
  254. data/src/physics/Box2D/Collision/b2Distance.h +0 -141
  255. data/src/physics/Box2D/Collision/b2DynamicTree.cpp +0 -778
  256. data/src/physics/Box2D/Collision/b2DynamicTree.h +0 -289
  257. data/src/physics/Box2D/Collision/b2TimeOfImpact.cpp +0 -486
  258. data/src/physics/Box2D/Collision/b2TimeOfImpact.h +0 -58
  259. data/src/physics/Box2D/Common/b2BlockAllocator.cpp +0 -215
  260. data/src/physics/Box2D/Common/b2BlockAllocator.h +0 -62
  261. data/src/physics/Box2D/Common/b2Draw.cpp +0 -44
  262. data/src/physics/Box2D/Common/b2Draw.h +0 -86
  263. data/src/physics/Box2D/Common/b2GrowableStack.h +0 -85
  264. data/src/physics/Box2D/Common/b2Math.cpp +0 -94
  265. data/src/physics/Box2D/Common/b2Math.h +0 -720
  266. data/src/physics/Box2D/Common/b2Settings.cpp +0 -44
  267. data/src/physics/Box2D/Common/b2Settings.h +0 -151
  268. data/src/physics/Box2D/Common/b2StackAllocator.cpp +0 -83
  269. data/src/physics/Box2D/Common/b2StackAllocator.h +0 -60
  270. data/src/physics/Box2D/Common/b2Timer.cpp +0 -101
  271. data/src/physics/Box2D/Common/b2Timer.h +0 -50
  272. data/src/physics/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp +0 -53
  273. data/src/physics/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h +0 -39
  274. data/src/physics/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp +0 -53
  275. data/src/physics/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h +0 -39
  276. data/src/physics/Box2D/Dynamics/Contacts/b2CircleContact.cpp +0 -52
  277. data/src/physics/Box2D/Dynamics/Contacts/b2CircleContact.h +0 -39
  278. data/src/physics/Box2D/Dynamics/Contacts/b2Contact.cpp +0 -247
  279. data/src/physics/Box2D/Dynamics/Contacts/b2Contact.h +0 -349
  280. data/src/physics/Box2D/Dynamics/Contacts/b2ContactSolver.cpp +0 -838
  281. data/src/physics/Box2D/Dynamics/Contacts/b2ContactSolver.h +0 -95
  282. data/src/physics/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp +0 -49
  283. data/src/physics/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h +0 -39
  284. data/src/physics/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp +0 -49
  285. data/src/physics/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h +0 -39
  286. data/src/physics/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp +0 -49
  287. data/src/physics/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h +0 -38
  288. data/src/physics/Box2D/Dynamics/Contacts/b2PolygonContact.cpp +0 -52
  289. data/src/physics/Box2D/Dynamics/Contacts/b2PolygonContact.h +0 -39
  290. data/src/physics/Box2D/Dynamics/Joints/b2DistanceJoint.cpp +0 -260
  291. data/src/physics/Box2D/Dynamics/Joints/b2DistanceJoint.h +0 -169
  292. data/src/physics/Box2D/Dynamics/Joints/b2FrictionJoint.cpp +0 -251
  293. data/src/physics/Box2D/Dynamics/Joints/b2FrictionJoint.h +0 -119
  294. data/src/physics/Box2D/Dynamics/Joints/b2GearJoint.cpp +0 -419
  295. data/src/physics/Box2D/Dynamics/Joints/b2GearJoint.h +0 -125
  296. data/src/physics/Box2D/Dynamics/Joints/b2Joint.cpp +0 -211
  297. data/src/physics/Box2D/Dynamics/Joints/b2Joint.h +0 -226
  298. data/src/physics/Box2D/Dynamics/Joints/b2MotorJoint.cpp +0 -304
  299. data/src/physics/Box2D/Dynamics/Joints/b2MotorJoint.h +0 -133
  300. data/src/physics/Box2D/Dynamics/Joints/b2MouseJoint.cpp +0 -222
  301. data/src/physics/Box2D/Dynamics/Joints/b2MouseJoint.h +0 -129
  302. data/src/physics/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp +0 -629
  303. data/src/physics/Box2D/Dynamics/Joints/b2PrismaticJoint.h +0 -196
  304. data/src/physics/Box2D/Dynamics/Joints/b2PulleyJoint.cpp +0 -348
  305. data/src/physics/Box2D/Dynamics/Joints/b2PulleyJoint.h +0 -152
  306. data/src/physics/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp +0 -502
  307. data/src/physics/Box2D/Dynamics/Joints/b2RevoluteJoint.h +0 -204
  308. data/src/physics/Box2D/Dynamics/Joints/b2RopeJoint.cpp +0 -241
  309. data/src/physics/Box2D/Dynamics/Joints/b2RopeJoint.h +0 -114
  310. data/src/physics/Box2D/Dynamics/Joints/b2WeldJoint.cpp +0 -344
  311. data/src/physics/Box2D/Dynamics/Joints/b2WeldJoint.h +0 -126
  312. data/src/physics/Box2D/Dynamics/Joints/b2WheelJoint.cpp +0 -419
  313. data/src/physics/Box2D/Dynamics/Joints/b2WheelJoint.h +0 -210
  314. data/src/physics/Box2D/Dynamics/b2Body.cpp +0 -549
  315. data/src/physics/Box2D/Dynamics/b2Body.h +0 -860
  316. data/src/physics/Box2D/Dynamics/b2ContactManager.cpp +0 -296
  317. data/src/physics/Box2D/Dynamics/b2ContactManager.h +0 -52
  318. data/src/physics/Box2D/Dynamics/b2Fixture.cpp +0 -303
  319. data/src/physics/Box2D/Dynamics/b2Fixture.h +0 -345
  320. data/src/physics/Box2D/Dynamics/b2Island.cpp +0 -539
  321. data/src/physics/Box2D/Dynamics/b2Island.h +0 -93
  322. data/src/physics/Box2D/Dynamics/b2TimeStep.h +0 -70
  323. data/src/physics/Box2D/Dynamics/b2World.cpp +0 -1339
  324. data/src/physics/Box2D/Dynamics/b2World.h +0 -354
  325. data/src/physics/Box2D/Dynamics/b2WorldCallbacks.cpp +0 -36
  326. data/src/physics/Box2D/Dynamics/b2WorldCallbacks.h +0 -155
  327. data/src/physics/Box2D/Rope/b2Rope.cpp +0 -259
  328. data/src/physics/Box2D/Rope/b2Rope.h +0 -115
  329. data/src/shape_view.cpp +0 -306
data/ext/reflex/view.cpp CHANGED
@@ -2,27 +2,27 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
- #include <rucy.h>
6
5
  #include <rays/ruby/point.h>
7
6
  #include <rays/ruby/bounds.h>
8
- #include "reflex/ruby/window.h"
7
+ #include <rays/ruby/polygon.h>
9
8
  #include "reflex/ruby/selector.h"
9
+ #include "reflex/ruby/timer.h"
10
10
  #include "reflex/ruby/style.h"
11
- #include "reflex/ruby/body.h"
12
-
13
-
14
- using namespace Rucy;
15
-
16
- using Reflex::coord;
11
+ #include "reflex/ruby/shape.h"
12
+ #include "reflex/ruby/filter.h"
13
+ #include "reflex/ruby/window.h"
14
+ #include "defs.h"
15
+ #include "selector.h"
17
16
 
18
17
 
19
18
  RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Reflex::View)
20
19
 
21
- #define THIS to<Reflex::View*>(self)
20
+ #define THIS to< Reflex::View*>(self)
21
+ #define C_THIS to<const Reflex::View*>(self)
22
22
 
23
23
  #define CHECK RUCY_CHECK_OBJECT(Reflex::View, self)
24
24
 
25
- #define CALL(fun) RUCY_WRAPPER_CALL(Reflex::View, THIS, fun)
25
+ #define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
26
26
 
27
27
 
28
28
  template <typename T>
@@ -77,6 +77,59 @@ RUCY_DEF0(redraw)
77
77
  }
78
78
  RUCY_END
79
79
 
80
+ static
81
+ RUCY_DEFN(focus)
82
+ {
83
+ CHECK;
84
+ check_arg_count(__FILE__, __LINE__, "View#focus", argc, 0, 1);
85
+
86
+ bool state = (argc >= 1) ? to<bool>(argv[0]) : true;
87
+
88
+ THIS->focus(state);
89
+ return self;
90
+ }
91
+ RUCY_END
92
+
93
+ static
94
+ RUCY_DEF0(blur)
95
+ {
96
+ CHECK;
97
+ THIS->blur();
98
+ return self;
99
+ }
100
+ RUCY_END
101
+
102
+ static
103
+ RUCY_DEF0(has_focus)
104
+ {
105
+ CHECK;
106
+ return value(THIS->has_focus());
107
+ }
108
+ RUCY_END
109
+
110
+ static
111
+ RUCY_DEFN(start_timer)
112
+ {
113
+ CHECK;
114
+ check_arg_count(__FILE__, __LINE__, "View#start_timer", argc, 1, 2);
115
+
116
+ Reflex::Timer* timer = THIS->start_timer(
117
+ to<float>(argv[0]),
118
+ argc >= 2 ? to<int>(argv[1]) : 1);
119
+
120
+ return value(timer);
121
+ }
122
+ RUCY_END
123
+
124
+ static
125
+ RUCY_DEF0(update_layout)
126
+ {
127
+ CHECK;
128
+ THIS->update_layout();
129
+ return self;
130
+ }
131
+ RUCY_END
132
+
80
133
  static
81
134
  RUCY_DEF1(add_child, child)
82
135
  {
@@ -95,16 +148,25 @@ RUCY_DEF1(remove_child, child)
95
148
  }
96
149
  RUCY_END
97
150
 
151
+ static
152
+ RUCY_DEF0(clear_children)
153
+ {
154
+ CHECK;
155
+ THIS->clear_children();
156
+ return self;
157
+ }
158
+ RUCY_END
159
+
98
160
  static
99
161
  RUCY_DEFN(find_children)
100
162
  {
101
163
  CHECK;
102
164
  check_arg_count(__FILE__, __LINE__, "View#find_children", argc, 1, 2);
103
165
 
104
- bool recursive = (argc >= 2) ? to<bool>(argv[1]) : false;
166
+ bool recursive = (argc >= 2) ? to<bool>(argv[1]) : true;
105
167
 
106
- Reflex::View::ChildList children;
107
- THIS->find_children(&children, to<Reflex::Selector>(argv[0]), recursive);
168
+ Reflex::View::ChildList children =
169
+ THIS->find_children(to<Reflex::Selector>(argv[0]), recursive);
108
170
  return array(children.begin(), children.end());
109
171
  }
110
172
  RUCY_END
@@ -147,9 +209,9 @@ RUCY_DEF1(get_style, selector)
147
209
 
148
210
  Reflex::Style* s = NULL;
149
211
  if (selector)
150
- s = THIS->get_style(to<Reflex::Selector>(selector), true);
212
+ s = THIS->get_style(to<Reflex::Selector>(selector));
151
213
  else
152
- s = THIS->style(true);
214
+ s = THIS->style();
153
215
 
154
216
  return s ? value(*s) : nil();
155
217
  }
@@ -163,8 +225,8 @@ RUCY_DEFN(find_styles)
163
225
 
164
226
  bool recursive = (argc >= 2) ? to<bool>(argv[1]) : false;
165
227
 
166
- Reflex::View::StyleList styles;
167
- THIS->find_styles(&styles, to<Reflex::Selector>(argv[0]), recursive);
228
+ Reflex::View::StyleList styles =
229
+ THIS->find_styles(to<Reflex::Selector>(argv[0]), recursive);
168
230
  return array(styles.begin(), styles.end());
169
231
  }
170
232
  RUCY_END
@@ -182,143 +244,205 @@ RUCY_DEF0(each_style)
182
244
  }
183
245
  RUCY_END
184
246
 
247
+ static Reflex::Shape::Ref
248
+ to_shape (Value value)
249
+ {
250
+ if (value.is_nil())
251
+ return NULL;
252
+
253
+ if (value.is_kind_of(Rays::polygon_class()))
254
+ {
255
+ Reflex::PolygonShape* shape = new Reflex::PolygonShape();
256
+ shape->set_polygon(to<Rays::Polygon&>(value));
257
+ return shape;
258
+ }
259
+ else
260
+ return to<Reflex::Shape*>(value);
261
+ }
262
+
185
263
  static
186
- RUCY_DEFN(focus)
264
+ RUCY_DEF1(set_shape, shape)
187
265
  {
188
266
  CHECK;
189
- check_arg_count(__FILE__, __LINE__, "View#focus", argc, 0, 1);
190
-
191
- bool state = (argc >= 1) ? to<bool>(argv[0]) : true;
267
+ THIS->set_shape(to_shape(shape));
268
+ return shape;
269
+ }
270
+ RUCY_END
192
271
 
193
- THIS->focus(state);
194
- return self;
272
+ static
273
+ RUCY_DEF0(get_shape)
274
+ {
275
+ CHECK;
276
+ return value(THIS->shape());
195
277
  }
196
278
  RUCY_END
197
279
 
198
280
  static
199
- RUCY_DEF0(blur)
281
+ RUCY_DEF1(add_shape, shape)
200
282
  {
201
283
  CHECK;
202
- THIS->blur();
203
- return self;
284
+ THIS->add_shape(to_shape(shape));
285
+ return shape;
204
286
  }
205
287
  RUCY_END
206
288
 
207
289
  static
208
- RUCY_DEF0(has_focus)
290
+ RUCY_DEF1(remove_shape, shape)
209
291
  {
210
292
  CHECK;
211
- return value(THIS->has_focus());
293
+ THIS->remove_shape(to<Reflex::Shape*>(shape));
294
+ return shape;
212
295
  }
213
296
  RUCY_END
214
297
 
215
298
  static
216
- RUCY_DEF0(resize_to_fit)
299
+ RUCY_DEF0(clear_shapes)
217
300
  {
218
301
  CHECK;
219
- THIS->resize_to_fit();
302
+ THIS->clear_shapes();
220
303
  return self;
221
304
  }
222
305
  RUCY_END
223
306
 
224
307
  static
225
- RUCY_DEF0(content_size)
308
+ RUCY_DEFN(find_shapes)
226
309
  {
227
310
  CHECK;
228
- return value(CALL(content_size()));
311
+ check_arg_count(__FILE__, __LINE__, "View#find_shapes", argc, 1);
312
+
313
+ Reflex::View::ShapeList shapes =
314
+ THIS->find_shapes(to<Reflex::Selector>(argv[0]));
315
+ return array(shapes.begin(), shapes.end());
229
316
  }
230
317
  RUCY_END
231
318
 
232
319
  static
233
- RUCY_DEF0(make_body)
320
+ RUCY_DEF0(each_shape)
234
321
  {
235
322
  CHECK;
236
- CALL(make_body());
323
+
324
+ Value ret;
325
+ Reflex::View::shape_iterator end = THIS->shape_end();
326
+ for (Reflex::View::shape_iterator it = THIS->shape_begin(); it != end; ++it)
327
+ ret = rb_yield(value(it->get()));
328
+ return ret;
237
329
  }
238
330
  RUCY_END
239
331
 
240
332
  static
241
- RUCY_DEF0(clear_body)
333
+ RUCY_DEF1(set_filter, filter)
242
334
  {
243
335
  CHECK;
244
- THIS->clear_body();
336
+ THIS->set_filter(filter ? to<Reflex::Filter*>(filter) : NULL);
337
+ return filter;
245
338
  }
246
339
  RUCY_END
247
340
 
248
341
  static
249
- RUCY_DEF1(set_name, name)
342
+ RUCY_DEF0(get_filter)
250
343
  {
251
344
  CHECK;
252
- THIS->set_name(name.is_nil() ? NULL : name.c_str());
345
+ return value(THIS->filter());
253
346
  }
254
347
  RUCY_END
255
348
 
256
349
  static
257
- RUCY_DEF0(get_name)
350
+ RUCY_DEFN(set_frame)
258
351
  {
259
352
  CHECK;
260
- return THIS->name() ? value(THIS->name()) : nil();
353
+ THIS->set_frame(to<Rays::Bounds>(argc, argv));
354
+ return value(THIS->frame());
261
355
  }
262
356
  RUCY_END
263
357
 
264
358
  static
265
- RUCY_DEF1(add_tag, tag)
359
+ RUCY_DEF0(get_frame)
266
360
  {
267
361
  CHECK;
268
- THIS->add_tag(tag.c_str());
362
+ return value(THIS->frame());
269
363
  }
270
364
  RUCY_END
271
365
 
272
366
  static
273
- RUCY_DEF1(remove_tag, tag)
367
+ RUCY_DEF0(content_bounds)
274
368
  {
275
369
  CHECK;
276
- THIS->remove_tag(tag.c_str());
370
+ return value(CALL(content_bounds()));
277
371
  }
278
372
  RUCY_END
279
373
 
280
374
  static
281
- RUCY_DEF0(each_tag)
375
+ RUCY_DEF0(fit_to_content)
282
376
  {
283
377
  CHECK;
378
+ THIS->fit_to_content();
379
+ return self;
380
+ }
381
+ RUCY_END
284
382
 
285
- Value ret;
286
- Reflex::View::tag_iterator end = THIS->tag_end();
287
- for (Reflex::View::tag_iterator it = THIS->tag_begin(); it != end; ++it)
288
- ret = rb_yield(value(*it));
289
- return ret;
383
+ static
384
+ RUCY_DEF1(set_angle, degree)
385
+ {
386
+ CHECK;
387
+ THIS->set_angle(to<float>(degree));
388
+ return degree;
290
389
  }
291
390
  RUCY_END
292
391
 
293
392
  static
294
- RUCY_DEF1(set_selector, selector)
393
+ RUCY_DEF0(get_angle)
295
394
  {
296
395
  CHECK;
297
- THIS->set_selector(to<Reflex::Selector>(selector));
396
+ return value(THIS->angle());
298
397
  }
299
398
  RUCY_END
300
399
 
301
400
  static
302
- RUCY_DEF0(get_selector)
401
+ RUCY_DEFN(scroll_to)
303
402
  {
304
403
  CHECK;
305
- return value(THIS->selector());
404
+ check_arg_count(__FILE__, __LINE__, "View#scroll_to", argc, 1, 2, 3);
405
+
406
+ if (argv[0].is_kind_of(Rays::point_class()))
407
+ THIS->scroll_to(to<Rays::Point&>(argv[0]));
408
+ else
409
+ {
410
+ const Rays::Point& p = THIS->scroll();
411
+ coord x = (argc >= 1 && argv[0]) ? to<coord>(argv[0]) : p.x;
412
+ coord y = (argc >= 2 && argv[1]) ? to<coord>(argv[1]) : p.y;
413
+ coord z = (argc >= 3 && argv[2]) ? to<coord>(argv[2]) : p.z;
414
+ THIS->scroll_to(x, y, z);
415
+ }
416
+
417
+ return self;
306
418
  }
307
419
  RUCY_END
308
420
 
309
421
  static
310
- RUCY_DEF1(set_frame, arg)
422
+ RUCY_DEFN(scroll_by)
311
423
  {
312
424
  CHECK;
313
- THIS->set_frame(to<Rays::Bounds>(arg));
425
+ check_arg_count(__FILE__, __LINE__, "View#scroll_by", argc, 1, 2, 3);
426
+
427
+ if (argv[0].is_kind_of(Rays::point_class()))
428
+ THIS->scroll_by(to<Rays::Point&>(argv[0]));
429
+ else
430
+ {
431
+ coord x = (argc >= 1 && argv[0]) ? to<coord>(argv[0]) : 0;
432
+ coord y = (argc >= 2 && argv[1]) ? to<coord>(argv[1]) : 0;
433
+ coord z = (argc >= 3 && argv[2]) ? to<coord>(argv[2]) : 0;
434
+ THIS->scroll_by(x, y, z);
435
+ }
436
+
437
+ return self;
314
438
  }
315
439
  RUCY_END
316
440
 
317
441
  static
318
- RUCY_DEF0(get_frame)
442
+ RUCY_DEF0(get_scroll)
319
443
  {
320
444
  CHECK;
321
- return value(THIS->frame());
445
+ return value(THIS->scroll());
322
446
  }
323
447
  RUCY_END
324
448
 
@@ -327,6 +451,7 @@ RUCY_DEF1(set_zoom, zoom)
327
451
  {
328
452
  CHECK;
329
453
  THIS->set_zoom(to<float>(zoom));
454
+ return zoom;
330
455
  }
331
456
  RUCY_END
332
457
 
@@ -339,75 +464,107 @@ RUCY_DEF0(get_zoom)
339
464
  RUCY_END
340
465
 
341
466
  static
342
- RUCY_DEF0(get_angle)
467
+ RUCY_DEF1(set_capture, types)
343
468
  {
344
469
  CHECK;
345
- return value(THIS->angle());
470
+ THIS->set_capture(to<uint>(types));
471
+ return types;
346
472
  }
347
473
  RUCY_END
348
474
 
349
475
  static
350
- RUCY_DEF1(set_capture, types)
476
+ RUCY_DEF0(get_capture)
351
477
  {
352
478
  CHECK;
353
- THIS->set_capture(to<uint>(types));
479
+ return value(THIS->capture());
354
480
  }
355
481
  RUCY_END
356
482
 
357
483
  static
358
- RUCY_DEF0(get_capture)
484
+ RUCY_DEF1(set_clip, clip)
359
485
  {
360
486
  CHECK;
361
- return value(THIS->capture());
487
+
488
+ if (clip)
489
+ THIS-> add_flag(Reflex::View::FLAG_CLIP);
490
+ else
491
+ THIS->remove_flag(Reflex::View::FLAG_CLIP);
492
+
493
+ return clip;
362
494
  }
363
495
  RUCY_END
364
496
 
365
497
  static
366
- RUCY_DEFN(scroll_to)
498
+ RUCY_DEF0(get_clip)
367
499
  {
368
500
  CHECK;
369
- check_arg_count(__FILE__, __LINE__, "View#scroll_to", argc, 1, 2, 3);
501
+ return value(THIS->has_flag(Reflex::View::FLAG_CLIP));
502
+ }
503
+ RUCY_END
370
504
 
371
- if (argv[0].is_kind_of(Rays::point_class()))
372
- THIS->scroll_to(to<Rays::Point&>(argv[0]));
505
+ static
506
+ RUCY_DEF1(set_cache, cache)
507
+ {
508
+ CHECK;
509
+
510
+ if (cache)
511
+ THIS-> add_flag(Reflex::View::FLAG_CACHE);
373
512
  else
374
- {
375
- const Rays::Point& p = THIS->scroll();
376
- coord x = (argc >= 1 && argv[0]) ? to<coord>(argv[0]) : p.x;
377
- coord y = (argc >= 2 && argv[1]) ? to<coord>(argv[1]) : p.y;
378
- coord z = (argc >= 3 && argv[2]) ? to<coord>(argv[2]) : p.z;
379
- THIS->scroll_to(x, y, z);
380
- }
513
+ THIS->remove_flag(Reflex::View::FLAG_CACHE);
381
514
 
382
- return self;
515
+ return cache;
383
516
  }
384
517
  RUCY_END
385
518
 
386
519
  static
387
- RUCY_DEFN(scroll_by)
520
+ RUCY_DEF0(get_cache)
388
521
  {
389
522
  CHECK;
390
- check_arg_count(__FILE__, __LINE__, "View#scroll_by", argc, 1, 2, 3);
523
+ return value(THIS->has_flag(Reflex::View::FLAG_CACHE));
524
+ }
525
+ RUCY_END
391
526
 
392
- if (argv[0].is_kind_of(Rays::point_class()))
393
- THIS->scroll_by(to<Rays::Point&>(argv[0]));
527
+ static
528
+ RUCY_DEF1(set_resize_to_fit, resize)
529
+ {
530
+ CHECK;
531
+
532
+ if (resize)
533
+ THIS-> add_flag(Reflex::View::FLAG_RESIZE_TO_FIT);
394
534
  else
395
- {
396
- coord x = (argc >= 1 && argv[0]) ? to<coord>(argv[0]) : 0;
397
- coord y = (argc >= 2 && argv[1]) ? to<coord>(argv[1]) : 0;
398
- coord z = (argc >= 3 && argv[2]) ? to<coord>(argv[2]) : 0;
399
- THIS->scroll_by(x, y, z);
400
- }
535
+ THIS->remove_flag(Reflex::View::FLAG_RESIZE_TO_FIT);
401
536
 
402
- return self;
537
+ return resize;
403
538
  }
404
539
  RUCY_END
405
540
 
406
541
  static
407
- RUCY_DEF0(get_scroll)
542
+ RUCY_DEF0(get_resize_to_fit)
408
543
  {
409
544
  CHECK;
410
- return value(THIS->scroll());
545
+ return value(THIS->has_flag(Reflex::View::FLAG_RESIZE_TO_FIT));
546
+ }
547
+ RUCY_END
548
+
549
+ static
550
+ RUCY_DEF1(set_scroll_to_fit, scroll)
551
+ {
552
+ CHECK;
553
+
554
+ if (scroll)
555
+ THIS-> add_flag(Reflex::View::FLAG_SCROLL_TO_FIT);
556
+ else
557
+ THIS->remove_flag(Reflex::View::FLAG_SCROLL_TO_FIT);
558
+
559
+ return scroll;
560
+ }
561
+ RUCY_END
562
+
563
+ static
564
+ RUCY_DEF0(get_scroll_to_fit)
565
+ {
566
+ CHECK;
567
+ return value(THIS->has_flag(Reflex::View::FLAG_SCROLL_TO_FIT));
411
568
  }
412
569
  RUCY_END
413
570
 
@@ -428,10 +585,237 @@ RUCY_DEF0(window)
428
585
  RUCY_END
429
586
 
430
587
  static
431
- RUCY_DEF0(body)
588
+ RUCY_DEFN(apply_force)
589
+ {
590
+ CHECK;
591
+ THIS->apply_force(to<Rays::Point>(argc, argv));
592
+ return self;
593
+ }
594
+ RUCY_END
595
+
596
+ static
597
+ RUCY_DEF1(apply_torque, torque)
432
598
  {
433
599
  CHECK;
434
- return value(THIS->body());
600
+ THIS->apply_torque(to<float>(torque));
601
+ return self;
602
+ }
603
+ RUCY_END
604
+
605
+ static
606
+ RUCY_DEFN(apply_linear_impulse)
607
+ {
608
+ CHECK;
609
+ THIS->apply_linear_impulse(to<Rays::Point>(argc, argv));
610
+ return self;
611
+ }
612
+ RUCY_END
613
+
614
+ static
615
+ RUCY_DEF1(apply_angular_impulse, impulse)
616
+ {
617
+ CHECK;
618
+ THIS->apply_angular_impulse(to<float>(impulse));
619
+ return self;
620
+ }
621
+ RUCY_END
622
+
623
+ static
624
+ RUCY_DEF1(set_static, state)
625
+ {
626
+ CHECK;
627
+ THIS->set_static(state);
628
+ return state;
629
+ }
630
+ RUCY_END
631
+
632
+ static
633
+ RUCY_DEF0(is_static)
634
+ {
635
+ CHECK;
636
+ return value(THIS->is_static());
637
+ }
638
+ RUCY_END
639
+
640
+ static
641
+ RUCY_DEF1(set_dynamic, state)
642
+ {
643
+ CHECK;
644
+ THIS->set_dynamic(state);
645
+ return state;
646
+ }
647
+ RUCY_END
648
+
649
+ static
650
+ RUCY_DEF0(is_dynamic)
651
+ {
652
+ CHECK;
653
+ return value(THIS->is_dynamic());
654
+ }
655
+ RUCY_END
656
+
657
+ static
658
+ RUCY_DEF1(set_density, density)
659
+ {
660
+ CHECK;
661
+ THIS->set_density(to<float>(density));
662
+ return density;
663
+ }
664
+ RUCY_END
665
+
666
+ static
667
+ RUCY_DEF0(get_density)
668
+ {
669
+ CHECK;
670
+ return value(THIS->density());
671
+ }
672
+ RUCY_END
673
+
674
+ static
675
+ RUCY_DEF1(set_friction, friction)
676
+ {
677
+ CHECK;
678
+ THIS->set_friction(to<float>(friction));
679
+ return friction;
680
+ }
681
+ RUCY_END
682
+
683
+ static
684
+ RUCY_DEF0(get_friction)
685
+ {
686
+ CHECK;
687
+ return value(THIS->friction());
688
+ }
689
+ RUCY_END
690
+
691
+ static
692
+ RUCY_DEF1(set_restitution, restitution)
693
+ {
694
+ CHECK;
695
+ THIS->set_restitution(to<float>(restitution));
696
+ return restitution;
697
+ }
698
+ RUCY_END
699
+
700
+ static
701
+ RUCY_DEF0(get_restitution)
702
+ {
703
+ CHECK;
704
+ return value(THIS->restitution());
705
+ }
706
+ RUCY_END
707
+
708
+ static
709
+ RUCY_DEF1(set_sensor, state)
710
+ {
711
+ CHECK;
712
+ THIS->set_sensor(state);
713
+ return state;
714
+ }
715
+ RUCY_END
716
+
717
+ static
718
+ RUCY_DEF0(is_sensor)
719
+ {
720
+ CHECK;
721
+ return value(THIS->is_sensor());
722
+ }
723
+ RUCY_END
724
+
725
+ static
726
+ RUCY_DEF1(set_category_bits, bits)
727
+ {
728
+ CHECK;
729
+ THIS->set_category_bits(to<uint>(bits));
730
+ return bits;
731
+ }
732
+ RUCY_END
733
+
734
+ static
735
+ RUCY_DEF0(get_category_bits)
736
+ {
737
+ CHECK;
738
+ return value(THIS->category_bits());
739
+ }
740
+ RUCY_END
741
+
742
+ static
743
+ RUCY_DEF1(set_collision_mask, mask)
744
+ {
745
+ CHECK;
746
+ THIS->set_collision_mask(to<uint>(mask));
747
+ return mask;
748
+ }
749
+ RUCY_END
750
+
751
+ static
752
+ RUCY_DEF0(get_collision_mask)
753
+ {
754
+ CHECK;
755
+ return value(THIS->collision_mask());
756
+ }
757
+ RUCY_END
758
+
759
+ static
760
+ RUCY_DEFN(set_linear_velocity)
761
+ {
762
+ CHECK;
763
+ THIS->set_linear_velocity(to<Rays::Point>(argc, argv));
764
+ return value(THIS->linear_velocity());
765
+ }
766
+ RUCY_END
767
+
768
+ static
769
+ RUCY_DEF0(get_linear_velocity)
770
+ {
771
+ CHECK;
772
+ return value(THIS->linear_velocity());
773
+ }
774
+ RUCY_END
775
+
776
+ static
777
+ RUCY_DEF1(set_angular_velocity, velocity)
778
+ {
779
+ CHECK;
780
+ THIS->set_angular_velocity(to<float>(velocity));
781
+ return velocity;
782
+ }
783
+ RUCY_END
784
+
785
+ static
786
+ RUCY_DEF0(get_angular_velocity)
787
+ {
788
+ CHECK;
789
+ return value(THIS->angular_velocity());
790
+ }
791
+ RUCY_END
792
+
793
+ static
794
+ RUCY_DEF1(set_gravity_scale, scale)
795
+ {
796
+ CHECK;
797
+ THIS->set_gravity_scale(to<float>(scale));
798
+ return scale;
799
+ }
800
+ RUCY_END
801
+
802
+ static
803
+ RUCY_DEF0(get_gravity_scale)
804
+ {
805
+ CHECK;
806
+ return value(THIS->gravity_scale());
807
+ }
808
+ RUCY_END
809
+
810
+ static
811
+ RUCY_DEFN(update_physics)
812
+ {
813
+ CHECK;
814
+ check_arg_count(__FILE__, __LINE__, "View#update_physics", argc, 0, 1);
815
+
816
+ float duration = argc >= 1 ? to<float>(argv[0]) : 0;
817
+ THIS->update_physics(duration);
818
+ return self;
435
819
  }
436
820
  RUCY_END
437
821
 
@@ -441,18 +825,18 @@ RUCY_DEFN(meter2pixel)
441
825
  CHECK;
442
826
  check_arg_count(__FILE__, __LINE__, "View#meter2pixel", argc, 0, 1, 2);
443
827
 
444
- float meter = argc >= 1 ? argv[0].as_f(true) : 1;
445
- bool create_world = argc >= 2 ? (bool) argv[1] : true;
828
+ float meter = argc >= 1 ? to<float>(argv[0]) : 1;
829
+ bool create_world = argc >= 2 ? to<bool> (argv[1]) : true;
446
830
  return value(THIS->meter2pixel(meter, create_world));
447
831
  }
448
832
  RUCY_END
449
833
 
450
834
  static
451
- RUCY_DEF2(set_gravity, x, y)
835
+ RUCY_DEFN(set_gravity)
452
836
  {
453
837
  CHECK;
454
- THIS->set_gravity(x.as_f(true), y.as_f(true));
455
- return self;
838
+ THIS->set_gravity(to<Rays::Point>(argc, argv));
839
+ return value(THIS->gravity());
456
840
  }
457
841
  RUCY_END
458
842
 
@@ -464,6 +848,23 @@ RUCY_DEF0(get_gravity)
464
848
  }
465
849
  RUCY_END
466
850
 
851
+ static
852
+ RUCY_DEF1(set_time_scale, scale)
853
+ {
854
+ CHECK;
855
+ THIS->set_time_scale(to<float>(scale));
856
+ return scale;
857
+ }
858
+ RUCY_END
859
+
860
+ static
861
+ RUCY_DEF0(get_time_scale)
862
+ {
863
+ CHECK;
864
+ return value(THIS->time_scale());
865
+ }
866
+ RUCY_END
867
+
467
868
  static
468
869
  RUCY_DEF0(wall)
469
870
  {
@@ -482,10 +883,10 @@ RUCY_DEF1(set_debug, state)
482
883
  RUCY_END
483
884
 
484
885
  static
485
- RUCY_DEF0(debugging)
886
+ RUCY_DEF0(get_debug)
486
887
  {
487
888
  CHECK;
488
- return value(THIS->debugging());
889
+ return value(THIS->debug());
489
890
  }
490
891
  RUCY_END
491
892
 
@@ -493,10 +894,6 @@ static
493
894
  RUCY_DEF1(on_attach, event)
494
895
  {
495
896
  CHECK;
496
-
497
- RUCY_SYM(call_attach_block);
498
- self.call(call_attach_block);
499
-
500
897
  CALL(on_attach(to<Reflex::Event*>(event)));
501
898
  }
502
899
  RUCY_END
@@ -581,14 +978,6 @@ RUCY_DEF1(on_focus, event)
581
978
  }
582
979
  RUCY_END
583
980
 
584
- static
585
- RUCY_DEF1(on_blur, event)
586
- {
587
- CHECK;
588
- CALL(on_blur(to<Reflex::FocusEvent*>(event)));
589
- }
590
- RUCY_END
591
-
592
981
  static
593
982
  RUCY_DEF1(on_key, event)
594
983
  {
@@ -661,6 +1050,14 @@ RUCY_DEF1(on_capture, event)
661
1050
  }
662
1051
  RUCY_END
663
1052
 
1053
+ static
1054
+ RUCY_DEF1(on_timer, event)
1055
+ {
1056
+ CHECK;
1057
+ CALL(on_timer(to<Reflex::TimerEvent*>(event)));
1058
+ }
1059
+ RUCY_END
1060
+
664
1061
  static
665
1062
  RUCY_DEF1(on_contact, event)
666
1063
  {
@@ -685,9 +1082,6 @@ RUCY_DEF1(on_contact_end, event)
685
1082
  }
686
1083
  RUCY_END
687
1084
 
688
- static
689
- RUCY_DEF_clear_override_flags(cof, Reflex::View);
690
-
691
1085
 
692
1086
  static Class cView;
693
1087
 
@@ -702,48 +1096,96 @@ Init_view ()
702
1096
  cView.define_method("hide", hide);
703
1097
  cView.define_method("hidden?", hidden);
704
1098
  cView.define_method("redraw", redraw);
705
- cView.define_method("add_child", add_child);
706
- cView.define_method("remove_child", remove_child);
707
- cView.define_method("find_children", find_children);
708
- cView.define_method("each_child", each_child);
1099
+ cView.define_method("focus", focus);
1100
+ cView.define_method("blur", blur);
1101
+ cView.define_method("focus?", has_focus);
1102
+ cView.define_private_method("start_timer", start_timer);
1103
+ cView.define_method("update_layout", update_layout);
1104
+
1105
+ cView.define_method("add_child", add_child);
1106
+ cView.define_method("remove_child", remove_child);
1107
+ cView.define_method("clear_children", clear_children);
1108
+ cView.define_method("find_children", find_children);
1109
+ cView.define_method("each_child", each_child);
1110
+
709
1111
  cView.define_method("add_style", add_style);
710
1112
  cView.define_method("remove_style", remove_style);
711
1113
  cView.define_method("get_style", get_style);
712
1114
  cView.define_method("find_styles", find_styles);
713
1115
  cView.define_method("each_style", each_style);
714
- cView.define_method("focus", focus);
715
- cView.define_method("blur", blur);
716
- cView.define_method("focus?", has_focus);
717
- cView.define_method("resize_to_fit", resize_to_fit);
718
- cView.define_method("content_size", content_size);
719
- cView.define_method("make_body", make_body);
720
- cView.define_method("clear_body", clear_body);
721
- cView.define_method("name=", set_name);
722
- cView.define_method("name", get_name);
723
- cView.define_method("add_tag", add_tag);
724
- cView.define_method("remove_tag", remove_tag);
725
- cView.define_method("each_tag", each_tag);
726
- cView.define_method("selector=", set_selector);
727
- cView.define_method("selector", get_selector);
728
- cView.define_private_method("set_frame", set_frame);
729
- cView.define_private_method("get_frame", get_frame);
730
- cView.define_method("zoom=", set_zoom);
731
- cView.define_method("zoom", get_zoom);
1116
+
1117
+ cView.define_method("shape=", set_shape);
1118
+ cView.define_method("shape", get_shape);
1119
+ cView.define_method("add_shape", add_shape);
1120
+ cView.define_method("remove_shape", remove_shape);
1121
+ cView.define_method("clear_shapes", clear_shapes);
1122
+ cView.define_method("find_shapes", find_shapes);
1123
+ cView.define_method("each_shape", each_shape);
1124
+
1125
+ cView.define_method("filter=", set_filter);
1126
+ cView.define_method("filter", get_filter);
1127
+
1128
+ cView.define_method("frame=", set_frame);
1129
+ cView.define_method("frame", get_frame);
1130
+ cView.define_method("content_bounds", content_bounds);
1131
+ cView.define_method("fit_to_content", fit_to_content);
1132
+ cView.define_method("angle=", set_angle);
732
1133
  cView.define_method("angle", get_angle);
733
1134
  cView.define_method("scroll_to", scroll_to);
734
1135
  cView.define_method("scroll_by", scroll_by);
735
1136
  cView.define_method("scroll", get_scroll);
736
- cView.define_method("set_capture", set_capture);
737
- cView.define_method("get_capture", get_capture);
1137
+ cView.define_method("zoom=", set_zoom);
1138
+ cView.define_method("zoom", get_zoom);
1139
+ cView.define_method("capture=", set_capture);
1140
+ cView.define_method("capture", get_capture);
1141
+ cView.define_method("clip=", set_clip);
1142
+ cView.define_method("clip?", get_clip);
1143
+ cView.define_method("cache=", set_cache);
1144
+ cView.define_method("cache?", get_cache);
1145
+ cView.define_method("resize_to_fit=", set_resize_to_fit);
1146
+ cView.define_method("resize_to_fit?", get_resize_to_fit);
1147
+ cView.define_method("scroll_to_fit=", set_scroll_to_fit);
1148
+ cView.define_method("scroll_to_fit?", get_scroll_to_fit);
738
1149
  cView.define_method("parent", parent);
739
1150
  cView.define_method("window", window);
740
- cView.define_method("body", body);
1151
+
1152
+ cView.define_method("apply_force", apply_force);
1153
+ cView.define_method("apply_torque", apply_torque);
1154
+ cView.define_method("apply_linear_impulse", apply_linear_impulse);
1155
+ cView.define_method("apply_angular_impulse", apply_angular_impulse);
1156
+ cView.define_method("static=", set_static);
1157
+ cView.define_method("static?", is_static);
1158
+ cView.define_method("dynamic=", set_dynamic);
1159
+ cView.define_method("dynamic?", is_dynamic);
1160
+ cView.define_method("density=", set_density);
1161
+ cView.define_method("density", get_density);
1162
+ cView.define_method("friction=", set_friction);
1163
+ cView.define_method("friction", get_friction);
1164
+ cView.define_method("restitution=", set_restitution);
1165
+ cView.define_method("restitution", get_restitution);
1166
+ cView.define_method("sensor=", set_sensor);
1167
+ cView.define_method("sensor?", is_sensor);
1168
+ cView.define_private_method("set_category_bits", set_category_bits);
1169
+ cView.define_private_method("get_category_bits", get_category_bits);
1170
+ cView.define_private_method("set_collision_mask", set_collision_mask);
1171
+ cView.define_private_method("get_collision_mask", get_collision_mask);
1172
+ cView.define_method("linear_velocity=", set_linear_velocity);
1173
+ cView.define_method("linear_velocity", get_linear_velocity);
1174
+ cView.define_method("angular_velocity=", set_angular_velocity);
1175
+ cView.define_method("angular_velocity", get_angular_velocity);
1176
+ cView.define_method("gravity_scale=", set_gravity_scale);
1177
+ cView.define_method("gravity_scale", get_gravity_scale);
1178
+
1179
+ cView.define_method("update_physics", update_physics);
741
1180
  cView.define_method("meter2pixel", meter2pixel);
742
- cView.define_method("set_gravity", set_gravity);
743
- cView.define_method("gravity", get_gravity);
1181
+ cView.define_method("gravity=", set_gravity);
1182
+ cView.define_method("gravity", get_gravity);
1183
+ cView.define_method("time_scale=", set_time_scale);
1184
+ cView.define_method("time_scale", get_time_scale);
744
1185
  cView.define_method("wall", wall);
745
1186
  cView.define_method("debug=", set_debug);
746
- cView.define_method("debug?", debugging);
1187
+ cView.define_method("debug?", get_debug);
1188
+
747
1189
  cView.define_method("on_attach", on_attach);
748
1190
  cView.define_method("on_detach", on_detach);
749
1191
  cView.define_method("on_show", on_show);
@@ -755,7 +1197,6 @@ Init_view ()
755
1197
  cView.define_method("on_rotate", on_rotate);
756
1198
  cView.define_method("on_scroll", on_scroll);
757
1199
  cView.define_method("on_focus", on_focus);
758
- cView.define_method("on_blur", on_blur);
759
1200
  cView.define_method("on_key", on_key);
760
1201
  cView.define_method("on_key_down", on_key_down);
761
1202
  cView.define_method("on_key_up", on_key_up);
@@ -765,14 +1206,17 @@ Init_view ()
765
1206
  cView.define_method("on_pointer_move", on_pointer_move);
766
1207
  cView.define_method("on_wheel", on_wheel);
767
1208
  cView.define_method("on_capture", on_capture);
768
- cView.define_method("on_contact", on_contact);
769
- cView.define_method("on_contact_begin", on_contact_begin);
770
- cView.define_method("on_contact_end", on_contact_end);
771
- cView.define_const("CAPTURE_NONE", Reflex::View::CAPTURE_NONE);
772
- cView.define_const("CAPTURE_KEY", Reflex::View::CAPTURE_KEY);
773
- cView.define_const("CAPTURE_POINTER", Reflex::View::CAPTURE_POINTER);
774
- cView.define_const("CAPTURE_ALL", Reflex::View::CAPTURE_ALL);
775
- cView.define_clear_override_flags(cof);
1209
+ cView.define_method("on_timer", on_timer);
1210
+ cView.define_private_method("call_contact!", on_contact);
1211
+ cView.define_private_method("call_contact_begin!", on_contact_begin);
1212
+ cView.define_private_method("call_contact_end!", on_contact_end);
1213
+
1214
+ cView.define_const("CAPTURE_NONE", Reflex::View::CAPTURE_NONE);
1215
+ cView.define_const("CAPTURE_KEY", Reflex::View::CAPTURE_KEY);
1216
+ cView.define_const("CAPTURE_POINTER", Reflex::View::CAPTURE_POINTER);
1217
+ cView.define_const("CAPTURE_ALL", Reflex::View::CAPTURE_ALL);
1218
+
1219
+ define_selector_methods<Reflex::View>(cView);
776
1220
  }
777
1221
 
778
1222