reflexion 0.3.3 → 0.3.5
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 +20 -0
- data/.doc/ext/reflex/reflex.cpp +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- data/CONTRIBUTING.md +7 -0
- data/ChangeLog.md +21 -0
- data/README.md +46 -2
- data/VERSION +1 -1
- data/ext/reflex/extconf.rb +3 -3
- data/ext/reflex/key_event.cpp +20 -0
- data/ext/reflex/reflex.cpp +23 -0
- data/include/reflex/defs.h +23 -0
- data/include/reflex/view.h +10 -10
- data/lib/reflex/application.rb +2 -2
- data/lib/reflex/helper.rb +0 -12
- data/lib/reflex/shape.rb +2 -1
- data/lib/reflex/view.rb +10 -3
- data/lib/reflex/window.rb +2 -1
- data/reflex.gemspec +3 -3
- data/src/body.cpp +15 -5
- data/src/ios/event.h +5 -0
- data/src/ios/event.mm +84 -1
- data/src/ios/reflex.mm +5 -0
- data/src/ios/view_controller.mm +1 -7
- data/src/osx/event.h +5 -0
- data/src/osx/event.mm +87 -2
- data/src/osx/native_window.mm +1 -7
- data/src/osx/reflex.mm +5 -0
- data/src/view.cpp +56 -20
- data/src/win32/event.cpp +85 -1
- data/src/win32/event.h +3 -0
- data/src/win32/window.cpp +8 -7
- data/src/window.cpp +84 -34
- data/src/window.h +12 -1
- data/test/test_view.rb +51 -0
- metadata +16 -14
data/src/window.h
CHANGED
@@ -23,7 +23,7 @@ namespace Reflex
|
|
23
23
|
typedef std::list<Pointer> PointerList;
|
24
24
|
|
25
25
|
|
26
|
-
enum {
|
26
|
+
enum {CAPTURE_ALL_EVENTS = INT_MAX};
|
27
27
|
|
28
28
|
|
29
29
|
struct Window::Data
|
@@ -33,6 +33,13 @@ namespace Reflex
|
|
33
33
|
|
34
34
|
typedef std::map<View::Ref, CaptureTargetIDList> CaptureMap;
|
35
35
|
|
36
|
+
enum Flag
|
37
|
+
{
|
38
|
+
|
39
|
+
ACTIVE = Xot::bit(1, FLAG_LAST),
|
40
|
+
|
41
|
+
};// Flag
|
42
|
+
|
36
43
|
int hide_count = 1;
|
37
44
|
|
38
45
|
bool redraw = true;
|
@@ -82,6 +89,8 @@ namespace Reflex
|
|
82
89
|
|
83
90
|
Application::WindowList& Window_all ();
|
84
91
|
|
92
|
+
Window* Window_get_active ();
|
93
|
+
|
85
94
|
|
86
95
|
uint Window_default_flags ();
|
87
96
|
|
@@ -120,6 +129,8 @@ namespace Reflex
|
|
120
129
|
|
121
130
|
void Window_call_deactivate_event (Window* window);
|
122
131
|
|
132
|
+
void Window_call_update_event (Window* window);
|
133
|
+
|
123
134
|
void Window_call_draw_event (Window* window, DrawEvent* event);
|
124
135
|
|
125
136
|
void Window_call_key_event (Window* window, KeyEvent* event);
|
data/test/test_view.rb
CHANGED
@@ -373,6 +373,57 @@ class TestView < Test::Unit::TestCase
|
|
373
373
|
assert_raise(ArgumentError) {v.scroll_by 100}
|
374
374
|
end
|
375
375
|
|
376
|
+
def test_capture()
|
377
|
+
v, w = view, window
|
378
|
+
w.add v
|
379
|
+
assert_equal [], v.capture
|
380
|
+
|
381
|
+
v.capture = :key; assert_equal [:key], v.capture
|
382
|
+
v.capture = :pointer; assert_equal [:pointer], v.capture
|
383
|
+
v.capture = :all; assert_equal [:key, :pointer], v.capture
|
384
|
+
|
385
|
+
v.capture -= [:key]; assert_equal [:pointer], v.capture
|
386
|
+
v.capture += [:key]; assert_equal [:key, :pointer], v.capture
|
387
|
+
|
388
|
+
v.capture = []; assert_equal [], v.capture
|
389
|
+
v.capture += [:key, :pointer]; assert_equal [:key, :pointer], v.capture
|
390
|
+
v.capture = []; assert_equal [], v.capture
|
391
|
+
v.capture += [:all]; assert_equal [:key, :pointer], v.capture
|
392
|
+
|
393
|
+
v.capture -= []; assert_equal [:key, :pointer], v.capture
|
394
|
+
v.capture = []; assert_equal [], v.capture
|
395
|
+
v.capture += []; assert_equal [], v.capture
|
396
|
+
end
|
397
|
+
|
398
|
+
def test_capturing()
|
399
|
+
v, w = view, window
|
400
|
+
w.add v
|
401
|
+
|
402
|
+
v.capture = []
|
403
|
+
assert_false v.capturing?
|
404
|
+
assert_false v.capturing? :key
|
405
|
+
assert_false v.capturing? :pointer
|
406
|
+
assert_false v.capturing? :all
|
407
|
+
|
408
|
+
v.capture = :key
|
409
|
+
assert_true v.capturing?
|
410
|
+
assert_true v.capturing? :key
|
411
|
+
assert_false v.capturing? :pointer
|
412
|
+
assert_false v.capturing? :all
|
413
|
+
|
414
|
+
v.capture = :pointer
|
415
|
+
assert_true v.capturing?
|
416
|
+
assert_false v.capturing? :key
|
417
|
+
assert_true v.capturing? :pointer
|
418
|
+
assert_false v.capturing? :all
|
419
|
+
|
420
|
+
v.capture = :all
|
421
|
+
assert_true v.capturing?
|
422
|
+
assert_true v.capturing? :key
|
423
|
+
assert_true v.capturing? :pointer
|
424
|
+
assert_true v.capturing? :all
|
425
|
+
end
|
426
|
+
|
376
427
|
def test_parent()
|
377
428
|
parent, child = view, view
|
378
429
|
parent.add_child child
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reflexion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xot
|
@@ -16,60 +16,60 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.5
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.3.
|
29
|
+
version: 0.3.5
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.3.
|
32
|
+
version: 0.3.5
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rucy
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.3.
|
39
|
+
version: 0.3.5
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.3.
|
42
|
+
version: 0.3.5
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.3.
|
49
|
+
version: 0.3.5
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.3.
|
52
|
+
version: 0.3.5
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rays
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.3.
|
59
|
+
version: 0.3.5
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.3.
|
62
|
+
version: 0.3.5
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.3.
|
69
|
+
version: 0.3.5
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 0.3.
|
72
|
+
version: 0.3.5
|
73
73
|
description: This library helps you to develop interactive graphical user interface.
|
74
74
|
email: xordog@gmail.com
|
75
75
|
executables: []
|
@@ -143,10 +143,12 @@ files:
|
|
143
143
|
- ".doc/ext/reflex/view.cpp"
|
144
144
|
- ".doc/ext/reflex/wheel_event.cpp"
|
145
145
|
- ".doc/ext/reflex/window.cpp"
|
146
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
146
147
|
- ".github/workflows/release-gem.yml"
|
147
148
|
- ".github/workflows/tag.yml"
|
148
149
|
- ".github/workflows/test.yml"
|
149
150
|
- ".github/workflows/utils.rb"
|
151
|
+
- CONTRIBUTING.md
|
150
152
|
- ChangeLog.md
|
151
153
|
- Gemfile
|
152
154
|
- Gemfile.lock
|