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