57 !MIMETypes class methodsFor:'initialization'! |
57 !MIMETypes class methodsFor:'initialization'! |
58 |
58 |
59 initialize |
59 initialize |
60 "initialize wellKnown facts" |
60 "initialize wellKnown facts" |
61 |
61 |
62 |t| |
62 |typeToImageReaderClassMapping fileSuffixToTypeMapping |
63 |
63 fileSuffixToImageReaderClassMapping charSetToFontMapping| |
64 (t := TypeToImageReaderClassMapping) isNil ifTrue:[ |
64 |
65 TypeToImageReaderClassMapping := t := Dictionary new |
65 "/ image formats. |
66 ]. |
66 |
67 t at:'image/jpeg' put:JPEGReader. |
67 (typeToImageReaderClassMapping := TypeToImageReaderClassMapping) isNil ifTrue:[ |
68 t at:'image/gif' put:GIFReader. |
68 TypeToImageReaderClassMapping := typeToImageReaderClassMapping := Dictionary new |
69 t at:'image/tiff' put:TIFFReader. |
69 ]. |
70 |
70 typeToImageReaderClassMapping at:'image/jpeg' put:JPEGReader. |
71 (t := FileSuffixToTypeMapping) isNil ifTrue:[ |
71 typeToImageReaderClassMapping at:'image/gif' put:GIFReader. |
72 FileSuffixToTypeMapping := t := Dictionary new |
72 typeToImageReaderClassMapping at:'image/tiff' put:TIFFReader. |
73 ]. |
73 |
74 t at:'jpg' put:'image/jpeg'. |
74 (fileSuffixToTypeMapping := FileSuffixToTypeMapping) isNil ifTrue:[ |
75 t at:'gif' put:'image/gif'. |
75 FileSuffixToTypeMapping := fileSuffixToTypeMapping := Dictionary new |
76 t at:'tif' put:'image/tiff'. |
76 ]. |
77 |
77 fileSuffixToTypeMapping at:'jpg' put:'image/jpeg'. |
78 t at:'htm' put:'text/html'. |
78 fileSuffixToTypeMapping at:'gif' put:'image/gif'. |
79 t at:'html' put:'text/html'. |
79 fileSuffixToTypeMapping at:'tif' put:'image/tiff'. |
80 t at:'ps' put:'application/postscript'. |
80 fileSuffixToTypeMapping at:'xbm' put:'image/x-xbitmap'. |
81 |
81 fileSuffixToTypeMapping at:'xpm' put:'image/x-xpixmap'. |
82 (t := FileSuffixToImageReaderClassMapping) isNil ifTrue:[ |
82 fileSuffixToTypeMapping at:'png' put:'image/x-png'. |
83 FileSuffixToImageReaderClassMapping := t := Dictionary new |
83 fileSuffixToTypeMapping at:'pcd' put:'image/x-photo-cd'. |
84 ]. |
84 fileSuffixToTypeMapping at:'bmp' put:'image/x-MS-bmp'. |
85 t at:'jpg' put:JPEGReader. |
85 fileSuffixToTypeMapping at:'rgb' put:'image/x-rgb'. |
86 t at:'gif' put:GIFReader. |
86 fileSuffixToTypeMapping at:'ppm' put:'image/x-portable-pixmap'. |
87 t at:'tif' put:TIFFReader. |
87 fileSuffixToTypeMapping at:'pgm' put:'image/x-portable-graymap'. |
88 |
88 fileSuffixToTypeMapping at:'pbm' put:'image/x-portable-bitmap'. |
89 (t := CharSetToFontMapping) isNil ifTrue:[ |
89 fileSuffixToTypeMapping at:'pnm' put:'image/x-portable-anymap'. |
90 CharSetToFontMapping := t := Dictionary new |
90 fileSuffixToTypeMapping at:'xwd' put:'image/x-xwindowdump'. |
91 ]. |
91 fileSuffixToTypeMapping at:'ras' put:'image/x-cmu-raster'. |
92 t at:'iso2022-jp' put:'jis*0208*'. |
92 |
93 t at:'x-iso2022-jp' put:'jis*0208*'. |
93 fileSuffixToTypeMapping at:'htm' put:'text/html'. |
94 t at:'x-euc-jp' put:'jis*0208*'. |
94 fileSuffixToTypeMapping at:'html' put:'text/html'. |
95 t at:'x-shift-jis' put:'jis*0208*'. |
95 fileSuffixToTypeMapping at:'ps' put:'application/postscript'. |
96 t at:'x-sjis' put:'jis*0208*'. |
96 fileSuffixToTypeMapping at:'pdf' put:'application/pdf'. |
97 t at:'x-jis7' put:'jis*0208*'. |
97 fileSuffixToTypeMapping at:'rtf' put:'application/rtf'. |
98 t at:'jis7' put:'jis*0208*'. |
98 |
99 t at:'euc' put:'jis*0208*'. |
99 fileSuffixToTypeMapping at:'htm' put:'text/html'. |
100 t at:'euc-jp' put:'jis*0208*'. |
100 fileSuffixToTypeMapping at:'html' put:'text/html'. |
101 t at:'sjis' put:'jis*0208*'. |
101 fileSuffixToTypeMapping at:'txt' put:'text/plain'. |
102 |
102 fileSuffixToTypeMapping at:'text' put:'text/plain'. |
103 t at:'big5' put:'big5*'. |
103 |
104 |
104 fileSuffixToTypeMapping at:'movie' put:'video/x-sgi-movie'. |
105 t at:'gb2312' put:'gb*'. |
105 fileSuffixToTypeMapping at:'avi' put:'video/x-msvideo'. |
106 t at:'hz-gb-2312' put:'gb*'. |
106 fileSuffixToTypeMapping at:'qt' put:'video/quicktime'. |
107 t at:'x-gbk' put:'gb*'. |
107 fileSuffixToTypeMapping at:'mov' put:'video/quicktime'. |
108 |
108 fileSuffixToTypeMapping at:'moov' put:'video/quicktime'. |
109 t at:'iso2022-kr' put:'ksc*'. |
109 fileSuffixToTypeMapping at:'mpv2' put:'video/x-mpeg2'. |
110 t at:'x-euc-kr' put:'ksc*'. |
110 fileSuffixToTypeMapping at:'mpv' put:'video/mpeg'. |
|
111 fileSuffixToTypeMapping at:'mpegv' put:'video/mpeg'. |
|
112 fileSuffixToTypeMapping at:'mpg' put:'video/mpeg'. |
|
113 fileSuffixToTypeMapping at:'mpeg' put:'video/mpeg'. |
|
114 |
|
115 fileSuffixToTypeMapping at:'ra' put:'audio/x-pn-realaudio'. |
|
116 fileSuffixToTypeMapping at:'mpa' put:'audio/x-mpeg'. |
|
117 fileSuffixToTypeMapping at:'mpega' put:'audio/x-mpeg'. |
|
118 fileSuffixToTypeMapping at:'wav' put:'audio/x-wav'. |
|
119 fileSuffixToTypeMapping at:'aif' put:'audio/x-aiff'. |
|
120 fileSuffixToTypeMapping at:'aiff' put:'audio/x-aiff'. |
|
121 fileSuffixToTypeMapping at:'aifc' put:'audio/x-aiff'. |
|
122 fileSuffixToTypeMapping at:'au' put:'audio/basic'. |
|
123 fileSuffixToTypeMapping at:'snd' put:'audio/basic'. |
|
124 |
|
125 (fileSuffixToImageReaderClassMapping := FileSuffixToImageReaderClassMapping) isNil ifTrue:[ |
|
126 FileSuffixToImageReaderClassMapping := fileSuffixToImageReaderClassMapping := Dictionary new |
|
127 ]. |
|
128 fileSuffixToImageReaderClassMapping at:'jpg' put:JPEGReader. |
|
129 fileSuffixToImageReaderClassMapping at:'gif' put:GIFReader. |
|
130 fileSuffixToImageReaderClassMapping at:'tif' put:TIFFReader. |
|
131 |
|
132 "/ misc stuff |
|
133 |
|
134 fileSuffixToTypeMapping at:'st' put:'application/x-smalltalk-source'. |
|
135 fileSuffixToTypeMapping at:'tar' put:'application/x-tar'. |
|
136 fileSuffixToTypeMapping at:'zip' put:'application/x-zip-compressed'. |
|
137 |
|
138 "/ character sets (not really mime stuff, but also placed here) |
|
139 |
|
140 (charSetToFontMapping := CharSetToFontMapping) isNil ifTrue:[ |
|
141 CharSetToFontMapping := charSetToFontMapping := Dictionary new |
|
142 ]. |
|
143 charSetToFontMapping at:'iso2022-jp' put:'jis*0208*'. |
|
144 charSetToFontMapping at:'x-iso2022-jp' put:'jis*0208*'. |
|
145 charSetToFontMapping at:'x-euc-jp' put:'jis*0208*'. |
|
146 charSetToFontMapping at:'x-shift-jis' put:'jis*0208*'. |
|
147 charSetToFontMapping at:'x-sjis' put:'jis*0208*'. |
|
148 charSetToFontMapping at:'x-jis7' put:'jis*0208*'. |
|
149 charSetToFontMapping at:'jis7' put:'jis*0208*'. |
|
150 charSetToFontMapping at:'euc' put:'jis*0208*'. |
|
151 charSetToFontMapping at:'euc-jp' put:'jis*0208*'. |
|
152 charSetToFontMapping at:'sjis' put:'jis*0208*'. |
|
153 |
|
154 charSetToFontMapping at:'big5' put:'big5*'. |
|
155 |
|
156 charSetToFontMapping at:'gb2312' put:'gb*'. |
|
157 charSetToFontMapping at:'hz-gb-2312' put:'gb*'. |
|
158 charSetToFontMapping at:'x-gbk' put:'gb*'. |
|
159 |
|
160 charSetToFontMapping at:'iso2022-kr' put:'ksc*'. |
|
161 charSetToFontMapping at:'x-euc-kr' put:'ksc*'. |
111 |
162 |
112 " |
163 " |
113 self initialize |
164 self initialize |
114 " |
165 " |
115 |
166 |
116 "Modified: 16.7.1997 / 13:52:50 / cg" |
167 "Modified: / 1.8.1998 / 17:28:38 / cg" |
117 ! ! |
168 ! ! |
118 |
169 |
119 !MIMETypes class methodsFor:'accessing'! |
170 !MIMETypes class methodsFor:'accessing'! |
120 |
171 |
121 defineImageType:mimeType suffix:aSuffix reader:aReaderClass |
172 defineImageType:mimeType suffix:aSuffix reader:aReaderClass |