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