reflexion 0.1.14 → 0.1.20
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.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/capture_event.cpp +4 -5
- data/.doc/ext/reflex/contact_event.cpp +4 -7
- data/.doc/ext/reflex/draw_event.cpp +3 -4
- data/.doc/ext/reflex/frame_event.cpp +7 -8
- data/.doc/ext/reflex/key_event.cpp +7 -8
- data/.doc/ext/reflex/motion_event.cpp +3 -5
- data/.doc/ext/reflex/pointer_event.cpp +23 -15
- data/.doc/ext/reflex/reflex.cpp +3 -1
- data/.doc/ext/reflex/scroll_event.cpp +8 -9
- data/.doc/ext/reflex/update_event.cpp +4 -5
- data/.doc/ext/reflex/wheel_event.cpp +5 -6
- data/VERSION +1 -1
- data/ext/reflex/capture_event.cpp +3 -4
- data/ext/reflex/contact_event.cpp +3 -6
- data/ext/reflex/draw_event.cpp +2 -3
- data/ext/reflex/frame_event.cpp +6 -7
- data/ext/reflex/key_event.cpp +6 -7
- data/ext/reflex/motion_event.cpp +2 -4
- data/ext/reflex/pointer_event.cpp +22 -14
- data/ext/reflex/reflex.cpp +3 -1
- data/ext/reflex/scroll_event.cpp +8 -9
- data/ext/reflex/update_event.cpp +3 -4
- data/ext/reflex/wheel_event.cpp +4 -5
- data/include/reflex/defs.h +0 -2
- data/include/reflex/event.h +15 -15
- data/include/reflex/exception.h +9 -3
- data/include/reflex/ruby/event.h +11 -11
- data/include/reflex/ruby/reflex.h +1 -0
- data/include/reflex/style.h +30 -4
- data/lib/reflex.rb +2 -1
- data/lib/reflex/camera.rb +13 -0
- data/lib/reflex/pointer_event.rb +4 -0
- data/reflex.gemspec +4 -4
- data/samples/camera.rb +45 -0
- data/samples/shapes.rb +16 -0
- data/src/event.cpp +7 -7
- data/src/ios/view_controller.h +4 -0
- data/src/ios/view_controller.mm +22 -34
- data/src/osx/native_window.mm +10 -26
- data/src/shape.cpp +4 -4
- data/src/style.cpp +4 -4
- data/src/timer.cpp +3 -6
- data/src/view.cpp +2 -2
- data/src/window.cpp +27 -0
- data/src/window.h +2 -0
- data/test/test_pointer_event.rb +79 -34
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 218d0608702c70706afb48a61849b27fd36fc8a2efc6518da6ed54f66d7e0662
|
4
|
+
data.tar.gz: ff0332f957a15deea1923575c042c970c9cc86b6da8279131faa91fafe6389af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbacfbdaf3ba3554bfa31a193f0b438b020f2327695f17ee5653953e29693138faa8d89840020b7c735e6474c776cd5c7df9924b59346048f58eafdae19212c8
|
7
|
+
data.tar.gz: 5e38e12dd168b2ae77f5b427541ed68ed2b50599fba5264987d5819a96e1949b1f45fd4da8e07ce3a275f0c8eb07ca260978e36f693d65e2eb8c48525ef79b91
|
@@ -19,13 +19,12 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self)
|
22
|
+
VALUE initialize(VALUE self, VALUE begin, VALUE end)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "CaptureEvent#initialize", argc, 0, 1, 2);
|
26
25
|
|
27
|
-
THIS->begin =
|
28
|
-
THIS->end =
|
26
|
+
THIS->begin = to<uint>(begin);
|
27
|
+
THIS->end = to<uint>(end);
|
29
28
|
|
30
29
|
return rb_call_super(0, NULL);
|
31
30
|
}
|
@@ -62,7 +61,7 @@ Init_capture_event ()
|
|
62
61
|
|
63
62
|
cCaptureEvent = mReflex.define_class("CaptureEvent", Reflex::event_class());
|
64
63
|
rb_define_alloc_func(cCaptureEvent, alloc);
|
65
|
-
rb_define_private_method(cCaptureEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
64
|
+
rb_define_private_method(cCaptureEvent, "initialize", RUBY_METHOD_FUNC(initialize), 2);
|
66
65
|
rb_define_private_method(cCaptureEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
67
66
|
rb_define_private_method(cCaptureEvent, "get_begin", RUBY_METHOD_FUNC(begin), 0);
|
68
67
|
rb_define_private_method(cCaptureEvent, "get_end", RUBY_METHOD_FUNC(end), 0);
|
@@ -20,15 +20,12 @@ VALUE alloc(VALUE klass)
|
|
20
20
|
}
|
21
21
|
|
22
22
|
static
|
23
|
-
VALUE initialize(VALUE self)
|
23
|
+
VALUE initialize(VALUE self, VALUE type, VALUE shape)
|
24
24
|
{
|
25
25
|
CHECK;
|
26
|
-
check_arg_count(__FILE__, __LINE__, "ContactEvent#initialize", argc, 0, 2);
|
27
26
|
|
28
|
-
THIS->type = (
|
29
|
-
|
30
|
-
: Reflex::ContactEvent::NONE;
|
31
|
-
THIS->shape = (argc >= 2) ? to<Reflex::Shape*>(argv[1]) : NULL;
|
27
|
+
THIS->type = (Reflex::ContactEvent::Type) to<int>(type);
|
28
|
+
THIS->shape = to<Reflex::Shape*>(shape);
|
32
29
|
|
33
30
|
return rb_call_super(0, NULL);
|
34
31
|
}
|
@@ -72,7 +69,7 @@ Init_contact_event ()
|
|
72
69
|
|
73
70
|
cContactEvent = mReflex.define_class("ContactEvent", Reflex::event_class());
|
74
71
|
rb_define_alloc_func(cContactEvent, alloc);
|
75
|
-
rb_define_private_method(cContactEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
72
|
+
rb_define_private_method(cContactEvent, "initialize", RUBY_METHOD_FUNC(initialize), 2);
|
76
73
|
rb_define_private_method(cContactEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
77
74
|
rb_define_method(cContactEvent, "type", RUBY_METHOD_FUNC(type), 0);
|
78
75
|
rb_define_method(cContactEvent, "shape", RUBY_METHOD_FUNC(shape), 0);
|
@@ -20,12 +20,11 @@ VALUE alloc(VALUE klass)
|
|
20
20
|
}
|
21
21
|
|
22
22
|
static
|
23
|
-
VALUE initialize(VALUE self)
|
23
|
+
VALUE initialize(VALUE self, VALUE dt)
|
24
24
|
{
|
25
25
|
CHECK;
|
26
|
-
check_arg_count(__FILE__, __LINE__, "DrawEvent#initialize", argc, 0, 1);
|
27
26
|
|
28
|
-
THIS->dt =
|
27
|
+
THIS->dt = to<float>(dt);
|
29
28
|
|
30
29
|
return rb_call_super(0, NULL);
|
31
30
|
}
|
@@ -76,7 +75,7 @@ Init_draw_event ()
|
|
76
75
|
|
77
76
|
cDrawEvent = mReflex.define_class("DrawEvent", Reflex::event_class());
|
78
77
|
rb_define_alloc_func(cDrawEvent, alloc);
|
79
|
-
rb_define_private_method(cDrawEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
78
|
+
rb_define_private_method(cDrawEvent, "initialize", RUBY_METHOD_FUNC(initialize), 1);
|
80
79
|
rb_define_private_method(cDrawEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
81
80
|
rb_define_method(cDrawEvent, "painter", RUBY_METHOD_FUNC(painter), 0);
|
82
81
|
rb_define_method(cDrawEvent, "bounds", RUBY_METHOD_FUNC(bounds), 0);
|
@@ -20,16 +20,15 @@ VALUE alloc(VALUE klass)
|
|
20
20
|
}
|
21
21
|
|
22
22
|
static
|
23
|
-
VALUE initialize(VALUE self)
|
23
|
+
VALUE initialize(VALUE self, VALUE frame, VALUE dx, VALUE dy, VALUE dwidth, VALUE dheight)
|
24
24
|
{
|
25
25
|
CHECK;
|
26
|
-
check_arg_count(__FILE__, __LINE__, "FrameEvent#initialize", argc, 0, 1, 2, 3, 4, 5);
|
27
26
|
|
28
|
-
THIS->frame =
|
29
|
-
THIS->dx =
|
30
|
-
THIS->dy =
|
31
|
-
THIS->dwidth =
|
32
|
-
THIS->dheight =
|
27
|
+
THIS->frame = to<Rays::Bounds>(frame);
|
28
|
+
THIS->dx = to<coord>(dx);
|
29
|
+
THIS->dy = to<coord>(dy);
|
30
|
+
THIS->dwidth = to<coord>(dwidth);
|
31
|
+
THIS->dheight = to<coord>(dheight);
|
33
32
|
|
34
33
|
return rb_call_super(0, NULL);
|
35
34
|
}
|
@@ -136,7 +135,7 @@ Init_frame_event ()
|
|
136
135
|
|
137
136
|
cFrameEvent = mReflex.define_class("FrameEvent", Reflex::event_class());
|
138
137
|
rb_define_alloc_func(cFrameEvent, alloc);
|
139
|
-
rb_define_private_method(cFrameEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
138
|
+
rb_define_private_method(cFrameEvent, "initialize", RUBY_METHOD_FUNC(initialize), 5);
|
140
139
|
rb_define_private_method(cFrameEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
141
140
|
rb_define_method(cFrameEvent, "frame", RUBY_METHOD_FUNC(frame), 0);
|
142
141
|
rb_define_method(cFrameEvent, "dx", RUBY_METHOD_FUNC(dx), 0);
|
@@ -18,16 +18,15 @@ VALUE alloc(VALUE klass)
|
|
18
18
|
}
|
19
19
|
|
20
20
|
static
|
21
|
-
VALUE initialize(VALUE self)
|
21
|
+
VALUE initialize(VALUE self, VALUE type, VALUE chars, VALUE code, VALUE repeat, VALUE modifiers)
|
22
22
|
{
|
23
23
|
CHECK;
|
24
|
-
check_arg_count(__FILE__, __LINE__, "KeyEvent#initialize", argc, 0, 1, 2, 3, 4, 5);
|
25
24
|
|
26
|
-
THIS->type = (
|
27
|
-
THIS->chars =
|
28
|
-
THIS->code =
|
29
|
-
THIS->repeat =
|
30
|
-
THIS->modifiers =
|
25
|
+
THIS->type = (Reflex::KeyEvent::Type) to<int>(type);
|
26
|
+
THIS->chars = chars.c_str();
|
27
|
+
THIS->code = to<int>(code);
|
28
|
+
THIS->repeat = to<int>(repeat);
|
29
|
+
THIS->modifiers = to<uint>(modifiers);
|
31
30
|
|
32
31
|
return rb_call_super(0, NULL);
|
33
32
|
}
|
@@ -92,7 +91,7 @@ Init_key_event ()
|
|
92
91
|
|
93
92
|
cKeyEvent = mReflex.define_class("KeyEvent", Reflex::event_class());
|
94
93
|
rb_define_alloc_func(cKeyEvent, alloc);
|
95
|
-
rb_define_private_method(cKeyEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
94
|
+
rb_define_private_method(cKeyEvent, "initialize", RUBY_METHOD_FUNC(initialize), 5);
|
96
95
|
rb_define_private_method(cKeyEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
97
96
|
rb_define_method(cKeyEvent, "type", RUBY_METHOD_FUNC(type), 0);
|
98
97
|
rb_define_method(cKeyEvent, "chars", RUBY_METHOD_FUNC(chars), 0);
|
@@ -19,13 +19,11 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self)
|
22
|
+
VALUE initialize(VALUE self, VALUE gravity)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "MotionEvent#initialize", argc, 0, 1);
|
26
25
|
|
27
|
-
|
28
|
-
THIS->gravity = to<Rays::Point>(argv[0]);
|
26
|
+
THIS->gravity = to<Rays::Point>(gravity);
|
29
27
|
|
30
28
|
return rb_call_super(0, NULL);
|
31
29
|
}
|
@@ -55,7 +53,7 @@ Init_motion_event ()
|
|
55
53
|
|
56
54
|
cMotionEvent = mReflex.define_class("MotionEvent", Reflex::event_class());
|
57
55
|
rb_define_alloc_func(cMotionEvent, alloc);
|
58
|
-
rb_define_private_method(cMotionEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
56
|
+
rb_define_private_method(cMotionEvent, "initialize", RUBY_METHOD_FUNC(initialize), 1);
|
59
57
|
rb_define_private_method(cMotionEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
60
58
|
rb_define_method(cMotionEvent, "gravity", RUBY_METHOD_FUNC(gravity), 0);
|
61
59
|
}
|
@@ -19,19 +19,23 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self)
|
22
|
+
VALUE initialize(VALUE self, VALUE type, VALUE pointer_type, VALUE modifiers, VALUE count, VALUE drag, VALUE positions)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "PointerEvent#initialize", argc, 0, 1, 2, 3, 4, 5, 6, 7);
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
THIS->
|
32
|
-
THIS->
|
33
|
-
THIS->
|
34
|
-
THIS->
|
26
|
+
int size = positions.size();
|
27
|
+
if (size <= 0 || Reflex::PointerEvent::MAX < size)
|
28
|
+
argument_error(__FILE__, __LINE__);
|
29
|
+
|
30
|
+
THIS->type = (Reflex::PointerEvent::Type) to<int>(type);
|
31
|
+
THIS->pointer_type = to<uint>(pointer_type);
|
32
|
+
THIS->modifiers = to<uint>(modifiers);
|
33
|
+
THIS->count = to<uint>(count);
|
34
|
+
THIS->drag = to<bool>(drag);
|
35
|
+
THIS->size = (size_t) size;
|
36
|
+
|
37
|
+
for (int i = 0; i < size; ++i)
|
38
|
+
THIS->positions[i] = to<Rays::Point>(positions[i]);
|
35
39
|
|
36
40
|
return rb_call_super(0, NULL);
|
37
41
|
}
|
@@ -118,10 +122,15 @@ VALUE position(VALUE self)
|
|
118
122
|
}
|
119
123
|
|
120
124
|
static
|
121
|
-
VALUE
|
125
|
+
VALUE get_at(VALUE self, VALUE index)
|
122
126
|
{
|
123
127
|
CHECK;
|
124
|
-
|
128
|
+
|
129
|
+
int i = to<int>(index);
|
130
|
+
if (i < 0 || THIS->size <= (size_t) i)
|
131
|
+
index_error(__FILE__, __LINE__);
|
132
|
+
|
133
|
+
return value((*THIS)[i]);
|
125
134
|
}
|
126
135
|
|
127
136
|
|
@@ -134,7 +143,7 @@ Init_pointer_event ()
|
|
134
143
|
|
135
144
|
cPointerEvent = mReflex.define_class("PointerEvent", Reflex::event_class());
|
136
145
|
rb_define_alloc_func(cPointerEvent, alloc);
|
137
|
-
rb_define_private_method(cPointerEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
146
|
+
rb_define_private_method(cPointerEvent, "initialize", RUBY_METHOD_FUNC(initialize), 6);
|
138
147
|
rb_define_private_method(cPointerEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
139
148
|
rb_define_method(cPointerEvent, "type", RUBY_METHOD_FUNC(type), 0);
|
140
149
|
rb_define_method(cPointerEvent, "pointer_type", RUBY_METHOD_FUNC(pointer_type), 0);
|
@@ -146,7 +155,7 @@ Init_pointer_event ()
|
|
146
155
|
rb_define_method(cPointerEvent, "x", RUBY_METHOD_FUNC(x), 0);
|
147
156
|
rb_define_method(cPointerEvent, "y", RUBY_METHOD_FUNC(y), 0);
|
148
157
|
rb_define_method(cPointerEvent, "position", RUBY_METHOD_FUNC(position), -1);
|
149
|
-
cPointerEvent.define_method("[]",
|
158
|
+
cPointerEvent.define_method("[]", get_at);
|
150
159
|
cPointerEvent.define_const("TYPE_NONE", Reflex::PointerEvent::NONE);
|
151
160
|
cPointerEvent.define_const("TYPE_DOWN", Reflex::PointerEvent::DOWN);
|
152
161
|
cPointerEvent.define_const("TYPE_UP", Reflex::PointerEvent::UP);
|
@@ -157,7 +166,6 @@ Init_pointer_event ()
|
|
157
166
|
cPointerEvent.define_const("POINTER_MOUSE_MIDDLE", Reflex::POINTER_MOUSE_MIDDLE);
|
158
167
|
cPointerEvent.define_const("POINTER_TOUCH", Reflex::POINTER_TOUCH);
|
159
168
|
cPointerEvent.define_const("POINTER_PEN", Reflex::POINTER_PEN);
|
160
|
-
cPointerEvent.define_const("POINTER_TYPE_LAST", Reflex::POINTER_TYPE_LAST);
|
161
169
|
}
|
162
170
|
|
163
171
|
|
data/.doc/ext/reflex/reflex.cpp
CHANGED
@@ -19,17 +19,16 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self)
|
22
|
+
VALUE initialize(VALUE self, VALUE x, VALUE y, VALUE z, VALUE dx, VALUE dy, VALUE dz)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "ScrollEvent#initialize", argc, 0, 1, 2, 3, 4, 5, 6);
|
26
25
|
|
27
|
-
THIS->x
|
28
|
-
THIS->y
|
29
|
-
THIS->z
|
30
|
-
THIS->dx
|
31
|
-
THIS->dy
|
32
|
-
THIS->dz
|
26
|
+
THIS->x = to<coord>(x);
|
27
|
+
THIS->y = to<coord>(y);
|
28
|
+
THIS->z = to<coord>(z);
|
29
|
+
THIS->dx = to<coord>(dx);
|
30
|
+
THIS->dy = to<coord>(dy);
|
31
|
+
THIS->dz = to<coord>(dz);
|
33
32
|
|
34
33
|
return rb_call_super(0, NULL);
|
35
34
|
}
|
@@ -108,7 +107,7 @@ Init_scroll_event ()
|
|
108
107
|
|
109
108
|
cScrollEvent = mReflex.define_class("ScrollEvent", Reflex::event_class());
|
110
109
|
rb_define_alloc_func(cScrollEvent, alloc);
|
111
|
-
rb_define_private_method(cScrollEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
110
|
+
rb_define_private_method(cScrollEvent, "initialize", RUBY_METHOD_FUNC(initialize), 6);
|
112
111
|
rb_define_private_method(cScrollEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
113
112
|
rb_define_method(cScrollEvent, "x", RUBY_METHOD_FUNC(x), 0);
|
114
113
|
rb_define_method(cScrollEvent, "y", RUBY_METHOD_FUNC(y), 0);
|
@@ -18,13 +18,12 @@ VALUE alloc(VALUE klass)
|
|
18
18
|
}
|
19
19
|
|
20
20
|
static
|
21
|
-
VALUE initialize(VALUE self)
|
21
|
+
VALUE initialize(VALUE self, VALUE now, VALUE dt)
|
22
22
|
{
|
23
23
|
CHECK;
|
24
|
-
check_arg_count(__FILE__, __LINE__, "UpdateEvent#initialize", argc, 0, 1, 2);
|
25
24
|
|
26
|
-
THIS->now =
|
27
|
-
THIS->dt =
|
25
|
+
THIS->now = to<double>(now);
|
26
|
+
THIS->dt = to<float>(dt);
|
28
27
|
|
29
28
|
return rb_call_super(0, NULL);
|
30
29
|
}
|
@@ -61,7 +60,7 @@ Init_update_event ()
|
|
61
60
|
|
62
61
|
cUpdateEvent = mReflex.define_class("UpdateEvent", Reflex::event_class());
|
63
62
|
rb_define_alloc_func(cUpdateEvent, alloc);
|
64
|
-
rb_define_private_method(cUpdateEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
63
|
+
rb_define_private_method(cUpdateEvent, "initialize", RUBY_METHOD_FUNC(initialize), 2);
|
65
64
|
rb_define_private_method(cUpdateEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
66
65
|
rb_define_method(cUpdateEvent, "now", RUBY_METHOD_FUNC(now), 0);
|
67
66
|
rb_define_method(cUpdateEvent, "dt", RUBY_METHOD_FUNC(dt), 0);
|
@@ -19,14 +19,13 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self)
|
22
|
+
VALUE initialize(VALUE self, VALUE dx, VALUE dy, VALUE dz)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "WheelEvent#initialize", argc, 0, 1, 2, 3);
|
26
25
|
|
27
|
-
THIS->dx =
|
28
|
-
THIS->dy =
|
29
|
-
THIS->dz =
|
26
|
+
THIS->dx = to<coord>(dx);
|
27
|
+
THIS->dy = to<coord>(dy);
|
28
|
+
THIS->dz = to<coord>(dz);
|
30
29
|
|
31
30
|
return rb_call_super(0, NULL);
|
32
31
|
}
|
@@ -98,7 +97,7 @@ Init_wheel_event ()
|
|
98
97
|
|
99
98
|
cWheelEvent = mReflex.define_class("WheelEvent", Reflex::event_class());
|
100
99
|
rb_define_alloc_func(cWheelEvent, alloc);
|
101
|
-
rb_define_private_method(cWheelEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
100
|
+
rb_define_private_method(cWheelEvent, "initialize", RUBY_METHOD_FUNC(initialize), 3);
|
102
101
|
rb_define_private_method(cWheelEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
103
102
|
rb_define_method(cWheelEvent, "dx", RUBY_METHOD_FUNC(dx), 0);
|
104
103
|
rb_define_method(cWheelEvent, "dy", RUBY_METHOD_FUNC(dy), 0);
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.20
|
@@ -20,13 +20,12 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
20
20
|
RUCY_END
|
21
21
|
|
22
22
|
static
|
23
|
-
|
23
|
+
RUCY_DEF2(initialize, begin, end)
|
24
24
|
{
|
25
25
|
CHECK;
|
26
|
-
check_arg_count(__FILE__, __LINE__, "CaptureEvent#initialize", argc, 0, 1, 2);
|
27
26
|
|
28
|
-
THIS->begin =
|
29
|
-
THIS->end =
|
27
|
+
THIS->begin = to<uint>(begin);
|
28
|
+
THIS->end = to<uint>(end);
|
30
29
|
|
31
30
|
return rb_call_super(0, NULL);
|
32
31
|
}
|
@@ -21,15 +21,12 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
21
|
RUCY_END
|
22
22
|
|
23
23
|
static
|
24
|
-
|
24
|
+
RUCY_DEF2(initialize, type, shape)
|
25
25
|
{
|
26
26
|
CHECK;
|
27
|
-
check_arg_count(__FILE__, __LINE__, "ContactEvent#initialize", argc, 0, 2);
|
28
27
|
|
29
|
-
THIS->type = (
|
30
|
-
|
31
|
-
: Reflex::ContactEvent::NONE;
|
32
|
-
THIS->shape = (argc >= 2) ? to<Reflex::Shape*>(argv[1]) : NULL;
|
28
|
+
THIS->type = (Reflex::ContactEvent::Type) to<int>(type);
|
29
|
+
THIS->shape = to<Reflex::Shape*>(shape);
|
33
30
|
|
34
31
|
return rb_call_super(0, NULL);
|
35
32
|
}
|
data/ext/reflex/draw_event.cpp
CHANGED
@@ -21,12 +21,11 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
21
|
RUCY_END
|
22
22
|
|
23
23
|
static
|
24
|
-
|
24
|
+
RUCY_DEF1(initialize, dt)
|
25
25
|
{
|
26
26
|
CHECK;
|
27
|
-
check_arg_count(__FILE__, __LINE__, "DrawEvent#initialize", argc, 0, 1);
|
28
27
|
|
29
|
-
THIS->dt =
|
28
|
+
THIS->dt = to<float>(dt);
|
30
29
|
|
31
30
|
return rb_call_super(0, NULL);
|
32
31
|
}
|
data/ext/reflex/frame_event.cpp
CHANGED
@@ -21,16 +21,15 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
21
|
RUCY_END
|
22
22
|
|
23
23
|
static
|
24
|
-
|
24
|
+
RUCY_DEF5(initialize, frame, dx, dy, dwidth, dheight)
|
25
25
|
{
|
26
26
|
CHECK;
|
27
|
-
check_arg_count(__FILE__, __LINE__, "FrameEvent#initialize", argc, 0, 1, 2, 3, 4, 5);
|
28
27
|
|
29
|
-
THIS->frame =
|
30
|
-
THIS->dx =
|
31
|
-
THIS->dy =
|
32
|
-
THIS->dwidth =
|
33
|
-
THIS->dheight =
|
28
|
+
THIS->frame = to<Rays::Bounds>(frame);
|
29
|
+
THIS->dx = to<coord>(dx);
|
30
|
+
THIS->dy = to<coord>(dy);
|
31
|
+
THIS->dwidth = to<coord>(dwidth);
|
32
|
+
THIS->dheight = to<coord>(dheight);
|
34
33
|
|
35
34
|
return rb_call_super(0, NULL);
|
36
35
|
}
|
data/ext/reflex/key_event.cpp
CHANGED
@@ -19,16 +19,15 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
19
19
|
RUCY_END
|
20
20
|
|
21
21
|
static
|
22
|
-
|
22
|
+
RUCY_DEF5(initialize, type, chars, code, repeat, modifiers)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
|
-
check_arg_count(__FILE__, __LINE__, "KeyEvent#initialize", argc, 0, 1, 2, 3, 4, 5);
|
26
25
|
|
27
|
-
THIS->type = (
|
28
|
-
THIS->chars =
|
29
|
-
THIS->code =
|
30
|
-
THIS->repeat =
|
31
|
-
THIS->modifiers =
|
26
|
+
THIS->type = (Reflex::KeyEvent::Type) to<int>(type);
|
27
|
+
THIS->chars = chars.c_str();
|
28
|
+
THIS->code = to<int>(code);
|
29
|
+
THIS->repeat = to<int>(repeat);
|
30
|
+
THIS->modifiers = to<uint>(modifiers);
|
32
31
|
|
33
32
|
return rb_call_super(0, NULL);
|
34
33
|
}
|