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