movewin 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -7
  2. data/ext/movewin/winutils.c +5 -1
  3. data/lib/movewin.rb +17 -1
  4. metadata +29 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a8e944a1c1c53e792e0702a75bcaa935e1f40d11
4
- data.tar.gz: a810a3fbf0e569a772fef44fdad80eb2ba48eac8
5
- SHA512:
6
- metadata.gz: 76f97acb90936fb4b3bca5ffeb6c5879e0a184974e9bae82f26b4ed2ac7ede1f263566104e3a0e359570365ca3426d15c1dc66a7f1f195c6d904497fcd18c28b
7
- data.tar.gz: 1a313507d82594ec1ce688515dcd61066dc048dd41f40598dbcec801288fa8d1da45659cc9404a43b897446227aa0f573771321a663b603c9970d01591b448e9
1
+ ---
2
+ SHA1:
3
+ data.tar.gz: ec2cca34dab2420bdb554f23048fb78fdaf79896
4
+ metadata.gz: 18f6fcbe38d203cc912c2aa9bd88aa20f320a4d7
5
+ SHA512:
6
+ data.tar.gz: 6cddcf1dccd2db60492e6da76cf1295f42312cbe2a86c3d3af4aed313e6acb6cad4b17a97980c856a6361e07fb66e751f16884c0e5d6c5337bfced9dbe5c21e3
7
+ metadata.gz: 677a6c4e31858049864754f19ca139413b458ac13d785224f557cb25f718ad88a95b5e8a7b07663b1af6be4d4b88f8add1e13f79a46bb9cacef8e3f013cc9729
@@ -194,7 +194,11 @@ AXUIElementRef AXWindowFromCGWindow(CFDictionaryRef window, int minIdx) {
194
194
  AXUIElementCopyAttributeValue(
195
195
  appWindow, kAXTitleAttribute, (CFTypeRef *)&actualWindowTitle
196
196
  );
197
- if(CFStringCompare(targetWindowName, actualWindowTitle, 0) != 0) continue;
197
+ if( !actualWindowTitle ||
198
+ CFStringCompare(targetWindowName, actualWindowTitle, 0) != 0)
199
+ {
200
+ continue;
201
+ }
198
202
 
199
203
  /* Position and size must match */
200
204
  actualPosition = AXWindowGetPosition(appWindow);
data/lib/movewin.rb CHANGED
@@ -36,8 +36,24 @@
36
36
  require 'movewin/movewin_ext'
37
37
 
38
38
  module MoveWin
39
- VERSION = '1.0'
39
+ VERSION = '1.1'
40
+
41
+ # Individual accessors for display size components
42
+ def self.display_width; MoveWin.display_size[0]; end
43
+ def self.display_height; MoveWin.display_size[1]; end
44
+
40
45
  class Window
46
+ # Individual accessors and mutators for window position and size components
47
+ def x; self.position[0]; end
48
+ def y; self.position[1]; end
49
+ def width; self.size[0]; end
50
+ def height; self.size[1]; end
51
+ def x=(x); self.move!(x, self.position[1]); end
52
+ def y=(y); self.move!(self.position[0], y); end
53
+ def width=(width); self.resize!(width, self.size[1]); end
54
+ def height=(height); self.resize!(self[0], height); end
55
+
56
+ # Combined accessor and mutator for all window bounds together
41
57
  def bounds
42
58
  self.position + self.size
43
59
  end
metadata CHANGED
@@ -1,49 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: movewin
3
- version: !ruby/object:Gem::Version
4
- version: '1.0'
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.1"
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Andrew Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-31 00:00:00.000000000 Z
11
+
12
+ date: 2014-09-06 00:00:00 Z
12
13
  dependencies: []
14
+
13
15
  description: List and move OS X windows from Ruby via the OS X accessibility APIs.
14
16
  email: andrew@zeuscat.com
15
17
  executables: []
16
- extensions:
18
+
19
+ extensions:
17
20
  - ext/movewin/extconf.rb
18
21
  extra_rdoc_files: []
19
- files:
20
- - ext/movewin/extconf.rb
22
+
23
+ files:
24
+ - lib/movewin.rb
21
25
  - ext/movewin/movewin_ext.c
22
26
  - ext/movewin/winutils.c
23
27
  - ext/movewin/winutils.h
24
- - lib/movewin.rb
28
+ - ext/movewin/extconf.rb
25
29
  homepage: https://github.com/andrewgho/movewin-ruby
26
- licenses:
30
+ licenses:
27
31
  - BSD-3-Clause
28
32
  metadata: {}
33
+
29
34
  post_install_message:
30
35
  rdoc_options: []
31
- require_paths:
36
+
37
+ require_paths:
32
38
  - lib
33
- required_ruby_version: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - ">="
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- required_rubygems_version: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - &id001
42
+ - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - *id001
43
48
  requirements: []
49
+
44
50
  rubyforge_project:
45
- rubygems_version: 2.2.2
51
+ rubygems_version: 2.0.5
46
52
  signing_key:
47
53
  specification_version: 4
48
54
  summary: List and move OS X windows from Ruby
49
55
  test_files: []
56
+