AXElements 0.6.0beta2 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardopts +1 -2
- data/README.markdown +152 -88
- data/Rakefile +8 -103
- data/docs/Debugging.markdown +9 -2
- data/docs/KeyboardEvents.markdown +114 -49
- data/docs/Setting.markdown +1 -0
- data/docs/images/next_version.png +0 -0
- data/ext/accessibility/key_coder/extconf.rb +22 -0
- data/ext/accessibility/key_coder/key_coder.c +113 -0
- data/lib/AXElements.rb +2 -0
- data/lib/accessibility/core.rb +897 -0
- data/lib/accessibility/debug.rb +168 -0
- data/lib/accessibility/dsl.rb +697 -0
- data/lib/accessibility/enumerators.rb +104 -0
- data/lib/accessibility/errors.rb +32 -0
- data/lib/accessibility/factory.rb +153 -0
- data/lib/accessibility/graph.rb +150 -0
- data/lib/{ax_elements/inspector.rb → accessibility/pp_inspector.rb} +39 -28
- data/lib/accessibility/qualifier.rb +158 -0
- data/lib/accessibility/string.rb +494 -0
- data/lib/accessibility/translator.rb +178 -0
- data/lib/accessibility/version.rb +7 -0
- data/lib/accessibility.rb +79 -0
- data/lib/ax/application.rb +234 -0
- data/lib/{ax_elements/elements → ax}/button.rb +2 -0
- data/lib/ax/element.rb +518 -0
- data/lib/{ax_elements/elements → ax}/radio_button.rb +2 -0
- data/lib/ax/row.rb +37 -0
- data/lib/{ax_elements/elements → ax}/static_text.rb +2 -0
- data/lib/ax/systemwide.rb +86 -0
- data/lib/ax_elements/awesome_print.rb +25 -0
- data/lib/ax_elements/exception_workaround.rb +8 -0
- data/lib/ax_elements/nsarray_compat.rb +64 -0
- data/lib/ax_elements/vendor/inflection_data.rb +65 -0
- data/lib/ax_elements/vendor/inflections.rb +172 -0
- data/lib/ax_elements/vendor/inflector.rb +306 -0
- data/lib/ax_elements.rb +14 -25
- data/lib/minitest/ax_elements.rb +112 -12
- data/lib/mouse.rb +72 -46
- data/lib/rspec/expectations/ax_elements.rb +133 -6
- data/rakelib/doc.rake +13 -0
- data/rakelib/ext.rake +61 -0
- data/rakelib/gem.rake +28 -0
- data/rakelib/test.rake +53 -0
- data/test/helper.rb +11 -97
- data/test/integration/accessibility/test_core.rb +18 -0
- data/test/integration/accessibility/test_debug.rb +44 -0
- data/test/integration/accessibility/test_dsl.rb +225 -0
- data/test/integration/accessibility/test_enumerators.rb +122 -0
- data/test/integration/accessibility/test_errors.rb +38 -0
- data/test/integration/accessibility/test_notifications.rb +22 -0
- data/test/integration/accessibility/test_qualifier.rb +148 -0
- data/test/integration/ax/test_application.rb +56 -0
- data/test/integration/ax/test_element.rb +46 -0
- data/test/integration/ax/test_row.rb +23 -0
- data/test/integration/ax_elements/test_nsarray_compat.rb +43 -0
- data/test/integration/minitest/test_ax_elements.rb +98 -0
- data/test/integration/rspec/expectations/test_ax_elements.rb +58 -0
- data/test/integration/test_mouse.rb +35 -0
- data/test/sanity/accessibility/test_core.rb +553 -0
- data/test/sanity/accessibility/test_debug.rb +63 -0
- data/test/sanity/accessibility/test_dsl.rb +75 -0
- data/test/sanity/accessibility/test_errors.rb +10 -0
- data/test/sanity/accessibility/test_factory.rb +88 -0
- data/test/sanity/accessibility/test_pp_inspector.rb +110 -0
- data/test/sanity/accessibility/test_qualifier.rb +13 -0
- data/test/sanity/accessibility/test_string.rb +238 -0
- data/test/sanity/accessibility/test_translator.rb +145 -0
- data/test/sanity/ax/test_application.rb +90 -0
- data/test/sanity/ax/test_element.rb +80 -0
- data/test/sanity/ax/test_systemwide.rb +66 -0
- data/test/sanity/ax_elements/test_nsarray_compat.rb +16 -0
- data/test/sanity/ax_elements/test_nsobject_inspect.rb +11 -0
- data/test/sanity/minitest/test_ax_elements.rb +15 -0
- data/test/sanity/rspec/expectations/test_ax_elements.rb +12 -0
- data/test/sanity/test_ax_elements.rb +10 -0
- data/test/sanity/test_mouse.rb +19 -0
- metadata +111 -93
- data/LICENSE.txt +0 -25
- data/ext/key_coder/extconf.rb +0 -6
- data/ext/key_coder/key_coder.m +0 -77
- data/lib/ax_elements/accessibility/enumerators.rb +0 -104
- data/lib/ax_elements/accessibility/graph.rb +0 -118
- data/lib/ax_elements/accessibility/language.rb +0 -347
- data/lib/ax_elements/accessibility/qualifier.rb +0 -73
- data/lib/ax_elements/accessibility.rb +0 -166
- data/lib/ax_elements/core.rb +0 -541
- data/lib/ax_elements/element.rb +0 -593
- data/lib/ax_elements/elements/application.rb +0 -88
- data/lib/ax_elements/elements/row.rb +0 -30
- data/lib/ax_elements/elements/systemwide.rb +0 -46
- data/lib/ax_elements/macruby_extensions.rb +0 -255
- data/lib/ax_elements/notification.rb +0 -37
- data/lib/ax_elements/version.rb +0 -9
- data/test/elements/test_application.rb +0 -72
- data/test/elements/test_row.rb +0 -27
- data/test/elements/test_systemwide.rb +0 -38
- data/test/test_accessibility.rb +0 -127
- data/test/test_blankness.rb +0 -26
- data/test/test_core.rb +0 -448
- data/test/test_element.rb +0 -939
- data/test/test_enumerators.rb +0 -81
- data/test/test_inspector.rb +0 -130
- data/test/test_language.rb +0 -157
- data/test/test_macruby_extensions.rb +0 -303
- data/test/test_mouse.rb +0 -5
- data/test/test_search_semantics.rb +0 -143
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
require 'test/helper'
|
|
2
|
+
require 'ax/element'
|
|
3
|
+
|
|
4
|
+
class TestAXElement < MiniTest::Unit::TestCase
|
|
5
|
+
|
|
6
|
+
def element
|
|
7
|
+
@element ||= AX::Element.new REF
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def test_methods_is_flat
|
|
11
|
+
methods = element.methods
|
|
12
|
+
assert_equal methods.flatten.sort!, methods.sort!
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_setting_through_method_missing
|
|
16
|
+
got_callback = false
|
|
17
|
+
element.define_singleton_method :set do |attr, value|
|
|
18
|
+
if attr == 'my_little_pony' && value == :firefly
|
|
19
|
+
got_callback = true
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
assert element.my_little_pony = :firefly
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_respond_to_works_with_dynamic_setters
|
|
26
|
+
window = element.attribute(:main_window)
|
|
27
|
+
assert_respond_to window, :position=
|
|
28
|
+
assert_respond_to window, :size=
|
|
29
|
+
refute_respond_to window, :grandad=
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_to_point
|
|
33
|
+
def center_test position, size, expected
|
|
34
|
+
element.define_singleton_method :attribute do |attr|
|
|
35
|
+
case attr
|
|
36
|
+
when :position then CGPointMake(*position)
|
|
37
|
+
when :size then CGSizeMake(*size)
|
|
38
|
+
else raise ArgumentError
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
assert_equal CGPointMake(*expected), element.to_point
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# the nil case
|
|
45
|
+
center_test CGPointZero, CGSizeZero, CGPointZero
|
|
46
|
+
# simple square with origin at zero
|
|
47
|
+
center_test [0,0], [2,2], [1,1]
|
|
48
|
+
# simple square in positive positive quadrant
|
|
49
|
+
center_test [1,1], [6,6], [4,4]
|
|
50
|
+
# rect in positive positive quadrant
|
|
51
|
+
center_test [1,2], [6,10], [4,7]
|
|
52
|
+
# rect in negative positive quadrant
|
|
53
|
+
center_test [-123.0,25.0], [6.0,10.0], [-120,30]
|
|
54
|
+
# rect starts in negative positive quadrant but is in positive positive
|
|
55
|
+
center_test [-10.0,70.0], [20,42], [0,91]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class TestSearchResultBlankness < MiniTest::Unit::TestCase
|
|
62
|
+
|
|
63
|
+
def test_array_blank
|
|
64
|
+
[
|
|
65
|
+
NSArray.array,
|
|
66
|
+
[true]
|
|
67
|
+
].each do |ary|
|
|
68
|
+
assert_equal ary.empty?, ary.blank?
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def test_nil_blank
|
|
73
|
+
assert_equal true, nil.blank?
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def test_element_blank
|
|
77
|
+
assert_equal false, AX::Element.new(REF).blank?
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
require 'test/helper'
|
|
2
|
+
require 'ax/systemwide'
|
|
3
|
+
|
|
4
|
+
class AX::Element
|
|
5
|
+
attr_reader :ref
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class TestAXSystemWide < MiniTest::Unit::TestCase
|
|
9
|
+
|
|
10
|
+
def system_wide
|
|
11
|
+
@system_wide ||= AX::SystemWide.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def test_is_effectively_a_singleton
|
|
15
|
+
assert_equal AX::SystemWide.new, AX::SystemWide.new
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_type_string_forwards_events
|
|
19
|
+
system = system_wide.ref
|
|
20
|
+
meth = system.method :post
|
|
21
|
+
got_callback = false
|
|
22
|
+
system.define_singleton_method :post do |events|
|
|
23
|
+
got_callback = true if events.kind_of?(Array)
|
|
24
|
+
end
|
|
25
|
+
system_wide.type_string 'test'
|
|
26
|
+
assert got_callback
|
|
27
|
+
ensure
|
|
28
|
+
system.define_singleton_method :post, meth if meth
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def test_search_not_allowed
|
|
32
|
+
assert_raises(NoMethodError) { system_wide.search }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_notifications_not_allowed
|
|
36
|
+
assert_raises(NoMethodError) { system_wide.on_notification }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def test_element_at
|
|
40
|
+
system = system_wide.ref
|
|
41
|
+
[[10,10],[500,500]].each do |point|
|
|
42
|
+
expected = system.element_at(point)
|
|
43
|
+
actual = system_wide.element_at(point).ref
|
|
44
|
+
assert_equal expected, actual
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def test_parameterized_attributes_is_empty
|
|
49
|
+
assert_empty system_wide.parameterized_attributes
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def test_actions_is_empty
|
|
53
|
+
assert_empty system_wide.actions
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# this is a special case because it hits other things, like
|
|
57
|
+
# parameterized attributes, which do not work with the
|
|
58
|
+
# system wide object
|
|
59
|
+
def test_respond_to
|
|
60
|
+
assert_respond_to system_wide, :role
|
|
61
|
+
assert_respond_to system_wide, :role=
|
|
62
|
+
assert_respond_to system_wide, :inspect
|
|
63
|
+
assert_respond_to system_wide, :object_id
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'test/runner'
|
|
2
|
+
require 'ax_elements/nsarray_compat'
|
|
3
|
+
|
|
4
|
+
class TestNSArrayCompat < MiniTest::Unit::TestCase
|
|
5
|
+
|
|
6
|
+
def test_second_returns_second
|
|
7
|
+
assert_equal :two, NSArray.arrayWithArray([:one, :two]).second
|
|
8
|
+
assert_nil NSArray.arrayWithArray([:one]).second
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_third_returns_third
|
|
12
|
+
assert_equal :three, NSArray.arrayWithArray([:one, :two, :three]).third
|
|
13
|
+
assert_nil NSArray.arrayWithArray([:one, :two]).third
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require 'test/runner'
|
|
2
|
+
|
|
3
|
+
class TestNSObjectExtensions < MiniTest::Unit::TestCase
|
|
4
|
+
# keeping this test just to make sure the version of MacRuby
|
|
5
|
+
# being used is new enough
|
|
6
|
+
def test_inspecting
|
|
7
|
+
url = NSURL.URLWithString('http://marketcircle.com/')
|
|
8
|
+
assert_equal url.description, url.inspect
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'test/runner'
|
|
2
|
+
require 'minitest/ax_elements'
|
|
3
|
+
|
|
4
|
+
class TestMiniTestAssertions < MiniTest::Unit::TestCase
|
|
5
|
+
|
|
6
|
+
def test_methods_are_loaded
|
|
7
|
+
assert_respond_to self, :assert_has_child
|
|
8
|
+
assert_respond_to self, :assert_has_descendent
|
|
9
|
+
assert_respond_to self, :assert_has_descendant
|
|
10
|
+
assert_respond_to self, :refute_has_child
|
|
11
|
+
assert_respond_to self, :refute_has_descendent
|
|
12
|
+
assert_respond_to self, :refute_has_descendant
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'test/runner'
|
|
2
|
+
require 'rspec/expectations/ax_elements'
|
|
3
|
+
|
|
4
|
+
class TestRSpecMatchers < MiniTest::Unit::TestCase
|
|
5
|
+
|
|
6
|
+
def test_defined
|
|
7
|
+
assert TopLevel.method(:have_child)
|
|
8
|
+
assert TopLevel.method(:have_descendent)
|
|
9
|
+
assert TopLevel.method(:have_descendant)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class TestMouseModule < MiniTest::Unit::TestCase
|
|
2
|
+
|
|
3
|
+
def distance point1, point2
|
|
4
|
+
x = point1.x - point2.x
|
|
5
|
+
y = point1.y - point2.y
|
|
6
|
+
Math.sqrt((x**2) + (y**2))
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def test_move_to
|
|
10
|
+
point = CGPointMake(100, 100)
|
|
11
|
+
Mouse.move_to point
|
|
12
|
+
assert_in_delta 0, distance(point,Mouse.current_position), 1.0
|
|
13
|
+
|
|
14
|
+
point = CGPointMake(rand(700)+150, rand(500)+100)
|
|
15
|
+
Mouse.move_to point
|
|
16
|
+
assert_in_delta 0, distance(point,Mouse.current_position), 1.0
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
metadata
CHANGED
|
@@ -1,49 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: AXElements
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
prerelease:
|
|
5
|
-
version: 0.
|
|
4
|
+
prerelease:
|
|
5
|
+
version: 0.7.5
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Mark Rada
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
-
default_executable:
|
|
12
|
+
date: 2012-04-04 00:00:00 Z
|
|
14
13
|
dependencies:
|
|
15
|
-
- !ruby/object:Gem::Dependency
|
|
16
|
-
name: activesupport
|
|
17
|
-
prerelease: false
|
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
|
19
|
-
none: false
|
|
20
|
-
requirements:
|
|
21
|
-
- - ~>
|
|
22
|
-
- !ruby/object:Gem::Version
|
|
23
|
-
version: 3.1.0
|
|
24
|
-
type: :runtime
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
none: false
|
|
27
|
-
requirements:
|
|
28
|
-
- - ~>
|
|
29
|
-
- !ruby/object:Gem::Version
|
|
30
|
-
version: 3.1.0
|
|
31
|
-
- !ruby/object:Gem::Dependency
|
|
32
|
-
name: i18n
|
|
33
|
-
prerelease: false
|
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
|
35
|
-
none: false
|
|
36
|
-
requirements:
|
|
37
|
-
- - ~>
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.6.0
|
|
40
|
-
type: :runtime
|
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
-
none: false
|
|
43
|
-
requirements:
|
|
44
|
-
- - ~>
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: 0.6.0
|
|
47
14
|
- !ruby/object:Gem::Dependency
|
|
48
15
|
name: minitest
|
|
49
16
|
prerelease: false
|
|
@@ -52,14 +19,14 @@ dependencies:
|
|
|
52
19
|
requirements:
|
|
53
20
|
- - ~>
|
|
54
21
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: "2.
|
|
22
|
+
version: "2.12"
|
|
56
23
|
type: :development
|
|
57
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
58
25
|
none: false
|
|
59
26
|
requirements:
|
|
60
27
|
- - ~>
|
|
61
28
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: "2.
|
|
29
|
+
version: "2.12"
|
|
63
30
|
- !ruby/object:Gem::Dependency
|
|
64
31
|
name: yard
|
|
65
32
|
prerelease: false
|
|
@@ -68,14 +35,14 @@ dependencies:
|
|
|
68
35
|
requirements:
|
|
69
36
|
- - ~>
|
|
70
37
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: 0.7.
|
|
38
|
+
version: 0.7.5
|
|
72
39
|
type: :development
|
|
73
40
|
version_requirements: !ruby/object:Gem::Requirement
|
|
74
41
|
none: false
|
|
75
42
|
requirements:
|
|
76
43
|
- - ~>
|
|
77
44
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: 0.7.
|
|
45
|
+
version: 0.7.5
|
|
79
46
|
- !ruby/object:Gem::Dependency
|
|
80
47
|
name: redcarpet
|
|
81
48
|
prerelease: false
|
|
@@ -103,13 +70,14 @@ description: 'AXElements is a DSL abstraction on top of the Mac OS X Accessibili
|
|
|
103
70
|
email: mrada@marketcircle.com
|
|
104
71
|
executables: []
|
|
105
72
|
extensions:
|
|
106
|
-
- ext/key_coder/extconf.rb
|
|
73
|
+
- ext/accessibility/key_coder/extconf.rb
|
|
107
74
|
extra_rdoc_files:
|
|
108
75
|
- docs/AccessibilityTips.markdown
|
|
109
76
|
- docs/Acting.markdown
|
|
110
77
|
- docs/Debugging.markdown
|
|
111
78
|
- docs/images/all_the_buttons.jpg
|
|
112
79
|
- docs/images/AX.png
|
|
80
|
+
- docs/images/next_version.png
|
|
113
81
|
- docs/images/ui_hierarchy.dot
|
|
114
82
|
- docs/images/ui_hierarchy.png
|
|
115
83
|
- docs/Inspecting.markdown
|
|
@@ -117,55 +85,88 @@ extra_rdoc_files:
|
|
|
117
85
|
- docs/NewBehaviour.markdown
|
|
118
86
|
- docs/Notifications.markdown
|
|
119
87
|
- docs/Searching.markdown
|
|
88
|
+
- docs/Setting.markdown
|
|
120
89
|
- docs/TestingExtensions.markdown
|
|
121
90
|
- .yardopts
|
|
122
|
-
- LICENSE.txt
|
|
123
91
|
- README.markdown
|
|
124
92
|
files:
|
|
125
|
-
- lib/
|
|
126
|
-
- lib/
|
|
127
|
-
- lib/
|
|
128
|
-
- lib/
|
|
129
|
-
- lib/
|
|
130
|
-
- lib/
|
|
131
|
-
- lib/
|
|
132
|
-
- lib/
|
|
133
|
-
- lib/
|
|
134
|
-
- lib/
|
|
135
|
-
- lib/
|
|
136
|
-
- lib/
|
|
137
|
-
- lib/
|
|
138
|
-
- lib/
|
|
139
|
-
- lib/
|
|
140
|
-
- lib/
|
|
141
|
-
- lib/
|
|
93
|
+
- lib/accessibility/core.rb
|
|
94
|
+
- lib/accessibility/debug.rb
|
|
95
|
+
- lib/accessibility/dsl.rb
|
|
96
|
+
- lib/accessibility/enumerators.rb
|
|
97
|
+
- lib/accessibility/errors.rb
|
|
98
|
+
- lib/accessibility/factory.rb
|
|
99
|
+
- lib/accessibility/graph.rb
|
|
100
|
+
- lib/accessibility/pp_inspector.rb
|
|
101
|
+
- lib/accessibility/qualifier.rb
|
|
102
|
+
- lib/accessibility/string.rb
|
|
103
|
+
- lib/accessibility/translator.rb
|
|
104
|
+
- lib/accessibility/version.rb
|
|
105
|
+
- lib/accessibility.rb
|
|
106
|
+
- lib/ax/application.rb
|
|
107
|
+
- lib/ax/button.rb
|
|
108
|
+
- lib/ax/element.rb
|
|
109
|
+
- lib/ax/radio_button.rb
|
|
110
|
+
- lib/ax/row.rb
|
|
111
|
+
- lib/ax/static_text.rb
|
|
112
|
+
- lib/ax/systemwide.rb
|
|
113
|
+
- lib/ax_elements/awesome_print.rb
|
|
114
|
+
- lib/ax_elements/exception_workaround.rb
|
|
115
|
+
- lib/ax_elements/nsarray_compat.rb
|
|
116
|
+
- lib/ax_elements/vendor/inflection_data.rb
|
|
117
|
+
- lib/ax_elements/vendor/inflections.rb
|
|
118
|
+
- lib/ax_elements/vendor/inflector.rb
|
|
142
119
|
- lib/ax_elements.rb
|
|
143
120
|
- lib/AXElements.rb
|
|
144
121
|
- lib/minitest/ax_elements.rb
|
|
145
122
|
- lib/mouse.rb
|
|
146
123
|
- lib/rspec/expectations/ax_elements.rb
|
|
147
|
-
- ext/key_coder/extconf.rb
|
|
148
|
-
- ext/key_coder/key_coder.
|
|
124
|
+
- ext/accessibility/key_coder/extconf.rb
|
|
125
|
+
- ext/accessibility/key_coder/key_coder.c
|
|
126
|
+
- rakelib/doc.rake
|
|
127
|
+
- rakelib/ext.rake
|
|
128
|
+
- rakelib/gem.rake
|
|
129
|
+
- rakelib/test.rake
|
|
149
130
|
- Rakefile
|
|
150
|
-
- test/
|
|
151
|
-
- test/
|
|
152
|
-
- test/
|
|
153
|
-
- test/
|
|
154
|
-
- test/
|
|
155
|
-
- test/
|
|
156
|
-
- test/
|
|
157
|
-
- test/
|
|
158
|
-
- test/
|
|
159
|
-
- test/
|
|
160
|
-
- test/
|
|
161
|
-
- test/
|
|
162
|
-
- test/
|
|
131
|
+
- test/integration/accessibility/test_core.rb
|
|
132
|
+
- test/integration/accessibility/test_debug.rb
|
|
133
|
+
- test/integration/accessibility/test_dsl.rb
|
|
134
|
+
- test/integration/accessibility/test_enumerators.rb
|
|
135
|
+
- test/integration/accessibility/test_errors.rb
|
|
136
|
+
- test/integration/accessibility/test_notifications.rb
|
|
137
|
+
- test/integration/accessibility/test_qualifier.rb
|
|
138
|
+
- test/integration/ax/test_application.rb
|
|
139
|
+
- test/integration/ax/test_element.rb
|
|
140
|
+
- test/integration/ax/test_row.rb
|
|
141
|
+
- test/integration/ax_elements/test_nsarray_compat.rb
|
|
142
|
+
- test/integration/minitest/test_ax_elements.rb
|
|
143
|
+
- test/integration/rspec/expectations/test_ax_elements.rb
|
|
144
|
+
- test/integration/test_mouse.rb
|
|
145
|
+
- test/sanity/accessibility/test_core.rb
|
|
146
|
+
- test/sanity/accessibility/test_debug.rb
|
|
147
|
+
- test/sanity/accessibility/test_dsl.rb
|
|
148
|
+
- test/sanity/accessibility/test_errors.rb
|
|
149
|
+
- test/sanity/accessibility/test_factory.rb
|
|
150
|
+
- test/sanity/accessibility/test_pp_inspector.rb
|
|
151
|
+
- test/sanity/accessibility/test_qualifier.rb
|
|
152
|
+
- test/sanity/accessibility/test_string.rb
|
|
153
|
+
- test/sanity/accessibility/test_translator.rb
|
|
154
|
+
- test/sanity/ax/test_application.rb
|
|
155
|
+
- test/sanity/ax/test_element.rb
|
|
156
|
+
- test/sanity/ax/test_systemwide.rb
|
|
157
|
+
- test/sanity/ax_elements/test_nsarray_compat.rb
|
|
158
|
+
- test/sanity/ax_elements/test_nsobject_inspect.rb
|
|
159
|
+
- test/sanity/minitest/test_ax_elements.rb
|
|
160
|
+
- test/sanity/rspec/expectations/test_ax_elements.rb
|
|
161
|
+
- test/sanity/test_ax_elements.rb
|
|
162
|
+
- test/sanity/test_mouse.rb
|
|
163
163
|
- test/helper.rb
|
|
164
164
|
- docs/AccessibilityTips.markdown
|
|
165
165
|
- docs/Acting.markdown
|
|
166
166
|
- docs/Debugging.markdown
|
|
167
167
|
- docs/images/all_the_buttons.jpg
|
|
168
168
|
- docs/images/AX.png
|
|
169
|
+
- docs/images/next_version.png
|
|
169
170
|
- docs/images/ui_hierarchy.dot
|
|
170
171
|
- docs/images/ui_hierarchy.png
|
|
171
172
|
- docs/Inspecting.markdown
|
|
@@ -173,11 +174,10 @@ files:
|
|
|
173
174
|
- docs/NewBehaviour.markdown
|
|
174
175
|
- docs/Notifications.markdown
|
|
175
176
|
- docs/Searching.markdown
|
|
177
|
+
- docs/Setting.markdown
|
|
176
178
|
- docs/TestingExtensions.markdown
|
|
177
179
|
- .yardopts
|
|
178
|
-
- LICENSE.txt
|
|
179
180
|
- README.markdown
|
|
180
|
-
has_rdoc: true
|
|
181
181
|
homepage: http://github.com/Marketcircle/AXElements
|
|
182
182
|
licenses:
|
|
183
183
|
- BSD 3-clause
|
|
@@ -185,7 +185,6 @@ post_install_message:
|
|
|
185
185
|
rdoc_options: []
|
|
186
186
|
require_paths:
|
|
187
187
|
- lib
|
|
188
|
-
- ext
|
|
189
188
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
189
|
none: false
|
|
191
190
|
requirements:
|
|
@@ -195,27 +194,46 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
195
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
195
|
none: false
|
|
197
196
|
requirements:
|
|
198
|
-
- - '
|
|
197
|
+
- - '>='
|
|
199
198
|
- !ruby/object:Gem::Version
|
|
200
|
-
version:
|
|
199
|
+
version: "0"
|
|
201
200
|
requirements: []
|
|
202
201
|
rubyforge_project:
|
|
203
|
-
rubygems_version: 1.
|
|
202
|
+
rubygems_version: 1.8.20
|
|
204
203
|
signing_key:
|
|
205
204
|
specification_version: 3
|
|
206
205
|
summary: A DSL for automating GUI manipulation
|
|
207
206
|
test_files:
|
|
208
|
-
- test/
|
|
209
|
-
- test/
|
|
210
|
-
- test/
|
|
211
|
-
- test/
|
|
212
|
-
- test/
|
|
213
|
-
- test/
|
|
214
|
-
- test/
|
|
215
|
-
- test/
|
|
216
|
-
- test/
|
|
217
|
-
- test/
|
|
218
|
-
- test/
|
|
219
|
-
- test/
|
|
220
|
-
- test/
|
|
207
|
+
- test/integration/accessibility/test_core.rb
|
|
208
|
+
- test/integration/accessibility/test_debug.rb
|
|
209
|
+
- test/integration/accessibility/test_dsl.rb
|
|
210
|
+
- test/integration/accessibility/test_enumerators.rb
|
|
211
|
+
- test/integration/accessibility/test_errors.rb
|
|
212
|
+
- test/integration/accessibility/test_notifications.rb
|
|
213
|
+
- test/integration/accessibility/test_qualifier.rb
|
|
214
|
+
- test/integration/ax/test_application.rb
|
|
215
|
+
- test/integration/ax/test_element.rb
|
|
216
|
+
- test/integration/ax/test_row.rb
|
|
217
|
+
- test/integration/ax_elements/test_nsarray_compat.rb
|
|
218
|
+
- test/integration/minitest/test_ax_elements.rb
|
|
219
|
+
- test/integration/rspec/expectations/test_ax_elements.rb
|
|
220
|
+
- test/integration/test_mouse.rb
|
|
221
|
+
- test/sanity/accessibility/test_core.rb
|
|
222
|
+
- test/sanity/accessibility/test_debug.rb
|
|
223
|
+
- test/sanity/accessibility/test_dsl.rb
|
|
224
|
+
- test/sanity/accessibility/test_errors.rb
|
|
225
|
+
- test/sanity/accessibility/test_factory.rb
|
|
226
|
+
- test/sanity/accessibility/test_pp_inspector.rb
|
|
227
|
+
- test/sanity/accessibility/test_qualifier.rb
|
|
228
|
+
- test/sanity/accessibility/test_string.rb
|
|
229
|
+
- test/sanity/accessibility/test_translator.rb
|
|
230
|
+
- test/sanity/ax/test_application.rb
|
|
231
|
+
- test/sanity/ax/test_element.rb
|
|
232
|
+
- test/sanity/ax/test_systemwide.rb
|
|
233
|
+
- test/sanity/ax_elements/test_nsarray_compat.rb
|
|
234
|
+
- test/sanity/ax_elements/test_nsobject_inspect.rb
|
|
235
|
+
- test/sanity/minitest/test_ax_elements.rb
|
|
236
|
+
- test/sanity/rspec/expectations/test_ax_elements.rb
|
|
237
|
+
- test/sanity/test_ax_elements.rb
|
|
238
|
+
- test/sanity/test_mouse.rb
|
|
221
239
|
- test/helper.rb
|
data/LICENSE.txt
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2010-2011, Marketcircle Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
|
6
|
-
* Redistributions of source code must retain the above copyright
|
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
|
10
|
-
documentation and/or other materials provided with the distribution.
|
|
11
|
-
* Neither the name of Marketcircle Inc. nor the names of its
|
|
12
|
-
contributors may be used to endorse or promote products derived
|
|
13
|
-
from this software without specific prior written permission.
|
|
14
|
-
|
|
15
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
16
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
-
DISCLAIMED. IN NO EVENT SHALL Marketcircle Inc. BE LIABLE FOR ANY
|
|
19
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
21
|
-
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
22
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
23
|
-
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
24
|
-
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
25
|
-
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/ext/key_coder/extconf.rb
DELETED
data/ext/key_coder/key_coder.m
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* key_coder.m
|
|
3
|
-
* KeyCoder
|
|
4
|
-
*
|
|
5
|
-
* Created by Mark Rada on 11-07-27.
|
|
6
|
-
* Copyright 2011 Marketcircle Incorporated. All rights reserved.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
#import <Carbon/Carbon.h>
|
|
11
|
-
#import <CoreServices/CoreServices.h>
|
|
12
|
-
#include "ruby/ruby.h"
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
* @note Static keycode reference at
|
|
16
|
-
* /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h
|
|
17
|
-
*
|
|
18
|
-
* Map of characters to key codes.
|
|
19
|
-
*
|
|
20
|
-
* @return [Hash{String=>Fixnum}]
|
|
21
|
-
*/
|
|
22
|
-
static NSMutableDictionary* mAX_keycode_map;
|
|
23
|
-
|
|
24
|
-
static VALUE mAX;
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
* Helper method to create the keycode mapping at runtime.
|
|
28
|
-
*/
|
|
29
|
-
static void mAX_initialize_keycode_map() {
|
|
30
|
-
|
|
31
|
-
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
|
|
32
|
-
CFDataRef keyboardLayoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard,
|
|
33
|
-
kTISPropertyUnicodeKeyLayoutData);
|
|
34
|
-
const UCKeyboardLayout* keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(keyboardLayoutData);
|
|
35
|
-
UInt32 deadKeyState = 0;
|
|
36
|
-
UniCharCount actualStringLength = 0;
|
|
37
|
-
UniChar string[255];
|
|
38
|
-
|
|
39
|
-
mAX_keycode_map = [[NSMutableDictionary alloc] initWithCapacity:255];
|
|
40
|
-
|
|
41
|
-
for (int keyCode = 0; keyCode < 255; keyCode++) {
|
|
42
|
-
UCKeyTranslate (
|
|
43
|
-
keyboardLayout,
|
|
44
|
-
keyCode,
|
|
45
|
-
kUCKeyActionDown,
|
|
46
|
-
0,
|
|
47
|
-
0, // kb type
|
|
48
|
-
0, // OptionBits keyTranslateOptions,
|
|
49
|
-
&deadKeyState,
|
|
50
|
-
255,
|
|
51
|
-
&actualStringLength,
|
|
52
|
-
string
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
[mAX_keycode_map setObject:[NSNumber numberWithInt:keyCode]
|
|
56
|
-
forKey:[NSString stringWithFormat:@"%C", string[0]]];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
void Init_key_coder() {
|
|
62
|
-
|
|
63
|
-
// TODO: Make mapping keys lazy, expose a C function to map a single
|
|
64
|
-
// character to a keycode, and define a hash in Ruby land that
|
|
65
|
-
// will use the hash callback feature to get the mapping on demand.
|
|
66
|
-
// POSSIBLE PROBLEM: How to handle alternative characters, like
|
|
67
|
-
// symbols which require holding shift first? How would we know
|
|
68
|
-
// about them?
|
|
69
|
-
|
|
70
|
-
// Initialize the mapping and expose it as a constant in the AX module
|
|
71
|
-
mAX_initialize_keycode_map();
|
|
72
|
-
mAX = rb_define_module("AX");
|
|
73
|
-
rb_define_const(mAX, "KEYCODE_MAP", (VALUE)mAX_keycode_map);
|
|
74
|
-
// No need to expose the method right now...
|
|
75
|
-
//rb_define_module_function(mAX, "initialize_keycode_map", mAX_initialize_keycode_map, 0);
|
|
76
|
-
|
|
77
|
-
}
|