reflexion 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/application.cpp +37 -6
- data/.doc/ext/reflex/capture_event.cpp +1 -1
- data/.doc/ext/reflex/chase_constraint.cpp +1 -1
- data/.doc/ext/reflex/clipboard.cpp +1 -1
- data/.doc/ext/reflex/color_event.cpp +76 -0
- data/.doc/ext/reflex/color_picker.cpp +113 -0
- data/.doc/ext/reflex/constraint.cpp +1 -1
- data/.doc/ext/reflex/contact_event.cpp +1 -1
- data/.doc/ext/reflex/control_change_event.cpp +1 -1
- data/.doc/ext/reflex/device.cpp +1 -1
- data/.doc/ext/reflex/device_event.cpp +1 -1
- data/.doc/ext/reflex/draw_event.cpp +1 -1
- data/.doc/ext/reflex/ellipse_shape.cpp +1 -1
- data/.doc/ext/reflex/event.cpp +1 -1
- data/.doc/ext/reflex/file_dialog.cpp +181 -0
- data/.doc/ext/reflex/file_event.cpp +103 -0
- data/.doc/ext/reflex/filter.cpp +1 -1
- data/.doc/ext/reflex/focus_event.cpp +1 -1
- data/.doc/ext/reflex/frame_event.cpp +1 -1
- data/.doc/ext/reflex/gamepad.cpp +48 -0
- data/.doc/ext/reflex/image_view.cpp +1 -1
- data/.doc/ext/reflex/key_event.cpp +1 -274
- data/.doc/ext/reflex/line_shape.cpp +1 -1
- data/.doc/ext/reflex/link_constraint.cpp +1 -1
- data/.doc/ext/reflex/menu.cpp +6 -5
- data/.doc/ext/reflex/midi.cpp +9 -2
- data/.doc/ext/reflex/midi_event.cpp +1 -1
- data/.doc/ext/reflex/motion_event.cpp +1 -1
- data/.doc/ext/reflex/native.cpp +18 -6
- data/.doc/ext/reflex/note_event.cpp +1 -1
- data/.doc/ext/reflex/pin.cpp +1 -1
- data/.doc/ext/reflex/pointer.cpp +1 -1
- data/.doc/ext/reflex/pointer_event.cpp +2 -2
- data/.doc/ext/reflex/polygon_shape.cpp +1 -1
- data/.doc/ext/reflex/rect_shape.cpp +1 -1
- data/.doc/ext/reflex/reflex.cpp +566 -232
- data/.doc/ext/reflex/screen.cpp +27 -1
- data/.doc/ext/reflex/scroll_event.cpp +1 -1
- data/.doc/ext/reflex/selector.cpp +1 -1
- data/.doc/ext/reflex/shape.cpp +1 -1
- data/.doc/ext/reflex/snap_constraint.cpp +1 -1
- data/.doc/ext/reflex/style.cpp +1 -1
- data/.doc/ext/reflex/style_length.cpp +1 -1
- data/.doc/ext/reflex/text_event.cpp +104 -0
- data/.doc/ext/reflex/timer.cpp +1 -1
- data/.doc/ext/reflex/timer_event.cpp +1 -1
- data/.doc/ext/reflex/update_event.cpp +1 -1
- data/.doc/ext/reflex/view.cpp +110 -56
- data/.doc/ext/reflex/wheel_constraint.cpp +1 -1
- data/.doc/ext/reflex/wheel_event.cpp +1 -1
- data/.doc/ext/reflex/window.cpp +226 -17
- data/.github/workflows/release-gem.yml +2 -49
- data/.github/workflows/tag.yml +5 -28
- data/.github/workflows/test.yml +1 -37
- data/ChangeLog.md +54 -0
- data/Gemfile.lock +13 -8
- data/Rakefile +13 -2
- data/Reflex.podspec +2 -2
- data/VERSION +1 -1
- data/ext/reflex/application.cpp +41 -6
- data/ext/reflex/capture_event.cpp +1 -1
- data/ext/reflex/chase_constraint.cpp +1 -1
- data/ext/reflex/clipboard.cpp +1 -1
- data/ext/reflex/color_event.cpp +80 -0
- data/ext/reflex/color_picker.cpp +121 -0
- data/ext/reflex/constraint.cpp +1 -1
- data/ext/reflex/contact_event.cpp +1 -1
- data/ext/reflex/control_change_event.cpp +1 -1
- data/ext/reflex/device.cpp +1 -1
- data/ext/reflex/device_event.cpp +1 -1
- data/ext/reflex/draw_event.cpp +1 -1
- data/ext/reflex/ellipse_shape.cpp +1 -1
- data/ext/reflex/event.cpp +1 -1
- data/ext/reflex/extconf.rb +4 -2
- data/ext/reflex/file_dialog.cpp +194 -0
- data/ext/reflex/file_event.cpp +108 -0
- data/ext/reflex/filter.cpp +1 -1
- data/ext/reflex/focus_event.cpp +1 -1
- data/ext/reflex/frame_event.cpp +1 -1
- data/ext/reflex/gamepad.cpp +50 -0
- data/ext/reflex/image_view.cpp +1 -1
- data/ext/reflex/key_event.cpp +1 -275
- data/ext/reflex/line_shape.cpp +1 -1
- data/ext/reflex/link_constraint.cpp +1 -1
- data/ext/reflex/menu.cpp +8 -7
- data/ext/reflex/midi.cpp +11 -3
- data/ext/reflex/midi_event.cpp +1 -1
- data/ext/reflex/motion_event.cpp +1 -1
- data/ext/reflex/native.cpp +18 -6
- data/ext/reflex/note_event.cpp +1 -1
- data/ext/reflex/pin.cpp +1 -1
- data/ext/reflex/pointer.cpp +1 -1
- data/ext/reflex/pointer_event.cpp +2 -2
- data/ext/reflex/polygon_shape.cpp +1 -1
- data/ext/reflex/rect_shape.cpp +1 -1
- data/ext/reflex/reflex.cpp +568 -232
- data/ext/reflex/screen.cpp +31 -2
- data/ext/reflex/scroll_event.cpp +1 -1
- data/ext/reflex/selector.cpp +1 -1
- data/ext/reflex/selector.h +9 -9
- data/ext/reflex/shape.cpp +1 -1
- data/ext/reflex/snap_constraint.cpp +1 -1
- data/ext/reflex/style.cpp +1 -1
- data/ext/reflex/style_length.cpp +1 -1
- data/ext/reflex/text_event.cpp +111 -0
- data/ext/reflex/timer.cpp +1 -1
- data/ext/reflex/timer_event.cpp +1 -1
- data/ext/reflex/update_event.cpp +1 -1
- data/ext/reflex/view.cpp +121 -61
- data/ext/reflex/wheel_constraint.cpp +1 -1
- data/ext/reflex/wheel_event.cpp +1 -1
- data/ext/reflex/window.cpp +256 -25
- data/include/reflex/application.h +10 -0
- data/include/reflex/color_picker.h +65 -0
- data/include/reflex/event.h +178 -88
- data/include/reflex/file_dialog.h +73 -0
- data/include/reflex/gamepad.h +3 -0
- data/include/reflex/menu.h +3 -3
- data/include/reflex/midi.h +3 -0
- data/include/reflex/reflex.h +2 -0
- data/include/reflex/ruby/application.h +6 -1
- data/include/reflex/ruby/color_picker.h +89 -0
- data/include/reflex/ruby/event.h +62 -29
- data/include/reflex/ruby/file_dialog.h +89 -0
- data/include/reflex/ruby/gamepad.h +46 -0
- data/include/reflex/ruby/reflex.h +3 -0
- data/include/reflex/ruby/view.h +92 -44
- data/include/reflex/ruby/window.h +60 -1
- data/include/reflex/ruby.h +3 -0
- data/include/reflex/screen.h +11 -2
- data/include/reflex/view.h +28 -16
- data/include/reflex/window.h +40 -8
- data/include/reflex.h +3 -0
- data/lib/reflex/application.rb +5 -5
- data/lib/reflex/autoinit.rb +3 -1
- data/lib/reflex/button.rb +3 -3
- data/lib/reflex/color_event.rb +16 -0
- data/lib/reflex/color_picker.rb +45 -0
- data/lib/reflex/control_change_event.rb +17 -0
- data/lib/reflex/file_dialog.rb +70 -0
- data/lib/reflex/file_event.rb +37 -0
- data/lib/reflex/helper.rb +58 -7
- data/lib/reflex/key_event.rb +9 -4
- data/lib/reflex/menu.rb +17 -1
- data/lib/reflex/model.rb +19 -19
- data/lib/reflex/note_event.rb +1 -1
- data/lib/reflex/pointer.rb +14 -3
- data/lib/reflex/pointer_event.rb +12 -1
- data/lib/reflex/reflex.rb +5 -0
- data/lib/reflex/shape.rb +14 -14
- data/lib/reflex/style.rb +16 -16
- data/lib/reflex/text_event.rb +40 -0
- data/lib/reflex/timer.rb +3 -3
- data/lib/reflex/view.rb +29 -14
- data/lib/reflex/wheel_event.rb +12 -3
- data/lib/reflex/window.rb +25 -13
- data/lib/reflex.rb +8 -2
- data/reflex.gemspec +4 -4
- data/samples/ime.rb +100 -0
- data/samples/ios/hello/hello.xcodeproj/project.pbxproj +236 -224
- data/samples/menu.rb +4 -1
- data/samples/model.rb +3 -3
- data/samples/test/alert.rb +93 -0
- data/samples/test/always_on.rb +76 -0
- data/samples/test/app_background.rb +51 -0
- data/samples/test/boundary.rb +75 -0
- data/samples/test/callback_exception.rb +101 -0
- data/samples/test/cancel.rb +53 -0
- data/samples/test/color_picker.rb +63 -0
- data/samples/test/file_dialog.rb +102 -0
- data/samples/window_style.rb +156 -0
- data/src/application.cpp +159 -18
- data/src/application.h +92 -7
- data/src/color_picker.cpp +113 -0
- data/src/color_picker.h +36 -0
- data/src/event.cpp +410 -252
- data/src/event.h +12 -0
- data/src/file_dialog.cpp +163 -0
- data/src/file_dialog.h +52 -0
- data/src/gamepad.cpp +42 -5
- data/src/gamepad.h +4 -0
- data/src/ios/app_delegate.mm +5 -3
- data/src/ios/application.mm +24 -0
- data/src/ios/color_picker.mm +19 -0
- data/src/ios/file_dialog.mm +21 -0
- data/src/ios/gamepad.mm +4 -4
- data/src/ios/menu.mm +5 -0
- data/src/ios/reflex.mm +8 -0
- data/src/ios/screen.mm +26 -0
- data/src/ios/view_controller.mm +2 -30
- data/src/ios/window.mm +38 -9
- data/src/menu.cpp +66 -4
- data/src/menu.h +17 -1
- data/src/midi.cpp +61 -31
- data/src/osx/app_delegate.h +4 -0
- data/src/osx/app_delegate.mm +102 -22
- data/src/osx/application.mm +88 -6
- data/src/osx/color_picker.mm +112 -0
- data/src/osx/event.h +10 -0
- data/src/osx/event.mm +84 -30
- data/src/osx/file_dialog.mm +168 -0
- data/src/osx/gamepad.mm +2 -2
- data/src/osx/gamepad_hid.mm +1 -1
- data/src/osx/menu.mm +177 -33
- data/src/osx/native_window.h +16 -2
- data/src/osx/native_window.mm +114 -57
- data/src/osx/opengl_view.h +2 -1
- data/src/osx/opengl_view.mm +184 -43
- data/src/osx/reflex.mm +38 -0
- data/src/osx/screen.mm +36 -0
- data/src/osx/window.mm +106 -24
- data/src/pointer.cpp +13 -4
- data/src/pointer.h +4 -0
- data/src/rays.h +46 -0
- data/src/sdl/application.cpp +68 -8
- data/src/sdl/color_picker.cpp +18 -0
- data/src/sdl/event.cpp +24 -3
- data/src/sdl/event.h +12 -0
- data/src/sdl/file_dialog.cpp +20 -0
- data/src/sdl/gamepad.cpp +3 -7
- data/src/sdl/menu.cpp +5 -0
- data/src/sdl/reflex.cpp +20 -0
- data/src/sdl/screen.cpp +36 -0
- data/src/sdl/window.cpp +142 -29
- data/src/shape.cpp +15 -10
- data/src/view.cpp +287 -198
- data/src/view.h +4 -2
- data/src/vk.h +416 -0
- data/src/win32/application.cpp +162 -12
- data/src/win32/application.h +20 -0
- data/src/win32/color_picker.cpp +82 -0
- data/src/win32/event.cpp +114 -12
- data/src/win32/event.h +21 -4
- data/src/win32/file_dialog.cpp +226 -0
- data/src/win32/gamepad.cpp +9 -2
- data/src/win32/menu.cpp +191 -53
- data/src/win32/menu.h +9 -1
- data/src/win32/opengl.cpp +2 -9
- data/src/win32/reflex.cpp +44 -3
- data/src/win32/screen.cpp +164 -3
- data/src/win32/screen.h +8 -0
- data/src/win32/tray.cpp +191 -0
- data/src/win32/tray.h +22 -0
- data/src/win32/vk.cpp +11 -0
- data/src/win32/window.cpp +809 -148
- data/src/win32/window.h +6 -0
- data/src/window.cpp +718 -185
- data/src/window.h +66 -33
- data/src/world.cpp +9 -1
- data/test/helper.rb +17 -0
- data/test/test_application.rb +90 -1
- data/test/test_chase_constraint.rb +1 -3
- data/test/test_color_event.rb +36 -0
- data/test/test_color_picker.rb +62 -0
- data/test/test_constraint.rb +2 -4
- data/test/test_event.rb +1 -1
- data/test/test_file_dialog.rb +48 -0
- data/test/test_file_event.rb +43 -0
- data/test/test_has_text_preedit.rb +54 -0
- data/test/test_key_event.rb +20 -5
- data/test/test_link_constraint.rb +1 -3
- data/test/test_menu.rb +40 -10
- data/test/test_pointer.rb +33 -23
- data/test/test_pointer_event.rb +24 -9
- data/test/test_reflex.rb +36 -0
- data/test/test_screen.rb +24 -2
- data/test/test_snap_constraint.rb +1 -3
- data/test/test_text_event.rb +54 -0
- data/test/test_view.rb +41 -4
- data/test/test_wheel_constraint.rb +1 -3
- data/test/test_wheel_event.rb +13 -5
- data/test/test_window.rb +196 -44
- metadata +80 -10
- data/.github/workflows/utils.rb +0 -127
data/.doc/ext/reflex/screen.cpp
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#include "reflex/ruby/screen.h"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
#include <ranges>
|
|
4
5
|
#include <rays/ruby/bounds.h>
|
|
5
6
|
#include "defs.h"
|
|
6
7
|
|
|
@@ -9,7 +10,7 @@ RUCY_DEFINE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Screen)
|
|
|
9
10
|
|
|
10
11
|
#define THIS to<Reflex::Screen*>(self)
|
|
11
12
|
|
|
12
|
-
#define CHECK
|
|
13
|
+
#define CHECK RUCY_CHECK_OBJ(Reflex::Screen, self)
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
static
|
|
@@ -18,6 +19,13 @@ VALUE alloc(VALUE klass)
|
|
|
18
19
|
Reflex::reflex_error(__FILE__, __LINE__, "can not instantiate Screen class.");
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
static
|
|
23
|
+
VALUE get_name(VALUE self)
|
|
24
|
+
{
|
|
25
|
+
CHECK;
|
|
26
|
+
return value(THIS->name());
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
static
|
|
22
30
|
VALUE get_frame(VALUE self)
|
|
23
31
|
{
|
|
@@ -25,6 +33,21 @@ VALUE get_frame(VALUE self)
|
|
|
25
33
|
return value(THIS->frame());
|
|
26
34
|
}
|
|
27
35
|
|
|
36
|
+
static
|
|
37
|
+
VALUE get_pixel_density(VALUE self)
|
|
38
|
+
{
|
|
39
|
+
CHECK;
|
|
40
|
+
return value(THIS->pixel_density());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static
|
|
44
|
+
VALUE get_all(VALUE self)
|
|
45
|
+
{
|
|
46
|
+
auto list = Reflex::Screen::all() |
|
|
47
|
+
std::views::transform([](const Reflex::Screen& s) {return value(s);});
|
|
48
|
+
return array(list.begin(), list.end());
|
|
49
|
+
}
|
|
50
|
+
|
|
28
51
|
|
|
29
52
|
static Class cScreen;
|
|
30
53
|
|
|
@@ -35,7 +58,10 @@ Init_reflex_screen ()
|
|
|
35
58
|
|
|
36
59
|
cScreen = rb_define_class_under(mReflex, "Screen", rb_cObject);
|
|
37
60
|
rb_define_alloc_func(cScreen, alloc);
|
|
61
|
+
rb_define_method(cScreen, "name", RUBY_METHOD_FUNC(get_name), 0);
|
|
38
62
|
rb_define_method(cScreen, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
|
63
|
+
rb_define_method(cScreen, "pixel_density", RUBY_METHOD_FUNC(get_pixel_density), 0);
|
|
64
|
+
rb_define_singleton_method(cScreen, "all", RUBY_METHOD_FUNC(get_all), 0);
|
|
39
65
|
}
|
|
40
66
|
|
|
41
67
|
|
|
@@ -9,7 +9,7 @@ RUCY_DEFINE_VALUE_OR_ARRAY_FROM_TO(REFLEX_EXPORT, Reflex::Selector)
|
|
|
9
9
|
#define THIS to< Reflex::Selector*>(self)
|
|
10
10
|
#define C_THIS to<const Reflex::Selector*>(self)
|
|
11
11
|
|
|
12
|
-
#define CHECK
|
|
12
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::Selector, self)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
static
|
data/.doc/ext/reflex/shape.cpp
CHANGED
|
@@ -12,7 +12,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Shape)
|
|
|
12
12
|
|
|
13
13
|
#define THIS to<Reflex::Shape*>(self)
|
|
14
14
|
|
|
15
|
-
#define CHECK
|
|
15
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::Shape, self)
|
|
16
16
|
|
|
17
17
|
#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
|
|
18
18
|
|
|
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::SnapConstraint)
|
|
|
9
9
|
|
|
10
10
|
#define THIS to<Reflex::SnapConstraint*>(self)
|
|
11
11
|
|
|
12
|
-
#define CHECK
|
|
12
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::SnapConstraint, self)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
static
|
data/.doc/ext/reflex/style.cpp
CHANGED
|
@@ -13,7 +13,7 @@ RUCY_DEFINE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Style)
|
|
|
13
13
|
#define THIS to< Reflex::Style*>(self)
|
|
14
14
|
#define C_THIS to<const Reflex::Style*>(self)
|
|
15
15
|
|
|
16
|
-
#define CHECK
|
|
16
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::Style, self)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
static
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#include "reflex/ruby/event.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
#include "defs.h"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
RUCY_DEFINE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::TextEvent)
|
|
8
|
+
|
|
9
|
+
#define THIS to<Reflex::TextEvent*>(self)
|
|
10
|
+
|
|
11
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::TextEvent, self)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
static
|
|
15
|
+
VALUE alloc(VALUE klass)
|
|
16
|
+
{
|
|
17
|
+
return new_type<Reflex::TextEvent>(klass);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static
|
|
21
|
+
VALUE initialize(VALUE self, VALUE action, VALUE text, VALUE selection_offset, VALUE selection_size)
|
|
22
|
+
{
|
|
23
|
+
CHECK;
|
|
24
|
+
|
|
25
|
+
*THIS = Reflex::TextEvent(
|
|
26
|
+
(Reflex::TextEvent::Action) to<uint>(action),
|
|
27
|
+
text.is_nil() ? "" : text.c_str(),
|
|
28
|
+
to<int>(selection_offset),
|
|
29
|
+
to<int>(selection_size));
|
|
30
|
+
|
|
31
|
+
return rb_call_super(0, NULL);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static
|
|
35
|
+
VALUE initialize_copy(VALUE self, VALUE obj)
|
|
36
|
+
{
|
|
37
|
+
CHECK;
|
|
38
|
+
*THIS = to<Reflex::TextEvent&>(obj).dup();
|
|
39
|
+
return self;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static
|
|
43
|
+
VALUE get_action(VALUE self)
|
|
44
|
+
{
|
|
45
|
+
CHECK;
|
|
46
|
+
return value(THIS->action());
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static
|
|
50
|
+
VALUE get_text(VALUE self)
|
|
51
|
+
{
|
|
52
|
+
CHECK;
|
|
53
|
+
return value(THIS->text());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static
|
|
57
|
+
VALUE get_selection_offset(VALUE self)
|
|
58
|
+
{
|
|
59
|
+
CHECK;
|
|
60
|
+
return value(THIS->selection_offset());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static
|
|
64
|
+
VALUE get_selection_size(VALUE self)
|
|
65
|
+
{
|
|
66
|
+
CHECK;
|
|
67
|
+
return value(THIS->selection_size());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
static Class cTextEvent;
|
|
72
|
+
|
|
73
|
+
void
|
|
74
|
+
Init_reflex_text_event ()
|
|
75
|
+
{
|
|
76
|
+
Module mReflex = rb_define_module("Reflex");
|
|
77
|
+
|
|
78
|
+
cTextEvent = mReflex.define_class("TextEvent", Reflex::event_class());
|
|
79
|
+
rb_define_alloc_func(cTextEvent, alloc);
|
|
80
|
+
rb_define_private_method(cTextEvent, "initialize", RUBY_METHOD_FUNC(initialize), 4);
|
|
81
|
+
rb_define_private_method(cTextEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
|
|
82
|
+
rb_define_method(cTextEvent, "action", RUBY_METHOD_FUNC(get_action), 0);
|
|
83
|
+
rb_define_method(cTextEvent, "text", RUBY_METHOD_FUNC(get_text), 0);
|
|
84
|
+
cTextEvent.define_private_method("selection_offset!", get_selection_offset);
|
|
85
|
+
cTextEvent.define_private_method("selection_size!", get_selection_size);
|
|
86
|
+
|
|
87
|
+
cTextEvent.define_const("ACTION_NONE", Reflex::TextEvent::ACTION_NONE);
|
|
88
|
+
cTextEvent.define_const("PREEDIT", Reflex::TextEvent::PREEDIT);
|
|
89
|
+
cTextEvent.define_const("COMMIT", Reflex::TextEvent::COMMIT);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
namespace Reflex
|
|
94
|
+
{
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Class
|
|
98
|
+
text_event_class ()
|
|
99
|
+
{
|
|
100
|
+
return cTextEvent;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
}// Reflex
|
data/.doc/ext/reflex/timer.cpp
CHANGED
|
@@ -12,7 +12,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Timer)
|
|
|
12
12
|
|
|
13
13
|
#define THIS to<Reflex::Timer*>(self)
|
|
14
14
|
|
|
15
|
-
#define CHECK
|
|
15
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::Timer, self)
|
|
16
16
|
|
|
17
17
|
#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
|
|
18
18
|
|
data/.doc/ext/reflex/view.cpp
CHANGED
|
@@ -22,7 +22,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::View)
|
|
|
22
22
|
#define THIS to< Reflex::View*>(self)
|
|
23
23
|
#define C_THIS to<const Reflex::View*>(self)
|
|
24
24
|
|
|
25
|
-
#define CHECK
|
|
25
|
+
#define CHECK RUCY_CHECK_OBJ(Reflex::View, self)
|
|
26
26
|
|
|
27
27
|
#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
|
|
28
28
|
|
|
@@ -50,7 +50,7 @@ VALUE hide(VALUE self)
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
static
|
|
53
|
-
VALUE
|
|
53
|
+
VALUE is_hidden(VALUE self)
|
|
54
54
|
{
|
|
55
55
|
CHECK;
|
|
56
56
|
return value(THIS->hidden());
|
|
@@ -112,6 +112,28 @@ VALUE update_layout(VALUE self)
|
|
|
112
112
|
return self;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
static
|
|
116
|
+
VALUE fit_to_content(VALUE self)
|
|
117
|
+
{
|
|
118
|
+
CHECK;
|
|
119
|
+
THIS->fit_to_content();
|
|
120
|
+
return self;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static
|
|
124
|
+
VALUE content_bounds(VALUE self)
|
|
125
|
+
{
|
|
126
|
+
CHECK;
|
|
127
|
+
return value(CALL(content_bounds()));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static
|
|
131
|
+
VALUE get_text_input_bounds(VALUE self)
|
|
132
|
+
{
|
|
133
|
+
CHECK;
|
|
134
|
+
return value(CALL(text_input_bounds()));
|
|
135
|
+
}
|
|
136
|
+
|
|
115
137
|
static
|
|
116
138
|
VALUE from_parent(VALUE self, VALUE point)
|
|
117
139
|
{
|
|
@@ -406,21 +428,6 @@ VALUE get_frame(VALUE self)
|
|
|
406
428
|
return value(THIS->frame());
|
|
407
429
|
}
|
|
408
430
|
|
|
409
|
-
static
|
|
410
|
-
VALUE content_bounds(VALUE self)
|
|
411
|
-
{
|
|
412
|
-
CHECK;
|
|
413
|
-
return value(CALL(content_bounds()));
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
static
|
|
417
|
-
VALUE fit_to_content(VALUE self)
|
|
418
|
-
{
|
|
419
|
-
CHECK;
|
|
420
|
-
THIS->fit_to_content();
|
|
421
|
-
return self;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
431
|
static
|
|
425
432
|
VALUE set_angle(VALUE self, VALUE degree)
|
|
426
433
|
{
|
|
@@ -590,23 +597,23 @@ VALUE get_clip(VALUE self)
|
|
|
590
597
|
}
|
|
591
598
|
|
|
592
599
|
static
|
|
593
|
-
VALUE
|
|
600
|
+
VALUE set_draw_cache(VALUE self, VALUE state)
|
|
594
601
|
{
|
|
595
602
|
CHECK;
|
|
596
603
|
|
|
597
|
-
if (
|
|
598
|
-
THIS-> add_flag(Reflex::View::
|
|
604
|
+
if (state)
|
|
605
|
+
THIS-> add_flag(Reflex::View::FLAG_DRAW_CACHE);
|
|
599
606
|
else
|
|
600
|
-
THIS->remove_flag(Reflex::View::
|
|
607
|
+
THIS->remove_flag(Reflex::View::FLAG_DRAW_CACHE);
|
|
601
608
|
|
|
602
|
-
return
|
|
609
|
+
return state;
|
|
603
610
|
}
|
|
604
611
|
|
|
605
612
|
static
|
|
606
|
-
VALUE
|
|
613
|
+
VALUE has_draw_cache(VALUE self)
|
|
607
614
|
{
|
|
608
615
|
CHECK;
|
|
609
|
-
return value(THIS->has_flag(Reflex::View::
|
|
616
|
+
return value(THIS->has_flag(Reflex::View::FLAG_DRAW_CACHE));
|
|
610
617
|
}
|
|
611
618
|
|
|
612
619
|
static
|
|
@@ -669,6 +676,26 @@ VALUE get_fix_angle(VALUE self)
|
|
|
669
676
|
return value(THIS->has_flag(Reflex::View::FLAG_FIX_ANGLE));
|
|
670
677
|
}
|
|
671
678
|
|
|
679
|
+
static
|
|
680
|
+
VALUE set_text_input(VALUE self, VALUE state)
|
|
681
|
+
{
|
|
682
|
+
CHECK;
|
|
683
|
+
|
|
684
|
+
if (state)
|
|
685
|
+
THIS-> add_flag(Reflex::View::FLAG_TEXT_INPUT);
|
|
686
|
+
else
|
|
687
|
+
THIS->remove_flag(Reflex::View::FLAG_TEXT_INPUT);
|
|
688
|
+
|
|
689
|
+
return state;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
static
|
|
693
|
+
VALUE get_text_input(VALUE self)
|
|
694
|
+
{
|
|
695
|
+
CHECK;
|
|
696
|
+
return value(THIS->has_flag(Reflex::View::FLAG_TEXT_INPUT));
|
|
697
|
+
}
|
|
698
|
+
|
|
672
699
|
static
|
|
673
700
|
VALUE parent(VALUE self)
|
|
674
701
|
{
|
|
@@ -1048,6 +1075,27 @@ VALUE on_key_up(VALUE self, VALUE event)
|
|
|
1048
1075
|
CALL(on_key_up(to<Reflex::KeyEvent*>(event)));
|
|
1049
1076
|
}
|
|
1050
1077
|
|
|
1078
|
+
static
|
|
1079
|
+
VALUE on_text(VALUE self, VALUE event)
|
|
1080
|
+
{
|
|
1081
|
+
CHECK;
|
|
1082
|
+
CALL(on_text(to<Reflex::TextEvent*>(event)));
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
static
|
|
1086
|
+
VALUE on_text_preedit(VALUE self, VALUE event)
|
|
1087
|
+
{
|
|
1088
|
+
CHECK;
|
|
1089
|
+
CALL(on_text_preedit(to<Reflex::TextEvent*>(event)));
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
static
|
|
1093
|
+
VALUE on_text_commit(VALUE self, VALUE event)
|
|
1094
|
+
{
|
|
1095
|
+
CHECK;
|
|
1096
|
+
CALL(on_text_commit(to<Reflex::TextEvent*>(event)));
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1051
1099
|
static
|
|
1052
1100
|
VALUE on_pointer(VALUE self, VALUE event)
|
|
1053
1101
|
{
|
|
@@ -1105,80 +1153,80 @@ VALUE on_wheel(VALUE self, VALUE event)
|
|
|
1105
1153
|
}
|
|
1106
1154
|
|
|
1107
1155
|
static
|
|
1108
|
-
VALUE
|
|
1156
|
+
VALUE on_capture(VALUE self, VALUE event)
|
|
1109
1157
|
{
|
|
1110
1158
|
CHECK;
|
|
1111
|
-
CALL(
|
|
1159
|
+
CALL(on_capture(to<Reflex::CaptureEvent*>(event)));
|
|
1112
1160
|
}
|
|
1113
1161
|
|
|
1114
1162
|
static
|
|
1115
|
-
VALUE
|
|
1163
|
+
VALUE on_timer(VALUE self, VALUE event)
|
|
1116
1164
|
{
|
|
1117
1165
|
CHECK;
|
|
1118
|
-
CALL(
|
|
1166
|
+
CALL(on_timer(to<Reflex::TimerEvent*>(event)));
|
|
1119
1167
|
}
|
|
1120
1168
|
|
|
1121
1169
|
static
|
|
1122
|
-
VALUE
|
|
1170
|
+
VALUE will_contact(VALUE self, VALUE view)
|
|
1123
1171
|
{
|
|
1124
1172
|
CHECK;
|
|
1125
|
-
CALL(
|
|
1173
|
+
return value(CALL(will_contact(to<Reflex::View*>(view))));
|
|
1126
1174
|
}
|
|
1127
1175
|
|
|
1128
1176
|
static
|
|
1129
|
-
VALUE
|
|
1177
|
+
VALUE on_contact(VALUE self, VALUE event)
|
|
1130
1178
|
{
|
|
1131
1179
|
CHECK;
|
|
1132
|
-
CALL(
|
|
1180
|
+
CALL(on_contact(to<Reflex::ContactEvent*>(event)));
|
|
1133
1181
|
}
|
|
1134
1182
|
|
|
1135
1183
|
static
|
|
1136
|
-
VALUE
|
|
1184
|
+
VALUE on_contact_begin(VALUE self, VALUE event)
|
|
1137
1185
|
{
|
|
1138
1186
|
CHECK;
|
|
1139
|
-
CALL(
|
|
1187
|
+
CALL(on_contact_begin(to<Reflex::ContactEvent*>(event)));
|
|
1140
1188
|
}
|
|
1141
1189
|
|
|
1142
1190
|
static
|
|
1143
|
-
VALUE
|
|
1191
|
+
VALUE on_contact_end(VALUE self, VALUE event)
|
|
1144
1192
|
{
|
|
1145
1193
|
CHECK;
|
|
1146
|
-
CALL(
|
|
1194
|
+
CALL(on_contact_end(to<Reflex::ContactEvent*>(event)));
|
|
1147
1195
|
}
|
|
1148
1196
|
|
|
1149
1197
|
static
|
|
1150
|
-
VALUE
|
|
1198
|
+
VALUE on_midi(VALUE self, VALUE event)
|
|
1151
1199
|
{
|
|
1152
1200
|
CHECK;
|
|
1153
|
-
CALL(
|
|
1201
|
+
CALL(on_midi(to<Reflex::MIDIEvent*>(event)));
|
|
1154
1202
|
}
|
|
1155
1203
|
|
|
1156
1204
|
static
|
|
1157
|
-
VALUE
|
|
1205
|
+
VALUE on_note(VALUE self, VALUE event)
|
|
1158
1206
|
{
|
|
1159
1207
|
CHECK;
|
|
1160
|
-
|
|
1208
|
+
CALL(on_note(to<Reflex::NoteEvent*>(event)));
|
|
1161
1209
|
}
|
|
1162
1210
|
|
|
1163
1211
|
static
|
|
1164
|
-
VALUE
|
|
1212
|
+
VALUE on_note_on(VALUE self, VALUE event)
|
|
1165
1213
|
{
|
|
1166
1214
|
CHECK;
|
|
1167
|
-
CALL(
|
|
1215
|
+
CALL(on_note_on(to<Reflex::NoteEvent*>(event)));
|
|
1168
1216
|
}
|
|
1169
1217
|
|
|
1170
1218
|
static
|
|
1171
|
-
VALUE
|
|
1219
|
+
VALUE on_note_off(VALUE self, VALUE event)
|
|
1172
1220
|
{
|
|
1173
1221
|
CHECK;
|
|
1174
|
-
CALL(
|
|
1222
|
+
CALL(on_note_off(to<Reflex::NoteEvent*>(event)));
|
|
1175
1223
|
}
|
|
1176
1224
|
|
|
1177
1225
|
static
|
|
1178
|
-
VALUE
|
|
1226
|
+
VALUE on_control_change(VALUE self, VALUE event)
|
|
1179
1227
|
{
|
|
1180
1228
|
CHECK;
|
|
1181
|
-
CALL(
|
|
1229
|
+
CALL(on_control_change(to<Reflex::ControlChangeEvent*>(event)));
|
|
1182
1230
|
}
|
|
1183
1231
|
|
|
1184
1232
|
|
|
@@ -1193,13 +1241,16 @@ Init_reflex_view ()
|
|
|
1193
1241
|
rb_define_alloc_func(cView, alloc);
|
|
1194
1242
|
rb_define_method(cView, "show", RUBY_METHOD_FUNC(show), 0);
|
|
1195
1243
|
rb_define_method(cView, "hide", RUBY_METHOD_FUNC(hide), 0);
|
|
1196
|
-
cView.define_method("hidden?",
|
|
1244
|
+
cView.define_method("hidden?", is_hidden);
|
|
1197
1245
|
rb_define_method(cView, "redraw", RUBY_METHOD_FUNC(redraw), 0);
|
|
1198
1246
|
rb_define_method(cView, "focus", RUBY_METHOD_FUNC(focus), -1);
|
|
1199
1247
|
rb_define_method(cView, "blur", RUBY_METHOD_FUNC(blur), 0);
|
|
1200
1248
|
cView.define_method("focus?", has_focus);
|
|
1201
1249
|
cView.define_private_method("start_timer!", start_timer);
|
|
1202
1250
|
rb_define_method(cView, "update_layout", RUBY_METHOD_FUNC(update_layout), 0);
|
|
1251
|
+
rb_define_method(cView, "fit_to_content", RUBY_METHOD_FUNC(fit_to_content), 0);
|
|
1252
|
+
rb_define_method(cView, "content_bounds", RUBY_METHOD_FUNC(content_bounds), 0);
|
|
1253
|
+
rb_define_method(cView, "text_input_bounds", RUBY_METHOD_FUNC(get_text_input_bounds), 0);
|
|
1203
1254
|
|
|
1204
1255
|
rb_define_method(cView, "from_parent", RUBY_METHOD_FUNC(from_parent), 1);
|
|
1205
1256
|
rb_define_method(cView, "to_parent", RUBY_METHOD_FUNC(to_parent), 1);
|
|
@@ -1237,8 +1288,6 @@ Init_reflex_view ()
|
|
|
1237
1288
|
|
|
1238
1289
|
rb_define_method(cView, "frame=", RUBY_METHOD_FUNC(set_frame), -1);
|
|
1239
1290
|
rb_define_method(cView, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
|
1240
|
-
rb_define_method(cView, "content_bounds", RUBY_METHOD_FUNC(content_bounds), 0);
|
|
1241
|
-
rb_define_method(cView, "fit_to_content", RUBY_METHOD_FUNC(fit_to_content), 0);
|
|
1242
1291
|
rb_define_method(cView, "angle=", RUBY_METHOD_FUNC(set_angle), 1);
|
|
1243
1292
|
rb_define_method(cView, "angle", RUBY_METHOD_FUNC(get_angle), 0);
|
|
1244
1293
|
rb_define_method(cView, "pivot=", RUBY_METHOD_FUNC(set_pivot), -1);
|
|
@@ -1252,14 +1301,16 @@ Init_reflex_view ()
|
|
|
1252
1301
|
rb_define_method(cView, "capture", RUBY_METHOD_FUNC(get_capture), 0);
|
|
1253
1302
|
rb_define_method(cView, "clip=", RUBY_METHOD_FUNC(set_clip), 1);
|
|
1254
1303
|
cView.define_method("clip?", get_clip);
|
|
1255
|
-
rb_define_method(cView, "
|
|
1256
|
-
cView.define_method("
|
|
1304
|
+
rb_define_method(cView, "draw_cache=", RUBY_METHOD_FUNC(set_draw_cache), 1);
|
|
1305
|
+
cView.define_method("draw_cache?", has_draw_cache);
|
|
1257
1306
|
rb_define_method(cView, "resize_to_fit=", RUBY_METHOD_FUNC(set_resize_to_fit), 1);
|
|
1258
1307
|
cView.define_method("resize_to_fit?", get_resize_to_fit);
|
|
1259
1308
|
rb_define_method(cView, "scroll_to_fit=", RUBY_METHOD_FUNC(set_scroll_to_fit), 1);
|
|
1260
1309
|
cView.define_method("scroll_to_fit?", get_scroll_to_fit);
|
|
1261
1310
|
rb_define_method(cView, "fix_angle=", RUBY_METHOD_FUNC(set_fix_angle), 1);
|
|
1262
1311
|
cView.define_method("fix_angle?", get_fix_angle);
|
|
1312
|
+
cView.define_private_method("set_text_input_flag!", set_text_input);
|
|
1313
|
+
cView.define_private_method( "text_input_flag!", get_text_input);
|
|
1263
1314
|
rb_define_method(cView, "parent", RUBY_METHOD_FUNC(parent), 0);
|
|
1264
1315
|
rb_define_method(cView, "window", RUBY_METHOD_FUNC(window), 0);
|
|
1265
1316
|
|
|
@@ -1314,6 +1365,9 @@ Init_reflex_view ()
|
|
|
1314
1365
|
rb_define_method(cView, "on_key", RUBY_METHOD_FUNC(on_key), 1);
|
|
1315
1366
|
rb_define_method(cView, "on_key_down", RUBY_METHOD_FUNC(on_key_down), 1);
|
|
1316
1367
|
rb_define_method(cView, "on_key_up", RUBY_METHOD_FUNC(on_key_up), 1);
|
|
1368
|
+
rb_define_method(cView, "on_text", RUBY_METHOD_FUNC(on_text), 1);
|
|
1369
|
+
rb_define_method(cView, "on_text_preedit", RUBY_METHOD_FUNC(on_text_preedit), 1);
|
|
1370
|
+
rb_define_method(cView, "on_text_commit", RUBY_METHOD_FUNC(on_text_commit), 1);
|
|
1317
1371
|
rb_define_method(cView, "on_pointer", RUBY_METHOD_FUNC(on_pointer), 1);
|
|
1318
1372
|
rb_define_method(cView, "on_pointer_down", RUBY_METHOD_FUNC(on_pointer_down), 1);
|
|
1319
1373
|
rb_define_method(cView, "on_pointer_up", RUBY_METHOD_FUNC(on_pointer_up), 1);
|
|
@@ -1322,17 +1376,17 @@ Init_reflex_view ()
|
|
|
1322
1376
|
rb_define_method(cView, "on_pointer_enter", RUBY_METHOD_FUNC(on_pointer_enter), 1);
|
|
1323
1377
|
rb_define_method(cView, "on_pointer_leave", RUBY_METHOD_FUNC(on_pointer_leave), 1);
|
|
1324
1378
|
rb_define_method(cView, "on_wheel", RUBY_METHOD_FUNC(on_wheel), 1);
|
|
1325
|
-
rb_define_method(cView, "on_midi", RUBY_METHOD_FUNC(on_midi), 1);
|
|
1326
|
-
rb_define_method(cView, "on_note", RUBY_METHOD_FUNC(on_note), 1);
|
|
1327
|
-
rb_define_method(cView, "on_note_on", RUBY_METHOD_FUNC(on_note_on), 1);
|
|
1328
|
-
rb_define_method(cView, "on_note_off", RUBY_METHOD_FUNC(on_note_off), 1);
|
|
1329
|
-
rb_define_method(cView, "on_control_change", RUBY_METHOD_FUNC(on_control_change), 1);
|
|
1330
1379
|
rb_define_method(cView, "on_capture", RUBY_METHOD_FUNC(on_capture), 1);
|
|
1331
1380
|
rb_define_method(cView, "on_timer", RUBY_METHOD_FUNC(on_timer), 1);
|
|
1332
1381
|
cView.define_method( "will_contact?", will_contact);
|
|
1333
1382
|
cView.define_private_method("call_contact!", on_contact);
|
|
1334
1383
|
cView.define_private_method("call_contact_begin!", on_contact_begin);
|
|
1335
1384
|
cView.define_private_method("call_contact_end!", on_contact_end);
|
|
1385
|
+
rb_define_method(cView, "on_midi", RUBY_METHOD_FUNC(on_midi), 1);
|
|
1386
|
+
rb_define_method(cView, "on_note", RUBY_METHOD_FUNC(on_note), 1);
|
|
1387
|
+
rb_define_method(cView, "on_note_on", RUBY_METHOD_FUNC(on_note_on), 1);
|
|
1388
|
+
rb_define_method(cView, "on_note_off", RUBY_METHOD_FUNC(on_note_off), 1);
|
|
1389
|
+
rb_define_method(cView, "on_control_change", RUBY_METHOD_FUNC(on_control_change), 1);
|
|
1336
1390
|
|
|
1337
1391
|
cView.define_const("CAPTURE_NONE", Reflex::View::CAPTURE_NONE);
|
|
1338
1392
|
cView.define_const("CAPTURE_KEY", Reflex::View::CAPTURE_KEY);
|
|
@@ -10,7 +10,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::WheelConstraint)
|
|
|
10
10
|
|
|
11
11
|
#define THIS to<Reflex::WheelConstraint*>(self)
|
|
12
12
|
|
|
13
|
-
#define CHECK
|
|
13
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::WheelConstraint, self)
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
static
|