reflexion 0.1.12 → 0.1.13

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 (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/style.cpp CHANGED
@@ -1,21 +1,19 @@
1
1
  #include "reflex/ruby/style.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
4
  #include "rays/ruby/color.h"
6
5
  #include "rays/ruby/image.h"
7
6
  #include "reflex/ruby/selector.h"
8
7
  #include "defs.h"
9
-
10
-
11
- using namespace Rucy;
8
+ #include "selector.h"
12
9
 
13
10
 
14
11
  RUCY_DEFINE_VALUE_FROM_TO(Reflex::Style)
15
12
 
16
- #define THIS to<Reflex::Style*>(self)
13
+ #define THIS to< Reflex::Style*>(self)
14
+ #define C_THIS to<const Reflex::Style*>(self)
17
15
 
18
- #define CHECK RUCY_CHECK_OBJ(Reflex::Style, self)
16
+ #define CHECK RUCY_CHECK_OBJ(Reflex::Style, self)
19
17
 
20
18
 
21
19
  static
@@ -34,76 +32,27 @@ RUCY_DEF1(initialize_copy, obj)
34
32
  }
35
33
  RUCY_END
36
34
 
37
- static
38
- RUCY_DEF1(set_name, name)
39
- {
40
- CHECK;
41
- THIS->set_name(name.is_nil() ? NULL : name.c_str());
42
- }
43
- RUCY_END
44
-
45
- static
46
- RUCY_DEF0(get_name)
47
- {
48
- CHECK;
49
- return THIS->name() ? value(THIS->name()) : nil();
50
- }
51
- RUCY_END
52
-
53
- static
54
- RUCY_DEF1(add_tag, tag)
55
- {
56
- CHECK;
57
- THIS->add_tag(tag.c_str());
58
- }
59
- RUCY_END
60
-
61
- static
62
- RUCY_DEF1(remove_tag, tag)
63
- {
64
- CHECK;
65
- THIS->remove_tag(tag.c_str());
66
- }
67
- RUCY_END
68
-
69
- static
70
- RUCY_DEF0(each_tag)
71
- {
72
- CHECK;
73
-
74
- Value ret;
75
- Reflex::Style::tag_iterator end = THIS->tag_end();
76
- for (Reflex::Style::tag_iterator it = THIS->tag_begin(); it != end; ++it)
77
- ret = rb_yield(value(*it));
78
- return ret;
79
- }
80
- RUCY_END
81
-
82
- static
83
- RUCY_DEF1(set_selector, selector)
84
- {
85
- CHECK;
86
- THIS->set_selector(to<Reflex::Selector>(selector));
87
- }
88
- RUCY_END
89
-
90
- static
91
- RUCY_DEF0(get_selector)
92
- {
93
- CHECK;
94
- return value(THIS->selector());
95
- }
96
- RUCY_END
97
-
98
35
  static
99
36
  RUCY_DEFN(set_flow)
100
37
  {
101
38
  CHECK;
102
39
  check_arg_count(__FILE__, __LINE__, "Style#set_flow", argc, 1, 2);
103
40
 
104
- THIS->set_flow(
105
- (Reflex::Style::Flow) argv[0].as_i(),
106
- argc >= 2 ? (Reflex::Style::Flow) argv[1].as_i() : Reflex::Style::FLOW_NONE);
41
+ if (argv[0].is_nil())
42
+ {
43
+ if (argc >= 2 && !argv[1].is_nil())
44
+ argument_error(__FILE__, __LINE__);
45
+
46
+ THIS->clear_flow();
47
+ }
48
+ else
49
+ {
50
+ THIS->set_flow(
51
+ (Reflex::Style::Flow) to<int>(argv[0]),
52
+ argc >= 2 ? (Reflex::Style::Flow) to<int>(argv[1]) : Reflex::Style::FLOW_NONE);
53
+ }
54
+
55
+ return value(argc, argv);
107
56
  }
108
57
  RUCY_END
109
58
 
@@ -111,6 +60,7 @@ static
111
60
  RUCY_DEF0(get_flow)
112
61
  {
113
62
  CHECK;
63
+
114
64
  Reflex::Style::Flow main, sub;
115
65
  THIS->get_flow(&main, &sub);
116
66
  return array(main, sub);
@@ -121,7 +71,13 @@ static
121
71
  RUCY_DEF1(set_width, width)
122
72
  {
123
73
  CHECK;
124
- THIS->set_width(to<Reflex::StyleLength>(width));
74
+
75
+ if (width.is_nil())
76
+ THIS->clear_width();
77
+ else
78
+ THIS->set_width(to<Reflex::StyleLength>(width));
79
+
80
+ return width;
125
81
  }
126
82
  RUCY_END
127
83
 
@@ -137,7 +93,13 @@ static
137
93
  RUCY_DEF1(set_height, height)
138
94
  {
139
95
  CHECK;
140
- THIS->set_height(to<Reflex::StyleLength>(height));
96
+
97
+ if (height.is_nil())
98
+ THIS->clear_height();
99
+ else
100
+ THIS->set_height(to<Reflex::StyleLength>(height));
101
+
102
+ return height;
141
103
  }
142
104
  RUCY_END
143
105
 
@@ -155,8 +117,10 @@ RUCY_DEFN(set_size)
155
117
  CHECK;
156
118
  check_arg_count(__FILE__, __LINE__, "Style#set_size", argc, 1, 2);
157
119
 
158
- set_width (self, argv[0]);
120
+ set_width( self, argv[0]);
159
121
  set_height(self, argc >= 2 ? argv[1] : argv[0]);
122
+
123
+ return value(argc, argv);
160
124
  }
161
125
  RUCY_END
162
126
 
@@ -164,7 +128,9 @@ static
164
128
  RUCY_DEF0(get_size)
165
129
  {
166
130
  CHECK;
167
- return array(get_width(self), get_height(self));
131
+ return array(
132
+ get_width(self),
133
+ get_height(self));
168
134
  }
169
135
  RUCY_END
170
136
 
@@ -172,7 +138,13 @@ static
172
138
  RUCY_DEF1(set_left, left)
173
139
  {
174
140
  CHECK;
175
- THIS->set_left(to<Reflex::StyleLength>(left));
141
+
142
+ if (left.is_nil())
143
+ THIS->clear_left();
144
+ else
145
+ THIS->set_left(to<Reflex::StyleLength>(left));
146
+
147
+ return left;
176
148
  }
177
149
  RUCY_END
178
150
 
@@ -188,7 +160,13 @@ static
188
160
  RUCY_DEF1(set_top, top)
189
161
  {
190
162
  CHECK;
191
- THIS->set_top(to<Reflex::StyleLength>(top));
163
+
164
+ if (top.is_nil())
165
+ THIS->clear_top();
166
+ else
167
+ THIS->set_top(to<Reflex::StyleLength>(top));
168
+
169
+ return top;
192
170
  }
193
171
  RUCY_END
194
172
 
@@ -204,7 +182,13 @@ static
204
182
  RUCY_DEF1(set_right, right)
205
183
  {
206
184
  CHECK;
207
- THIS->set_right(to<Reflex::StyleLength>(right));
185
+
186
+ if (right.is_nil())
187
+ THIS->clear_right();
188
+ else
189
+ THIS->set_right(to<Reflex::StyleLength>(right));
190
+
191
+ return right;
208
192
  }
209
193
  RUCY_END
210
194
 
@@ -220,7 +204,13 @@ static
220
204
  RUCY_DEF1(set_bottom, bottom)
221
205
  {
222
206
  CHECK;
223
- THIS->set_bottom(to<Reflex::StyleLength>(bottom));
207
+
208
+ if (bottom.is_nil())
209
+ THIS->clear_bottom();
210
+ else
211
+ THIS->set_bottom(to<Reflex::StyleLength>(bottom));
212
+
213
+ return bottom;
224
214
  }
225
215
  RUCY_END
226
216
 
@@ -236,10 +226,13 @@ static
236
226
  RUCY_DEF4(set_position, left, top, right, bottom)
237
227
  {
238
228
  CHECK;
239
- set_left (self, left);
240
- set_top (self, top);
241
- set_right (self, right);
229
+
230
+ set_left( self, left);
231
+ set_top( self, top);
232
+ set_right( self, right);
242
233
  set_bottom(self, bottom);
234
+
235
+ return array(left, top, right, bottom);
243
236
  }
244
237
  RUCY_END
245
238
 
@@ -256,295 +249,468 @@ RUCY_DEF0(get_position)
256
249
  RUCY_END
257
250
 
258
251
  static
259
- RUCY_DEF1(set_offset_left, left)
252
+ RUCY_DEF1(set_margin_left, left)
260
253
  {
261
254
  CHECK;
262
- THIS->set_offset_left(to<Reflex::StyleLength>(left));
255
+
256
+ if (left.is_nil())
257
+ THIS->clear_margin_left();
258
+ else
259
+ THIS->set_margin_left(to<Reflex::StyleLength>(left));
260
+
261
+ return left;
263
262
  }
264
263
  RUCY_END
265
264
 
266
265
  static
267
- RUCY_DEF0(get_offset_left)
266
+ RUCY_DEF0(get_margin_left)
268
267
  {
269
268
  CHECK;
270
- return value(THIS->offset_left());
269
+ return value(THIS->margin_left());
271
270
  }
272
271
  RUCY_END
273
272
 
274
273
  static
275
- RUCY_DEF1(set_offset_top, top)
274
+ RUCY_DEF1(set_margin_top, top)
276
275
  {
277
276
  CHECK;
278
- THIS->set_offset_top(to<Reflex::StyleLength>(top));
277
+
278
+ if (top.is_nil())
279
+ THIS->clear_margin_top();
280
+ else
281
+ THIS->set_margin_top(to<Reflex::StyleLength>(top));
282
+
283
+ return top;
279
284
  }
280
285
  RUCY_END
281
286
 
282
287
  static
283
- RUCY_DEF0(get_offset_top)
288
+ RUCY_DEF0(get_margin_top)
284
289
  {
285
290
  CHECK;
286
- return value(THIS->offset_top());
291
+ return value(THIS->margin_top());
287
292
  }
288
293
  RUCY_END
289
294
 
290
295
  static
291
- RUCY_DEF1(set_offset_right, right)
296
+ RUCY_DEF1(set_margin_right, right)
292
297
  {
293
298
  CHECK;
294
- THIS->set_offset_right(to<Reflex::StyleLength>(right));
299
+
300
+ if (right.is_nil())
301
+ THIS->clear_margin_right();
302
+ else
303
+ THIS->set_margin_right(to<Reflex::StyleLength>(right));
304
+
305
+ return right;
295
306
  }
296
307
  RUCY_END
297
308
 
298
309
  static
299
- RUCY_DEF0(get_offset_right)
310
+ RUCY_DEF0(get_margin_right)
300
311
  {
301
312
  CHECK;
302
- return value(THIS->offset_right());
313
+ return value(THIS->margin_right());
303
314
  }
304
315
  RUCY_END
305
316
 
306
317
  static
307
- RUCY_DEF1(set_offset_bottom, bottom)
318
+ RUCY_DEF1(set_margin_bottom, bottom)
308
319
  {
309
320
  CHECK;
310
- THIS->set_offset_bottom(to<Reflex::StyleLength>(bottom));
321
+
322
+ if (bottom.is_nil())
323
+ THIS->clear_margin_bottom();
324
+ else
325
+ THIS->set_margin_bottom(to<Reflex::StyleLength>(bottom));
326
+
327
+ return bottom;
311
328
  }
312
329
  RUCY_END
313
330
 
314
331
  static
315
- RUCY_DEF0(get_offset_bottom)
332
+ RUCY_DEF0(get_margin_bottom)
316
333
  {
317
334
  CHECK;
318
- return value(THIS->offset_bottom());
335
+ return value(THIS->margin_bottom());
319
336
  }
320
337
  RUCY_END
321
338
 
322
339
  static
323
- RUCY_DEF4(set_offset, left, top, right, bottom)
340
+ RUCY_DEF4(set_margin, left, top, right, bottom)
324
341
  {
325
342
  CHECK;
326
- set_offset_left (self, left);
327
- set_offset_top (self, top);
328
- set_offset_right (self, right);
329
- set_offset_bottom(self, bottom);
343
+
344
+ set_margin_left( self, left);
345
+ set_margin_top( self, top);
346
+ set_margin_right( self, right);
347
+ set_margin_bottom(self, bottom);
348
+
349
+ return array(left, top, right, bottom);
330
350
  }
331
351
  RUCY_END
332
352
 
333
353
  static
334
- RUCY_DEF0(get_offset)
354
+ RUCY_DEF0(get_margin)
335
355
  {
336
356
  CHECK;
337
357
  return array(
338
- get_offset_left(self),
339
- get_offset_top(self),
340
- get_offset_right(self),
341
- get_offset_bottom(self));
358
+ get_margin_left(self),
359
+ get_margin_top(self),
360
+ get_margin_right(self),
361
+ get_margin_bottom(self));
342
362
  }
343
363
  RUCY_END
344
364
 
345
365
  static
346
- RUCY_DEF1(set_margin_left, left)
366
+ RUCY_DEF1(set_padding_left, left)
347
367
  {
348
368
  CHECK;
349
- THIS->set_margin_left(to<Reflex::StyleLength>(left));
369
+
370
+ if (left.is_nil())
371
+ THIS->clear_padding_left();
372
+ else
373
+ THIS->set_padding_left(to<Reflex::StyleLength>(left));
374
+
375
+ return left;
350
376
  }
351
377
  RUCY_END
352
378
 
353
379
  static
354
- RUCY_DEF0(get_margin_left)
380
+ RUCY_DEF0(get_padding_left)
355
381
  {
356
382
  CHECK;
357
- return value(THIS->margin_left());
383
+ return value(THIS->padding_left());
358
384
  }
359
385
  RUCY_END
360
386
 
361
387
  static
362
- RUCY_DEF1(set_margin_top, top)
388
+ RUCY_DEF1(set_padding_top, top)
363
389
  {
364
390
  CHECK;
365
- THIS->set_margin_top(to<Reflex::StyleLength>(top));
391
+
392
+ if (top.is_nil())
393
+ THIS->clear_padding_top();
394
+ else
395
+ THIS->set_padding_top(to<Reflex::StyleLength>(top));
396
+
397
+ return top;
366
398
  }
367
399
  RUCY_END
368
400
 
369
401
  static
370
- RUCY_DEF0(get_margin_top)
402
+ RUCY_DEF0(get_padding_top)
371
403
  {
372
404
  CHECK;
373
- return value(THIS->margin_top());
405
+ return value(THIS->padding_top());
374
406
  }
375
407
  RUCY_END
376
408
 
377
409
  static
378
- RUCY_DEF1(set_margin_right, right)
410
+ RUCY_DEF1(set_padding_right, right)
379
411
  {
380
412
  CHECK;
381
- THIS->set_margin_right(to<Reflex::StyleLength>(right));
413
+
414
+ if (right.is_nil())
415
+ THIS->clear_padding_right();
416
+ else
417
+ THIS->set_padding_right(to<Reflex::StyleLength>(right));
418
+
419
+ return right;
382
420
  }
383
421
  RUCY_END
384
422
 
385
423
  static
386
- RUCY_DEF0(get_margin_right)
424
+ RUCY_DEF0(get_padding_right)
387
425
  {
388
426
  CHECK;
389
- return value(THIS->margin_right());
427
+ return value(THIS->padding_right());
390
428
  }
391
429
  RUCY_END
392
430
 
393
431
  static
394
- RUCY_DEF1(set_margin_bottom, bottom)
432
+ RUCY_DEF1(set_padding_bottom, bottom)
395
433
  {
396
434
  CHECK;
397
- THIS->set_margin_bottom(to<Reflex::StyleLength>(bottom));
435
+
436
+ if (bottom.is_nil())
437
+ THIS->clear_padding_bottom();
438
+ else
439
+ THIS->set_padding_bottom(to<Reflex::StyleLength>(bottom));
440
+
441
+ return bottom;
398
442
  }
399
443
  RUCY_END
400
444
 
401
445
  static
402
- RUCY_DEF0(get_margin_bottom)
446
+ RUCY_DEF0(get_padding_bottom)
403
447
  {
404
448
  CHECK;
405
- return value(THIS->margin_bottom());
449
+ return value(THIS->padding_bottom());
406
450
  }
407
451
  RUCY_END
408
452
 
409
453
  static
410
- RUCY_DEF4(set_margin, left, top, right, bottom)
454
+ RUCY_DEF4(set_padding, left, top, right, bottom)
411
455
  {
412
456
  CHECK;
413
- set_margin_left (self, left);
414
- set_margin_top (self, top);
415
- set_margin_right (self, right);
416
- set_margin_bottom(self, bottom);
457
+
458
+ set_padding_left( self, left);
459
+ set_padding_top( self, top);
460
+ set_padding_right( self, right);
461
+ set_padding_bottom(self, bottom);
462
+
463
+ return array(left, top, right, bottom);
417
464
  }
418
465
  RUCY_END
419
466
 
420
467
  static
421
- RUCY_DEF0(get_margin)
468
+ RUCY_DEF0(get_padding)
422
469
  {
423
470
  CHECK;
424
471
  return array(
425
- get_margin_left(self),
426
- get_margin_top(self),
427
- get_margin_right(self),
428
- get_margin_bottom(self));
472
+ get_padding_left(self),
473
+ get_padding_top(self),
474
+ get_padding_right(self),
475
+ get_padding_bottom(self));
429
476
  }
430
477
  RUCY_END
431
478
 
432
479
  static
433
- RUCY_DEF1(set_padding_left, left)
480
+ RUCY_DEF1(set_center_x, x)
434
481
  {
435
482
  CHECK;
436
- THIS->set_padding_left(to<Reflex::StyleLength>(left));
483
+
484
+ if (x.is_nil())
485
+ THIS->clear_center_x();
486
+ else
487
+ THIS->set_center_x(to<Reflex::StyleLength>(x));
488
+
489
+ return x;
437
490
  }
438
491
  RUCY_END
439
492
 
440
493
  static
441
- RUCY_DEF0(get_padding_left)
494
+ RUCY_DEF0(get_center_x)
442
495
  {
443
496
  CHECK;
444
- return value(THIS->padding_left());
497
+ return value(THIS->center_x());
445
498
  }
446
499
  RUCY_END
447
500
 
448
501
  static
449
- RUCY_DEF1(set_padding_top, top)
502
+ RUCY_DEF1(set_center_y, y)
450
503
  {
451
504
  CHECK;
452
- THIS->set_padding_top(to<Reflex::StyleLength>(top));
505
+
506
+ if (y.is_nil())
507
+ THIS->clear_center_y();
508
+ else
509
+ THIS->set_center_y(to<Reflex::StyleLength>(y));
510
+
511
+ return y;
453
512
  }
454
513
  RUCY_END
455
514
 
456
515
  static
457
- RUCY_DEF0(get_padding_top)
516
+ RUCY_DEF0(get_center_y)
458
517
  {
459
518
  CHECK;
460
- return value(THIS->padding_top());
519
+ return value(THIS->center_y());
461
520
  }
462
521
  RUCY_END
463
522
 
464
523
  static
465
- RUCY_DEF1(set_padding_right, right)
524
+ RUCY_DEF2(set_center, x, y)
466
525
  {
467
526
  CHECK;
468
- THIS->set_padding_right(to<Reflex::StyleLength>(right));
527
+
528
+ set_center_x(self, x);
529
+ set_center_y(self, y);
530
+
531
+ return array(x, y);
469
532
  }
470
533
  RUCY_END
471
534
 
472
535
  static
473
- RUCY_DEF0(get_padding_right)
536
+ RUCY_DEF0(get_center)
474
537
  {
475
538
  CHECK;
476
- return value(THIS->padding_right());
539
+ return array(
540
+ get_center_x(self),
541
+ get_center_y(self));
477
542
  }
478
543
  RUCY_END
479
544
 
480
545
  static
481
- RUCY_DEF1(set_padding_bottom, bottom)
546
+ RUCY_DEFN(set_foreground_fill)
482
547
  {
483
548
  CHECK;
484
- THIS->set_padding_bottom(to<Reflex::StyleLength>(bottom));
549
+ check_arg_count(
550
+ __FILE__, __LINE__, "Style#set_foreground_fill", argc, 1, 2, 3, 4);
551
+
552
+ if (argv[0].is_nil())
553
+ {
554
+ if (argc != 1)
555
+ argument_error(__FILE__, __LINE__);
556
+
557
+ THIS->clear_foreground_fill();
558
+ return argv[0];
559
+ }
560
+ else
561
+ {
562
+ Reflex::Color color = to<Reflex::Color>(argc, argv);
563
+ THIS->set_foreground_fill(color);
564
+ return value(color);
565
+ }
485
566
  }
486
567
  RUCY_END
487
568
 
488
569
  static
489
- RUCY_DEF0(get_padding_bottom)
570
+ RUCY_DEFN(set_foreground_stroke)
490
571
  {
491
572
  CHECK;
492
- return value(THIS->padding_bottom());
573
+ check_arg_count(
574
+ __FILE__, __LINE__, "Style#set_foreground_stroke", argc, 1, 2, 3, 4);
575
+
576
+ if (argv[0].is_nil())
577
+ {
578
+ if (argc != 1)
579
+ argument_error(__FILE__, __LINE__);
580
+
581
+ THIS->clear_foreground_stroke();
582
+ return argv[0];
583
+ }
584
+ else
585
+ {
586
+ Reflex::Color color = to<Reflex::Color>(argc, argv);
587
+ THIS->set_foreground_stroke(color);
588
+ return value(color);
589
+ }
493
590
  }
494
591
  RUCY_END
495
592
 
496
593
  static
497
- RUCY_DEF4(set_padding, left, top, right, bottom)
594
+ RUCY_DEF1(set_foreground_stroke_width, width)
498
595
  {
499
596
  CHECK;
500
- set_padding_left (self, left);
501
- set_padding_top (self, top);
502
- set_padding_right (self, right);
503
- set_padding_bottom(self, bottom);
597
+
598
+ if (width.is_nil())
599
+ THIS->clear_foreground_stroke_width();
600
+ else
601
+ THIS->set_foreground_stroke_width(to<coord>(width));
602
+
603
+ return width;
504
604
  }
505
605
  RUCY_END
506
606
 
507
607
  static
508
- RUCY_DEF0(get_padding)
608
+ RUCY_DEFN(set_background_fill)
509
609
  {
510
610
  CHECK;
511
- return array(
512
- get_padding_left(self),
513
- get_padding_top(self),
514
- get_padding_right(self),
515
- get_padding_bottom(self));
611
+ check_arg_count(
612
+ __FILE__, __LINE__, "Style#set_background_fill", argc, 1, 2, 3, 4);
613
+
614
+ if (argv[0].is_nil())
615
+ {
616
+ if (argc != 1)
617
+ argument_error(__FILE__, __LINE__);
618
+
619
+ THIS->clear_background_fill();
620
+ return argv[0];
621
+ }
622
+ else
623
+ {
624
+ Reflex::Color color = to<Reflex::Color>(argc, argv);
625
+ THIS->set_background_fill(color);
626
+ return value(color);
627
+ }
516
628
  }
517
629
  RUCY_END
518
630
 
519
631
  static
520
- RUCY_DEF1(set_fill, color)
632
+ RUCY_DEFN(set_background_stroke)
521
633
  {
522
634
  CHECK;
523
- THIS->set_fill(to<Reflex::Color&>(color));
635
+ check_arg_count(
636
+ __FILE__, __LINE__, "Style#set_background_stroke", argc, 1, 2, 3, 4);
637
+
638
+ if (argv[0].is_nil())
639
+ {
640
+ if (argc != 1)
641
+ argument_error(__FILE__, __LINE__);
642
+
643
+ THIS->clear_background_stroke();
644
+ return argv[0];
645
+ }
646
+ else
647
+ {
648
+ Reflex::Color color = to<Reflex::Color>(argc, argv);
649
+ THIS->set_background_stroke(color);
650
+ return value(color);
651
+ }
524
652
  }
525
653
  RUCY_END
526
654
 
527
655
  static
528
- RUCY_DEF0(get_fill)
656
+ RUCY_DEF1(set_background_stroke_width, width)
529
657
  {
530
658
  CHECK;
531
- return value(THIS->fill());
659
+
660
+ if (width.is_nil())
661
+ THIS->clear_background_stroke_width();
662
+ else
663
+ THIS->set_background_stroke_width(to<coord>(width));
664
+
665
+ return width;
532
666
  }
533
667
  RUCY_END
534
668
 
535
669
  static
536
- RUCY_DEF1(set_stroke, color)
670
+ RUCY_DEF0(get_foreground_fill)
537
671
  {
538
672
  CHECK;
539
- THIS->set_stroke(to<Reflex::Color&>(color));
673
+ return value(THIS->foreground_fill());
540
674
  }
541
675
  RUCY_END
542
676
 
543
677
  static
544
- RUCY_DEF0(get_stroke)
678
+ RUCY_DEF0(get_foreground_stroke)
545
679
  {
546
680
  CHECK;
547
- return value(THIS->stroke());
681
+ return value(THIS->foreground_stroke());
682
+ }
683
+ RUCY_END
684
+
685
+ static
686
+ RUCY_DEF0(get_foreground_stroke_width)
687
+ {
688
+ CHECK;
689
+ return value(THIS->foreground_stroke_width());
690
+ }
691
+ RUCY_END
692
+
693
+ static
694
+ RUCY_DEF0(get_background_fill)
695
+ {
696
+ CHECK;
697
+ return value(THIS->background_fill());
698
+ }
699
+ RUCY_END
700
+
701
+ static
702
+ RUCY_DEF0(get_background_stroke)
703
+ {
704
+ CHECK;
705
+ return value(THIS->background_stroke());
706
+ }
707
+ RUCY_END
708
+
709
+ static
710
+ RUCY_DEF0(get_background_stroke_width)
711
+ {
712
+ CHECK;
713
+ return value(THIS->background_stroke_width());
548
714
  }
549
715
  RUCY_END
550
716
 
@@ -552,7 +718,13 @@ static
552
718
  RUCY_DEF1(set_image, image)
553
719
  {
554
720
  CHECK;
555
- THIS->set_image(to<Reflex::Image&>(image));
721
+
722
+ if (image.is_nil())
723
+ THIS->clear_image();
724
+ else
725
+ THIS->set_image(to<Reflex::Image&>(image));
726
+
727
+ return image;
556
728
  }
557
729
  RUCY_END
558
730
 
@@ -584,14 +756,6 @@ Init_style ()
584
756
  cStyle.define_alloc_func(alloc);
585
757
  cStyle.define_private_method("initialize_copy", initialize_copy);
586
758
 
587
- cStyle.define_method("name=", set_name);
588
- cStyle.define_method("name", get_name);
589
- cStyle.define_method("add_tag", add_tag);
590
- cStyle.define_method("remove_tag", remove_tag);
591
- cStyle.define_method("each_tag", each_tag);
592
- cStyle.define_method("selector=", set_selector);
593
- cStyle.define_method("selector", get_selector);
594
-
595
759
  cStyle.define_method("set_flow", set_flow);
596
760
  cStyle.define_method("get_flow", get_flow);
597
761
 
@@ -613,17 +777,6 @@ Init_style ()
613
777
  cStyle.define_method("position=", set_position);
614
778
  cStyle.define_method("position", get_position);
615
779
 
616
- cStyle.define_method("offset_left=", set_offset_left);
617
- cStyle.define_method("offset_left", get_offset_left);
618
- cStyle.define_method("offset_top=", set_offset_top);
619
- cStyle.define_method("offset_top", get_offset_top);
620
- cStyle.define_method("offset_right=", set_offset_right);
621
- cStyle.define_method("offset_right", get_offset_right);
622
- cStyle.define_method("offset_bottom=", set_offset_bottom);
623
- cStyle.define_method("offset_bottom", get_offset_bottom);
624
- cStyle.define_method("offset=", set_offset);
625
- cStyle.define_method("offset", get_offset);
626
-
627
780
  cStyle.define_method("margin_left=", set_margin_left);
628
781
  cStyle.define_method("margin_left", get_margin_left);
629
782
  cStyle.define_method("margin_top=", set_margin_top);
@@ -646,20 +799,38 @@ Init_style ()
646
799
  cStyle.define_method("padding=", set_padding);
647
800
  cStyle.define_method("padding", get_padding);
648
801
 
649
- cStyle.define_method("fill=", set_fill);
650
- cStyle.define_method("fill", get_fill);
651
- cStyle.define_method("stroke=", set_stroke);
652
- cStyle.define_method("stroke", get_stroke);
802
+ cStyle.define_method("center_x=", set_center_x);
803
+ cStyle.define_method("center_x", get_center_x);
804
+ cStyle.define_method("center_y=", set_center_y);
805
+ cStyle.define_method("center_y", get_center_y);
806
+ cStyle.define_method("center=", set_center);
807
+ cStyle.define_method("center", get_center);
808
+
809
+ cStyle.define_method("foreground_fill=", set_foreground_fill);
810
+ cStyle.define_method("foreground_fill", get_foreground_fill);
811
+ cStyle.define_method("foreground_stroke=", set_foreground_stroke);
812
+ cStyle.define_method("foreground_stroke", get_foreground_stroke);
813
+ cStyle.define_method("foreground_stroke_width=", set_foreground_stroke_width);
814
+ cStyle.define_method("foreground_stroke_width", get_foreground_stroke_width);
815
+ cStyle.define_method("background_fill=", set_background_fill);
816
+ cStyle.define_method("background_fill", get_background_fill);
817
+ cStyle.define_method("background_stroke=", set_background_stroke);
818
+ cStyle.define_method("background_stroke", get_background_stroke);
819
+ cStyle.define_method("background_stroke_width=", set_background_stroke_width);
820
+ cStyle.define_method("background_stroke_width", get_background_stroke_width);
653
821
 
654
822
  cStyle.define_method("image=", set_image);
655
823
  cStyle.define_method("image", get_image);
656
824
 
657
825
  cStyle.define_method("==", equal);
826
+
658
827
  cStyle.define_const("FLOW_NONE", Reflex::Style::FLOW_NONE);
659
828
  cStyle.define_const("FLOW_DOWN", Reflex::Style::FLOW_DOWN);
660
829
  cStyle.define_const("FLOW_RIGHT", Reflex::Style::FLOW_RIGHT);
661
830
  cStyle.define_const("FLOW_UP", Reflex::Style::FLOW_UP);
662
831
  cStyle.define_const("FLOW_LEFT", Reflex::Style::FLOW_LEFT);
832
+
833
+ define_selector_methods<Reflex::Style>(cStyle);
663
834
  }
664
835
 
665
836