author | Claus Gittinger <cg@exept.de> |
Tue, 18 Mar 2014 16:14:17 +0100 | |
changeset 3314 | 552383bb5952 |
parent 3295 | c430566c334c |
child 3322 | 78576b7fa8c5 |
permissions | -rw-r--r-- |
643 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
1612 | 3 |
All Rights Reserved |
643 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1410 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
643 | 14 |
Object subclass:#MIMETypes |
1612 | 15 |
instanceVariableNames:'' |
1729 | 16 |
classVariableNames:'TypeToImageReaderClassMapping TypeToCommentStringMapping |
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
17 |
TypeToFileSuffixMapping TypeToViewerApplicationMapping |
1729 | 18 |
SuffixToCommentStringMapping FileSuffixToTypeMapping |
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
19 |
FilenameToTypeMapping FileSuffixToImageReaderClassMapping |
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
20 |
CharSetToFontMapping LastSuffix LastType |
2298 | 21 |
DefaultCommandPerMIMEPerOS DefaultPrintCommandPerMIMEPerOS |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
22 |
TypeToParenthesisSpecMapping SuffixToParenthesisSpecMapping' |
1612 | 23 |
poolDictionaries:'' |
1800 | 24 |
category:'Net-Communication-Support' |
1612 | 25 |
! |
26 |
||
27 |
String variableByteSubclass:#MIMEType |
|
28 |
instanceVariableNames:'' |
|
29 |
classVariableNames:'CachedTypes' |
|
30 |
poolDictionaries:'' |
|
31 |
privateIn:MIMETypes |
|
643 | 32 |
! |
33 |
||
34 |
!MIMETypes class methodsFor:'documentation'! |
|
35 |
||
36 |
copyright |
|
37 |
" |
|
38 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
1612 | 39 |
All Rights Reserved |
643 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
48 |
||
49 |
" |
|
50 |
! |
|
51 |
||
52 |
documentation |
|
53 |
" |
|
54 |
just a place to keep MIME information |
|
55 |
(avoid spreading things at many places) |
|
56 |
||
1021 | 57 |
MIMETypes is abstract and functional. |
58 |
Actually, in some OperatingSystems, this information may |
|
59 |
be found in some config files (or registries). |
|
60 |
Therefore, this class may have to be extended to support this |
|
61 |
and fetch the information from there eventually. |
|
62 |
||
643 | 63 |
[author:] |
64 |
Claus Gittinger |
|
65 |
" |
|
1311 | 66 |
! |
67 |
||
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
68 |
examples |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
69 |
" |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
70 |
[exBegin] |
3210 | 71 |
MIMETypes mimeTypeFromString:'text/plain' |
72 |
[exEnd] |
|
73 |
[exBegin] |
|
2487
eaa224da42fa
mimeType: x-expecco-testsuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2486
diff
changeset
|
74 |
MIMETypes mimeTypeFromString:'application/x-expecco-testsuite' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
75 |
[exEnd] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
76 |
|
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
77 |
[exBegin] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
78 |
MIMETypes mimeTypeForSuffix:'gif' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
79 |
MIMETypes mimeTypeForSuffix:'ets' |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
80 |
MIMETypes mimeTypeForSuffix:'xlsx' |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
81 |
[exEnd] |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
82 |
" |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
83 |
! |
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
84 |
|
1311 | 85 |
knownTypes |
86 |
" |
|
87 |
simply a reminder for me ... |
|
88 |
||
89 |
application mime file extentsions |
|
90 |
||
91 |
powerpoint application/ms-powerpoint .pot, .ppz, .ppt, .pps, |
|
92 |
application/mspowerpoint |
|
93 |
application/vnd.ms-powerpoint |
|
94 |
application/x-mspowerpoint |
|
95 |
||
1312 | 96 |
shockwave application/x-shockwave-flash .swf |
1311 | 97 |
|
1312 | 98 |
futuresplash application/futuresplash .spl |
1311 | 99 |
" |
643 | 100 |
! ! |
101 |
||
102 |
!MIMETypes class methodsFor:'initialization'! |
|
103 |
||
1729 | 104 |
initialize |
105 |
"initialize wellKnown facts" |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
106 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
107 |
MIMEType initialize. "must be initialized first" |
1729 | 108 |
LastSuffix := LastType := nil. |
109 |
self initializeFileNameToMimeTypeMapping. |
|
110 |
self initializeImageReaderMappings. |
|
111 |
self initializeCommentStringMappings. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
112 |
self initializeParenthesisSpecMappings. |
1729 | 113 |
|
114 |
" |
|
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
115 |
self initialize |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
116 |
" |
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
117 |
|
2298 | 118 |
"Modified: / 10-04-2007 / 15:16:44 / cg" |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
119 |
"Modified (comment): / 29-11-2011 / 19:11:51 / cg" |
1729 | 120 |
! |
121 |
||
122 |
initializeCommentStringMappings |
|
123 |
TypeToCommentStringMapping := Dictionary new. |
|
124 |
SuffixToCommentStringMapping := Dictionary new. |
|
125 |
||
126 |
TypeToCommentStringMapping |
|
127 |
at:'application/x-make' |
|
128 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
129 |
||
130 |
TypeToCommentStringMapping |
|
131 |
at:'application/x-sh' |
|
132 |
put:#('#' (nil nil)). "/ '#' for EOL comments only |
|
133 |
||
2489
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
134 |
#('text/html' 'text/xml' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
135 |
'application/xml' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
136 |
'application/x-expecco-testsuite' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
137 |
'application/x-expecco-logfile' |
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
138 |
) |
1729 | 139 |
do:[:eachXMLType | |
140 |
TypeToCommentStringMapping |
|
141 |
at:eachXMLType |
|
142 |
put:#(nil ('<!!-- ' ' -->')). "/ '<!!-- ... -->' delimited comments only |
|
143 |
]. |
|
144 |
||
145 |
TypeToCommentStringMapping |
|
2055 | 146 |
at:'text/css' |
147 |
put:#('//' ('/*' '*/')). |
|
148 |
||
149 |
TypeToCommentStringMapping |
|
1729 | 150 |
at:'application/x-batch-script' |
2937
67ef44218dc0
changed: #initializeCommentStringMappings
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
151 |
put:#('@REM ' '@rem ' 'REM ' 'rem ' (nil nil)). "/ 'rem ' for EOL comments only |
1729 | 152 |
|
153 |
"/ the following is ST/X specific |
|
154 |
TypeToCommentStringMapping |
|
155 |
at:'application/x-smalltalk-source' |
|
156 |
put:#('"/' ('"' '"')). "/ '"/ ' for EOL; ".." for delimited comments |
|
157 |
||
2055 | 158 |
|
1729 | 159 |
"/ this is for standard smalltalk |
160 |
"/ TypeToCommentStringMapping |
|
161 |
"/ at:'application/x-smalltalk-source' |
|
162 |
"/ put:#(nil ('"' '"')). "/ ".." for delimited comments only |
|
163 |
||
164 |
||
165 |
TypeToCommentStringMapping |
|
166 |
at:'application/x-pascal-source' |
|
167 |
put:#(nil ('{' '}')). "/ '{'..'}' for delimited comments |
|
168 |
||
2055 | 169 |
|
2048
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
170 |
"/ "/ the following is k&r |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
171 |
"/ TypeToCommentStringMapping |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
172 |
"/ at:'application/x-c-source' |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
173 |
"/ put:#(nil ('/*' '*/')). "/ '/*'..'*/' for delimited comments |
1729 | 174 |
"/ this is ANSI-c |
175 |
TypeToCommentStringMapping |
|
176 |
at:'application/x-c-source' |
|
177 |
put:#('//' ('/*' '*/')). |
|
178 |
||
179 |
TypeToCommentStringMapping |
|
180 |
at:'application/x-cpp-source' |
|
181 |
put:#('//' ('/*' '*/')). |
|
182 |
||
183 |
TypeToCommentStringMapping |
|
2479 | 184 |
at:'application/x-csharp-source' |
185 |
put:#('//' ('/*' '*/')). |
|
186 |
||
187 |
TypeToCommentStringMapping |
|
1729 | 188 |
at:'application/x-java-source' |
189 |
put:#('//' ('/*' '*/')). |
|
190 |
||
191 |
TypeToCommentStringMapping |
|
2048
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
192 |
at:'application/x-javascript' |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
193 |
put:#('//' ('/*' '*/')). |
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
194 |
|
dbb361dd9c5f
comment strings for javascript files
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
195 |
TypeToCommentStringMapping |
2298 | 196 |
at:'application/x-lisp-source' |
197 |
put:#(';' (nil nil)). "/ '#' for EOL comments only |
|
198 |
||
199 |
TypeToCommentStringMapping |
|
1729 | 200 |
at:'application/x-asn1-source' |
201 |
put:#('--' ('--' '--')). |
|
202 |
||
203 |
||
204 |
"/ st/x support files |
|
205 |
SuffixToCommentStringMapping |
|
206 |
at:'style' |
|
207 |
put:#(';' (nil nil)). |
|
1604 | 208 |
|
1729 | 209 |
SuffixToCommentStringMapping |
210 |
at:'rs' |
|
2298 | 211 |
put:#(';' (nil nil)). |
212 |
||
2937
67ef44218dc0
changed: #initializeCommentStringMappings
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
213 |
"Modified: / 06-09-2011 / 10:46:27 / cg" |
1729 | 214 |
! |
215 |
||
216 |
initializeDefaultCommands |
|
217 |
"TODO: move this to OS" |
|
218 |
||
3253 | 219 |
|unixCommands win32Commands unixPrintCommands win32PrintCommands listToTry| |
1729 | 220 |
|
221 |
DefaultCommandPerMIMEPerOS := Dictionary new. |
|
222 |
DefaultCommandPerMIMEPerOS at:#unix put:(unixCommands := Dictionary new). |
|
223 |
DefaultCommandPerMIMEPerOS at:#win32 put:(win32Commands := Dictionary new). |
|
224 |
||
3187 | 225 |
unixCommands at:'application/x-tar-compressed' put:'tar tvf -'. |
1729 | 226 |
|
2141 | 227 |
OperatingSystem isMSWINDOWSlike ifFalse:[ |cmd| |
3253 | 228 |
OperatingSystem isOSXlike ifTrue:[ |
229 |
listToTry := #( '/Applications/Safari.app/Contents/MacOS/Safari' ) |
|
230 |
] ifFalse:[ |
|
231 |
listToTry := #('firefox' 'chrome' 'chromium' 'konqueror' 'opera') |
|
232 |
]. |
|
233 |
cmd := listToTry |
|
234 |
detect:[:aCmd| (OperatingSystem pathOfCommand:aCmd) notEmptyOrNil ] |
|
235 |
ifNone:nil. |
|
2141 | 236 |
|
237 |
cmd notNil ifTrue:[ |
|
2142 | 238 |
unixCommands at:'text/html' put:(cmd, ' "%1"') |
2141 | 239 |
]. |
3187 | 240 |
|
3253 | 241 |
OperatingSystem isOSXlike ifTrue:[ |
242 |
listToTry := #( '/Applications/Preview.app/Contents/MacOS/Preview' ) |
|
243 |
] ifFalse:[ |
|
244 |
listToTry := #('acroread' 'okular' 'evince' 'kpdf' 'xpdf') |
|
245 |
]. |
|
246 |
cmd := listToTry |
|
247 |
detect:[:aCmd| (OperatingSystem pathOfCommand:aCmd) notEmptyOrNil ] |
|
248 |
ifNone:nil. |
|
3187 | 249 |
|
250 |
cmd notNil ifTrue:[ |
|
251 |
unixCommands at:'application/pdf' put:(cmd, ' "%1"') |
|
252 |
]. |
|
2141 | 253 |
]. |
254 |
||
255 |
||
2116 | 256 |
DefaultPrintCommandPerMIMEPerOS := Dictionary new. |
257 |
DefaultPrintCommandPerMIMEPerOS at:#unix put:(unixPrintCommands := Dictionary new). |
|
258 |
DefaultPrintCommandPerMIMEPerOS at:#win32 put:(win32PrintCommands := Dictionary new). |
|
259 |
||
260 |
"/ if you have a good (intelligent) spooler ;-) |
|
2904
bb555534881e
changed: #initializeDefaultCommands
Stefan Vogel <sv@exept.de>
parents:
2892
diff
changeset
|
261 |
unixPrintCommands at:'application/pdf' put:'lpr "%1"'. |
2116 | 262 |
"/ if not, you may need more... |
263 |
"/ unixPrintCommands at:'application/pdf' put:'pdfToPS %1 | lpr'. |
|
264 |
||
1729 | 265 |
" |
266 |
self initializeDefaultCommands |
|
267 |
" |
|
1979
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
268 |
|
0612875a95c1
acroread command from registry (win32)
Claus Gittinger <cg@exept.de>
parents:
1925
diff
changeset
|
269 |
"Modified: / 12-05-2004 / 11:43:23 / cg" |
1729 | 270 |
! |
271 |
||
272 |
initializeFileNameToMimeTypeMapping |
|
273 |
"initialize wellKnown facts" |
|
274 |
||
275 |
|types| |
|
276 |
||
277 |
FileSuffixToTypeMapping isNil ifTrue:[ |
|
278 |
FileSuffixToTypeMapping := Dictionary new |
|
279 |
]. |
|
1887 | 280 |
TypeToFileSuffixMapping isNil ifTrue:[ |
281 |
TypeToFileSuffixMapping := Dictionary new |
|
282 |
]. |
|
1729 | 283 |
FilenameToTypeMapping isNil ifTrue:[ |
284 |
FilenameToTypeMapping := Dictionary new. |
|
285 |
]. |
|
286 |
||
287 |
types := OrderedCollection new. |
|
288 |
types addAll:self textTypeList. |
|
289 |
types addAll:self imageTypeList. |
|
290 |
types addAll:self videoTypeList. |
|
291 |
types addAll:self audioTypeList. |
|
292 |
types addAll:self applicationTypeList. |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
293 |
types addAll:self osSpecificTypeList. |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
294 |
|
1729 | 295 |
types pairWiseDo:[:suff :typeString| |
296 |
|type| |
|
297 |
||
298 |
type := MIMEType fromString:typeString. |
|
299 |
suff isArray ifTrue:[ |
|
1887 | 300 |
suff do:[:s | FileSuffixToTypeMapping at:s put:type]. |
301 |
TypeToFileSuffixMapping at:type put:suff first. |
|
1729 | 302 |
] ifFalse:[ |
1887 | 303 |
FileSuffixToTypeMapping at:suff put:type. |
304 |
TypeToFileSuffixMapping at:type put:suff. |
|
305 |
]. |
|
1729 | 306 |
]. |
307 |
||
308 |
self miscFilenameList pairWiseDo:[:nm :typeString| |
|
309 |
|type| |
|
310 |
||
311 |
type := MIMEType fromString:typeString. |
|
312 |
nm isArray ifTrue:[ |
|
313 |
nm do:[:s | FilenameToTypeMapping at:s put:type] |
|
314 |
] ifFalse:[ |
|
315 |
FilenameToTypeMapping at:nm put:type |
|
316 |
] |
|
317 |
]. |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
318 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
319 |
" |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
320 |
self initializeFileNameToMimeTypeMapping |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
321 |
" |
1729 | 322 |
! |
323 |
||
324 |
initializeImageReaderMappings |
|
3295 | 325 |
|rdr| |
326 |
||
1729 | 327 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
328 |
FileSuffixToImageReaderClassMapping := Dictionary new |
|
329 |
]. |
|
330 |
"MIME" TypeToImageReaderClassMapping isNil ifTrue:[ |
|
331 |
TypeToImageReaderClassMapping := Dictionary new |
|
332 |
]. |
|
333 |
||
334 |
"/ setup mimeType to image reader class mapping ... |
|
335 |
TypeToImageReaderClassMapping at:'image/jpeg' put:JPEGReader. |
|
336 |
TypeToImageReaderClassMapping at:'image/gif' put:GIFReader. |
|
337 |
TypeToImageReaderClassMapping at:'image/tiff' put:TIFFReader. |
|
2710 | 338 |
TypeToImageReaderClassMapping at:'image/png' put:PNGReader. |
1729 | 339 |
|
340 |
"/ setup suffix to image reader class mapping ... |
|
341 |
FileSuffixToImageReaderClassMapping at:'jpg' put:JPEGReader. |
|
3295 | 342 |
FileSuffixToImageReaderClassMapping at:'jpeg' put:JPEGReader. |
1729 | 343 |
FileSuffixToImageReaderClassMapping at:'gif' put:GIFReader. |
344 |
FileSuffixToImageReaderClassMapping at:'tif' put:TIFFReader. |
|
3295 | 345 |
FileSuffixToImageReaderClassMapping at:'tiff' put:TIFFReader. |
2710 | 346 |
FileSuffixToImageReaderClassMapping at:'png' put:PNGReader. |
2570 | 347 |
|
3295 | 348 |
"/ some 'used-to-be-optional' readers |
349 |
(rdr := Smalltalk at:#WindowsIconReader) notNil ifTrue:[ |
|
350 |
TypeToImageReaderClassMapping at:'image/bmp' put:rdr. |
|
351 |
TypeToImageReaderClassMapping at:'image/x-MS-bmp' put:rdr. |
|
352 |
TypeToImageReaderClassMapping at:'image/x-MS-ico' put:rdr. |
|
353 |
FileSuffixToImageReaderClassMapping at:'bmp' put:rdr. |
|
354 |
FileSuffixToImageReaderClassMapping at:'ico' put:rdr. |
|
355 |
]. |
|
356 |
(rdr := Smalltalk at:#XBMReader) notNil ifTrue:[ |
|
357 |
TypeToImageReaderClassMapping at:'image/x-xbitmap' put:rdr. |
|
358 |
FileSuffixToImageReaderClassMapping at:'xbm' put:rdr. |
|
359 |
]. |
|
360 |
(rdr := Smalltalk at:#XPMReader) notNil ifTrue:[ |
|
361 |
TypeToImageReaderClassMapping at:'image/x-xpixmap' put:rdr. |
|
362 |
FileSuffixToImageReaderClassMapping at:'pm' put:rdr. |
|
363 |
]. |
|
364 |
(rdr := Smalltalk at:#PBMReader) notNil ifTrue:[ |
|
365 |
TypeToImageReaderClassMapping at:'image/x-portable-pixmap' put:rdr. |
|
366 |
TypeToImageReaderClassMapping at:'image/x-portable-bitmap' put:rdr. |
|
367 |
TypeToImageReaderClassMapping at:'image/x-portable-graymap' put:rdr. |
|
368 |
TypeToImageReaderClassMapping at:'image/x-portable-anymap' put:rdr. |
|
369 |
FileSuffixToImageReaderClassMapping at:'ppm' put:rdr. |
|
370 |
FileSuffixToImageReaderClassMapping at:'pbm' put:rdr. |
|
371 |
FileSuffixToImageReaderClassMapping at:'pgm' put:rdr. |
|
372 |
FileSuffixToImageReaderClassMapping at:'pnm' put:rdr. |
|
373 |
]. |
|
374 |
(rdr := Smalltalk at:#PCXReader) notNil ifTrue:[ |
|
375 |
TypeToImageReaderClassMapping at:'image/x-pcx' put:rdr. |
|
376 |
FileSuffixToImageReaderClassMapping at:'pcx' put:rdr. |
|
377 |
]. |
|
378 |
(rdr := Smalltalk at:#TargaReader) notNil ifTrue:[ |
|
379 |
TypeToImageReaderClassMapping at:'image/x-targa' put:rdr. |
|
380 |
FileSuffixToImageReaderClassMapping at:'tga' put:rdr. |
|
381 |
]. |
|
382 |
(rdr := Smalltalk at:#XWDReader) notNil ifTrue:[ |
|
383 |
TypeToImageReaderClassMapping at:'image/x-xwindowdump' put:rdr. |
|
384 |
TypeToImageReaderClassMapping at:'image/x-windowdump' put:rdr. |
|
385 |
FileSuffixToImageReaderClassMapping at:'xwd' put:rdr. |
|
386 |
]. |
|
387 |
(rdr := Smalltalk at:#BlitImageReader) notNil ifTrue:[ |
|
388 |
TypeToImageReaderClassMapping at:'image/x-blitimage' put:rdr. |
|
389 |
FileSuffixToImageReaderClassMapping at:'48x48x1' put:rdr. |
|
390 |
]. |
|
391 |
(rdr := Smalltalk at:#IrisRGBReader) notNil ifTrue:[ |
|
392 |
TypeToImageReaderClassMapping at:'image/x-rgb' put:rdr. |
|
393 |
FileSuffixToImageReaderClassMapping at:'rgb' put:rdr. |
|
394 |
]. |
|
395 |
(rdr := Smalltalk at:#SunRasterReader) notNil ifTrue:[ |
|
396 |
TypeToImageReaderClassMapping at:'image/x-sunraster' put:rdr. |
|
397 |
FileSuffixToImageReaderClassMapping at:'im8' put:rdr. |
|
398 |
FileSuffixToImageReaderClassMapping at:'icon' put:rdr. |
|
2570 | 399 |
]. |
3295 | 400 |
(rdr := Smalltalk at:#ST80FormReader) notNil ifTrue:[ |
401 |
TypeToImageReaderClassMapping at:'image/x-st80-form' put:rdr. |
|
402 |
FileSuffixToImageReaderClassMapping at:'form' put:rdr. |
|
403 |
]. |
|
404 |
(rdr := Smalltalk at:#FaceReader) notNil ifTrue:[ |
|
405 |
TypeToImageReaderClassMapping at:'image/x-face' put:rdr. |
|
406 |
FileSuffixToImageReaderClassMapping at:'face' put:rdr. |
|
407 |
]. |
|
408 |
(rdr := Smalltalk at:#PCDReader) notNil ifTrue:[ |
|
409 |
TypeToImageReaderClassMapping at:'image/x-photo-cd' put:rdr. |
|
410 |
FileSuffixToImageReaderClassMapping at:'pcd' put:rdr. |
|
411 |
]. |
|
412 |
(rdr := Smalltalk at:#CMURasterReader) notNil ifTrue:[ |
|
413 |
TypeToImageReaderClassMapping at:'image/x-cmu-raster' put:rdr. |
|
414 |
FileSuffixToImageReaderClassMapping at:'ras' put:rdr. |
|
415 |
]. |
|
416 |
||
417 |
"/ movie formats - experimantal and not yet complete / finished / delivered |
|
418 |
"/ (rdr := Smalltalk at:#FLIReader) notNil ifTrue:[ |
|
419 |
"/ TypeToImageReaderClassMapping at:'video/x-fli' put:rdr. |
|
420 |
"/ FileSuffixToImageReaderClassMapping at:'fli' put:rdr. |
|
421 |
"/ ]. |
|
422 |
"/ (rdr := Smalltalk at:#AVIReader) notNil ifTrue:[ |
|
423 |
"/ TypeToImageReaderClassMapping at:'video/x-msvideo' put:rdr. |
|
424 |
"/ FileSuffixToImageReaderClassMapping at:'avi' put:rdr. |
|
425 |
"/ ]. |
|
426 |
"/ (rdr := Smalltalk at:#AVIReader) notNil ifTrue:[ |
|
427 |
"/ TypeToImageReaderClassMapping at:'video/x-msvideo' put:rdr. |
|
428 |
"/ FileSuffixToImageReaderClassMapping at:'avi' put:rdr. |
|
429 |
"/ ]. |
|
430 |
"/ (rdr := Smalltalk at:#QuickTimeReader) notNil ifTrue:[ |
|
431 |
"/ TypeToImageReaderClassMapping at:'video/quicktime' put:rdr. |
|
432 |
"/ FileSuffixToImageReaderClassMapping at:'qt' put:rdr. |
|
433 |
"/ FileSuffixToImageReaderClassMapping at:'mov' put:rdr. |
|
434 |
"/ FileSuffixToImageReaderClassMapping at:'moov' put:rdr. |
|
435 |
"/ ]. |
|
436 |
"/ (rdr := Smalltalk at:#MPEG2Reader) notNil ifTrue:[ |
|
437 |
"/ TypeToImageReaderClassMapping at:'video/x-mpeg2' put:rdr. |
|
438 |
"/ FileSuffixToImageReaderClassMapping at:'mpg2' put:rdr. |
|
439 |
"/ FileSuffixToImageReaderClassMapping at:'mpv2' put:rdr. |
|
440 |
"/ FileSuffixToImageReaderClassMapping at:'mp2v' put:rdr. |
|
441 |
"/ FileSuffixToImageReaderClassMapping at:'mp2' put:rdr. |
|
442 |
"/ ]. |
|
443 |
"/ (rdr := Smalltalk at:#MPEGReader) notNil ifTrue:[ |
|
444 |
"/ TypeToImageReaderClassMapping at:'video/mpeg' put:rdr. |
|
445 |
"/ FileSuffixToImageReaderClassMapping at:'mpg' put:rdr. |
|
446 |
"/ FileSuffixToImageReaderClassMapping at:'mpeg' put:rdr. |
|
447 |
"/ FileSuffixToImageReaderClassMapping at:'mpe' put:rdr. |
|
448 |
"/ FileSuffixToImageReaderClassMapping at:'mpv' put:rdr. |
|
449 |
"/ FileSuffixToImageReaderClassMapping at:'vps' put:rdr. |
|
450 |
"/ FileSuffixToImageReaderClassMapping at:'mpegv' put:rdr. |
|
451 |
"/ ]. |
|
452 |
"/ (rdr := Smalltalk at:#SGIMovieReader) notNil ifTrue:[ |
|
453 |
"/ TypeToImageReaderClassMapping at:'video/x-sgi-movie' put:rdr. |
|
454 |
"/ FileSuffixToImageReaderClassMapping at:'movie' put:rdr. |
|
455 |
"/ ]. |
|
2298 | 456 |
! |
457 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
458 |
initializeParenthesisSpecMappings |
2298 | 459 |
|spec| |
460 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
461 |
TypeToParenthesisSpecMapping := Dictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
462 |
SuffixToParenthesisSpecMapping := Dictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
463 |
|
2298 | 464 |
"/ ST/X spec |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
465 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
466 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
467 |
spec at:#open put:#( $( $[ ${ ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
468 |
spec at:#close put:#( $) $] $} ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
469 |
spec at:#ignore put:#( $' $" '$[' '$]' '${' '$)' ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
470 |
spec at:#eolComment put:'"/'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
471 |
TypeToParenthesisSpecMapping at:'application/x-smalltalk-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
472 |
|
2479 | 473 |
"/ XML & HTML |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
474 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
475 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
476 |
spec at:#open put:#( $< ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
477 |
spec at:#close put:#( $> ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
478 |
spec at:#ignore put:#( $' $" '$[' '$]' '${' '$)' ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
479 |
#( 'text/html' 'text/xml' 'application/xml' ) do:[:eachXMLType | |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
480 |
TypeToParenthesisSpecMapping at:eachXMLType put:spec |
2298 | 481 |
]. |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
482 |
|
2479 | 483 |
"/ ANSI-c, Java, C# |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
484 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
485 |
spec := IdentityDictionary new. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
486 |
spec at:#open put:#( $( $[ ${ ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
487 |
spec at:#close put:#( $) $] $} ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
488 |
spec at:#ignore put:#( $' $" ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
489 |
spec at:#eolComment put:'//'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
490 |
TypeToParenthesisSpecMapping at:'application/x-c-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
491 |
TypeToParenthesisSpecMapping at:'application/x-cpp-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
492 |
TypeToParenthesisSpecMapping at:'application/x-csharp-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
493 |
TypeToParenthesisSpecMapping at:'application/x-java-source' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
494 |
TypeToParenthesisSpecMapping at:'application/x-javascript' put:spec. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
495 |
|
2298 | 496 |
"/ Lisp |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
497 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
498 |
spec := IdentityDictionary new. |
3039 | 499 |
spec at:#open put:#( $( $[ ). |
500 |
spec at:#close put:#( $) $] ). |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
501 |
spec at:#ignore put:#( $" ). |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
502 |
spec at:#eolComment put:';'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
503 |
TypeToParenthesisSpecMapping at:'application/x-lisp-source' put:spec. |
2298 | 504 |
|
505 |
"Created: / 10-04-2007 / 15:16:37 / cg" |
|
1729 | 506 |
! ! |
507 |
||
508 |
!MIMETypes class methodsFor:'initialization-lists'! |
|
509 |
||
510 |
applicationCompressorsAndArchiveTypeList |
|
1604 | 511 |
^ #( |
1890 | 512 |
'tar' 'application/x-tar' |
513 |
'gtar' 'application/x-gtar' |
|
1891 | 514 |
('tgz' 'tar.gz') 'application/x-tar-gzip-compressed' "/ 'application/x-tar-compressed' |
515 |
('tar.bz2') 'application/x-tar-bzip2-compressed' |
|
1890 | 516 |
'zip' 'application/x-zip-compressed' |
517 |
'bz2' 'application/x-bzip2-compressed' |
|
518 |
('gz' 'z') 'application/x-gzip-compressed' |
|
519 |
'cpio' 'application/x-cpio' |
|
520 |
'shar' 'application/x-shar' |
|
521 |
'jar' 'application/java-archive' |
|
522 |
'sar' 'application/x-squeak-archive' |
|
523 |
'sit' 'application/x-stuffit' |
|
524 |
'hqx' 'application/mac-binhex40' |
|
525 |
'cpt' 'application/mac-compactpro' |
|
1604 | 526 |
) |
527 |
! |
|
645 | 528 |
|
1609 | 529 |
applicationMiscTypeList |
530 |
"misc applications" |
|
531 |
||
532 |
^ #( |
|
533 |
('a' 'o' 'obj' ) 'application/binary' |
|
2968 | 534 |
('lic') 'application/license' |
1609 | 535 |
('dll' 'so') 'application/shared-library' |
2486
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
536 |
|
42063a7fc3db
mimeType: x-expecco-testSuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
537 |
('ets') 'application/x-expecco-testsuite' |
3104 | 538 |
('etr') 'application/x-expecco-testrepository' |
2489
b891d96fd496
elf extension: x-expecco-logfile
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
539 |
('elf') 'application/x-expecco-logfile' |
2886
22b48a4da285
comment/format in: #initializeFileNameToMimeTypeMapping
sr
parents:
2830
diff
changeset
|
540 |
('expeccolicense') 'application/x-expecco-license' |
2888 | 541 |
('expeccopatch') 'application/x-expecco-patch' |
1609 | 542 |
) |
2886
22b48a4da285
comment/format in: #initializeFileNameToMimeTypeMapping
sr
parents:
2830
diff
changeset
|
543 |
|
2968 | 544 |
"Modified: / 03-11-2011 / 10:42:28 / sr" |
1609 | 545 |
! |
546 |
||
1604 | 547 |
applicationProgLangTypeList |
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
548 |
"applications for programming languages" |
713 | 549 |
|
1604 | 550 |
^ #( |
1609 | 551 |
('st' 'cls' 'rc') 'application/x-smalltalk-source' |
1604 | 552 |
'sif' 'application/x-smalltalk-source-sif' |
1668 | 553 |
'pac' 'application/x-smalltalk-dolphin-package' |
1778 | 554 |
|
555 |
'sts' 'application/x-squeak-source' |
|
556 |
'pr' 'application/x-squeak-project' |
|
557 |
||
1604 | 558 |
'c' 'application/x-c-source' |
559 |
('cc' 'cpp') 'application/x-cpp-source' |
|
2479 | 560 |
'cs' 'application/x-csharp-source' |
1609 | 561 |
('h' 'hi') 'application/x-c-header' |
1604 | 562 |
('js' 'mocha') 'application/x-javascript' |
563 |
('java' 'jav') 'application/x-java-source' |
|
564 |
'sh' 'application/x-sh' |
|
565 |
'csh' 'application/x-csh' |
|
566 |
'tcl' 'application/x-tcl' |
|
567 |
'pl' 'application/x-perl' |
|
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
568 |
'dart' 'application/x-dart' |
1604 | 569 |
'mak' 'application/x-make' |
570 |
'bat' 'application/x-batch-script' |
|
3008 | 571 |
('asn1' 'x409' 'gdmo' 'gdm') 'application/x-asn1-source' |
572 |
||
2912
f3466ea0810b
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
573 |
('lisp' 'lsp' 'scm' 'ss' |
f3466ea0810b
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
574 |
'arc' 'cl' 'brg') 'application/x-lisp-source' |
1604 | 575 |
) |
2298 | 576 |
|
3020
3f9c74ff0975
changed: #applicationProgLangTypeList
Claus Gittinger <cg@exept.de>
parents:
3014
diff
changeset
|
577 |
"Modified (comment): / 21-08-2012 / 20:55:13 / cg" |
1604 | 578 |
! |
1561 | 579 |
|
1604 | 580 |
applicationTextTypeList |
1606 | 581 |
"text applications" |
1604 | 582 |
|
583 |
^ #( |
|
584 |
('ps' 'eps') 'application/postscript' |
|
1778 | 585 |
"/ 'ai' 'application/postscript' |
1604 | 586 |
'pdf' 'application/pdf' |
587 |
'rtf' 'application/rtf' |
|
1778 | 588 |
"/ 'rtf' 'text/rtf' ???? |
3008 | 589 |
'ics' 'text/calendar' |
590 |
'doc' 'application/ms-word-document' |
|
1778 | 591 |
"/ 'doc' 'application/winword' |
592 |
'swf' 'application/x-shockwave-flash' |
|
593 |
('ppt' 'ppz' 'pot' 'pps') 'application/mspowerpoint' |
|
2028 | 594 |
'xls' 'application/x-excel' |
595 |
'slk' 'application/vnd.ms-excel' |
|
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
596 |
'txt' 'text/plain' |
2970
8b91ec204044
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
2968
diff
changeset
|
597 |
'xlsx' 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
1604 | 598 |
) |
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
599 |
|
3008 | 600 |
"Modified: / 26-05-2012 / 15:27:30 / cg" |
1604 | 601 |
! |
602 |
||
603 |
applicationTypeList |
|
1606 | 604 |
"applications" |
1604 | 605 |
|
1729 | 606 |
|typeList| |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
607 |
|
1729 | 608 |
typeList := OrderedCollection new. |
609 |
typeList addAll:self applicationProgLangTypeList. |
|
610 |
typeList addAll:self applicationTextTypeList. |
|
611 |
typeList addAll:self applicationCompressorsAndArchiveTypeList. |
|
612 |
typeList addAll:self applicationMiscTypeList. |
|
1616 | 613 |
|
1729 | 614 |
^ typeList |
1604 | 615 |
! |
616 |
||
617 |
audioTypeList |
|
1606 | 618 |
"audio formats ..." |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
619 |
|
1604 | 620 |
^ #( |
1720 | 621 |
('au' 'snd') 'audio/basic' |
1778 | 622 |
('ra') 'audio/x-realaudio' |
623 |
('ram' 'rm') 'audio/x-pn-realaudio' |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
624 |
"/ cg: see unixSpecific / windowsSpecific |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
625 |
"/ 'rpm' 'audio/x-pn-realaudio-plugin' |
3008 | 626 |
('mpa' 'mpega' 'mpga') 'audio/mpeg' |
1778 | 627 |
"/ 'mp3' 'audio/x-mp3' |
628 |
('mp3' 'mp2') 'audio/mpeg' |
|
1604 | 629 |
'wav' 'audio/x-wav' |
630 |
('aif' 'aiff' 'aifc') 'audio/x-aiff' |
|
1778 | 631 |
('midi' 'mid') 'audio/midi' |
1604 | 632 |
) |
3008 | 633 |
|
634 |
"Modified: / 26-05-2012 / 15:23:45 / cg" |
|
1604 | 635 |
! |
636 |
||
637 |
imageTypeList |
|
638 |
||
639 |
^ #( |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
640 |
"/ image formats ... |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
641 |
|
1216 | 642 |
('jpg' 'jpeg') 'image/jpeg' |
1188 | 643 |
'gif' 'image/gif' |
644 |
('tif' 'tiff') 'image/tiff' |
|
3295 | 645 |
('xbm' 'bm') 'image/x-xbitmap' |
1188 | 646 |
'xpm' 'image/x-xpixmap' |
1720 | 647 |
'png' 'image/png' |
1188 | 648 |
'pcd' 'image/x-photo-cd' |
649 |
'bmp' 'image/x-MS-bmp' |
|
650 |
'rgb' 'image/x-rgb' |
|
651 |
'ppm' 'image/x-portable-pixmap' |
|
652 |
'pgm' 'image/x-portable-graymap' |
|
653 |
'pbm' 'image/x-portable-bitmap' |
|
654 |
'pnm' 'image/x-portable-anymap' |
|
655 |
'xwd' 'image/x-xwindowdump' |
|
656 |
'ras' 'image/x-cmu-raster' |
|
1216 | 657 |
'tga' 'image/x-targa' |
2020 | 658 |
'ico' 'image/x-ico' |
1604 | 659 |
) |
660 |
! |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
661 |
|
1609 | 662 |
miscFilenameList |
3104 | 663 |
"other formats (not by suffix, but by fileName instead) ..." |
1609 | 664 |
|
665 |
^ #( |
|
2113 | 666 |
('makefile' 'make.proto' 'make.spec' 'nt.mak') 'application/x-make' |
2830 | 667 |
('exe' 'bin' 'com') 'application/octet-stream' |
2113 | 668 |
('class') 'application/octet-stream' |
2375 | 669 |
('top') 'application/x-waltop-digital-notepad' |
1609 | 670 |
) |
671 |
! |
|
672 |
||
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
673 |
osSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
674 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
675 |
^ self windowsSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
676 |
]. |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
677 |
^ self unixSpecificTypeList |
2023 | 678 |
|
679 |
" |
|
680 |
self osSpecificTypeList |
|
681 |
" |
|
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
682 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
683 |
|
1604 | 684 |
textTypeList |
685 |
"/ misc text ... |
|
686 |
||
687 |
^ #( |
|
1887 | 688 |
('html' 'htm' 'shtml') 'text/html' |
1604 | 689 |
('txt' 'text') 'text/plain' |
1680 | 690 |
'xml' 'text/xml' |
1777 | 691 |
'css' 'text/css' |
2432 | 692 |
'csv' 'text/csv' |
1604 | 693 |
) |
694 |
! |
|
695 |
||
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
696 |
unixSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
697 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
698 |
^ #( |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
699 |
"/ cg: RPM is 'audio/x-pn-realaudio-plugin' for WIN32 |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
700 |
"/ and 'application/x-rpm' for Unix |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
701 |
'rpm' 'application/x-rpm' |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
702 |
) |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
703 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
704 |
|
1604 | 705 |
videoTypeList |
706 |
"/ video formats ... |
|
707 |
||
708 |
^ #( |
|
1720 | 709 |
('qt' 'mov' 'moov') 'video/quicktime' |
710 |
('mpv' 'mpegv' 'mpg' 'mpeg' 'mpe') 'video/mpeg' |
|
1604 | 711 |
'movie' 'video/x-sgi-movie' |
1820 | 712 |
('avi' 'wmv' 'asf') 'video/x-msvideo' |
1604 | 713 |
('mpv2' 'mp2v' 'mp2' 'mpeg2') 'video/x-mpeg2' |
1680 | 714 |
'rm' 'application/vnd.rn-realmedia' |
715 |
'rv' 'video/x-pn-realvideo' |
|
3295 | 716 |
'fli' 'video/x-fli' |
1778 | 717 |
) |
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
718 |
! |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
719 |
|
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
720 |
windowsSpecificTypeList |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
721 |
^ #( |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
722 |
"/ cg: RPM is 'audio/x-pn-realaudio-plugin' for WIN32 |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
723 |
"/ and 'application/x-rpm' for Unix |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
724 |
'rpm' 'audio/x-pn-realaudio-plugin' |
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
725 |
) |
643 | 726 |
! ! |
727 |
||
1729 | 728 |
!MIMETypes class methodsFor:'obsolete'! |
1489 | 729 |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
730 |
defaultCommandForMimeType:mimeType |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
731 |
<resource: #obsolete> |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
732 |
self obsoleteMethodWarning:'use #defaultCommandTemplateToOpenMimeType:'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
733 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
734 |
^ self defaultCommandTemplateToOpenMimeType:mimeType |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
735 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
736 |
" |
2758
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
737 |
MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf' |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
738 |
" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
739 |
|
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
740 |
"Created: / 12-05-2004 / 11:09:22 / cg" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
741 |
"Modified: / 12-05-2004 / 11:16:53 / cg" |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
742 |
! |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
743 |
|
1729 | 744 |
fontForCharset:aCharSetName |
745 |
"return the font-encoding for an iso-charset" |
|
1489 | 746 |
|
1981 | 747 |
<resource:#obsolete> |
1729 | 748 |
self obsoleteMethodWarning:'use FontDescription >> fontNamePatternForCharset:'. |
749 |
^ FontDescription fontNamePatternForCharset:aCharSetName. |
|
1489 | 750 |
|
751 |
" |
|
1729 | 752 |
MIMETypes fontForCharset:'iso2022-jp' |
753 |
MIMETypes fontForCharset:'euc-jp' |
|
1472 | 754 |
" |
755 |
||
1729 | 756 |
"Modified: / 1.8.1998 / 17:00:57 / cg" |
757 |
! ! |
|
1472 | 758 |
|
1729 | 759 |
!MIMETypes class methodsFor:'queries'! |
1472 | 760 |
|
647 | 761 |
defineImageType:mimeType suffix:aSuffix reader:aReaderClass |
762 |
"register an image reader." |
|
763 |
||
764 |
aSuffix notNil ifTrue:[ |
|
765 |
self imageReaderForSuffix:aSuffix put:aReaderClass. |
|
766 |
]. |
|
767 |
||
768 |
mimeType notNil ifTrue:[ |
|
769 |
self imageReaderForType:mimeType put:aReaderClass |
|
770 |
]. |
|
771 |
||
772 |
(aSuffix notNil and:[mimeType notNil]) ifTrue:[ |
|
773 |
self mimeTypeForSuffix:aSuffix put:mimeType |
|
774 |
]. |
|
775 |
! |
|
776 |
||
643 | 777 |
fileSuffixToImageReaderMapping |
1021 | 778 |
"return the suffix-to-imageReader mapping" |
779 |
||
643 | 780 |
^ FileSuffixToImageReaderClassMapping ? #() |
781 |
||
1021 | 782 |
"Modified: / 1.8.1998 / 17:00:11 / cg" |
643 | 783 |
! |
784 |
||
785 |
imageFileSuffixes |
|
1021 | 786 |
"return a collection with known file suffixes" |
787 |
||
643 | 788 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ #()]. |
789 |
^ FileSuffixToImageReaderClassMapping keys |
|
790 |
||
1021 | 791 |
"Created: / 30.6.1997 / 22:04:48 / cg" |
792 |
"Modified: / 1.8.1998 / 17:01:26 / cg" |
|
643 | 793 |
! |
794 |
||
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
795 |
mimeTypeForFilename:filenameOrString |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
796 |
"given a filename, return the mime-type or nil, if unknown" |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
797 |
|
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
798 |
|type filename lcFilename suff suff2| |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
799 |
|
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
800 |
filename := filenameOrString asFilename. |
1474 | 801 |
|
802 |
lcFilename := filename baseName asLowercase. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
803 |
type := FilenameToTypeMapping at:lcFilename ifAbsent:nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
804 |
type isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
805 |
"/ allow for fallback ... |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
806 |
type := OperatingSystem mimeTypeForFilename:lcFilename. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
807 |
"/ the special value #unknown is returned as nil; |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
808 |
"/ this avoids constant retry if a mimeType is not known in |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
809 |
"/ the OS. |
1275 | 810 |
"/ type isNil ifTrue:[ |
811 |
"/ FilenameToTypeMapping at:lcFilename put:#unknown |
|
812 |
"/ ]. |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
813 |
]. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
814 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
815 |
type == #unknown ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
816 |
type := nil. |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
817 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
818 |
|
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
819 |
type isNil ifTrue:[ |
1473 | 820 |
suff := filename suffix. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
821 |
suff size ~~ 0 ifTrue:[ |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
822 |
"/ sigh - special code for multiple-suffices... |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
823 |
"/ .tar.gz -> tgz |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
824 |
suff2 := filename withoutSuffix suffix. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
825 |
suff2 size > 0 ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
826 |
type := self mimeTypeForSuffix:(suff2 , '.' , suff). |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
827 |
]. |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
828 |
type isNil ifTrue:[ |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
829 |
type := self mimeTypeForSuffix:suff |
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
830 |
]. |
1273
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
831 |
] |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
832 |
]. |
7a52d4bcdb10
filenames mime query falls back to suffix query.
Claus Gittinger <cg@exept.de>
parents:
1272
diff
changeset
|
833 |
|
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
834 |
^ type |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
835 |
|
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
836 |
" |
2820 | 837 |
MIMETypes mimeTypeForFilename:'typeinst.dvi' |
838 |
MIMETypes mimeTypeForFilename:'foo.tar' |
|
839 |
MIMETypes mimeTypeForFilename:'foo.tgz' |
|
840 |
MIMETypes mimeTypeForFilename:'foo.tar.gz' |
|
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
841 |
MIMETypes mimeTypeForFilename:'foo.txt' |
1780
ba94d562efe8
support double-suffix such as '.tar.gz'
Claus Gittinger <cg@exept.de>
parents:
1779
diff
changeset
|
842 |
" |
2911
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
843 |
|
7afaf1fdae8b
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
2904
diff
changeset
|
844 |
"Modified: / 10-05-2011 / 11:55:18 / cg" |
3014
e6d9a204da08
comment/format in: #mimeTypeForFilename:
Claus Gittinger <cg@exept.de>
parents:
3012
diff
changeset
|
845 |
"Modified (format): / 28-07-2012 / 09:39:15 / cg" |
1272
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
846 |
! |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
847 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
848 |
mimeTypeForFilename:filename put:mimeType |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
849 |
"register a mime type for a filename" |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
850 |
|
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
851 |
FilenameToTypeMapping isNil ifTrue:[ |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
852 |
FilenameToTypeMapping := Dictionary new |
91ba4078b690
additional mime table for filenames without suffix.
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
853 |
]. |
1612 | 854 |
FilenameToTypeMapping at:filename put:(MIMEType fromString:mimeType asLowercase) |
1611 | 855 |
! |
856 |
||
643 | 857 |
mimeTypeForSuffix:suffix |
1021 | 858 |
"given a file suffix, return the mime-type" |
859 |
||
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
860 |
|type lcSuffix| |
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
861 |
|
1837 | 862 |
suffix = LastSuffix ifTrue:[ |
863 |
^ LastType |
|
864 |
]. |
|
865 |
||
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
866 |
lcSuffix := suffix asLowercase. |
1837 | 867 |
type := FileSuffixToTypeMapping at:lcSuffix ifAbsent:nil. |
868 |
type isNil ifTrue:[ |
|
869 |
"/ allow for fallback ... |
|
870 |
type := OperatingSystem mimeTypeForSuffix:lcSuffix. |
|
871 |
"/ the special value #unknown is returned as nil; |
|
872 |
"/ this avoids constant retry if a mimeType is not known in the OS. |
|
873 |
||
874 |
type := type ? #unknown. |
|
875 |
FileSuffixToTypeMapping at:lcSuffix put:type. |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
876 |
]. |
1837 | 877 |
|
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
878 |
type == #unknown ifTrue:[ |
1837 | 879 |
type := nil. |
1180
c3309b30d14f
code cleanup & added mimeType aquire fallBack via OS
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
880 |
]. |
1840 | 881 |
type notNil ifTrue:[ |
882 |
LastSuffix := suffix. |
|
883 |
LastType := MIMEType fromString:type. |
|
884 |
^ LastType |
|
885 |
]. |
|
1841 | 886 |
^ type |
643 | 887 |
|
1666 | 888 |
" |
1840 | 889 |
self mimeTypeForSuffix:'gif' |
1888
ef0f346b8f43
rpm suffix is RPM-package under unix (realplayer under windows)
Claus Gittinger <cg@exept.de>
parents:
1887
diff
changeset
|
890 |
self mimeTypeForSuffix:'rpm' |
2891 | 891 |
self mimeTypeForSuffix:'zip' |
1666 | 892 |
" |
893 |
||
2891 | 894 |
"Created: / 30-06-1997 / 21:55:51 / cg" |
895 |
"Modified: / 14-02-2011 / 17:14:34 / cg" |
|
643 | 896 |
! |
897 |
||
898 |
mimeTypeForSuffix:suffix put:mimeType |
|
1021 | 899 |
"register a mime type for a file suffix" |
900 |
||
643 | 901 |
FileSuffixToTypeMapping isNil ifTrue:[ |
902 |
FileSuffixToTypeMapping := Dictionary new |
|
903 |
]. |
|
904 |
FileSuffixToTypeMapping at:suffix put:mimeType asLowercase |
|
905 |
||
1021 | 906 |
"Created: / 30.6.1997 / 21:56:20 / cg" |
907 |
"Modified: / 1.8.1998 / 17:03:18 / cg" |
|
1593 | 908 |
! |
909 |
||
910 |
mimeTypeForSuffixMapping |
|
911 |
||
912 |
^ FileSuffixToTypeMapping |
|
1611 | 913 |
! |
914 |
||
2023 | 915 |
mimeTypeFromString:mimeTypeString |
916 |
"given a mime-type for a string" |
|
917 |
||
918 |
^ MIMEType fromString:mimeTypeString |
|
919 |
||
920 |
" |
|
921 |
self mimeTypeFromString:'image/gif' |
|
2487
eaa224da42fa
mimeType: x-expecco-testsuite (extension: ets)
Claus Gittinger <cg@exept.de>
parents:
2486
diff
changeset
|
922 |
self mimeTypeFromString:'application/x-expecco-testsuite' |
2023 | 923 |
" |
924 |
! |
|
925 |
||
1611 | 926 |
mimeTypeOfContents:filename |
927 |
"given a filename, scan the contents, return the mime-type or nil, if unknown" |
|
928 |
||
1612 | 929 |
|typeString| |
930 |
||
931 |
typeString := filename mimeTypeOfContents. |
|
932 |
typeString isNil ifTrue:[^ nil]. |
|
933 |
^ MIMEType fromString:typeString. |
|
1887 | 934 |
! |
935 |
||
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
936 |
mimeTypeOfData:someData |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
937 |
"this tries to guess the mime type of contents of someData. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
938 |
Returns nil, if unknown. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
939 |
This is done using some heuristics, and may need some improvement" |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
940 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
941 |
|buffer lcBuffer size idx idx2| |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
942 |
|
2583 | 943 |
someData isEmptyOrNil ifTrue:[^ nil]. |
944 |
||
945 |
size := 2048 min:someData size. |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
946 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
947 |
"/ read some data from the file ... |
2583 | 948 |
buffer := (someData copyTo:size) asString. |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
949 |
lcBuffer := buffer asLowercase. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
950 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
951 |
(idx := lcBuffer findString:'mimetype:') ~~ 0 ifTrue:[ |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
952 |
idx := idx + 'mimetype:' size. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
953 |
idx := lcBuffer indexOfNonSeparatorStartingAt:idx. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
954 |
idx2 := lcBuffer indexOfSeparatorStartingAt:idx. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
955 |
idx2 > idx ifTrue:[ |
2583 | 956 |
^ MIMEType fromString:(lcBuffer copyFrom:idx to:idx2-1) |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
957 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
958 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
959 |
|
2924 | 960 |
"/ real starters |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
961 |
#( |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
962 |
( #[16r4C 16r00 16r00 16r00 16r01 16r14 16r02 16r00 16r00 16r00 16r00 16r00 16rC0 16r00 16r00 16r00 16r00 16r00 16r00 16r46] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
963 |
#'application/x-ms-shortcut' ) |
2924 | 964 |
( 'ITOLITLS' |
965 |
#'application/x-ms-reader' ) |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
966 |
( 'WALTOP' |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
967 |
#'application/x-waltop-digital-notepad' ) |
2892 | 968 |
('PK' |
969 |
#'application/x-zip-compressed') |
|
3113 | 970 |
('<?xml' |
971 |
#'text/xml') |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
972 |
) pairsDo:[:pattern :what | |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
973 |
|patternString| |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
974 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
975 |
patternString := pattern asString. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
976 |
(buffer startsWith:patternString) ifTrue:[ |
2583 | 977 |
^ MIMEType fromString:what |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
978 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
979 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
980 |
|
2924 | 981 |
"/ somewhere near the beginning |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
982 |
#( |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
983 |
('<body:' #'text/html') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
984 |
('%!!ps-adobe' #'application/postscript') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
985 |
('%PDF-' #'application/pdf') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
986 |
('#!! /bin/sh' #'application/x-sh') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
987 |
('#!!/bin/sh' #'application/x-sh') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
988 |
"/ ('#!! /bin/bash' 'application/x-bash') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
989 |
"/ ('#!!/bin/bash' 'application/x-bash') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
990 |
|
3113 | 991 |
('---- encoding: ' #'application/x-smalltalk-source') |
992 |
('---- timestamp ' #'application/x-smalltalk-source') |
|
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
993 |
('from dolphin' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
994 |
('from visualworks' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
995 |
('categoriesforclass' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
996 |
('methodsfor!!' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
997 |
('subclass:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
998 |
('methodsfor:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
999 |
('interchangeversion:' #'application/x-smalltalk-source-sif') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1000 |
('subclass:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1001 |
('methodsfor:' #'application/x-smalltalk-source') |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1002 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1003 |
) pairsDo:[:pattern :what | |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1004 |
(lcBuffer findString:pattern) ~~ 0 ifTrue:[ |
2583 | 1005 |
^ MIMEType fromString:what |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1006 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1007 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1008 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1009 |
(idx := lcBuffer findString:'<h') ~~ 0 ifTrue:[ |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1010 |
((lcBuffer continuesWith:'<head' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1011 |
or:[(lcBuffer continuesWith:'<html' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1012 |
or:[(lcBuffer continuesWith:'<h1' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1013 |
or:[(lcBuffer continuesWith:'<h2' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1014 |
or:[(lcBuffer continuesWith:'<h3' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1015 |
or:[(lcBuffer continuesWith:'<h4' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1016 |
or:[(lcBuffer continuesWith:'<h5' startingAt:idx) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1017 |
or:[(lcBuffer continuesWith:'<h6' startingAt:idx)]]]]]]]) |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1018 |
ifTrue:[ |
2583 | 1019 |
^ MIMEType fromString:'text/html' |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1020 |
] |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1021 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1022 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1023 |
[size ~~ 0 and:[(buffer at:size) isPrintable]] whileTrue:[size := size - 1]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1024 |
|
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1025 |
size == 0 ifTrue:[ |
2583 | 1026 |
^ MIMEType fromString:'text/plain' |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1027 |
]. |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1028 |
^ nil |
2891 | 1029 |
|
2924 | 1030 |
"Modified: / 12-07-2011 / 19:08:17 / cg" |
2582
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1031 |
! |
298203fdb64d
mime type detection from conents moved from fileName to here
Claus Gittinger <cg@exept.de>
parents:
2570
diff
changeset
|
1032 |
|
1887 | 1033 |
suffixForMimeType:mimeType |
1034 |
"given a file suffix, return the mime-type" |
|
1035 |
||
1036 |
^ TypeToFileSuffixMapping at:mimeType ifAbsent:nil |
|
1037 |
||
1038 |
" |
|
1039 |
self suffixForMimeType:(MIMEType fromString:'image/gif') |
|
1040 |
" |
|
1041 |
||
1042 |
"Created: / 30.6.1997 / 21:55:51 / cg" |
|
1043 |
"Modified: / 23.12.1999 / 22:30:55 / cg" |
|
1044 |
! |
|
1045 |
||
1046 |
suffixForMimeTypeString:mimeTypeString |
|
1047 |
"given a file suffix, return the mime-type" |
|
1048 |
||
1049 |
^ self suffixForMimeType:(MIMEType fromString:mimeTypeString) |
|
1050 |
||
1051 |
" |
|
1052 |
self suffixForMimeTypeString:'image/gif' |
|
1053 |
" |
|
1054 |
||
1055 |
"Created: / 30.6.1997 / 21:55:51 / cg" |
|
1056 |
"Modified: / 23.12.1999 / 22:30:55 / cg" |
|
1612 | 1057 |
! ! |
1058 |
||
2116 | 1059 |
!MIMETypes class methodsFor:'queries-applications'! |
1060 |
||
2117 | 1061 |
defaultCommandPerMIME |
1062 |
"returns the collection which is used to map MIME-type to command-templates." |
|
1063 |
||
1064 |
"TODO: move this to OS/UserPreferences" |
|
1065 |
||
1066 |
DefaultCommandPerMIMEPerOS isNil ifTrue:[ |
|
1067 |
self initializeDefaultCommands |
|
1068 |
]. |
|
1069 |
OperatingSystem isUNIXlike ifTrue:[ |
|
1070 |
^ DefaultCommandPerMIMEPerOS at:#unix |
|
1071 |
]. |
|
1072 |
^ DefaultCommandPerMIMEPerOS at:#win32 |
|
2942
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1073 |
|
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1074 |
" |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1075 |
MIMETypes defaultCommandPerMIME |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1076 |
" |
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1077 |
|
693d381bc775
comment/format in: #defaultCommandPerMIME
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1078 |
"Modified (comment): / 16-09-2011 / 16:20:12 / cg" |
2117 | 1079 |
! |
1080 |
||
2116 | 1081 |
defaultCommandTemplateToOpenMimeType:mimeType |
1082 |
|cmd| |
|
1083 |
||
1084 |
cmd := self defaultCommandPerMIME at:mimeType ifAbsent:nil. |
|
1085 |
cmd isNil ifTrue:[ |
|
1086 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
1087 |
cmd := Win32OperatingSystem::RegistryEntry commandTemplateToOpenMimeType:mimeType |
|
1088 |
]. |
|
1089 |
]. |
|
1090 |
^ cmd |
|
1091 |
||
1092 |
" |
|
1093 |
MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf' |
|
2118 | 1094 |
MIMETypes defaultCommandTemplateToOpenMimeType:'text/html' |
2116 | 1095 |
" |
1096 |
||
1097 |
"Created: / 12-05-2004 / 11:09:22 / cg" |
|
1098 |
"Modified: / 12-05-2004 / 11:16:53 / cg" |
|
1099 |
! |
|
1100 |
||
1101 |
defaultCommandTemplateToPrintMimeType:mimeType |
|
1102 |
|cmd| |
|
1103 |
||
1104 |
cmd := self defaultPrintCommandPerMIME at:mimeType ifAbsent:nil. |
|
1105 |
cmd isNil ifTrue:[ |
|
1106 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
1107 |
cmd := Win32OperatingSystem::RegistryEntry commandTemplateToPrintMimeType:mimeType |
|
1108 |
]. |
|
1109 |
]. |
|
1110 |
^ cmd |
|
1111 |
||
1112 |
" |
|
1113 |
MIMETypes defaultCommandTemplateToPrintMimeType:'application/pdf' |
|
1114 |
" |
|
2117 | 1115 |
! |
1116 |
||
1117 |
defaultPrintCommandPerMIME |
|
1118 |
"returns the collection which is used to map MIME-type to printing command-templates." |
|
1119 |
||
1120 |
"TODO: move this to OS/UserPreferences" |
|
1121 |
||
1122 |
DefaultPrintCommandPerMIMEPerOS isNil ifTrue:[ |
|
1123 |
self initializeDefaultCommands |
|
1124 |
]. |
|
1125 |
OperatingSystem isUNIXlike ifTrue:[ |
|
1126 |
^ DefaultPrintCommandPerMIMEPerOS at:#unix |
|
1127 |
]. |
|
1128 |
^ DefaultPrintCommandPerMIMEPerOS at:#win32 |
|
2116 | 1129 |
! ! |
1130 |
||
1729 | 1131 |
!MIMETypes class methodsFor:'queries-image formats'! |
1132 |
||
1133 |
imageReaderClasses |
|
1134 |
"return a collection of registered image reader classes" |
|
1135 |
||
1136 |
|setOfClasses| |
|
1137 |
||
1138 |
setOfClasses := IdentitySet new. |
|
1139 |
FileSuffixToImageReaderClassMapping notNil ifTrue:[ |
|
1140 |
FileSuffixToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
1141 |
setOfClasses add:cls |
|
1142 |
]. |
|
1143 |
]. |
|
1144 |
TypeToImageReaderClassMapping notNil ifTrue:[ |
|
1145 |
TypeToImageReaderClassMapping keysAndValuesDo:[:suff :cls | |
|
1146 |
setOfClasses add:cls |
|
1147 |
]. |
|
1148 |
]. |
|
1149 |
^ setOfClasses |
|
1150 |
||
1151 |
"Created: / 30.6.1997 / 22:03:42 / cg" |
|
1152 |
"Modified: / 1.8.1998 / 16:59:52 / cg" |
|
1153 |
! |
|
1154 |
||
1155 |
imageReaderForSuffix:aSuffix |
|
1156 |
"given a file suffix, return an approriate image reader class" |
|
1157 |
||
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1158 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1159 |
self initializeImageReaderMappings |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1160 |
]. |
1729 | 1161 |
^ FileSuffixToImageReaderClassMapping at:aSuffix asLowercase ifAbsent:nil |
1162 |
||
1163 |
"Created: / 30.6.1997 / 21:59:11 / cg" |
|
1164 |
"Modified: / 1.8.1998 / 17:01:58 / cg" |
|
1165 |
! |
|
1166 |
||
1167 |
imageReaderForSuffix:aSuffix put:aReaderClass |
|
1168 |
"register an image reader for a file suffix" |
|
1169 |
||
1170 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[ |
|
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1171 |
self initializeImageReaderMappings |
1729 | 1172 |
]. |
1173 |
FileSuffixToImageReaderClassMapping at:aSuffix asLowercase put:aReaderClass |
|
1174 |
||
1175 |
"Created: / 30.6.1997 / 21:59:43 / cg" |
|
1176 |
"Modified: / 1.8.1998 / 17:02:14 / cg" |
|
1177 |
! |
|
1178 |
||
1179 |
imageReaderForType:mimeTypeString |
|
1180 |
"given a mime-type, return an approriate image reader class" |
|
1181 |
||
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1182 |
TypeToImageReaderClassMapping isNil ifTrue:[ |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1183 |
self initializeImageReaderMappings |
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1184 |
]. |
1729 | 1185 |
^ TypeToImageReaderClassMapping at:mimeTypeString asLowercase ifAbsent:nil |
1186 |
||
1187 |
"Created: / 30.6.1997 / 21:56:01 / cg" |
|
1188 |
"Modified: / 1.8.1998 / 17:02:28 / cg" |
|
1189 |
! |
|
1190 |
||
1191 |
imageReaderForType:mimeTypeString put:aReaderClass |
|
1192 |
"register an image reader for a mime-type" |
|
1193 |
||
1194 |
TypeToImageReaderClassMapping isNil ifTrue:[ |
|
2724
8e834e62dbbc
Initialize when querying for image type and not yet initialized
Stefan Vogel <sv@exept.de>
parents:
2710
diff
changeset
|
1195 |
self initializeImageReaderMappings |
1729 | 1196 |
]. |
1197 |
TypeToImageReaderClassMapping at:mimeTypeString asLowercase put:aReaderClass |
|
1198 |
||
1199 |
"Created: / 30.6.1997 / 21:56:11 / cg" |
|
1200 |
"Modified: / 1.8.1998 / 17:02:40 / cg" |
|
1201 |
! ! |
|
1202 |
||
1203 |
!MIMETypes class methodsFor:'queries-language syntax'! |
|
1204 |
||
1205 |
commentStringsForFilename:aFilename |
|
1206 |
"return a useful comment definition; heuristics for now. |
|
1207 |
The returned value is an array of 2 elements; |
|
1208 |
the first is the end-of-line comment string (or nil); |
|
1209 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1210 |
||
1211 |
|mime| |
|
1212 |
||
1213 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
1214 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) |
|
1215 |
||
1216 |
" |
|
1217 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
1218 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
1219 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
1925 | 1220 |
MIMETypes commentStringsForFilename:'Foo.html'. |
1729 | 1221 |
" |
1222 |
! |
|
1223 |
||
1224 |
commentStringsForFilename:aFilename ifUnknown:alternativeBlockReturningCommentString |
|
1225 |
"return a useful comment definition; heuristics for now. |
|
1226 |
The returned value is an array of 2 elements; |
|
1227 |
the first is the end-of-line comment string (or nil); |
|
1228 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1229 |
||
1230 |
|mime| |
|
1231 |
||
1232 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
1233 |
^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix) ifUnknown:alternativeBlockReturningCommentString |
|
1234 |
||
1235 |
" |
|
1236 |
MIMETypes commentStringsForFilename:'Makefile'. |
|
1237 |
MIMETypes commentStringsForFilename:'Object.st'. |
|
1238 |
MIMETypes commentStringsForFilename:'Foo.java'. |
|
1239 |
" |
|
1240 |
! |
|
1241 |
||
1242 |
commentStringsForMimeType:mime suffix:suff |
|
1243 |
"return a useful comment definition; heuristics for now. |
|
1244 |
The returned value is an array of 2 elements; |
|
1245 |
the first is the end-of-line comment string (or nil); |
|
1246 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1247 |
||
1248 |
^ self |
|
1249 |
commentStringsForMimeType:mime suffix:suff |
|
1250 |
ifUnknown: #(';' (nil nil)) |
|
1251 |
||
1252 |
" |
|
1253 |
|mime| |
|
1254 |
||
1255 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
1256 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1257 |
" |
|
1258 |
||
1259 |
" |
|
1260 |
|mime| |
|
1261 |
||
1262 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
1263 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1264 |
" |
|
1265 |
! |
|
1266 |
||
1267 |
commentStringsForMimeType:mime suffix:suff ifUnknown:alternativeBlockReturningCommentString |
|
1268 |
"return a useful comment definition; heuristics for now. |
|
1269 |
The returned value is an array of 2 elements; |
|
1270 |
the first is the end-of-line comment string (or nil); |
|
1271 |
the second an array of opening/closing delimiters (or an array of nils)" |
|
1272 |
||
1273 |
|commentSpec| |
|
1274 |
||
1275 |
commentSpec := TypeToCommentStringMapping at:mime ifAbsent:nil. |
|
1276 |
commentSpec notNil ifTrue:[ |
|
1277 |
^ commentSpec |
|
1278 |
]. |
|
1279 |
||
1280 |
commentSpec := SuffixToCommentStringMapping at:suff ifAbsent:nil. |
|
1281 |
commentSpec notNil ifTrue:[ |
|
1282 |
^ commentSpec |
|
1283 |
]. |
|
1284 |
||
1285 |
^ alternativeBlockReturningCommentString value |
|
1286 |
||
1287 |
" |
|
1288 |
|mime| |
|
1289 |
||
1290 |
mime := MIMETypes mimeTypeForFilename:'Makefile'. |
|
1291 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1292 |
" |
|
1293 |
||
1294 |
" |
|
1295 |
|mime| |
|
1296 |
||
1297 |
mime := MIMETypes mimeTypeForFilename:'Object.st'. |
|
1298 |
MIMETypes commentStringsForMimeType:mime suffix:nil. |
|
1299 |
" |
|
2298 | 1300 |
! |
1301 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1302 |
parenthesisSpecForFilename:aFilename |
2298 | 1303 |
"return a useful parentesis spec; heuristics for now. |
1304 |
The returned value is a dictionary to be used as parentesis spec in an editor" |
|
1305 |
||
1306 |
|mime| |
|
1307 |
||
1308 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1309 |
^ self parenthesisSpecForMimeType:mime suffix:(aFilename asFilename suffix) |
2298 | 1310 |
|
1311 |
" |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1312 |
MIMETypes parenthesisSpecForFilename:'Object.st'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1313 |
MIMETypes parenthesisSpecForFilename:'Foo.java'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1314 |
MIMETypes parenthesisSpecForFilename:'Foo.html'. |
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1315 |
MIMETypes parenthesisSpecForFilename:'Foo.lsp'. |
2298 | 1316 |
" |
1317 |
||
1318 |
"Created: / 10-04-2007 / 15:18:41 / cg" |
|
1319 |
! |
|
1320 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1321 |
parenthesisSpecForFilename:aFilename ifUnknown:alternative |
2298 | 1322 |
|mime| |
1323 |
||
1324 |
mime := MIMETypes mimeTypeForFilename:aFilename. |
|
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1325 |
^ self parenthesisSpecForMimeType:mime suffix:(aFilename asFilename suffix) ifUnknown:alternative |
2298 | 1326 |
|
1327 |
"Created: / 10-04-2007 / 15:26:20 / cg" |
|
1328 |
! |
|
1329 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1330 |
parenthesisSpecForMimeType:mime suffix:suff |
2298 | 1331 |
^ self |
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1332 |
parenthesisSpecForMimeType:mime suffix:suff |
2298 | 1333 |
ifUnknown: nil |
1334 |
||
1335 |
"Created: / 10-04-2007 / 15:19:39 / cg" |
|
1336 |
! |
|
1337 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1338 |
parenthesisSpecForMimeType:mime suffix:suff ifUnknown:alternativeValue |
2298 | 1339 |
|spec| |
1340 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1341 |
spec := TypeToParenthesisSpecMapping at:mime ifAbsent:nil. |
2298 | 1342 |
spec notNil ifTrue:[ |
1343 |
^ spec |
|
1344 |
]. |
|
1345 |
||
2491
831417cc1e5b
Change bas spelling: parentesis to good spellinge parenthesis
Stefan Vogel <sv@exept.de>
parents:
2490
diff
changeset
|
1346 |
spec := SuffixToParenthesisSpecMapping at:suff ifAbsent:nil. |
2298 | 1347 |
spec notNil ifTrue:[ |
1348 |
^ spec |
|
1349 |
]. |
|
1350 |
||
1351 |
^ alternativeValue value |
|
1352 |
||
1353 |
"Created: / 10-04-2007 / 15:20:38 / cg" |
|
1729 | 1354 |
! ! |
1355 |
||
1612 | 1356 |
!MIMETypes::MIMEType class methodsFor:'documentation'! |
1357 |
||
1358 |
documentation |
|
1359 |
" |
|
1864 | 1360 |
like a string, but knows that it represents a mimeType. |
1612 | 1361 |
" |
1362 |
! ! |
|
1363 |
||
1364 |
!MIMETypes::MIMEType class methodsFor:'instance creation'! |
|
1365 |
||
1366 |
fromString:aString |
|
1367 |
|cachedType newType| |
|
1368 |
||
1369 |
aString class == self ifTrue:[^ aString]. |
|
1370 |
||
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1371 |
CachedTypes isNil ifTrue:[ |
3012 | 1372 |
CachedTypes := Dictionary new:100. |
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1373 |
]. |
1612 | 1374 |
cachedType := CachedTypes at:aString ifAbsent:nil. |
1375 |
cachedType notNil ifTrue:[^ cachedType]. |
|
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1376 |
|
1612 | 1377 |
newType := aString copy changeClassTo:self. |
1378 |
CachedTypes at:aString put:newType. |
|
1379 |
^ newType |
|
1380 |
||
1381 |
" |
|
1382 |
self fromString:'text/html' |
|
1383 |
" |
|
3011
f2af94d78383
delay initialization of cachedTypes
Claus Gittinger <cg@exept.de>
parents:
3008
diff
changeset
|
1384 |
|
3012 | 1385 |
"Modified: / 20-07-2012 / 17:36:31 / cg" |
1612 | 1386 |
! ! |
1387 |
||
1388 |
!MIMETypes::MIMEType methodsFor:'queries'! |
|
1389 |
||
1693 | 1390 |
isArchive |
3260 | 1391 |
<resource: #obsolete> |
1392 |
"return true, if I represent an archive type (such as zip or tar)" |
|
1393 |
||
1394 |
^ self isArchiveType |
|
1395 |
! |
|
1396 |
||
1397 |
isArchiveType |
|
1864 | 1398 |
"return true, if I represent an archive type (such as zip or tar)" |
1399 |
||
1612 | 1400 |
|archivTypes| |
1401 |
||
1729 | 1402 |
archivTypes := MIMETypes applicationCompressorsAndArchiveTypeList. |
1612 | 1403 |
archivTypes pairWiseDo:[: ext : type | |
1404 |
self = type ifTrue:[ ^ true]. |
|
1405 |
]. |
|
1406 |
^ false |
|
1407 |
! |
|
1408 |
||
2024 | 1409 |
isBinary |
3260 | 1410 |
<resource: #obsolete> |
1411 |
"return true, if I represent a binary (non-text) type" |
|
1412 |
||
1413 |
^ self isBinaryType |
|
1414 |
! |
|
1415 |
||
1416 |
isBinaryType |
|
2024 | 1417 |
"return true, if I represent a binary (non-text) type" |
1418 |
||
1419 |
^ self isTextType not |
|
1420 |
! |
|
1421 |
||
1612 | 1422 |
isHtml |
3260 | 1423 |
<resource: #obsolete> |
1424 |
"return true, if I represent the html text type" |
|
1425 |
||
1426 |
^ self isHtmlType |
|
1427 |
! |
|
1428 |
||
1429 |
isHtmlType |
|
1864 | 1430 |
"return true, if I represent the html text type" |
1612 | 1431 |
|
1432 |
^ (self = 'text/html') |
|
1433 |
! |
|
1434 |
||
1435 |
isImage |
|
3260 | 1436 |
<resource: #obsolete> |
1437 |
"return true, if I represent an image type (such as gif or jpg)" |
|
1438 |
||
1439 |
^ self isImageType |
|
1440 |
! |
|
1441 |
||
1442 |
isImageType |
|
1864 | 1443 |
"return true, if I represent an image type (such as gif or jpg)" |
1612 | 1444 |
|
1693 | 1445 |
^ (self startsWith:'image/') |
1612 | 1446 |
! |
1447 |
||
1448 |
isPdf |
|
3260 | 1449 |
<resource: #obsolete> |
1450 |
"return true, if I represent the pdf type" |
|
1451 |
||
1452 |
^ self isPdfType |
|
1453 |
! |
|
1454 |
||
1455 |
isPdfType |
|
1864 | 1456 |
"return true, if I represent the pdf type" |
1457 |
||
1612 | 1458 |
^ (self = 'application/pdf') |
1459 |
! |
|
1460 |
||
1461 |
isSmalltalkSource |
|
3260 | 1462 |
<resource: #obsolete> |
1463 |
"return true, if I represent the smalltalk sourcecode type" |
|
1464 |
||
1465 |
^ self isSmalltalkSourceType |
|
1466 |
! |
|
1467 |
||
1468 |
isSmalltalkSourceType |
|
1864 | 1469 |
"return true, if I represent the smalltalk sourcecode type" |
1470 |
||
1612 | 1471 |
^ (self = 'application/x-smalltalk-source') |
1783 | 1472 |
! |
1473 |
||
2024 | 1474 |
isTextType |
1475 |
"return true, if I represent some text type" |
|
1476 |
||
1477 |
^ self startsWith:'text/' |
|
1478 |
! |
|
1479 |
||
1783 | 1480 |
isXml |
3260 | 1481 |
<resource: #obsolete> |
1482 |
"return true, if I represent the xml text type" |
|
1483 |
||
1484 |
^ self isXmlType |
|
1485 |
! |
|
1486 |
||
1487 |
isXmlType |
|
1864 | 1488 |
"return true, if I represent the xml text type" |
1489 |
||
1783 | 1490 |
^ (self = 'text/xml') |
2490 | 1491 |
! |
1492 |
||
1493 |
suffix |
|
1494 |
^ MIMETypes suffixForMimeType:self |
|
1495 |
||
1496 |
" |
|
1497 |
(MIMETypes mimeTypeFromString:'application/x-expecco-testsuite') suffix |
|
1498 |
" |
|
643 | 1499 |
! ! |
1500 |
||
1501 |
!MIMETypes class methodsFor:'documentation'! |
|
1502 |
||
1503 |
version |
|
3295 | 1504 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.132 2014-02-28 15:31:25 cg Exp $' |
2758
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1505 |
! |
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1506 |
|
66e62ceecb67
comment/format in: #defaultCommandForMimeType:
Claus Gittinger <cg@exept.de>
parents:
2724
diff
changeset
|
1507 |
version_CVS |
3295 | 1508 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.132 2014-02-28 15:31:25 cg Exp $' |
643 | 1509 |
! ! |
1666 | 1510 |
|
3104 | 1511 |
|
643 | 1512 |
MIMETypes initialize! |