spyglass 0.0.5 → 0.0.5.1

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
  SHA1:
3
- metadata.gz: d8e0f9a857a304d3a87857e05baecfc761eae686
4
- data.tar.gz: 56fe04d59eb6700545daae2f3c910185ca97d166
3
+ metadata.gz: b42c4ba13458e7bdf19c7320a303c5e81f23d8b7
4
+ data.tar.gz: a8991220588aa8e9a6b4c7816402fd779c98c845
5
5
  SHA512:
6
- metadata.gz: 39b41c955236f3868616647e3bc264d4f3cdc17546f49b44386f2b71c8ce1f486b062265fbc7a25b9758b36eeb8d2301bfe826c0c4c7119b8a335bf380705851
7
- data.tar.gz: 90d5814cc51555ce8b7fce8a4d6a4ea8a810da0295cf316a8d130bf39d4b7fceb585bdf68cc46b3ec5b7ba69f2811dfbd7b53b2f701d5bb1c72f8aec3bba17f2
6
+ metadata.gz: d7ffbd9316f395b9f9a3c737fc345c70344f1e02c26434e03ff432a9319efc0c5b16f7415d383065bcda0b1d9c09203eb627abfc5ce19d95463fba07c57d6704
7
+ data.tar.gz: d6950330150b23122a1a86e19a211b0e271fa53f3ff15c90d8c6d5ba9663fb6495ad5a41aa47c94458fe29e50de47d2e34f912fb9e7f144a6d5f034d28fd4dc1
@@ -10,6 +10,10 @@ window.on_click do |x, y|
10
10
  puts "CLICKED: #{ x }, #{ y }"
11
11
  end
12
12
 
13
+ window.on_double_click do |x, y|
14
+ puts "DOUBLE CLICKED: #{ x }, #{ y }"
15
+ end
16
+
13
17
  window.on_right_click do |x, y|
14
18
  puts "RIGHT CLICKED: #{ x }, #{ y }"
15
19
  end
@@ -17,6 +21,6 @@ end
17
21
  window.show(card)
18
22
 
19
23
  loop do
20
- break if GUI::wait_key(10) > 0
24
+ break if GUI::wait_key(500) > 0
21
25
  end
22
26
 
@@ -15,6 +15,7 @@ namespace Spyglass {
15
15
  rb_define_method(WindowClass, "hide", RUBY_METHOD_FUNC(rb_hide), 0);
16
16
  rb_define_method(WindowClass, "move", RUBY_METHOD_FUNC(rb_move), 2);
17
17
  rb_define_method(WindowClass, "on_click", RUBY_METHOD_FUNC(rb_on_click), 0);
18
+ rb_define_method(WindowClass, "on_double_click", RUBY_METHOD_FUNC(rb_on_double_click), 0);
18
19
  rb_define_method(WindowClass, "on_right_click", RUBY_METHOD_FUNC(rb_on_right_click), 0);
19
20
  rb_define_method(WindowClass, "on_move", RUBY_METHOD_FUNC(rb_on_move), 0);
20
21
  rb_define_method(WindowClass, "show", RUBY_METHOD_FUNC(rb_show), 1);
@@ -47,6 +48,10 @@ namespace Spyglass {
47
48
  block = rb_ivar_get(self, rb_intern("@_click_block"));
48
49
  break;
49
50
 
51
+ case cv::EVENT_LBUTTONDBLCLK:
52
+ block = rb_ivar_get(self, rb_intern("@_double_click_block"));
53
+ break;
54
+
50
55
  case cv::EVENT_RBUTTONDOWN:
51
56
  block = rb_ivar_get(self, rb_intern("@_right_click_block"));
52
57
  break;
@@ -92,6 +97,12 @@ namespace Spyglass {
92
97
  return self;
93
98
  }
94
99
 
100
+ static VALUE rb_on_double_click(VALUE self) {
101
+ rb_need_block();
102
+ rb_ivar_set(self, rb_intern("@_double_click_block"), rb_block_proc());
103
+ return self;
104
+ }
105
+
95
106
  static VALUE rb_on_right_click(VALUE self) {
96
107
  rb_need_block();
97
108
  rb_ivar_set(self, rb_intern("@_right_click_block"), rb_block_proc());
@@ -23,6 +23,7 @@ namespace Spyglass {
23
23
  static VALUE rb_hide(VALUE self);
24
24
  static VALUE rb_move(VALUE self, VALUE x, VALUE y);
25
25
  static VALUE rb_on_click(VALUE self);
26
+ static VALUE rb_on_double_click(VALUE self);
26
27
  static VALUE rb_on_right_click(VALUE self);
27
28
  static VALUE rb_on_move(VALUE self);
28
29
  static VALUE rb_show(VALUE self, VALUE image);
@@ -1,3 +1,3 @@
1
1
  module Spyglass
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyglass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Medeiros