reflexion 0.1.15 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- 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 -14
- 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/.doc/ext/reflex/window.cpp +17 -0
- 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 -13
- 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/ext/reflex/window.cpp +19 -0
- 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/window.h +4 -0
- data/lib/reflex.rb +2 -1
- data/lib/reflex/camera.rb +13 -0
- data/lib/reflex/pointer_event.rb +4 -0
- data/lib/reflex/window.rb +2 -1
- data/reflex.gemspec +4 -4
- data/samples/camera.rb +45 -0
- data/src/event.cpp +7 -7
- data/src/ios/view_controller.mm +1 -1
- data/src/ios/window.mm +18 -0
- data/src/osx/native_window.mm +1 -1
- data/src/osx/window.mm +22 -0
- data/src/timer.cpp +3 -6
- data/src/window.cpp +13 -1
- data/src/window.h +6 -0
- data/test/test_pointer_event.rb +79 -34
- data/test/test_window.rb +17 -0
- 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: 3a92694d805e53936c602a5b7b4f686c39505f90683f039d021678dae013408a
|
4
|
+
data.tar.gz: 78b1cc8751399d48133827f757bd53dd8b165afb695da6b233d80134977274ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0086b7bcbc0f684dc3e94fe57fee7057e055708f338d22c11f6dea11dd9c36056079c2558c77bb24d8277b15758e86707a95c0c03ae9e21c35e8192385efe1f
|
7
|
+
data.tar.gz: 656414624e17e036e032b0904a7499c6fbb3846b96b8eac83bdf6c6ec6154e89fc93f73ca5d95ee340336830579546cc179342374a7624b8870af4c192ff97d4
|
@@ -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);
|
@@ -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/.doc/ext/reflex/window.cpp
CHANGED
@@ -84,6 +84,21 @@ VALUE get_frame(VALUE self)
|
|
84
84
|
return value(THIS->frame());
|
85
85
|
}
|
86
86
|
|
87
|
+
static
|
88
|
+
VALUE set_resizable(VALUE self, VALUE state)
|
89
|
+
{
|
90
|
+
CHECK;
|
91
|
+
THIS->set_resizable(to<bool>(state));
|
92
|
+
return value(THIS->is_resizable());
|
93
|
+
}
|
94
|
+
|
95
|
+
static
|
96
|
+
VALUE is_resizable(VALUE self)
|
97
|
+
{
|
98
|
+
CHECK;
|
99
|
+
return value(THIS->is_resizable());
|
100
|
+
}
|
101
|
+
|
87
102
|
static
|
88
103
|
VALUE hidden(VALUE self)
|
89
104
|
{
|
@@ -239,6 +254,8 @@ Init_window ()
|
|
239
254
|
rb_define_method(cWindow, "title", RUBY_METHOD_FUNC(get_title), 0);
|
240
255
|
rb_define_method(cWindow, "frame=", RUBY_METHOD_FUNC(set_frame), -1);
|
241
256
|
rb_define_method(cWindow, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
257
|
+
rb_define_method(cWindow, "resizable=", RUBY_METHOD_FUNC(set_resizable), 1);
|
258
|
+
cWindow.define_method("resizable?", is_resizable);
|
242
259
|
rb_define_method(cWindow, "hidden", RUBY_METHOD_FUNC(hidden), 0);
|
243
260
|
rb_define_method(cWindow, "root", RUBY_METHOD_FUNC(root), 0);
|
244
261
|
rb_define_method(cWindow, "focus", RUBY_METHOD_FUNC(focus), 0);
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.21
|
@@ -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
|
}
|