reflexion 0.3.9 → 0.3.11

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.
data/src/window.cpp CHANGED
@@ -5,6 +5,7 @@
5
5
  #include <algorithm>
6
6
  #include <set>
7
7
  #include "reflex/exception.h"
8
+ #include "reflex/debug.h"
8
9
  #include "view.h"
9
10
  #include "event.h"
10
11
 
@@ -250,22 +251,7 @@ namespace Reflex
250
251
  if (!event)
251
252
  argument_error(__FILE__, __LINE__);
252
253
 
253
- for (auto& [view, targets] : window->self->captures)
254
- {
255
- if (
256
- !view->window() ||
257
- !is_capturing(view.get(), targets, View::CAPTURE_KEY))
258
- {
259
- continue;
260
- }
261
-
262
- KeyEvent e = event->dup();
263
- KeyEvent_set_captured(&e, true);
264
- View_call_key_event(const_cast<View*>(view.get()), &e);
265
- }
266
-
267
- if (!event->is_blocked())
268
- window->on_key(event);
254
+ window->on_key(event);
269
255
 
270
256
  if (!event->is_blocked())
271
257
  {
@@ -277,6 +263,25 @@ namespace Reflex
277
263
  }
278
264
  }
279
265
 
266
+ if (!event->is_blocked())
267
+ {
268
+ for (auto& [view, targets] : window->self->captures)
269
+ {
270
+ if (
271
+ !view->window() ||
272
+ !is_capturing(view.get(), targets, View::CAPTURE_KEY))
273
+ {
274
+ continue;
275
+ }
276
+
277
+ KeyEvent e = event->dup();
278
+ KeyEvent_set_captured(&e, true);
279
+ View_call_key_event(const_cast<View*>(view.get()), &e);
280
+
281
+ if (e.is_blocked()) event->block();
282
+ }
283
+ }
284
+
280
285
  if (!event->is_blocked() && window->self->focus)
281
286
  View_call_key_event(window->self->focus.get(), event);
282
287
 
@@ -566,12 +571,10 @@ namespace Reflex
566
571
 
567
572
  setup_pointer_event(window, event);
568
573
 
569
- call_captured_pointer_events(window, event);
570
-
571
- if (!event->is_blocked() && !event->empty())
574
+ if (!event->empty())
572
575
  window->on_pointer(event);
573
576
 
574
- if (!event->is_blocked() && !event->empty())
577
+ if (!event->empty() && !event->is_blocked())
575
578
  {
576
579
  switch ((*event)[0].action())
577
580
  {
@@ -583,7 +586,10 @@ namespace Reflex
583
586
  }
584
587
  }
585
588
 
586
- if (!event->is_blocked() && !event->empty())
589
+ if (!event->empty() && !event->is_blocked())
590
+ call_captured_pointer_events(window, event);
591
+
592
+ if (!event->empty() && !event->is_blocked())
587
593
  {
588
594
  PointerEvent_update_for_child_view(event, window->root());
589
595
  View_call_pointer_event(window->root(), event);
@@ -600,9 +606,11 @@ namespace Reflex
600
606
  if (!event)
601
607
  argument_error(__FILE__, __LINE__);
602
608
 
603
- window->on_wheel(event);
609
+ if (!event->is_blocked())
610
+ window->on_wheel(event);
604
611
 
605
- View_call_wheel_event(window->root(), event);
612
+ if (!event->is_blocked())
613
+ View_call_wheel_event(window->root(), event);
606
614
  }
607
615
 
608
616
  static void
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.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2026-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,60 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.8
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.3.8
19
+ version: 0.3.10
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 0.3.8
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.3.8
26
+ version: 0.3.10
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rucy
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: 0.3.8
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.3.8
33
+ version: 0.3.10
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: 0.3.8
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.3.8
40
+ version: 0.3.10
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: rays
55
43
  requirement: !ruby/object:Gem::Requirement
56
44
  requirements:
57
45
  - - "~>"
58
46
  - !ruby/object:Gem::Version
59
- version: 0.3.8
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 0.3.8
47
+ version: 0.3.10
63
48
  type: :runtime
64
49
  prerelease: false
65
50
  version_requirements: !ruby/object:Gem::Requirement
66
51
  requirements:
67
52
  - - "~>"
68
53
  - !ruby/object:Gem::Version
69
- version: 0.3.8
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 0.3.8
54
+ version: 0.3.10
73
55
  description: This library helps you to develop interactive graphical user interface.
74
56
  email: xordog@gmail.com
75
57
  executables: []
@@ -158,6 +140,7 @@ files:
158
140
  - ".github/workflows/tag.yml"
159
141
  - ".github/workflows/test.yml"
160
142
  - ".github/workflows/utils.rb"
143
+ - CLAUDE.md
161
144
  - CONTRIBUTING.md
162
145
  - ChangeLog.md
163
146
  - Gemfile
@@ -398,6 +381,16 @@ files:
398
381
  - src/pointer.h
399
382
  - src/queue.h
400
383
  - src/reflex.cpp
384
+ - src/sdl/application.cpp
385
+ - src/sdl/device.cpp
386
+ - src/sdl/gamepad.cpp
387
+ - src/sdl/opengl.cpp
388
+ - src/sdl/opengl.h
389
+ - src/sdl/reflex.cpp
390
+ - src/sdl/screen.cpp
391
+ - src/sdl/screen.h
392
+ - src/sdl/window.cpp
393
+ - src/sdl/window.h
401
394
  - src/selector.cpp
402
395
  - src/selector.h
403
396
  - src/shape.cpp