pasteboard 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +3 -0
- data/.autotest +14 -0
- data/.gemtest +0 -0
- data/History.txt +5 -0
- data/Manifest.txt +12 -0
- data/README.rdoc +97 -0
- data/Rakefile +26 -0
- data/ext/pasteboard/extconf.rb +14 -0
- data/ext/pasteboard/pasteboard.c +478 -0
- data/lib/pasteboard.rb +251 -0
- data/lib/pasteboard/type.rb +713 -0
- data/sample/dump.rb +16 -0
- data/sample/image.rb +110 -0
- data/test/test_pasteboard.rb +287 -0
- metadata +151 -0
- metadata.gz.sig +0 -0
data/lib/pasteboard.rb
ADDED
@@ -0,0 +1,251 @@
|
|
1
|
+
require 'enumerator'
|
2
|
+
|
3
|
+
##
|
4
|
+
# Pasteboard wraps the OS X pasteboard (clipboard) allowing you to paste
|
5
|
+
# multiple flavors of a pasteboard item. Currently it only supports the
|
6
|
+
# general clipboard.
|
7
|
+
#
|
8
|
+
# To add data to the clipboard:
|
9
|
+
#
|
10
|
+
# item = [
|
11
|
+
# Pasteboard::Type::UTF_8, 'π'],
|
12
|
+
# Pasteboard::Type::PLAIN_TEXT, 'pi'],
|
13
|
+
# ]
|
14
|
+
#
|
15
|
+
# pasteboard.put item
|
16
|
+
#
|
17
|
+
# See also #put, #put_url and #put_jpeg_url
|
18
|
+
#
|
19
|
+
# To retrieve data from the clipboard:
|
20
|
+
#
|
21
|
+
# data = pasteboard.first Pasteboard::Type::UTF_8
|
22
|
+
#
|
23
|
+
# If the item cannot be found nil will be returned.
|
24
|
+
#
|
25
|
+
# See also #first, #[] and #each.
|
26
|
+
#
|
27
|
+
# Pasteboard also provides direct access to the C API through #clear,
|
28
|
+
# #copy_item_flavors, #copy_item_flavor_data, #get_item_count,
|
29
|
+
# #get_item_identifier, #name, #put_item_flavor and #sync.
|
30
|
+
|
31
|
+
class Pasteboard
|
32
|
+
|
33
|
+
##
|
34
|
+
# Pasteboard error class
|
35
|
+
|
36
|
+
class Error < RuntimeError
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
# Missing is raised when attempting to access an item that does not exist
|
41
|
+
|
42
|
+
class Missing < Error
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# Version of pasteboard
|
47
|
+
|
48
|
+
VERSION = '1.0'
|
49
|
+
|
50
|
+
if defined? Encoding then
|
51
|
+
BE_BOM = "\xFE\xFF" # :nodoc:
|
52
|
+
LE_BOM = "\xFF\xFE" # :nodoc:
|
53
|
+
|
54
|
+
BE_BOM.force_encoding Encoding::BINARY
|
55
|
+
LE_BOM.force_encoding Encoding::BINARY
|
56
|
+
|
57
|
+
little = [1].pack('S') == "\001\000" ? true : false
|
58
|
+
|
59
|
+
NATIVE_BOM = little ? LE_BOM : BE_BOM
|
60
|
+
NATIVE_ENCODING = little ? Encoding::UTF_16LE : Encoding::UTF_16BE
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# General clipboard pasteboard type. Cut, copy and paste use this
|
65
|
+
# pasteboard.
|
66
|
+
|
67
|
+
CLIPBOARD = 'com.apple.pasteboard.clipboard'
|
68
|
+
|
69
|
+
##
|
70
|
+
# Find pasteboard type. Find and find and replace use this pasteboard.
|
71
|
+
|
72
|
+
FIND = 'com.apple.pasteboard.find'
|
73
|
+
|
74
|
+
##
|
75
|
+
# A uniquely named pasteboard type.
|
76
|
+
|
77
|
+
UNIQUE = nil
|
78
|
+
|
79
|
+
##
|
80
|
+
# Synchronizes the pasteboard and returns the item at +index+ in the
|
81
|
+
# pasteboard.
|
82
|
+
#
|
83
|
+
# If +flavor+ is given only the given flavor's data is returned. If no
|
84
|
+
# flavor matches nil is returned.
|
85
|
+
#
|
86
|
+
# An item is an Array of pairs in the order of preference which looks like
|
87
|
+
# this:
|
88
|
+
#
|
89
|
+
# [
|
90
|
+
# ["public.utf8-plain-text", "Pasteboard"],
|
91
|
+
# ["public.utf16-external-plain-text",
|
92
|
+
# "\377\376P\000a\000s\000t\000e\000b\000o\000a\000r\000d\000"],
|
93
|
+
# ["com.apple.traditional-mac-plain-text", "Pasteboard"],
|
94
|
+
# ["public.utf16-plain-text",
|
95
|
+
# "P\000a\000s\000t\000e\000b\000o\000a\000r\000d\000"],
|
96
|
+
# ]
|
97
|
+
|
98
|
+
def [] index, flavor = nil
|
99
|
+
flags = sync
|
100
|
+
|
101
|
+
raise Error, 'pasteboard sync error' if (flags & MODIFIED) != 0
|
102
|
+
|
103
|
+
id = get_item_identifier index + 1
|
104
|
+
|
105
|
+
get id, flavor
|
106
|
+
rescue Missing
|
107
|
+
return nil
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Synchronizes the pasteboard and yields each item in the pasteboard.
|
112
|
+
#
|
113
|
+
# If +flavor+ is given only the given flavor's data is yielded. If no
|
114
|
+
# flavor matches nil is yielded.
|
115
|
+
#
|
116
|
+
# See #[] for a description of an item.
|
117
|
+
|
118
|
+
def each flavor = nil # :yields: item
|
119
|
+
unless block_given? then
|
120
|
+
enum = defined?(Enumerator) ? Enumerator : Enumerable::Enumerator # 1.8.7
|
121
|
+
return enum.new(self, :each, flavor)
|
122
|
+
end
|
123
|
+
|
124
|
+
flags = sync
|
125
|
+
|
126
|
+
raise Error, 'pasteboard sync error' if (flags & MODIFIED) != 0
|
127
|
+
|
128
|
+
ids.each do |id|
|
129
|
+
yield get(id, flavor)
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Retrieves the first item in the pasteboard.
|
137
|
+
#
|
138
|
+
# If +flavor+ is given only the given flavor's data is returned. If no
|
139
|
+
# flavor matches nil is returned.
|
140
|
+
#
|
141
|
+
# See #[] for a description of an item.
|
142
|
+
|
143
|
+
def first flavor = nil
|
144
|
+
self[0, flavor]
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# Returns the item with +id+ in the pasteboard.
|
149
|
+
#
|
150
|
+
# If +flavor+ is given only the given flavor's data is returned. If no
|
151
|
+
# flavor matches nil is returned.
|
152
|
+
#
|
153
|
+
# See #[] for a description of an item.
|
154
|
+
|
155
|
+
def get id, flavor = nil
|
156
|
+
item = copy_item_flavors(id).map do |item_flavor|
|
157
|
+
if flavor then
|
158
|
+
return copy_item_flavor_data(id, item_flavor) if item_flavor == flavor
|
159
|
+
next
|
160
|
+
end
|
161
|
+
|
162
|
+
[item_flavor, copy_item_flavor_data(id, item_flavor)]
|
163
|
+
end
|
164
|
+
|
165
|
+
return nil if item.compact.empty?
|
166
|
+
|
167
|
+
item
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# An array of item ids in the pasteboard. You must sync the clipboard to
|
172
|
+
# get the latest ids.
|
173
|
+
|
174
|
+
def ids
|
175
|
+
(1..get_item_count).map do |index|
|
176
|
+
get_item_identifier index
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def inspect # :nodoc:
|
181
|
+
'#<%s:0x%x %s>' % [self.class, object_id, name]
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Clears the pasteboard and adds +items+ to the pasteboard. Each item is
|
186
|
+
# added with a consecutive id starting at 0.
|
187
|
+
#
|
188
|
+
# An item must be an Enumerable with pairs of item flavors and items. For
|
189
|
+
# example:
|
190
|
+
#
|
191
|
+
# item = [
|
192
|
+
# [Pasteboard::Type::TIFF, tiff],
|
193
|
+
# [Pasteboard::Type::URL, url],
|
194
|
+
# [Pasteboard::Type::URL_NAME, url],
|
195
|
+
# [Pasteboard::Type::UTF_8, url],
|
196
|
+
# ]
|
197
|
+
#
|
198
|
+
# pasteboard.put item
|
199
|
+
#
|
200
|
+
# The pasteboard considers flavors added earlier in an item to have a higher
|
201
|
+
# preference.
|
202
|
+
|
203
|
+
def put *items
|
204
|
+
clear
|
205
|
+
flags = sync
|
206
|
+
|
207
|
+
raise Error, 'pasteboard sync error' if (flags & MODIFIED) != 0
|
208
|
+
raise Error, 'pasteboard not owned' if (flags & CLIENT_IS_OWNER) == 0
|
209
|
+
|
210
|
+
items.each_with_index do |item, id|
|
211
|
+
item.each do |flavor, data|
|
212
|
+
put_item_flavor id, flavor, data
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
self
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Adds +url+ to the pasteboard with an optional +url_name+.
|
221
|
+
|
222
|
+
def put_url url, url_name = url
|
223
|
+
item = [
|
224
|
+
[Pasteboard::Type::URL, url],
|
225
|
+
[Pasteboard::Type::URL_NAME, url_name],
|
226
|
+
[Pasteboard::Type::UTF_8, url],
|
227
|
+
]
|
228
|
+
|
229
|
+
put item
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# Adds JPEG data +image+ to the pasteboard with a +url+ and optional
|
234
|
+
# +url_name+.
|
235
|
+
|
236
|
+
def put_jpeg_url image, url, url_name = url
|
237
|
+
item = [
|
238
|
+
[Pasteboard::Type::JPEG, image],
|
239
|
+
[Pasteboard::Type::URL, url],
|
240
|
+
[Pasteboard::Type::URL_NAME, url_name],
|
241
|
+
[Pasteboard::Type::UTF_8, url],
|
242
|
+
]
|
243
|
+
|
244
|
+
put item
|
245
|
+
end
|
246
|
+
|
247
|
+
end
|
248
|
+
|
249
|
+
require 'pasteboard/type'
|
250
|
+
require 'pasteboard/pasteboard'
|
251
|
+
|
@@ -0,0 +1,713 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
##
|
4
|
+
# Documentation here comes from the OS X 10.6 Core Library's Uniform Type
|
5
|
+
# Identifiers Reference.
|
6
|
+
|
7
|
+
module Pasteboard::Type
|
8
|
+
|
9
|
+
encoding = defined?(Encoding)
|
10
|
+
|
11
|
+
if encoding then
|
12
|
+
##
|
13
|
+
# Maps a type to its encoding. The default encoding is Encoding::BINARY.
|
14
|
+
|
15
|
+
Encodings = {}
|
16
|
+
|
17
|
+
Encodings.default = Encoding::BINARY
|
18
|
+
end
|
19
|
+
|
20
|
+
# :section: System-defined uniform type identifiers
|
21
|
+
|
22
|
+
# Base type for the physical hierarchy.
|
23
|
+
|
24
|
+
ITEM = 'public.item'
|
25
|
+
|
26
|
+
# Base type for all document content.
|
27
|
+
|
28
|
+
CONTENT = 'public.content'
|
29
|
+
|
30
|
+
# Base type for mixed content. For example, a PDF file contains both text
|
31
|
+
# and special formatting data.
|
32
|
+
|
33
|
+
COMPOSITE_CONTENT = 'public.composite-content'
|
34
|
+
|
35
|
+
# Base physical type for byte streams (flat files, pasteboard data, and so
|
36
|
+
# on).
|
37
|
+
|
38
|
+
DATA = 'public.data'
|
39
|
+
|
40
|
+
# Base functional type for databases.
|
41
|
+
|
42
|
+
DATABASE = 'public.database'
|
43
|
+
|
44
|
+
# Base functional type for scheduled events.
|
45
|
+
|
46
|
+
CALENDAR_EVENT = 'public.calendar-event'
|
47
|
+
|
48
|
+
# Base type for messages (email, IM, and so on).
|
49
|
+
|
50
|
+
MESSAGE = 'public.message'
|
51
|
+
|
52
|
+
# ,public.composite-content,Base type for presentations.
|
53
|
+
|
54
|
+
PRESENTATION = 'public.presentation'
|
55
|
+
|
56
|
+
# Base type for contact information.
|
57
|
+
|
58
|
+
CONTACT = 'public.contact'
|
59
|
+
|
60
|
+
# Base type for an archive of files and directories.
|
61
|
+
|
62
|
+
ARCHIVE = 'public.archive'
|
63
|
+
|
64
|
+
# Base type for items mountable as a volume.
|
65
|
+
|
66
|
+
DISK_IMAGE = 'public.disk-image'
|
67
|
+
|
68
|
+
# Base type for all text, including text with markup information (HTML, RTF,
|
69
|
+
# and so on).
|
70
|
+
|
71
|
+
TEXT = 'public.text'
|
72
|
+
|
73
|
+
# Text of unspecified encoding, with no markup. Equivalent to the MIME type
|
74
|
+
# text/plain
|
75
|
+
|
76
|
+
PLAIN_TEXT = 'public.plain-text'
|
77
|
+
Encodings[TEXT] = Encoding::US_ASCII if encoding
|
78
|
+
|
79
|
+
# Unicode-8
|
80
|
+
|
81
|
+
PLAIN_TEXT_UTF8 = 'public.utf8-plain-text'
|
82
|
+
UTF_8 = PLAIN_TEXT_UTF8
|
83
|
+
Encodings[PLAIN_TEXT_UTF8] = Encoding::UTF_8 if encoding
|
84
|
+
|
85
|
+
# Unicode-16 with byte-order mark (BOM), or if BOM is not present, an
|
86
|
+
# external representation byte order (big-endian).
|
87
|
+
|
88
|
+
PLAIN_TEXT_UTF16_EXTERNAL = 'public.utf16-external-plain-text'
|
89
|
+
Encodings[PLAIN_TEXT_UTF16_EXTERNAL] = Encoding::UTF_16BE if encoding
|
90
|
+
|
91
|
+
# Unicode-16, native byte order, with an optional byte-order mark (BOM).
|
92
|
+
|
93
|
+
PLAIN_TEXT_UTF16 = 'public.utf16-plain-text'
|
94
|
+
Encodings[PLAIN_TEXT_UTF16] = Pasteboard::NATIVE_ENCODING if encoding
|
95
|
+
|
96
|
+
# Classic Mac OS text.
|
97
|
+
|
98
|
+
PLAIN_TEXT_TRADITIONAL = 'com.apple.traditional-mac-plain-text'
|
99
|
+
Encodings[PLAIN_TEXT_TRADITIONAL] = Encoding::MacRoman if encoding
|
100
|
+
|
101
|
+
# Rich Text.
|
102
|
+
|
103
|
+
RTF = 'public.rtf'
|
104
|
+
|
105
|
+
# Opaque InkText data.
|
106
|
+
|
107
|
+
INKTEXT = 'com.apple.ink.inktext'
|
108
|
+
|
109
|
+
# HTML text.
|
110
|
+
|
111
|
+
HTML = 'public.html'
|
112
|
+
|
113
|
+
# XML text.
|
114
|
+
|
115
|
+
XML = 'public.xml'
|
116
|
+
|
117
|
+
# Generic source code.
|
118
|
+
|
119
|
+
SOURCE_CODE = 'public.source-code'
|
120
|
+
|
121
|
+
# C source code.
|
122
|
+
|
123
|
+
C_SOURCE = 'public.c-source'
|
124
|
+
|
125
|
+
# Objective-C source code.
|
126
|
+
|
127
|
+
OBJC_SOURCE = 'public.objective-c-source'
|
128
|
+
|
129
|
+
# C++ source code.
|
130
|
+
|
131
|
+
C_PLUS_PLUS_SOURCE = 'public.c-plus-plus-source'
|
132
|
+
CXX_SOURCE = C_PLUS_PLUS_SOURCE
|
133
|
+
|
134
|
+
# Objective-C++ source code.
|
135
|
+
|
136
|
+
OBJC_PLUS_PLUS_SOURCE = 'public.objective-c-plus-plus-source'
|
137
|
+
OBJCXX_SOURCE = OBJC_PLUS_PLUS_SOURCE
|
138
|
+
|
139
|
+
# C header file.
|
140
|
+
|
141
|
+
C_HEADER = 'public.c-header'
|
142
|
+
|
143
|
+
# C++ header file.
|
144
|
+
|
145
|
+
C_PLUS_PLUS_HEADER = 'public.c-plus-plus-header'
|
146
|
+
CXX_HEADER = C_PLUS_PLUS_HEADER
|
147
|
+
|
148
|
+
# Java source code
|
149
|
+
|
150
|
+
JAVA_SOURCE = 'com.sun.java-source'
|
151
|
+
|
152
|
+
# Base type for scripting language source code.
|
153
|
+
|
154
|
+
SCRIPT = 'public.script'
|
155
|
+
|
156
|
+
# Assembly language source code.
|
157
|
+
|
158
|
+
ASSEMBLY_SOURCE = 'public.assembly-source'
|
159
|
+
|
160
|
+
# Rez source code.
|
161
|
+
|
162
|
+
REZ_SOURCE = 'com.apple.rez-source'
|
163
|
+
|
164
|
+
# Mig definition source code.
|
165
|
+
|
166
|
+
MIG_SOURCE = 'public.mig-source'
|
167
|
+
|
168
|
+
# Symbol export list.
|
169
|
+
|
170
|
+
SYMBOL_EXPORT_LIST = 'com.apple.symbol-export'
|
171
|
+
|
172
|
+
# JavaScript.
|
173
|
+
|
174
|
+
JAVASCRIPT_SOURCE = 'com.netscape.javascript-source'
|
175
|
+
|
176
|
+
# Shell script.
|
177
|
+
|
178
|
+
SHELL_SCRIPT = 'public.shell-script'
|
179
|
+
|
180
|
+
# C-shell script.
|
181
|
+
|
182
|
+
CSH_SCRIPT = 'public.csh-script'
|
183
|
+
|
184
|
+
# Perl script.
|
185
|
+
|
186
|
+
PERL_SCRIPT = 'public.perl-script'
|
187
|
+
|
188
|
+
# Python script.
|
189
|
+
|
190
|
+
PYTHON_SCRIPT = 'public.python-script'
|
191
|
+
|
192
|
+
# Ruby script.
|
193
|
+
|
194
|
+
RUBY_SCRIPT = 'public.ruby-script'
|
195
|
+
|
196
|
+
# PHP script.
|
197
|
+
|
198
|
+
PHP_SCRIPT = 'public.php-script'
|
199
|
+
|
200
|
+
# Java web start.
|
201
|
+
|
202
|
+
JAVA_WEB_START = 'com.sun.java-web-start'
|
203
|
+
|
204
|
+
# AppleScript text.
|
205
|
+
|
206
|
+
APPLESCRIPT_TEXT = 'com.apple.applescript.text'
|
207
|
+
|
208
|
+
# AppleScript.
|
209
|
+
|
210
|
+
APPLESCRIPT_SCRIPT = 'com.apple.applescript.script'
|
211
|
+
|
212
|
+
# Object code.
|
213
|
+
|
214
|
+
OBJECT_CODE = 'public.object-code'
|
215
|
+
|
216
|
+
# Mach-O binary.
|
217
|
+
|
218
|
+
MACH_O_BINARY = 'com.apple.mach-o-binary'
|
219
|
+
|
220
|
+
# PEF (CFM-based) binary
|
221
|
+
|
222
|
+
PEF_BINARY = 'com.apple.pef-binary'
|
223
|
+
|
224
|
+
# Microsoft Windows application.
|
225
|
+
|
226
|
+
WINDOWS_EXECUTABLE = 'com.microsoft.windows-executable'
|
227
|
+
|
228
|
+
# Microsoft dynamic link library.
|
229
|
+
|
230
|
+
WINDOWS_DLL = 'com.microsoft.windows-dynamic-link-library'
|
231
|
+
|
232
|
+
# Java class.
|
233
|
+
|
234
|
+
JAVA_CLASS = 'com.sun.java-class'
|
235
|
+
|
236
|
+
# Java archive.
|
237
|
+
|
238
|
+
JAVA_ARCHIVE = 'com.sun.java-archive'
|
239
|
+
|
240
|
+
# Quartz Composer composition.
|
241
|
+
|
242
|
+
QUARTZ_COMPOSER_COMPOSITION = 'com.apple.quartz-composer-composition'
|
243
|
+
|
244
|
+
# GNU archive.
|
245
|
+
|
246
|
+
GNU_TAR_ARCHIVE = 'org.gnu.gnu-tar-archive'
|
247
|
+
|
248
|
+
# Tar archive.
|
249
|
+
|
250
|
+
TAR_ARCHIVE = 'public.tar-archive'
|
251
|
+
|
252
|
+
# Gzip archive.
|
253
|
+
|
254
|
+
GUN_ZIP_ARCHIVE = 'org.gnu.gnu-zip-archive'
|
255
|
+
|
256
|
+
# Gzip tar archive.
|
257
|
+
|
258
|
+
GNU_ZIP_TAR_ARCHIVE = 'org.gnu.gnu-zip-tar-archive'
|
259
|
+
|
260
|
+
# BinHex archive.
|
261
|
+
|
262
|
+
BINHEX_ARCHIVE = 'com.apple.binhex-archive'
|
263
|
+
|
264
|
+
# MacBinary archive.
|
265
|
+
|
266
|
+
MACBINARY_ARCHIVE = 'com.apple.macbinary-archive'
|
267
|
+
|
268
|
+
# Uniform Resource Locator.
|
269
|
+
|
270
|
+
URL = 'public.url'
|
271
|
+
Encodings[URL] = Encoding::US_ASCII if encoding
|
272
|
+
|
273
|
+
# File URL.
|
274
|
+
|
275
|
+
FILE_URL = 'public.file-url'
|
276
|
+
Encodings[FILE_URL] = Encoding::US_ASCII if encoding
|
277
|
+
|
278
|
+
# URL name.
|
279
|
+
|
280
|
+
URL_NAME = 'public.url-name'
|
281
|
+
Encodings[URL_NAME] = Encoding::UTF_8 if encoding
|
282
|
+
|
283
|
+
# vCard (electronic business card).
|
284
|
+
|
285
|
+
VCARD = 'public.vcard'
|
286
|
+
|
287
|
+
# Base type for images.
|
288
|
+
|
289
|
+
IMAGE = 'public.image'
|
290
|
+
|
291
|
+
# Base type for fax images.
|
292
|
+
|
293
|
+
FAX = 'public.fax'
|
294
|
+
|
295
|
+
# JPEG image.
|
296
|
+
|
297
|
+
JPEG = 'public.jpeg'
|
298
|
+
|
299
|
+
# JPEG 2000 image.
|
300
|
+
|
301
|
+
JPEG_2000 = 'public.jpeg-2000'
|
302
|
+
|
303
|
+
# TIFF image.
|
304
|
+
|
305
|
+
TIFF = 'public.tiff'
|
306
|
+
|
307
|
+
# Base type for digital camera raw image formats.
|
308
|
+
|
309
|
+
CAMERA_RAW_IMAGE = 'public.camera-raw-image'
|
310
|
+
|
311
|
+
# PICT image
|
312
|
+
|
313
|
+
PICT = 'com.apple.pict'
|
314
|
+
|
315
|
+
# MacPaint image.
|
316
|
+
|
317
|
+
MACPAINT = 'com.apple.macpaint-image'
|
318
|
+
|
319
|
+
# PNG image
|
320
|
+
|
321
|
+
PNG = 'public.png'
|
322
|
+
|
323
|
+
# X bitmap image.
|
324
|
+
|
325
|
+
XBITMAP = 'public.xbitmap-image'
|
326
|
+
|
327
|
+
# QuickTime image.
|
328
|
+
|
329
|
+
QUICKTIME_IMAGE = 'com.apple.quicktime-image'
|
330
|
+
|
331
|
+
# Mac OS icon image.
|
332
|
+
|
333
|
+
ICNS = 'com.apple.icns'
|
334
|
+
|
335
|
+
# MLTE (Textension) format for mixed text and multimedia data.
|
336
|
+
|
337
|
+
TEXT_MULTIMEDIA_DATA = 'com.apple.txn.text-multimedia-data'
|
338
|
+
|
339
|
+
# Base type for any audiovisual content.
|
340
|
+
|
341
|
+
AUDIOVISUAL_CONTENT = 'public.audiovisual-content'
|
342
|
+
AV_CONTENT = AUDIOVISUAL_CONTENT
|
343
|
+
|
344
|
+
# Base type for movies (video with optional audio or other tracks).
|
345
|
+
|
346
|
+
MOVIE = 'public.movie'
|
347
|
+
|
348
|
+
# Base type for video (no audio).
|
349
|
+
|
350
|
+
VIDEO = 'public.video'
|
351
|
+
|
352
|
+
# QuickTime movie.
|
353
|
+
|
354
|
+
QUICKTIME_MOVIE = 'com.apple.quicktime-movie'
|
355
|
+
|
356
|
+
# AVI movie.
|
357
|
+
|
358
|
+
AVI = 'public.avi'
|
359
|
+
|
360
|
+
# MPEG-1 or MPEG-2 content.
|
361
|
+
|
362
|
+
MPEG = 'public.mpeg'
|
363
|
+
|
364
|
+
# MPEG-4 content.
|
365
|
+
|
366
|
+
MPEG4 = 'public.mpeg-4'
|
367
|
+
|
368
|
+
# 3GPP movie.
|
369
|
+
|
370
|
+
MOVIE_3GPP = 'public.3gpp'
|
371
|
+
|
372
|
+
# 3GPP2 movie.
|
373
|
+
|
374
|
+
MOVIE_3GPP2 = 'public.3gpp2'
|
375
|
+
|
376
|
+
# Base type for audio (no video).
|
377
|
+
|
378
|
+
AUDIO = 'public.audio'
|
379
|
+
|
380
|
+
# MPEG-3 audio.
|
381
|
+
|
382
|
+
MP3 = 'public.mp3'
|
383
|
+
|
384
|
+
# MPEG-4 audio.
|
385
|
+
|
386
|
+
MPEG4_AUDIO = 'public.mpeg-4-audio'
|
387
|
+
|
388
|
+
# Protected MPEG-4 audio. (iTunes music store format)
|
389
|
+
|
390
|
+
MPEG4_AUDIO_PROTECTED = 'com.apple.protected-mpeg-4-audio'
|
391
|
+
|
392
|
+
# μLaw audio.
|
393
|
+
|
394
|
+
ULAW = 'public.ulaw-audio'
|
395
|
+
|
396
|
+
# AIFF-C audio.
|
397
|
+
|
398
|
+
AIFC = 'public.aifc-audio'
|
399
|
+
|
400
|
+
# AIFF audio.
|
401
|
+
|
402
|
+
AIFF = 'public.aiff-audio'
|
403
|
+
|
404
|
+
# Core Audio format.
|
405
|
+
|
406
|
+
COREAUDIO = 'com.apple.coreaudio-format'
|
407
|
+
|
408
|
+
# Base type for directories.
|
409
|
+
|
410
|
+
DIRECTORY = 'public.directory'
|
411
|
+
|
412
|
+
# A plain folder (that is, not a package).
|
413
|
+
|
414
|
+
FOLDER = 'public.folder'
|
415
|
+
|
416
|
+
# A volume.
|
417
|
+
|
418
|
+
VOLUME = 'public.volume'
|
419
|
+
|
420
|
+
# A package (that is, a directory presented to the user as a file).
|
421
|
+
|
422
|
+
PACKAGE = 'com.apple.package'
|
423
|
+
|
424
|
+
# A directory with an internal structure specified by Core Foundation Bundle
|
425
|
+
# Services. .
|
426
|
+
|
427
|
+
BUNDLE = 'com.apple.bundle'
|
428
|
+
|
429
|
+
# Base type for executable data.
|
430
|
+
|
431
|
+
EXECUTABLE = 'public.executable'
|
432
|
+
|
433
|
+
# Base type for applications and other launchable files.
|
434
|
+
|
435
|
+
APPLICATION = 'com.apple.application'
|
436
|
+
|
437
|
+
# Application bundle.
|
438
|
+
|
439
|
+
APPLICATION_BUNDLE = 'com.apple.application-bundle'
|
440
|
+
|
441
|
+
# Application file.
|
442
|
+
|
443
|
+
APPLICATION_FILE = 'com.apple.application-file'
|
444
|
+
|
445
|
+
# Deprecated application file.
|
446
|
+
|
447
|
+
APPLICATION_FILE_DEPRECATED = 'com.apple.deprecated-application-file'
|
448
|
+
|
449
|
+
# Plugin.
|
450
|
+
|
451
|
+
PLUGIN = 'com.apple.plugin'
|
452
|
+
|
453
|
+
# Spotlight importer plugin.
|
454
|
+
|
455
|
+
METADATA_IMPORTER = 'com.apple.metadata-importer'
|
456
|
+
|
457
|
+
# Dashboard widget.
|
458
|
+
|
459
|
+
DASHBOARD_WIDGET = 'com.apple.dashboard-widget'
|
460
|
+
|
461
|
+
# CPIO archive.
|
462
|
+
|
463
|
+
CPIO_ARCHIVE = 'public.cpio-archive'
|
464
|
+
|
465
|
+
# Zip archive.
|
466
|
+
|
467
|
+
ZIP_ARCHIVE = 'com.pkware.zip-archive'
|
468
|
+
|
469
|
+
# Web Kit webarchive format.
|
470
|
+
|
471
|
+
WEBARCHIVE = 'com.apple.webarchive'
|
472
|
+
|
473
|
+
# Framework.
|
474
|
+
|
475
|
+
FRAMEWORK = 'com.apple.framework'
|
476
|
+
|
477
|
+
# Rich Text Format Directory. That is, Rich Text with content embedding,
|
478
|
+
# on-disk format.
|
479
|
+
|
480
|
+
RTFD = 'com.apple.rtfd'
|
481
|
+
|
482
|
+
# Rich Text with content embedding, pasteboard format.
|
483
|
+
|
484
|
+
RTFD_FLAT = 'com.apple.flat-rtfd'
|
485
|
+
|
486
|
+
# Items that the Alias Manager can resolve.
|
487
|
+
|
488
|
+
RESOLVEABLE = 'com.apple.resolvable'
|
489
|
+
|
490
|
+
# UNIX-style symlink.
|
491
|
+
|
492
|
+
SYMLINK = 'public.symlink'
|
493
|
+
|
494
|
+
# A volume mount point
|
495
|
+
|
496
|
+
MOUNT_POINT = 'com.apple.mount-point'
|
497
|
+
|
498
|
+
# Alias record.
|
499
|
+
|
500
|
+
ALIAS_RECORD = 'com.apple.alias-record'
|
501
|
+
|
502
|
+
# Alias file.
|
503
|
+
|
504
|
+
ALIAS_FILE = 'com.apple.alias-file'
|
505
|
+
|
506
|
+
# Base type for fonts.
|
507
|
+
|
508
|
+
FONT = 'public.font'
|
509
|
+
|
510
|
+
# TrueType font.
|
511
|
+
|
512
|
+
TRUETYPE_FONT = 'public.truetype-font'
|
513
|
+
|
514
|
+
# PostScript font.
|
515
|
+
|
516
|
+
POSTSCRIPT_FONT = 'com.adobe.postscript-font'
|
517
|
+
|
518
|
+
# TrueType data fork font.
|
519
|
+
|
520
|
+
TRUETYPE_DATA_FORK_FONT = 'com.apple.truetype-datafork-suitcase-font'
|
521
|
+
|
522
|
+
# PostScript OpenType font.
|
523
|
+
|
524
|
+
OPENTYPE_FONT = 'public.opentype-font'
|
525
|
+
|
526
|
+
# TrueType OpenType font.
|
527
|
+
|
528
|
+
TRUETYPE_TTF_FONT = 'public.truetype-ttf-font'
|
529
|
+
|
530
|
+
# TrueType collection font.
|
531
|
+
|
532
|
+
TRUETYPE_COLLECTION_FONT = 'public.truetype-collection-font'
|
533
|
+
|
534
|
+
# Font suitcase.
|
535
|
+
|
536
|
+
FONT_SUITCASE = 'com.apple.font-suitcase'
|
537
|
+
|
538
|
+
# PostScript Type 1 outline font.
|
539
|
+
|
540
|
+
POSTSCRIPT_LWFN_FONT = 'com.adobe.postscript-lwfn-font'
|
541
|
+
|
542
|
+
# PostScriptType1 outline font.
|
543
|
+
|
544
|
+
POSTSCRIPT_PFB_FONT = 'com.adobe.postscript-pfb-font'
|
545
|
+
|
546
|
+
# PostScriptType 1 outline font.
|
547
|
+
|
548
|
+
POSTSCRIPT_PFA_FONT = 'com.adobe.postscript.pfa-font'
|
549
|
+
|
550
|
+
# ColorSync profile.
|
551
|
+
|
552
|
+
COLORSYNC_PROFILE = 'com.apple.colorsync-profile'
|
553
|
+
|
554
|
+
# :section: Uniform type identifiers for alternate tags
|
555
|
+
|
556
|
+
# Filename extension.
|
557
|
+
|
558
|
+
FILENAME_EXTENSION = 'public.filename-extension'
|
559
|
+
|
560
|
+
# MIME type.
|
561
|
+
|
562
|
+
MIME_TYPE = 'public.mime-type'
|
563
|
+
|
564
|
+
# Four-character code (type OSType).
|
565
|
+
|
566
|
+
OS_TYPE = 'com.apple.ostype'
|
567
|
+
|
568
|
+
# NSPasteboard type.
|
569
|
+
|
570
|
+
PASTEBOARD_TYPE = 'com.apple.nspboard-type'
|
571
|
+
|
572
|
+
# :section: Imported uniform type identifiers
|
573
|
+
|
574
|
+
# PDF data.
|
575
|
+
|
576
|
+
PDF = "com.adobe.pdf (kUTTypePDF)"
|
577
|
+
|
578
|
+
# PostScript data.
|
579
|
+
|
580
|
+
POSTSCRIPT = "com.adobe.postscript"
|
581
|
+
|
582
|
+
# Encapsulated PostScript.
|
583
|
+
|
584
|
+
ENCAPSULATED_POSTSCRIPT = "com.adobe.encapsulated-postscript"
|
585
|
+
|
586
|
+
# Adobe Photoshop document.
|
587
|
+
|
588
|
+
PHOTOSHOP_IMAGE = "com.adobe.photoshop-image"
|
589
|
+
|
590
|
+
# Adobe Illustrator document.
|
591
|
+
|
592
|
+
ILLUSTRATOR_IMAGE = "com.adobe.illustrator.ai-image"
|
593
|
+
|
594
|
+
# GIF image.
|
595
|
+
|
596
|
+
GIF = "com.compuserve.gif (kUTTypeGIF)"
|
597
|
+
|
598
|
+
# Windows bitmap image.
|
599
|
+
|
600
|
+
WINDOWS_BITMAP = "com.microsoft.bmp (kUTTypeBMP)"
|
601
|
+
|
602
|
+
# Windows icon image.
|
603
|
+
|
604
|
+
WINDOWS_ICON = "com.microsoft.ico (kUTTypeICO)"
|
605
|
+
|
606
|
+
# Microsoft Word data.
|
607
|
+
|
608
|
+
WORD_DOCUMENT = "com.microsoft.word.doc"
|
609
|
+
|
610
|
+
# Microsoft Excel data.
|
611
|
+
|
612
|
+
EXCEL_SPREADSHEET = "com.microsoft.excel.xls"
|
613
|
+
|
614
|
+
# Microsoft PowerPoint presentation.
|
615
|
+
|
616
|
+
POWERPOINT_PRESENTATION = "com.microsoft.powerpoint.ppt"
|
617
|
+
|
618
|
+
# Waveform audio.
|
619
|
+
|
620
|
+
MICROSOFT_WAV = "com.microsoft.waveform-audio"
|
621
|
+
|
622
|
+
# Microsoft Advanced Systems format.
|
623
|
+
|
624
|
+
MICROSOFT_ADVANCED_SYSTEMS_FORMAT = "com.microsoft.advanced-systems-format"
|
625
|
+
|
626
|
+
# Windows media.
|
627
|
+
|
628
|
+
WINDOWS_MEDIA_WM = "com.microsoft.windows-media-wm"
|
629
|
+
|
630
|
+
# Windows media.
|
631
|
+
|
632
|
+
WINDOWS_MEDIA_WMV = "com.microsoft.windows-media-wmv"
|
633
|
+
|
634
|
+
# Windows media.
|
635
|
+
|
636
|
+
WINDOWS_MEDIA_WMP = "com.microsoft.windows-media-wmp"
|
637
|
+
|
638
|
+
# Windows media audio.
|
639
|
+
|
640
|
+
WINDOWS_MEDIA_WMA = "com.microsoft.windows-media-wma"
|
641
|
+
|
642
|
+
# Advanced Stream Redirector.
|
643
|
+
|
644
|
+
MICROSOFT_ADVANCED_STREAM_REDIRECTOR =
|
645
|
+
"com.microsoft.advanced-stream-redirector"
|
646
|
+
|
647
|
+
# Windows media.
|
648
|
+
|
649
|
+
WINDOWS_MEDIA_WMX = "com.microsoft.windows-media-wmx"
|
650
|
+
|
651
|
+
# Windows media.
|
652
|
+
|
653
|
+
WINDOWS_MEDIA_WVX = "com.microsoft.windows-media-wvx"
|
654
|
+
|
655
|
+
# Windows media audio.
|
656
|
+
|
657
|
+
WINDOWS_MEDIA_WAX = "com.microsoft.windows-media-wax"
|
658
|
+
|
659
|
+
# Apple Keynote document.
|
660
|
+
|
661
|
+
KEYNOTE_DOCUMENT = "com.apple.keynote.key"
|
662
|
+
|
663
|
+
# Apple Keynote theme.
|
664
|
+
|
665
|
+
KEYNOTE_THEME = "com.apple.keynote.kth"
|
666
|
+
|
667
|
+
# TGA image.
|
668
|
+
|
669
|
+
TGA_IMAGE = "com.truevision.tga-image"
|
670
|
+
|
671
|
+
# Silicon Graphics image.
|
672
|
+
|
673
|
+
SGI_IMAGE = "com.sgi.sgi-image"
|
674
|
+
|
675
|
+
# OpenEXR image.
|
676
|
+
|
677
|
+
OPENEXR_IMAGE = "com.ilm.openexr-image"
|
678
|
+
|
679
|
+
# FlashPix image.
|
680
|
+
|
681
|
+
FLASHPIX_IMAGE = "com.kodak.flashpix.image"
|
682
|
+
|
683
|
+
# J2 fax.
|
684
|
+
|
685
|
+
J2_FAX = "com.j2.jfx-fax"
|
686
|
+
|
687
|
+
# eFax fax.
|
688
|
+
|
689
|
+
EFAX_FAX = "com.js.efx-fax"
|
690
|
+
|
691
|
+
# Digidesign Sound Designer II audio.
|
692
|
+
|
693
|
+
SOUND_DESIGNER_II_AUDIO = "com.digidesign.sd2-audio"
|
694
|
+
SOUND_DESIGNER_2_AUDIO = SOUND_DESIGNER_II_AUDIO
|
695
|
+
|
696
|
+
# RealMedia.
|
697
|
+
|
698
|
+
REAL_MEDIA = "com.real.realmedia"
|
699
|
+
|
700
|
+
# RealMedia audio.
|
701
|
+
|
702
|
+
REAL_AUDIO = "com.real.realaudio"
|
703
|
+
|
704
|
+
# Real synchronized multimedia integration language.
|
705
|
+
|
706
|
+
REAL_SMIL = "com.real.smil"
|
707
|
+
|
708
|
+
# Stuffit archive.
|
709
|
+
|
710
|
+
STUFFIT_ARCHIVE = "com.allume.stuffit-archive"
|
711
|
+
|
712
|
+
end
|
713
|
+
|