accessibility_core 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -0
- data.tar.gz.sig +0 -0
- data/History.markdown +4 -0
- data/README.markdown +1 -0
- data/Rakefile +1 -2
- data/ext/accessibility/screen_shooter/extconf.rb +23 -0
- data/ext/accessibility/screen_shooter/screen_shooter.c +63 -0
- data/lib/accessibility/core/version.rb +1 -1
- data/lib/accessibility/screen_shooter.rb +15 -0
- metadata +47 -22
- metadata.gz.sig +2 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e42fc16e3829c4c43ace67dbd68040bb41a48beb
|
4
|
+
data.tar.gz: f82c3f7057e715a44bd105f42d6129be88cb8abe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed18266aaf9ff994fee995f833afebbe17e10d879c9f2b45867a20917dd758c9bf184b084f2fb880e750f3665d5a665d118015e896501e8add5639b91666ae0
|
7
|
+
data.tar.gz: caaa05abc95e4cd96bfaf1620b3c9d456f0daf3b9d22828575e62fd229095c95e7458ed2973475927cff7a61e449cfeab22e7e967454957df7fbdf69aa6f1ca2
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
Binary file
|
data/History.markdown
CHANGED
data/README.markdown
CHANGED
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ end
|
|
9
9
|
|
10
10
|
desc 'Startup an IRb console with everything loaded'
|
11
11
|
task :console_complete => :compile do
|
12
|
-
sh 'irb -Ilib -raccessibility/bridge -raccessibility/core -raccessibility/extras -raccessibility/highlighter'
|
12
|
+
sh 'irb -Ilib -raccessibility/bridge -raccessibility/core -raccessibility/extras -raccessibility/highlighter -raccessibility/screen_shooter'
|
13
13
|
end
|
14
14
|
|
15
15
|
# Gem stuff
|
@@ -24,4 +24,3 @@ task :install => :gem do
|
|
24
24
|
require 'rubygems/installer'
|
25
25
|
Gem::Installer.new("pkg/#{SPEC.file_name}").install
|
26
26
|
end
|
27
|
-
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
|
3
|
+
$CFLAGS << ' -std=c11 -Weverything -ObjC -fno-objc-arc'
|
4
|
+
$CFLAGS << ' -Wno-disabled-macro-expansion -Wno-gnu -Wno-documentation -Wno-used-but-marked-unused'
|
5
|
+
# @todo REALLY NEED TO CLEAR ALL THESE WARNINGS
|
6
|
+
$CFLAGS << ' -Wno-conversion'
|
7
|
+
|
8
|
+
$LIBS << ' -framework Foundation'
|
9
|
+
$LIBS << ' -framework CoreGraphics'
|
10
|
+
|
11
|
+
unless RbConfig::CONFIG['CC'].match(/clang/)
|
12
|
+
clang = `which clang`.chomp
|
13
|
+
fail 'Clang not installed. Cannot build C extension' if clang.empty?
|
14
|
+
RbConfig::MAKEFILE_CONFIG['CC'] = clang
|
15
|
+
RbConfig::MAKEFILE_CONFIG['CXX'] = clang
|
16
|
+
end
|
17
|
+
|
18
|
+
create_makefile 'screen_shooter/screen_shooter'
|
19
|
+
|
20
|
+
makefile = File.read 'Makefile'
|
21
|
+
makefile.gsub! '$(DLLIB): $(OBJS) Makefile', '$(DLLIB): $(OBJS) Makefile ../bridge/bridge.o'
|
22
|
+
makefile.gsub! '$(LDSHARED) -o $@', ' $(LDSHARED) -o $@ ../bridge/bridge.o'
|
23
|
+
File.open('Makefile', 'w') { |f| f.write makefile }
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#include "ruby.h"
|
2
|
+
#import <Cocoa/Cocoa.h>
|
3
|
+
#include "../bridge/bridge.h"
|
4
|
+
|
5
|
+
static VALUE rb_mSS;
|
6
|
+
|
7
|
+
static
|
8
|
+
VALUE
|
9
|
+
rb_ss_take_shot(__unused const VALUE self, const VALUE rbrect, const VALUE path)
|
10
|
+
{
|
11
|
+
NSString* const ns_path =
|
12
|
+
[[NSString alloc] initWithBytesNoCopy:RSTRING_PTR(path)
|
13
|
+
length:RSTRING_LEN(path)
|
14
|
+
encoding:NSUTF8StringEncoding
|
15
|
+
freeWhenDone:NO];
|
16
|
+
|
17
|
+
CGRect rect = unwrap_rect(rbrect);
|
18
|
+
if (rect.size.width < 0 || rect.size.height < 0)
|
19
|
+
rect = CGRectInfinite;
|
20
|
+
|
21
|
+
CGImageRef const image =
|
22
|
+
CGWindowListCreateImage(rect,
|
23
|
+
kCGWindowListOptionOnScreenOnly,
|
24
|
+
kCGNullWindowID,
|
25
|
+
kCGWindowImageDefault);
|
26
|
+
|
27
|
+
NSBitmapImageRep* const rep =
|
28
|
+
[[NSBitmapImageRep alloc] initWithCGImage:image];
|
29
|
+
|
30
|
+
NSData* const data = [rep representationUsingType:NSPNGFileType
|
31
|
+
properties:nil];
|
32
|
+
|
33
|
+
const VALUE result =
|
34
|
+
[data writeToFile:ns_path atomically:NO] ? Qtrue : Qfalse;
|
35
|
+
|
36
|
+
|
37
|
+
[ns_path release];
|
38
|
+
if (image)
|
39
|
+
CFRelease(image);
|
40
|
+
[rep release];
|
41
|
+
[data release];
|
42
|
+
|
43
|
+
return result;
|
44
|
+
}
|
45
|
+
|
46
|
+
void Init_screen_shooter(void);
|
47
|
+
|
48
|
+
void
|
49
|
+
Init_screen_shooter()
|
50
|
+
{
|
51
|
+
Init_bridge();
|
52
|
+
|
53
|
+
/*
|
54
|
+
* Document-module: ScreenShooter
|
55
|
+
*
|
56
|
+
* A module that adds a simple API for taking screen shots. It only
|
57
|
+
* uses default options at the moment, so screen shots may not come
|
58
|
+
* out as fancy as they could...this could be fixed in the future...
|
59
|
+
*/
|
60
|
+
rb_mSS = rb_define_module("ScreenShooter");
|
61
|
+
rb_extend_object(rb_mSS, rb_mSS);
|
62
|
+
rb_define_method(rb_mSS, "screenshot", rb_ss_take_shot, 2);
|
63
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'accessibility/bridge'
|
2
|
+
require 'accessibility/screen_shooter/screen_shooter.bundle'
|
3
|
+
|
4
|
+
module ScreenShooter
|
5
|
+
|
6
|
+
def shoot rect = nil, path = '~/Downloads'
|
7
|
+
path = File.expand_path path.to_s
|
8
|
+
path = "#{path}/AXElements-ScreenShot-#{Time.now.strftime '%Y%m%d%H%M%S'}.png"
|
9
|
+
|
10
|
+
rect ||= CGRect.new(CGPoint.new(0, 0), CGSize.new(-1, -1))
|
11
|
+
|
12
|
+
screenshot rect, path
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accessibility_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRMwEQYDVQQDDAptYXJr
|
14
|
+
cmFkYTI2MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNj
|
15
|
+
b20wHhcNMTUwMjAyMDQ1MTA3WhcNMTYwMjAyMDQ1MTA3WjBBMRMwEQYDVQQDDApt
|
16
|
+
YXJrcmFkYTI2MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
|
17
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDeOx6HTOprjEsz
|
18
|
+
FP/7agdlejgztRqyQhyqEoAQIBAlerdVGNbciMOW8+KWRd6SnlzRvk155o7I3xM7
|
19
|
+
AGtSWqEHTUifyXGYKZF/UW/ELvrXNUk1wcy+D3UsiKf0jqON+fmqrGlm5PzoF4gi
|
20
|
+
BhQ2ftcMctlQk4VFkewfFa4ZuhEiWmfLWkND+JsdNwVkubSN4xak35/2Xx6CBuPe
|
21
|
+
zsCsJH66TSq1rppCKKukA6KQ4TrV2wKA2Mrfd+t0sBW479ARwma//FCj4QSMbmGr
|
22
|
+
NcSqjwdWonh9jLNeC2PeQpD89USvOMUxuB8As5b0ogH1wjt95MbgWbXrsrTFi16E
|
23
|
+
+JIS0imdAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
24
|
+
BBSwxj6mvdm3mmDV0kM0LcMjbdO+pzAfBgNVHREEGDAWgRRtYXJrcmFkYTI2QGdt
|
25
|
+
YWlsLmNvbTAfBgNVHRIEGDAWgRRtYXJrcmFkYTI2QGdtYWlsLmNvbTANBgkqhkiG
|
26
|
+
9w0BAQUFAAOCAQEAs5lrI4/N5ZdVRN7Fu4AFcv6Ex6IaEG8IEClQPphQYtGutQyv
|
27
|
+
zE939GshQE+bq7+g44axieuWPot4BJzGJbSvHJJa/4t4k3H+EYt2mwKbYIu2PHSU
|
28
|
+
RaJtAjkax8/PgwQeBx2CVdpX+p5IVk0hZ4nH+zd9bZpztQnl6oCakHMOSb3ds0er
|
29
|
+
zLmvMhkYClNmjcgggy+UoXzsOACGwwNe+iyydlJujz3JjLmODpiet0aSZEx4ZSdk
|
30
|
+
0WHcut5WdsOnrIkVkbvgxDUtQclWeulaIRqGkvnajtp2FJdRsi/n8zo3nAfeR6QM
|
31
|
+
vkReJWGG0H8U/JJqYfQBZopYOUMnLJQxN+NA4w==
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
34
|
dependencies: []
|
13
35
|
description: |
|
14
36
|
accessibility_core is a wrapper around the OS X Accessibility framework.
|
@@ -27,28 +49,31 @@ extensions:
|
|
27
49
|
- ext/accessibility/highlighter/extconf.rb
|
28
50
|
extra_rdoc_files: []
|
29
51
|
files:
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
- lib/accessibility/core.rb
|
35
|
-
- lib/accessibility/extras/common.rb
|
36
|
-
- lib/accessibility/extras.rb
|
37
|
-
- lib/accessibility/highlighter.rb
|
52
|
+
- ".yardopts"
|
53
|
+
- History.markdown
|
54
|
+
- README.markdown
|
55
|
+
- Rakefile
|
38
56
|
- ext/accessibility/bridge/bridge.c
|
39
|
-
- ext/accessibility/core/core.c
|
40
|
-
- ext/accessibility/extras/extras.c
|
41
|
-
- ext/accessibility/highlighter/highlighter.c
|
42
57
|
- ext/accessibility/bridge/bridge.h
|
43
|
-
- ext/accessibility/extras/extras.h
|
44
58
|
- ext/accessibility/bridge/extconf.rb
|
59
|
+
- ext/accessibility/core/core.c
|
45
60
|
- ext/accessibility/core/extconf.rb
|
46
61
|
- ext/accessibility/extras/extconf.rb
|
62
|
+
- ext/accessibility/extras/extras.c
|
63
|
+
- ext/accessibility/extras/extras.h
|
47
64
|
- ext/accessibility/highlighter/extconf.rb
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
- .
|
65
|
+
- ext/accessibility/highlighter/highlighter.c
|
66
|
+
- ext/accessibility/screen_shooter/extconf.rb
|
67
|
+
- ext/accessibility/screen_shooter/screen_shooter.c
|
68
|
+
- lib/accessibility/bridge.rb
|
69
|
+
- lib/accessibility/bridge/common.rb
|
70
|
+
- lib/accessibility/bridge/mri.rb
|
71
|
+
- lib/accessibility/core.rb
|
72
|
+
- lib/accessibility/core/version.rb
|
73
|
+
- lib/accessibility/extras.rb
|
74
|
+
- lib/accessibility/extras/common.rb
|
75
|
+
- lib/accessibility/highlighter.rb
|
76
|
+
- lib/accessibility/screen_shooter.rb
|
52
77
|
- test/helper.rb
|
53
78
|
homepage: https://github.com/AXElements/accessibility_core
|
54
79
|
licenses:
|
@@ -60,17 +85,17 @@ require_paths:
|
|
60
85
|
- lib
|
61
86
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
87
|
requirements:
|
63
|
-
- -
|
88
|
+
- - ">="
|
64
89
|
- !ruby/object:Gem::Version
|
65
90
|
version: '0'
|
66
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
92
|
requirements:
|
68
|
-
- -
|
93
|
+
- - ">="
|
69
94
|
- !ruby/object:Gem::Version
|
70
95
|
version: '0'
|
71
96
|
requirements: []
|
72
97
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.4.3
|
74
99
|
signing_key:
|
75
100
|
specification_version: 4
|
76
101
|
summary: A library for building automation tools on OS X
|
metadata.gz.sig
ADDED