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