author | Claus Gittinger <cg@exept.de> |
Sat, 25 Apr 1998 22:51:55 +0200 | |
changeset 279 | 289856108844 |
parent 231 | 9d22d1c7b856 |
child 298 | 2e757f2d0232 |
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 |
*" |
230 | 47 |
|rdr| |
48 |
||
49 |
MIMETypes notNil ifTrue:[ |
|
5 | 50 |
|
230 | 51 |
rdr := Smalltalk at:#XBMReader ifAbsent:nil. |
52 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
53 |
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
|
54 |
MIMETypes defineImageType:nil suffix:'bm' reader:rdr. |
230 | 55 |
]. |
56 |
rdr := Smalltalk at:#TIFFReader ifAbsent:nil. |
|
57 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
58 |
MIMETypes defineImageType:'image/tiff' suffix:'tif' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
59 |
MIMETypes defineImageType:nil suffix:'tiff' reader:rdr. |
230 | 60 |
]. |
61 |
rdr := Smalltalk at:#GIFReader 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/gif' suffix:'gif' reader:rdr. |
230 | 64 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
65 |
|
230 | 66 |
"/ still to come ... |
67 |
"/ '.img' put:IMGReader. |
|
68 |
"/ '.IMG' put:IMGReader. |
|
69 |
"/ '.mac' put:MacPaintReader. |
|
7 | 70 |
|
230 | 71 |
rdr := Smalltalk at:#SunRasterReader ifAbsent:nil. |
72 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
73 |
MIMETypes defineImageType:nil suffix:'im8' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
74 |
MIMETypes defineImageType:nil suffix:'icon' reader:rdr. |
230 | 75 |
]. |
7 | 76 |
|
230 | 77 |
"/ still to come ... |
78 |
"/ '.g3' put:G3FileReader. |
|
7 | 79 |
|
230 | 80 |
rdr := Smalltalk at:#WindowsIconReader ifAbsent:nil. |
81 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
82 |
MIMETypes defineImageType:'image/x-MS-bmp' suffix:'bmp' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
83 |
MIMETypes defineImageType:nil suffix:'ico' reader:rdr. |
230 | 84 |
]. |
7 | 85 |
|
230 | 86 |
rdr := Smalltalk at:#JPEGReader 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:'image/jpeg' suffix:'jpg' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
89 |
MIMETypes defineImageType:nil suffix:'jpeg' reader:rdr. |
230 | 90 |
]. |
7 | 91 |
|
230 | 92 |
rdr := Smalltalk at:#PBMReader 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-portable-pixmap' suffix:'ppm' reader:rdr. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
95 |
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
|
96 |
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
|
97 |
MIMETypes defineImageType:'image/x-portable-anymap' suffix:'pnm' reader:rdr. |
230 | 98 |
]. |
7 | 99 |
|
230 | 100 |
rdr := Smalltalk at:#ST80FormReader ifAbsent:nil. |
101 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
102 |
MIMETypes defineImageType:nil suffix:'form' reader:rdr. |
230 | 103 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
104 |
|
230 | 105 |
rdr := Smalltalk at:#FaceReader ifAbsent:nil. |
106 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
107 |
MIMETypes defineImageType:nil suffix:'face' reader:rdr. |
230 | 108 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
109 |
|
230 | 110 |
rdr := Smalltalk at:#XPMReader ifAbsent:nil. |
111 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
112 |
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
|
113 |
MIMETypes defineImageType:nil suffix:'pm' reader:rdr. |
230 | 114 |
]. |
7 | 115 |
|
230 | 116 |
rdr := Smalltalk at:#PCXReader ifAbsent:nil. |
117 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
118 |
MIMETypes defineImageType:'image/x-pcx' suffix:'pcx' reader:rdr. |
230 | 119 |
]. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
120 |
|
230 | 121 |
rdr := Smalltalk at:#TargaReader ifAbsent:nil. |
122 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
123 |
MIMETypes defineImageType:'image/x-targa' suffix:'tga' reader:rdr. |
230 | 124 |
]. |
14 | 125 |
|
230 | 126 |
rdr := Smalltalk at:#XWDReader ifAbsent:nil. |
127 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
128 |
MIMETypes defineImageType:'image/x-xwindowdump' suffix:'xwd' reader:rdr. |
230 | 129 |
]. |
47 | 130 |
|
230 | 131 |
rdr := Smalltalk at:#BlitImageReader ifAbsent:nil. |
132 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
133 |
MIMETypes defineImageType:nil suffix:'48x48x1' reader:rdr. |
230 | 134 |
]. |
205 | 135 |
|
230 | 136 |
rdr := Smalltalk at:#IrisRGBReader ifAbsent:nil. |
137 |
rdr notNil ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
138 |
MIMETypes defineImageType:'image/x-rgb' suffix:'rgb' reader:rdr. |
230 | 139 |
]. |
205 | 140 |
|
230 | 141 |
"/ experimanetal and not yet delivered |
227 | 142 |
|
230 | 143 |
"/ rdr := Smalltalk at:#PNGReader ifAbsent:nil. |
144 |
"/ rdr notNil ifTrue:[ |
|
145 |
"/ MIMETypes defineImageType:'image/x-png' suffix:'png' reader:rdr. |
|
146 |
"/ ]. |
|
227 | 147 |
|
230 | 148 |
"/ rdr := Smalltalk at:#PCDReader ifAbsent:nil. |
149 |
"/ rdr notNil ifTrue:[ |
|
150 |
"/ MIMETypes defineImageType:'image/x-photo-cd' suffix:'pcd' reader:rdr. |
|
151 |
"/ ]. |
|
227 | 152 |
|
230 | 153 |
"/ rdr := Smalltalk at:#CMURasterReader ifAbsent:nil. |
154 |
"/ rdr notNil ifTrue:[ |
|
155 |
"/ MIMETypes defineImageType:'image/x-cmu-raster' suffix:'ras' reader:rdr. |
|
156 |
"/ ]. |
|
227 | 157 |
|
230 | 158 |
"/ movie formats - experimanetal and not yet complete |
205 | 159 |
|
230 | 160 |
"/ rdr := Smalltalk at:#FLIReader ifAbsent:nil. |
161 |
"/ rdr notNil ifTrue:[ |
|
162 |
"/ MIMETypes defineImageType:'video/x-fli' suffix:'fli' reader:rdr. |
|
163 |
"/ ]. |
|
205 | 164 |
|
230 | 165 |
"/ rdr := Smalltalk at:#AVIReader ifAbsent:nil. |
166 |
"/ rdr notNil ifTrue:[ |
|
167 |
"/ MIMETypes defineImageType:'video/x-msvideo' suffix:'avi' reader:rdr. |
|
168 |
"/ ]. |
|
227 | 169 |
|
230 | 170 |
"/ rdr := Smalltalk at:#QuickTimeReader ifAbsent:nil. |
171 |
"/ rdr notNil ifTrue:[ |
|
172 |
"/ MIMETypes defineImageType:'video/quicktime' suffix:'qt' reader:rdr. |
|
173 |
"/ MIMETypes defineImageType:nil suffix:'mov' reader:rdr. |
|
174 |
"/ MIMETypes defineImageType:nil suffix:'moov' reader:rdr. |
|
175 |
"/ ]. |
|
227 | 176 |
|
230 | 177 |
"/ rdr := Smalltalk at:#MPEG2Reader ifAbsent:nil. |
178 |
"/ rdr notNil ifTrue:[ |
|
179 |
"/ MIMETypes defineImageType:'video/x-mpeg2' suffix:'mpg2' reader:rdr. |
|
180 |
"/ MIMETypes defineImageType:nil suffix:'mpv2' reader:rdr. |
|
181 |
"/ MIMETypes defineImageType:nil suffix:'mp2v' reader:rdr. |
|
182 |
"/ MIMETypes defineImageType:nil suffix:'mp2' reader:rdr. |
|
183 |
"/ ]. |
|
227 | 184 |
|
230 | 185 |
"/ rdr := Smalltalk at:#MPEGReader ifAbsent:nil. |
186 |
"/ rdr notNil ifTrue:[ |
|
187 |
"/ MIMETypes defineImageType:'video/mpeg' suffix:'mpg' reader:rdr. |
|
188 |
"/ MIMETypes defineImageType:nil suffix:'mpeg' reader:rdr. |
|
189 |
"/ MIMETypes defineImageType:nil suffix:'mpe' reader:rdr. |
|
190 |
"/ MIMETypes defineImageType:nil suffix:'mpv' reader:rdr. |
|
191 |
"/ MIMETypes defineImageType:nil suffix:'vbs' reader:rdr. |
|
192 |
"/ MIMETypes defineImageType:nil suffix:'mpegv' reader:rdr. |
|
193 |
"/ ]. |
|
227 | 194 |
|
230 | 195 |
"/ rdr := Smalltalk at:#SGIMovieReader ifAbsent:nil. |
196 |
"/ rdr notNil ifTrue:[ |
|
197 |
"/ MIMETypes defineImageType:'video/x-sgi-movie' suffix:'movie' reader:rdr. |
|
198 |
"/ ]. |
|
199 |
] |
|
5 | 200 |
! |
201 |
||
202 |
"* |
|
203 |
* find out, on what type of display we run |
|
8 | 204 |
* (boy, they should have added this to the x-protocol) |
5 | 205 |
* |
23 | 206 |
* look for a file named 'd_<displayname>.rc' and file it in |
5 | 207 |
*" |
208 |
||
68 | 209 |
|arguments displayVar display displayType s idx| |
5 | 210 |
|
211 |
"find display name from environment or -display argument" |
|
212 |
||
68 | 213 |
arguments := Smalltalk commandLineArguments. |
126 | 214 |
arguments size > 0 ifTrue:[ |
71 | 215 |
idx := arguments indexOf:'-display'. |
216 |
idx ~~ 0 ifTrue:[ |
|
87 | 217 |
displayVar := arguments at:idx + 1. |
126 | 218 |
arguments removeAtIndex:idx+1. |
219 |
arguments removeAtIndex:idx. |
|
71 | 220 |
]. |
221 |
]. |
|
222 |
displayVar isNil ifTrue:[ |
|
5 | 223 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'. |
224 |
]. |
|
225 |
display := displayVar. |
|
226 |
||
227 |
displayVar notNil ifTrue:[ |
|
8 | 228 |
((displayVar startsWith:':0') |
229 |
or:[(displayVar startsWith:'unix:') |
|
230 |
or:[displayVar startsWith:'shm:']]) ifTrue:[ |
|
231 |
"running on a local display" |
|
7 | 232 |
display := OperatingSystem getHostName. |
5 | 233 |
] ifFalse:[ |
7 | 234 |
(displayVar endsWith:':0') ifTrue:[ |
235 |
display := displayVar copyTo:(displayVar size - 2) |
|
236 |
] ifFalse:[ |
|
237 |
(displayVar endsWith:':0.0') ifTrue:[ |
|
238 |
display := displayVar copyTo:(displayVar size - 4) |
|
239 |
] |
|
240 |
] |
|
5 | 241 |
]. |
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| |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
261 |
serverVendor := Display serverVendor. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
262 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
263 |
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
|
264 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
265 |
displayType := 'xfree' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
266 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
267 |
serverVendor = 'Silicon Graphics' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
268 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
269 |
displayType := 'iris' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
270 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
271 |
serverVendor = 'International Business Machines' |
25 | 272 |
ifTrue:[ |
273 |
displayType := 'aix' |
|
274 |
]. |
|
275 |
]. |
|
276 |
||
277 |
" |
|
278 |
otherwise ... |
|
279 |
" |
|
7 | 280 |
displayType isNil ifTrue:[ |
23 | 281 |
" |
282 |
just an example - stuff can also be hardwired here ... |
|
283 |
" |
|
7 | 284 |
display notNil ifTrue:[ |
285 |
(display startsWith:'clam') ifTrue:[ |
|
286 |
displayType := 'next' |
|
287 |
]. |
|
288 |
(display startsWith:'porty') ifTrue:[ |
|
289 |
displayType := 'portable' |
|
290 |
]. |
|
291 |
(display startsWith:'blue') ifTrue:[ |
|
292 |
displayType := 'iris' |
|
293 |
]. |
|
294 |
(display startsWith:'sun') ifTrue:[ |
|
295 |
displayType := 'sun' |
|
296 |
]. |
|
297 |
(display startsWith:'hp') ifTrue:[ |
|
298 |
displayType := 'hpux' |
|
299 |
]. |
|
23 | 300 |
" |
301 |
if, in your organization, the display type can |
|
302 |
be deduced from the hostname, |
|
303 |
use something like: |
|
304 |
" |
|
8 | 305 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 306 |
"/ "all those machines at SEL are suns" |
8 | 307 |
"/ displayType := 'sun' |
308 |
"/ ]. |
|
23 | 309 |
"/ (display startsWith:'frxt') ifTrue:[ |
310 |
"/ "all those machines at AEG are xterminals" |
|
311 |
"/ displayType := 'xterminal' |
|
312 |
"/ ]. |
|
313 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
314 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
315 |
"/ displayType := 'linux_olwm' |
|
316 |
"/ ]. |
|
7 | 317 |
]. |
318 |
]. |
|
5 | 319 |
]. |
320 |
||
25 | 321 |
" |
322 |
final fallback: take OperatingSystem if we are running a local |
|
323 |
connection. |
|
26 | 324 |
the used name is one of: |
325 |
d_next.rc |
|
326 |
d_iris.rc |
|
327 |
etc. |
|
25 | 328 |
" |
5 | 329 |
displayType isNil ifTrue:[ |
7 | 330 |
"use type of machine smalltalk is running on as default ..." |
5 | 331 |
|
7 | 332 |
(displayVar startsWith:':0') ifTrue:[ |
333 |
displayType := OperatingSystem getSystemType. |
|
334 |
] ifFalse:[ |
|
335 |
(displayVar startsWith:(OperatingSystem getHostName , ':0')) ifTrue:[ |
|
336 |
displayType := OperatingSystem getSystemType. |
|
337 |
] |
|
338 |
] |
|
5 | 339 |
] |
340 |
]. |
|
341 |
||
342 |
"now, if the above mess found something, we have it in displayType; |
|
343 |
fileIn d_<displayType>.rc" |
|
344 |
||
345 |
displayType notNil ifTrue:[ |
|
346 |
(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
|
347 |
"Default for supportsDeepIcons is false. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
348 |
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
|
349 |
and d_displayType is called. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
350 |
" |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
351 |
Display supportsDeepIcons:false. |
84 | 352 |
Smalltalk isStandAloneApp ifFalse:[ |
195 | 353 |
('display.rc [info]: trying display setup ''d_' , displayType , '.rc'' ...') infoPrintCR. |
84 | 354 |
]. |
7 | 355 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 356 |
]. |
357 |
Smalltalk at:#'_ImageDisplayName' put:displayType |
|
358 |
] |
|
359 |
! |
|
360 |
||
361 |
"* |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
362 |
* 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
|
363 |
* |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
364 |
* 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
|
365 |
* 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
|
366 |
*" |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
367 |
|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
|
368 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
369 |
depthChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
370 |
colorChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
371 |
greyChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
372 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
373 |
(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
|
374 |
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
|
375 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
376 |
(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
|
377 |
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
|
378 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
379 |
(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
|
380 |
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
|
381 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
382 |
(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
|
383 |
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
|
384 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
385 |
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
|
386 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
387 |
reconfigure ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
388 |
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
|
389 |
aView notNil ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
390 |
aView reinitStyle. |
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 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
395 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
396 |
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
|
397 |
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
|
398 |
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
|
399 |
! |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
400 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
401 |
"* |
5 | 402 |
* set a default style, if not been set by rc-file |
403 |
* this is set according the system we are running on. |
|
404 |
* Notice: normally, the below is not needed, since the style |
|
405 |
* is always set by the d_xxx.rc file. |
|
406 |
* Except, when the d_xxx.rc is not present. |
|
407 |
*" |
|
408 |
|type| |
|
409 |
||
410 |
View defaultStyle isNil ifTrue:[ |
|
411 |
type := OperatingSystem getSystemType. |
|
412 |
type = 'sunos' ifTrue:[ |
|
7 | 413 |
View defaultStyle:#openwin |
5 | 414 |
]. |
415 |
type = 'next' ifTrue:[ |
|
7 | 416 |
View defaultStyle:#next |
5 | 417 |
]. |
418 |
type = 'iris' ifTrue:[ |
|
7 | 419 |
View defaultStyle:#iris |
5 | 420 |
]. |
421 |
type = 'linux' ifTrue:[ |
|
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
422 |
"/ 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
|
423 |
"/ use win95 style as default. |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
424 |
(((OperatingSystem getEnvironment:'DISPLAY') = ':0') |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
425 |
and:[((OperatingSystem getEnvironment:'WINDOWMANAGER') endsWith:'fvwm95')]) |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
426 |
ifTrue:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
427 |
View defaultStyle:#mswindows95 |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
428 |
] ifFalse:[ |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
429 |
View defaultStyle:#iris |
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
430 |
] |
5 | 431 |
]. |
432 |
type = 'hpux' ifTrue:[ |
|
26 | 433 |
View defaultStyle:#'motif' |
23 | 434 |
]. |
435 |
type = 'ultrix' ifTrue:[ |
|
26 | 436 |
View defaultStyle:#'motif_dec2' |
437 |
]. |
|
438 |
type = 'os2' ifTrue:[ |
|
439 |
View defaultStyle:#'os2' |
|
440 |
]. |
|
214 | 441 |
(type = 'win32') ifTrue:[ |
218 | 442 |
(Number readFromString:((OperatingSystem getSystemInfo) at:#release) onError:0) |
214 | 443 |
>= 4.0 ifTrue:[ |
279
289856108844
renamed mswindows3.style to mswindows95.style
Claus Gittinger <cg@exept.de>
parents:
231
diff
changeset
|
444 |
View defaultStyle:#'mswindows95' |
214 | 445 |
] ifFalse:[ |
446 |
View defaultStyle:#'mswindows' |
|
447 |
] |
|
26 | 448 |
]. |
8 | 449 |
View defaultStyle isNil ifTrue:[ |
450 |
Display hasGreyscales ifTrue:[ |
|
451 |
View defaultStyle:#iris |
|
452 |
] ifFalse:[ |
|
453 |
View defaultStyle:#normal |
|
454 |
] |
|
455 |
]. |
|
195 | 456 |
'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
|
457 |
View defaultStyle infoPrintCR |
5 | 458 |
] |
459 |
! |