reflexion 0.1.21 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/reflex/capture_event.cpp +6 -5
  3. data/.doc/ext/reflex/contact_event.cpp +18 -16
  4. data/.doc/ext/reflex/draw_event.cpp +10 -8
  5. data/.doc/ext/reflex/event.cpp +10 -10
  6. data/.doc/ext/reflex/focus_event.cpp +18 -17
  7. data/.doc/ext/reflex/frame_event.cpp +17 -17
  8. data/.doc/ext/reflex/key_event.cpp +227 -28
  9. data/.doc/ext/reflex/native.cpp +2 -0
  10. data/.doc/ext/reflex/pointer.cpp +158 -0
  11. data/.doc/ext/reflex/pointer_event.cpp +32 -91
  12. data/.doc/ext/reflex/scroll_event.cpp +14 -17
  13. data/.doc/ext/reflex/selector.cpp +8 -0
  14. data/.doc/ext/reflex/timer.cpp +9 -1
  15. data/.doc/ext/reflex/timer_event.cpp +4 -13
  16. data/.doc/ext/reflex/update_event.cpp +6 -5
  17. data/.doc/ext/reflex/view.cpp +57 -0
  18. data/.doc/ext/reflex/wheel_event.cpp +39 -22
  19. data/.doc/ext/reflex/window.cpp +24 -0
  20. data/VERSION +1 -1
  21. data/ext/reflex/capture_event.cpp +6 -5
  22. data/ext/reflex/contact_event.cpp +18 -16
  23. data/ext/reflex/draw_event.cpp +9 -7
  24. data/ext/reflex/event.cpp +11 -11
  25. data/ext/reflex/focus_event.cpp +18 -17
  26. data/ext/reflex/frame_event.cpp +16 -16
  27. data/ext/reflex/key_event.cpp +228 -28
  28. data/ext/reflex/native.cpp +2 -0
  29. data/ext/reflex/pointer.cpp +170 -0
  30. data/ext/reflex/pointer_event.cpp +31 -96
  31. data/ext/reflex/scroll_event.cpp +15 -18
  32. data/ext/reflex/selector.cpp +9 -0
  33. data/ext/reflex/timer.cpp +15 -6
  34. data/ext/reflex/timer_event.cpp +9 -19
  35. data/ext/reflex/update_event.cpp +6 -5
  36. data/ext/reflex/view.cpp +67 -3
  37. data/ext/reflex/wheel_event.cpp +40 -21
  38. data/ext/reflex/window.cpp +30 -3
  39. data/include/reflex/defs.h +140 -106
  40. data/include/reflex/event.h +232 -124
  41. data/include/reflex/pointer.h +107 -0
  42. data/include/reflex/ruby/pointer.h +41 -0
  43. data/include/reflex/ruby/view.h +9 -0
  44. data/include/reflex/ruby/window.h +9 -0
  45. data/include/reflex/selector.h +1 -1
  46. data/include/reflex/shape.h +2 -2
  47. data/include/reflex/view.h +6 -4
  48. data/include/reflex/window.h +10 -8
  49. data/lib/reflex/application.rb +3 -3
  50. data/lib/reflex/autoinit.rb +1 -1
  51. data/lib/reflex/button.rb +7 -7
  52. data/lib/reflex/capture_event.rb +7 -7
  53. data/lib/reflex/contact_event.rb +10 -10
  54. data/lib/reflex/draw_event.rb +2 -2
  55. data/lib/reflex/ellipse_shape.rb +2 -2
  56. data/lib/reflex/focus_event.rb +11 -11
  57. data/lib/reflex/frame_event.rb +5 -5
  58. data/lib/reflex/helper.rb +20 -20
  59. data/lib/reflex/image_view.rb +2 -2
  60. data/lib/reflex/key_event.rb +12 -12
  61. data/lib/reflex/model.rb +22 -22
  62. data/lib/reflex/model_owner.rb +7 -7
  63. data/lib/reflex/model_view.rb +1 -1
  64. data/lib/reflex/module.rb +5 -5
  65. data/lib/reflex/pointer.rb +107 -0
  66. data/lib/reflex/pointer_event.rb +16 -54
  67. data/lib/reflex/polygon_shape.rb +2 -2
  68. data/lib/reflex/reflex.rb +3 -3
  69. data/lib/reflex/scroll_event.rb +1 -1
  70. data/lib/reflex/selector.rb +4 -4
  71. data/lib/reflex/shape.rb +13 -13
  72. data/lib/reflex/style.rb +11 -11
  73. data/lib/reflex/style_length.rb +1 -1
  74. data/lib/reflex/text_view.rb +2 -2
  75. data/lib/reflex/timer.rb +2 -2
  76. data/lib/reflex/timer_event.rb +3 -2
  77. data/lib/reflex/update_event.rb +1 -1
  78. data/lib/reflex/view.rb +32 -32
  79. data/lib/reflex/wheel_event.rb +2 -10
  80. data/lib/reflex/window.rb +6 -6
  81. data/lib/reflex.rb +1 -0
  82. data/lib/reflexion.rb +17 -17
  83. data/reflex.gemspec +5 -5
  84. data/samples/reflexion/noise.rb +1 -1
  85. data/samples/tree.rb +1 -1
  86. data/src/event.cpp +792 -86
  87. data/src/event.h +47 -0
  88. data/src/image_view.cpp +2 -2
  89. data/src/ios/event.h +15 -3
  90. data/src/ios/event.mm +126 -11
  91. data/src/ios/view_controller.mm +50 -22
  92. data/src/ios/window.mm +1 -1
  93. data/src/osx/event.h +15 -4
  94. data/src/osx/event.mm +214 -24
  95. data/src/osx/native_window.mm +84 -17
  96. data/src/pointer.cpp +203 -0
  97. data/src/pointer.h +26 -0
  98. data/src/selector.cpp +1 -1
  99. data/src/shape.cpp +11 -13
  100. data/src/shape.h +1 -1
  101. data/src/view.cpp +205 -118
  102. data/src/view.h +5 -10
  103. data/src/window.cpp +334 -104
  104. data/src/window.h +22 -3
  105. data/src/world.cpp +6 -4
  106. data/test/helper.rb +3 -3
  107. data/test/test_application.rb +1 -1
  108. data/test/test_capture_event.rb +22 -6
  109. data/test/test_contact_event.rb +40 -0
  110. data/test/test_draw_event.rb +35 -0
  111. data/test/test_event.rb +33 -5
  112. data/test/test_focus_event.rb +34 -0
  113. data/test/test_frame_event.rb +38 -0
  114. data/test/test_has_frame.rb +11 -11
  115. data/test/test_key_event.rb +33 -0
  116. data/test/test_pointer.rb +149 -0
  117. data/test/test_pointer_event.rb +70 -104
  118. data/test/test_reflex.rb +1 -1
  119. data/test/test_scroll_event.rb +39 -0
  120. data/test/test_selector.rb +15 -8
  121. data/test/test_shape.rb +8 -8
  122. data/test/test_style.rb +13 -13
  123. data/test/test_style_length.rb +5 -5
  124. data/test/test_timer_event.rb +38 -0
  125. data/test/test_update_event.rb +29 -0
  126. data/test/test_view.rb +57 -30
  127. data/test/test_wheel_event.rb +40 -0
  128. data/test/test_window.rb +29 -27
  129. metadata +64 -35
data/src/pointer.h ADDED
@@ -0,0 +1,26 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __REFLEX_SRC_POINTER_H__
4
+ #define __REFLEX_SRC_POINTER_H__
5
+
6
+
7
+ #include <functional>
8
+ #include <reflex/pointer.h>
9
+
10
+
11
+ namespace Reflex
12
+ {
13
+
14
+
15
+ void Pointer_update_positions (
16
+ Pointer* pthis, std::function<void(Point*)> fun);
17
+
18
+ void Pointer_set_id (Pointer* pthis, Pointer::ID id);
19
+
20
+ void Pointer_set_prev (Pointer* pthis, const Pointer* prev);
21
+
22
+
23
+ }// Reflex
24
+
25
+
26
+ #endif//EOH
data/src/selector.cpp CHANGED
@@ -139,7 +139,7 @@ namespace Reflex
139
139
  }
140
140
 
141
141
  bool
142
- Selector::is_empty () const
142
+ Selector::empty () const
143
143
  {
144
144
  return self->name.empty() && self->tags.empty();
145
145
  }
data/src/shape.cpp CHANGED
@@ -432,25 +432,23 @@ namespace Reflex
432
432
  }
433
433
 
434
434
  void
435
- Shape_call_contact_event (Shape* shape, const ContactEvent& event)
435
+ Shape_call_contact_event (Shape* shape, ContactEvent* event)
436
436
  {
437
- if (!shape)
437
+ if (!shape || !event)
438
438
  argument_error(__FILE__, __LINE__);
439
439
 
440
- ContactEvent e = event;
441
- shape->on_contact(&e);
440
+ shape->on_contact(event);
442
441
 
443
- switch (e.type)
442
+ switch (event->action())
444
443
  {
445
- case ContactEvent::BEGIN: shape->on_contact_begin(&e); break;
446
- case ContactEvent::END: shape->on_contact_end(&e); break;
447
- case ContactEvent::NONE: break;
444
+ case ContactEvent::BEGIN: shape->on_contact_begin(event); break;
445
+ case ContactEvent::END: shape->on_contact_end(event); break;
446
+ default: break;
448
447
  }
449
448
 
450
- if (e.is_blocked())
451
- return;
449
+ if (event->is_blocked()) return;
452
450
 
453
- View_call_contact_event(shape->owner(), e);
451
+ View_call_contact_event(shape->owner(), event);
454
452
  }
455
453
 
456
454
 
@@ -587,9 +585,9 @@ namespace Reflex
587
585
  void
588
586
  Shape::on_draw (DrawEvent* e)
589
587
  {
590
- assert(e && e->painter);
588
+ assert(e && e->painter());
591
589
 
592
- e->painter->polygon(self->polygon);
590
+ e->painter()->polygon(self->polygon);
593
591
  }
594
592
 
595
593
  void
data/src/shape.h CHANGED
@@ -52,7 +52,7 @@ namespace Reflex
52
52
 
53
53
  void Shape_update (Shape* shape, bool force = false);
54
54
 
55
- void Shape_call_contact_event (Shape* shape, const ContactEvent& event);
55
+ void Shape_call_contact_event (Shape* shape, ContactEvent* event);
56
56
 
57
57
 
58
58
  }// Reflex