author | Claus Gittinger <cg@exept.de> |
Tue, 23 Oct 2001 22:20:05 +0200 | |
changeset 464 | 80f4507cb842 |
parent 451 | da67a4cc5401 |
child 477 | e94dd1d9b849 |
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| |
451 | 261 |
|
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
262 |
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
|
263 |
|
337 | 264 |
(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
|
265 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
266 |
displayType := 'xfree' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
267 |
]. |
337 | 268 |
(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
|
269 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
270 |
displayType := 'iris' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
271 |
]. |
337 | 272 |
(serverVendor startsWith:'International Business Machines') |
25 | 273 |
ifTrue:[ |
274 |
displayType := 'aix' |
|
275 |
]. |
|
337 | 276 |
(serverVendor startsWith:'DECWINDOWS Digital Equipment') |
277 |
ifTrue:[ |
|
278 |
displayType := 'dec' |
|
279 |
]. |
|
350 | 280 |
(serverVendor startsWith:'Hummingbird Communications') |
281 |
ifTrue:[ |
|
282 |
displayType := 'exceed' |
|
283 |
]. |
|
451 | 284 |
(serverVendor startsWith:'Hewlett-Packard Company') |
285 |
ifTrue:[ |
|
286 |
displayType := 'hpux' |
|
287 |
]. |
|
25 | 288 |
]. |
289 |
||
290 |
" |
|
291 |
otherwise ... |
|
292 |
" |
|
7 | 293 |
displayType isNil ifTrue:[ |
23 | 294 |
" |
295 |
just an example - stuff can also be hardwired here ... |
|
296 |
" |
|
7 | 297 |
display notNil ifTrue:[ |
298 | 298 |
" |
299 |
if, in your organization, all displays are of the |
|
300 |
same type, |
|
301 |
use something like: |
|
302 |
" |
|
303 |
"/ OperatingSystem getDomainName = '<yourDomain>.de' ifTrue:[ |
|
304 |
"/ displayType := 'myDisplayType' |
|
305 |
"/ ]. |
|
306 |
||
23 | 307 |
" |
308 |
if, in your organization, the display type can |
|
309 |
be deduced from the hostname, |
|
310 |
use something like: |
|
298 | 311 |
(take the exept code below as a guide ...) |
23 | 312 |
" |
8 | 313 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 314 |
"/ "all those machines at SEL are suns" |
8 | 315 |
"/ displayType := 'sun' |
316 |
"/ ]. |
|
23 | 317 |
"/ (display startsWith:'frxt') ifTrue:[ |
318 |
"/ "all those machines at AEG are xterminals" |
|
319 |
"/ displayType := 'xterminal' |
|
320 |
"/ ]. |
|
321 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
322 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
323 |
"/ displayType := 'linux_olwm' |
|
324 |
"/ ]. |
|
298 | 325 |
|
350 | 326 |
"/ OperatingSystem getDomainName = 'exept.de' ifTrue:[ |
327 |
"/ (display startsWith:'clam') ifTrue:[ |
|
328 |
"/ displayType := 'next' |
|
329 |
"/ ]. |
|
330 |
"/ (display startsWith:'porty') ifTrue:[ |
|
331 |
"/ displayType := 'portable' |
|
332 |
"/ ]. |
|
333 |
"/ (display startsWith:'blue') ifTrue:[ |
|
334 |
"/ displayType := 'iris' |
|
335 |
"/ ]. |
|
336 |
"/ (display startsWith:'sun') ifTrue:[ |
|
337 |
"/ displayType := 'sun' |
|
338 |
"/ ]. |
|
339 |
"/ (display startsWith:'sol') ifTrue:[ |
|
340 |
"/ displayType := 'sun' |
|
341 |
"/ ]. |
|
342 |
"/ (display startsWith:'hp') ifTrue:[ |
|
343 |
"/ displayType := 'hpux' |
|
344 |
"/ ]. |
|
345 |
"/ ]. |
|
7 | 346 |
]. |
347 |
]. |
|
5 | 348 |
]. |
349 |
||
25 | 350 |
" |
351 |
final fallback: take OperatingSystem if we are running a local |
|
352 |
connection. |
|
26 | 353 |
the used name is one of: |
354 |
d_next.rc |
|
355 |
d_iris.rc |
|
356 |
etc. |
|
25 | 357 |
" |
5 | 358 |
displayType isNil ifTrue:[ |
7 | 359 |
"use type of machine smalltalk is running on as default ..." |
5 | 360 |
|
304 | 361 |
(isWindowsDisplay |
305 | 362 |
or:[(displayVar startsWith:':0') |
363 |
or:[(displayVar startsWith:(OperatingSystem getHostName , ':0'))]]) |
|
304 | 364 |
ifTrue:[ |
7 | 365 |
displayType := OperatingSystem getSystemType. |
366 |
] |
|
5 | 367 |
] |
368 |
]. |
|
369 |
||
370 |
"now, if the above mess found something, we have it in displayType; |
|
371 |
fileIn d_<displayType>.rc" |
|
372 |
||
373 |
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
|
374 |
((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
|
375 |
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
|
376 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
377 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
378 |
"/ 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
|
379 |
"/ |
447 | 380 |
"/ (currently, allowed are 1,2,.. , #paste, #wheelFwd and #wheelBwd) |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
381 |
"/ 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
|
382 |
"/ 2 - button2; pops up a menu (i.e. middle button) |
447 | 383 |
"/ #paste - paste the clipBoard contents |
384 |
"/ #wheelFwd - simulates a mouseWheel forward motion (hp displays) |
|
385 |
"/ #wheelBwd - simulates a mouseWheel backward motion (hp displays) |
|
354
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 |
"/ 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
|
388 |
"/ |
447 | 389 |
"/ Screen buttonTranslation:#(1 2 #paste 4 5 6 7). |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
390 |
|
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 |
"/ 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
|
393 |
"/ |
448 | 394 |
"/ Screen buttonTranslation:#(1 2 2 #wheelFwd #wheelBwd 6 7). |
464 | 395 |
|
448 | 396 |
Screen buttonTranslation:#(1 2 2 4 5 6 7). |
354
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 |
"/ |
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
399 |
"/ 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
|
400 |
"/ |
447 | 401 |
"/ Screen buttonTranslation:#(2 2 1 #wheelFwd #wheelBwd 6 7). |
448 | 402 |
"/ Screen buttonTranslation:#(2 2 1 2 2 2 2). |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
403 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
404 |
"/ 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
|
405 |
"/ 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
|
406 |
"/ 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
|
407 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
408 |
"/ '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
|
409 |
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
|
410 |
|
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
411 |
|
120
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
412 |
"Default for supportsDeepIcons is false. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
413 |
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
|
414 |
and d_displayType is called. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
415 |
" |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
416 |
displayDevice supportsDeepIcons:false. |
84 | 417 |
Smalltalk isStandAloneApp ifFalse:[ |
333 | 418 |
('display.rc [info]: ') infoPrint. |
419 |
(Smalltalk getSystemFileName:('d_' , displayType , '.rc')) isNil ifTrue:[ |
|
420 |
'trying' infoPrint. |
|
421 |
] ifFalse:[ |
|
422 |
'reading' infoPrint. |
|
423 |
]. |
|
424 |
(' display setup ''d_' , displayType , '.rc'' ...') infoPrintCR. |
|
84 | 425 |
]. |
308
6e6d557009c7
dont loose windows keyboard setup after image restart
Claus Gittinger <cg@exept.de>
parents:
305
diff
changeset
|
426 |
|
7 | 427 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 428 |
]. |
354
bfddecfed2d2
only read any of keyboard.rc d_xxxx.rc if the display changed.
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
429 |
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
|
430 |
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
|
431 |
] |
5 | 432 |
] |
433 |
! |
|
434 |
||
435 |
"* |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
436 |
* 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
|
437 |
* |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
438 |
* 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
|
439 |
* 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
|
440 |
*" |
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
441 |
Display notNil ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
442 |
|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
|
443 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
444 |
depthChange := false. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
445 |
colorChange := false. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
446 |
greyChange := false. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
447 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
448 |
(Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
449 |
depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth) |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
450 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
451 |
(Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
452 |
colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors) |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
453 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
454 |
(Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
455 |
greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales) |
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 |
(depthChange or:[colorChange or:[greyChange]]) ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
458 |
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
|
459 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
460 |
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
|
461 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
462 |
reconfigure ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
463 |
Screen current knownViews do:[:aView | |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
464 |
aView notNil ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
465 |
aView reinitStyle. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
466 |
] |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
467 |
]. |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
468 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
469 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
470 |
|
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
471 |
Smalltalk at:#'_ImageDisplayDepth' put:Display depth. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
472 |
Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
473 |
Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
474 |
] |
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
475 |
! |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
476 |
|
302 | 477 |
"/ |
478 |
"/ set a default style, if not been set by rc-file |
|
479 |
"/ this is set according the system we are running on. |
|
480 |
"/ Notice: normally, the below is not needed, since the style |
|
481 |
"/ is always set by the d_xxx.rc file. |
|
482 |
"/ Except, when the d_xxx.rc is not present. |
|
483 |
"/ |
|
484 |
||
310 | 485 |
|type wm| |
5 | 486 |
|
487 |
View defaultStyle isNil ifTrue:[ |
|
488 |
type := OperatingSystem getSystemType. |
|
489 |
type = 'sunos' ifTrue:[ |
|
7 | 490 |
View defaultStyle:#openwin |
5 | 491 |
]. |
492 |
type = 'next' ifTrue:[ |
|
7 | 493 |
View defaultStyle:#next |
5 | 494 |
]. |
495 |
type = 'iris' ifTrue:[ |
|
7 | 496 |
View defaultStyle:#iris |
5 | 497 |
]. |
350 | 498 |
type = 'exceed' ifTrue:[ |
499 |
View defaultStyle:#mswindows95 |
|
500 |
]. |
|
5 | 501 |
type = 'linux' ifTrue:[ |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
502 |
"/ 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
|
503 |
"/ use win95 style as default. |
310 | 504 |
wm := OperatingSystem getEnvironment:'WINDOWMANAGER'. |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
505 |
(((OperatingSystem getEnvironment:'DISPLAY') = ':0') |
310 | 506 |
and:[wm notNil |
507 |
and:[wm endsWith:'fvwm95']]) |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
508 |
ifTrue:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
509 |
View defaultStyle:#mswindows95 |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
510 |
] ifFalse:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
511 |
View defaultStyle:#iris |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
512 |
] |
5 | 513 |
]. |
514 |
type = 'hpux' ifTrue:[ |
|
26 | 515 |
View defaultStyle:#'motif' |
23 | 516 |
]. |
517 |
type = 'ultrix' ifTrue:[ |
|
26 | 518 |
View defaultStyle:#'motif_dec2' |
519 |
]. |
|
520 |
type = 'os2' ifTrue:[ |
|
521 |
View defaultStyle:#'os2' |
|
522 |
]. |
|
214 | 523 |
(type = 'win32') ifTrue:[ |
218 | 524 |
(Number readFromString:((OperatingSystem getSystemInfo) at:#release) onError:0) |
214 | 525 |
>= 4.0 ifTrue:[ |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
526 |
View defaultStyle:#'mswindows95' |
214 | 527 |
] ifFalse:[ |
528 |
View defaultStyle:#'mswindows' |
|
529 |
] |
|
26 | 530 |
]. |
298 | 531 |
|
532 |
"/ final fallBack ... |
|
533 |
||
8 | 534 |
View defaultStyle isNil ifTrue:[ |
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
354
diff
changeset
|
535 |
(Display notNil and:[Display hasGreyscales]) ifTrue:[ |
8 | 536 |
View defaultStyle:#iris |
537 |
] ifFalse:[ |
|
538 |
View defaultStyle:#normal |
|
539 |
] |
|
540 |
]. |
|
195 | 541 |
'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
|
542 |
View defaultStyle infoPrintCR |
5 | 543 |
] |
544 |
! |
|
302 | 545 |