accessibility_core 0.4.1 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bd22e137f404608ca6b7cbb145104897d85e08fb
4
+ data.tar.gz: 6ce032c9c683c94e8f19c79723991ea6e6bf81a0
5
+ SHA512:
6
+ metadata.gz: 878efe9ec2813bfb7a21ee9d6149c49a46941f467c631d8fefbda0f4d0c3c8825cc25b08b7637f0e3a2311ee9488a20b0154420f43fda4fbb462ab661ce43647
7
+ data.tar.gz: 10425a3d104e3326b4a1c32255193f36a7950f2a96819819f2000920df11547c764fa704321649dd4e0fda357ebb0c6da6f57e2fbde2fab1e2f63ffca1a12304
@@ -1,3 +1,19 @@
1
+ # 0.4.3 - Oops, -Werror
2
+
3
+ * Fix a C warning generated in the Sea Lion compatability code path
4
+
5
+
6
+ # 0.4.2 - Sea Lion Compatability
7
+
8
+ * Print notice to standard out when AX access is required for an app (@tbartelmess)
9
+ * Added `CGRect#to_point`
10
+ * `Highlighter` now accepts bounds object that responds to `#to_rect`
11
+
12
+ * Disable keyboard events on Sea Lion (@tbartelmess)
13
+
14
+ * Remove development dependencies from gemspec, keep them in the Gemfile
15
+
16
+
1
17
  # 0.4.1 - Polish
2
18
 
3
19
  * Plug various memory leaks in `core.c`
@@ -6,6 +6,9 @@ runtimes.
6
6
 
7
7
  [Documentation](http://rdoc.info/gems/accessibility_core/frames)
8
8
 
9
+ [![Dependency Status](https://gemnasium.com/AXElements/accessibility_core.png)](https://gemnasium.com/AXElements/accessibility_core)
10
+ [![Code Climate](https://codeclimate.com/github/AXElements/accessibility_core.png)](https://codeclimate.com/github/AXElements/accessibility_core)
11
+
9
12
 
10
13
  ## Examples
11
14
 
@@ -22,7 +25,6 @@ runtimes.
22
25
 
23
26
  ## TODO
24
27
 
25
- * bridging for `NSAttributedString`
26
28
  * more descriptive error handling for the C extension
27
29
  * handle string encodings that are not UTF8 (or a subset of UTF8)
28
30
 
@@ -39,7 +41,7 @@ MacRuby and get the same results.
39
41
 
40
42
  ## Copyright
41
43
 
42
- Copyright (c) 2012, Mark Rada
44
+ Copyright (c) 2012-2013, Mark Rada
43
45
  All rights reserved.
44
46
 
45
47
  Redistribution and use in source and binary forms, with or without
@@ -638,6 +638,10 @@ static
638
638
  VALUE
639
639
  rb_acore_post(VALUE self, VALUE events)
640
640
  {
641
+ #if MAC_OS_X_VERSION_MIN_ALLOWED <= MAC_OS_X_VERSION_10_9
642
+ rb_raise(rb_eRuntimeError, "Posting keyboard events is deprecated in 10.9 and later");
643
+ return Qundef;
644
+ #else
641
645
  events = rb_ary_to_ary(events);
642
646
  long length = RARRAY_LEN(events);
643
647
  useconds_t sleep_time = NUM2DBL(rb_ivar_get(rb_cElement, ivar_key_rate)) * 100000;
@@ -671,6 +675,7 @@ rb_acore_post(VALUE self, VALUE events)
671
675
  }
672
676
 
673
677
  return self;
678
+ #endif
674
679
  }
675
680
 
676
681
 
@@ -765,7 +770,7 @@ Init_core()
765
770
  Init_bridge();
766
771
 
767
772
  #ifdef NOT_MACRUBY
768
-
773
+ #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
769
774
  if (!AXAPIEnabled())
770
775
  rb_raise(
771
776
  rb_eRuntimeError,
@@ -776,7 +781,24 @@ Init_core()
776
781
  "See https://github.com/Marketcircle/AXElements#getting-setup\n" \
777
782
  "------------------------------------------------------------------------\n"
778
783
  );
784
+ #else
785
+ CFMutableDictionaryRef options = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
786
+ CFDictionarySetValue(options, kAXTrustedCheckOptionPrompt, kCFBooleanTrue);
787
+
788
+ if (!AXIsProcessTrustedWithOptions(options)) {
789
+ rb_raise(rb_eRuntimeError,
790
+ "\n"
791
+ "-------------------------------------------------------------------\n" \
792
+ "The Application that is running AXElements is not trused to control\n" \
793
+ "your computer. A window prompting you to grant permission to the\n" \
794
+ "application should appear right now. Please grant the application\n" \
795
+ "permission to control your computer and try again.\n" \
796
+ "-------------------------------------------------------------------");
797
+ }
798
+ CFRelease(options);
779
799
 
800
+
801
+ #endif
780
802
  // bs that needs to be initialized from the bridge.c import
781
803
  sel_x = rb_intern("x");
782
804
  sel_y = rb_intern("y");
@@ -27,6 +27,16 @@ class CGRect
27
27
  self
28
28
  end
29
29
 
30
+ ##
31
+ # Returns the center point for the rectangle as a {CGPoint}
32
+ #
33
+ # @return [CGPoint]
34
+ def to_point
35
+ o = origin
36
+ s = size
37
+ CGPoint.new((o.x + (s.width / 2)), (o.y + (s.height / 2)))
38
+ end
39
+
30
40
  ##
31
41
  # Whether or not the receiver completely encloses the `inner` rect
32
42
  #
@@ -6,6 +6,6 @@ module Accessibility
6
6
  # Namespace for `accessibility_core` specific classes
7
7
  module Core
8
8
  # return [String]
9
- VERSION = '0.4.1'
9
+ VERSION = '0.4.3'
10
10
  end
11
11
  end
@@ -18,7 +18,7 @@
18
18
  #
19
19
  class Accessibility::Highlighter < NSWindow
20
20
 
21
- # @param bounds [CGRect]
21
+ # @param bounds [CGRect,#to_rect]
22
22
  # @param opts [Hash]
23
23
  # @option opts [Number] :timeout
24
24
  # @option opts [NSColor] :colour (NSColor.magentaColor)
@@ -13,6 +13,16 @@ else
13
13
  end
14
14
  end
15
15
 
16
+ if `uname -r`.to_i >= 13
17
+ def on_sea_lion?
18
+ true
19
+ end
20
+ else
21
+ def on_sea_lion?
22
+ false
23
+ end
24
+ end
25
+
16
26
 
17
27
  class MiniTest::Unit::TestCase
18
28
 
metadata CHANGED
@@ -1,61 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accessibility_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- prerelease:
4
+ version: 0.4.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mark Rada
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-04 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: yard
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 0.8.3
22
- type: :development
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- version: 0.8.3
30
- - !ruby/object:Gem::Dependency
31
- name: kramdown
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 0.14.1
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 0.14.1
46
- description: ! 'accessibility_core is a wrapper around the OS X Accessibility framework.
47
-
11
+ date: 2013-11-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
14
+ accessibility_core is a wrapper around the OS X Accessibility framework.
48
15
 
49
16
  Some other extras that are intended to help build higher level abstractions
50
-
51
17
  have also been included. They are primarily wrappers around misc bits
52
-
53
18
  of Cocoa, but include some speciality modules.
54
19
 
55
-
56
20
  Originally extracted from the AXElements project.
57
-
58
- '
59
21
  email: markrada26@gmail.com
60
22
  executables: []
61
23
  extensions:
@@ -95,33 +57,26 @@ files:
95
57
  homepage: http://github.com/AXElements/accessibility_core
96
58
  licenses:
97
59
  - BSD 3-clause
60
+ metadata: {}
98
61
  post_install_message:
99
62
  rdoc_options: []
100
63
  require_paths:
101
64
  - lib
102
65
  required_ruby_version: !ruby/object:Gem::Requirement
103
- none: false
104
66
  requirements:
105
- - - ! '>='
67
+ - - '>='
106
68
  - !ruby/object:Gem::Version
107
69
  version: '0'
108
- segments:
109
- - 0
110
- hash: 2206731083333154082
111
70
  required_rubygems_version: !ruby/object:Gem::Requirement
112
- none: false
113
71
  requirements:
114
- - - ! '>='
72
+ - - '>='
115
73
  - !ruby/object:Gem::Version
116
74
  version: '0'
117
- segments:
118
- - 0
119
- hash: 2206731083333154082
120
75
  requirements: []
121
76
  rubyforge_project:
122
- rubygems_version: 1.8.24
77
+ rubygems_version: 2.0.3
123
78
  signing_key:
124
- specification_version: 3
79
+ specification_version: 4
125
80
  summary: A library for building automation tools on OS X
126
81
  test_files:
127
82
  - test/test_core.rb