atspi 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/atspi.gemspec +1 -0
- data/lib/atspi.rb +20 -3
- data/lib/atspi/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f134b1179ffaa409a7a15f004dbcf790e147e941
|
4
|
+
data.tar.gz: 000a1c67cd9a54a64d84befaa7d84ae4a7b19feb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d40c792858b6ba1ed2b290e47dd415a7c7b1b898edf4fa1453342aa32095dd56fb7756d68915e591feda936c3b045f0a102cde178082d51afc059083d4977d
|
7
|
+
data.tar.gz: d8a07bbb02515b5489ba88f759a7408796e5b792e2d009e53394f0fddd50de142add23f755c9460f9aaa0239601f5f3ceb343f26db3f637024a24640bb1eb384
|
data/atspi.gemspec
CHANGED
data/lib/atspi.rb
CHANGED
@@ -1,10 +1,19 @@
|
|
1
1
|
require 'atspi/requires'
|
2
|
+
require 'dbus'
|
2
3
|
|
3
4
|
# ATSPI is the entry point to access accessible objects.
|
4
5
|
module ATSPI
|
5
6
|
class << self
|
6
7
|
extend Forwardable
|
7
8
|
|
9
|
+
# Checks if AT-SPI is activated on the system
|
10
|
+
#
|
11
|
+
# @return [true,false]
|
12
|
+
def available?
|
13
|
+
session_bus = DBus::SessionBus.instance
|
14
|
+
session_bus.service('org.a11y.Bus').exists?
|
15
|
+
end
|
16
|
+
|
8
17
|
# Returns all desktops known to AT-SPI.
|
9
18
|
#
|
10
19
|
# @return [Array<Desktop>]
|
@@ -15,8 +24,12 @@ module ATSPI
|
|
15
24
|
# @see https://developer.gnome.org/libatspi/stable/libatspi-atspi-registry.html#atspi-get-desktop atspi_get_desktop
|
16
25
|
# @see https://developer.gnome.org/libatspi/stable/libatspi-atspi-registry.html#atspi-get-desktop-count atspi_get_desktop_count
|
17
26
|
def desktops
|
18
|
-
@desktops ||=
|
19
|
-
|
27
|
+
@desktops ||= if available?
|
28
|
+
Libatspi.get_desktop_count.times.map do |idx|
|
29
|
+
Desktop.new(Libatspi.get_desktop(idx))
|
30
|
+
end
|
31
|
+
else
|
32
|
+
[]
|
20
33
|
end
|
21
34
|
end
|
22
35
|
|
@@ -29,7 +42,11 @@ module ATSPI
|
|
29
42
|
# @example
|
30
43
|
# ATSPI.applications # => [#<ATSPI::Application:0x71d18014 @desktop=0 @name="gnome-terminal-server">, …]
|
31
44
|
def applications(desktop = desktops.first)
|
32
|
-
desktop
|
45
|
+
if desktop
|
46
|
+
desktop.applications
|
47
|
+
else
|
48
|
+
[]
|
49
|
+
end
|
33
50
|
end
|
34
51
|
|
35
52
|
#@!method generate_keyboard_event(keyval, keystring, synth_type)
|
data/lib/atspi/version.rb
CHANGED
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.
|
4
|
+
version: 0.8.4
|
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-
|
11
|
+
date: 2016-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gir_ffi
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-dbus
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.11.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.11.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|