atspi 0.8.2 → 0.8.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 098653bbb4fcf2ebee3ccb274d9a1b5d7bf73035
4
- data.tar.gz: fbf3a9680dc2a95dd6ead1803b23ae6bcffd7f93
3
+ metadata.gz: 477e6b15eb78929735b6381e44736750f9486126
4
+ data.tar.gz: 1f1a1713e6a298d250ffb7b1b110c681b1b68273
5
5
  SHA512:
6
- metadata.gz: 1f609ffa1b51a3e0e8bf4373ad5ca187995cd5a917a7a7c928ccfeaf3430ad5f59b0cf8f6848e50721fc80f987645daf1af65898accd0c31200b5a4052710a25
7
- data.tar.gz: 807b5aa658a532c1d61f55d18c0c1c5aae78a94bab9f27f2f1a1ec7c72992e780624ecf28b2c84d3d2c4991d1e9bdca65d8d975d4a1763d9f369afe3fd83e387
6
+ metadata.gz: dca8e742c4e33109704dc5f75c3db4fe32fbb057b2fe817090c358d8fdf163820de2e0c9f40a4b9ed55dfb0c35e9b1219f3aadeb9de037f7611de1efc5d2e089
7
+ data.tar.gz: 71f344c322ae3df19f83adbc52da8b2d0bb41b324eb5f2f06f3d5eb56906de7e323f41af92359406ebcd73d0cd51ebc1d061de11875ba6ad64fa81763c6d29a3
@@ -34,6 +34,8 @@ module ATSPI
34
34
  when :frame then Window.new(native)
35
35
  else nil
36
36
  end
37
+ rescue
38
+ ErrorAccessible.new(native)
37
39
  end
38
40
  end
39
41
 
@@ -157,7 +159,7 @@ module ATSPI
157
159
  end
158
160
  end
159
161
 
160
- # @return [Accessible] its descendant found at the given path
162
+ # @return [Accessible,nil] its descendant found at the given path
161
163
  #
162
164
  # @overload descendant_by_path(path)
163
165
  # @param path [Array] a path as returned by {#path}
@@ -258,7 +260,7 @@ module ATSPI
258
260
  end
259
261
  end
260
262
 
261
- # @return [Value, nil] its image. It will be nil if it does not
263
+ # @return [Value, nil] its value. It will be nil if it does not
262
264
  # implement the {https://developer.gnome.org/libatspi/stable/AtspiAccessible.html#atspi-accessible-get-value value interface}.
263
265
  #
264
266
  # @see https://developer.gnome.org/libatspi/stable/AtspiAccessible.html#atspi-accessible-get-value atspi_accessible_get_value_iface
@@ -0,0 +1,178 @@
1
+ module ATSPI
2
+ # The {ErrorAccessible} is used for accessibles that cannot be instantiated
3
+ # due to errors. It responds to the interface of {Accessible} and returns
4
+ # dummy values.
5
+ class ErrorAccessible
6
+ include Accessible::Extents
7
+ def extends?
8
+ false
9
+ end
10
+
11
+ include Accessible::Selectable
12
+ def selectable?
13
+ false
14
+ end
15
+
16
+ # @api private
17
+ def initialize(native)
18
+ @native = native
19
+ end
20
+
21
+ attr_reader :native
22
+ private :native
23
+
24
+ # @!group Identification
25
+ # @return [nil] no desktop
26
+ def desktop
27
+ nil
28
+ end
29
+
30
+ # @return [nil] no application
31
+ def application
32
+ nil
33
+ end
34
+
35
+ # @return [nil] no window
36
+ def window
37
+ nil
38
+ end
39
+
40
+ # @return [-1] an invalid index
41
+ def index_in_parent
42
+ -1
43
+ end
44
+ alias_method :index, :index_in_parent
45
+
46
+ # @return [{}] an empty path
47
+ def path
48
+ []
49
+ end
50
+ # @!endgroup
51
+
52
+ # @!group Attributes & States
53
+ # @return [String] its inspection
54
+ def name
55
+ inspect
56
+ end
57
+
58
+ # @return [String] its inspection
59
+ def description
60
+ inspect
61
+ end
62
+
63
+ # @return [:invalid]
64
+ def role
65
+ :invalid
66
+ end
67
+
68
+ # @return ['Invalid']
69
+ def role_name
70
+ 'Invalid'
71
+ end
72
+
73
+ # @return ['Invalid']
74
+ def localized_role_name
75
+ 'Invalid'
76
+ end
77
+
78
+ # @return [''] an empty string
79
+ def toolkit_name
80
+ ''
81
+ end
82
+
83
+ # @return [''] an empty string
84
+ def toolkit_version
85
+ ''
86
+ end
87
+
88
+ # @return [StateSet] an empty state set
89
+ def states
90
+ StateSet.new
91
+ end
92
+
93
+ # @return [{}] an empty hash
94
+ def attributes
95
+ {}
96
+ end
97
+
98
+ # @return [[]] no interfaces
99
+ def interfaces
100
+ []
101
+ end
102
+ # @!endgroup
103
+
104
+ # @!group Tree & Traversal
105
+ # @return [nil] no parent
106
+ def parent
107
+ nil
108
+ end
109
+
110
+ # @return [[]] no children
111
+ def children
112
+ []
113
+ end
114
+
115
+ # @return [[]] no descendants
116
+ def descendants
117
+ []
118
+ end
119
+
120
+ # @return [nil]
121
+ def descendant_by_path(*path)
122
+ nil
123
+ end
124
+
125
+ # @return [{}] no relations
126
+ def relations
127
+ {}
128
+ end
129
+ # @!endgroup
130
+
131
+ # @!group Actions
132
+ # @return [[]] it supports no actions
133
+ def actions
134
+ []
135
+ end
136
+ # @!endgroup
137
+
138
+ # @!group Representative for
139
+ # @return [nil] no document
140
+ def document
141
+ nil
142
+ end
143
+
144
+ # @return [nil] no text
145
+ def text
146
+ nil
147
+ end
148
+
149
+ # @return [nil] no hyperlink
150
+ def hyperlink
151
+ nil
152
+ end
153
+ alias_method :link, :hyperlink
154
+
155
+ # @return [nil] no image
156
+ def image
157
+ nil
158
+ end
159
+
160
+ # @return [nil] no value
161
+ def value
162
+ nil
163
+ end
164
+
165
+ # @return [nil] no table
166
+ def table
167
+ nil
168
+ end
169
+ # @!endgroup
170
+
171
+ # @!group Representations
172
+ # @return [String] itself as an inspectable string
173
+ def inspect
174
+ "#<#{self.class.name}:0x#{'%x14' % __id__}>"
175
+ end
176
+ # @!endgroup
177
+ end
178
+ end
@@ -73,4 +73,5 @@ require 'atspi/accessible/value'
73
73
  # Specific accessibles
74
74
  require 'atspi/desktop'
75
75
  require 'atspi/application'
76
- require 'atspi/window'
76
+ require 'atspi/window'
77
+ require 'atspi/error_accessible'
data/lib/atspi/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module ATSPI
2
2
  # this library's version
3
- VERSION = "0.8.2"
3
+ VERSION = "0.8.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atspi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-28 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -96,6 +96,7 @@ files:
96
96
  - lib/atspi/application.rb
97
97
  - lib/atspi/collection.rb
98
98
  - lib/atspi/desktop.rb
99
+ - lib/atspi/error_accessible.rb
99
100
  - lib/atspi/extents.rb
100
101
  - lib/atspi/libatspi.rb
101
102
  - lib/atspi/requires.rb