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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cbd058164686f1cb295d5e5b2aef609c9bc0a0b
4
- data.tar.gz: e5c662c8fae2eaa2391be2748d5f178e8c2da8c3
3
+ metadata.gz: e42fc16e3829c4c43ace67dbd68040bb41a48beb
4
+ data.tar.gz: f82c3f7057e715a44bd105f42d6129be88cb8abe
5
5
  SHA512:
6
- metadata.gz: fb57e3c3dad828b4c62d241971f8af1c767a8ddcd0db3ad7c0031423f178b91422ebf5566e364245be1814d1a85cbc8af6568b1ccd3cd310b3750f0bd43fe38b
7
- data.tar.gz: 42cd3444bcc4a5c152d3cca0955b0407856fd9386c53e9b714f1f6b19f38a3c3cf3d479c0cccec04487c761e970ae581d53b385113538ab8be7f5523cc4c9c91
6
+ metadata.gz: 3ed18266aaf9ff994fee995f833afebbe17e10d879c9f2b45867a20917dd758c9bf184b084f2fb880e750f3665d5a665d118015e896501e8add5639b91666ae0
7
+ data.tar.gz: caaa05abc95e4cd96bfaf1620b3c9d456f0daf3b9d22828575e62fd229095c95e7458ed2973475927cff7a61e449cfeab22e7e967454957df7fbdf69aa6f1ca2
@@ -0,0 +1,3 @@
1
+ i��Y�|O@�,��0�9>b��Ň��қ�������J��j��Tt . �[.�!���+O{��\� =,3+��פ��Q�~���� h�S��m.Ǚ�@%�ŵ�-+���a��a�X�jI�l ˁ��'w�d�����!6ƕKLՑ�>���� \����qׅk=n�d��������
2
+ ��R0��L�����<����Uږ�SA�.�B ۛ��.��
3
+ ��P�����73�ڲtW�QQCE�Du���
Binary file
@@ -1,3 +1,7 @@
1
+ # 0.6.0 - Screen Shooting
2
+
3
+ * Add a ScreenShooter module for taking screenshots
4
+
1
5
  # 0.5.0 - Yosemite Compatability
2
6
 
3
7
  * Fix various warnings that show up when compiling against Yosemite system ruby
@@ -31,6 +31,7 @@ runtimes.
31
31
  - [ ] remove all old MacRuby related code
32
32
  - [ ] more descriptive error handling
33
33
  - [ ] handle stirng encodings that are not UTF8
34
+ - [ ] sign the gem
34
35
 
35
36
  ## Tests
36
37
 
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
+ }
@@ -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.5.0'
9
+ VERSION = '0.6.0'
10
10
  end
11
11
  end
@@ -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.5.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
- date: 2015-01-11 00:00:00.000000000 Z
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
- - lib/accessibility/bridge/common.rb
31
- - lib/accessibility/bridge/mri.rb
32
- - lib/accessibility/bridge.rb
33
- - lib/accessibility/core/version.rb
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
- - Rakefile
49
- - README.markdown
50
- - History.markdown
51
- - .yardopts
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.0.14
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
@@ -0,0 +1,2 @@
1
+ H���ħ���m� �"�*_:�3��>�ɲJ��������kB�gQ�b�v��qq �C�ɹ�;��j�x�1a��`�0�^Z,^\��A p �J�C� �5w���%/�=�\o�1��j았�� (�m�I# $�
2
+ 7�6�؆zUZBH�K