reflexion 0.1.23 → 0.1.24
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 +6 -5
- data/.doc/ext/reflex/contact_event.cpp +14 -12
- data/.doc/ext/reflex/draw_event.cpp +10 -8
- data/.doc/ext/reflex/event.cpp +2 -10
- data/.doc/ext/reflex/focus_event.cpp +14 -13
- data/.doc/ext/reflex/frame_event.cpp +17 -17
- data/.doc/ext/reflex/key_event.cpp +20 -19
- data/.doc/ext/reflex/pointer_event.cpp +1 -1
- data/.doc/ext/reflex/scroll_event.cpp +14 -17
- data/.doc/ext/reflex/timer.cpp +9 -1
- data/.doc/ext/reflex/timer_event.cpp +4 -13
- data/.doc/ext/reflex/update_event.cpp +6 -5
- data/.doc/ext/reflex/wheel_event.cpp +39 -22
- data/VERSION +1 -1
- data/ext/reflex/capture_event.cpp +6 -5
- data/ext/reflex/contact_event.cpp +16 -14
- data/ext/reflex/draw_event.cpp +9 -7
- data/ext/reflex/event.cpp +2 -11
- data/ext/reflex/focus_event.cpp +14 -13
- data/ext/reflex/frame_event.cpp +16 -16
- data/ext/reflex/key_event.cpp +20 -19
- data/ext/reflex/pointer_event.cpp +1 -1
- data/ext/reflex/scroll_event.cpp +15 -18
- data/ext/reflex/timer.cpp +15 -6
- data/ext/reflex/timer_event.cpp +9 -19
- data/ext/reflex/update_event.cpp +6 -5
- data/ext/reflex/wheel_event.cpp +40 -21
- data/include/reflex/event.h +224 -115
- data/include/reflex/shape.h +2 -2
- data/lib/reflex/contact_event.rb +7 -7
- data/lib/reflex/focus_event.rb +8 -8
- data/lib/reflex/key_event.rb +8 -8
- data/lib/reflex/pointer.rb +3 -3
- data/lib/reflex/timer_event.rb +2 -1
- data/lib/reflex/wheel_event.rb +1 -9
- data/lib/reflex/window.rb +1 -1
- data/reflex.gemspec +4 -4
- data/src/event.cpp +630 -76
- data/src/event.h +15 -0
- data/src/image_view.cpp +2 -2
- data/src/ios/view_controller.mm +1 -1
- data/src/osx/event.h +1 -1
- data/src/osx/event.mm +9 -9
- data/src/osx/native_window.mm +1 -1
- data/src/shape.cpp +11 -13
- data/src/shape.h +1 -1
- data/src/view.cpp +137 -89
- data/src/view.h +5 -6
- data/src/window.cpp +44 -38
- data/src/world.cpp +6 -4
- data/test/test_capture_event.rb +16 -0
- data/test/test_contact_event.rb +40 -0
- data/test/test_draw_event.rb +35 -0
- data/test/test_event.rb +20 -6
- data/test/test_focus_event.rb +34 -0
- data/test/test_frame_event.rb +38 -0
- data/test/test_key_event.rb +33 -0
- data/test/test_pointer.rb +14 -14
- data/test/test_pointer_event.rb +1 -1
- data/test/test_scroll_event.rb +39 -0
- data/test/test_timer_event.rb +38 -0
- data/test/test_update_event.rb +29 -0
- data/test/test_wheel_event.rb +40 -0
- metadata +29 -11
@@ -24,7 +24,7 @@ VALUE initialize(VALUE self, VALUE timer)
|
|
24
24
|
{
|
25
25
|
CHECK;
|
26
26
|
|
27
|
-
THIS
|
27
|
+
*THIS = Reflex::TimerEvent(to<Reflex::Timer*>(timer));
|
28
28
|
|
29
29
|
return rb_call_super(0, NULL);
|
30
30
|
}
|
@@ -33,7 +33,7 @@ static
|
|
33
33
|
VALUE initialize_copy(VALUE self, VALUE obj)
|
34
34
|
{
|
35
35
|
CHECK;
|
36
|
-
*THIS = to<Reflex::TimerEvent&>(obj);
|
36
|
+
*THIS = to<Reflex::TimerEvent&>(obj).dup();
|
37
37
|
return self;
|
38
38
|
}
|
39
39
|
|
@@ -41,7 +41,7 @@ static
|
|
41
41
|
VALUE timer(VALUE self)
|
42
42
|
{
|
43
43
|
CHECK;
|
44
|
-
return value(THIS->timer);
|
44
|
+
return value(THIS->timer());
|
45
45
|
}
|
46
46
|
|
47
47
|
static
|
@@ -65,14 +65,6 @@ VALUE interval(VALUE self)
|
|
65
65
|
return value(THIS->interval());
|
66
66
|
}
|
67
67
|
|
68
|
-
static
|
69
|
-
VALUE set_count(VALUE self, VALUE count)
|
70
|
-
{
|
71
|
-
CHECK;
|
72
|
-
THIS->set_count(to<int>(count));
|
73
|
-
return count;
|
74
|
-
}
|
75
|
-
|
76
68
|
static
|
77
69
|
VALUE count(VALUE self)
|
78
70
|
{
|
@@ -103,9 +95,8 @@ Init_timer_event ()
|
|
103
95
|
rb_define_method(cTimerEvent, "owner", RUBY_METHOD_FUNC(owner), 0);
|
104
96
|
rb_define_method(cTimerEvent, "id", RUBY_METHOD_FUNC(id), 0);
|
105
97
|
rb_define_method(cTimerEvent, "interval", RUBY_METHOD_FUNC(interval), 0);
|
106
|
-
rb_define_method(cTimerEvent, "count=", RUBY_METHOD_FUNC(set_count), 1);
|
107
98
|
rb_define_method(cTimerEvent, "count", RUBY_METHOD_FUNC(count), 0);
|
108
|
-
cTimerEvent.define_method("
|
99
|
+
cTimerEvent.define_method("finished?", is_finished);
|
109
100
|
}
|
110
101
|
|
111
102
|
|
@@ -22,8 +22,9 @@ VALUE initialize(VALUE self, VALUE now, VALUE dt)
|
|
22
22
|
{
|
23
23
|
CHECK;
|
24
24
|
|
25
|
-
THIS
|
26
|
-
|
25
|
+
*THIS = Reflex::UpdateEvent(
|
26
|
+
to<double>(now),
|
27
|
+
to<float>(dt));
|
27
28
|
|
28
29
|
return rb_call_super(0, NULL);
|
29
30
|
}
|
@@ -32,7 +33,7 @@ static
|
|
32
33
|
VALUE initialize_copy(VALUE self, VALUE obj)
|
33
34
|
{
|
34
35
|
CHECK;
|
35
|
-
*THIS = to<Reflex::UpdateEvent&>(obj);
|
36
|
+
*THIS = to<Reflex::UpdateEvent&>(obj).dup();
|
36
37
|
return self;
|
37
38
|
}
|
38
39
|
|
@@ -40,14 +41,14 @@ static
|
|
40
41
|
VALUE now(VALUE self)
|
41
42
|
{
|
42
43
|
CHECK;
|
43
|
-
return value(THIS->now);
|
44
|
+
return value(THIS->now());
|
44
45
|
}
|
45
46
|
|
46
47
|
static
|
47
48
|
VALUE dt(VALUE self)
|
48
49
|
{
|
49
50
|
CHECK;
|
50
|
-
return value(THIS->dt);
|
51
|
+
return value(THIS->dt());
|
51
52
|
}
|
52
53
|
|
53
54
|
|
@@ -19,13 +19,14 @@ VALUE alloc(VALUE klass)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static
|
22
|
-
VALUE initialize(VALUE self, VALUE dx, VALUE dy, VALUE dz)
|
22
|
+
VALUE initialize(VALUE self, VALUE x, VALUE y, VALUE z, VALUE dx, VALUE dy, VALUE dz, VALUE modifiers)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
25
|
|
26
|
-
THIS
|
27
|
-
|
28
|
-
|
26
|
+
*THIS = Reflex::WheelEvent(
|
27
|
+
to<coord>( x), to<coord>( y), to<coord>( z),
|
28
|
+
to<coord>(dx), to<coord>(dy), to<coord>(dz),
|
29
|
+
to<uint>(modifiers));
|
29
30
|
|
30
31
|
return rb_call_super(0, NULL);
|
31
32
|
}
|
@@ -34,57 +35,71 @@ static
|
|
34
35
|
VALUE initialize_copy(VALUE self, VALUE obj)
|
35
36
|
{
|
36
37
|
CHECK;
|
37
|
-
*THIS = to<Reflex::WheelEvent&>(obj);
|
38
|
+
*THIS = to<Reflex::WheelEvent&>(obj).dup();
|
38
39
|
return self;
|
39
40
|
}
|
40
41
|
|
41
42
|
static
|
42
|
-
VALUE
|
43
|
+
VALUE x(VALUE self)
|
43
44
|
{
|
44
45
|
CHECK;
|
45
|
-
return value(THIS->
|
46
|
+
return value(THIS->position().x);
|
46
47
|
}
|
47
48
|
|
48
49
|
static
|
49
|
-
VALUE
|
50
|
+
VALUE y(VALUE self)
|
50
51
|
{
|
51
52
|
CHECK;
|
52
|
-
return value(THIS->
|
53
|
+
return value(THIS->position().y);
|
53
54
|
}
|
54
55
|
|
55
56
|
static
|
56
|
-
VALUE
|
57
|
+
VALUE z(VALUE self)
|
57
58
|
{
|
58
59
|
CHECK;
|
59
|
-
return value(THIS->
|
60
|
+
return value(THIS->position().z);
|
60
61
|
}
|
61
62
|
|
62
63
|
static
|
63
|
-
VALUE
|
64
|
+
VALUE dx(VALUE self)
|
64
65
|
{
|
65
66
|
CHECK;
|
66
|
-
return value(THIS->x);
|
67
|
+
return value(THIS->dposition().x);
|
67
68
|
}
|
68
69
|
|
69
70
|
static
|
70
|
-
VALUE
|
71
|
+
VALUE dy(VALUE self)
|
71
72
|
{
|
72
73
|
CHECK;
|
73
|
-
return value(THIS->y);
|
74
|
+
return value(THIS->dposition().y);
|
74
75
|
}
|
75
76
|
|
76
77
|
static
|
77
|
-
VALUE
|
78
|
+
VALUE dz(VALUE self)
|
79
|
+
{
|
80
|
+
CHECK;
|
81
|
+
return value(THIS->dposition().z);
|
82
|
+
}
|
83
|
+
|
84
|
+
static
|
85
|
+
VALUE position(VALUE self)
|
86
|
+
{
|
87
|
+
CHECK;
|
88
|
+
return value(THIS->position());
|
89
|
+
}
|
90
|
+
|
91
|
+
static
|
92
|
+
VALUE dposition(VALUE self)
|
78
93
|
{
|
79
94
|
CHECK;
|
80
|
-
return value(THIS->
|
95
|
+
return value(THIS->dposition());
|
81
96
|
}
|
82
97
|
|
83
98
|
static
|
84
99
|
VALUE modifiers(VALUE self)
|
85
100
|
{
|
86
101
|
CHECK;
|
87
|
-
return value(THIS->modifiers);
|
102
|
+
return value(THIS->modifiers());
|
88
103
|
}
|
89
104
|
|
90
105
|
|
@@ -97,14 +112,16 @@ Init_wheel_event ()
|
|
97
112
|
|
98
113
|
cWheelEvent = mReflex.define_class("WheelEvent", Reflex::event_class());
|
99
114
|
rb_define_alloc_func(cWheelEvent, alloc);
|
100
|
-
rb_define_private_method(cWheelEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
115
|
+
rb_define_private_method(cWheelEvent, "initialize", RUBY_METHOD_FUNC(initialize), 7);
|
101
116
|
rb_define_private_method(cWheelEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
102
|
-
rb_define_method(cWheelEvent, "dx", RUBY_METHOD_FUNC(dx), 0);
|
103
|
-
rb_define_method(cWheelEvent, "dy", RUBY_METHOD_FUNC(dy), 0);
|
104
|
-
rb_define_method(cWheelEvent, "dz", RUBY_METHOD_FUNC(dz), 0);
|
105
117
|
rb_define_method(cWheelEvent, "x", RUBY_METHOD_FUNC(x), 0);
|
106
118
|
rb_define_method(cWheelEvent, "y", RUBY_METHOD_FUNC(y), 0);
|
107
119
|
rb_define_method(cWheelEvent, "z", RUBY_METHOD_FUNC(z), 0);
|
120
|
+
rb_define_method(cWheelEvent, "dx", RUBY_METHOD_FUNC(dx), 0);
|
121
|
+
rb_define_method(cWheelEvent, "dy", RUBY_METHOD_FUNC(dy), 0);
|
122
|
+
rb_define_method(cWheelEvent, "dz", RUBY_METHOD_FUNC(dz), 0);
|
123
|
+
rb_define_method(cWheelEvent, "position", RUBY_METHOD_FUNC(position), 0);
|
124
|
+
rb_define_method(cWheelEvent, "dposition", RUBY_METHOD_FUNC(dposition), 0);
|
108
125
|
rb_define_method(cWheelEvent, "modifiers", RUBY_METHOD_FUNC(modifiers), 0);
|
109
126
|
}
|
110
127
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.24
|
@@ -24,8 +24,9 @@ RUCY_DEF2(initialize, begin, end)
|
|
24
24
|
{
|
25
25
|
CHECK;
|
26
26
|
|
27
|
-
THIS
|
28
|
-
|
27
|
+
*THIS = Reflex::CaptureEvent(
|
28
|
+
to<uint>(begin),
|
29
|
+
to<uint>(end));
|
29
30
|
|
30
31
|
return rb_call_super(0, NULL);
|
31
32
|
}
|
@@ -35,7 +36,7 @@ static
|
|
35
36
|
RUCY_DEF1(initialize_copy, obj)
|
36
37
|
{
|
37
38
|
CHECK;
|
38
|
-
*THIS = to<Reflex::CaptureEvent&>(obj);
|
39
|
+
*THIS = to<Reflex::CaptureEvent&>(obj).dup();
|
39
40
|
return self;
|
40
41
|
}
|
41
42
|
RUCY_END
|
@@ -44,7 +45,7 @@ static
|
|
44
45
|
RUCY_DEF0(begin)
|
45
46
|
{
|
46
47
|
CHECK;
|
47
|
-
return value(THIS->begin);
|
48
|
+
return value(THIS->begin());
|
48
49
|
}
|
49
50
|
RUCY_END
|
50
51
|
|
@@ -52,7 +53,7 @@ static
|
|
52
53
|
RUCY_DEF0(end)
|
53
54
|
{
|
54
55
|
CHECK;
|
55
|
-
return value(THIS->end);
|
56
|
+
return value(THIS->end());
|
56
57
|
}
|
57
58
|
RUCY_END
|
58
59
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
#include "reflex/ruby/shape.h"
|
5
5
|
#include "reflex/ruby/view.h"
|
6
|
+
#include "reflex/ruby/shape.h"
|
6
7
|
#include "defs.h"
|
7
8
|
|
8
9
|
|
@@ -21,12 +22,13 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
22
|
RUCY_END
|
22
23
|
|
23
24
|
static
|
24
|
-
RUCY_DEF2(initialize,
|
25
|
+
RUCY_DEF2(initialize, action, shape)
|
25
26
|
{
|
26
27
|
CHECK;
|
27
28
|
|
28
|
-
THIS
|
29
|
-
|
29
|
+
*THIS = Reflex::ContactEvent(
|
30
|
+
(Reflex::ContactEvent::Action) to<uint>(action),
|
31
|
+
to<Reflex::Shape*>(shape));
|
30
32
|
|
31
33
|
return rb_call_super(0, NULL);
|
32
34
|
}
|
@@ -36,16 +38,16 @@ static
|
|
36
38
|
RUCY_DEF1(initialize_copy, obj)
|
37
39
|
{
|
38
40
|
CHECK;
|
39
|
-
*THIS = to<Reflex::ContactEvent&>(obj);
|
41
|
+
*THIS = to<Reflex::ContactEvent&>(obj).dup();
|
40
42
|
return self;
|
41
43
|
}
|
42
44
|
RUCY_END
|
43
45
|
|
44
46
|
static
|
45
|
-
RUCY_DEF0(
|
47
|
+
RUCY_DEF0(get_action)
|
46
48
|
{
|
47
49
|
CHECK;
|
48
|
-
return value(THIS->
|
50
|
+
return value(THIS->action());
|
49
51
|
}
|
50
52
|
RUCY_END
|
51
53
|
|
@@ -53,7 +55,7 @@ static
|
|
53
55
|
RUCY_DEF0(get_shape)
|
54
56
|
{
|
55
57
|
CHECK;
|
56
|
-
return value(THIS->shape);
|
58
|
+
return value(THIS->shape());
|
57
59
|
}
|
58
60
|
RUCY_END
|
59
61
|
|
@@ -61,7 +63,7 @@ static
|
|
61
63
|
RUCY_DEF0(get_view)
|
62
64
|
{
|
63
65
|
CHECK;
|
64
|
-
return value(THIS->view);
|
66
|
+
return value(THIS->view());
|
65
67
|
}
|
66
68
|
RUCY_END
|
67
69
|
|
@@ -77,12 +79,12 @@ Init_contact_event ()
|
|
77
79
|
cContactEvent.define_alloc_func(alloc);
|
78
80
|
cContactEvent.define_private_method("initialize", initialize);
|
79
81
|
cContactEvent.define_private_method("initialize_copy", initialize_copy);
|
80
|
-
cContactEvent.define_method("
|
81
|
-
cContactEvent.define_method("shape",
|
82
|
-
cContactEvent.define_method("view",
|
83
|
-
cContactEvent.define_const("
|
84
|
-
cContactEvent.define_const("
|
85
|
-
cContactEvent.define_const("
|
82
|
+
cContactEvent.define_method("action", get_action);
|
83
|
+
cContactEvent.define_method("shape", get_shape);
|
84
|
+
cContactEvent.define_method("view", get_view);
|
85
|
+
cContactEvent.define_const("ACTION_NONE", Reflex::ContactEvent::ACTION_NONE);
|
86
|
+
cContactEvent.define_const("BEGIN", Reflex::ContactEvent::BEGIN);
|
87
|
+
cContactEvent.define_const("END", Reflex::ContactEvent::END);
|
86
88
|
}
|
87
89
|
|
88
90
|
|
data/ext/reflex/draw_event.cpp
CHANGED
@@ -21,11 +21,13 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
21
|
RUCY_END
|
22
22
|
|
23
23
|
static
|
24
|
-
|
24
|
+
RUCY_DEF2(initialize, dt, fps)
|
25
25
|
{
|
26
26
|
CHECK;
|
27
27
|
|
28
|
-
THIS
|
28
|
+
*THIS = Reflex::DrawEvent(
|
29
|
+
to<float>(dt),
|
30
|
+
to<float>(fps));
|
29
31
|
|
30
32
|
return rb_call_super(0, NULL);
|
31
33
|
}
|
@@ -35,7 +37,7 @@ static
|
|
35
37
|
RUCY_DEF1(initialize_copy, obj)
|
36
38
|
{
|
37
39
|
CHECK;
|
38
|
-
*THIS = to<Reflex::DrawEvent&>(obj);
|
40
|
+
*THIS = to<Reflex::DrawEvent&>(obj).dup();
|
39
41
|
return self;
|
40
42
|
}
|
41
43
|
RUCY_END
|
@@ -44,7 +46,7 @@ static
|
|
44
46
|
RUCY_DEF0(painter)
|
45
47
|
{
|
46
48
|
CHECK;
|
47
|
-
return value(THIS->painter);
|
49
|
+
return value(THIS->painter());
|
48
50
|
}
|
49
51
|
RUCY_END
|
50
52
|
|
@@ -52,7 +54,7 @@ static
|
|
52
54
|
RUCY_DEF0(bounds)
|
53
55
|
{
|
54
56
|
CHECK;
|
55
|
-
return value(THIS->bounds);
|
57
|
+
return value(THIS->bounds());
|
56
58
|
}
|
57
59
|
RUCY_END
|
58
60
|
|
@@ -60,7 +62,7 @@ static
|
|
60
62
|
RUCY_DEF0(dt)
|
61
63
|
{
|
62
64
|
CHECK;
|
63
|
-
return value(THIS->dt);
|
65
|
+
return value(THIS->dt());
|
64
66
|
}
|
65
67
|
RUCY_END
|
66
68
|
|
@@ -68,7 +70,7 @@ static
|
|
68
70
|
RUCY_DEF0(fps)
|
69
71
|
{
|
70
72
|
CHECK;
|
71
|
-
return value(THIS->fps);
|
73
|
+
return value(THIS->fps());
|
72
74
|
}
|
73
75
|
RUCY_END
|
74
76
|
|
data/ext/reflex/event.cpp
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#include "reflex/ruby/event.h"
|
2
2
|
|
3
3
|
|
4
|
+
#include "reflex/exception.h"
|
4
5
|
#include "defs.h"
|
5
6
|
|
6
7
|
|
@@ -14,16 +15,7 @@ RUCY_DEFINE_VALUE_FROM_TO(Reflex::Event)
|
|
14
15
|
static
|
15
16
|
RUCY_DEF_ALLOC(alloc, klass)
|
16
17
|
{
|
17
|
-
|
18
|
-
}
|
19
|
-
RUCY_END
|
20
|
-
|
21
|
-
static
|
22
|
-
RUCY_DEF1(initialize_copy, obj)
|
23
|
-
{
|
24
|
-
CHECK;
|
25
|
-
*THIS = to<Reflex::Event&>(obj);
|
26
|
-
return self;
|
18
|
+
Reflex::reflex_error(__FILE__, __LINE__, "can not instantiate Event class.");
|
27
19
|
}
|
28
20
|
RUCY_END
|
29
21
|
|
@@ -61,7 +53,6 @@ Init_event ()
|
|
61
53
|
|
62
54
|
cEvent = mReflex.define_class("Event");
|
63
55
|
cEvent.define_alloc_func(alloc);
|
64
|
-
cEvent.define_private_method("initialize_copy", initialize_copy);
|
65
56
|
cEvent.define_method("block", block);
|
66
57
|
cEvent.define_method("blocked?", is_blocked);
|
67
58
|
cEvent.define_method("time", get_time);
|
data/ext/reflex/focus_event.cpp
CHANGED
@@ -20,13 +20,14 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
20
20
|
RUCY_END
|
21
21
|
|
22
22
|
static
|
23
|
-
RUCY_DEF3(initialize,
|
23
|
+
RUCY_DEF3(initialize, action, current, last)
|
24
24
|
{
|
25
25
|
CHECK;
|
26
26
|
|
27
|
-
THIS
|
28
|
-
|
29
|
-
|
27
|
+
*THIS = Reflex::FocusEvent(
|
28
|
+
(Reflex::FocusEvent::Action) to<uint>(action),
|
29
|
+
to<Reflex::View*>(current),
|
30
|
+
to<Reflex::View*>(last));
|
30
31
|
|
31
32
|
return rb_call_super(0, NULL);
|
32
33
|
}
|
@@ -36,16 +37,16 @@ static
|
|
36
37
|
RUCY_DEF1(initialize_copy, obj)
|
37
38
|
{
|
38
39
|
CHECK;
|
39
|
-
*THIS = to<Reflex::FocusEvent&>(obj);
|
40
|
+
*THIS = to<Reflex::FocusEvent&>(obj).dup();
|
40
41
|
return self;
|
41
42
|
}
|
42
43
|
RUCY_END
|
43
44
|
|
44
45
|
static
|
45
|
-
RUCY_DEF0(
|
46
|
+
RUCY_DEF0(get_action)
|
46
47
|
{
|
47
48
|
CHECK;
|
48
|
-
return value(THIS->
|
49
|
+
return value(THIS->action());
|
49
50
|
}
|
50
51
|
RUCY_END
|
51
52
|
|
@@ -53,7 +54,7 @@ static
|
|
53
54
|
RUCY_DEF0(get_current)
|
54
55
|
{
|
55
56
|
CHECK;
|
56
|
-
return THIS->current ? value(THIS->current) : nil();
|
57
|
+
return THIS->current() ? value(THIS->current()) : nil();
|
57
58
|
}
|
58
59
|
RUCY_END
|
59
60
|
|
@@ -61,7 +62,7 @@ static
|
|
61
62
|
RUCY_DEF0(get_last)
|
62
63
|
{
|
63
64
|
CHECK;
|
64
|
-
return THIS->last ? value(THIS->last) : nil();
|
65
|
+
return THIS->last() ? value(THIS->last()) : nil();
|
65
66
|
}
|
66
67
|
RUCY_END
|
67
68
|
|
@@ -77,12 +78,12 @@ Init_focus_event ()
|
|
77
78
|
cFocusEvent.define_alloc_func(alloc);
|
78
79
|
cFocusEvent.define_private_method("initialize", initialize);
|
79
80
|
cFocusEvent.define_private_method("initialize_copy", initialize_copy);
|
80
|
-
cFocusEvent.define_method("
|
81
|
+
cFocusEvent.define_method("action", get_action);
|
81
82
|
cFocusEvent.define_method("current", get_current);
|
82
83
|
cFocusEvent.define_method("last", get_last);
|
83
|
-
cFocusEvent.define_const("
|
84
|
-
cFocusEvent.define_const("
|
85
|
-
cFocusEvent.define_const("
|
84
|
+
cFocusEvent.define_const("ACTION_NONE", Reflex::FocusEvent::ACTION_NONE);
|
85
|
+
cFocusEvent.define_const("FOCUS", Reflex::FocusEvent::FOCUS);
|
86
|
+
cFocusEvent.define_const("BLUR", Reflex::FocusEvent::BLUR);
|
86
87
|
}
|
87
88
|
|
88
89
|
|
data/ext/reflex/frame_event.cpp
CHANGED
@@ -21,15 +21,15 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
21
21
|
RUCY_END
|
22
22
|
|
23
23
|
static
|
24
|
-
|
24
|
+
RUCY_DEF7(initialize, frame, dx, dy, dwidth, dheight, angle, dangle)
|
25
25
|
{
|
26
26
|
CHECK;
|
27
27
|
|
28
|
-
THIS
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
*THIS = Reflex::FrameEvent(
|
29
|
+
to<Rays::Bounds>(frame),
|
30
|
+
to<coord>(dx), to<coord>(dy),
|
31
|
+
to<coord>(dwidth), to<coord>(dheight),
|
32
|
+
to<float>(angle), to<float>(dangle));
|
33
33
|
|
34
34
|
return rb_call_super(0, NULL);
|
35
35
|
}
|
@@ -39,7 +39,7 @@ static
|
|
39
39
|
RUCY_DEF1(initialize_copy, obj)
|
40
40
|
{
|
41
41
|
CHECK;
|
42
|
-
*THIS = to<Reflex::FrameEvent&>(obj);
|
42
|
+
*THIS = to<Reflex::FrameEvent&>(obj).dup();
|
43
43
|
return self;
|
44
44
|
}
|
45
45
|
RUCY_END
|
@@ -48,7 +48,7 @@ static
|
|
48
48
|
RUCY_DEF0(frame)
|
49
49
|
{
|
50
50
|
CHECK;
|
51
|
-
return value(THIS->frame);
|
51
|
+
return value(THIS->frame());
|
52
52
|
}
|
53
53
|
RUCY_END
|
54
54
|
|
@@ -56,7 +56,7 @@ static
|
|
56
56
|
RUCY_DEF0(dx)
|
57
57
|
{
|
58
58
|
CHECK;
|
59
|
-
return value(THIS->dx);
|
59
|
+
return value(THIS->dx());
|
60
60
|
}
|
61
61
|
RUCY_END
|
62
62
|
|
@@ -64,7 +64,7 @@ static
|
|
64
64
|
RUCY_DEF0(dy)
|
65
65
|
{
|
66
66
|
CHECK;
|
67
|
-
return value(THIS->dy);
|
67
|
+
return value(THIS->dy());
|
68
68
|
}
|
69
69
|
RUCY_END
|
70
70
|
|
@@ -72,7 +72,7 @@ static
|
|
72
72
|
RUCY_DEF0(dwidth)
|
73
73
|
{
|
74
74
|
CHECK;
|
75
|
-
return value(THIS->dwidth);
|
75
|
+
return value(THIS->dwidth());
|
76
76
|
}
|
77
77
|
RUCY_END
|
78
78
|
|
@@ -80,7 +80,7 @@ static
|
|
80
80
|
RUCY_DEF0(dheight)
|
81
81
|
{
|
82
82
|
CHECK;
|
83
|
-
return value(THIS->dheight);
|
83
|
+
return value(THIS->dheight());
|
84
84
|
}
|
85
85
|
RUCY_END
|
86
86
|
|
@@ -88,7 +88,7 @@ static
|
|
88
88
|
RUCY_DEF0(dposition)
|
89
89
|
{
|
90
90
|
CHECK;
|
91
|
-
return value(Rays::Point(THIS->dx, THIS->dy));
|
91
|
+
return value(Rays::Point(THIS->dx(), THIS->dy()));
|
92
92
|
}
|
93
93
|
RUCY_END
|
94
94
|
|
@@ -96,7 +96,7 @@ static
|
|
96
96
|
RUCY_DEF0(dsize)
|
97
97
|
{
|
98
98
|
CHECK;
|
99
|
-
return value(Rays::Point(THIS->
|
99
|
+
return value(Rays::Point(THIS->dwidth(), THIS->dheight()));
|
100
100
|
}
|
101
101
|
RUCY_END
|
102
102
|
|
@@ -104,7 +104,7 @@ static
|
|
104
104
|
RUCY_DEF0(angle)
|
105
105
|
{
|
106
106
|
CHECK;
|
107
|
-
return value(THIS->angle);
|
107
|
+
return value(THIS->angle());
|
108
108
|
}
|
109
109
|
RUCY_END
|
110
110
|
|
@@ -112,7 +112,7 @@ static
|
|
112
112
|
RUCY_DEF0(dangle)
|
113
113
|
{
|
114
114
|
CHECK;
|
115
|
-
return value(THIS->dangle);
|
115
|
+
return value(THIS->dangle());
|
116
116
|
}
|
117
117
|
RUCY_END
|
118
118
|
|