reflexion 0.1.22 → 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/event.cpp +9 -1
- data/.doc/ext/reflex/key_event.cpp +3 -3
- data/.doc/ext/reflex/native.cpp +2 -0
- data/.doc/ext/reflex/pointer.cpp +158 -0
- data/.doc/ext/reflex/pointer_event.cpp +29 -88
- data/.doc/ext/reflex/selector.cpp +8 -0
- data/.doc/ext/reflex/view.cpp +57 -0
- data/.doc/ext/reflex/window.cpp +24 -0
- data/VERSION +1 -1
- data/ext/reflex/event.cpp +11 -2
- data/ext/reflex/key_event.cpp +3 -3
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/pointer.cpp +170 -0
- data/ext/reflex/pointer_event.cpp +29 -94
- data/ext/reflex/selector.cpp +9 -0
- data/ext/reflex/view.cpp +67 -3
- data/ext/reflex/window.cpp +30 -3
- data/include/reflex/defs.h +0 -18
- 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 +10 -8
- data/lib/reflex/key_event.rb +1 -1
- data/lib/reflex/pointer.rb +107 -0
- data/lib/reflex/pointer_event.rb +16 -54
- data/lib/reflex.rb +1 -0
- data/reflex.gemspec +5 -5
- 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 +49 -21
- data/src/osx/event.h +6 -3
- data/src/osx/event.mm +40 -22
- data/src/osx/native_window.mm +79 -16
- data/src/pointer.cpp +203 -0
- data/src/pointer.h +26 -0
- data/src/selector.cpp +1 -1
- data/src/view.cpp +83 -72
- data/src/view.h +0 -4
- data/src/window.cpp +321 -97
- data/src/window.h +22 -3
- data/test/test_event.rb +16 -2
- data/test/test_pointer.rb +149 -0
- data/test/test_pointer_event.rb +70 -104
- data/test/test_selector.rb +7 -0
- data/test/test_view.rb +38 -11
- data/test/test_window.rb +27 -25
- 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
|
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
|
|
@@ -272,10 +272,10 @@ VALUE get_repeat(VALUE self)
|
|
272
272
|
}
|
273
273
|
|
274
274
|
static
|
275
|
-
VALUE
|
275
|
+
VALUE is_captured(VALUE self)
|
276
276
|
{
|
277
277
|
CHECK;
|
278
|
-
return value(THIS->
|
278
|
+
return value(THIS->captured);
|
279
279
|
}
|
280
280
|
|
281
281
|
|
@@ -296,7 +296,7 @@ Init_key_event ()
|
|
296
296
|
rb_define_method(cKeyEvent, "code", RUBY_METHOD_FUNC(get_code), 0);
|
297
297
|
rb_define_method(cKeyEvent, "modifiers", RUBY_METHOD_FUNC(get_modifiers), 0);
|
298
298
|
rb_define_method(cKeyEvent, "repeat", RUBY_METHOD_FUNC(get_repeat), 0);
|
299
|
-
cKeyEvent.define_method("
|
299
|
+
cKeyEvent.define_method("captured?", is_captured);
|
300
300
|
cKeyEvent.define_const("TYPE_NONE", Reflex::KeyEvent::NONE);
|
301
301
|
cKeyEvent.define_const("TYPE_DOWN", Reflex::KeyEvent::DOWN);
|
302
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
|
@@ -1,7 +1,9 @@
|
|
1
1
|
#include "reflex/ruby/event.h"
|
2
2
|
|
3
3
|
|
4
|
+
#include <vector>
|
4
5
|
#include <rays/ruby/point.h>
|
6
|
+
#include "reflex/ruby/pointer.h"
|
5
7
|
#include "defs.h"
|
6
8
|
|
7
9
|
|
@@ -19,23 +21,18 @@ VALUE alloc(VALUE klass)
|
|
19
21
|
}
|
20
22
|
|
21
23
|
static
|
22
|
-
VALUE initialize(VALUE self
|
24
|
+
VALUE initialize(VALUE self)
|
23
25
|
{
|
24
26
|
CHECK;
|
25
27
|
|
26
|
-
|
27
|
-
if (size <= 0 || Reflex::PointerEvent::MAX < size)
|
28
|
+
if (argc == 0)
|
28
29
|
argument_error(__FILE__, __LINE__);
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
THIS->count = to<uint>(count);
|
34
|
-
THIS->drag = to<bool>(drag);
|
35
|
-
THIS->size = (size_t) size;
|
31
|
+
std::vector<Reflex::Pointer> pointers;
|
32
|
+
for (size_t i = 0; i < argc; ++i)
|
33
|
+
pointers.emplace_back(to<Reflex::Pointer&>(argv[i]));
|
36
34
|
|
37
|
-
|
38
|
-
THIS->positions[i] = to<Rays::Point>(positions[i]);
|
35
|
+
*THIS = Reflex::PointerEvent(&pointers[0], pointers.size());
|
39
36
|
|
40
37
|
return rb_call_super(0, NULL);
|
41
38
|
}
|
@@ -48,89 +45,49 @@ VALUE initialize_copy(VALUE self, VALUE obj)
|
|
48
45
|
return self;
|
49
46
|
}
|
50
47
|
|
51
|
-
static
|
52
|
-
VALUE get_type(VALUE self)
|
53
|
-
{
|
54
|
-
CHECK;
|
55
|
-
return value(THIS->type);
|
56
|
-
}
|
57
|
-
|
58
|
-
static
|
59
|
-
VALUE get_pointer_type(VALUE self)
|
60
|
-
{
|
61
|
-
CHECK;
|
62
|
-
return value(THIS->pointer_type);
|
63
|
-
}
|
64
|
-
|
65
48
|
static
|
66
49
|
VALUE get_size(VALUE self)
|
67
50
|
{
|
68
51
|
CHECK;
|
69
|
-
return value(THIS->size);
|
70
|
-
}
|
71
|
-
|
72
|
-
static
|
73
|
-
VALUE get_modifiers(VALUE self)
|
74
|
-
{
|
75
|
-
CHECK;
|
76
|
-
return value(THIS->modifiers);
|
77
|
-
}
|
78
|
-
|
79
|
-
static
|
80
|
-
VALUE get_count(VALUE self)
|
81
|
-
{
|
82
|
-
CHECK;
|
83
|
-
return value(THIS->count);
|
84
|
-
}
|
85
|
-
|
86
|
-
static
|
87
|
-
VALUE is_drag(VALUE self)
|
88
|
-
{
|
89
|
-
CHECK;
|
90
|
-
return value(THIS->drag);
|
52
|
+
return value(THIS->size());
|
91
53
|
}
|
92
54
|
|
93
55
|
static
|
94
|
-
VALUE
|
56
|
+
VALUE is_empty(VALUE self)
|
95
57
|
{
|
96
58
|
CHECK;
|
97
|
-
return value(THIS->
|
59
|
+
return value(THIS->empty());
|
98
60
|
}
|
99
61
|
|
100
62
|
static
|
101
|
-
VALUE
|
63
|
+
VALUE is_captured(VALUE self)
|
102
64
|
{
|
103
65
|
CHECK;
|
104
|
-
return value(THIS->
|
66
|
+
return value(THIS->is_captured());
|
105
67
|
}
|
106
68
|
|
107
69
|
static
|
108
|
-
VALUE
|
70
|
+
VALUE get_at(VALUE self, VALUE index)
|
109
71
|
{
|
110
72
|
CHECK;
|
111
|
-
return value(THIS->y);
|
112
|
-
}
|
113
73
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
check_arg_count(__FILE__, __LINE__, "PointerEvent#position", argc, 0, 1);
|
74
|
+
int size = (int) THIS->size();
|
75
|
+
int i = to<int>(index);
|
76
|
+
if (i < -size || size <= i)
|
77
|
+
return Qnil;
|
119
78
|
|
120
|
-
|
121
|
-
return value(THIS->position(index));
|
79
|
+
return value((*THIS)[i >= 0 ? i : i + size]);
|
122
80
|
}
|
123
81
|
|
124
82
|
static
|
125
|
-
VALUE
|
83
|
+
VALUE each(VALUE self)
|
126
84
|
{
|
127
85
|
CHECK;
|
128
86
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
return value((*THIS)[i]);
|
87
|
+
Value ret;
|
88
|
+
for (size_t i = 0, size = THIS->size(); i < size; ++i)
|
89
|
+
ret = rb_yield(value((*THIS)[i]));
|
90
|
+
return ret;
|
134
91
|
}
|
135
92
|
|
136
93
|
|
@@ -143,29 +100,13 @@ Init_pointer_event ()
|
|
143
100
|
|
144
101
|
cPointerEvent = mReflex.define_class("PointerEvent", Reflex::event_class());
|
145
102
|
rb_define_alloc_func(cPointerEvent, alloc);
|
146
|
-
rb_define_private_method(cPointerEvent, "initialize", RUBY_METHOD_FUNC(initialize),
|
103
|
+
rb_define_private_method(cPointerEvent, "initialize", RUBY_METHOD_FUNC(initialize), -1);
|
147
104
|
rb_define_private_method(cPointerEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
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
105
|
rb_define_method(cPointerEvent, "size", RUBY_METHOD_FUNC(get_size), 0);
|
151
|
-
|
152
|
-
|
153
|
-
cPointerEvent.define_method("
|
154
|
-
cPointerEvent
|
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
|
-
cPointerEvent.define_const("TYPE_NONE", Reflex::PointerEvent::NONE);
|
160
|
-
cPointerEvent.define_const("TYPE_DOWN", Reflex::PointerEvent::DOWN);
|
161
|
-
cPointerEvent.define_const("TYPE_UP", Reflex::PointerEvent::UP);
|
162
|
-
cPointerEvent.define_const("TYPE_MOVE", Reflex::PointerEvent::MOVE);
|
163
|
-
cPointerEvent.define_const("POINTER_NONE", Reflex::POINTER_NONE);
|
164
|
-
cPointerEvent.define_const("POINTER_MOUSE_LEFT", Reflex::POINTER_MOUSE_LEFT);
|
165
|
-
cPointerEvent.define_const("POINTER_MOUSE_RIGHT", Reflex::POINTER_MOUSE_RIGHT);
|
166
|
-
cPointerEvent.define_const("POINTER_MOUSE_MIDDLE", Reflex::POINTER_MOUSE_MIDDLE);
|
167
|
-
cPointerEvent.define_const("POINTER_TOUCH", Reflex::POINTER_TOUCH);
|
168
|
-
cPointerEvent.define_const("POINTER_PEN", Reflex::POINTER_PEN);
|
106
|
+
cPointerEvent.define_method("empty?", is_empty);
|
107
|
+
cPointerEvent.define_method("captured?", is_captured);
|
108
|
+
cPointerEvent.define_method("[]", get_at);
|
109
|
+
rb_define_method(cPointerEvent, "each", RUBY_METHOD_FUNC(each), 0);
|
169
110
|
}
|
170
111
|
|
171
112
|
|
@@ -81,6 +81,13 @@ VALUE each_tag(VALUE self)
|
|
81
81
|
return ret;
|
82
82
|
}
|
83
83
|
|
84
|
+
static
|
85
|
+
VALUE is_empty(VALUE self)
|
86
|
+
{
|
87
|
+
CHECK;
|
88
|
+
return value(C_THIS->empty());
|
89
|
+
}
|
90
|
+
|
84
91
|
static
|
85
92
|
VALUE contains(VALUE self, VALUE selector)
|
86
93
|
{
|
@@ -113,6 +120,7 @@ Init_selector ()
|
|
113
120
|
rb_define_method(cSelector, "clear_tags", RUBY_METHOD_FUNC(clear_tags), 0);
|
114
121
|
cSelector.define_method("tag?", has_tag);
|
115
122
|
rb_define_method(cSelector, "each_tag", RUBY_METHOD_FUNC(each_tag), 0);
|
123
|
+
cSelector.define_method("empty?", is_empty);
|
116
124
|
rb_define_method(cSelector, "contains", RUBY_METHOD_FUNC(contains), 1);
|
117
125
|
cSelector.define_method("==", equal);
|
118
126
|
}
|
data/.doc/ext/reflex/view.cpp
CHANGED
@@ -120,6 +120,48 @@ VALUE update_layout(VALUE self)
|
|
120
120
|
return self;
|
121
121
|
}
|
122
122
|
|
123
|
+
static
|
124
|
+
VALUE from_parent(VALUE self, VALUE point)
|
125
|
+
{
|
126
|
+
CHECK;
|
127
|
+
return value(THIS->from_parent(to<Rays::Point>(point)));
|
128
|
+
}
|
129
|
+
|
130
|
+
static
|
131
|
+
VALUE to_parent(VALUE self, VALUE point)
|
132
|
+
{
|
133
|
+
CHECK;
|
134
|
+
return value(THIS->to_parent(to<Rays::Point>(point)));
|
135
|
+
}
|
136
|
+
|
137
|
+
static
|
138
|
+
VALUE from_window(VALUE self, VALUE point)
|
139
|
+
{
|
140
|
+
CHECK;
|
141
|
+
return value(THIS->from_window(to<Rays::Point>(point)));
|
142
|
+
}
|
143
|
+
|
144
|
+
static
|
145
|
+
VALUE to_window(VALUE self, VALUE point)
|
146
|
+
{
|
147
|
+
CHECK;
|
148
|
+
return value(THIS->to_window(to<Rays::Point>(point)));
|
149
|
+
}
|
150
|
+
|
151
|
+
static
|
152
|
+
VALUE from_screen(VALUE self, VALUE point)
|
153
|
+
{
|
154
|
+
CHECK;
|
155
|
+
return value(THIS->from_screen(to<Rays::Point>(point)));
|
156
|
+
}
|
157
|
+
|
158
|
+
static
|
159
|
+
VALUE to_screen(VALUE self, VALUE point)
|
160
|
+
{
|
161
|
+
CHECK;
|
162
|
+
return value(THIS->to_screen(to<Rays::Point>(point)));
|
163
|
+
}
|
164
|
+
|
123
165
|
static
|
124
166
|
VALUE add_child(VALUE self, VALUE child)
|
125
167
|
{
|
@@ -929,6 +971,13 @@ VALUE on_pointer_move(VALUE self, VALUE event)
|
|
929
971
|
CALL(on_pointer_move(to<Reflex::PointerEvent*>(event)));
|
930
972
|
}
|
931
973
|
|
974
|
+
static
|
975
|
+
VALUE on_pointer_cancel(VALUE self, VALUE event)
|
976
|
+
{
|
977
|
+
CHECK;
|
978
|
+
CALL(on_pointer_cancel(to<Reflex::PointerEvent*>(event)));
|
979
|
+
}
|
980
|
+
|
932
981
|
static
|
933
982
|
VALUE on_wheel(VALUE self, VALUE event)
|
934
983
|
{
|
@@ -991,6 +1040,13 @@ Init_view ()
|
|
991
1040
|
rb_define_private_method(cView, "start_timer", RUBY_METHOD_FUNC(start_timer), -1);
|
992
1041
|
rb_define_method(cView, "update_layout", RUBY_METHOD_FUNC(update_layout), 0);
|
993
1042
|
|
1043
|
+
rb_define_method(cView, "from_parent", RUBY_METHOD_FUNC(from_parent), 1);
|
1044
|
+
rb_define_method(cView, "to_parent", RUBY_METHOD_FUNC(to_parent), 1);
|
1045
|
+
rb_define_method(cView, "from_window", RUBY_METHOD_FUNC(from_window), 1);
|
1046
|
+
rb_define_method(cView, "to_window", RUBY_METHOD_FUNC(to_window), 1);
|
1047
|
+
rb_define_method(cView, "from_screen", RUBY_METHOD_FUNC(from_screen), 1);
|
1048
|
+
rb_define_method(cView, "to_screen", RUBY_METHOD_FUNC(to_screen), 1);
|
1049
|
+
|
994
1050
|
rb_define_method(cView, "add_child", RUBY_METHOD_FUNC(add_child), 1);
|
995
1051
|
rb_define_method(cView, "remove_child", RUBY_METHOD_FUNC(remove_child), 1);
|
996
1052
|
rb_define_method(cView, "clear_children", RUBY_METHOD_FUNC(clear_children), 0);
|
@@ -1093,6 +1149,7 @@ Init_view ()
|
|
1093
1149
|
rb_define_method(cView, "on_pointer_down", RUBY_METHOD_FUNC(on_pointer_down), 1);
|
1094
1150
|
rb_define_method(cView, "on_pointer_up", RUBY_METHOD_FUNC(on_pointer_up), 1);
|
1095
1151
|
rb_define_method(cView, "on_pointer_move", RUBY_METHOD_FUNC(on_pointer_move), 1);
|
1152
|
+
rb_define_method(cView, "on_pointer_cancel", RUBY_METHOD_FUNC(on_pointer_cancel), 1);
|
1096
1153
|
rb_define_method(cView, "on_wheel", RUBY_METHOD_FUNC(on_wheel), 1);
|
1097
1154
|
rb_define_method(cView, "on_capture", RUBY_METHOD_FUNC(on_capture), 1);
|
1098
1155
|
rb_define_method(cView, "on_timer", RUBY_METHOD_FUNC(on_timer), 1);
|
data/.doc/ext/reflex/window.cpp
CHANGED
@@ -54,6 +54,20 @@ VALUE redraw(VALUE self)
|
|
54
54
|
return self;
|
55
55
|
}
|
56
56
|
|
57
|
+
static
|
58
|
+
VALUE from_screen(VALUE self, VALUE point)
|
59
|
+
{
|
60
|
+
CHECK;
|
61
|
+
return value(THIS->from_screen(to<Rays::Point>(point)));
|
62
|
+
}
|
63
|
+
|
64
|
+
static
|
65
|
+
VALUE to_screen(VALUE self, VALUE point)
|
66
|
+
{
|
67
|
+
CHECK;
|
68
|
+
return value(THIS->to_screen(to<Rays::Point>(point)));
|
69
|
+
}
|
70
|
+
|
57
71
|
static
|
58
72
|
VALUE set_title(VALUE self, VALUE title)
|
59
73
|
{
|
@@ -229,6 +243,13 @@ VALUE on_pointer_move(VALUE self, VALUE event)
|
|
229
243
|
CALL(on_pointer_move(to<Reflex::PointerEvent*>(event)));
|
230
244
|
}
|
231
245
|
|
246
|
+
static
|
247
|
+
VALUE on_pointer_cancel(VALUE self, VALUE event)
|
248
|
+
{
|
249
|
+
CHECK;
|
250
|
+
CALL(on_pointer_cancel(to<Reflex::PointerEvent*>(event)));
|
251
|
+
}
|
252
|
+
|
232
253
|
static
|
233
254
|
VALUE on_wheel(VALUE self, VALUE event)
|
234
255
|
{
|
@@ -250,6 +271,8 @@ Init_window ()
|
|
250
271
|
rb_define_method(cWindow, "hide", RUBY_METHOD_FUNC(hide), 0);
|
251
272
|
rb_define_method(cWindow, "close", RUBY_METHOD_FUNC(close), 0);
|
252
273
|
rb_define_method(cWindow, "redraw", RUBY_METHOD_FUNC(redraw), 0);
|
274
|
+
rb_define_method(cWindow, "from_screen", RUBY_METHOD_FUNC(from_screen), 1);
|
275
|
+
rb_define_method(cWindow, "to_screen", RUBY_METHOD_FUNC(to_screen), 1);
|
253
276
|
rb_define_method(cWindow, "title=", RUBY_METHOD_FUNC(set_title), 1);
|
254
277
|
rb_define_method(cWindow, "title", RUBY_METHOD_FUNC(get_title), 0);
|
255
278
|
rb_define_method(cWindow, "frame=", RUBY_METHOD_FUNC(set_frame), -1);
|
@@ -274,6 +297,7 @@ Init_window ()
|
|
274
297
|
rb_define_method(cWindow, "on_pointer_down", RUBY_METHOD_FUNC(on_pointer_down), 1);
|
275
298
|
rb_define_method(cWindow, "on_pointer_up", RUBY_METHOD_FUNC(on_pointer_up), 1);
|
276
299
|
rb_define_method(cWindow, "on_pointer_move", RUBY_METHOD_FUNC(on_pointer_move), 1);
|
300
|
+
rb_define_method(cWindow, "on_pointer_cancel", RUBY_METHOD_FUNC(on_pointer_cancel), 1);
|
277
301
|
rb_define_method(cWindow, "on_wheel", RUBY_METHOD_FUNC(on_wheel), 1);
|
278
302
|
}
|
279
303
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.23
|
data/ext/reflex/event.cpp
CHANGED
@@ -43,6 +43,14 @@ RUCY_DEF0(is_blocked)
|
|
43
43
|
}
|
44
44
|
RUCY_END
|
45
45
|
|
46
|
+
static
|
47
|
+
RUCY_DEF0(get_time)
|
48
|
+
{
|
49
|
+
CHECK;
|
50
|
+
return value(THIS->time());
|
51
|
+
}
|
52
|
+
RUCY_END
|
53
|
+
|
46
54
|
|
47
55
|
static Class cEvent;
|
48
56
|
|
@@ -54,8 +62,9 @@ Init_event ()
|
|
54
62
|
cEvent = mReflex.define_class("Event");
|
55
63
|
cEvent.define_alloc_func(alloc);
|
56
64
|
cEvent.define_private_method("initialize_copy", initialize_copy);
|
57
|
-
cEvent.define_method("block",
|
58
|
-
cEvent.define_method("
|
65
|
+
cEvent.define_method("block", block);
|
66
|
+
cEvent.define_method("blocked?", is_blocked);
|
67
|
+
cEvent.define_method("time", get_time);
|
59
68
|
}
|
60
69
|
|
61
70
|
|
data/ext/reflex/key_event.cpp
CHANGED
@@ -281,10 +281,10 @@ RUCY_DEF0(get_repeat)
|
|
281
281
|
RUCY_END
|
282
282
|
|
283
283
|
static
|
284
|
-
RUCY_DEF0(
|
284
|
+
RUCY_DEF0(is_captured)
|
285
285
|
{
|
286
286
|
CHECK;
|
287
|
-
return value(THIS->
|
287
|
+
return value(THIS->captured);
|
288
288
|
}
|
289
289
|
RUCY_END
|
290
290
|
|
@@ -306,7 +306,7 @@ Init_key_event ()
|
|
306
306
|
cKeyEvent.define_method("code", get_code);
|
307
307
|
cKeyEvent.define_method("modifiers", get_modifiers);
|
308
308
|
cKeyEvent.define_method("repeat", get_repeat);
|
309
|
-
cKeyEvent.define_method("
|
309
|
+
cKeyEvent.define_method("captured?", is_captured);
|
310
310
|
cKeyEvent.define_const("TYPE_NONE", Reflex::KeyEvent::NONE);
|
311
311
|
cKeyEvent.define_const("TYPE_DOWN", Reflex::KeyEvent::DOWN);
|
312
312
|
cKeyEvent.define_const("TYPE_UP", Reflex::KeyEvent::UP);
|
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();
|