reflexion 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/reflex/contact_event.cpp +6 -6
  3. data/.doc/ext/reflex/focus_event.cpp +6 -6
  4. data/.doc/ext/reflex/key_event.cpp +210 -12
  5. data/.doc/ext/reflex/pointer_event.cpp +21 -21
  6. data/VERSION +1 -1
  7. data/ext/reflex/contact_event.cpp +6 -6
  8. data/ext/reflex/focus_event.cpp +6 -6
  9. data/ext/reflex/key_event.cpp +211 -12
  10. data/ext/reflex/pointer_event.cpp +21 -21
  11. data/include/reflex/defs.h +143 -91
  12. data/lib/reflex/application.rb +3 -3
  13. data/lib/reflex/autoinit.rb +1 -1
  14. data/lib/reflex/button.rb +7 -7
  15. data/lib/reflex/capture_event.rb +7 -7
  16. data/lib/reflex/contact_event.rb +4 -4
  17. data/lib/reflex/draw_event.rb +2 -2
  18. data/lib/reflex/ellipse_shape.rb +2 -2
  19. data/lib/reflex/focus_event.rb +4 -4
  20. data/lib/reflex/frame_event.rb +5 -5
  21. data/lib/reflex/helper.rb +20 -20
  22. data/lib/reflex/image_view.rb +2 -2
  23. data/lib/reflex/key_event.rb +5 -5
  24. data/lib/reflex/model.rb +22 -22
  25. data/lib/reflex/model_owner.rb +7 -7
  26. data/lib/reflex/model_view.rb +1 -1
  27. data/lib/reflex/module.rb +5 -5
  28. data/lib/reflex/pointer_event.rb +12 -12
  29. data/lib/reflex/polygon_shape.rb +2 -2
  30. data/lib/reflex/reflex.rb +3 -3
  31. data/lib/reflex/scroll_event.rb +1 -1
  32. data/lib/reflex/selector.rb +4 -4
  33. data/lib/reflex/shape.rb +13 -13
  34. data/lib/reflex/style.rb +11 -11
  35. data/lib/reflex/style_length.rb +1 -1
  36. data/lib/reflex/text_view.rb +2 -2
  37. data/lib/reflex/timer.rb +2 -2
  38. data/lib/reflex/timer_event.rb +1 -1
  39. data/lib/reflex/update_event.rb +1 -1
  40. data/lib/reflex/view.rb +32 -32
  41. data/lib/reflex/wheel_event.rb +3 -3
  42. data/lib/reflex/window.rb +5 -5
  43. data/lib/reflexion.rb +17 -17
  44. data/reflex.gemspec +4 -4
  45. data/samples/reflexion/noise.rb +1 -1
  46. data/samples/tree.rb +1 -1
  47. data/src/ios/window.mm +1 -1
  48. data/src/osx/event.h +8 -0
  49. data/src/osx/event.mm +173 -1
  50. data/src/osx/native_window.mm +5 -1
  51. data/src/view.cpp +38 -10
  52. data/src/window.cpp +1 -1
  53. data/test/helper.rb +3 -3
  54. data/test/test_application.rb +1 -1
  55. data/test/test_capture_event.rb +6 -6
  56. data/test/test_event.rb +2 -2
  57. data/test/test_has_frame.rb +11 -11
  58. data/test/test_pointer_event.rb +13 -13
  59. data/test/test_reflex.rb +1 -1
  60. data/test/test_selector.rb +8 -8
  61. data/test/test_shape.rb +8 -8
  62. data/test/test_style.rb +13 -13
  63. data/test/test_style_length.rb +5 -5
  64. data/test/test_view.rb +30 -30
  65. data/test/test_window.rb +10 -10
  66. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a92694d805e53936c602a5b7b4f686c39505f90683f039d021678dae013408a
4
- data.tar.gz: 78b1cc8751399d48133827f757bd53dd8b165afb695da6b233d80134977274ba
3
+ metadata.gz: 3ddbc019fc036a931bdef9ec81872663f375a2e440003ef18b638666e61f7ed7
4
+ data.tar.gz: 6a803b54ac97bbe773c432f2089383983b95e2f5187891e5fd79aaca375fa9d4
5
5
  SHA512:
6
- metadata.gz: e0086b7bcbc0f684dc3e94fe57fee7057e055708f338d22c11f6dea11dd9c36056079c2558c77bb24d8277b15758e86707a95c0c03ae9e21c35e8192385efe1f
7
- data.tar.gz: 656414624e17e036e032b0904a7499c6fbb3846b96b8eac83bdf6c6ec6154e89fc93f73ca5d95ee340336830579546cc179342374a7624b8870af4c192ff97d4
6
+ metadata.gz: de9b87fd54230c33385b5e252ea39aae91b395e6f9aa2d2ef5b8dfcb9aead804831c7b6f8614b296df041914cf0a69e998e41e518d955d644ccec3e225a21c9d
7
+ data.tar.gz: c2072f7e2fa3c76e3d4a6aece31a6fa9c90f838bb7d96c2cc636def5c375b1c90f702634558363e0f282c0c79fc6adecd0484baa85c1d2c6c29a43e52118caad
@@ -39,21 +39,21 @@ VALUE initialize_copy(VALUE self, VALUE obj)
39
39
  }
40
40
 
41
41
  static
42
- VALUE type(VALUE self)
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 shape(VALUE self)
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 view(VALUE self)
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(type), 0);
75
- rb_define_method(cContactEvent, "shape", RUBY_METHOD_FUNC(shape), 0);
76
- rb_define_method(cContactEvent, "view", RUBY_METHOD_FUNC(view), 0);
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);
@@ -39,21 +39,21 @@ VALUE initialize_copy(VALUE self, VALUE obj)
39
39
  }
40
40
 
41
41
  static
42
- VALUE type(VALUE self)
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 current(VALUE self)
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 last(VALUE self)
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(type), 0);
75
- rb_define_method(cFocusEvent, "current", RUBY_METHOD_FUNC(current), 0);
76
- rb_define_method(cFocusEvent, "last", RUBY_METHOD_FUNC(last), 0);
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,42 +40,239 @@ VALUE initialize_copy(VALUE self, VALUE obj)
40
40
  }
41
41
 
42
42
  static
43
- VALUE type(VALUE self)
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 chars(VALUE self)
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 code(VALUE self)
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 modifiers(VALUE self)
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 repeat(VALUE self)
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 capture(VALUE self)
275
+ VALUE is_capture(VALUE self)
79
276
  {
80
277
  CHECK;
81
278
  return value(THIS->capture);
@@ -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(type), 0);
97
- rb_define_method(cKeyEvent, "chars", RUBY_METHOD_FUNC(chars), 0);
98
- rb_define_method(cKeyEvent, "code", RUBY_METHOD_FUNC(code), 0);
99
- rb_define_method(cKeyEvent, "modifiers", RUBY_METHOD_FUNC(modifiers), 0);
100
- rb_define_method(cKeyEvent, "repeat", RUBY_METHOD_FUNC(repeat), 0);
101
- cKeyEvent.define_method("capture?", capture);
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("capture?", is_capture);
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);
@@ -49,70 +49,70 @@ VALUE initialize_copy(VALUE self, VALUE obj)
49
49
  }
50
50
 
51
51
  static
52
- VALUE type(VALUE self)
52
+ VALUE get_type(VALUE self)
53
53
  {
54
54
  CHECK;
55
55
  return value(THIS->type);
56
56
  }
57
57
 
58
58
  static
59
- VALUE pointer_type(VALUE self)
59
+ VALUE get_pointer_type(VALUE self)
60
60
  {
61
61
  CHECK;
62
62
  return value(THIS->pointer_type);
63
63
  }
64
64
 
65
65
  static
66
- VALUE size(VALUE self)
66
+ VALUE get_size(VALUE self)
67
67
  {
68
68
  CHECK;
69
69
  return value(THIS->size);
70
70
  }
71
71
 
72
72
  static
73
- VALUE modifiers(VALUE self)
73
+ VALUE get_modifiers(VALUE self)
74
74
  {
75
75
  CHECK;
76
76
  return value(THIS->modifiers);
77
77
  }
78
78
 
79
79
  static
80
- VALUE count(VALUE self)
80
+ VALUE get_count(VALUE self)
81
81
  {
82
82
  CHECK;
83
83
  return value(THIS->count);
84
84
  }
85
85
 
86
86
  static
87
- VALUE drag(VALUE self)
87
+ VALUE is_drag(VALUE self)
88
88
  {
89
89
  CHECK;
90
90
  return value(THIS->drag);
91
91
  }
92
92
 
93
93
  static
94
- VALUE capture(VALUE self)
94
+ VALUE is_capture(VALUE self)
95
95
  {
96
96
  CHECK;
97
97
  return value(THIS->capture);
98
98
  }
99
99
 
100
100
  static
101
- VALUE x(VALUE self)
101
+ VALUE get_x(VALUE self)
102
102
  {
103
103
  CHECK;
104
104
  return value(THIS->x);
105
105
  }
106
106
 
107
107
  static
108
- VALUE y(VALUE self)
108
+ VALUE get_y(VALUE self)
109
109
  {
110
110
  CHECK;
111
111
  return value(THIS->y);
112
112
  }
113
113
 
114
114
  static
115
- VALUE position(VALUE self)
115
+ VALUE get_position(VALUE self)
116
116
  {
117
117
  CHECK;
118
118
  check_arg_count(__FILE__, __LINE__, "PointerEvent#position", argc, 0, 1);
@@ -145,17 +145,17 @@ Init_pointer_event ()
145
145
  rb_define_alloc_func(cPointerEvent, alloc);
146
146
  rb_define_private_method(cPointerEvent, "initialize", RUBY_METHOD_FUNC(initialize), 6);
147
147
  rb_define_private_method(cPointerEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
148
- rb_define_method(cPointerEvent, "type", RUBY_METHOD_FUNC(type), 0);
149
- rb_define_method(cPointerEvent, "pointer_type", RUBY_METHOD_FUNC(pointer_type), 0);
150
- rb_define_method(cPointerEvent, "size", RUBY_METHOD_FUNC(size), 0);
151
- rb_define_method(cPointerEvent, "modifiers", RUBY_METHOD_FUNC(modifiers), 0);
152
- rb_define_method(cPointerEvent, "count", RUBY_METHOD_FUNC(count), 0);
153
- cPointerEvent.define_method("drag?", drag);
154
- cPointerEvent.define_method("capture?", capture);
155
- rb_define_method(cPointerEvent, "x", RUBY_METHOD_FUNC(x), 0);
156
- rb_define_method(cPointerEvent, "y", RUBY_METHOD_FUNC(y), 0);
157
- rb_define_method(cPointerEvent, "position", RUBY_METHOD_FUNC(position), -1);
158
- cPointerEvent.define_method("[]", get_at);
148
+ rb_define_method(cPointerEvent, "type", RUBY_METHOD_FUNC(get_type), 0);
149
+ rb_define_method(cPointerEvent, "pointer_type", RUBY_METHOD_FUNC(get_pointer_type), 0);
150
+ rb_define_method(cPointerEvent, "size", RUBY_METHOD_FUNC(get_size), 0);
151
+ rb_define_method(cPointerEvent, "modifiers", RUBY_METHOD_FUNC(get_modifiers), 0);
152
+ rb_define_method(cPointerEvent, "count", RUBY_METHOD_FUNC(get_count), 0);
153
+ cPointerEvent.define_method("drag?", is_drag);
154
+ cPointerEvent.define_method("capture?", is_capture);
155
+ rb_define_method(cPointerEvent, "x", RUBY_METHOD_FUNC(get_x), 0);
156
+ rb_define_method(cPointerEvent, "y", RUBY_METHOD_FUNC(get_y), 0);
157
+ rb_define_method(cPointerEvent, "position", RUBY_METHOD_FUNC(get_position), -1);
158
+ cPointerEvent.define_method("[]", get_at);
159
159
  cPointerEvent.define_const("TYPE_NONE", Reflex::PointerEvent::NONE);
160
160
  cPointerEvent.define_const("TYPE_DOWN", Reflex::PointerEvent::DOWN);
161
161
  cPointerEvent.define_const("TYPE_UP", Reflex::PointerEvent::UP);