reflexion 0.1.35 → 0.1.36
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/view.cpp +17 -0
- data/ChangeLog.md +10 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/ext/reflex/extconf.rb +0 -3
- data/ext/reflex/view.cpp +19 -0
- data/include/reflex/event.h +1 -1
- data/include/reflex/view.h +6 -0
- data/lib/reflex/application.rb +2 -3
- data/lib/reflex/autoinit.rb +0 -3
- data/lib/reflex/bitmap.rb +0 -3
- data/lib/reflex/bounds.rb +0 -3
- data/lib/reflex/button.rb +0 -3
- data/lib/reflex/camera.rb +0 -3
- data/lib/reflex/capture_event.rb +0 -3
- data/lib/reflex/color.rb +0 -3
- data/lib/reflex/color_space.rb +0 -3
- data/lib/reflex/contact_event.rb +0 -3
- data/lib/reflex/draw_event.rb +0 -3
- data/lib/reflex/ellipse_shape.rb +0 -3
- data/lib/reflex/ext.rb +0 -3
- data/lib/reflex/extension.rb +0 -3
- data/lib/reflex/filter.rb +0 -3
- data/lib/reflex/fixture.rb +0 -3
- data/lib/reflex/focus_event.rb +0 -3
- data/lib/reflex/font.rb +0 -3
- data/lib/reflex/frame_event.rb +0 -3
- data/lib/reflex/helper.rb +0 -3
- data/lib/reflex/image.rb +0 -3
- data/lib/reflex/image_view.rb +0 -3
- data/lib/reflex/key_event.rb +0 -3
- data/lib/reflex/line_shape.rb +0 -3
- data/lib/reflex/list_view.rb +0 -3
- data/lib/reflex/matrix.rb +0 -3
- data/lib/reflex/model.rb +0 -3
- data/lib/reflex/model_owner.rb +0 -3
- data/lib/reflex/model_view.rb +0 -3
- data/lib/reflex/painter.rb +0 -3
- data/lib/reflex/point.rb +0 -3
- data/lib/reflex/pointer.rb +0 -3
- data/lib/reflex/pointer_event.rb +0 -3
- data/lib/reflex/polygon.rb +0 -3
- data/lib/reflex/polygon_shape.rb +0 -3
- data/lib/reflex/polyline.rb +0 -3
- data/lib/reflex/rect_shape.rb +0 -3
- data/lib/reflex/reflex.rb +0 -3
- data/lib/reflex/scroll_event.rb +0 -3
- data/lib/reflex/selector.rb +0 -3
- data/lib/reflex/shader.rb +0 -3
- data/lib/reflex/shape.rb +0 -3
- data/lib/reflex/style.rb +0 -3
- data/lib/reflex/style_length.rb +0 -3
- data/lib/reflex/text_view.rb +0 -3
- data/lib/reflex/timer.rb +0 -3
- data/lib/reflex/timer_event.rb +0 -3
- data/lib/reflex/update_event.rb +0 -3
- data/lib/reflex/view.rb +10 -4
- data/lib/reflex/wheel_event.rb +0 -3
- data/lib/reflex/window.rb +2 -3
- data/lib/reflex.rb +0 -3
- data/lib/reflexion/include.rb +0 -3
- data/lib/reflexion.rb +0 -3
- data/reflex.gemspec +5 -5
- data/samples/app.rb +0 -3
- data/samples/bats.rb +0 -3
- data/samples/camera.rb +0 -3
- data/samples/checker.rb +0 -3
- data/samples/fans.rb +0 -3
- data/samples/fps.rb +0 -3
- data/samples/grid.rb +0 -3
- data/samples/hello.rb +0 -3
- data/samples/image.rb +0 -3
- data/samples/key.rb +0 -3
- data/samples/layout.rb +0 -3
- data/samples/model.rb +0 -3
- data/samples/physics.rb +0 -3
- data/samples/reflexion/breakout.rb +0 -3
- data/samples/reflexion/hello.rb +0 -3
- data/samples/reflexion/jump_action.rb +0 -3
- data/samples/reflexion/noise.rb +0 -3
- data/samples/reflexion/paint.rb +0 -3
- data/samples/reflexion/physics.rb +0 -3
- data/samples/reflexion/pulse.rb +0 -3
- data/samples/repl.rb +0 -3
- data/samples/shader.rb +0 -3
- data/samples/shapes.rb +0 -3
- data/samples/text.rb +0 -3
- data/samples/tree.rb +0 -3
- data/samples/views.rb +0 -3
- data/samples/visuals.rb +0 -3
- data/src/body.cpp +14 -0
- data/src/body.h +4 -0
- data/src/event.cpp +27 -28
- data/src/view.cpp +89 -14
- data/src/window.cpp +4 -2
- data/test/helper.rb +0 -3
- data/test/test_application.rb +4 -3
- data/test/test_capture_event.rb +0 -3
- data/test/test_contact_event.rb +0 -3
- data/test/test_draw_event.rb +0 -3
- data/test/test_event.rb +1 -4
- data/test/test_focus_event.rb +0 -3
- data/test/test_frame_event.rb +0 -3
- data/test/test_has_frame.rb +0 -3
- data/test/test_key_event.rb +0 -3
- data/test/test_model.rb +0 -3
- data/test/test_model_owner.rb +0 -3
- data/test/test_pointer.rb +0 -3
- data/test/test_pointer_event.rb +0 -3
- data/test/test_reflex_init.rb +0 -3
- data/test/test_scroll_event.rb +0 -3
- data/test/test_selector.rb +0 -3
- data/test/test_shape.rb +0 -3
- data/test/test_style.rb +0 -3
- data/test/test_style_length.rb +0 -3
- data/test/test_timer_event.rb +0 -3
- data/test/test_update_event.rb +0 -3
- data/test/test_view.rb +37 -3
- data/test/test_wheel_event.rb +0 -3
- data/test/test_window.rb +4 -3
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54f32e8f80f2156f47dca7b252f81acf4bf0dc45aab45d7af8d3fb2418141a6c
|
4
|
+
data.tar.gz: 538889ab97d5fec6fc47a3a8a99bec4856d9a3e763ffcd2c438d81f1ca92422d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad6c799423f7c91fd99ca2eb9821d817e78eda67a1de868cedf632d9c888abfb9a46ea46a2c78f532a47ff28a8cd008344c230cd7c8560e8ac796ba3cf2d415
|
7
|
+
data.tar.gz: caa79e8872fb1c7a6633c57d4316318ed6a3754a792c07179c3493c6b8767e7c740cf6261f87885cde24b63f4c066db36d69ed57a559769b9c6f7a44185d918c
|
data/.doc/ext/reflex/view.cpp
CHANGED
@@ -404,6 +404,21 @@ VALUE get_angle(VALUE self)
|
|
404
404
|
return value(THIS->angle());
|
405
405
|
}
|
406
406
|
|
407
|
+
static
|
408
|
+
VALUE set_pivot(VALUE self, VALUE x, VALUE y, VALUE z)
|
409
|
+
{
|
410
|
+
CHECK;
|
411
|
+
THIS->set_pivot(to<float>(x), to<float>(y), to<float>(z));
|
412
|
+
return value(THIS->pivot());
|
413
|
+
}
|
414
|
+
|
415
|
+
static
|
416
|
+
VALUE get_pivot(VALUE self)
|
417
|
+
{
|
418
|
+
CHECK;
|
419
|
+
return value(THIS->pivot());
|
420
|
+
}
|
421
|
+
|
407
422
|
static
|
408
423
|
VALUE scroll_to(VALUE self)
|
409
424
|
{
|
@@ -1060,6 +1075,8 @@ Init_reflex_view ()
|
|
1060
1075
|
rb_define_method(cView, "fit_to_content", RUBY_METHOD_FUNC(fit_to_content), 0);
|
1061
1076
|
rb_define_method(cView, "angle=", RUBY_METHOD_FUNC(set_angle), 1);
|
1062
1077
|
rb_define_method(cView, "angle", RUBY_METHOD_FUNC(get_angle), 0);
|
1078
|
+
cView.define_private_method("set_pivot!", set_pivot);
|
1079
|
+
rb_define_method(cView, "pivot", RUBY_METHOD_FUNC(get_pivot), 0);
|
1063
1080
|
rb_define_method(cView, "scroll_to", RUBY_METHOD_FUNC(scroll_to), -1);
|
1064
1081
|
rb_define_method(cView, "scroll_by", RUBY_METHOD_FUNC(scroll_by), -1);
|
1065
1082
|
rb_define_method(cView, "scroll", RUBY_METHOD_FUNC(get_scroll), 0);
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
# reflex ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.1.36] - 2023-05-08
|
5
|
+
|
6
|
+
- Add inspect()
|
7
|
+
- Add View#pivot accessor
|
8
|
+
- Awake view body on every pointer event
|
9
|
+
- Disable blocking event escalation
|
10
|
+
- Check is view valid before calling event handlers
|
11
|
+
- Fix pointer position for rotated view
|
12
|
+
|
13
|
+
|
4
14
|
## [v0.1.35] - 2023-04-30
|
5
15
|
|
6
16
|
- Add View#on_zoom(e)
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.36
|
data/ext/reflex/extconf.rb
CHANGED
data/ext/reflex/view.cpp
CHANGED
@@ -445,6 +445,23 @@ RUCY_DEF0(get_angle)
|
|
445
445
|
}
|
446
446
|
RUCY_END
|
447
447
|
|
448
|
+
static
|
449
|
+
RUCY_DEF3(set_pivot, x, y, z)
|
450
|
+
{
|
451
|
+
CHECK;
|
452
|
+
THIS->set_pivot(to<float>(x), to<float>(y), to<float>(z));
|
453
|
+
return value(THIS->pivot());
|
454
|
+
}
|
455
|
+
RUCY_END
|
456
|
+
|
457
|
+
static
|
458
|
+
RUCY_DEF0(get_pivot)
|
459
|
+
{
|
460
|
+
CHECK;
|
461
|
+
return value(THIS->pivot());
|
462
|
+
}
|
463
|
+
RUCY_END
|
464
|
+
|
448
465
|
static
|
449
466
|
RUCY_DEFN(scroll_to)
|
450
467
|
{
|
@@ -1176,6 +1193,8 @@ Init_reflex_view ()
|
|
1176
1193
|
cView.define_method("fit_to_content", fit_to_content);
|
1177
1194
|
cView.define_method("angle=", set_angle);
|
1178
1195
|
cView.define_method("angle", get_angle);
|
1196
|
+
cView.define_private_method("set_pivot!", set_pivot);
|
1197
|
+
cView.define_method( "pivot", get_pivot);
|
1179
1198
|
cView.define_method("scroll_to", scroll_to);
|
1180
1199
|
cView.define_method("scroll_by", scroll_by);
|
1181
1200
|
cView.define_method("scroll", get_scroll);
|
data/include/reflex/event.h
CHANGED
data/include/reflex/view.h
CHANGED
@@ -217,6 +217,12 @@ namespace Reflex
|
|
217
217
|
|
218
218
|
virtual float angle () const;
|
219
219
|
|
220
|
+
virtual void set_pivot (float x, float y, float z = 0);
|
221
|
+
|
222
|
+
virtual void set_pivot (const Point& pivot);
|
223
|
+
|
224
|
+
virtual const Point& pivot () const;
|
225
|
+
|
220
226
|
virtual void scroll_to (coord x, coord y, coord z = 0);
|
221
227
|
|
222
228
|
virtual void scroll_to (const Point& scroll);
|
data/lib/reflex/application.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
1
|
require 'xot/setter'
|
5
2
|
require 'xot/universal_accessor'
|
6
3
|
require 'xot/block_util'
|
4
|
+
require 'xot/inspectable'
|
7
5
|
require 'reflex/ext'
|
8
6
|
require 'reflex/helper'
|
9
7
|
|
@@ -14,6 +12,7 @@ module Reflex
|
|
14
12
|
class Application
|
15
13
|
|
16
14
|
include Xot::Setter
|
15
|
+
include Xot::Inspectable
|
17
16
|
include Hookable
|
18
17
|
|
19
18
|
universal_accessor :name
|
data/lib/reflex/autoinit.rb
CHANGED
data/lib/reflex/bitmap.rb
CHANGED
data/lib/reflex/bounds.rb
CHANGED
data/lib/reflex/button.rb
CHANGED
data/lib/reflex/camera.rb
CHANGED
data/lib/reflex/capture_event.rb
CHANGED
data/lib/reflex/color.rb
CHANGED
data/lib/reflex/color_space.rb
CHANGED
data/lib/reflex/contact_event.rb
CHANGED
data/lib/reflex/draw_event.rb
CHANGED
data/lib/reflex/ellipse_shape.rb
CHANGED
data/lib/reflex/ext.rb
CHANGED
data/lib/reflex/extension.rb
CHANGED
data/lib/reflex/filter.rb
CHANGED
data/lib/reflex/fixture.rb
CHANGED
data/lib/reflex/focus_event.rb
CHANGED
data/lib/reflex/font.rb
CHANGED
data/lib/reflex/frame_event.rb
CHANGED
data/lib/reflex/helper.rb
CHANGED
data/lib/reflex/image.rb
CHANGED
data/lib/reflex/image_view.rb
CHANGED
data/lib/reflex/key_event.rb
CHANGED
data/lib/reflex/line_shape.rb
CHANGED
data/lib/reflex/list_view.rb
CHANGED
data/lib/reflex/matrix.rb
CHANGED
data/lib/reflex/model.rb
CHANGED
data/lib/reflex/model_owner.rb
CHANGED
data/lib/reflex/model_view.rb
CHANGED
data/lib/reflex/painter.rb
CHANGED
data/lib/reflex/point.rb
CHANGED
data/lib/reflex/pointer.rb
CHANGED
data/lib/reflex/pointer_event.rb
CHANGED
data/lib/reflex/polygon.rb
CHANGED
data/lib/reflex/polygon_shape.rb
CHANGED
data/lib/reflex/polyline.rb
CHANGED
data/lib/reflex/rect_shape.rb
CHANGED
data/lib/reflex/reflex.rb
CHANGED
data/lib/reflex/scroll_event.rb
CHANGED
data/lib/reflex/selector.rb
CHANGED
data/lib/reflex/shader.rb
CHANGED
data/lib/reflex/shape.rb
CHANGED
data/lib/reflex/style.rb
CHANGED
data/lib/reflex/style_length.rb
CHANGED
data/lib/reflex/text_view.rb
CHANGED
data/lib/reflex/timer.rb
CHANGED
data/lib/reflex/timer_event.rb
CHANGED
data/lib/reflex/update_event.rb
CHANGED
data/lib/reflex/view.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
1
|
require 'forwardable'
|
5
2
|
require 'xot/setter'
|
6
3
|
require 'xot/bit_flag_accessor'
|
@@ -100,6 +97,14 @@ module Reflex
|
|
100
97
|
to_enum :each_shape
|
101
98
|
end
|
102
99
|
|
100
|
+
def pivot=(arg)
|
101
|
+
case arg
|
102
|
+
when Point then set_pivot! arg.x, arg.y, arg.z
|
103
|
+
when Array then set_pivot! arg[0], arg[1], arg[2] || 0
|
104
|
+
else raise ArgumentError
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
103
108
|
def capturing?(*args)
|
104
109
|
cap = capture
|
105
110
|
args.all? {|type| cap.include? type}
|
@@ -114,7 +119,8 @@ module Reflex
|
|
114
119
|
def on_contact_end(e)
|
115
120
|
end
|
116
121
|
|
117
|
-
universal_accessor :shape, :name, :selector,
|
122
|
+
universal_accessor :shape, :name, :selector,
|
123
|
+
:frame, :angle, :pivot, :zoom, :capture,
|
118
124
|
:density, :friction, :restitution,
|
119
125
|
:linear_velocity, :angular_velocity, :gravity_scale,
|
120
126
|
:gravity, :time_scale,
|
data/lib/reflex/wheel_event.rb
CHANGED
data/lib/reflex/window.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
1
|
require 'forwardable'
|
5
2
|
require 'xot/setter'
|
6
3
|
require 'xot/universal_accessor'
|
7
4
|
require 'xot/block_util'
|
5
|
+
require 'xot/inspectable'
|
8
6
|
require 'reflex/ext'
|
9
7
|
require 'reflex/helper'
|
10
8
|
|
@@ -15,6 +13,7 @@ module Reflex
|
|
15
13
|
class Window
|
16
14
|
|
17
15
|
include Xot::Setter
|
16
|
+
include Xot::Inspectable
|
18
17
|
include Hookable
|
19
18
|
include HasFrame
|
20
19
|
|
data/lib/reflex.rb
CHANGED
data/lib/reflexion/include.rb
CHANGED
data/lib/reflexion.rb
CHANGED
data/reflex.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# -*- mode: ruby
|
1
|
+
# -*- mode: ruby -*-
|
2
2
|
|
3
3
|
|
4
4
|
File.expand_path('lib', __dir__)
|
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.platform = Gem::Platform::RUBY
|
29
29
|
s.required_ruby_version = '>= 2.7.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.35'
|
32
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.35'
|
33
|
+
s.add_runtime_dependency 'beeps', '~> 0.1.36'
|
34
|
+
s.add_runtime_dependency 'rays', '~> 0.1.35'
|
35
35
|
|
36
36
|
s.add_development_dependency 'rake'
|
37
37
|
s.add_development_dependency 'test-unit'
|
data/samples/app.rb
CHANGED