author | Claus Gittinger <cg@exept.de> |
Mon, 07 Feb 2000 13:25:14 +0100 | |
changeset 423 | 2cb5f72d1b0e |
parent 417 | d1e57f03fc28 |
child 447 | 426c5de3dcbc |
permissions | -rw-r--r-- |
0 | 1 |
"* |
2 |
* $Header$ |
|
5 | 3 |
* |
399 | 4 |
* MIMEType: application/x-smalltalk-source |
5 |
* |
|
298 | 6 |
* ST/X startup display configuration file: |
209 | 7 |
* |
5 | 8 |
* DONT add site specific things here - use your own d_xxx.rc file instead |
8 | 9 |
* where xxx stands for your displays hostname(s) |
5 | 10 |
* |
11 |
* display related configuration: |
|
298 | 12 |
* first do some common setup, then try to figure out |
13 |
* the kind of display and find a |
|
5 | 14 |
* display specific initialization file. |
0 | 15 |
*" |
16 |
||
17 |
"* |
|
7 | 18 |
* define extensions for image files (i.e. extension-to-readerClass |
19 |
* mappings). Some of the readers are autoloaded (see patches file). |
|
20 |
* Moved this from code to here (from Image-class), for more flexibility |
|
5 | 21 |
* actually since this is not display- but host specific (naming conventions) |
22 |
* it should be moved into the host.rc or h_xxx.rc file |
|
84 | 23 |
* |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
24 |
* Some readers are optional and therefore, only installed if the |
84 | 25 |
* corresponding Smalltalk class is nonNil; not accessing it as global, |
423 | 26 |
* but via a Smalltalk>>at: message - this avoids warning messages |
84 | 27 |
* during startup, if classes are missing and the globals are undefined. |
5 | 28 |
*" |
230 | 29 |
|rdr| |
30 |
||
31 |
MIMETypes notNil ifTrue:[ |
|
32 |
rdr := Smalltalk at:#XBMReader ifAbsent:nil. |
|
33 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
34 |
MIMETypes defineImageType:'image/x-xbitmap' suffix:'xbm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
35 |
MIMETypes defineImageType:nil suffix:'bm' reader:rdr. |
230 | 36 |
]. |
37 |
rdr := Smalltalk at:#TIFFReader ifAbsent:nil. |
|
38 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
39 |
MIMETypes defineImageType:'image/tiff' suffix:'tif' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
40 |
MIMETypes defineImageType:nil suffix:'tiff' reader:rdr. |
230 | 41 |
]. |
42 |
rdr := Smalltalk at:#GIFReader ifAbsent:nil. |
|
43 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
44 |
MIMETypes defineImageType:'image/gif' suffix:'gif' reader:rdr. |
230 | 45 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
46 |
|
230 | 47 |
"/ still to come ... |
48 |
"/ '.img' put:IMGReader. |
|
49 |
"/ '.IMG' put:IMGReader. |
|
50 |
"/ '.mac' put:MacPaintReader. |
|
7 | 51 |
|
230 | 52 |
rdr := Smalltalk at:#SunRasterReader ifAbsent:nil. |
53 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
54 |
MIMETypes defineImageType:nil suffix:'im8' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
55 |
MIMETypes defineImageType:nil suffix:'icon' reader:rdr. |
230 | 56 |
]. |
7 | 57 |
|
230 | 58 |
"/ still to come ... |
59 |
"/ '.g3' put:G3FileReader. |
|
7 | 60 |
|
230 | 61 |
rdr := Smalltalk at:#WindowsIconReader ifAbsent:nil. |
62 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
63 |
MIMETypes defineImageType:'image/x-MS-bmp' suffix:'bmp' reader:rdr. |
338 | 64 |
MIMETypes defineImageType:'image/x-MS-ico' suffix:'ico' reader:rdr. |
230 | 65 |
]. |
7 | 66 |
|
230 | 67 |
rdr := Smalltalk at:#JPEGReader ifAbsent:nil. |
68 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
69 |
MIMETypes defineImageType:'image/jpeg' suffix:'jpg' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
70 |
MIMETypes defineImageType:nil suffix:'jpeg' reader:rdr. |
230 | 71 |
]. |
7 | 72 |
|
230 | 73 |
rdr := Smalltalk at:#PBMReader ifAbsent:nil. |
74 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
75 |
MIMETypes defineImageType:'image/x-portable-pixmap' suffix:'ppm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
76 |
MIMETypes defineImageType:'image/x-portable-bitmap' suffix:'pbm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
77 |
MIMETypes defineImageType:'image/x-portable-graymap' suffix:'pgm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
78 |
MIMETypes defineImageType:'image/x-portable-anymap' suffix:'pnm' reader:rdr. |
230 | 79 |
]. |
7 | 80 |
|
230 | 81 |
rdr := Smalltalk at:#ST80FormReader ifAbsent:nil. |
82 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
83 |
MIMETypes defineImageType:nil suffix:'form' reader:rdr. |
230 | 84 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
85 |
|
230 | 86 |
rdr := Smalltalk at:#FaceReader ifAbsent:nil. |
87 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
88 |
MIMETypes defineImageType:nil suffix:'face' reader:rdr. |
230 | 89 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
90 |
|
230 | 91 |
rdr := Smalltalk at:#XPMReader ifAbsent:nil. |
92 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
93 |
MIMETypes defineImageType:'image/x-xpixmap' suffix:'xpm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
94 |
MIMETypes defineImageType:nil suffix:'pm' reader:rdr. |
230 | 95 |
]. |
7 | 96 |
|
230 | 97 |
rdr := Smalltalk at:#PCXReader ifAbsent:nil. |
98 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
99 |
MIMETypes defineImageType:'image/x-pcx' suffix:'pcx' reader:rdr. |
230 | 100 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
101 |
|
230 | 102 |
rdr := Smalltalk at:#TargaReader ifAbsent:nil. |
103 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
104 |
MIMETypes defineImageType:'image/x-targa' suffix:'tga' reader:rdr. |
230 | 105 |
]. |
14 | 106 |
|
230 | 107 |
rdr := Smalltalk at:#XWDReader ifAbsent:nil. |
108 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
109 |
MIMETypes defineImageType:'image/x-xwindowdump' suffix:'xwd' reader:rdr. |
230 | 110 |
]. |
47 | 111 |
|
230 | 112 |
rdr := Smalltalk at:#BlitImageReader ifAbsent:nil. |
113 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
114 |
MIMETypes defineImageType:nil suffix:'48x48x1' reader:rdr. |
230 | 115 |
]. |
205 | 116 |
|
230 | 117 |
rdr := Smalltalk at:#IrisRGBReader ifAbsent:nil. |
118 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
119 |
MIMETypes defineImageType:'image/x-rgb' suffix:'rgb' reader:rdr. |
230 | 120 |
]. |
205 | 121 |
|
298 | 122 |
"/ experimanetal and not yet finished / delivered |
227 | 123 |
|
230 | 124 |
"/ rdr := Smalltalk at:#PNGReader ifAbsent:nil. |
125 |
"/ rdr notNil ifTrue:[ |
|
126 |
"/ MIMETypes defineImageType:'image/x-png' suffix:'png' reader:rdr. |
|
127 |
"/ ]. |
|
227 | 128 |
|
230 | 129 |
"/ rdr := Smalltalk at:#PCDReader ifAbsent:nil. |
130 |
"/ rdr notNil ifTrue:[ |
|
131 |
"/ MIMETypes defineImageType:'image/x-photo-cd' suffix:'pcd' reader:rdr. |
|
132 |
"/ ]. |
|
227 | 133 |
|
230 | 134 |
"/ rdr := Smalltalk at:#CMURasterReader ifAbsent:nil. |
135 |
"/ rdr notNil ifTrue:[ |
|
136 |
"/ MIMETypes defineImageType:'image/x-cmu-raster' suffix:'ras' reader:rdr. |
|
137 |
"/ ]. |
|
227 | 138 |
|
298 | 139 |
"/ movie formats - experimanetal and not yet complete / finished / delivered |
205 | 140 |
|
230 | 141 |
"/ rdr := Smalltalk at:#FLIReader ifAbsent:nil. |
142 |
"/ rdr notNil ifTrue:[ |
|
143 |
"/ MIMETypes defineImageType:'video/x-fli' suffix:'fli' reader:rdr. |
|
144 |
"/ ]. |
|
205 | 145 |
|
230 | 146 |
"/ rdr := Smalltalk at:#AVIReader ifAbsent:nil. |
147 |
"/ rdr notNil ifTrue:[ |
|
148 |
"/ MIMETypes defineImageType:'video/x-msvideo' suffix:'avi' reader:rdr. |
|
149 |
"/ ]. |
|
227 | 150 |
|
230 | 151 |
"/ rdr := Smalltalk at:#QuickTimeReader ifAbsent:nil. |
152 |
"/ rdr notNil ifTrue:[ |
|
153 |
"/ MIMETypes defineImageType:'video/quicktime' suffix:'qt' reader:rdr. |
|
154 |
"/ MIMETypes defineImageType:nil suffix:'mov' reader:rdr. |
|
155 |
"/ MIMETypes defineImageType:nil suffix:'moov' reader:rdr. |
|
156 |
"/ ]. |
|
227 | 157 |
|
230 | 158 |
"/ rdr := Smalltalk at:#MPEG2Reader ifAbsent:nil. |
159 |
"/ rdr notNil ifTrue:[ |
|
160 |
"/ MIMETypes defineImageType:'video/x-mpeg2' suffix:'mpg2' reader:rdr. |
|
161 |
"/ MIMETypes defineImageType:nil suffix:'mpv2' reader:rdr. |
|
162 |
"/ MIMETypes defineImageType:nil suffix:'mp2v' reader:rdr. |
|
163 |
"/ MIMETypes defineImageType:nil suffix:'mp2' reader:rdr. |
|
164 |
"/ ]. |
|
227 | 165 |
|
230 | 166 |
"/ rdr := Smalltalk at:#MPEGReader ifAbsent:nil. |
167 |
"/ rdr notNil ifTrue:[ |
|
168 |
"/ MIMETypes defineImageType:'video/mpeg' suffix:'mpg' reader:rdr. |
|
169 |
"/ MIMETypes defineImageType:nil suffix:'mpeg' reader:rdr. |
|
170 |
"/ MIMETypes defineImageType:nil suffix:'mpe' reader:rdr. |
|
171 |
"/ MIMETypes defineImageType:nil suffix:'mpv' reader:rdr. |
|
172 |
"/ MIMETypes defineImageType:nil suffix:'vbs' reader:rdr. |
|
173 |
"/ MIMETypes defineImageType:nil suffix:'mpegv' reader:rdr. |
|
174 |
"/ ]. |
|
227 | 175 |
|
230 | 176 |
"/ rdr := Smalltalk at:#SGIMovieReader ifAbsent:nil. |
177 |
"/ rdr notNil ifTrue:[ |
|
178 |
"/ MIMETypes defineImageType:'video/x-sgi-movie' suffix:'movie' reader:rdr. |
|
179 |
"/ ]. |
|
180 |
] |
|
5 | 181 |
! |
182 |
||
183 |
"* |
|
184 |
* find out, on what type of display we run |
|
8 | 185 |
* (boy, they should have added this to the x-protocol) |
5 | 186 |
* |
23 | 187 |
* look for a file named 'd_<displayname>.rc' and file it in |
5 | 188 |
*" |
189 |
||
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
190 |
|displayDevice arguments displayVar display displayType isWindowsDisplay s idx| |
5 | 191 |
|
192 |
"find display name from environment or -display argument" |
|
193 |
||
68 | 194 |
arguments := Smalltalk commandLineArguments. |
126 | 195 |
arguments size > 0 ifTrue:[ |
71 | 196 |
idx := arguments indexOf:'-display'. |
197 |
idx ~~ 0 ifTrue:[ |
|
87 | 198 |
displayVar := arguments at:idx + 1. |
126 | 199 |
arguments removeAtIndex:idx+1. |
200 |
arguments removeAtIndex:idx. |
|
71 | 201 |
]. |
202 |
]. |
|
203 |
displayVar isNil ifTrue:[ |
|
5 | 204 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'. |
205 |
]. |
|
302 | 206 |
|
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
207 |
displayDevice := Screen current. |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
208 |
isWindowsDisplay := (displayDevice platformName = 'WIN32'). |
302 | 209 |
|
5 | 210 |
display := displayVar. |
211 |
||
304 | 212 |
(displayVar notNil or:[isWindowsDisplay]) ifTrue:[ |
302 | 213 |
"/ figure out the hostname of the display, |
214 |
"/ to read d_<hostname>.rc |
|
215 |
||
304 | 216 |
(isWindowsDisplay |
217 |
or:[(displayVar startsWith:':0') |
|
8 | 218 |
or:[(displayVar startsWith:'unix:') |
304 | 219 |
or:[displayVar startsWith:'shm:']]]) ifTrue:[ |
8 | 220 |
"running on a local display" |
7 | 221 |
display := OperatingSystem getHostName. |
5 | 222 |
] ifFalse:[ |
7 | 223 |
(displayVar endsWith:':0') ifTrue:[ |
224 |
display := displayVar copyTo:(displayVar size - 2) |
|
225 |
] ifFalse:[ |
|
226 |
(displayVar endsWith:':0.0') ifTrue:[ |
|
227 |
display := displayVar copyTo:(displayVar size - 4) |
|
228 |
] |
|
229 |
] |
|
5 | 230 |
]. |
302 | 231 |
|
232 |
"/ if no host specific info, |
|
308
6e6d557009c7
dont loose windows keyboard setup after image restart
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
233 |
"/ take the display vendor information, |
302 | 234 |
"/ to read d_<vendor>.rc |
235 |
||
236 |
display isNil ifTrue:[ |
|
237 |
isWindowsDisplay ifTrue:[ |
|
304 | 238 |
display := 'win32' |
302 | 239 |
] |
240 |
]. |
|
241 |
||
5 | 242 |
display isNil ifTrue:[ |
195 | 243 |
'display.rc [warning]: cannot determine display I am running on' errorPrintCR. |
5 | 244 |
] ifFalse:[ |
23 | 245 |
" |
246 |
if there is a corresponding file d_<displayName>.rc ... |
|
25 | 247 |
thats the one to take. |
23 | 248 |
" |
7 | 249 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc'). |
250 |
s notNil ifTrue:[ |
|
251 |
displayType := display. |
|
252 |
s close. |
|
253 |
]. |
|
8 | 254 |
|
25 | 255 |
" |
256 |
if the X-server gives some info, |
|
257 |
take that as a base |
|
258 |
" |
|
259 |
displayType isNil ifTrue:[ |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
260 |
|serverVendor| |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
261 |
serverVendor := displayDevice serverVendor. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
262 |
|
337 | 263 |
(serverVendor startsWith:'The XFree86 Project, Inc') |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
264 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
265 |
displayType := 'xfree' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
266 |
]. |
337 | 267 |
(serverVendor startsWith:'Silicon Graphics') |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
268 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
269 |
displayType := 'iris' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
270 |
]. |
337 | 271 |
(serverVendor startsWith:'International Business Machines') |
25 | 272 |
ifTrue:[ |
273 |
displayType := 'aix' |
|
274 |
]. |
|
337 | 275 |
(serverVendor startsWith:'DECWINDOWS Digital Equipment') |
276 |
ifTrue:[ |
|
277 |
displayType := 'dec' |
|
278 |
]. |
|
350 | 279 |
(serverVendor startsWith:'Hummingbird Communications') |
280 |
ifTrue:[ |
|
281 |
displayType := 'exceed' |
|
282 |
]. |
|
25 | 283 |
]. |
284 |
||
285 |
" |
|
286 |
otherwise ... |
|
287 |
" |
|
7 | 288 |
displayType isNil ifTrue:[ |
23 | 289 |
" |
290 |
just an example - stuff can also be hardwired here ... |
|
291 |
" |
|
7 | 292 |
display notNil ifTrue:[ |
298 | 293 |
" |
294 |
if, in your organization, all displays are of the |
|
295 |
same type, |
|
296 |
use something like: |
|
297 |
" |
|
298 |
"/ OperatingSystem getDomainName = '<yourDomain>.de' ifTrue:[ |
|
299 |
"/ displayType := 'myDisplayType' |
|
300 |
"/ ]. |
|
301 |
||
23 | 302 |
" |
303 |
if, in your organization, the display type can |
|
304 |
be deduced from the hostname, |
|
305 |
use something like: |
|
298 | 306 |
(take the exept code below as a guide ...) |
23 | 307 |
" |
8 | 308 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 309 |
"/ "all those machines at SEL are suns" |
8 | 310 |
"/ displayType := 'sun' |
311 |
"/ ]. |
|
23 | 312 |
"/ (display startsWith:'frxt') ifTrue:[ |
313 |
"/ "all those machines at AEG are xterminals" |
|
314 |
"/ displayType := 'xterminal' |
|
315 |
"/ ]. |
|
316 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
317 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
318 |
"/ displayType := 'linux_olwm' |
|
319 |
"/ ]. |
|
298 | 320 |
|
350 | 321 |
"/ OperatingSystem getDomainName = 'exept.de' ifTrue:[ |
322 |
"/ (display startsWith:'clam') ifTrue:[ |
|
323 |
"/ displayType := 'next' |
|
324 |
"/ ]. |
|
325 |
"/ (display startsWith:'porty') ifTrue:[ |
|
326 |
"/ displayType := 'portable' |
|
327 |
"/ ]. |
|
328 |
"/ (display startsWith:'blue') ifTrue:[ |
|
329 |
"/ displayType := 'iris' |
|
330 |
"/ ]. |
|
331 |
"/ (display startsWith:'sun') ifTrue:[ |
|
332 |
"/ displayType := 'sun' |
|
333 |
"/ ]. |
|
334 |
"/ (display startsWith:'sol') ifTrue:[ |
|
335 |
"/ displayType := 'sun' |
|
336 |
"/ ]. |
|
337 |
"/ (display startsWith:'hp') ifTrue:[ |
|
338 |
"/ displayType := 'hpux' |
|
339 |
"/ ]. |
|
340 |
"/ ]. |
|
7 | 341 |
]. |
342 |
]. |
|
5 | 343 |
]. |
344 |
||
25 | 345 |
" |
346 |
final fallback: take OperatingSystem if we are running a local |
|
347 |
connection. |
|
26 | 348 |
the used name is one of: |
349 |
d_next.rc |
|
350 |
d_iris.rc |
|
351 |
etc. |
|
25 | 352 |
" |
5 | 353 |
displayType isNil ifTrue:[ |
7 | 354 |
"use type of machine smalltalk is running on as default ..." |
5 | 355 |
|
304 | 356 |
(isWindowsDisplay |
305 | 357 |
or:[(displayVar startsWith:':0') |
358 |
or:[(displayVar startsWith:(OperatingSystem getHostName , ':0'))]]) |
|
304 | 359 |
ifTrue:[ |
7 | 360 |
displayType := OperatingSystem getSystemType. |
361 |
] |
|
5 | 362 |
] |
363 |
]. |
|
364 |
||
365 |
"now, if the above mess found something, we have it in displayType; |
|
366 |
fileIn d_<displayType>.rc" |
|
367 |
||
368 |
displayType notNil ifTrue:[ |
|
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
369 |
((Smalltalk at:#'_ImageDisplayName') ~= displayType |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
370 |
or:[displayDevice ~~ Display]) ifTrue:[ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
371 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
372 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
373 |
"/ mouse-button translation |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
374 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
375 |
"/ (currently, allowed are 1 2 and #paste) |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
376 |
"/ 1 - button1; used to select (i.e. left button) |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
377 |
"/ 2 - button2; pops up a menu (i.e. middle button) |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
378 |
"/ #paste - paste the clipBoard contents |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
379 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
380 |
"/ the following line puts paste onto the right button (as in xterm): |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
381 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
382 |
Screen buttonTranslation:#(1 2 #paste). |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
383 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
384 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
385 |
"/ while that one puts the pop-up menu both on the middle and right buttons: |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
386 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
387 |
Screen buttonTranslation:#(1 2 2). |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
388 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
389 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
390 |
"/ lefthanders can use: |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
391 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
392 |
"/ Screen buttonTranslation:#(2 2 1). |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
393 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
394 |
"/ common keyboard setup; |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
395 |
"/ might be changed later by a display-specific |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
396 |
"/ rc file (especially, d_windows does this) |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
397 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
398 |
"/ 'display.rc [info]: reading ''keyboard.rc'' ...' infoPrintCR. |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
399 |
Smalltalk fileIn:'keyboard.rc'. |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
400 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
401 |
|
120
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
402 |
"Default for supportsDeepIcons is false. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
403 |
Set default value only when ImageDisplayName changes |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
404 |
and d_displayType is called. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
405 |
" |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
406 |
displayDevice supportsDeepIcons:false. |
84 | 407 |
Smalltalk isStandAloneApp ifFalse:[ |
333 | 408 |
('display.rc [info]: ') infoPrint. |
409 |
(Smalltalk getSystemFileName:('d_' , displayType , '.rc')) isNil ifTrue:[ |
|
410 |
'trying' infoPrint. |
|
411 |
] ifFalse:[ |
|
412 |
'reading' infoPrint. |
|
413 |
]. |
|
414 |
(' display setup ''d_' , displayType , '.rc'' ...') infoPrintCR. |
|
84 | 415 |
]. |
308
6e6d557009c7
dont loose windows keyboard setup after image restart
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
416 |
|
7 | 417 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 418 |
]. |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
419 |
displayDevice == Display ifTrue:[ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
420 |
Smalltalk at:#'_ImageDisplayName' put:displayType |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
421 |
] |
5 | 422 |
] |
423 |
! |
|
424 |
||
425 |
"* |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
426 |
* now, this is a nice one: |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
427 |
* |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
428 |
* if the image was saved on a different type of display, ask |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
429 |
* user, if he/she'd like to have the style changed. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
430 |
*" |
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
431 |
Display notNil ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
432 |
|depthChange colorChange greyChange reconfigure| |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
433 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
434 |
depthChange := false. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
435 |
colorChange := false. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
436 |
greyChange := false. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
437 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
438 |
(Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
439 |
depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth) |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
440 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
441 |
(Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
442 |
colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors) |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
443 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
444 |
(Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
445 |
greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales) |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
446 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
447 |
(depthChange or:[colorChange or:[greyChange]]) ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
448 |
reconfigure := self confirm:'Display capabilities have changed |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
449 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
450 |
Do you want to reconfigure the view style ?'. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
451 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
452 |
reconfigure ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
453 |
Screen current knownViews do:[:aView | |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
454 |
aView notNil ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
455 |
aView reinitStyle. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
456 |
] |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
457 |
]. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
458 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
459 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
460 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
461 |
Smalltalk at:#'_ImageDisplayDepth' put:Display depth. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
462 |
Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
463 |
Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
464 |
] |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
465 |
! |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
466 |
|
302 | 467 |
"/ |
468 |
"/ set a default style, if not been set by rc-file |
|
469 |
"/ this is set according the system we are running on. |
|
470 |
"/ Notice: normally, the below is not needed, since the style |
|
471 |
"/ is always set by the d_xxx.rc file. |
|
472 |
"/ Except, when the d_xxx.rc is not present. |
|
473 |
"/ |
|
474 |
||
310 | 475 |
|type wm| |
5 | 476 |
|
477 |
View defaultStyle isNil ifTrue:[ |
|
478 |
type := OperatingSystem getSystemType. |
|
479 |
type = 'sunos' ifTrue:[ |
|
7 | 480 |
View defaultStyle:#openwin |
5 | 481 |
]. |
482 |
type = 'next' ifTrue:[ |
|
7 | 483 |
View defaultStyle:#next |
5 | 484 |
]. |
485 |
type = 'iris' ifTrue:[ |
|
7 | 486 |
View defaultStyle:#iris |
5 | 487 |
]. |
350 | 488 |
type = 'exceed' ifTrue:[ |
489 |
View defaultStyle:#mswindows95 |
|
490 |
]. |
|
5 | 491 |
type = 'linux' ifTrue:[ |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
492 |
"/ if on the local display, and WINDOWMANAGER is fvwm95, |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
493 |
"/ use win95 style as default. |
310 | 494 |
wm := OperatingSystem getEnvironment:'WINDOWMANAGER'. |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
495 |
(((OperatingSystem getEnvironment:'DISPLAY') = ':0') |
310 | 496 |
and:[wm notNil |
497 |
and:[wm endsWith:'fvwm95']]) |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
498 |
ifTrue:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
499 |
View defaultStyle:#mswindows95 |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
500 |
] ifFalse:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
501 |
View defaultStyle:#iris |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
502 |
] |
5 | 503 |
]. |
504 |
type = 'hpux' ifTrue:[ |
|
26 | 505 |
View defaultStyle:#'motif' |
23 | 506 |
]. |
507 |
type = 'ultrix' ifTrue:[ |
|
26 | 508 |
View defaultStyle:#'motif_dec2' |
509 |
]. |
|
510 |
type = 'os2' ifTrue:[ |
|
511 |
View defaultStyle:#'os2' |
|
512 |
]. |
|
214 | 513 |
(type = 'win32') ifTrue:[ |
218 | 514 |
(Number readFromString:((OperatingSystem getSystemInfo) at:#release) onError:0) |
214 | 515 |
>= 4.0 ifTrue:[ |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
516 |
View defaultStyle:#'mswindows95' |
214 | 517 |
] ifFalse:[ |
518 |
View defaultStyle:#'mswindows' |
|
519 |
] |
|
26 | 520 |
]. |
298 | 521 |
|
522 |
"/ final fallBack ... |
|
523 |
||
8 | 524 |
View defaultStyle isNil ifTrue:[ |
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
525 |
(Display notNil and:[Display hasGreyscales]) ifTrue:[ |
8 | 526 |
View defaultStyle:#iris |
527 |
] ifFalse:[ |
|
528 |
View defaultStyle:#normal |
|
529 |
] |
|
530 |
]. |
|
195 | 531 |
'display.rc [info]: no style set - default to ' infoPrint. |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
532 |
View defaultStyle infoPrintCR |
5 | 533 |
] |
534 |
! |
|
302 | 535 |