reflexion 0.5.3 → 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 +56 -7
- data/.doc/ext/reflex/capture_event.cpp +1 -1
- data/.doc/ext/reflex/chase_constraint.cpp +84 -0
- data/.doc/ext/reflex/clipboard.cpp +65 -0
- data/.doc/ext/reflex/color_event.cpp +76 -0
- data/.doc/ext/reflex/color_picker.cpp +113 -0
- data/.doc/ext/reflex/constraint.cpp +135 -0
- 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 +178 -0
- data/.doc/ext/reflex/menu.cpp +303 -0
- 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 +40 -10
- data/.doc/ext/reflex/note_event.cpp +1 -1
- data/.doc/ext/reflex/pin.cpp +156 -0
- data/.doc/ext/reflex/pointer.cpp +3 -1
- data/.doc/ext/reflex/pointer_event.cpp +3 -3
- data/.doc/ext/reflex/polygon_shape.cpp +1 -1
- data/.doc/ext/reflex/rect_shape.cpp +1 -1
- data/.doc/ext/reflex/reflex.cpp +606 -237
- data/.doc/ext/reflex/screen.cpp +27 -1
- data/.doc/ext/reflex/scroll_event.cpp +1 -1
- data/.doc/ext/reflex/selector.cpp +5 -5
- data/.doc/ext/reflex/shape.cpp +1 -1
- data/.doc/ext/reflex/snap_constraint.cpp +125 -0
- data/.doc/ext/reflex/style.cpp +1 -1
- data/.doc/ext/reflex/style_length.cpp +4 -3
- 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 +206 -79
- data/.doc/ext/reflex/wheel_constraint.cpp +142 -0
- data/.doc/ext/reflex/wheel_event.cpp +1 -1
- data/.doc/ext/reflex/window.cpp +282 -31
- data/.github/workflows/release-gem.yml +2 -40
- data/.github/workflows/tag.yml +5 -28
- data/.github/workflows/test.yml +1 -28
- data/ChangeLog.md +79 -0
- data/Gemfile.lock +13 -8
- data/README.md +1 -0
- data/Rakefile +13 -2
- data/Reflex.podspec +2 -2
- data/VERSION +1 -1
- data/ext/reflex/application.cpp +62 -7
- data/ext/reflex/capture_event.cpp +1 -1
- data/ext/reflex/chase_constraint.cpp +89 -0
- data/ext/reflex/clipboard.cpp +69 -0
- data/ext/reflex/color_event.cpp +80 -0
- data/ext/reflex/color_picker.cpp +121 -0
- data/ext/reflex/constraint.cpp +146 -0
- 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 +194 -0
- data/ext/reflex/menu.cpp +331 -0
- 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 +40 -10
- data/ext/reflex/note_event.cpp +1 -1
- data/ext/reflex/pin.cpp +165 -0
- data/ext/reflex/pointer.cpp +3 -1
- data/ext/reflex/pointer_event.cpp +3 -3
- data/ext/reflex/polygon_shape.cpp +1 -1
- data/ext/reflex/rect_shape.cpp +1 -1
- data/ext/reflex/reflex.cpp +608 -237
- data/ext/reflex/screen.cpp +31 -2
- data/ext/reflex/scroll_event.cpp +1 -1
- data/ext/reflex/selector.cpp +5 -5
- data/ext/reflex/selector.h +10 -10
- data/ext/reflex/shape.cpp +1 -1
- data/ext/reflex/snap_constraint.cpp +135 -0
- data/ext/reflex/style.cpp +1 -1
- data/ext/reflex/style_length.cpp +4 -3
- 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 +236 -96
- data/ext/reflex/wheel_constraint.cpp +154 -0
- data/ext/reflex/wheel_event.cpp +1 -1
- data/ext/reflex/window.cpp +318 -40
- data/include/reflex/application.h +19 -0
- data/include/reflex/clipboard.h +53 -0
- data/include/reflex/color_picker.h +65 -0
- data/include/reflex/constraint.h +275 -0
- data/include/reflex/defs.h +204 -195
- data/include/reflex/event.h +180 -88
- data/include/reflex/file_dialog.h +73 -0
- data/include/reflex/gamepad.h +3 -0
- data/include/reflex/menu.h +120 -0
- data/include/reflex/midi.h +3 -0
- data/include/reflex/pin.h +68 -0
- data/include/reflex/pointer.h +4 -0
- data/include/reflex/reflex.h +2 -0
- data/include/reflex/ruby/application.h +6 -1
- data/include/reflex/ruby/clipboard.h +23 -0
- data/include/reflex/ruby/color_picker.h +89 -0
- data/include/reflex/ruby/constraint.h +94 -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/menu.h +103 -0
- data/include/reflex/ruby/pin.h +40 -0
- data/include/reflex/ruby/reflex.h +3 -0
- data/include/reflex/ruby/view.h +123 -39
- data/include/reflex/ruby/window.h +96 -19
- data/include/reflex/ruby.h +3 -0
- data/include/reflex/screen.h +11 -2
- data/include/reflex/view.h +66 -27
- data/include/reflex/window.h +57 -12
- data/include/reflex.h +8 -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/chase_constraint.rb +15 -0
- data/lib/reflex/clipboard.rb +19 -0
- data/lib/reflex/color_event.rb +16 -0
- data/lib/reflex/color_picker.rb +45 -0
- data/lib/reflex/constraint.rb +29 -0
- data/lib/reflex/control_change_event.rb +17 -0
- data/lib/reflex/extension.rb +1 -1
- data/lib/reflex/file_dialog.rb +70 -0
- data/lib/reflex/file_event.rb +37 -0
- data/lib/reflex/helper.rb +79 -0
- data/lib/reflex/key_event.rb +14 -14
- data/lib/reflex/link_constraint.rb +31 -0
- data/lib/reflex/menu.rb +92 -0
- data/lib/reflex/model.rb +19 -19
- data/lib/reflex/note_event.rb +1 -1
- data/lib/reflex/pin.rb +39 -0
- data/lib/reflex/pointer.rb +30 -1
- data/lib/reflex/pointer_event.rb +13 -2
- data/lib/reflex/reflex.rb +5 -0
- data/lib/reflex/shape.rb +14 -14
- data/lib/reflex/snap_constraint.rb +28 -0
- 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 +85 -18
- data/lib/reflex/wheel_constraint.rb +28 -0
- data/lib/reflex/wheel_event.rb +19 -1
- data/lib/reflex/window.rb +25 -13
- data/lib/reflex.rb +23 -8
- data/pod.rake +1 -1
- data/reflex.gemspec +4 -4
- data/samples/constraint.rb +152 -0
- data/samples/ime.rb +100 -0
- data/samples/ios/hello/hello.xcodeproj/project.pbxproj +236 -224
- data/samples/menu.rb +32 -0
- 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 +180 -20
- data/src/application.h +95 -5
- data/src/clipboard.cpp +81 -0
- data/src/color_picker.cpp +113 -0
- data/src/color_picker.h +36 -0
- data/src/constraint.cpp +1662 -0
- data/src/constraint.h +64 -0
- data/src/event.cpp +416 -252
- data/src/event.h +13 -2
- 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 +29 -0
- data/src/ios/clipboard.mm +44 -0
- data/src/ios/color_picker.mm +19 -0
- data/src/ios/event.h +6 -2
- data/src/ios/event.mm +31 -12
- data/src/ios/file_dialog.mm +21 -0
- data/src/ios/gamepad.mm +4 -4
- data/src/ios/menu.mm +41 -0
- data/src/ios/reflex.mm +8 -0
- data/src/ios/screen.mm +26 -0
- data/src/ios/view_controller.mm +47 -42
- data/src/ios/window.mm +44 -9
- data/src/menu.cpp +387 -0
- data/src/menu.h +81 -0
- data/src/midi.cpp +61 -31
- data/src/osx/app_delegate.h +4 -0
- data/src/osx/app_delegate.mm +168 -139
- data/src/osx/application.mm +103 -5
- data/src/osx/clipboard.mm +45 -0
- data/src/osx/color_picker.mm +112 -0
- data/src/osx/event.h +10 -0
- data/src/osx/event.mm +114 -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.h +25 -0
- data/src/osx/menu.mm +516 -0
- data/src/osx/native_window.h +16 -2
- data/src/osx/native_window.mm +141 -57
- data/src/osx/opengl_view.h +2 -1
- data/src/osx/opengl_view.mm +229 -37
- data/src/osx/reflex.mm +38 -0
- data/src/osx/screen.mm +36 -0
- data/src/osx/window.mm +117 -24
- data/src/pin.cpp +137 -0
- data/src/pointer.cpp +36 -16
- data/src/pointer.h +10 -0
- data/src/rays.h +46 -0
- data/src/sdl/application.cpp +73 -8
- data/src/sdl/clipboard.cpp +39 -0
- data/src/sdl/color_picker.cpp +18 -0
- data/src/sdl/event.cpp +44 -6
- data/src/sdl/event.h +18 -3
- data/src/sdl/file_dialog.cpp +20 -0
- data/src/sdl/gamepad.cpp +3 -7
- data/src/sdl/menu.cpp +40 -0
- data/src/sdl/reflex.cpp +20 -0
- data/src/sdl/screen.cpp +36 -0
- data/src/sdl/window.cpp +168 -37
- data/src/shape.cpp +15 -10
- data/src/view.cpp +583 -233
- data/src/view.h +22 -4
- data/src/vk.h +416 -0
- data/src/win32/application.cpp +167 -12
- data/src/win32/application.h +20 -0
- data/src/win32/clipboard.cpp +210 -0
- data/src/win32/color_picker.cpp +82 -0
- data/src/win32/event.cpp +123 -11
- data/src/win32/event.h +22 -3
- data/src/win32/file_dialog.cpp +226 -0
- data/src/win32/gamepad.cpp +9 -2
- data/src/win32/menu.cpp +490 -0
- data/src/win32/menu.h +35 -0
- 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 +858 -135
- data/src/win32/window.h +9 -0
- data/src/window.cpp +929 -183
- data/src/window.h +77 -33
- data/src/world.cpp +86 -15
- data/src/world.h +9 -2
- data/test/helper.rb +24 -0
- data/test/test_application.rb +101 -1
- data/test/test_chase_constraint.rb +122 -0
- data/test/test_clipboard.rb +54 -0
- data/test/test_color_event.rb +36 -0
- data/test/test_color_picker.rb +62 -0
- data/test/test_constraint.rb +184 -0
- 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 +23 -2
- data/test/test_link_constraint.rb +237 -0
- data/test/test_menu.rb +237 -0
- data/test/test_pin.rb +65 -0
- data/test/test_pointer.rb +50 -26
- data/test/test_pointer_event.rb +25 -10
- data/test/test_reflex.rb +36 -0
- data/test/test_screen.rb +24 -2
- data/test/test_snap_constraint.rb +140 -0
- data/test/test_text_event.rb +54 -0
- data/test/test_view.rb +152 -25
- data/test/test_wheel_constraint.rb +125 -0
- data/test/test_wheel_event.rb +24 -10
- data/test/test_window.rb +205 -43
- metadata +154 -10
- data/.github/workflows/utils.rb +0 -127
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_PIN_H__
|
|
4
|
+
#define __REFLEX_PIN_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <xot/pimpl.h>
|
|
8
|
+
#include <rays/point.h>
|
|
9
|
+
#include <reflex/defs.h>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
namespace Reflex
|
|
13
|
+
{
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class View;
|
|
17
|
+
class SnapConstraint;
|
|
18
|
+
class LinkConstraint;
|
|
19
|
+
class WheelConstraint;
|
|
20
|
+
class ChaseConstraint;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Pin
|
|
24
|
+
{
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
|
|
28
|
+
Pin ();
|
|
29
|
+
|
|
30
|
+
Pin (coord x, coord y);
|
|
31
|
+
|
|
32
|
+
Pin (const Point& position);
|
|
33
|
+
|
|
34
|
+
Pin (View* view);
|
|
35
|
+
|
|
36
|
+
Pin (View* view, coord x, coord y);
|
|
37
|
+
|
|
38
|
+
Pin (View* view, const Point& position);
|
|
39
|
+
|
|
40
|
+
SnapConstraint* snap (Pin target = Pin());
|
|
41
|
+
|
|
42
|
+
LinkConstraint* link (Pin target = Pin());
|
|
43
|
+
|
|
44
|
+
WheelConstraint* wheel (Pin target = Pin());
|
|
45
|
+
|
|
46
|
+
ChaseConstraint* chase (Pin target = Pin());
|
|
47
|
+
|
|
48
|
+
View* view ();
|
|
49
|
+
|
|
50
|
+
const View* view () const;
|
|
51
|
+
|
|
52
|
+
const Point* position () const;
|
|
53
|
+
|
|
54
|
+
operator bool () const;
|
|
55
|
+
|
|
56
|
+
bool operator ! () const;
|
|
57
|
+
|
|
58
|
+
struct Data;
|
|
59
|
+
|
|
60
|
+
Xot::PSharedImpl<Data> self;
|
|
61
|
+
|
|
62
|
+
};// Pin
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
}// Reflex
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#endif//EOH
|
data/include/reflex/pointer.h
CHANGED
data/include/reflex/reflex.h
CHANGED
|
@@ -49,9 +49,14 @@ namespace Reflex
|
|
|
49
49
|
|
|
50
50
|
virtual void on_start (Event* e)
|
|
51
51
|
{
|
|
52
|
-
RUCY_SYM(on_start);
|
|
53
52
|
if (this->is_overridable())
|
|
53
|
+
{
|
|
54
|
+
RUCY_SYM(call_start_block);
|
|
55
|
+
this->value.call(call_start_block);
|
|
56
|
+
|
|
57
|
+
RUCY_SYM(on_start);
|
|
54
58
|
this->value.call(on_start, Rucy::value(e));
|
|
59
|
+
}
|
|
55
60
|
else
|
|
56
61
|
return Super::on_start(e);
|
|
57
62
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_CLIPBOARD_H__
|
|
4
|
+
#define __REFLEX_RUBY_CLIPBOARD_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/clipboard.h>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
namespace Reflex
|
|
13
|
+
{
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
REFLEX_EXPORT Rucy::Class clipboard_class ();
|
|
17
|
+
// class Reflex::Clipboard
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
}// Reflex
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#endif//EOH
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_COLOR_PICKER_H__
|
|
4
|
+
#define __REFLEX_RUBY_COLOR_PICKER_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/color_picker.h>
|
|
10
|
+
#include <reflex/ruby/event.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ColorPicker)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
namespace Reflex
|
|
17
|
+
{
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
REFLEX_EXPORT Rucy::Class color_picker_class ();
|
|
21
|
+
// class Reflex::ColorPicker
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
template <typename T>
|
|
25
|
+
class RubyColorPicker : public Rucy::ClassWrapper<T>
|
|
26
|
+
{
|
|
27
|
+
|
|
28
|
+
typedef Rucy::ClassWrapper<T> Super;
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
|
|
32
|
+
virtual void on_color (ColorEvent* e)
|
|
33
|
+
{
|
|
34
|
+
if (this->is_overridable())
|
|
35
|
+
{
|
|
36
|
+
RUCY_SYM(call_color_block);
|
|
37
|
+
this->value.call(call_color_block, Rucy::value(e));
|
|
38
|
+
|
|
39
|
+
if (!e->is_blocked())
|
|
40
|
+
{
|
|
41
|
+
RUCY_SYM(on_color);
|
|
42
|
+
this->value.call(on_color, Rucy::value(e));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
Super::on_color(e);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
virtual void on_close (Event* e)
|
|
50
|
+
{
|
|
51
|
+
if (this->is_overridable())
|
|
52
|
+
{
|
|
53
|
+
RUCY_SYM(clear_color_block);
|
|
54
|
+
this->value.call(clear_color_block);
|
|
55
|
+
|
|
56
|
+
RUCY_SYM(on_close);
|
|
57
|
+
this->value.call(on_close, Rucy::value(e));
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
Super::on_close(e);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
};// RubyColorPicker
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
}// Reflex
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
namespace Rucy
|
|
70
|
+
{
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
template <> inline Class
|
|
74
|
+
get_ruby_class<Reflex::ColorPicker> ()
|
|
75
|
+
{
|
|
76
|
+
return Reflex::color_picker_class();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
inline Value
|
|
80
|
+
value (Reflex::ColorPicker::Ref& ref, Value klass = Reflex::color_picker_class())
|
|
81
|
+
{
|
|
82
|
+
return value(ref.get(), klass);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
}// Rucy
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
#endif//EOH
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_CONSTRAINT_H__
|
|
4
|
+
#define __REFLEX_RUBY_CONSTRAINT_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/constraint.h>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Constraint)
|
|
13
|
+
|
|
14
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::SnapConstraint)
|
|
15
|
+
|
|
16
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::LinkConstraint)
|
|
17
|
+
|
|
18
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::WheelConstraint)
|
|
19
|
+
|
|
20
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ChaseConstraint)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
namespace Reflex
|
|
24
|
+
{
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
template <typename T>
|
|
28
|
+
class RubyConstraint : public Rucy::ClassWrapper<T> {};
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
REFLEX_EXPORT Rucy::Class constraint_class ();
|
|
32
|
+
// class Reflex::Constraint
|
|
33
|
+
|
|
34
|
+
REFLEX_EXPORT Rucy::Class snap_constraint_class ();
|
|
35
|
+
// class Reflex::SnapConstraint
|
|
36
|
+
|
|
37
|
+
REFLEX_EXPORT Rucy::Class link_constraint_class ();
|
|
38
|
+
// class Reflex::LinkConstraint
|
|
39
|
+
|
|
40
|
+
REFLEX_EXPORT Rucy::Class wheel_constraint_class ();
|
|
41
|
+
// class Reflex::WheelConstraint
|
|
42
|
+
|
|
43
|
+
REFLEX_EXPORT Rucy::Class chase_constraint_class ();
|
|
44
|
+
// class Reflex::ChaseConstraint
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
}// Reflex
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
namespace Rucy
|
|
51
|
+
{
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
template <> inline Class
|
|
55
|
+
get_ruby_class<Reflex::Constraint> ()
|
|
56
|
+
{
|
|
57
|
+
return Reflex::constraint_class();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
template <> inline Class
|
|
61
|
+
get_ruby_class<Reflex::SnapConstraint> ()
|
|
62
|
+
{
|
|
63
|
+
return Reflex::snap_constraint_class();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
template <> inline Class
|
|
67
|
+
get_ruby_class<Reflex::LinkConstraint> ()
|
|
68
|
+
{
|
|
69
|
+
return Reflex::link_constraint_class();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
template <> inline Class
|
|
73
|
+
get_ruby_class<Reflex::WheelConstraint> ()
|
|
74
|
+
{
|
|
75
|
+
return Reflex::wheel_constraint_class();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
template <> inline Class
|
|
79
|
+
get_ruby_class<Reflex::ChaseConstraint> ()
|
|
80
|
+
{
|
|
81
|
+
return Reflex::chase_constraint_class();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
inline Value
|
|
85
|
+
value (Reflex::Constraint::Ref& ref, Value klass = Reflex::constraint_class())
|
|
86
|
+
{
|
|
87
|
+
return value(ref.get(), klass);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
}// Rucy
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
#endif//EOH
|
data/include/reflex/ruby/event.h
CHANGED
|
@@ -25,16 +25,12 @@ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FocusEvent)
|
|
|
25
25
|
|
|
26
26
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::KeyEvent)
|
|
27
27
|
|
|
28
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::TextEvent)
|
|
29
|
+
|
|
28
30
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::PointerEvent)
|
|
29
31
|
|
|
30
32
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::WheelEvent)
|
|
31
33
|
|
|
32
|
-
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MIDIEvent)
|
|
33
|
-
|
|
34
|
-
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::NoteEvent)
|
|
35
|
-
|
|
36
|
-
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ControlChangeEvent)
|
|
37
|
-
|
|
38
34
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::CaptureEvent)
|
|
39
35
|
|
|
40
36
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::TimerEvent)
|
|
@@ -43,6 +39,16 @@ RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ContactEvent)
|
|
|
43
39
|
|
|
44
40
|
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MotionEvent)
|
|
45
41
|
|
|
42
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FileEvent)
|
|
43
|
+
|
|
44
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ColorEvent)
|
|
45
|
+
|
|
46
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::MIDIEvent)
|
|
47
|
+
|
|
48
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::NoteEvent)
|
|
49
|
+
|
|
50
|
+
RUCY_DECLARE_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::ControlChangeEvent)
|
|
51
|
+
|
|
46
52
|
|
|
47
53
|
namespace Reflex
|
|
48
54
|
{
|
|
@@ -72,21 +78,15 @@ namespace Reflex
|
|
|
72
78
|
REFLEX_EXPORT Rucy::Class key_event_class ();
|
|
73
79
|
// class Reflex::KeyEvent
|
|
74
80
|
|
|
81
|
+
REFLEX_EXPORT Rucy::Class text_event_class ();
|
|
82
|
+
// class Reflex::TextEvent
|
|
83
|
+
|
|
75
84
|
REFLEX_EXPORT Rucy::Class pointer_event_class ();
|
|
76
85
|
// class Reflex::PointerEvent
|
|
77
86
|
|
|
78
87
|
REFLEX_EXPORT Rucy::Class wheel_event_class ();
|
|
79
88
|
// class Reflex::WheelEvent
|
|
80
89
|
|
|
81
|
-
REFLEX_EXPORT Rucy::Class midi_event_class ();
|
|
82
|
-
// class Reflex::MIDIEvent
|
|
83
|
-
|
|
84
|
-
REFLEX_EXPORT Rucy::Class note_event_class ();
|
|
85
|
-
// class Reflex::NoteEvent
|
|
86
|
-
|
|
87
|
-
REFLEX_EXPORT Rucy::Class control_change_event_class ();
|
|
88
|
-
// class Reflex::ControlChangeEvent
|
|
89
|
-
|
|
90
90
|
REFLEX_EXPORT Rucy::Class capture_event_class ();
|
|
91
91
|
// class Reflex::CaptureEvent
|
|
92
92
|
|
|
@@ -99,6 +99,21 @@ namespace Reflex
|
|
|
99
99
|
REFLEX_EXPORT Rucy::Class motion_event_class ();
|
|
100
100
|
// class Reflex::MotionEvent
|
|
101
101
|
|
|
102
|
+
REFLEX_EXPORT Rucy::Class file_event_class ();
|
|
103
|
+
// class Reflex::FileEvent
|
|
104
|
+
|
|
105
|
+
REFLEX_EXPORT Rucy::Class color_event_class ();
|
|
106
|
+
// class Reflex::ColorEvent
|
|
107
|
+
|
|
108
|
+
REFLEX_EXPORT Rucy::Class midi_event_class ();
|
|
109
|
+
// class Reflex::MIDIEvent
|
|
110
|
+
|
|
111
|
+
REFLEX_EXPORT Rucy::Class note_event_class ();
|
|
112
|
+
// class Reflex::NoteEvent
|
|
113
|
+
|
|
114
|
+
REFLEX_EXPORT Rucy::Class control_change_event_class ();
|
|
115
|
+
// class Reflex::ControlChangeEvent
|
|
116
|
+
|
|
102
117
|
|
|
103
118
|
}// Reflex
|
|
104
119
|
|
|
@@ -155,6 +170,12 @@ namespace Rucy
|
|
|
155
170
|
return Reflex::key_event_class();
|
|
156
171
|
}
|
|
157
172
|
|
|
173
|
+
template <> inline Class
|
|
174
|
+
get_ruby_class<Reflex::TextEvent> ()
|
|
175
|
+
{
|
|
176
|
+
return Reflex::text_event_class();
|
|
177
|
+
}
|
|
178
|
+
|
|
158
179
|
template <> inline Class
|
|
159
180
|
get_ruby_class<Reflex::PointerEvent> ()
|
|
160
181
|
{
|
|
@@ -168,45 +189,57 @@ namespace Rucy
|
|
|
168
189
|
}
|
|
169
190
|
|
|
170
191
|
template <> inline Class
|
|
171
|
-
get_ruby_class<Reflex::
|
|
192
|
+
get_ruby_class<Reflex::CaptureEvent> ()
|
|
172
193
|
{
|
|
173
|
-
return Reflex::
|
|
194
|
+
return Reflex::capture_event_class();
|
|
174
195
|
}
|
|
175
196
|
|
|
176
197
|
template <> inline Class
|
|
177
|
-
get_ruby_class<Reflex::
|
|
198
|
+
get_ruby_class<Reflex::TimerEvent> ()
|
|
178
199
|
{
|
|
179
|
-
return Reflex::
|
|
200
|
+
return Reflex::timer_event_class();
|
|
180
201
|
}
|
|
181
202
|
|
|
182
203
|
template <> inline Class
|
|
183
|
-
get_ruby_class<Reflex::
|
|
204
|
+
get_ruby_class<Reflex::ContactEvent> ()
|
|
184
205
|
{
|
|
185
|
-
return Reflex::
|
|
206
|
+
return Reflex::contact_event_class();
|
|
186
207
|
}
|
|
187
208
|
|
|
188
209
|
template <> inline Class
|
|
189
|
-
get_ruby_class<Reflex::
|
|
210
|
+
get_ruby_class<Reflex::MotionEvent> ()
|
|
190
211
|
{
|
|
191
|
-
return Reflex::
|
|
212
|
+
return Reflex::motion_event_class();
|
|
192
213
|
}
|
|
193
214
|
|
|
194
215
|
template <> inline Class
|
|
195
|
-
get_ruby_class<Reflex::
|
|
216
|
+
get_ruby_class<Reflex::FileEvent> ()
|
|
196
217
|
{
|
|
197
|
-
return Reflex::
|
|
218
|
+
return Reflex::file_event_class();
|
|
198
219
|
}
|
|
199
220
|
|
|
200
221
|
template <> inline Class
|
|
201
|
-
get_ruby_class<Reflex::
|
|
222
|
+
get_ruby_class<Reflex::ColorEvent> ()
|
|
202
223
|
{
|
|
203
|
-
return Reflex::
|
|
224
|
+
return Reflex::color_event_class();
|
|
204
225
|
}
|
|
205
226
|
|
|
206
227
|
template <> inline Class
|
|
207
|
-
get_ruby_class<Reflex::
|
|
228
|
+
get_ruby_class<Reflex::MIDIEvent> ()
|
|
208
229
|
{
|
|
209
|
-
return Reflex::
|
|
230
|
+
return Reflex::midi_event_class();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
template <> inline Class
|
|
234
|
+
get_ruby_class<Reflex::NoteEvent> ()
|
|
235
|
+
{
|
|
236
|
+
return Reflex::note_event_class();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
template <> inline Class
|
|
240
|
+
get_ruby_class<Reflex::ControlChangeEvent> ()
|
|
241
|
+
{
|
|
242
|
+
return Reflex::control_change_event_class();
|
|
210
243
|
}
|
|
211
244
|
|
|
212
245
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_FILE_DIALOG_H__
|
|
4
|
+
#define __REFLEX_RUBY_FILE_DIALOG_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/file_dialog.h>
|
|
10
|
+
#include <reflex/ruby/event.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::FileDialog)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
namespace Reflex
|
|
17
|
+
{
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
REFLEX_EXPORT Rucy::Class file_dialog_class ();
|
|
21
|
+
// class Reflex::FileDialog
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
template <typename T>
|
|
25
|
+
class RubyFileDialog : public Rucy::ClassWrapper<T>
|
|
26
|
+
{
|
|
27
|
+
|
|
28
|
+
typedef Rucy::ClassWrapper<T> Super;
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
|
|
32
|
+
virtual void on_file (FileEvent* e)
|
|
33
|
+
{
|
|
34
|
+
if (this->is_overridable())
|
|
35
|
+
{
|
|
36
|
+
RUCY_SYM(call_file_block);
|
|
37
|
+
this->value.call(call_file_block, Rucy::value(e));
|
|
38
|
+
|
|
39
|
+
if (!e->is_blocked())
|
|
40
|
+
{
|
|
41
|
+
RUCY_SYM(on_file);
|
|
42
|
+
this->value.call(on_file, Rucy::value(e));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
Super::on_file(e);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
virtual void on_cancel (Event* e)
|
|
50
|
+
{
|
|
51
|
+
if (this->is_overridable())
|
|
52
|
+
{
|
|
53
|
+
RUCY_SYM(call_cancel_block);
|
|
54
|
+
this->value.call(call_cancel_block);
|
|
55
|
+
|
|
56
|
+
RUCY_SYM(on_cancel);
|
|
57
|
+
this->value.call(on_cancel, Rucy::value(e));
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
Super::on_cancel(e);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
};// RubyFileDialog
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
}// Reflex
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
namespace Rucy
|
|
70
|
+
{
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
template <> inline Class
|
|
74
|
+
get_ruby_class<Reflex::FileDialog> ()
|
|
75
|
+
{
|
|
76
|
+
return Reflex::file_dialog_class();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
inline Value
|
|
80
|
+
value (Reflex::FileDialog::Ref& ref, Value klass = Reflex::file_dialog_class())
|
|
81
|
+
{
|
|
82
|
+
return value(ref.get(), klass);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
}// Rucy
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
#endif//EOH
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_GAMEPAD_H__
|
|
4
|
+
#define __REFLEX_RUBY_GAMEPAD_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/gamepad.h>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Gamepad)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace Reflex
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
REFLEX_EXPORT Rucy::Class gamepad_class ();
|
|
20
|
+
// class Reflex::Gamepad
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
}// Reflex
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
namespace Rucy
|
|
27
|
+
{
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
template <> inline Class
|
|
31
|
+
get_ruby_class<Reflex::Gamepad> ()
|
|
32
|
+
{
|
|
33
|
+
return Reflex::gamepad_class();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
inline Value
|
|
37
|
+
value (Reflex::Gamepad::Ref& ref, Value klass = Reflex::gamepad_class())
|
|
38
|
+
{
|
|
39
|
+
return value(ref.get(), klass);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
}// Rucy
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
#endif//EOH
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// -*- c++ -*-
|
|
2
|
+
#pragma once
|
|
3
|
+
#ifndef __REFLEX_RUBY_MENU_H__
|
|
4
|
+
#define __REFLEX_RUBY_MENU_H__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#include <rucy/class.h>
|
|
8
|
+
#include <rucy/extension.h>
|
|
9
|
+
#include <reflex/menu.h>
|
|
10
|
+
#include <reflex/ruby/event.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Menu)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
namespace Reflex
|
|
17
|
+
{
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
REFLEX_EXPORT Rucy::Class menu_class ();
|
|
21
|
+
// class Reflex::Menu
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
template <typename T>
|
|
25
|
+
class RubyMenu : public Rucy::ClassWrapper<T>
|
|
26
|
+
{
|
|
27
|
+
|
|
28
|
+
typedef Rucy::ClassWrapper<T> Super;
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
|
|
32
|
+
virtual void on_show (Event* e)
|
|
33
|
+
{
|
|
34
|
+
RUCY_SYM(on_show);
|
|
35
|
+
if (this->is_overridable())
|
|
36
|
+
this->value.call(on_show, Rucy::value(e));
|
|
37
|
+
else
|
|
38
|
+
Super::on_show(e);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
virtual void on_hide (Event* e)
|
|
42
|
+
{
|
|
43
|
+
RUCY_SYM(on_hide);
|
|
44
|
+
if (this->is_overridable())
|
|
45
|
+
this->value.call(on_hide, Rucy::value(e));
|
|
46
|
+
else
|
|
47
|
+
Super::on_hide(e);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
virtual void on_open_submenu (Event* e)
|
|
51
|
+
{
|
|
52
|
+
RUCY_SYM(on_open_submenu);
|
|
53
|
+
if (this->is_overridable())
|
|
54
|
+
this->value.call(on_open_submenu, Rucy::value(e));
|
|
55
|
+
else
|
|
56
|
+
Super::on_open_submenu(e);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
virtual void on_close_submenu (Event* e)
|
|
60
|
+
{
|
|
61
|
+
RUCY_SYM(on_close_submenu);
|
|
62
|
+
if (this->is_overridable())
|
|
63
|
+
this->value.call(on_close_submenu, Rucy::value(e));
|
|
64
|
+
else
|
|
65
|
+
Super::on_close_submenu(e);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
virtual void on_click (Event* e)
|
|
69
|
+
{
|
|
70
|
+
RUCY_SYM(on_click);
|
|
71
|
+
if (this->is_overridable())
|
|
72
|
+
this->value.call(on_click, Rucy::value(e));
|
|
73
|
+
else
|
|
74
|
+
Super::on_click(e);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
};// RubyMenu
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}// Reflex
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
namespace Rucy
|
|
84
|
+
{
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
template <> inline Class
|
|
88
|
+
get_ruby_class<Reflex::Menu> ()
|
|
89
|
+
{
|
|
90
|
+
return Reflex::menu_class();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
inline Value
|
|
94
|
+
value (Reflex::Menu::Ref& ref, Value klass = Reflex::menu_class())
|
|
95
|
+
{
|
|
96
|
+
return value(ref.get(), klass);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
}// Rucy
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
#endif//EOH
|