reflexion 0.1.21 → 0.1.25
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 +6 -5
- data/.doc/ext/reflex/contact_event.cpp +18 -16
- data/.doc/ext/reflex/draw_event.cpp +10 -8
- data/.doc/ext/reflex/event.cpp +10 -10
- data/.doc/ext/reflex/focus_event.cpp +18 -17
- data/.doc/ext/reflex/frame_event.cpp +17 -17
- data/.doc/ext/reflex/key_event.cpp +227 -28
- data/.doc/ext/reflex/native.cpp +2 -0
- data/.doc/ext/reflex/pointer.cpp +158 -0
- data/.doc/ext/reflex/pointer_event.cpp +32 -91
- data/.doc/ext/reflex/scroll_event.cpp +14 -17
- data/.doc/ext/reflex/selector.cpp +8 -0
- 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/view.cpp +57 -0
- data/.doc/ext/reflex/wheel_event.cpp +39 -22
- data/.doc/ext/reflex/window.cpp +24 -0
- data/VERSION +1 -1
- data/ext/reflex/capture_event.cpp +6 -5
- data/ext/reflex/contact_event.cpp +18 -16
- data/ext/reflex/draw_event.cpp +9 -7
- data/ext/reflex/event.cpp +11 -11
- data/ext/reflex/focus_event.cpp +18 -17
- data/ext/reflex/frame_event.cpp +16 -16
- data/ext/reflex/key_event.cpp +228 -28
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/pointer.cpp +170 -0
- data/ext/reflex/pointer_event.cpp +31 -96
- data/ext/reflex/scroll_event.cpp +15 -18
- data/ext/reflex/selector.cpp +9 -0
- 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/view.cpp +67 -3
- data/ext/reflex/wheel_event.cpp +40 -21
- data/ext/reflex/window.cpp +30 -3
- data/include/reflex/defs.h +140 -106
- data/include/reflex/event.h +232 -124
- data/include/reflex/pointer.h +107 -0
- data/include/reflex/ruby/pointer.h +41 -0
- data/include/reflex/ruby/view.h +9 -0
- data/include/reflex/ruby/window.h +9 -0
- data/include/reflex/selector.h +1 -1
- data/include/reflex/shape.h +2 -2
- data/include/reflex/view.h +6 -4
- data/include/reflex/window.h +10 -8
- data/lib/reflex/application.rb +3 -3
- data/lib/reflex/autoinit.rb +1 -1
- data/lib/reflex/button.rb +7 -7
- data/lib/reflex/capture_event.rb +7 -7
- data/lib/reflex/contact_event.rb +10 -10
- data/lib/reflex/draw_event.rb +2 -2
- data/lib/reflex/ellipse_shape.rb +2 -2
- data/lib/reflex/focus_event.rb +11 -11
- data/lib/reflex/frame_event.rb +5 -5
- data/lib/reflex/helper.rb +20 -20
- data/lib/reflex/image_view.rb +2 -2
- data/lib/reflex/key_event.rb +12 -12
- data/lib/reflex/model.rb +22 -22
- data/lib/reflex/model_owner.rb +7 -7
- data/lib/reflex/model_view.rb +1 -1
- data/lib/reflex/module.rb +5 -5
- data/lib/reflex/pointer.rb +107 -0
- data/lib/reflex/pointer_event.rb +16 -54
- data/lib/reflex/polygon_shape.rb +2 -2
- data/lib/reflex/reflex.rb +3 -3
- data/lib/reflex/scroll_event.rb +1 -1
- data/lib/reflex/selector.rb +4 -4
- data/lib/reflex/shape.rb +13 -13
- data/lib/reflex/style.rb +11 -11
- data/lib/reflex/style_length.rb +1 -1
- data/lib/reflex/text_view.rb +2 -2
- data/lib/reflex/timer.rb +2 -2
- data/lib/reflex/timer_event.rb +3 -2
- data/lib/reflex/update_event.rb +1 -1
- data/lib/reflex/view.rb +32 -32
- data/lib/reflex/wheel_event.rb +2 -10
- data/lib/reflex/window.rb +6 -6
- data/lib/reflex.rb +1 -0
- data/lib/reflexion.rb +17 -17
- data/reflex.gemspec +5 -5
- data/samples/reflexion/noise.rb +1 -1
- data/samples/tree.rb +1 -1
- data/src/event.cpp +792 -86
- data/src/event.h +47 -0
- data/src/image_view.cpp +2 -2
- data/src/ios/event.h +15 -3
- data/src/ios/event.mm +126 -11
- data/src/ios/view_controller.mm +50 -22
- data/src/ios/window.mm +1 -1
- data/src/osx/event.h +15 -4
- data/src/osx/event.mm +214 -24
- data/src/osx/native_window.mm +84 -17
- data/src/pointer.cpp +203 -0
- data/src/pointer.h +26 -0
- data/src/selector.cpp +1 -1
- data/src/shape.cpp +11 -13
- data/src/shape.h +1 -1
- data/src/view.cpp +205 -118
- data/src/view.h +5 -10
- data/src/window.cpp +334 -104
- data/src/window.h +22 -3
- data/src/world.cpp +6 -4
- data/test/helper.rb +3 -3
- data/test/test_application.rb +1 -1
- data/test/test_capture_event.rb +22 -6
- data/test/test_contact_event.rb +40 -0
- data/test/test_draw_event.rb +35 -0
- data/test/test_event.rb +33 -5
- data/test/test_focus_event.rb +34 -0
- data/test/test_frame_event.rb +38 -0
- data/test/test_has_frame.rb +11 -11
- data/test/test_key_event.rb +33 -0
- data/test/test_pointer.rb +149 -0
- data/test/test_pointer_event.rb +70 -104
- data/test/test_reflex.rb +1 -1
- data/test/test_scroll_event.rb +39 -0
- data/test/test_selector.rb +15 -8
- data/test/test_shape.rb +8 -8
- data/test/test_style.rb +13 -13
- data/test/test_style_length.rb +5 -5
- data/test/test_timer_event.rb +38 -0
- data/test/test_update_event.rb +29 -0
- data/test/test_view.rb +57 -30
- data/test/test_wheel_event.rb +40 -0
- data/test/test_window.rb +29 -27
- metadata +64 -35
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,32 +15,31 @@ RUCY_DEFINE_VALUE_FROM_TO(Reflex::Event)
|
|
14
15
|
static
|
15
16
|
RUCY_DEF_ALLOC(alloc, klass)
|
16
17
|
{
|
17
|
-
|
18
|
+
Reflex::reflex_error(__FILE__, __LINE__, "can not instantiate Event class.");
|
18
19
|
}
|
19
20
|
RUCY_END
|
20
21
|
|
21
22
|
static
|
22
|
-
|
23
|
+
RUCY_DEF0(block)
|
23
24
|
{
|
24
25
|
CHECK;
|
25
|
-
|
26
|
-
return self;
|
26
|
+
THIS->block();
|
27
27
|
}
|
28
28
|
RUCY_END
|
29
29
|
|
30
30
|
static
|
31
|
-
RUCY_DEF0(
|
31
|
+
RUCY_DEF0(is_blocked)
|
32
32
|
{
|
33
33
|
CHECK;
|
34
|
-
THIS->
|
34
|
+
return value(THIS->is_blocked());
|
35
35
|
}
|
36
36
|
RUCY_END
|
37
37
|
|
38
38
|
static
|
39
|
-
RUCY_DEF0(
|
39
|
+
RUCY_DEF0(get_time)
|
40
40
|
{
|
41
41
|
CHECK;
|
42
|
-
return value(THIS->
|
42
|
+
return value(THIS->time());
|
43
43
|
}
|
44
44
|
RUCY_END
|
45
45
|
|
@@ -53,9 +53,9 @@ Init_event ()
|
|
53
53
|
|
54
54
|
cEvent = mReflex.define_class("Event");
|
55
55
|
cEvent.define_alloc_func(alloc);
|
56
|
-
cEvent.
|
57
|
-
cEvent.define_method("
|
58
|
-
cEvent.define_method("
|
56
|
+
cEvent.define_method("block", block);
|
57
|
+
cEvent.define_method("blocked?", is_blocked);
|
58
|
+
cEvent.define_method("time", get_time);
|
59
59
|
}
|
60
60
|
|
61
61
|
|
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,32 +37,32 @@ 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
|
|
52
53
|
static
|
53
|
-
RUCY_DEF0(
|
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
|
|
60
61
|
static
|
61
|
-
RUCY_DEF0(
|
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("current",
|
82
|
-
cFocusEvent.define_method("last",
|
83
|
-
cFocusEvent.define_const("
|
84
|
-
cFocusEvent.define_const("
|
85
|
-
cFocusEvent.define_const("
|
81
|
+
cFocusEvent.define_method("action", get_action);
|
82
|
+
cFocusEvent.define_method("current", get_current);
|
83
|
+
cFocusEvent.define_method("last", get_last);
|
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
|
|
data/ext/reflex/key_event.cpp
CHANGED
@@ -19,15 +19,16 @@ RUCY_DEF_ALLOC(alloc, klass)
|
|
19
19
|
RUCY_END
|
20
20
|
|
21
21
|
static
|
22
|
-
RUCY_DEF5(initialize,
|
22
|
+
RUCY_DEF5(initialize, action, chars, code, modifiers, repeat)
|
23
23
|
{
|
24
24
|
CHECK;
|
25
25
|
|
26
|
-
THIS
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
*THIS = Reflex::KeyEvent(
|
27
|
+
(Reflex::KeyEvent::Action) to<uint>(action),
|
28
|
+
chars.c_str(),
|
29
|
+
to<int>(code),
|
30
|
+
to<uint>(modifiers),
|
31
|
+
to<int>(repeat));
|
31
32
|
|
32
33
|
return rb_call_super(0, NULL);
|
33
34
|
}
|
@@ -37,56 +38,254 @@ static
|
|
37
38
|
RUCY_DEF1(initialize_copy, obj)
|
38
39
|
{
|
39
40
|
CHECK;
|
40
|
-
*THIS = to<Reflex::KeyEvent&>(obj);
|
41
|
+
*THIS = to<Reflex::KeyEvent&>(obj).dup();
|
41
42
|
return self;
|
42
43
|
}
|
43
44
|
RUCY_END
|
44
45
|
|
45
46
|
static
|
46
|
-
RUCY_DEF0(
|
47
|
+
RUCY_DEF0(get_action)
|
47
48
|
{
|
48
49
|
CHECK;
|
49
|
-
return value(THIS->
|
50
|
+
return value(THIS->action());
|
50
51
|
}
|
51
52
|
RUCY_END
|
52
53
|
|
53
54
|
static
|
54
|
-
RUCY_DEF0(
|
55
|
+
RUCY_DEF0(get_key)
|
55
56
|
{
|
56
57
|
CHECK;
|
57
|
-
|
58
|
+
switch (THIS->code())
|
59
|
+
{
|
60
|
+
#define CASE(key) case Reflex::KEY_##key
|
61
|
+
#define SYMBOL1(name) SYMBOL2(_##name, #name)
|
62
|
+
#define SYMBOL2(var, sym) {RUCY_SYMBOL(var, sym); return var.value();}
|
63
|
+
|
64
|
+
CASE(A): SYMBOL1(a);
|
65
|
+
CASE(B): SYMBOL1(b);
|
66
|
+
CASE(C): SYMBOL1(c);
|
67
|
+
CASE(D): SYMBOL1(d);
|
68
|
+
CASE(E): SYMBOL1(e);
|
69
|
+
CASE(F): SYMBOL1(f);
|
70
|
+
CASE(G): SYMBOL1(g);
|
71
|
+
CASE(H): SYMBOL1(h);
|
72
|
+
CASE(I): SYMBOL1(i);
|
73
|
+
CASE(J): SYMBOL1(j);
|
74
|
+
CASE(K): SYMBOL1(k);
|
75
|
+
CASE(L): SYMBOL1(l);
|
76
|
+
CASE(M): SYMBOL1(m);
|
77
|
+
CASE(N): SYMBOL1(n);
|
78
|
+
CASE(O): SYMBOL1(o);
|
79
|
+
CASE(P): SYMBOL1(p);
|
80
|
+
CASE(Q): SYMBOL1(q);
|
81
|
+
CASE(R): SYMBOL1(r);
|
82
|
+
CASE(S): SYMBOL1(s);
|
83
|
+
CASE(T): SYMBOL1(t);
|
84
|
+
CASE(U): SYMBOL1(u);
|
85
|
+
CASE(V): SYMBOL1(v);
|
86
|
+
CASE(W): SYMBOL1(w);
|
87
|
+
CASE(X): SYMBOL1(x);
|
88
|
+
CASE(Y): SYMBOL1(y);
|
89
|
+
CASE(Z): SYMBOL1(z);
|
90
|
+
|
91
|
+
CASE(0):
|
92
|
+
CASE(NUM_0): SYMBOL1(0);
|
93
|
+
CASE(1):
|
94
|
+
CASE(NUM_1): SYMBOL1(1);
|
95
|
+
CASE(2):
|
96
|
+
CASE(NUM_2): SYMBOL1(2);
|
97
|
+
CASE(3):
|
98
|
+
CASE(NUM_3): SYMBOL1(3);
|
99
|
+
CASE(4):
|
100
|
+
CASE(NUM_4): SYMBOL1(4);
|
101
|
+
CASE(5):
|
102
|
+
CASE(NUM_5): SYMBOL1(5);
|
103
|
+
CASE(6):
|
104
|
+
CASE(NUM_6): SYMBOL1(6);
|
105
|
+
CASE(7):
|
106
|
+
CASE(NUM_7): SYMBOL1(7);
|
107
|
+
CASE(8):
|
108
|
+
CASE(NUM_8): SYMBOL1(8);
|
109
|
+
CASE(9):
|
110
|
+
CASE(NUM_9): SYMBOL1(9);
|
111
|
+
|
112
|
+
CASE(MINUS): SYMBOL1(minus);
|
113
|
+
CASE(EQUAL): SYMBOL1(equal);
|
114
|
+
CASE(COMMA): SYMBOL1(comma);
|
115
|
+
CASE(PERIOD): SYMBOL1(period);
|
116
|
+
CASE(SEMICOLON): SYMBOL1(semicolon);
|
117
|
+
CASE(QUOTE): SYMBOL1(quote);
|
118
|
+
CASE(SLASH): SYMBOL1(slash);
|
119
|
+
CASE(BACKSLASH): SYMBOL1(backslash);
|
120
|
+
CASE(UNDERSCORE): SYMBOL1(underscore);
|
121
|
+
CASE(GRAVE): SYMBOL1(grave);
|
122
|
+
CASE(YEN): SYMBOL1(yen);
|
123
|
+
CASE(LBRACKET): SYMBOL1(lbracket);
|
124
|
+
CASE(RBRACKET): SYMBOL1(rbracket);
|
125
|
+
|
126
|
+
CASE(ENTER):
|
127
|
+
CASE(RETURN): SYMBOL1(enter);
|
128
|
+
CASE(SPACE): SYMBOL1(space);
|
129
|
+
CASE(TAB): SYMBOL1(tab);
|
130
|
+
CASE(DELETE): SYMBOL2(_delete, "delete");
|
131
|
+
CASE(BACKSPACE): SYMBOL1(backspace);
|
132
|
+
//CASE(INSERT): SYMBOL1(insert);
|
133
|
+
CASE(ESCAPE): SYMBOL1(escape);
|
134
|
+
|
135
|
+
CASE(LEFT): SYMBOL1(left);
|
136
|
+
CASE(RIGHT): SYMBOL1(right);
|
137
|
+
CASE(UP): SYMBOL1(up);
|
138
|
+
CASE(DOWN): SYMBOL1(down);
|
139
|
+
CASE(HOME): SYMBOL1(home);
|
140
|
+
CASE(END): SYMBOL1(end);
|
141
|
+
CASE(PAGEUP): SYMBOL1(pageup);
|
142
|
+
CASE(PAGEDOWN): SYMBOL1(pagedown);
|
143
|
+
|
144
|
+
CASE(LSHIFT):
|
145
|
+
CASE(RSHIFT): SYMBOL1(shift);
|
146
|
+
CASE(LCONTROL):
|
147
|
+
CASE(RCONTROL): SYMBOL1(control);
|
148
|
+
//CASE(LALT):
|
149
|
+
//CASE(RALT): SYMBOL1(alt);
|
150
|
+
//CASE(LWIN):
|
151
|
+
//CASE(RWIN): SYMBOL1(win);
|
152
|
+
CASE(LCOMMAND):
|
153
|
+
CASE(RCOMMAND): SYMBOL1(command);
|
154
|
+
CASE(LOPTION):
|
155
|
+
CASE(ROPTION): SYMBOL1(option);
|
156
|
+
CASE(FUNCTION): SYMBOL1(function);
|
157
|
+
|
158
|
+
CASE(F1): SYMBOL1(f1);
|
159
|
+
CASE(F2): SYMBOL1(f2);
|
160
|
+
CASE(F3): SYMBOL1(f3);
|
161
|
+
CASE(F4): SYMBOL1(f4);
|
162
|
+
CASE(F5): SYMBOL1(f5);
|
163
|
+
CASE(F6): SYMBOL1(f6);
|
164
|
+
CASE(F7): SYMBOL1(f7);
|
165
|
+
CASE(F8): SYMBOL1(f8);
|
166
|
+
CASE(F9): SYMBOL1(f9);
|
167
|
+
CASE(F10): SYMBOL1(f10);
|
168
|
+
CASE(F11): SYMBOL1(f11);
|
169
|
+
CASE(F12): SYMBOL1(f12);
|
170
|
+
CASE(F13): SYMBOL1(f13);
|
171
|
+
CASE(F14): SYMBOL1(f14);
|
172
|
+
CASE(F15): SYMBOL1(f15);
|
173
|
+
CASE(F16): SYMBOL1(f16);
|
174
|
+
CASE(F17): SYMBOL1(f17);
|
175
|
+
CASE(F18): SYMBOL1(f18);
|
176
|
+
CASE(F19): SYMBOL1(f19);
|
177
|
+
CASE(F20): SYMBOL1(f20);
|
178
|
+
//CASE(F21): SYMBOL1(f21);
|
179
|
+
//CASE(F22): SYMBOL1(f22);
|
180
|
+
//CASE(F23): SYMBOL1(f23);
|
181
|
+
//CASE(F24): SYMBOL1(f24);
|
182
|
+
|
183
|
+
CASE(NUM_PLUS): SYMBOL1(plus);
|
184
|
+
CASE(NUM_MINUS): SYMBOL1(minus);
|
185
|
+
CASE(NUM_MULTIPLY): SYMBOL1(multiply);
|
186
|
+
CASE(NUM_DIVIDE): SYMBOL1(divide);
|
187
|
+
CASE(NUM_EQUAL): SYMBOL1(equal);
|
188
|
+
CASE(NUM_COMMA): SYMBOL1(comma);
|
189
|
+
CASE(NUM_DECIMAL): SYMBOL1(decimal);
|
190
|
+
CASE(NUM_CLEAR): SYMBOL1(clear);
|
191
|
+
|
192
|
+
CASE(CAPSLOCK): SYMBOL1(capslock);
|
193
|
+
//CASE(NUMLOCK): SYMBOL1(numlock);
|
194
|
+
//CASE(SCROLLLOCK): SYMBOL1(scrolllock);
|
195
|
+
|
196
|
+
//CASE(PRINTSCREEN): SYMBOL1(printscreen);
|
197
|
+
//CASE(PAUSE): SYMBOL1(pause);
|
198
|
+
//CASE(BREAK): SYMBOL2(_break, "break");
|
199
|
+
CASE(SECTION): SYMBOL1(section);
|
200
|
+
CASE(HELP): SYMBOL1(help);
|
201
|
+
|
202
|
+
CASE(IME_EISU): SYMBOL1(eisu);
|
203
|
+
CASE(IME_KANA): SYMBOL1(kana);
|
204
|
+
//CASE(IME_KANJI): SYMBOL1(kanji);
|
205
|
+
//CASE(IME_JUNJA): SYMBOL1(junja);
|
206
|
+
//CASE(IME_PROCESS): SYMBOL1(process);
|
207
|
+
//CASE(IME_ACCEPT): SYMBOL1(accept);
|
208
|
+
//CASE(IME_FINAL): SYMBOL2(_final, "final");
|
209
|
+
//CASE(IME_CONVERT): SYMBOL1(convert);
|
210
|
+
//CASE(IME_NONCONVERT): SYMBOL1(nonconvert);
|
211
|
+
//CASE(IME_MODECHANGE): SYMBOL1(mode_change);
|
212
|
+
|
213
|
+
CASE(VOLUME_UP): SYMBOL1(volume_up);
|
214
|
+
CASE(VOLUME_DOWN): SYMBOL1(volume_down);
|
215
|
+
CASE(MUTE): SYMBOL1(mute);
|
216
|
+
|
217
|
+
//CASE(SLEEP): SYMBOL1(sleep);
|
218
|
+
//CASE(EXEC): SYMBOL1(exec);
|
219
|
+
//CASE(PRINT): SYMBOL1(print);
|
220
|
+
//CASE(APPS): SYMBOL1(apps);
|
221
|
+
//CASE(SELECT): SYMBOL1(select);
|
222
|
+
//CASE(CLEAR): SYMBOL1(clear);
|
223
|
+
//CASE(PLAY): SYMBOL1(play);
|
224
|
+
//CASE(ZOOM): SYMBOL1(zoom);
|
225
|
+
|
226
|
+
//CASE(BROWSER_BACK): SYMBOL1(browser_back);
|
227
|
+
//CASE(BROWSER_FORWARD): SYMBOL1(browser_forward);
|
228
|
+
//CASE(BROWSER_REFRESH): SYMBOL1(browser_refresh);
|
229
|
+
//CASE(BROWSER_STOP): SYMBOL1(browser_stop);
|
230
|
+
//CASE(BROWSER_SEARCH): SYMBOL1(browser_search);
|
231
|
+
//CASE(BROWSER_FAVORITES): SYMBOL1(browser_favorites);
|
232
|
+
//CASE(BROWSER_HOME): SYMBOL1(browser_home);
|
233
|
+
|
234
|
+
//CASE(MEDIA_NEXT_TRACK): SYMBOL1(media_next);
|
235
|
+
//CASE(MEDIA_PREV_TRACK): SYMBOL1(media_prev);
|
236
|
+
//CASE(MEDIA_STOP): SYMBOL1(media_stop);
|
237
|
+
//CASE(MEDIA_PLAY_PAUSE): SYMBOL1(media_play_stop);
|
238
|
+
|
239
|
+
//CASE(LAUNCH_MAIL): SYMBOL1(launch_mail);
|
240
|
+
//CASE(LAUNCH_MEDIA_SELECT): SYMBOL1(launch_media_select);
|
241
|
+
//CASE(LAUNCH_APP1): SYMBOL1(launch_app1);
|
242
|
+
//CASE(LAUNCH_APP2): SYMBOL1(launch_app2);
|
243
|
+
|
244
|
+
#undef CASE
|
245
|
+
#undef SYMBOL1
|
246
|
+
#undef SYMBOL2
|
247
|
+
}
|
248
|
+
return nil();
|
249
|
+
}
|
250
|
+
RUCY_END
|
251
|
+
|
252
|
+
static
|
253
|
+
RUCY_DEF0(get_chars)
|
254
|
+
{
|
255
|
+
CHECK;
|
256
|
+
return value(THIS->chars());
|
58
257
|
}
|
59
258
|
RUCY_END
|
60
259
|
|
61
260
|
static
|
62
|
-
RUCY_DEF0(
|
261
|
+
RUCY_DEF0(get_code)
|
63
262
|
{
|
64
263
|
CHECK;
|
65
|
-
return value(THIS->code);
|
264
|
+
return value(THIS->code());
|
66
265
|
}
|
67
266
|
RUCY_END
|
68
267
|
|
69
268
|
static
|
70
|
-
RUCY_DEF0(
|
269
|
+
RUCY_DEF0(get_modifiers)
|
71
270
|
{
|
72
271
|
CHECK;
|
73
|
-
return value(THIS->modifiers);
|
272
|
+
return value(THIS->modifiers());
|
74
273
|
}
|
75
274
|
RUCY_END
|
76
275
|
|
77
276
|
static
|
78
|
-
RUCY_DEF0(
|
277
|
+
RUCY_DEF0(get_repeat)
|
79
278
|
{
|
80
279
|
CHECK;
|
81
|
-
return value(THIS->repeat);
|
280
|
+
return value(THIS->repeat());
|
82
281
|
}
|
83
282
|
RUCY_END
|
84
283
|
|
85
284
|
static
|
86
|
-
RUCY_DEF0(
|
285
|
+
RUCY_DEF0(is_captured)
|
87
286
|
{
|
88
287
|
CHECK;
|
89
|
-
return value(THIS->
|
288
|
+
return value(THIS->is_captured());
|
90
289
|
}
|
91
290
|
RUCY_END
|
92
291
|
|
@@ -102,15 +301,16 @@ Init_key_event ()
|
|
102
301
|
cKeyEvent.define_alloc_func(alloc);
|
103
302
|
cKeyEvent.define_private_method("initialize", initialize);
|
104
303
|
cKeyEvent.define_private_method("initialize_copy", initialize_copy);
|
105
|
-
cKeyEvent.define_method("
|
106
|
-
cKeyEvent.define_method("
|
107
|
-
cKeyEvent.define_method("
|
108
|
-
cKeyEvent.define_method("
|
109
|
-
cKeyEvent.define_method("
|
110
|
-
cKeyEvent.define_method("
|
111
|
-
cKeyEvent.
|
112
|
-
cKeyEvent.define_const("
|
113
|
-
cKeyEvent.define_const("
|
304
|
+
cKeyEvent.define_method("action", get_action);
|
305
|
+
cKeyEvent.define_method("key", get_key);
|
306
|
+
cKeyEvent.define_method("chars", get_chars);
|
307
|
+
cKeyEvent.define_method("code", get_code);
|
308
|
+
cKeyEvent.define_method("modifiers", get_modifiers);
|
309
|
+
cKeyEvent.define_method("repeat", get_repeat);
|
310
|
+
cKeyEvent.define_method("captured?", is_captured);
|
311
|
+
cKeyEvent.define_const("ACTION_NONE", Reflex::KeyEvent::ACTION_NONE);
|
312
|
+
cKeyEvent.define_const("DOWN", Reflex::KeyEvent::DOWN);
|
313
|
+
cKeyEvent.define_const("UP", Reflex::KeyEvent::UP);
|
114
314
|
}
|
115
315
|
|
116
316
|
|
data/ext/reflex/native.cpp
CHANGED
@@ -17,6 +17,7 @@ void Init_frame_event ();
|
|
17
17
|
void Init_scroll_event ();
|
18
18
|
void Init_focus_event ();
|
19
19
|
void Init_key_event ();
|
20
|
+
void Init_pointer ();
|
20
21
|
void Init_pointer_event ();
|
21
22
|
void Init_wheel_event ();
|
22
23
|
void Init_capture_event ();
|
@@ -63,6 +64,7 @@ extern "C" void
|
|
63
64
|
Init_scroll_event();
|
64
65
|
Init_focus_event();
|
65
66
|
Init_key_event();
|
67
|
+
Init_pointer();
|
66
68
|
Init_pointer_event();
|
67
69
|
Init_wheel_event();
|
68
70
|
Init_capture_event();
|