totalspaces2 2.0.1 → 2.0.2
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 +4 -4
- data/lib/TSLib.h +17 -0
- data/lib/libtotalspaces2api.dylib +0 -0
- data/lib/totalspaces2.rb +46 -6
- metadata +19 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a35ca4a8f18d11eaffa4fefe54e252c3235c65bd
|
4
|
+
data.tar.gz: d384467bf0080d07fb93521e1b54bac8aa141f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28cf0083fd27abfd0e861ae8f241c1359f3c110380856df9489901ccd7060d6433016ce13c8b5b71662f0b5ced6a15908e2c94c756c2cc3423dd3bba9ab5b7d7
|
7
|
+
data.tar.gz: d77f8e8f4badc876659dc11c3042e5ae76452520ca7ee8d185bc2ec6d137cee57f049d119bacc48b0dab0190cf4b9d17ca25442d6d37c4bddf0e7fc326b86955
|
data/lib/TSLib.h
CHANGED
@@ -98,6 +98,14 @@ unsigned int tsapi_currentSpaceNumberOnDisplay(CGDirectDisplayID displayID);
|
|
98
98
|
*/
|
99
99
|
const char *tsapi_spaceNameForSpaceNumberOnDisplay(unsigned int spaceNumber, CGDirectDisplayID displayID);
|
100
100
|
|
101
|
+
/*
|
102
|
+
* The uuid for the given space number. This uniquely identifies the space, even when
|
103
|
+
* it is moved to a different position or to another monitor.
|
104
|
+
*
|
105
|
+
* You must call tsapi_freeString when you have finished with the returned string.
|
106
|
+
*/
|
107
|
+
const char *tsapi_uuidForSpaceNumberOnDisplay(unsigned int spaceNumber, CGDirectDisplayID displayID);
|
108
|
+
|
101
109
|
/*
|
102
110
|
* The total number of spaces.
|
103
111
|
* This includes the dashboard if you have it set as a space, and any
|
@@ -228,6 +236,15 @@ bool tsapi_moveWindowToSpaceOnDisplay(unsigned int windowID, unsigned int spaceN
|
|
228
236
|
*/
|
229
237
|
bool tsapi_moveSpaceToPositionOnDisplay(unsigned int spaceNumber, unsigned int positionNumber, CGDirectDisplayID displayID);
|
230
238
|
|
239
|
+
/*
|
240
|
+
* Move a space to another position on another display
|
241
|
+
* You cannot use this displays have separate spaces is turned off.
|
242
|
+
* You cannot move a currently visible space.
|
243
|
+
*
|
244
|
+
* Returns true on success, false if any parameter was invalid.
|
245
|
+
*/
|
246
|
+
bool tsapi_moveSpaceOnDisplayToPositionOnDisplay(unsigned int spaceNumber, CGDirectDisplayID fromDisplayID, unsigned int positionNumber, CGDirectDisplayID toDisplayID);
|
247
|
+
|
231
248
|
/*
|
232
249
|
* Add desktops
|
233
250
|
* There can usually be at most 16 desktops, unless desktops have migrated
|
Binary file
|
data/lib/totalspaces2.rb
CHANGED
@@ -5,8 +5,7 @@
|
|
5
5
|
# It is the officially supported way of using the API library libtotalspaces2api, and the required dylib
|
6
6
|
# comes bundled with this gem. This gem uses {Ruby-FFI}[link:https://github.com/ffi/ffi] to call the functions in the dylib.
|
7
7
|
# You'll need a sane ruby and compilation environment to install ruby-ffi - it probably won't install immediately with the
|
8
|
-
# ruby that comes with OSX because none of the compilation tools are present
|
9
|
-
# and {rbenv}[link:https://github.com/sstephenson/rbenv/] to manage our ruby scripting environment.
|
8
|
+
# ruby that comes with OSX because none of the compilation tools are present - you'll need to install Xcode first.
|
10
9
|
#
|
11
10
|
# You may use this gem in various ways. For instance, you could:
|
12
11
|
#
|
@@ -27,6 +26,9 @@
|
|
27
26
|
#
|
28
27
|
# % [sudo] gem install totalspaces2
|
29
28
|
#
|
29
|
+
# You will need Xcode installed in order for the C compiler to be present in order to install
|
30
|
+
# ruby-ffi, which is required (and automatically installed) by the totalspaces2 gem.
|
31
|
+
#
|
30
32
|
# Source code can be downloaded on GitHub
|
31
33
|
#
|
32
34
|
# * https://github.com/binaryage/totalspaces2-api
|
@@ -81,6 +83,7 @@ module TSApi #:nodoc:
|
|
81
83
|
|
82
84
|
attach_function :tsapi_currentSpaceNumberOnDisplay, [:uint], :uint
|
83
85
|
attach_function :tsapi_spaceNameForSpaceNumberOnDisplay, [:uint, :uint], :pointer
|
86
|
+
attach_function :tsapi_uuidForSpaceNumberOnDisplay, [:uint, :uint], :pointer
|
84
87
|
attach_function :tsapi_numberOfSpacesOnDisplay, [:uint], :uint
|
85
88
|
|
86
89
|
attach_function :tsapi_definedColumnsOnDisplay, [:uint], :uint
|
@@ -104,6 +107,7 @@ module TSApi #:nodoc:
|
|
104
107
|
attach_function :tsapi_moveWindowToSpaceOnDisplay, [:uint, :uint, :uint], :bool
|
105
108
|
|
106
109
|
attach_function :tsapi_moveSpaceToPositionOnDisplay, [:uint, :uint, :uint], :bool
|
110
|
+
attach_function :tsapi_moveSpaceOnDisplayToPositionOnDisplay, [:uint, :uint, :uint, :uint], :bool
|
107
111
|
|
108
112
|
attach_function :tsapi_addDesktopsOnDisplay, [:uint, :uint], :uint
|
109
113
|
attach_function :tsapi_removeDesktopsOnDisplay, [:uint, :uint], :bool
|
@@ -246,7 +250,7 @@ module TotalSpaces2
|
|
246
250
|
end
|
247
251
|
|
248
252
|
# Returns the number of the current space on the given display.
|
249
|
-
# Space numbering starts at 1
|
253
|
+
# Space numbering starts at 1.
|
250
254
|
#
|
251
255
|
# display_id = TotalSpaces2.displays[0]
|
252
256
|
# puts "Current space number: #{TotalSpaces2.current_space_on_display(display_id)}"
|
@@ -256,7 +260,7 @@ module TotalSpaces2
|
|
256
260
|
end
|
257
261
|
|
258
262
|
# Returns the name for a space on the main display. The returned string will be empty
|
259
|
-
# if the space number is not valid
|
263
|
+
# if the space number is not valid.
|
260
264
|
#
|
261
265
|
# current_space = TotalSpaces2.current_space
|
262
266
|
# puts "Current space is called: #{TotalSpaces2.name_for_space(current_space)}"
|
@@ -267,7 +271,7 @@ module TotalSpaces2
|
|
267
271
|
end
|
268
272
|
|
269
273
|
# Returns the name for a space. The returned string will be empty if the space number is
|
270
|
-
# not valid
|
274
|
+
# not valid.
|
271
275
|
#
|
272
276
|
# current_space = TotalSpaces2.current_space
|
273
277
|
# display_id = TotalSpaces2.main_display[:display_id]
|
@@ -278,6 +282,29 @@ module TotalSpaces2
|
|
278
282
|
name.force_encoding("UTF-8")
|
279
283
|
end
|
280
284
|
|
285
|
+
# Returns the uuid for a space on the main display. The returned string will be empty
|
286
|
+
# if the space number is not valid.
|
287
|
+
#
|
288
|
+
# current_space = TotalSpaces2.current_space
|
289
|
+
# puts "Current space uuid is: #{TotalSpaces2.uuid_for_space(current_space)}"
|
290
|
+
#
|
291
|
+
def uuid_for_space(space_number)
|
292
|
+
uuid = string_and_free(TSApi.tsapi_uuidForSpaceNumberOnDisplay(space_number, 0))
|
293
|
+
uuid.force_encoding("UTF-8")
|
294
|
+
end
|
295
|
+
|
296
|
+
# Returns the uuid for a space. The returned string will be empty
|
297
|
+
# if the space number is not valid.
|
298
|
+
#
|
299
|
+
# current_space = TotalSpaces2.current_space
|
300
|
+
# display_id = TotalSpaces2.main_display[:display_id]
|
301
|
+
# puts "Current space uuid is: #{TotalSpaces2.uuid_for_space_on_display(current_space, display_id)}"
|
302
|
+
#
|
303
|
+
def uuid_for_space_on_display(space_number, display_id)
|
304
|
+
uuid = string_and_free(TSApi.tsapi_uuidForSpaceNumberOnDisplay(space_number, display_id))
|
305
|
+
uuid.force_encoding("UTF-8")
|
306
|
+
end
|
307
|
+
|
281
308
|
# Returns the total number of spaces including fullscreens, dashboard (if it's a space).
|
282
309
|
#
|
283
310
|
# puts "Total number of spaces: #{TotalSpaces2.number_of_spaces}"
|
@@ -499,7 +526,7 @@ module TotalSpaces2
|
|
499
526
|
# TotalSpaces2.move_space_to_position(4, 2)
|
500
527
|
#
|
501
528
|
def move_space_to_position(space_number, position_number)
|
502
|
-
TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number)
|
529
|
+
TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, 0)
|
503
530
|
end
|
504
531
|
|
505
532
|
# Move space to a new position in the grid. Spaces can only be moved
|
@@ -514,6 +541,19 @@ module TotalSpaces2
|
|
514
541
|
TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, display_id)
|
515
542
|
end
|
516
543
|
|
544
|
+
# Move space to a new position on another screen.
|
545
|
+
# This won't work if you do not have displays have separate spaces enabled.
|
546
|
+
#
|
547
|
+
# Returns false if any parameters are not valid.
|
548
|
+
#
|
549
|
+
# display_id = TotalSpaces2.main_display[:display_id]
|
550
|
+
# display2_id = TotalSpaces2.display_list[1][:display_id]
|
551
|
+
# TotalSpaces2.move_space_on_display_to_position_on_display(2, display_id, 1, display2_id)
|
552
|
+
#
|
553
|
+
def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)
|
554
|
+
TSApi.tsapi_moveSpaceOnDisplayToPositionOnDisplay(space_number, from_display_id, position_number, to_display_id)
|
555
|
+
end
|
556
|
+
|
517
557
|
# Add desktops
|
518
558
|
# There can be at most 16 desktops unless the display has collected some when
|
519
559
|
# a secondary display has been unplugged.
|
metadata
CHANGED
@@ -1,27 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totalspaces2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 1.0.11
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 1.0.11
|
27
33
|
description: This allows you to control the TotalSpaces2 desktop manager for mac from
|
@@ -31,32 +37,33 @@ executables: []
|
|
31
37
|
extensions: []
|
32
38
|
extra_rdoc_files: []
|
33
39
|
files:
|
34
|
-
- README.rdoc
|
35
40
|
- MIT_LICENCE
|
36
|
-
-
|
37
|
-
- lib/libtotalspaces2api.dylib
|
41
|
+
- README.rdoc
|
38
42
|
- lib/TSLib.h
|
43
|
+
- lib/libtotalspaces2api.dylib
|
44
|
+
- lib/totalspaces2.rb
|
39
45
|
homepage: https://github.com/binaryage/totalspaces2-api/tree/master/ruby
|
40
|
-
licenses:
|
46
|
+
licenses:
|
47
|
+
- MIT
|
41
48
|
metadata: {}
|
42
49
|
post_install_message:
|
43
50
|
rdoc_options:
|
44
|
-
- --charset=UTF-8
|
51
|
+
- "--charset=UTF-8"
|
45
52
|
require_paths:
|
46
53
|
- lib
|
47
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
48
55
|
requirements:
|
49
|
-
- -
|
56
|
+
- - ">="
|
50
57
|
- !ruby/object:Gem::Version
|
51
58
|
version: '0'
|
52
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
60
|
requirements:
|
54
|
-
- -
|
61
|
+
- - ">="
|
55
62
|
- !ruby/object:Gem::Version
|
56
63
|
version: '0'
|
57
64
|
requirements: []
|
58
65
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.2.2
|
60
67
|
signing_key:
|
61
68
|
specification_version: 4
|
62
69
|
summary: TotalSpaces2 control from ruby
|