reflexion 0.1.20 → 0.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/capture_event.cpp +6 -5
- data/.doc/ext/reflex/contact_event.cpp +18 -16
- data/.doc/ext/reflex/draw_event.cpp +10 -8
- data/.doc/ext/reflex/event.cpp +10 -10
- data/.doc/ext/reflex/focus_event.cpp +18 -17
- data/.doc/ext/reflex/frame_event.cpp +17 -17
- data/.doc/ext/reflex/key_event.cpp +227 -28
- data/.doc/ext/reflex/native.cpp +2 -0
- data/.doc/ext/reflex/pointer.cpp +158 -0
- data/.doc/ext/reflex/pointer_event.cpp +32 -91
- data/.doc/ext/reflex/scroll_event.cpp +14 -17
- data/.doc/ext/reflex/selector.cpp +8 -0
- data/.doc/ext/reflex/timer.cpp +9 -1
- data/.doc/ext/reflex/timer_event.cpp +4 -13
- data/.doc/ext/reflex/update_event.cpp +6 -5
- data/.doc/ext/reflex/view.cpp +57 -0
- data/.doc/ext/reflex/wheel_event.cpp +39 -22
- data/.doc/ext/reflex/window.cpp +41 -0
- data/VERSION +1 -1
- data/ext/reflex/capture_event.cpp +6 -5
- data/ext/reflex/contact_event.cpp +18 -16
- data/ext/reflex/draw_event.cpp +9 -7
- data/ext/reflex/event.cpp +11 -11
- data/ext/reflex/focus_event.cpp +18 -17
- data/ext/reflex/frame_event.cpp +16 -16
- data/ext/reflex/key_event.cpp +228 -28
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/pointer.cpp +170 -0
- data/ext/reflex/pointer_event.cpp +31 -96
- data/ext/reflex/scroll_event.cpp +15 -18
- data/ext/reflex/selector.cpp +9 -0
- data/ext/reflex/timer.cpp +15 -6
- data/ext/reflex/timer_event.cpp +9 -19
- data/ext/reflex/update_event.cpp +6 -5
- data/ext/reflex/view.cpp +67 -3
- data/ext/reflex/wheel_event.cpp +40 -21
- data/ext/reflex/window.cpp +49 -3
- data/include/reflex/defs.h +140 -106
- data/include/reflex/event.h +232 -124
- data/include/reflex/pointer.h +107 -0
- data/include/reflex/ruby/pointer.h +41 -0
- data/include/reflex/ruby/view.h +9 -0
- data/include/reflex/ruby/window.h +9 -0
- data/include/reflex/selector.h +1 -1
- data/include/reflex/shape.h +2 -2
- data/include/reflex/view.h +6 -4
- data/include/reflex/window.h +14 -8
- data/lib/reflex/application.rb +3 -3
- data/lib/reflex/autoinit.rb +1 -1
- data/lib/reflex/button.rb +7 -7
- data/lib/reflex/capture_event.rb +7 -7
- data/lib/reflex/contact_event.rb +10 -10
- data/lib/reflex/draw_event.rb +2 -2
- data/lib/reflex/ellipse_shape.rb +2 -2
- data/lib/reflex/focus_event.rb +11 -11
- data/lib/reflex/frame_event.rb +5 -5
- data/lib/reflex/helper.rb +20 -20
- data/lib/reflex/image_view.rb +2 -2
- data/lib/reflex/key_event.rb +12 -12
- data/lib/reflex/model.rb +22 -22
- data/lib/reflex/model_owner.rb +7 -7
- data/lib/reflex/model_view.rb +1 -1
- data/lib/reflex/module.rb +5 -5
- data/lib/reflex/pointer.rb +107 -0
- data/lib/reflex/pointer_event.rb +16 -54
- data/lib/reflex/polygon_shape.rb +2 -2
- data/lib/reflex/reflex.rb +3 -3
- data/lib/reflex/scroll_event.rb +1 -1
- data/lib/reflex/selector.rb +4 -4
- data/lib/reflex/shape.rb +13 -13
- data/lib/reflex/style.rb +11 -11
- data/lib/reflex/style_length.rb +1 -1
- data/lib/reflex/text_view.rb +2 -2
- data/lib/reflex/timer.rb +2 -2
- data/lib/reflex/timer_event.rb +3 -2
- data/lib/reflex/update_event.rb +1 -1
- data/lib/reflex/view.rb +32 -32
- data/lib/reflex/wheel_event.rb +2 -10
- data/lib/reflex/window.rb +8 -7
- data/lib/reflex.rb +1 -0
- data/lib/reflexion.rb +17 -17
- data/reflex.gemspec +5 -5
- data/samples/reflexion/noise.rb +1 -1
- data/samples/tree.rb +1 -1
- data/src/event.cpp +792 -86
- data/src/event.h +47 -0
- data/src/image_view.cpp +2 -2
- data/src/ios/event.h +15 -3
- data/src/ios/event.mm +126 -11
- data/src/ios/view_controller.mm +51 -23
- data/src/ios/window.mm +18 -0
- data/src/osx/event.h +15 -4
- data/src/osx/event.mm +214 -24
- data/src/osx/native_window.mm +85 -18
- data/src/osx/window.mm +22 -0
- data/src/pointer.cpp +203 -0
- data/src/pointer.h +26 -0
- data/src/selector.cpp +1 -1
- data/src/shape.cpp +11 -13
- data/src/shape.h +1 -1
- data/src/view.cpp +205 -118
- data/src/view.h +5 -10
- data/src/window.cpp +346 -104
- data/src/window.h +28 -3
- data/src/world.cpp +6 -4
- data/test/helper.rb +3 -3
- data/test/test_application.rb +1 -1
- data/test/test_capture_event.rb +22 -6
- data/test/test_contact_event.rb +40 -0
- data/test/test_draw_event.rb +35 -0
- data/test/test_event.rb +33 -5
- data/test/test_focus_event.rb +34 -0
- data/test/test_frame_event.rb +38 -0
- data/test/test_has_frame.rb +11 -11
- data/test/test_key_event.rb +33 -0
- data/test/test_pointer.rb +149 -0
- data/test/test_pointer_event.rb +70 -104
- data/test/test_reflex.rb +1 -1
- data/test/test_scroll_event.rb +39 -0
- data/test/test_selector.rb +15 -8
- data/test/test_shape.rb +8 -8
- data/test/test_style.rb +13 -13
- data/test/test_style_length.rb +5 -5
- data/test/test_timer_event.rb +38 -0
- data/test/test_update_event.rb +29 -0
- data/test/test_view.rb +57 -30
- data/test/test_wheel_event.rb +40 -0
- data/test/test_window.rb +45 -26
- metadata +64 -35
data/lib/reflex/window.rb
CHANGED
@@ -24,7 +24,7 @@ module Reflex
|
|
24
24
|
:timeout, :delay, :interval,
|
25
25
|
:add_child, :add,
|
26
26
|
:remove_child, :remove,
|
27
|
-
:find_child,
|
27
|
+
:children, :find_child, :find, :find_children,
|
28
28
|
:style, :styles, :scroll_to, :scroll_by, :scroll,
|
29
29
|
:meter2pixel, :meter, :wall,
|
30
30
|
:zoom=, :zoom,
|
@@ -48,25 +48,26 @@ module Reflex
|
|
48
48
|
:friction=, :friction,
|
49
49
|
:restitution=, :restitution
|
50
50
|
|
51
|
-
universal_accessor :title, :frame
|
51
|
+
universal_accessor :title, :frame,
|
52
|
+
resizable: {reader: :resizable?}
|
52
53
|
|
53
|
-
def initialize
|
54
|
+
def initialize(options = nil, &block)
|
54
55
|
super()
|
55
56
|
set options if options
|
56
57
|
@show_block = block
|
57
58
|
end
|
58
59
|
|
59
|
-
def paint
|
60
|
-
painter.begin
|
60
|
+
def paint(&block)
|
61
|
+
painter.begin(&block)
|
61
62
|
end
|
62
63
|
|
63
|
-
def self.show
|
64
|
+
def self.show(*args, &block)
|
64
65
|
new(*args, &block).show
|
65
66
|
end
|
66
67
|
|
67
68
|
private
|
68
69
|
|
69
|
-
def call_show_block
|
70
|
+
def call_show_block()
|
70
71
|
return unless @show_block
|
71
72
|
Xot::BlockUtil.instance_eval_or_block_call self, &@show_block
|
72
73
|
@show_block = nil
|
data/lib/reflex.rb
CHANGED
data/lib/reflexion.rb
CHANGED
@@ -18,7 +18,7 @@ module Reflexion
|
|
18
18
|
}
|
19
19
|
|
20
20
|
|
21
|
-
def call_event
|
21
|
+
def call_event(event, *args, &block)
|
22
22
|
$event = event
|
23
23
|
Xot::BlockUtil.instance_eval_or_block_call *args, &block if block
|
24
24
|
$event = nil
|
@@ -27,7 +27,7 @@ module Reflexion
|
|
27
27
|
|
28
28
|
class App < Application
|
29
29
|
|
30
|
-
def on_motion
|
30
|
+
def on_motion(e)
|
31
31
|
super
|
32
32
|
call_event e, e, &$motion
|
33
33
|
end
|
@@ -39,29 +39,29 @@ module Reflexion
|
|
39
39
|
|
40
40
|
attr_reader :event
|
41
41
|
|
42
|
-
def initialize
|
42
|
+
def initialize(*args, &block)
|
43
43
|
super
|
44
44
|
$window = self
|
45
45
|
call_event nil, self, &$setup
|
46
46
|
end
|
47
47
|
|
48
|
-
def on_update
|
48
|
+
def on_update(e)
|
49
49
|
super
|
50
50
|
redraw
|
51
51
|
call_event e, e, &$update
|
52
52
|
end
|
53
53
|
|
54
|
-
def on_draw
|
54
|
+
def on_draw(e)
|
55
55
|
super
|
56
56
|
call_event e, e.painter, &$draw
|
57
57
|
end
|
58
58
|
|
59
|
-
def on_key
|
59
|
+
def on_key(e)
|
60
60
|
super
|
61
61
|
call_event e, e, &$key
|
62
62
|
end
|
63
63
|
|
64
|
-
def on_pointer
|
64
|
+
def on_pointer(e)
|
65
65
|
super
|
66
66
|
call_event e, e, &$pointer
|
67
67
|
end
|
@@ -71,43 +71,43 @@ module Reflexion
|
|
71
71
|
|
72
72
|
module_function
|
73
73
|
|
74
|
-
def window
|
74
|
+
def window()
|
75
75
|
$window ||= MainWindow.new DEFAULTS
|
76
76
|
end
|
77
77
|
|
78
|
-
def event
|
78
|
+
def event()
|
79
79
|
$event
|
80
80
|
end
|
81
81
|
|
82
|
-
def setup
|
82
|
+
def setup(&block)
|
83
83
|
$setup = block
|
84
84
|
end
|
85
85
|
|
86
|
-
def update
|
86
|
+
def update(&block)
|
87
87
|
$update = block
|
88
88
|
end
|
89
89
|
|
90
|
-
def draw
|
90
|
+
def draw(&block)
|
91
91
|
$draw = block
|
92
92
|
end
|
93
93
|
|
94
|
-
def key
|
94
|
+
def key(&block)
|
95
95
|
$key = block
|
96
96
|
end
|
97
97
|
|
98
|
-
def pointer
|
98
|
+
def pointer(&block)
|
99
99
|
$pointer = block
|
100
100
|
end
|
101
101
|
|
102
|
-
def motion
|
102
|
+
def motion(&block)
|
103
103
|
$motion = block
|
104
104
|
end
|
105
105
|
|
106
|
-
def start
|
106
|
+
def start()
|
107
107
|
App.new {window.show}.start
|
108
108
|
end
|
109
109
|
|
110
|
-
def quit
|
110
|
+
def quit()
|
111
111
|
window.close
|
112
112
|
end
|
113
113
|
|
data/reflex.gemspec
CHANGED
@@ -26,12 +26,12 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.homepage = "https://github.com/xord/reflex"
|
27
27
|
|
28
28
|
s.platform = Gem::Platform::RUBY
|
29
|
-
s.required_ruby_version = '
|
29
|
+
s.required_ruby_version = '>= 2.6.0'
|
30
30
|
|
31
|
-
s.add_runtime_dependency 'xot', '~> 0.1.
|
32
|
-
s.add_runtime_dependency 'rucy', '~> 0.1.
|
33
|
-
s.add_runtime_dependency 'beeps', '~> 0.1.
|
34
|
-
s.add_runtime_dependency 'rays', '~> 0.1.
|
31
|
+
s.add_runtime_dependency 'xot', '~> 0.1.24'
|
32
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.24'
|
33
|
+
s.add_runtime_dependency 'beeps', '~> 0.1.24'
|
34
|
+
s.add_runtime_dependency 'rays', '~> 0.1.24'
|
35
35
|
|
36
36
|
s.files = `git ls-files`.split $/
|
37
37
|
s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
|
data/samples/reflexion/noise.rb
CHANGED