reflexion 0.1.27 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52288a5e598995e6c18b383655f5d20b4a0262237746b88ed5408cf3e5554025
4
- data.tar.gz: ddd6f6977200341f3afd26f17d49c744ae1e47b76c33df93bd92f2d9283dcf41
3
+ metadata.gz: 4d798021f6a8adb1c8396c941d089c0b15e48149cf33015b2f1c3b3b10f66182
4
+ data.tar.gz: 0a3ba29819e4427f6293cdec727528930359705f70a1309c3acaf039498d7075
5
5
  SHA512:
6
- metadata.gz: f7935b26729230d5827e0b40fa3750fb522422727fb600aa5433b9ae08576d63af57bdb590f858d9e5d2215e2efe7b22a455bdb49ff9078339f0781b9c124630
7
- data.tar.gz: 3ca780dfc92485cccef7583aaaf40a337a215f3567b2e09cbe2a2917bd5f70663917e946f365c2eed214bbda492f7fc6c1d17735a712efdddff2600d03b023b9
6
+ metadata.gz: 195ac752005635274c9c371bd9775b2ec2244f8878fd3a1cd7e83b4b4c2b430511804136ddbb538ba39e388faac781eb373d17760ea04b0caa31fc5c83eaf0bd
7
+ data.tar.gz: b19bebd335578dbc3df9772acb239cc8c4774a0a85072846914d8e2e586df69c99ef0bc13b8d198887c62305e838b2c9241ab62f55f48f7dd8101d55d4dbc642
@@ -0,0 +1,45 @@
1
+ #include "reflex/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cReflexError;
8
+ static Class cLayoutError;
9
+ static Class cPhysicsError;
10
+
11
+ void
12
+ Init_exception ()
13
+ {
14
+ Module mReflex = rb_define_module("Reflex");
15
+
16
+ cReflexError = rb_define_class_under(mReflex, "ReflexError", rb_eRuntimeError);
17
+ cLayoutError = rb_define_class_under(mReflex, "LayoutError", cReflexError);
18
+ cPhysicsError = rb_define_class_under(mReflex, "PhysicsError", cReflexError);
19
+ }
20
+
21
+
22
+ namespace Reflex
23
+ {
24
+
25
+
26
+ Class
27
+ reflex_error_class ()
28
+ {
29
+ return cReflexError;
30
+ }
31
+
32
+ Class
33
+ layout_error_class ()
34
+ {
35
+ return cLayoutError;
36
+ }
37
+
38
+ Class
39
+ physics_error_class ()
40
+ {
41
+ return cPhysicsError;
42
+ }
43
+
44
+
45
+ }// Reflex
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  void Init_reflex ();
5
+ void Init_exception ();
5
6
 
6
7
  void Init_selector ();
7
8
  void Init_style ();
@@ -49,6 +50,7 @@ extern "C" void
49
50
  Rucy::init();
50
51
 
51
52
  Init_reflex();
53
+ Init_exception();
52
54
 
53
55
  Init_selector();
54
56
  Init_style();
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.27
1
+ 0.1.29
data/ext/reflex/defs.h CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy.h>
8
8
  #include <reflex/defs.h>
9
+ #include <reflex/ruby/defs.h>
9
10
 
10
11
 
11
12
  using namespace Rucy;
@@ -0,0 +1,45 @@
1
+ #include "reflex/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cReflexError;
8
+ static Class cLayoutError;
9
+ static Class cPhysicsError;
10
+
11
+ void
12
+ Init_exception ()
13
+ {
14
+ Module mReflex = define_module("Reflex");
15
+
16
+ cReflexError = mReflex.define_class("ReflexError", rb_eRuntimeError);
17
+ cLayoutError = mReflex.define_class("LayoutError", cReflexError);
18
+ cPhysicsError = mReflex.define_class("PhysicsError", cReflexError);
19
+ }
20
+
21
+
22
+ namespace Reflex
23
+ {
24
+
25
+
26
+ Class
27
+ reflex_error_class ()
28
+ {
29
+ return cReflexError;
30
+ }
31
+
32
+ Class
33
+ layout_error_class ()
34
+ {
35
+ return cLayoutError;
36
+ }
37
+
38
+ Class
39
+ physics_error_class ()
40
+ {
41
+ return cPhysicsError;
42
+ }
43
+
44
+
45
+ }// Reflex
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  void Init_reflex ();
5
+ void Init_exception ();
5
6
 
6
7
  void Init_selector ();
7
8
  void Init_style ();
@@ -49,6 +50,7 @@ extern "C" void
49
50
  Rucy::init();
50
51
 
51
52
  Init_reflex();
53
+ Init_exception();
52
54
 
53
55
  Init_selector();
54
56
  Init_style();
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_APPLICATION_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/application.h>
@@ -0,0 +1,33 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __REFLEX_RUBY_DEFS_H__
4
+ #define __REFLEX_RUBY_DEFS_H__
5
+
6
+
7
+ #include <rucy/extension.h>
8
+ #include <rays/ruby/defs.h>
9
+ #include <reflex/ruby/exception.h>
10
+
11
+
12
+ #define REFLEX_CATCH \
13
+ } \
14
+ catch (const Reflex::PhysicsError& e) \
15
+ { \
16
+ RUCY_RAISE(Reflex::physics_error_class(), e.what()); \
17
+ } \
18
+ catch (const Reflex::LayoutError& e) \
19
+ { \
20
+ RUCY_RAISE(Reflex::layout_error_class(), e.what()); \
21
+ } \
22
+ catch (const Reflex::ReflexError& e) \
23
+ { \
24
+ RUCY_RAISE(Reflex::reflex_error_class(), e.what());
25
+
26
+ #undef RUCY_END
27
+ #define RUCY_END \
28
+ REFLEX_CATCH \
29
+ RAYS_CATCH \
30
+ RUCY_DEF_END
31
+
32
+
33
+ #endif//EOH
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_EVENT_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/event.h>
@@ -0,0 +1,28 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __REFLEX_RUBY_EXCEPTION_H__
4
+ #define __REFLEX_RUBY_EXCEPTION_H__
5
+
6
+
7
+ #include <rucy/class.h>
8
+ #include <reflex/exception.h>
9
+
10
+
11
+ namespace Reflex
12
+ {
13
+
14
+
15
+ Rucy::Class reflex_error_class ();
16
+ // class Reflex::ReflexError
17
+
18
+ Rucy::Class layout_error_class ();
19
+ // class Reflex::LayoutError
20
+
21
+ Rucy::Class physics_error_class ();
22
+ // class Reflex::PhysicsError
23
+
24
+
25
+ }// Reflex
26
+
27
+
28
+ #endif//EOH
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_FILTER_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <rays/ruby/image.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_POINTER_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/pointer.h>
@@ -5,6 +5,7 @@
5
5
 
6
6
 
7
7
  #include <rucy/module.h>
8
+ #include <rucy/extension.h>
8
9
  #include <reflex/reflex.h>
9
10
 
10
11
 
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_SELECTOR_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/selector.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_SHAPE_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/shape.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_STYLE_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/style.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_TIMER_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/timer.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_VIEW_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/view.h>
@@ -4,7 +4,6 @@
4
4
  #define __REFLEX_RUBY_WINDOW_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
9
  #include <reflex/window.h>
@@ -5,6 +5,8 @@
5
5
 
6
6
 
7
7
  #include <reflex/ruby/reflex.h>
8
+ #include <reflex/ruby/defs.h>
9
+ #include <reflex/ruby/exception.h>
8
10
 
9
11
  #include <reflex/ruby/selector.h>
10
12
  #include <reflex/ruby/event.h>
data/lib/reflex/button.rb CHANGED
@@ -44,7 +44,7 @@ module Reflex
44
44
  end
45
45
 
46
46
  def on_pointer(e)
47
- case e.type
47
+ case e.action
48
48
  when :down
49
49
  self.capture += [:pointer]
50
50
  redraw
data/reflex.gemspec CHANGED
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
28
28
  s.platform = Gem::Platform::RUBY
29
29
  s.required_ruby_version = '>= 2.6.0'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1.27'
32
- s.add_runtime_dependency 'rucy', '~> 0.1.27'
33
- s.add_runtime_dependency 'beeps', '~> 0.1.27'
34
- s.add_runtime_dependency 'rays', '~> 0.1.27'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.29'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.29'
33
+ s.add_runtime_dependency 'beeps', '~> 0.1.29'
34
+ s.add_runtime_dependency 'rays', '~> 0.1.29'
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/bats.rb CHANGED
@@ -62,7 +62,7 @@ win = Reflex::Window.new do
62
62
  end
63
63
 
64
64
  on :pointer do |e|
65
- case e.type
65
+ case e.action
66
66
  when :down
67
67
  spawn e.x, e.y
68
68
  @spawning = true
data/samples/model.rb CHANGED
@@ -22,7 +22,7 @@ class SliderView < View
22
22
 
23
23
  start = nil
24
24
  @knob.on :pointer do |e|
25
- case e.type
25
+ case e.action
26
26
  when :down
27
27
  start = e.position
28
28
  @knob.capture :pointer
@@ -19,6 +19,8 @@
19
19
 
20
20
  - (void) viewDidResize;
21
21
 
22
+ - (void) titleDidChange;
23
+
22
24
  @end// ReflexViewController
23
25
 
24
26
 
@@ -400,6 +400,10 @@ ReflexViewController_get_show_fun ()
400
400
  }
401
401
  }
402
402
 
403
+ - (void) titleDidChange
404
+ {
405
+ }
406
+
403
407
  - (void) touchesBegan: (NSSet*) touches withEvent: (UIEvent*) event
404
408
  {
405
409
  Reflex::Window* win = self.window;
data/src/ios/window.mm CHANGED
@@ -102,7 +102,14 @@ namespace Reflex
102
102
  if (!title)
103
103
  argument_error(__FILE__, __LINE__);
104
104
 
105
- get_vc(window).title = [NSString stringWithUTF8String: title];
105
+ ReflexViewController* vc = get_vc(window);
106
+ NSString* titleStr = [NSString stringWithUTF8String: title];
107
+
108
+ if ([titleStr isEqualToString: vc.title])
109
+ return;
110
+
111
+ vc.title = titleStr;
112
+ [vc titleDidChange];
106
113
  }
107
114
 
108
115
  const char*
@@ -44,7 +44,10 @@ update_pixel_density (Reflex::Window* window)
44
44
 
45
45
  float pd = Window_get_pixel_density(*window);
46
46
  if (painter->pixel_density() != pd)
47
+ {
47
48
  painter->canvas(window->frame().dup().move_to(0, 0), pd);
49
+ window->redraw();
50
+ }
48
51
  }
49
52
 
50
53
 
@@ -25,16 +25,15 @@ make_pixelformat (int antialias_nsample = 0)
25
25
 
26
26
  static const NSOpenGLPixelFormatAttribute DEFAULT[] =
27
27
  {
28
- NSOpenGLPFAWindow,
29
- //NSOpenGLPFAAccelerated,
28
+ //NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
29
+ NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery,
30
30
  NSOpenGLPFADoubleBuffer,
31
- //NSOpenGLPFAColorSize, 24,
32
- //NSOpenGLPFAAlphaSize, 8,
33
- NSOpenGLPFADepthSize, 24,
34
- //NSOpenGLPFANoRecovery,
31
+ NSOpenGLPFAColorSize, 32,
32
+ NSOpenGLPFADepthSize, 32,
35
33
  };
36
34
  static const NSOpenGLPixelFormatAttribute ANTIALIAS[] =
37
35
  {
36
+ NSOpenGLPFAMultisample,
38
37
  NSOpenGLPFASampleBuffers, 1,
39
38
  NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute) antialias_nsample,
40
39
  };
data/test/test_reflex.rb CHANGED
@@ -10,9 +10,9 @@ require_relative 'helper'
10
10
  class TestReflex < Test::Unit::TestCase
11
11
 
12
12
  def test_init()
13
- assert_raise(Rucy::NativeError) {Reflex.fin!}
13
+ assert_raise(Reflex::ReflexError) {Reflex.fin!}
14
14
  assert Reflex.init!
15
- assert_raise(Rucy::NativeError) {Reflex.init!}
15
+ assert_raise(Reflex::ReflexError) {Reflex.init!}
16
16
  assert Reflex.fin!
17
17
  end
18
18
 
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.1.27
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
11
+ date: 2022-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.27
19
+ version: 0.1.29
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.27
26
+ version: 0.1.29
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.27
33
+ version: 0.1.29
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.27
40
+ version: 0.1.29
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: beeps
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.27
47
+ version: 0.1.29
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.27
54
+ version: 0.1.29
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rays
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.27
61
+ version: 0.1.29
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.27
68
+ version: 0.1.29
69
69
  description: This library helps you to develop interactive graphical user interface.
70
70
  email: xordog@gmail.com
71
71
  executables: []
@@ -78,6 +78,7 @@ extra_rdoc_files:
78
78
  - ".doc/ext/reflex/draw_event.cpp"
79
79
  - ".doc/ext/reflex/ellipse_shape.cpp"
80
80
  - ".doc/ext/reflex/event.cpp"
81
+ - ".doc/ext/reflex/exception.cpp"
81
82
  - ".doc/ext/reflex/filter.cpp"
82
83
  - ".doc/ext/reflex/focus_event.cpp"
83
84
  - ".doc/ext/reflex/frame_event.cpp"
@@ -109,6 +110,7 @@ files:
109
110
  - ".doc/ext/reflex/draw_event.cpp"
110
111
  - ".doc/ext/reflex/ellipse_shape.cpp"
111
112
  - ".doc/ext/reflex/event.cpp"
113
+ - ".doc/ext/reflex/exception.cpp"
112
114
  - ".doc/ext/reflex/filter.cpp"
113
115
  - ".doc/ext/reflex/focus_event.cpp"
114
116
  - ".doc/ext/reflex/frame_event.cpp"
@@ -144,6 +146,7 @@ files:
144
146
  - ext/reflex/draw_event.cpp
145
147
  - ext/reflex/ellipse_shape.cpp
146
148
  - ext/reflex/event.cpp
149
+ - ext/reflex/exception.cpp
147
150
  - ext/reflex/extconf.rb
148
151
  - ext/reflex/filter.cpp
149
152
  - ext/reflex/focus_event.cpp
@@ -182,7 +185,9 @@ files:
182
185
  - include/reflex/reflex.h
183
186
  - include/reflex/ruby.h
184
187
  - include/reflex/ruby/application.h
188
+ - include/reflex/ruby/defs.h
185
189
  - include/reflex/ruby/event.h
190
+ - include/reflex/ruby/exception.h
186
191
  - include/reflex/ruby/filter.h
187
192
  - include/reflex/ruby/image_view.h
188
193
  - include/reflex/ruby/pointer.h