reflexion 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.doc/ext/reflex/application.cpp +54 -39
- data/.doc/ext/reflex/capture_event.cpp +87 -0
- data/.doc/ext/reflex/draw_event.cpp +103 -0
- data/.doc/ext/reflex/event.cpp +73 -0
- data/.doc/ext/reflex/focus_event.cpp +98 -0
- data/.doc/ext/reflex/frame_event.cpp +133 -0
- data/.doc/ext/reflex/image_view.cpp +74 -0
- data/.doc/ext/reflex/key_event.cpp +124 -0
- data/.doc/ext/reflex/native.cpp +45 -6
- data/.doc/ext/reflex/pointer_event.cpp +181 -0
- data/.doc/ext/reflex/reflex.cpp +17 -41
- data/.doc/ext/reflex/scroll_event.cpp +141 -0
- data/.doc/ext/reflex/selector.cpp +135 -0
- data/.doc/ext/reflex/style.cpp +253 -0
- data/.doc/ext/reflex/style_length.cpp +133 -0
- data/.doc/ext/reflex/style_length2.cpp +149 -0
- data/.doc/ext/reflex/style_length4.cpp +192 -0
- data/.doc/ext/reflex/update_event.cpp +77 -0
- data/.doc/ext/reflex/view.cpp +408 -88
- data/.doc/ext/reflex/wheel_event.cpp +146 -0
- data/.doc/ext/reflex/window.cpp +95 -92
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/ext/reflex/application.cpp +67 -49
- data/ext/reflex/capture_event.cpp +92 -0
- data/ext/reflex/draw_event.cpp +110 -0
- data/ext/reflex/event.cpp +77 -0
- data/ext/reflex/extconf.rb +18 -68
- data/ext/reflex/focus_event.cpp +104 -0
- data/ext/reflex/frame_event.cpp +143 -0
- data/ext/reflex/image_view.cpp +77 -0
- data/ext/reflex/key_event.cpp +133 -0
- data/ext/reflex/native.cpp +45 -6
- data/ext/reflex/pointer_event.cpp +195 -0
- data/ext/reflex/reflex.cpp +21 -47
- data/ext/reflex/scroll_event.cpp +152 -0
- data/ext/reflex/selector.cpp +144 -0
- data/ext/reflex/style.cpp +277 -0
- data/ext/reflex/style_length.cpp +140 -0
- data/ext/reflex/style_length2.cpp +157 -0
- data/ext/reflex/style_length4.cpp +204 -0
- data/ext/reflex/update_event.cpp +81 -0
- data/ext/reflex/view.cpp +469 -114
- data/ext/reflex/wheel_event.cpp +158 -0
- data/ext/reflex/window.cpp +130 -123
- data/include/reflex/application.h +12 -7
- data/include/reflex/defs.h +13 -89
- data/include/reflex/event.h +260 -0
- data/include/reflex/exception.h +17 -11
- data/include/reflex/image_view.h +45 -0
- data/include/reflex/reflex.h +2 -6
- data/include/reflex/ruby/application.h +40 -13
- data/include/reflex/ruby/event.h +72 -0
- data/include/reflex/ruby/image_view.h +25 -0
- data/include/reflex/ruby/selector.h +27 -0
- data/include/reflex/ruby/style.h +27 -0
- data/include/reflex/ruby/style_length.h +37 -0
- data/include/reflex/ruby/view.h +193 -38
- data/include/reflex/ruby/window.h +123 -39
- data/include/reflex/ruby.h +3 -2
- data/include/reflex/selector.h +64 -0
- data/include/reflex/style.h +144 -0
- data/include/reflex/style_length.h +147 -0
- data/include/reflex/view.h +182 -19
- data/include/reflex/window.h +35 -19
- data/include/reflex.h +7 -0
- data/lib/reflex/application.rb +14 -5
- data/lib/reflex/arc_shape.rb +20 -0
- data/lib/reflex/button.rb +75 -0
- data/lib/reflex/capture_event.rb +37 -0
- data/lib/reflex/color.rb +13 -0
- data/lib/reflex/color_space.rb +13 -0
- data/lib/reflex/draw_event.rb +19 -0
- data/lib/reflex/ellipse_shape.rb +20 -0
- data/lib/reflex/ext.rb +1 -1
- data/lib/reflex/flags.rb +18 -0
- data/lib/reflex/focus_event.rb +38 -0
- data/lib/reflex/font.rb +13 -0
- data/lib/reflex/frame_event.rb +42 -0
- data/lib/reflex/helper.rb +87 -30
- data/lib/reflex/image_view.rb +25 -0
- data/lib/reflex/key_event.rb +38 -0
- data/lib/reflex/line_shape.rb +20 -0
- data/lib/reflex/list_view.rb +15 -0
- data/lib/reflex/model.rb +149 -0
- data/lib/reflex/model_owner.rb +57 -0
- data/lib/reflex/model_view.rb +22 -0
- data/lib/reflex/module.rb +11 -7
- data/lib/reflex/pointer_event.rb +85 -0
- data/lib/reflex/rect_shape.rb +20 -0
- data/lib/reflex/reflex.rb +13 -2
- data/lib/reflex/scroll_event.rb +19 -0
- data/lib/reflex/selector.rb +31 -0
- data/lib/reflex/shader.rb +13 -0
- data/lib/reflex/shape.rb +34 -0
- data/lib/reflex/style.rb +55 -0
- data/lib/reflex/style_length.rb +30 -0
- data/lib/reflex/style_length2.rb +34 -0
- data/lib/reflex/style_length4.rb +38 -0
- data/lib/reflex/text_view.rb +55 -0
- data/lib/reflex/update_event.rb +19 -0
- data/lib/reflex/view.rb +38 -4
- data/lib/reflex/wheel_event.rb +19 -0
- data/lib/reflex/window.rb +7 -5
- data/lib/reflex.rb +38 -1
- data/lib/reflexion/include.rb +5 -0
- data/lib/reflexion.rb +100 -0
- data/reflex.gemspec +3 -4
- data/samples/app.rb +13 -0
- data/samples/bats.rb +91 -0
- data/samples/checker.rb +36 -0
- data/{examples/ruby/shapes.rb → samples/fans.rb} +12 -16
- data/samples/fps.rb +46 -0
- data/samples/grid.rb +60 -0
- data/{examples/ruby → samples}/hello.rb +14 -16
- data/samples/image.rb +44 -0
- data/samples/ios/hello/hello/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/samples/ios/hello/hello/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
- data/samples/ios/hello/hello/en.lproj/InfoPlist.strings +2 -0
- data/samples/ios/hello/hello/hello-Info.plist +47 -0
- data/samples/ios/hello/hello/hello-Prefix.pch +10 -0
- data/samples/ios/hello/hello/main.cpp +79 -0
- data/samples/ios/hello/hello.xcodeproj/project.pbxproj +725 -0
- data/{examples/ruby → samples}/key.rb +11 -14
- data/samples/layout.rb +89 -0
- data/samples/model.rb +86 -0
- data/samples/osx/hello/hello/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/samples/osx/hello/hello/en.lproj/Credits.rtf +29 -0
- data/samples/osx/hello/hello/en.lproj/InfoPlist.strings +2 -0
- data/samples/osx/hello/hello/hello-Info.plist +32 -0
- data/samples/osx/hello/hello/hello-Prefix.pch +3 -0
- data/samples/osx/hello/hello/main.cpp +79 -0
- data/samples/osx/hello/hello.xcodeproj/project.pbxproj +725 -0
- data/samples/reflexion/hello.rb +24 -0
- data/samples/reflexion/paint.rb +40 -0
- data/samples/reflexion/pulse.rb +34 -0
- data/samples/repl.rb +69 -0
- data/samples/shader.rb +41 -0
- data/samples/shapes.rb +30 -0
- data/{examples/ruby → samples}/text.rb +7 -8
- data/samples/tree.rb +71 -0
- data/samples/views.rb +41 -0
- data/samples/visuals.rb +22 -0
- data/src/event.cpp +225 -0
- data/src/exception.cpp +24 -15
- data/src/image_view.cpp +70 -0
- data/src/ios/app_delegate.h +17 -0
- data/src/ios/app_delegate.mm +120 -0
- data/src/ios/application.mm +116 -0
- data/src/{cocoa/applicationdata.h → ios/application_data.h} +6 -6
- data/src/ios/event.h +26 -0
- data/src/ios/event.mm +31 -0
- data/src/ios/native_window.h +37 -0
- data/src/ios/native_window.mm +220 -0
- data/src/ios/opengl_view.h +13 -0
- data/src/ios/opengl_view.mm +131 -0
- data/src/{cocoa → ios}/reflex.mm +8 -12
- data/src/ios/window.mm +303 -0
- data/src/ios/window_data.h +75 -0
- data/src/osx/app_delegate.h +17 -0
- data/src/{cocoa/cocoaapplication.mm → osx/app_delegate.mm} +90 -48
- data/src/osx/application.mm +132 -0
- data/src/osx/application_data.h +45 -0
- data/src/osx/event.h +42 -0
- data/src/osx/event.mm +112 -0
- data/src/osx/native_window.h +26 -0
- data/src/osx/native_window.mm +322 -0
- data/src/{cocoa/openglview.h → osx/opengl_view.h} +0 -4
- data/src/{cocoa/openglview.mm → osx/opengl_view.mm} +66 -23
- data/src/osx/reflex.mm +50 -0
- data/src/osx/window.mm +308 -0
- data/src/osx/window_data.h +75 -0
- data/src/selector.cpp +121 -0
- data/src/style.cpp +576 -0
- data/src/style_length.cpp +341 -0
- data/src/view.cpp +1228 -129
- data/src/win32/application.cpp +1 -1
- data/src/window.cpp +54 -26
- data/test/helper.rb +8 -4
- data/test/test_capture_event.rb +41 -0
- data/test/test_event.rb +20 -0
- data/test/test_has_frame.rb +45 -0
- data/test/test_model.rb +9 -0
- data/test/test_model_owner.rb +9 -0
- data/test/test_selector.rb +75 -0
- data/test/test_style.rb +70 -0
- data/test/test_style_length.rb +38 -0
- data/test/test_style_length2.rb +50 -0
- data/test/test_style_length4.rb +56 -0
- data/test/test_view.rb +97 -23
- data/test/test_window.rb +54 -46
- metadata +205 -84
- data/.doc/ext/reflex/defs.cpp +0 -8
- data/.doc/ext/reflex/key.cpp +0 -122
- data/.doc/ext/reflex/points.cpp +0 -151
- data/.gitignore +0 -14
- data/ChangeLog +0 -8
- data/examples/hello/.gitignore +0 -2
- data/examples/hello/Rakefile +0 -41
- data/examples/hello/main.cpp +0 -18
- data/examples/ruby/app.rb +0 -13
- data/examples/ruby/checker.rb +0 -41
- data/examples/ruby/fps.rb +0 -49
- data/examples/ruby/grid.rb +0 -65
- data/examples/ruby/views.rb +0 -88
- data/examples/ruby/visuals.rb +0 -27
- data/ext/reflex/defs.cpp +0 -8
- data/ext/reflex/key.cpp +0 -129
- data/ext/reflex/points.cpp +0 -161
- data/include/reflex/ruby/key.h +0 -39
- data/include/reflex/ruby/points.h +0 -39
- data/lib/reflex/visuals/string.rb +0 -53
- data/src/cocoa/application.mm +0 -101
- data/src/cocoa/cocoaapplication.h +0 -21
- data/src/cocoa/cocoawindow.h +0 -46
- data/src/cocoa/cocoawindow.mm +0 -230
- data/src/cocoa/defs.h +0 -34
- data/src/cocoa/defs.mm +0 -87
- data/src/cocoa/window.mm +0 -148
- data/src/cocoa/windowdata.h +0 -56
- data/src/defs.cpp +0 -47
- data/src/helper.h +0 -12
- data/src/reflex.cpp +0 -43
- /data/{README → README.md} +0 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_RUBY_STYLE_H__
|
4
|
+
#define __REFLEX_RUBY_STYLE_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <rucy/rucy.h>
|
8
|
+
#include <rucy/class.h>
|
9
|
+
#include <rucy/extension.h>
|
10
|
+
#include <reflex/style.h>
|
11
|
+
|
12
|
+
|
13
|
+
namespace Reflex
|
14
|
+
{
|
15
|
+
|
16
|
+
|
17
|
+
Rucy::Class style_class ();
|
18
|
+
// class Reflex::Style
|
19
|
+
|
20
|
+
|
21
|
+
}// Reflex
|
22
|
+
|
23
|
+
|
24
|
+
RUCY_DECLARE_VALUE_FROM_TO(Reflex::Style)
|
25
|
+
|
26
|
+
|
27
|
+
#endif//EOH
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_RUBY_STYLE_LENGTH_H__
|
4
|
+
#define __REFLEX_RUBY_STYLE_LENGTH_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <rucy/rucy.h>
|
8
|
+
#include <rucy/class.h>
|
9
|
+
#include <rucy/extension.h>
|
10
|
+
#include <reflex/style.h>
|
11
|
+
|
12
|
+
|
13
|
+
namespace Reflex
|
14
|
+
{
|
15
|
+
|
16
|
+
|
17
|
+
Rucy::Class style_length_class ();
|
18
|
+
// class Reflex::StyleLength
|
19
|
+
|
20
|
+
Rucy::Class style_length2_class ();
|
21
|
+
// class Reflex::StyleLength2
|
22
|
+
|
23
|
+
Rucy::Class style_length4_class ();
|
24
|
+
// class Reflex::StyleLength4
|
25
|
+
|
26
|
+
|
27
|
+
}// Reflex
|
28
|
+
|
29
|
+
|
30
|
+
RUCY_DECLARE_VALUE_FROM_TO(Reflex::StyleLength)
|
31
|
+
|
32
|
+
RUCY_DECLARE_VALUE_FROM_TO(Reflex::StyleLength2)
|
33
|
+
|
34
|
+
RUCY_DECLARE_VALUE_FROM_TO(Reflex::StyleLength4)
|
35
|
+
|
36
|
+
|
37
|
+
#endif//EOH
|
data/include/reflex/ruby/view.h
CHANGED
@@ -7,11 +7,8 @@
|
|
7
7
|
#include <rucy/rucy.h>
|
8
8
|
#include <rucy/class.h>
|
9
9
|
#include <rucy/extension.h>
|
10
|
-
#include <rays/ruby/bounds.h>
|
11
|
-
#include <rays/ruby/painter.h>
|
12
10
|
#include <reflex/view.h>
|
13
|
-
#include <reflex/ruby/
|
14
|
-
#include <reflex/ruby/points.h>
|
11
|
+
#include <reflex/ruby/event.h>
|
15
12
|
|
16
13
|
|
17
14
|
namespace Reflex
|
@@ -28,70 +25,214 @@ namespace Reflex
|
|
28
25
|
|
29
26
|
public:
|
30
27
|
|
31
|
-
|
28
|
+
RUCY_OVERRIDE_BEGIN(Rucy::ClassWrapper<T>)
|
29
|
+
|
30
|
+
RUCY_OVERRIDE_ID(content_size)
|
31
|
+
RUCY_OVERRIDE_ID(on_attach)
|
32
|
+
RUCY_OVERRIDE_ID(on_detach)
|
33
|
+
RUCY_OVERRIDE_ID(on_update)
|
34
|
+
RUCY_OVERRIDE_ID(on_draw)
|
35
|
+
RUCY_OVERRIDE_ID(on_move)
|
36
|
+
RUCY_OVERRIDE_ID(on_resize)
|
37
|
+
RUCY_OVERRIDE_ID(on_scroll)
|
38
|
+
RUCY_OVERRIDE_ID(on_focus)
|
39
|
+
RUCY_OVERRIDE_ID(on_blur)
|
40
|
+
RUCY_OVERRIDE_ID(on_key)
|
41
|
+
RUCY_OVERRIDE_ID(on_key_down)
|
42
|
+
RUCY_OVERRIDE_ID(on_key_up)
|
43
|
+
RUCY_OVERRIDE_ID(on_pointer)
|
44
|
+
RUCY_OVERRIDE_ID(on_pointer_down)
|
45
|
+
RUCY_OVERRIDE_ID(on_pointer_up)
|
46
|
+
RUCY_OVERRIDE_ID(on_pointer_move)
|
47
|
+
RUCY_OVERRIDE_ID(on_wheel)
|
48
|
+
RUCY_OVERRIDE_ID(on_capture)
|
49
|
+
|
50
|
+
RUCY_OVERRIDE_END
|
51
|
+
|
52
|
+
virtual void show ()
|
53
|
+
{
|
54
|
+
RUCY_SYM(show);
|
55
|
+
this->value.call(show);
|
56
|
+
}
|
57
|
+
|
58
|
+
virtual void hide ()
|
59
|
+
{
|
60
|
+
RUCY_SYM(hide);
|
61
|
+
this->value.call(hide);
|
62
|
+
}
|
63
|
+
|
64
|
+
virtual Point content_size () const
|
65
|
+
{
|
66
|
+
RUCY_SYM(content_size);
|
67
|
+
if (RUCY_IS_OVERRIDDEN(content_size, view_class()))
|
68
|
+
{
|
69
|
+
Rucy::Value ret = this->value.call(content_size);
|
70
|
+
return ret.is_nil() ? Super::content_size() : Rucy::to<Point>(ret);
|
71
|
+
}
|
72
|
+
else
|
73
|
+
return Super::content_size();
|
74
|
+
}
|
75
|
+
|
76
|
+
virtual void on_attach (Event* e)
|
77
|
+
{
|
78
|
+
RUCY_SYM(on_attach);
|
79
|
+
if (RUCY_IS_OVERRIDDEN(on_attach, view_class()))
|
80
|
+
this->value.call(on_attach, Rucy::value(e));
|
81
|
+
else
|
82
|
+
Super::on_attach(e);
|
83
|
+
}
|
84
|
+
|
85
|
+
virtual void on_detach (Event* e)
|
86
|
+
{
|
87
|
+
RUCY_SYM(on_detach);
|
88
|
+
if (RUCY_IS_OVERRIDDEN(on_detach, view_class()))
|
89
|
+
this->value.call(on_detach, Rucy::value(e));
|
90
|
+
else
|
91
|
+
Super::on_detach(e);
|
92
|
+
}
|
93
|
+
|
94
|
+
virtual void on_update (UpdateEvent* e)
|
95
|
+
{
|
96
|
+
RUCY_SYM(on_update);
|
97
|
+
if (RUCY_IS_OVERRIDDEN(on_update, view_class()))
|
98
|
+
this->value.call(on_update, Rucy::value(e));
|
99
|
+
else
|
100
|
+
Super::on_update(e);
|
101
|
+
}
|
102
|
+
|
103
|
+
virtual void on_draw (DrawEvent* e)
|
32
104
|
{
|
33
|
-
|
34
|
-
|
105
|
+
RUCY_SYM(on_draw);
|
106
|
+
if (RUCY_IS_OVERRIDDEN(on_draw, view_class()))
|
107
|
+
this->value.call(on_draw, Rucy::value(e));
|
108
|
+
else
|
109
|
+
Super::on_draw(e);
|
35
110
|
}
|
36
111
|
|
37
|
-
virtual
|
112
|
+
virtual void on_move (FrameEvent* e)
|
38
113
|
{
|
39
|
-
|
40
|
-
|
114
|
+
RUCY_SYM(on_move);
|
115
|
+
if (RUCY_IS_OVERRIDDEN(on_move, view_class()))
|
116
|
+
this->value.call(on_move, Rucy::value(e));
|
117
|
+
else
|
118
|
+
Super::on_move(e);
|
41
119
|
}
|
42
120
|
|
43
|
-
virtual void
|
121
|
+
virtual void on_resize (FrameEvent* e)
|
44
122
|
{
|
45
|
-
|
46
|
-
|
123
|
+
RUCY_SYM(on_resize);
|
124
|
+
if (RUCY_IS_OVERRIDDEN(on_resize, view_class()))
|
125
|
+
this->value.call(on_resize, Rucy::value(e));
|
126
|
+
else
|
127
|
+
Super::on_resize(e);
|
47
128
|
}
|
48
129
|
|
49
|
-
virtual void
|
130
|
+
virtual void on_scroll (ScrollEvent* e)
|
50
131
|
{
|
51
|
-
|
52
|
-
|
132
|
+
RUCY_SYM(on_scroll);
|
133
|
+
if (RUCY_IS_OVERRIDDEN(on_scroll, view_class()))
|
134
|
+
this->value.call(on_scroll, Rucy::value(e));
|
135
|
+
else
|
136
|
+
Super::on_scroll(e);
|
53
137
|
}
|
54
138
|
|
55
|
-
virtual void
|
139
|
+
virtual void on_focus (FocusEvent* e)
|
56
140
|
{
|
57
|
-
|
58
|
-
|
141
|
+
RUCY_SYM(on_focus);
|
142
|
+
if (RUCY_IS_OVERRIDDEN(on_focus, view_class()))
|
143
|
+
this->value.call(on_focus, Rucy::value(e));
|
144
|
+
else
|
145
|
+
Super::on_focus(e);
|
59
146
|
}
|
60
147
|
|
61
|
-
virtual void
|
148
|
+
virtual void on_blur (FocusEvent* e)
|
62
149
|
{
|
63
|
-
|
64
|
-
|
150
|
+
RUCY_SYM(on_blur);
|
151
|
+
if (RUCY_IS_OVERRIDDEN(on_blur, view_class()))
|
152
|
+
this->value.call(on_blur, Rucy::value(e));
|
153
|
+
else
|
154
|
+
Super::on_blur(e);
|
65
155
|
}
|
66
156
|
|
67
|
-
virtual void
|
157
|
+
virtual void on_key (KeyEvent* e)
|
68
158
|
{
|
69
|
-
|
70
|
-
|
159
|
+
RUCY_SYM(on_key);
|
160
|
+
if (RUCY_IS_OVERRIDDEN(on_key, view_class()))
|
161
|
+
this->value.call(on_key, Rucy::value(e));
|
162
|
+
else
|
163
|
+
Super::on_key(e);
|
71
164
|
}
|
72
165
|
|
73
|
-
virtual void
|
166
|
+
virtual void on_key_down (KeyEvent* e)
|
74
167
|
{
|
75
|
-
|
76
|
-
|
168
|
+
RUCY_SYM(on_key_down);
|
169
|
+
if (RUCY_IS_OVERRIDDEN(on_key_down, view_class()))
|
170
|
+
this->value.call(on_key_down, Rucy::value(e));
|
171
|
+
else
|
172
|
+
Super::on_key_down(e);
|
77
173
|
}
|
78
174
|
|
79
|
-
virtual void
|
175
|
+
virtual void on_key_up (KeyEvent* e)
|
80
176
|
{
|
81
|
-
|
82
|
-
|
177
|
+
RUCY_SYM(on_key_up);
|
178
|
+
if (RUCY_IS_OVERRIDDEN(on_key_up, view_class()))
|
179
|
+
this->value.call(on_key_up, Rucy::value(e));
|
180
|
+
else
|
181
|
+
Super::on_key_up(e);
|
83
182
|
}
|
84
183
|
|
85
|
-
virtual void
|
184
|
+
virtual void on_pointer (PointerEvent* e)
|
86
185
|
{
|
87
|
-
|
88
|
-
|
186
|
+
RUCY_SYM(on_pointer);
|
187
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer, view_class()))
|
188
|
+
this->value.call(on_pointer, Rucy::value(e));
|
189
|
+
else
|
190
|
+
Super::on_pointer(e);
|
89
191
|
}
|
90
192
|
|
91
|
-
virtual void
|
193
|
+
virtual void on_pointer_down (PointerEvent* e)
|
92
194
|
{
|
93
|
-
|
94
|
-
|
195
|
+
RUCY_SYM(on_pointer_down);
|
196
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_down, view_class()))
|
197
|
+
this->value.call(on_pointer_down, Rucy::value(e));
|
198
|
+
else
|
199
|
+
Super::on_pointer_down(e);
|
200
|
+
}
|
201
|
+
|
202
|
+
virtual void on_pointer_up (PointerEvent* e)
|
203
|
+
{
|
204
|
+
RUCY_SYM(on_pointer_up);
|
205
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_up, view_class()))
|
206
|
+
this->value.call(on_pointer_up, Rucy::value(e));
|
207
|
+
else
|
208
|
+
Super::on_pointer_up(e);
|
209
|
+
}
|
210
|
+
|
211
|
+
virtual void on_pointer_move (PointerEvent* e)
|
212
|
+
{
|
213
|
+
RUCY_SYM(on_pointer_move);
|
214
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_move, view_class()))
|
215
|
+
this->value.call(on_pointer_move, Rucy::value(e));
|
216
|
+
else
|
217
|
+
Super::on_pointer_move(e);
|
218
|
+
}
|
219
|
+
|
220
|
+
virtual void on_wheel (WheelEvent* e)
|
221
|
+
{
|
222
|
+
RUCY_SYM(on_wheel);
|
223
|
+
if (RUCY_IS_OVERRIDDEN(on_wheel, view_class()))
|
224
|
+
this->value.call(on_wheel, Rucy::value(e));
|
225
|
+
else
|
226
|
+
Super::on_wheel(e);
|
227
|
+
}
|
228
|
+
|
229
|
+
virtual void on_capture (CaptureEvent* e)
|
230
|
+
{
|
231
|
+
RUCY_SYM(on_capture);
|
232
|
+
if (RUCY_IS_OVERRIDDEN(on_capture, view_class()))
|
233
|
+
this->value.call(on_capture, Rucy::value(e));
|
234
|
+
else
|
235
|
+
Super::on_capture(e);
|
95
236
|
}
|
96
237
|
|
97
238
|
};// RubyView
|
@@ -100,7 +241,21 @@ namespace Reflex
|
|
100
241
|
}// Reflex
|
101
242
|
|
102
243
|
|
103
|
-
|
244
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(Reflex::View)
|
245
|
+
|
246
|
+
|
247
|
+
namespace Rucy
|
248
|
+
{
|
249
|
+
|
250
|
+
|
251
|
+
inline Value
|
252
|
+
value (Reflex::View::Ref& ref, Value klass = Reflex::view_class())
|
253
|
+
{
|
254
|
+
return value(ref.get(), klass);
|
255
|
+
}
|
256
|
+
|
257
|
+
|
258
|
+
}// Rucy
|
104
259
|
|
105
260
|
|
106
261
|
#endif//EOH
|
@@ -8,8 +8,7 @@
|
|
8
8
|
#include <rucy/class.h>
|
9
9
|
#include <rucy/extension.h>
|
10
10
|
#include <reflex/window.h>
|
11
|
-
#include <reflex/ruby/
|
12
|
-
#include <reflex/ruby/points.h>
|
11
|
+
#include <reflex/ruby/event.h>
|
13
12
|
|
14
13
|
|
15
14
|
namespace Reflex
|
@@ -26,76 +25,147 @@ namespace Reflex
|
|
26
25
|
|
27
26
|
public:
|
28
27
|
|
29
|
-
|
28
|
+
RUCY_OVERRIDE_BEGIN(Rucy::ClassWrapper<T>)
|
29
|
+
|
30
|
+
RUCY_OVERRIDE_ID(on_update)
|
31
|
+
RUCY_OVERRIDE_ID(on_draw)
|
32
|
+
RUCY_OVERRIDE_ID(on_move)
|
33
|
+
RUCY_OVERRIDE_ID(on_resize)
|
34
|
+
RUCY_OVERRIDE_ID(on_key)
|
35
|
+
RUCY_OVERRIDE_ID(on_key_down)
|
36
|
+
RUCY_OVERRIDE_ID(on_key_up)
|
37
|
+
RUCY_OVERRIDE_ID(on_pointer)
|
38
|
+
RUCY_OVERRIDE_ID(on_pointer_down)
|
39
|
+
RUCY_OVERRIDE_ID(on_pointer_up)
|
40
|
+
RUCY_OVERRIDE_ID(on_pointer_move)
|
41
|
+
RUCY_OVERRIDE_ID(on_wheel)
|
42
|
+
|
43
|
+
RUCY_OVERRIDE_END
|
44
|
+
|
45
|
+
virtual void show ()
|
46
|
+
{
|
47
|
+
RUCY_SYM(show);
|
48
|
+
this->value.call(show);
|
49
|
+
}
|
50
|
+
|
51
|
+
virtual void hide ()
|
52
|
+
{
|
53
|
+
RUCY_SYM(hide);
|
54
|
+
this->value.call(hide);
|
55
|
+
}
|
56
|
+
|
57
|
+
virtual void close ()
|
58
|
+
{
|
59
|
+
RUCY_SYM(close);
|
60
|
+
this->value.call(close);
|
61
|
+
}
|
62
|
+
|
63
|
+
virtual void on_update (UpdateEvent* e)
|
30
64
|
{
|
31
|
-
|
32
|
-
|
65
|
+
RUCY_SYM(on_update);
|
66
|
+
if (RUCY_IS_OVERRIDDEN(on_update, window_class()))
|
67
|
+
this->value.call(on_update, Rucy::value(e));
|
68
|
+
else
|
69
|
+
Super::on_update(e);
|
33
70
|
}
|
34
71
|
|
35
|
-
virtual
|
72
|
+
virtual void on_draw (DrawEvent* e)
|
36
73
|
{
|
37
|
-
|
38
|
-
|
74
|
+
RUCY_SYM(on_draw);
|
75
|
+
if (RUCY_IS_OVERRIDDEN(on_draw, window_class()))
|
76
|
+
this->value.call(on_draw, Rucy::value(e));
|
77
|
+
else
|
78
|
+
Super::on_draw(e);
|
39
79
|
}
|
40
80
|
|
41
|
-
virtual
|
81
|
+
virtual void on_move (FrameEvent* e)
|
42
82
|
{
|
43
|
-
|
44
|
-
|
83
|
+
RUCY_SYM(on_move);
|
84
|
+
if (RUCY_IS_OVERRIDDEN(on_move, window_class()))
|
85
|
+
this->value.call(on_move, Rucy::value(e));
|
86
|
+
else
|
87
|
+
Super::on_move(e);
|
45
88
|
}
|
46
89
|
|
47
|
-
virtual void
|
90
|
+
virtual void on_resize (FrameEvent* e)
|
48
91
|
{
|
49
|
-
|
50
|
-
|
92
|
+
RUCY_SYM(on_resize);
|
93
|
+
if (RUCY_IS_OVERRIDDEN(on_resize, window_class()))
|
94
|
+
this->value.call(on_resize, Rucy::value(e));
|
95
|
+
else
|
96
|
+
Super::on_resize(e);
|
51
97
|
}
|
52
98
|
|
53
|
-
virtual void
|
99
|
+
virtual void on_key (KeyEvent* e)
|
54
100
|
{
|
55
|
-
|
56
|
-
|
101
|
+
RUCY_SYM(on_key);
|
102
|
+
if (RUCY_IS_OVERRIDDEN(on_key, window_class()))
|
103
|
+
this->value.call(on_key, Rucy::value(e));
|
104
|
+
else
|
105
|
+
Super::on_key(e);
|
57
106
|
}
|
58
107
|
|
59
|
-
virtual void
|
108
|
+
virtual void on_key_down (KeyEvent* e)
|
60
109
|
{
|
61
|
-
|
62
|
-
|
110
|
+
RUCY_SYM(on_key_down);
|
111
|
+
if (RUCY_IS_OVERRIDDEN(on_key_down, window_class()))
|
112
|
+
this->value.call(on_key_down, Rucy::value(e));
|
113
|
+
else
|
114
|
+
Super::on_key_down(e);
|
63
115
|
}
|
64
116
|
|
65
|
-
virtual void
|
117
|
+
virtual void on_key_up (KeyEvent* e)
|
66
118
|
{
|
67
|
-
|
68
|
-
|
119
|
+
RUCY_SYM(on_key_up);
|
120
|
+
if (RUCY_IS_OVERRIDDEN(on_key_up, window_class()))
|
121
|
+
this->value.call(on_key_up, Rucy::value(e));
|
122
|
+
else
|
123
|
+
Super::on_key_up(e);
|
69
124
|
}
|
70
125
|
|
71
|
-
virtual void
|
126
|
+
virtual void on_pointer (PointerEvent* e)
|
72
127
|
{
|
73
|
-
|
74
|
-
|
128
|
+
RUCY_SYM(on_pointer);
|
129
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer, window_class()))
|
130
|
+
this->value.call(on_pointer, Rucy::value(e));
|
131
|
+
else
|
132
|
+
Super::on_pointer(e);
|
75
133
|
}
|
76
134
|
|
77
|
-
virtual void
|
135
|
+
virtual void on_pointer_down (PointerEvent* e)
|
78
136
|
{
|
79
|
-
|
80
|
-
|
137
|
+
RUCY_SYM(on_pointer_down);
|
138
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_down, window_class()))
|
139
|
+
this->value.call(on_pointer_down, Rucy::value(e));
|
140
|
+
else
|
141
|
+
Super::on_pointer_down(e);
|
81
142
|
}
|
82
143
|
|
83
|
-
virtual void
|
144
|
+
virtual void on_pointer_up (PointerEvent* e)
|
84
145
|
{
|
85
|
-
|
86
|
-
|
146
|
+
RUCY_SYM(on_pointer_up);
|
147
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_up, window_class()))
|
148
|
+
this->value.call(on_pointer_up, Rucy::value(e));
|
149
|
+
else
|
150
|
+
Super::on_pointer_up(e);
|
87
151
|
}
|
88
152
|
|
89
|
-
virtual void
|
153
|
+
virtual void on_pointer_move (PointerEvent* e)
|
90
154
|
{
|
91
|
-
|
92
|
-
|
155
|
+
RUCY_SYM(on_pointer_move);
|
156
|
+
if (RUCY_IS_OVERRIDDEN(on_pointer_move, window_class()))
|
157
|
+
this->value.call(on_pointer_move, Rucy::value(e));
|
158
|
+
else
|
159
|
+
Super::on_pointer_move(e);
|
93
160
|
}
|
94
161
|
|
95
|
-
virtual void
|
162
|
+
virtual void on_wheel (WheelEvent* e)
|
96
163
|
{
|
97
|
-
|
98
|
-
|
164
|
+
RUCY_SYM(on_wheel);
|
165
|
+
if (RUCY_IS_OVERRIDDEN(on_wheel, window_class()))
|
166
|
+
this->value.call(on_wheel, Rucy::value(e));
|
167
|
+
else
|
168
|
+
Super::on_wheel(e);
|
99
169
|
}
|
100
170
|
|
101
171
|
};// RubyWindow
|
@@ -104,7 +174,21 @@ namespace Reflex
|
|
104
174
|
}// Reflex
|
105
175
|
|
106
176
|
|
107
|
-
|
177
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(Reflex::Window)
|
178
|
+
|
179
|
+
|
180
|
+
namespace Rucy
|
181
|
+
{
|
182
|
+
|
183
|
+
|
184
|
+
inline Value
|
185
|
+
value (Reflex::Window::Ref& ref, Value klass = Reflex::window_class())
|
186
|
+
{
|
187
|
+
return value(ref.get(), klass);
|
188
|
+
}
|
189
|
+
|
190
|
+
|
191
|
+
}// Rucy
|
108
192
|
|
109
193
|
|
110
194
|
#endif//EOH
|
data/include/reflex/ruby.h
CHANGED
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
#include <reflex/ruby/reflex.h>
|
8
|
-
#include <reflex/ruby/key.h>
|
9
|
-
#include <reflex/ruby/points.h>
|
10
8
|
#include <reflex/ruby/application.h>
|
11
9
|
#include <reflex/ruby/window.h>
|
12
10
|
#include <reflex/ruby/view.h>
|
11
|
+
#include <reflex/ruby/selector.h>
|
12
|
+
#include <reflex/ruby/style.h>
|
13
|
+
#include <reflex/ruby/event.h>
|
13
14
|
|
14
15
|
|
15
16
|
#endif//EOH
|
@@ -0,0 +1,64 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SELECTOR_H__
|
4
|
+
#define __REFLEX_SELECTOR_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <set>
|
8
|
+
#include <xot/pimpl.h>
|
9
|
+
#include <xot/string.h>
|
10
|
+
#include <reflex/defs.h>
|
11
|
+
|
12
|
+
|
13
|
+
namespace Reflex
|
14
|
+
{
|
15
|
+
|
16
|
+
|
17
|
+
class Selector
|
18
|
+
{
|
19
|
+
|
20
|
+
typedef Selector This;
|
21
|
+
|
22
|
+
public:
|
23
|
+
|
24
|
+
typedef std::set<String> TagSet;
|
25
|
+
|
26
|
+
typedef TagSet:: iterator iterator;
|
27
|
+
|
28
|
+
typedef TagSet::const_iterator const_iterator;
|
29
|
+
|
30
|
+
Selector (const char* name = NULL);
|
31
|
+
|
32
|
+
void set_name (const char* name);
|
33
|
+
|
34
|
+
const char* name () const;
|
35
|
+
|
36
|
+
void add_tag (const char* tag);
|
37
|
+
|
38
|
+
void remove_tag (const char* tag);
|
39
|
+
|
40
|
+
iterator begin ();
|
41
|
+
|
42
|
+
const_iterator begin () const;
|
43
|
+
|
44
|
+
iterator end ();
|
45
|
+
|
46
|
+
const_iterator end () const;
|
47
|
+
|
48
|
+
bool match (const This& obj) const;
|
49
|
+
|
50
|
+
friend bool operator == (const This& lhs, const This& rhs);
|
51
|
+
|
52
|
+
friend bool operator != (const This& lhs, const This& rhs);
|
53
|
+
|
54
|
+
struct Data;
|
55
|
+
|
56
|
+
Xot::PImpl<Data, true> self;
|
57
|
+
|
58
|
+
};// Selector
|
59
|
+
|
60
|
+
|
61
|
+
}// Reflex
|
62
|
+
|
63
|
+
|
64
|
+
#endif//EOH
|