reflexion 0.3.15 → 0.4.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/key_event.cpp +3 -3
- data/.github/workflows/release-gem.yml +2 -16
- data/ChangeLog.md +13 -0
- data/README.md +205 -6
- data/VERSION +1 -1
- data/ext/reflex/key_event.cpp +3 -3
- data/include/reflex/defs.h +24 -24
- data/reflex.gemspec +3 -3
- data/samples/bats.rb +2 -2
- data/samples/ios/hello/hello/main.cpp +3 -3
- data/samples/ios/hello/hello.xcodeproj/project.pbxproj +868 -588
- data/samples/osx/hello/hello/main.cpp +4 -4
- data/samples/osx/hello/hello.xcodeproj/project.pbxproj +902 -594
- data/src/ios/event.h +25 -1
- data/src/ios/event.mm +95 -12
- data/src/ios/view_controller.mm +133 -1
- data/src/osx/event.mm +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8781c6a2e533488f1529b59cdb98ed7922909330e254bdbd80b7ce67f40a8252
|
|
4
|
+
data.tar.gz: 449a81f9c5ba57c2daa68af18cc6e42d90319703beab674dee431e5bc2923d4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c746ba6a4b32c05eca98a2bd3c7ab5e459e44222d80794323757a8516401a91404c76aa4e7dbb08b084126bf08d65bf310ab8f3095f06bd2df29577fa7989604
|
|
7
|
+
data.tar.gz: 928aa64c73861dcb0848dc6c6ea6d770ccb3dff1e9e06ba6bb3cf470cb5104311af6ecfc543d4ca015f8efdc3a12d9bb6662b80014f9fc57a2bbc16c74bf5e43
|
|
@@ -152,13 +152,13 @@ VALUE get_key(VALUE self)
|
|
|
152
152
|
CASE(LCONTROL):
|
|
153
153
|
CASE(RCONTROL): SYMBOL1(control);
|
|
154
154
|
CASE(ALT):
|
|
155
|
-
#if !defined(LINUX)
|
|
155
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
156
156
|
CASE(LALT):
|
|
157
157
|
#endif
|
|
158
158
|
CASE(RALT): SYMBOL1(alt);
|
|
159
159
|
CASE(LWIN):
|
|
160
160
|
CASE(RWIN): SYMBOL1(win);
|
|
161
|
-
#if !defined(LINUX)
|
|
161
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
162
162
|
CASE(LCOMMAND):
|
|
163
163
|
CASE(RCOMMAND): SYMBOL1(command);
|
|
164
164
|
CASE(LOPTION):
|
|
@@ -198,7 +198,7 @@ VALUE get_key(VALUE self)
|
|
|
198
198
|
CASE(NUM_EQUAL): SYMBOL1(equal);
|
|
199
199
|
CASE(NUM_COMMA): SYMBOL1(comma);
|
|
200
200
|
CASE(NUM_DECIMAL): SYMBOL1(decimal);
|
|
201
|
-
#if !defined(LINUX)
|
|
201
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
202
202
|
CASE(NUM_CLEAR): SYMBOL1(clear);
|
|
203
203
|
#endif
|
|
204
204
|
CASE(NUM_ENTER): SYMBOL1(enter);
|
|
@@ -36,23 +36,9 @@ jobs:
|
|
|
36
36
|
echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
|
|
37
37
|
|
|
38
38
|
- name: create github release
|
|
39
|
-
id: release
|
|
40
|
-
uses: actions/create-release@v1
|
|
41
39
|
env:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
tag_name: ${{ github.ref }}
|
|
45
|
-
release_name: ${{ github.ref }}
|
|
46
|
-
|
|
47
|
-
- name: upload to github release
|
|
48
|
-
uses: actions/upload-release-asset@v1
|
|
49
|
-
env:
|
|
50
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
51
|
-
with:
|
|
52
|
-
upload_url: ${{ steps.release.outputs.upload_url }}
|
|
53
|
-
asset_path: ./${{ steps.gem.outputs.path }}
|
|
54
|
-
asset_name: ${{ steps.gem.outputs.path }}
|
|
55
|
-
asset_content_type: application/zip
|
|
40
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
|
|
56
42
|
|
|
57
43
|
- name: upload to rubygems
|
|
58
44
|
env:
|
data/ChangeLog.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# reflex ChangeLog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [v0.4.0] - 2026-05-17
|
|
5
|
+
|
|
6
|
+
- [BREAKING] Normalize wheel Y delta to top-left origin convention
|
|
7
|
+
|
|
8
|
+
- Add keyboard event handling on iOS
|
|
9
|
+
- Add mouse event handling on iOS
|
|
10
|
+
- Rewrite README.md
|
|
11
|
+
- CI: Migrate release-gem.yml from actions/create-release to gh release create
|
|
12
|
+
- Refresh hello sample Xcode projects
|
|
13
|
+
|
|
14
|
+
- Skip duplicate KEY_CODE aliases on WASM build
|
|
15
|
+
|
|
16
|
+
|
|
4
17
|
## [v0.3.15] - 2026-05-10
|
|
5
18
|
|
|
6
19
|
- Support WebAssembly
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Reflex - A
|
|
1
|
+
# Reflex - A GUI toolkit for Ruby
|
|
2
2
|
|
|
3
3
|
[](https://deepwiki.com/xord/reflex)
|
|
4
4
|

|
|
@@ -21,19 +21,38 @@ Thanks for your support! 🙌
|
|
|
21
21
|
|
|
22
22
|
## 🚀 About
|
|
23
23
|
|
|
24
|
-
**Reflex** is a
|
|
24
|
+
**Reflex** is a cross-platform GUI toolkit for Ruby. It gives you a `Window` with a tree of `View` objects, an event-driven runtime (`Application` / `on_draw`, `on_update`, `on_pointer`, ...), and bindings to a 2D physics engine, MIDI I/O, and live camera capture — all sitting on top of the [Rays](https://github.com/xord/rays) drawing engine.
|
|
25
25
|
|
|
26
|
-
It is
|
|
27
|
-
|
|
26
|
+
It is the application layer underneath [Processing](https://github.com/xord/processing), [RubySketch](https://github.com/xord/rubysketch), and [Reight](https://github.com/xord/reight). Like the rest of the `xord/*` family, Reflex is primarily developed for our own use, but it also works as a standalone GUI / creative-coding toolkit.
|
|
27
|
+
|
|
28
|
+
> **The gem name is `reflexion`** (not `reflex`) — `gem install reflexion`. The Ruby namespace is `Reflex`.
|
|
29
|
+
|
|
30
|
+
## 📋 Requirements
|
|
31
|
+
|
|
32
|
+
- Ruby **3.0.0** or later
|
|
33
|
+
- A C++ compiler with C++20 support
|
|
34
|
+
- [Xot](https://rubygems.org/gems/xot), [Rucy](https://rubygems.org/gems/rucy), and [Rays](https://rubygems.org/gems/rays) (declared as runtime dependencies)
|
|
35
|
+
- Platform GUI backend:
|
|
36
|
+
- **macOS** — AppKit (bundled with the OS)
|
|
37
|
+
- **iOS** — UIKit (bundled with the OS)
|
|
38
|
+
- **Windows** — native Win32
|
|
39
|
+
- **Linux** — `libsdl2-dev`
|
|
40
|
+
|
|
41
|
+
The following third-party libraries are cloned from GitHub and statically linked while the native extension is being built:
|
|
42
|
+
|
|
43
|
+
| Library | Role |
|
|
44
|
+
| --------------------------------------------- | ----------------------------------- |
|
|
45
|
+
| [Box2D](https://github.com/erincatto/box2d) | 2D physics simulation (`View` bodies, `ContactEvent`, gravity, fixtures) |
|
|
46
|
+
| [RtMidi](https://github.com/thestk/rtmidi) | MIDI I/O — exposes `MidiEvent`, `NoteEvent`, `ControlChangeEvent` to views |
|
|
28
47
|
|
|
29
48
|
## 📦 Installation
|
|
30
49
|
|
|
31
50
|
Add this line to your Gemfile:
|
|
32
51
|
```ruby
|
|
33
|
-
|
|
52
|
+
gem 'reflexion'
|
|
34
53
|
```
|
|
35
54
|
|
|
36
|
-
Then
|
|
55
|
+
Then install:
|
|
37
56
|
```bash
|
|
38
57
|
$ bundle install
|
|
39
58
|
```
|
|
@@ -43,7 +62,187 @@ Or install it directly:
|
|
|
43
62
|
$ gem install reflexion
|
|
44
63
|
```
|
|
45
64
|
|
|
65
|
+
`require 'reflex'` automatically calls `Reflex.init!` (and `Rays.init!`) and registers `Reflex.fin!` at exit. Set `$REFLEX_NOAUTOINIT = true` before requiring if you want to manage the lifetime yourself.
|
|
66
|
+
|
|
67
|
+
## 📚 What's Included
|
|
68
|
+
|
|
69
|
+
### Application / Window / View
|
|
70
|
+
|
|
71
|
+
| Class | Purpose |
|
|
72
|
+
| ------------------------ | ----------------------------------------------------------------------- |
|
|
73
|
+
| `Reflex::Application` | Run loop; created and started by `Reflex.start { ... }` |
|
|
74
|
+
| `Reflex::Window` | OS-level window with title, frame, flags (closable / resizable / fullscreen / portrait / landscape) |
|
|
75
|
+
| `Reflex::View` | Recursive UI node: position, size, transform, styles, child views, optional clipping / caching |
|
|
76
|
+
| `Reflex::Screen` | Information about a display monitor |
|
|
77
|
+
| `Reflex::Timer` | One-shot or interval timer that delivers `TimerEvent` |
|
|
78
|
+
|
|
79
|
+
### Shapes (drawing + physics body)
|
|
80
|
+
|
|
81
|
+
A view can carry one or more `Shape` objects that act both as its drawn appearance and as its physics fixture. Built-ins:
|
|
82
|
+
|
|
83
|
+
- `Reflex::RectShape`
|
|
84
|
+
- `Reflex::EllipseShape`
|
|
85
|
+
- `Reflex::LineShape`
|
|
86
|
+
- `Reflex::PolygonShape` — wraps a `Rays::Polygon`
|
|
87
|
+
|
|
88
|
+
### Events
|
|
89
|
+
|
|
90
|
+
Every event class inherits from `Reflex::Event`. Views receive them via `on_<name>` hooks (or `on(:name)` / `before(:name)` / `after(:name)` from `Xot::Hookable`).
|
|
91
|
+
|
|
92
|
+
| Event class | View hook | When it fires |
|
|
93
|
+
| ---------------------------------------------------- | -------------------- | --------------------------------------------------- |
|
|
94
|
+
| `UpdateEvent` | `on_update` | Every frame, before drawing |
|
|
95
|
+
| `DrawEvent` | `on_draw` | Every frame, to render with `e.painter` |
|
|
96
|
+
| `FrameEvent` | `on_frame_*` | Frame resize / move |
|
|
97
|
+
| `FocusEvent` | `on_focus` | Keyboard focus gained / lost |
|
|
98
|
+
| `KeyEvent` | `on_key` | Key down / up / repeat |
|
|
99
|
+
| `PointerEvent` | `on_pointer` | Mouse / touch down / move / up |
|
|
100
|
+
| `WheelEvent` | `on_wheel` | Scroll wheel / trackpad scroll |
|
|
101
|
+
| `ScrollEvent` | `on_scroll` | The view itself scrolled |
|
|
102
|
+
| `MidiEvent` / `NoteEvent` / `ControlChangeEvent` | `on_midi` / `on_note` / `on_control_change` | Incoming MIDI message |
|
|
103
|
+
| `CaptureEvent` | `on_capture` | New frame from a `Rays::Camera` |
|
|
104
|
+
| `TimerEvent` | `on_timer` | Fired by `start_timer` / `start_interval` |
|
|
105
|
+
| `ContactEvent` | `on_contact_*` | Two physics bodies began / ended overlapping |
|
|
106
|
+
| `DeviceEvent` / `MotionEvent` | various | Device-level signals (accelerometer / gyro / connection) |
|
|
107
|
+
|
|
108
|
+
### Styling and selectors
|
|
109
|
+
|
|
110
|
+
`Reflex::Style` and `Reflex::Selector` (with `HasSelector`) provide a lightweight CSS-style mechanism for setting background, padding, layout, etc., on views.
|
|
111
|
+
|
|
112
|
+
### Two ways to use the gem
|
|
113
|
+
|
|
114
|
+
The gem ships **two complementary APIs**:
|
|
115
|
+
|
|
116
|
+
1. **`require 'reflex'`** — the full OO API. Subclass `Reflex::Window`, override `on_draw` / `on_update` / `on_pointer`, build a view hierarchy, etc.
|
|
117
|
+
2. **`require 'reflexion/include'`** — a single-file, Processing-style API that exposes top-level `setup`, `draw`, `update`, `key`, `pointer`, `motion` blocks and auto-starts the application on `at_exit`.
|
|
118
|
+
|
|
119
|
+
## 💡 Usage
|
|
120
|
+
|
|
121
|
+
### Hello, Reflex (OO style)
|
|
122
|
+
|
|
123
|
+
```ruby
|
|
124
|
+
require 'reflex'
|
|
125
|
+
|
|
126
|
+
class HelloWindow < Reflex::Window
|
|
127
|
+
def initialize
|
|
128
|
+
super title: 'Hello Reflex!', frame: [100, 100, 320, 240]
|
|
129
|
+
painter.font = Reflex::Font.new('Menlo', 32)
|
|
130
|
+
painter.background = 0
|
|
131
|
+
painter.fill = 1
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def on_draw(e)
|
|
135
|
+
e.painter.text 'hello world!', 5, 5
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def on_update(e)
|
|
139
|
+
painter.background = rand, rand, rand
|
|
140
|
+
redraw
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
Reflex.start do
|
|
145
|
+
HelloWindow.new.show
|
|
146
|
+
end
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Block / DSL style
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
require 'reflex'
|
|
153
|
+
|
|
154
|
+
Reflex.start do
|
|
155
|
+
Reflex::Window.show title: 'Shapes', frame: [100, 100, 500, 300] do
|
|
156
|
+
def on_draw(e)
|
|
157
|
+
e.painter.push do
|
|
158
|
+
fill :pink
|
|
159
|
+
stroke 1
|
|
160
|
+
stroke_width 2
|
|
161
|
+
rect 10, 10, 80, 80, 10
|
|
162
|
+
ellipse 120, 10, 80, 80
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Reflexion (Processing-style single-file)
|
|
170
|
+
|
|
171
|
+
```ruby
|
|
172
|
+
require 'reflexion/include'
|
|
173
|
+
|
|
174
|
+
setup do
|
|
175
|
+
window.title = 'Reflexion!'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
draw do |p|
|
|
179
|
+
p.background 0
|
|
180
|
+
p.fill 1
|
|
181
|
+
p.text 'hello from reflexion', 10, 30
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
pointer do |e|
|
|
185
|
+
puts "pointer at #{e.pos.to_a.inspect}"
|
|
186
|
+
end
|
|
187
|
+
# Reflexion.start is called automatically at_exit
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 2D physics with Box2D
|
|
191
|
+
|
|
192
|
+
```ruby
|
|
193
|
+
require 'reflex'
|
|
194
|
+
|
|
195
|
+
Reflex.start name: 'Physics' do |app|
|
|
196
|
+
Reflex::Window.show title: app.name, frame: [100, 100, 500, 500] do
|
|
197
|
+
gravity 0, 9.8 * meter
|
|
198
|
+
|
|
199
|
+
50.times do
|
|
200
|
+
add Reflex::View.new {
|
|
201
|
+
pos rand(10..400), rand(10..100)
|
|
202
|
+
size rand(5..50)
|
|
203
|
+
background [:red, :green, :blue, :yellow, :orange].sample
|
|
204
|
+
dynamic true
|
|
205
|
+
shape Reflex::EllipseShape.new(density: 1)
|
|
206
|
+
}
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
add Reflex::View.new { # a static ground
|
|
210
|
+
pos 0, 480
|
|
211
|
+
size 500, 20
|
|
212
|
+
background :darkgray
|
|
213
|
+
static true
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
on :pointer do |e|
|
|
217
|
+
if e.down? || e.drag?
|
|
218
|
+
add Reflex::View.new(pos: e.pos, size: 10, dynamic: true,
|
|
219
|
+
shape: Reflex::EllipseShape.new(density: 1))
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
See the [`samples/`](./samples) directory for more examples covering shapes, layout, models, MIDI, camera capture, etc.
|
|
227
|
+
|
|
228
|
+
## 🛠️ Development
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
$ rake vendor # clone Box2D and RtMidi into vendor/
|
|
232
|
+
$ rake lib # build the native C++ library (libreflex)
|
|
233
|
+
$ rake ext # build the Ruby C extension
|
|
234
|
+
$ rake test # run the test suite
|
|
235
|
+
$ rake doc # generate RDoc from C++ sources
|
|
236
|
+
$ rake # default: builds the extension
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
The test suite requires a windowing system, so CI only runs it on macOS. The `test_reflex_init.rb` test must run in its own process and is listed in `TESTS_ALONE`.
|
|
240
|
+
|
|
241
|
+
In the [`xord/all`](https://github.com/xord/all) monorepo you can scope by module, e.g. `rake reflex test`.
|
|
242
|
+
|
|
46
243
|
## 📜 License
|
|
47
244
|
|
|
48
245
|
**Reflex** is licensed under the MIT License.
|
|
49
246
|
See the [LICENSE](./LICENSE) file for details.
|
|
247
|
+
|
|
248
|
+
The third-party libraries listed above retain their own licenses (Box2D: MIT, RtMidi: MIT-style).
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.4.0
|
data/ext/reflex/key_event.cpp
CHANGED
|
@@ -156,13 +156,13 @@ RUCY_DEF0(get_key)
|
|
|
156
156
|
CASE(LCONTROL):
|
|
157
157
|
CASE(RCONTROL): SYMBOL1(control);
|
|
158
158
|
CASE(ALT):
|
|
159
|
-
#if !defined(LINUX)
|
|
159
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
160
160
|
CASE(LALT):
|
|
161
161
|
#endif
|
|
162
162
|
CASE(RALT): SYMBOL1(alt);
|
|
163
163
|
CASE(LWIN):
|
|
164
164
|
CASE(RWIN): SYMBOL1(win);
|
|
165
|
-
#if !defined(LINUX)
|
|
165
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
166
166
|
CASE(LCOMMAND):
|
|
167
167
|
CASE(RCOMMAND): SYMBOL1(command);
|
|
168
168
|
CASE(LOPTION):
|
|
@@ -202,7 +202,7 @@ RUCY_DEF0(get_key)
|
|
|
202
202
|
CASE(NUM_EQUAL): SYMBOL1(equal);
|
|
203
203
|
CASE(NUM_COMMA): SYMBOL1(comma);
|
|
204
204
|
CASE(NUM_DECIMAL): SYMBOL1(decimal);
|
|
205
|
-
#if !defined(LINUX)
|
|
205
|
+
#if !defined(IOS) && !defined(LINUX) && !defined(WASM)
|
|
206
206
|
CASE(NUM_CLEAR): SYMBOL1(clear);
|
|
207
207
|
#endif
|
|
208
208
|
CASE(NUM_ENTER): SYMBOL1(enter);
|
data/include/reflex/defs.h
CHANGED
|
@@ -77,12 +77,12 @@ namespace Reflex
|
|
|
77
77
|
|
|
78
78
|
KEY_NONE = -1,
|
|
79
79
|
|
|
80
|
-
#if defined(
|
|
81
|
-
#define NATIVE_VK(darwin, win32,
|
|
82
|
-
#elif defined(
|
|
83
|
-
#define NATIVE_VK(darwin, win32,
|
|
80
|
+
#if defined(OSX)
|
|
81
|
+
#define NATIVE_VK(darwin, win32, hid) darwin
|
|
82
|
+
#elif defined(WIN32)
|
|
83
|
+
#define NATIVE_VK(darwin, win32, hid) win32
|
|
84
84
|
#else
|
|
85
|
-
#define NATIVE_VK(darwin, win32,
|
|
85
|
+
#define NATIVE_VK(darwin, win32, hid) hid
|
|
86
86
|
#endif
|
|
87
87
|
|
|
88
88
|
KEY_A = NATIVE_VK(0x00, 0x41, 0x04),
|
|
@@ -231,16 +231,16 @@ namespace Reflex
|
|
|
231
231
|
KEY_SECTION = NATIVE_VK(0x0A, 0xE2, 0x64),
|
|
232
232
|
KEY_HELP = NATIVE_VK(0x72, 0x2F, 0x75),
|
|
233
233
|
|
|
234
|
-
KEY_EISU = NATIVE_VK(0x66, -33,
|
|
235
|
-
KEY_KANA = NATIVE_VK(0x68, 0x15,
|
|
236
|
-
KEY_KANJI = NATIVE_VK(-18, 0x19,
|
|
237
|
-
KEY_IME_ON = NATIVE_VK(-19, 0x16, -
|
|
238
|
-
KEY_IME_OFF = NATIVE_VK(-20, 0x1A, -
|
|
239
|
-
KEY_IME_MODECHANGE = NATIVE_VK(-21, 0x1F, -
|
|
240
|
-
KEY_CONVERT = NATIVE_VK(-22, 0x1C, -
|
|
241
|
-
KEY_NONCONVERT = NATIVE_VK(-23, 0x1D, -
|
|
242
|
-
KEY_ACCEPT = NATIVE_VK(-24, 0x1E, -
|
|
243
|
-
KEY_PROCESS = NATIVE_VK(-25, 0xE5, -
|
|
234
|
+
KEY_EISU = NATIVE_VK(0x66, -33, 0x90),
|
|
235
|
+
KEY_KANA = NATIVE_VK(0x68, 0x15, 0x91),
|
|
236
|
+
KEY_KANJI = NATIVE_VK(-18, 0x19, 0x94),
|
|
237
|
+
KEY_IME_ON = NATIVE_VK(-19, 0x16, -4),
|
|
238
|
+
KEY_IME_OFF = NATIVE_VK(-20, 0x1A, -5),
|
|
239
|
+
KEY_IME_MODECHANGE = NATIVE_VK(-21, 0x1F, -6),
|
|
240
|
+
KEY_CONVERT = NATIVE_VK(-22, 0x1C, -7),
|
|
241
|
+
KEY_NONCONVERT = NATIVE_VK(-23, 0x1D, -8),
|
|
242
|
+
KEY_ACCEPT = NATIVE_VK(-24, 0x1E, -9),
|
|
243
|
+
KEY_PROCESS = NATIVE_VK(-25, 0xE5, -10),
|
|
244
244
|
|
|
245
245
|
KEY_VOLUME_UP = NATIVE_VK(0x48, 0xAF, 0x80),
|
|
246
246
|
KEY_VOLUME_DOWN = NATIVE_VK(0x49, 0xAE, 0x81),
|
|
@@ -248,19 +248,19 @@ namespace Reflex
|
|
|
248
248
|
|
|
249
249
|
KEY_SLEEP = NATIVE_VK(-26, 0x5F, 0x11A),
|
|
250
250
|
KEY_EXEC = NATIVE_VK(-27, 0x2B, 0x74),
|
|
251
|
-
KEY_PRINT = NATIVE_VK(-28, 0x2A, -
|
|
251
|
+
KEY_PRINT = NATIVE_VK(-28, 0x2A, -11),
|
|
252
252
|
KEY_APPS = NATIVE_VK(-29, 0x5D, 0x65),
|
|
253
253
|
KEY_SELECT = NATIVE_VK(-30, 0x29, 0x77),
|
|
254
254
|
KEY_CLEAR = NATIVE_VK(-31, 0x0C, 0x9C),
|
|
255
255
|
|
|
256
|
-
KEY_NAVIGATION_VIEW = NATIVE_VK(-32, 0x88, -
|
|
257
|
-
KEY_NAVIGATION_MENU = NATIVE_VK(-33, 0x89, -
|
|
258
|
-
KEY_NAVIGATION_UP = NATIVE_VK(-34, 0x8A, -
|
|
259
|
-
KEY_NAVIGATION_DOWN = NATIVE_VK(-35, 0x8B, -
|
|
260
|
-
KEY_NAVIGATION_LEFT = NATIVE_VK(-36, 0x8C, -
|
|
261
|
-
KEY_NAVIGATION_RIGHT = NATIVE_VK(-37, 0x8D, -
|
|
262
|
-
KEY_NAVIGATION_ACCEPT = NATIVE_VK(-38, 0x8E, -
|
|
263
|
-
KEY_NAVIGATION_CANCEL = NATIVE_VK(-39, 0x8F, -
|
|
256
|
+
KEY_NAVIGATION_VIEW = NATIVE_VK(-32, 0x88, -12),
|
|
257
|
+
KEY_NAVIGATION_MENU = NATIVE_VK(-33, 0x89, -13),
|
|
258
|
+
KEY_NAVIGATION_UP = NATIVE_VK(-34, 0x8A, -14),
|
|
259
|
+
KEY_NAVIGATION_DOWN = NATIVE_VK(-35, 0x8B, -15),
|
|
260
|
+
KEY_NAVIGATION_LEFT = NATIVE_VK(-36, 0x8C, -16),
|
|
261
|
+
KEY_NAVIGATION_RIGHT = NATIVE_VK(-37, 0x8D, -17),
|
|
262
|
+
KEY_NAVIGATION_ACCEPT = NATIVE_VK(-38, 0x8E, -18),
|
|
263
|
+
KEY_NAVIGATION_CANCEL = NATIVE_VK(-39, 0x8F, -19),
|
|
264
264
|
|
|
265
265
|
KEY_BROWSER_BACK = NATIVE_VK(-40, 0xA6, 0x10E),
|
|
266
266
|
KEY_BROWSER_FORWARD = NATIVE_VK(-41, 0xA7, 0x10F),
|
data/reflex.gemspec
CHANGED
|
@@ -25,9 +25,9 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
s.platform = Gem::Platform::RUBY
|
|
26
26
|
s.required_ruby_version = '>= 3.0.0'
|
|
27
27
|
|
|
28
|
-
s.add_dependency 'xot', '~> 0.3.
|
|
29
|
-
s.add_dependency 'rucy', '~> 0.3.
|
|
30
|
-
s.add_dependency 'rays', '~> 0.3.
|
|
28
|
+
s.add_dependency 'xot', '~> 0.3.13'
|
|
29
|
+
s.add_dependency 'rucy', '~> 0.3.13'
|
|
30
|
+
s.add_dependency 'rays', '~> 0.3.13'
|
|
31
31
|
|
|
32
32
|
s.files = `git ls-files`.split $/
|
|
33
33
|
s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
|
data/samples/bats.rb
CHANGED
|
@@ -24,7 +24,7 @@ win = Reflex::Window.new do
|
|
|
24
24
|
angle = 0
|
|
25
25
|
speed = (rand * 2 - 1) * 30
|
|
26
26
|
|
|
27
|
-
on :update do
|
|
27
|
+
on :update do |e|
|
|
28
28
|
move_by rand(5) - 2, rand(5) - 2
|
|
29
29
|
angle += speed
|
|
30
30
|
angle %= 360
|
|
@@ -71,7 +71,7 @@ win = Reflex::Window.new do
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
add Reflex::TextView.new {
|
|
74
|
-
set name: :count,
|
|
74
|
+
set name: :count, frame: [10, 10, 100, 30], model: model
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
root.on :draw do |e|
|
|
@@ -21,7 +21,7 @@ class Win : public Window
|
|
|
21
21
|
|
|
22
22
|
void on_draw (DrawEvent* e)
|
|
23
23
|
{
|
|
24
|
-
e->painter->text(stringf("%f", e->fps), 10, 10);
|
|
24
|
+
e->painter()->text(stringf("%f", e->fps()), 10, 10);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
};// Window
|
|
@@ -64,8 +64,8 @@ class App : public Application
|
|
|
64
64
|
|
|
65
65
|
win->root()->add_child(view);
|
|
66
66
|
|
|
67
|
-
view->
|
|
68
|
-
view->
|
|
67
|
+
view->set_dynamic(true);
|
|
68
|
+
view->set_density(1);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|