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,142 @@
|
|
|
1
|
+
#include "reflex/ruby/constraint.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
#include <rays/ruby/point.h>
|
|
5
|
+
#include "reflex/exception.h"
|
|
6
|
+
#include "defs.h"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::WheelConstraint)
|
|
10
|
+
|
|
11
|
+
#define THIS to<Reflex::WheelConstraint*>(self)
|
|
12
|
+
|
|
13
|
+
#define CHECK RUCY_CHECK_PTR(Reflex::WheelConstraint, self)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
static
|
|
17
|
+
VALUE alloc(VALUE klass)
|
|
18
|
+
{
|
|
19
|
+
Reflex::reflex_error(
|
|
20
|
+
__FILE__, __LINE__, "can not instantiate WheelConstraint class");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static
|
|
24
|
+
VALUE set_axis(VALUE self)
|
|
25
|
+
{
|
|
26
|
+
CHECK;
|
|
27
|
+
THIS->set_axis(to<Rays::Point>(argc, argv));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static
|
|
31
|
+
VALUE get_axis(VALUE self)
|
|
32
|
+
{
|
|
33
|
+
CHECK;
|
|
34
|
+
return value(THIS->axis());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static
|
|
38
|
+
VALUE set_range(VALUE self, VALUE min, VALUE max)
|
|
39
|
+
{
|
|
40
|
+
CHECK;
|
|
41
|
+
THIS->set_range(to<coord>(min), to<coord>(max));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static
|
|
45
|
+
VALUE clear_range(VALUE self)
|
|
46
|
+
{
|
|
47
|
+
CHECK;
|
|
48
|
+
THIS->clear_range();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static
|
|
52
|
+
VALUE range_min(VALUE self)
|
|
53
|
+
{
|
|
54
|
+
CHECK;
|
|
55
|
+
return value(THIS->range_min());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static
|
|
59
|
+
VALUE range_max(VALUE self)
|
|
60
|
+
{
|
|
61
|
+
CHECK;
|
|
62
|
+
return value(THIS->range_max());
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static
|
|
66
|
+
VALUE has_range(VALUE self)
|
|
67
|
+
{
|
|
68
|
+
CHECK;
|
|
69
|
+
return value(THIS->has_range());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static
|
|
73
|
+
VALUE set_motor(VALUE self, VALUE degrees_per_second)
|
|
74
|
+
{
|
|
75
|
+
CHECK;
|
|
76
|
+
if (degrees_per_second.is_nil())
|
|
77
|
+
THIS->clear_motor();
|
|
78
|
+
else
|
|
79
|
+
THIS->set_motor(to<float>(degrees_per_second));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static
|
|
83
|
+
VALUE get_motor(VALUE self)
|
|
84
|
+
{
|
|
85
|
+
CHECK;
|
|
86
|
+
return THIS->has_motor() ? value(THIS->motor()) : nil();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static
|
|
90
|
+
VALUE set_force(VALUE self, VALUE max_torque)
|
|
91
|
+
{
|
|
92
|
+
CHECK;
|
|
93
|
+
if (max_torque.is_nil())
|
|
94
|
+
THIS->clear_force();
|
|
95
|
+
else
|
|
96
|
+
THIS->set_force(to<float>(max_torque));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static
|
|
100
|
+
VALUE get_force(VALUE self)
|
|
101
|
+
{
|
|
102
|
+
CHECK;
|
|
103
|
+
return THIS->has_force() ? value(THIS->force()) : nil();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
static Class cWheelConstraint;
|
|
108
|
+
|
|
109
|
+
void
|
|
110
|
+
Init_reflex_wheel_constraint ()
|
|
111
|
+
{
|
|
112
|
+
Module mReflex = rb_define_module("Reflex");
|
|
113
|
+
|
|
114
|
+
cWheelConstraint = mReflex.define_class(
|
|
115
|
+
"WheelConstraint", Reflex::constraint_class());
|
|
116
|
+
rb_define_alloc_func(cWheelConstraint, alloc);
|
|
117
|
+
rb_define_method(cWheelConstraint, "axis=", RUBY_METHOD_FUNC(set_axis), -1);
|
|
118
|
+
rb_define_method(cWheelConstraint, "axis", RUBY_METHOD_FUNC(get_axis), 0);
|
|
119
|
+
cWheelConstraint.define_private_method( "set_range!", set_range);
|
|
120
|
+
cWheelConstraint.define_private_method("clear_range!", clear_range);
|
|
121
|
+
cWheelConstraint.define_private_method( "range_min!", range_min);
|
|
122
|
+
cWheelConstraint.define_private_method( "range_max!", range_max);
|
|
123
|
+
cWheelConstraint.define_private_method( "has_range!", has_range);
|
|
124
|
+
rb_define_method(cWheelConstraint, "motor=", RUBY_METHOD_FUNC(set_motor), 1);
|
|
125
|
+
rb_define_method(cWheelConstraint, "motor", RUBY_METHOD_FUNC(get_motor), 0);
|
|
126
|
+
rb_define_method(cWheelConstraint, "force=", RUBY_METHOD_FUNC(set_force), 1);
|
|
127
|
+
rb_define_method(cWheelConstraint, "force", RUBY_METHOD_FUNC(get_force), 0);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
namespace Reflex
|
|
132
|
+
{
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
Class
|
|
136
|
+
wheel_constraint_class ()
|
|
137
|
+
{
|
|
138
|
+
return cWheelConstraint;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
}// Reflex
|
data/.doc/ext/reflex/window.cpp
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
#include <rays/ruby/bounds.h>
|
|
5
5
|
#include <rays/ruby/painter.h>
|
|
6
|
-
#include "reflex/ruby/screen.h"
|
|
7
6
|
#include "reflex/ruby/view.h"
|
|
7
|
+
#include "reflex/ruby/menu.h"
|
|
8
|
+
#include "reflex/ruby/screen.h"
|
|
8
9
|
#include "defs.h"
|
|
9
10
|
|
|
10
11
|
|
|
@@ -12,7 +13,8 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, Reflex::Window)
|
|
|
12
13
|
|
|
13
14
|
#define THIS to<Reflex::Window*>(self)
|
|
14
15
|
|
|
15
|
-
#define
|
|
16
|
+
#define CHECK_PTR RUCY_CHECK_PTR(Reflex::Window, self)
|
|
17
|
+
#define CHECK RUCY_CHECK_OBJ(Reflex::Window, self)
|
|
16
18
|
|
|
17
19
|
#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
|
|
18
20
|
|
|
@@ -40,7 +42,7 @@ VALUE hide(VALUE self)
|
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
static
|
|
43
|
-
VALUE
|
|
45
|
+
VALUE is_hidden(VALUE self)
|
|
44
46
|
{
|
|
45
47
|
CHECK;
|
|
46
48
|
return value(THIS->hidden());
|
|
@@ -49,8 +51,8 @@ VALUE hidden(VALUE self)
|
|
|
49
51
|
static
|
|
50
52
|
VALUE close(VALUE self)
|
|
51
53
|
{
|
|
52
|
-
|
|
53
|
-
THIS->close();
|
|
54
|
+
CHECK_PTR;
|
|
55
|
+
if (*THIS) THIS->close();
|
|
54
56
|
return self;
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -76,6 +78,13 @@ VALUE to_screen(VALUE self, VALUE point)
|
|
|
76
78
|
return value(THIS->to_screen(to<Rays::Point>(point)));
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
static
|
|
82
|
+
VALUE is_active(VALUE self)
|
|
83
|
+
{
|
|
84
|
+
CHECK;
|
|
85
|
+
return value(THIS->active());
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
static
|
|
80
89
|
VALUE set_title(VALUE self, VALUE title)
|
|
81
90
|
{
|
|
@@ -106,6 +115,21 @@ VALUE get_frame(VALUE self)
|
|
|
106
115
|
return value(THIS->frame());
|
|
107
116
|
}
|
|
108
117
|
|
|
118
|
+
static
|
|
119
|
+
VALUE set_menu(VALUE self, VALUE menu)
|
|
120
|
+
{
|
|
121
|
+
CHECK;
|
|
122
|
+
THIS->set_menu(menu ? to<Reflex::Menu*>(menu) : NULL);
|
|
123
|
+
return menu;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
static
|
|
127
|
+
VALUE get_menu(VALUE self)
|
|
128
|
+
{
|
|
129
|
+
CHECK;
|
|
130
|
+
return value(THIS->menu());
|
|
131
|
+
}
|
|
132
|
+
|
|
109
133
|
static
|
|
110
134
|
VALUE set_closable(VALUE self, VALUE state)
|
|
111
135
|
{
|
|
@@ -166,6 +190,80 @@ VALUE is_resizable(VALUE self)
|
|
|
166
190
|
return value(THIS->has_flag(Reflex::Window::FLAG_RESIZABLE));
|
|
167
191
|
}
|
|
168
192
|
|
|
193
|
+
static const uint TITLEBAR_MASK =
|
|
194
|
+
Reflex::Window::FLAG_TITLEBAR_BUTTONS |
|
|
195
|
+
Reflex::Window::FLAG_TITLEBAR_BACKGROUND;
|
|
196
|
+
|
|
197
|
+
static
|
|
198
|
+
VALUE set_titlebar(VALUE self, VALUE titlebar)
|
|
199
|
+
{
|
|
200
|
+
CHECK;
|
|
201
|
+
|
|
202
|
+
uint flags = to<uint>(titlebar);
|
|
203
|
+
THIS->set_flags((flags & TITLEBAR_MASK) | (THIS->flags() & ~TITLEBAR_MASK));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static
|
|
207
|
+
VALUE get_titlebar(VALUE self)
|
|
208
|
+
{
|
|
209
|
+
CHECK;
|
|
210
|
+
return value(THIS->flags() & TITLEBAR_MASK);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
static
|
|
214
|
+
VALUE set_unlisted(VALUE self, VALUE state)
|
|
215
|
+
{
|
|
216
|
+
CHECK;
|
|
217
|
+
|
|
218
|
+
if (state)
|
|
219
|
+
THIS-> add_flag(Reflex::Window::FLAG_UNLISTED);
|
|
220
|
+
else
|
|
221
|
+
THIS->remove_flag(Reflex::Window::FLAG_UNLISTED);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
static
|
|
225
|
+
VALUE is_unlisted(VALUE self)
|
|
226
|
+
{
|
|
227
|
+
CHECK;
|
|
228
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_UNLISTED));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
static
|
|
232
|
+
VALUE set_shadow(VALUE self, VALUE state)
|
|
233
|
+
{
|
|
234
|
+
CHECK;
|
|
235
|
+
|
|
236
|
+
if (state)
|
|
237
|
+
THIS-> add_flag(Reflex::Window::FLAG_SHADOW);
|
|
238
|
+
else
|
|
239
|
+
THIS->remove_flag(Reflex::Window::FLAG_SHADOW);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
static
|
|
243
|
+
VALUE has_shadow(VALUE self)
|
|
244
|
+
{
|
|
245
|
+
CHECK;
|
|
246
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_SHADOW));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
static
|
|
250
|
+
VALUE set_transparent(VALUE self, VALUE state)
|
|
251
|
+
{
|
|
252
|
+
CHECK;
|
|
253
|
+
|
|
254
|
+
if (state)
|
|
255
|
+
THIS-> add_flag(Reflex::Window::FLAG_TRANSPARENT);
|
|
256
|
+
else
|
|
257
|
+
THIS->remove_flag(Reflex::Window::FLAG_TRANSPARENT);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static
|
|
261
|
+
VALUE is_transparent(VALUE self)
|
|
262
|
+
{
|
|
263
|
+
CHECK;
|
|
264
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_TRANSPARENT));
|
|
265
|
+
}
|
|
266
|
+
|
|
169
267
|
static
|
|
170
268
|
VALUE set_fullscreen(VALUE self, VALUE state)
|
|
171
269
|
{
|
|
@@ -186,18 +284,90 @@ VALUE is_fullscreen(VALUE self)
|
|
|
186
284
|
return value(THIS->has_flag(Reflex::Window::FLAG_FULLSCREEN));
|
|
187
285
|
}
|
|
188
286
|
|
|
287
|
+
static
|
|
288
|
+
VALUE set_always_on_top(VALUE self, VALUE state)
|
|
289
|
+
{
|
|
290
|
+
CHECK;
|
|
291
|
+
|
|
292
|
+
if (state)
|
|
293
|
+
{
|
|
294
|
+
THIS->remove_flag(Reflex::Window::FLAG_ALWAYS_ON_BOTTOM);
|
|
295
|
+
THIS-> add_flag(Reflex::Window::FLAG_ALWAYS_ON_TOP);
|
|
296
|
+
}
|
|
297
|
+
else
|
|
298
|
+
THIS->remove_flag(Reflex::Window::FLAG_ALWAYS_ON_TOP);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
static
|
|
302
|
+
VALUE is_always_on_top(VALUE self)
|
|
303
|
+
{
|
|
304
|
+
CHECK;
|
|
305
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_ALWAYS_ON_TOP));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
static
|
|
309
|
+
VALUE set_always_on_bottom(VALUE self, VALUE state)
|
|
310
|
+
{
|
|
311
|
+
CHECK;
|
|
312
|
+
|
|
313
|
+
if (state)
|
|
314
|
+
{
|
|
315
|
+
THIS->remove_flag(Reflex::Window::FLAG_ALWAYS_ON_TOP);
|
|
316
|
+
THIS-> add_flag(Reflex::Window::FLAG_ALWAYS_ON_BOTTOM);
|
|
317
|
+
}
|
|
318
|
+
else
|
|
319
|
+
THIS->remove_flag(Reflex::Window::FLAG_ALWAYS_ON_BOTTOM);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
static
|
|
323
|
+
VALUE is_always_on_bottom(VALUE self)
|
|
324
|
+
{
|
|
325
|
+
CHECK;
|
|
326
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_ALWAYS_ON_BOTTOM));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
static
|
|
330
|
+
VALUE set_pointer_through(VALUE self, VALUE state)
|
|
331
|
+
{
|
|
332
|
+
CHECK;
|
|
333
|
+
|
|
334
|
+
if (state)
|
|
335
|
+
THIS-> add_flag(Reflex::Window::FLAG_POINTER_THROUGH);
|
|
336
|
+
else
|
|
337
|
+
THIS->remove_flag(Reflex::Window::FLAG_POINTER_THROUGH);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static
|
|
341
|
+
VALUE is_pointer_through(VALUE self)
|
|
342
|
+
{
|
|
343
|
+
CHECK;
|
|
344
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_POINTER_THROUGH));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
static
|
|
348
|
+
VALUE set_pointer_through_alpha(VALUE self, VALUE alpha)
|
|
349
|
+
{
|
|
350
|
+
CHECK;
|
|
351
|
+
THIS->set_pointer_through_alpha(to<float>(alpha));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
static
|
|
355
|
+
VALUE get_pointer_through_alpha(VALUE self)
|
|
356
|
+
{
|
|
357
|
+
CHECK;
|
|
358
|
+
return value(THIS->pointer_through_alpha());
|
|
359
|
+
}
|
|
360
|
+
|
|
189
361
|
static const uint ORIENTATION_MASK =
|
|
190
362
|
Reflex::Window::FLAG_PORTRAIT | Reflex::Window::FLAG_LANDSCAPE;
|
|
191
363
|
|
|
192
364
|
static
|
|
193
365
|
VALUE set_orientations(VALUE self, VALUE orientations)
|
|
194
366
|
{
|
|
195
|
-
using namespace Reflex;
|
|
196
|
-
|
|
197
367
|
CHECK;
|
|
198
368
|
|
|
199
369
|
uint flags = to<uint>(orientations);
|
|
200
|
-
THIS->
|
|
370
|
+
THIS->set_flags(
|
|
201
371
|
( flags & ORIENTATION_MASK) |
|
|
202
372
|
(THIS->flags() & ~ORIENTATION_MASK));
|
|
203
373
|
}
|
|
@@ -205,8 +375,6 @@ VALUE set_orientations(VALUE self, VALUE orientations)
|
|
|
205
375
|
static
|
|
206
376
|
VALUE get_orientations(VALUE self)
|
|
207
377
|
{
|
|
208
|
-
using namespace Reflex;
|
|
209
|
-
|
|
210
378
|
CHECK;
|
|
211
379
|
return value(THIS->flags() & ORIENTATION_MASK);
|
|
212
380
|
}
|
|
@@ -240,42 +408,39 @@ VALUE get_painter(VALUE self)
|
|
|
240
408
|
}
|
|
241
409
|
|
|
242
410
|
static
|
|
243
|
-
VALUE
|
|
411
|
+
VALUE on_show(VALUE self, VALUE event)
|
|
244
412
|
{
|
|
245
413
|
CHECK;
|
|
246
|
-
|
|
414
|
+
|
|
415
|
+
CALL(on_show(to<Reflex::Event*>(event)));
|
|
247
416
|
}
|
|
248
417
|
|
|
249
418
|
static
|
|
250
|
-
VALUE
|
|
419
|
+
VALUE on_hide(VALUE self, VALUE event)
|
|
251
420
|
{
|
|
252
421
|
CHECK;
|
|
253
|
-
CALL(
|
|
422
|
+
CALL(on_hide(to<Reflex::Event*>(event)));
|
|
254
423
|
}
|
|
255
424
|
|
|
256
425
|
static
|
|
257
|
-
VALUE
|
|
426
|
+
VALUE on_close(VALUE self, VALUE event)
|
|
258
427
|
{
|
|
259
428
|
CHECK;
|
|
260
|
-
|
|
261
|
-
RUCY_SYM(call_show_block);
|
|
262
|
-
self.call(call_show_block);
|
|
263
|
-
|
|
264
|
-
CALL(on_show(to<Reflex::Event*>(event)));
|
|
429
|
+
CALL(on_close(to<Reflex::Event*>(event)));
|
|
265
430
|
}
|
|
266
431
|
|
|
267
432
|
static
|
|
268
|
-
VALUE
|
|
433
|
+
VALUE on_activate(VALUE self, VALUE event)
|
|
269
434
|
{
|
|
270
435
|
CHECK;
|
|
271
|
-
CALL(
|
|
436
|
+
CALL(on_activate(to<Reflex::Event*>(event)));
|
|
272
437
|
}
|
|
273
438
|
|
|
274
439
|
static
|
|
275
|
-
VALUE
|
|
440
|
+
VALUE on_deactivate(VALUE self, VALUE event)
|
|
276
441
|
{
|
|
277
442
|
CHECK;
|
|
278
|
-
CALL(
|
|
443
|
+
CALL(on_deactivate(to<Reflex::Event*>(event)));
|
|
279
444
|
}
|
|
280
445
|
|
|
281
446
|
static
|
|
@@ -327,6 +492,27 @@ VALUE on_key_up(VALUE self, VALUE event)
|
|
|
327
492
|
CALL(on_key_up(to<Reflex::KeyEvent*>(event)));
|
|
328
493
|
}
|
|
329
494
|
|
|
495
|
+
static
|
|
496
|
+
VALUE on_text(VALUE self, VALUE event)
|
|
497
|
+
{
|
|
498
|
+
CHECK;
|
|
499
|
+
CALL(on_text(to<Reflex::TextEvent*>(event)));
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
static
|
|
503
|
+
VALUE on_text_preedit(VALUE self, VALUE event)
|
|
504
|
+
{
|
|
505
|
+
CHECK;
|
|
506
|
+
CALL(on_text_preedit(to<Reflex::TextEvent*>(event)));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
static
|
|
510
|
+
VALUE on_text_commit(VALUE self, VALUE event)
|
|
511
|
+
{
|
|
512
|
+
CHECK;
|
|
513
|
+
CALL(on_text_commit(to<Reflex::TextEvent*>(event)));
|
|
514
|
+
}
|
|
515
|
+
|
|
330
516
|
static
|
|
331
517
|
VALUE on_pointer(VALUE self, VALUE event)
|
|
332
518
|
{
|
|
@@ -362,6 +548,20 @@ VALUE on_pointer_cancel(VALUE self, VALUE event)
|
|
|
362
548
|
CALL(on_pointer_cancel(to<Reflex::PointerEvent*>(event)));
|
|
363
549
|
}
|
|
364
550
|
|
|
551
|
+
static
|
|
552
|
+
VALUE on_pointer_enter(VALUE self, VALUE event)
|
|
553
|
+
{
|
|
554
|
+
CHECK;
|
|
555
|
+
CALL(on_pointer_enter(to<Reflex::PointerEvent*>(event)));
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
static
|
|
559
|
+
VALUE on_pointer_leave(VALUE self, VALUE event)
|
|
560
|
+
{
|
|
561
|
+
CHECK;
|
|
562
|
+
CALL(on_pointer_leave(to<Reflex::PointerEvent*>(event)));
|
|
563
|
+
}
|
|
564
|
+
|
|
365
565
|
static
|
|
366
566
|
VALUE on_wheel(VALUE self, VALUE event)
|
|
367
567
|
{
|
|
@@ -369,6 +569,27 @@ VALUE on_wheel(VALUE self, VALUE event)
|
|
|
369
569
|
CALL(on_wheel(to<Reflex::WheelEvent*>(event)));
|
|
370
570
|
}
|
|
371
571
|
|
|
572
|
+
static
|
|
573
|
+
VALUE on_file(VALUE self, VALUE event)
|
|
574
|
+
{
|
|
575
|
+
CHECK;
|
|
576
|
+
CALL(on_file(to<Reflex::FileEvent*>(event)));
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
static
|
|
580
|
+
VALUE on_file_open(VALUE self, VALUE event)
|
|
581
|
+
{
|
|
582
|
+
CHECK;
|
|
583
|
+
CALL(on_file_open(to<Reflex::FileEvent*>(event)));
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
static
|
|
587
|
+
VALUE on_file_save(VALUE self, VALUE event)
|
|
588
|
+
{
|
|
589
|
+
CHECK;
|
|
590
|
+
CALL(on_file_save(to<Reflex::FileEvent*>(event)));
|
|
591
|
+
}
|
|
592
|
+
|
|
372
593
|
static
|
|
373
594
|
VALUE on_midi(VALUE self, VALUE event)
|
|
374
595
|
{
|
|
@@ -416,34 +637,53 @@ Init_reflex_window ()
|
|
|
416
637
|
rb_define_alloc_func(cWindow, alloc);
|
|
417
638
|
rb_define_method(cWindow, "show", RUBY_METHOD_FUNC(show), 0);
|
|
418
639
|
rb_define_method(cWindow, "hide", RUBY_METHOD_FUNC(hide), 0);
|
|
640
|
+
cWindow.define_method("hidden?", is_hidden);
|
|
419
641
|
rb_define_method(cWindow, "close", RUBY_METHOD_FUNC(close), 0);
|
|
420
642
|
rb_define_method(cWindow, "redraw", RUBY_METHOD_FUNC(redraw), 0);
|
|
421
643
|
rb_define_method(cWindow, "from_screen", RUBY_METHOD_FUNC(from_screen), 1);
|
|
422
644
|
rb_define_method(cWindow, "to_screen", RUBY_METHOD_FUNC(to_screen), 1);
|
|
645
|
+
cWindow.define_method("active?", is_active);
|
|
423
646
|
rb_define_method(cWindow, "title=", RUBY_METHOD_FUNC(set_title), 1);
|
|
424
647
|
rb_define_method(cWindow, "title", RUBY_METHOD_FUNC(get_title), 0);
|
|
425
648
|
rb_define_method(cWindow, "frame=", RUBY_METHOD_FUNC(set_frame), -1);
|
|
426
649
|
rb_define_method(cWindow, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
|
650
|
+
rb_define_method(cWindow, "menu=", RUBY_METHOD_FUNC(set_menu), 1);
|
|
651
|
+
rb_define_method(cWindow, "menu", RUBY_METHOD_FUNC(get_menu), 0);
|
|
427
652
|
rb_define_method(cWindow, "closable=", RUBY_METHOD_FUNC(set_closable), 1);
|
|
428
|
-
cWindow.define_method("closable?",
|
|
653
|
+
cWindow.define_method("closable?", is_closable);
|
|
429
654
|
rb_define_method(cWindow, "minimizable=", RUBY_METHOD_FUNC(set_minimizable), 1);
|
|
430
|
-
cWindow.define_method("minimizable?",
|
|
655
|
+
cWindow.define_method("minimizable?", is_minimizable);
|
|
431
656
|
rb_define_method(cWindow, "resizable=", RUBY_METHOD_FUNC(set_resizable), 1);
|
|
432
|
-
cWindow.define_method("resizable?",
|
|
657
|
+
cWindow.define_method("resizable?", is_resizable);
|
|
658
|
+
rb_define_method(cWindow, "titlebar=", RUBY_METHOD_FUNC(set_titlebar), 1);
|
|
659
|
+
rb_define_method(cWindow, "titlebar", RUBY_METHOD_FUNC(get_titlebar), 0);
|
|
660
|
+
rb_define_method(cWindow, "unlisted=", RUBY_METHOD_FUNC(set_unlisted), 1);
|
|
661
|
+
cWindow.define_method("unlisted?", is_unlisted);
|
|
662
|
+
rb_define_method(cWindow, "shadow=", RUBY_METHOD_FUNC(set_shadow), 1);
|
|
663
|
+
cWindow.define_method("shadow?", has_shadow);
|
|
664
|
+
rb_define_method(cWindow, "transparent=", RUBY_METHOD_FUNC(set_transparent), 1);
|
|
665
|
+
cWindow.define_method("transparent?", is_transparent);
|
|
433
666
|
rb_define_method(cWindow, "fullscreen=", RUBY_METHOD_FUNC(set_fullscreen), 1);
|
|
434
|
-
cWindow.define_method("fullscreen?",
|
|
667
|
+
cWindow.define_method("fullscreen?", is_fullscreen);
|
|
668
|
+
rb_define_method(cWindow, "always_on_top=", RUBY_METHOD_FUNC(set_always_on_top), 1);
|
|
669
|
+
cWindow.define_method("always_on_top?", is_always_on_top);
|
|
670
|
+
rb_define_method(cWindow, "always_on_bottom=", RUBY_METHOD_FUNC(set_always_on_bottom), 1);
|
|
671
|
+
cWindow.define_method("always_on_bottom?", is_always_on_bottom);
|
|
672
|
+
rb_define_method(cWindow, "pointer_through=", RUBY_METHOD_FUNC(set_pointer_through), 1);
|
|
673
|
+
cWindow.define_method("pointer_through?", is_pointer_through);
|
|
674
|
+
rb_define_method(cWindow, "pointer_through_alpha=", RUBY_METHOD_FUNC(set_pointer_through_alpha), 1);
|
|
675
|
+
rb_define_method(cWindow, "pointer_through_alpha", RUBY_METHOD_FUNC(get_pointer_through_alpha), 0);
|
|
435
676
|
rb_define_method(cWindow, "orientations=", RUBY_METHOD_FUNC(set_orientations), 1);
|
|
436
677
|
rb_define_method(cWindow, "orientations", RUBY_METHOD_FUNC(get_orientations), 0);
|
|
437
|
-
rb_define_method(cWindow, "hidden", RUBY_METHOD_FUNC(hidden), 0);
|
|
438
678
|
rb_define_method(cWindow, "screen", RUBY_METHOD_FUNC(get_screen), 0);
|
|
439
679
|
rb_define_method(cWindow, "root", RUBY_METHOD_FUNC(get_root), 0);
|
|
440
680
|
rb_define_method(cWindow, "focus", RUBY_METHOD_FUNC(get_focus), 0);
|
|
441
681
|
rb_define_method(cWindow, "painter", RUBY_METHOD_FUNC(get_painter), 0);
|
|
442
|
-
rb_define_method(cWindow, "on_activate", RUBY_METHOD_FUNC(on_activate), 1);
|
|
443
|
-
rb_define_method(cWindow, "on_deactivate", RUBY_METHOD_FUNC(on_deactivate), 1);
|
|
444
682
|
rb_define_method(cWindow, "on_show", RUBY_METHOD_FUNC(on_show), 1);
|
|
445
683
|
rb_define_method(cWindow, "on_hide", RUBY_METHOD_FUNC(on_hide), 1);
|
|
446
684
|
rb_define_method(cWindow, "on_close", RUBY_METHOD_FUNC(on_close), 1);
|
|
685
|
+
rb_define_method(cWindow, "on_activate", RUBY_METHOD_FUNC(on_activate), 1);
|
|
686
|
+
rb_define_method(cWindow, "on_deactivate", RUBY_METHOD_FUNC(on_deactivate), 1);
|
|
447
687
|
rb_define_method(cWindow, "on_update", RUBY_METHOD_FUNC(on_update), 1);
|
|
448
688
|
rb_define_method(cWindow, "on_draw", RUBY_METHOD_FUNC(on_draw), 1);
|
|
449
689
|
rb_define_method(cWindow, "on_move", RUBY_METHOD_FUNC(on_move), 1);
|
|
@@ -451,18 +691,29 @@ Init_reflex_window ()
|
|
|
451
691
|
rb_define_method(cWindow, "on_key", RUBY_METHOD_FUNC(on_key), 1);
|
|
452
692
|
rb_define_method(cWindow, "on_key_down", RUBY_METHOD_FUNC(on_key_down), 1);
|
|
453
693
|
rb_define_method(cWindow, "on_key_up", RUBY_METHOD_FUNC(on_key_up), 1);
|
|
694
|
+
rb_define_method(cWindow, "on_text", RUBY_METHOD_FUNC(on_text), 1);
|
|
695
|
+
rb_define_method(cWindow, "on_text_preedit", RUBY_METHOD_FUNC(on_text_preedit), 1);
|
|
696
|
+
rb_define_method(cWindow, "on_text_commit", RUBY_METHOD_FUNC(on_text_commit), 1);
|
|
454
697
|
rb_define_method(cWindow, "on_pointer", RUBY_METHOD_FUNC(on_pointer), 1);
|
|
455
698
|
rb_define_method(cWindow, "on_pointer_down", RUBY_METHOD_FUNC(on_pointer_down), 1);
|
|
456
699
|
rb_define_method(cWindow, "on_pointer_up", RUBY_METHOD_FUNC(on_pointer_up), 1);
|
|
457
700
|
rb_define_method(cWindow, "on_pointer_move", RUBY_METHOD_FUNC(on_pointer_move), 1);
|
|
458
701
|
rb_define_method(cWindow, "on_pointer_cancel", RUBY_METHOD_FUNC(on_pointer_cancel), 1);
|
|
702
|
+
rb_define_method(cWindow, "on_pointer_enter", RUBY_METHOD_FUNC(on_pointer_enter), 1);
|
|
703
|
+
rb_define_method(cWindow, "on_pointer_leave", RUBY_METHOD_FUNC(on_pointer_leave), 1);
|
|
459
704
|
rb_define_method(cWindow, "on_wheel", RUBY_METHOD_FUNC(on_wheel), 1);
|
|
705
|
+
rb_define_method(cWindow, "on_file", RUBY_METHOD_FUNC(on_file), 1);
|
|
706
|
+
rb_define_method(cWindow, "on_file_open", RUBY_METHOD_FUNC(on_file_open), 1);
|
|
707
|
+
rb_define_method(cWindow, "on_file_save", RUBY_METHOD_FUNC(on_file_save), 1);
|
|
460
708
|
rb_define_method(cWindow, "on_midi", RUBY_METHOD_FUNC(on_midi), 1);
|
|
461
709
|
rb_define_method(cWindow, "on_note", RUBY_METHOD_FUNC(on_note), 1);
|
|
462
710
|
rb_define_method(cWindow, "on_note_on", RUBY_METHOD_FUNC(on_note_on), 1);
|
|
463
711
|
rb_define_method(cWindow, "on_note_off", RUBY_METHOD_FUNC(on_note_off), 1);
|
|
464
712
|
rb_define_method(cWindow, "on_control_change", RUBY_METHOD_FUNC(on_control_change), 1);
|
|
465
713
|
|
|
714
|
+
cWindow.define_const("TITLEBAR_BUTTONS", Reflex::Window::FLAG_TITLEBAR_BUTTONS);
|
|
715
|
+
cWindow.define_const("TITLEBAR_BACKGROUND", Reflex::Window::FLAG_TITLEBAR_BACKGROUND);
|
|
716
|
+
|
|
466
717
|
cWindow.define_const("ORIENTATION_PORTRAIT", Reflex::Window::FLAG_PORTRAIT);
|
|
467
718
|
cWindow.define_const("ORIENTATION_LANDSCAPE", Reflex::Window::FLAG_LANDSCAPE);
|
|
468
719
|
|
|
@@ -9,43 +9,5 @@ permissions:
|
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
11
|
release:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- name: ruby 3.2
|
|
16
|
-
uses: ruby/setup-ruby@v1
|
|
17
|
-
with:
|
|
18
|
-
ruby-version: 3.2
|
|
19
|
-
|
|
20
|
-
- name: checkout
|
|
21
|
-
uses: actions/checkout@v4
|
|
22
|
-
|
|
23
|
-
- name: setup gems
|
|
24
|
-
run: bundle install
|
|
25
|
-
|
|
26
|
-
- name: setup dependencies
|
|
27
|
-
run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
|
|
28
|
-
|
|
29
|
-
- name: test
|
|
30
|
-
run: bundle exec rake packages test
|
|
31
|
-
|
|
32
|
-
- name: create gem
|
|
33
|
-
id: gem
|
|
34
|
-
run: |
|
|
35
|
-
bundle exec rake gem
|
|
36
|
-
echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
|
|
37
|
-
|
|
38
|
-
- name: create github release
|
|
39
|
-
env:
|
|
40
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
-
run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
|
|
42
|
-
|
|
43
|
-
- name: upload to rubygems
|
|
44
|
-
env:
|
|
45
|
-
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
|
46
|
-
run: |
|
|
47
|
-
mkdir -p $HOME/.gem
|
|
48
|
-
touch $HOME/.gem/credentials
|
|
49
|
-
chmod 0600 $HOME/.gem/credentials
|
|
50
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
51
|
-
bundle exec rake upload
|
|
12
|
+
uses: xord/xot/.github/workflows/release-gem.yml@master
|
|
13
|
+
secrets: inherit
|
data/.github/workflows/tag.yml
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
name: Tag
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: [Test]
|
|
6
|
+
types: [completed]
|
|
5
7
|
branches: [master]
|
|
6
8
|
|
|
7
9
|
jobs:
|
|
8
10
|
tag:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- name: ruby 3.2
|
|
13
|
-
uses: ruby/setup-ruby@v1
|
|
14
|
-
with:
|
|
15
|
-
ruby-version: 3.2
|
|
16
|
-
|
|
17
|
-
- name: checkout
|
|
18
|
-
uses: actions/checkout@v4
|
|
19
|
-
with:
|
|
20
|
-
fetch-depth: 0
|
|
21
|
-
token: ${{ secrets.PAT }}
|
|
22
|
-
|
|
23
|
-
- name: setup dependencies
|
|
24
|
-
run: "ruby -I.github/workflows -rutils -e 'setup_dependencies only: :xot'"
|
|
25
|
-
|
|
26
|
-
- name: setup user name and email
|
|
27
|
-
run: |
|
|
28
|
-
git config --global user.email "xordog@gmail.com"
|
|
29
|
-
git config --global user.name "xord"
|
|
30
|
-
|
|
31
|
-
- name: tag versions
|
|
32
|
-
run: "ruby -I.github/workflows -rutils -e 'tag_versions'"
|
|
33
|
-
|
|
34
|
-
- name: push tags
|
|
35
|
-
run: git push origin --tags
|
|
11
|
+
uses: xord/xot/.github/workflows/tag.yml@master
|
|
12
|
+
secrets: inherit
|