author | Claus Gittinger <cg@exept.de> |
Fri, 19 Jul 1996 11:27:20 +0200 | |
changeset 126 | 565643e43074 |
parent 123 | a974136fe017 |
child 195 | 1cf850844da9 |
permissions | -rw-r--r-- |
0 | 1 |
"* |
2 |
* $Header$ |
|
5 | 3 |
* |
4 |
* DONT add site specific things here - use your own d_xxx.rc file instead |
|
8 | 5 |
* where xxx stands for your displays hostname(s) |
5 | 6 |
* |
7 |
* display related configuration: |
|
8 |
* first do some common setup, then try to find a |
|
9 |
* display specific initialization file. |
|
0 | 10 |
*" |
11 |
||
12 |
"* |
|
5 | 13 |
* mouse-button translation |
14 |
* |
|
15 |
* (allowed are #select #menu and #paste) |
|
16 |
* |
|
17 |
* the following line puts paste onto the right button (as in xterm): |
|
18 |
*" |
|
25 | 19 |
"/ Screen buttonTranslation:#(select #menu #paste). |
5 | 20 |
|
21 |
"* |
|
22 |
* while that one puts the pop-up menu both on the middle and right buttons: |
|
23 |
*" |
|
25 | 24 |
"/ Screen buttonTranslation:#(select #menu #menu). |
25 |
Screen buttonTranslation:#(1 2 2). |
|
7 | 26 |
|
27 |
"* |
|
28 |
* lefthanders can use: |
|
29 |
*" |
|
25 | 30 |
"/ Screen buttonTranslation:#(#menu #menu #select). |
5 | 31 |
! |
32 |
||
33 |
"* |
|
7 | 34 |
* define extensions for image files (i.e. extension-to-readerClass |
35 |
* mappings). Some of the readers are autoloaded (see patches file). |
|
36 |
* Moved this from code to here (from Image-class), for more flexibility |
|
5 | 37 |
* actually since this is not display- but host specific (naming conventions) |
38 |
* it should be moved into the host.rc or h_xxx.rc file |
|
84 | 39 |
* |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
40 |
* Some readers are optional and therefore, only installed if the |
84 | 41 |
* corresponding Smalltalk class is nonNil; not accessing it as global, |
42 |
* but via a SMalltalk>>at: message - this avoids warning messages |
|
43 |
* during startup, if classes are missing and the globals are undefined. |
|
5 | 44 |
*" |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
45 |
|formats rdr| |
5 | 46 |
|
47 |
formats := Image fileFormats. |
|
84 | 48 |
rdr := Smalltalk at:#XBMReader ifAbsent:nil. |
49 |
rdr notNil ifTrue:[ |
|
50 |
formats at:'.xbm' put:rdr. |
|
51 |
formats at:'.bm' put:rdr. |
|
52 |
]. |
|
53 |
rdr := Smalltalk at:#TIFFReader ifAbsent:nil. |
|
54 |
rdr notNil ifTrue:[ |
|
55 |
formats at:'.tiff' put:rdr. |
|
56 |
formats at:'.tif' put:rdr. |
|
57 |
formats at:'.TIF' put:rdr. |
|
58 |
]. |
|
59 |
rdr := Smalltalk at:#GIFReader ifAbsent:nil. |
|
60 |
rdr notNil ifTrue:[ |
|
61 |
formats at:'.gif' put:rdr. |
|
62 |
formats at:'.GIF' put:rdr. |
|
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:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
72 |
formats at:'.im8' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
73 |
formats at:'.icon' put:rdr. |
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:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
81 |
formats at:'.bmp' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
82 |
formats at:'.ico' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
83 |
formats at:'.BMP' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
84 |
formats at:'.ICO' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
85 |
]. |
7 | 86 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
87 |
rdr := Smalltalk at:#JPEGReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
88 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
89 |
formats at:'.JPG' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
90 |
formats at:'.jpg' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
91 |
formats at:'.jpeg' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
92 |
]. |
7 | 93 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
94 |
rdr := Smalltalk at:#PBMReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
95 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
96 |
formats at:'.ppm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
97 |
formats at:'.pbm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
98 |
formats at:'.pgm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
99 |
]. |
7 | 100 |
|
84 | 101 |
rdr := Smalltalk at:#ST80FormReader ifAbsent:nil. |
102 |
rdr notNil ifTrue:[ |
|
103 |
formats at:'.form' put:rdr. |
|
104 |
]. |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
105 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
106 |
rdr := Smalltalk at:#FaceReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
107 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
108 |
formats at:'.face' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
109 |
]. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
110 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
111 |
rdr := Smalltalk at:#XPMReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
112 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
113 |
formats at:'.pm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
114 |
formats at:'.xpm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
115 |
]. |
7 | 116 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
117 |
rdr := Smalltalk at:#PCXReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
118 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
119 |
formats at:'.pcx' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
120 |
formats at:'.PCX' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
121 |
]. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
122 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
123 |
rdr := Smalltalk at:#TargaReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
124 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
125 |
formats at:'.tga' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
126 |
formats at:'.TGA' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
127 |
]. |
14 | 128 |
|
84 | 129 |
rdr := Smalltalk at:#XWDReader ifAbsent:nil. |
130 |
rdr notNil ifTrue:[ |
|
131 |
formats at:'.xwd' put:rdr. |
|
132 |
]. |
|
47 | 133 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
134 |
rdr := Smalltalk at:#BlitImageReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
135 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
136 |
formats at:'48x48x1' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
137 |
] |
5 | 138 |
! |
139 |
||
140 |
"* |
|
141 |
* find out, on what type of display we run |
|
8 | 142 |
* (boy, they should have added this to the x-protocol) |
5 | 143 |
* |
23 | 144 |
* look for a file named 'd_<displayname>.rc' and file it in |
5 | 145 |
*" |
146 |
||
68 | 147 |
|arguments displayVar display displayType s idx| |
5 | 148 |
|
149 |
"find display name from environment or -display argument" |
|
150 |
||
68 | 151 |
arguments := Smalltalk commandLineArguments. |
126 | 152 |
arguments size > 0 ifTrue:[ |
71 | 153 |
idx := arguments indexOf:'-display'. |
154 |
idx ~~ 0 ifTrue:[ |
|
87 | 155 |
displayVar := arguments at:idx + 1. |
126 | 156 |
arguments removeAtIndex:idx+1. |
157 |
arguments removeAtIndex:idx. |
|
71 | 158 |
]. |
159 |
]. |
|
160 |
displayVar isNil ifTrue:[ |
|
5 | 161 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'. |
162 |
]. |
|
163 |
display := displayVar. |
|
164 |
||
165 |
displayVar notNil ifTrue:[ |
|
8 | 166 |
((displayVar startsWith:':0') |
167 |
or:[(displayVar startsWith:'unix:') |
|
168 |
or:[displayVar startsWith:'shm:']]) ifTrue:[ |
|
169 |
"running on a local display" |
|
7 | 170 |
display := OperatingSystem getHostName. |
5 | 171 |
] ifFalse:[ |
7 | 172 |
(displayVar endsWith:':0') ifTrue:[ |
173 |
display := displayVar copyTo:(displayVar size - 2) |
|
174 |
] ifFalse:[ |
|
175 |
(displayVar endsWith:':0.0') ifTrue:[ |
|
176 |
display := displayVar copyTo:(displayVar size - 4) |
|
177 |
] |
|
178 |
] |
|
5 | 179 |
]. |
180 |
display isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
181 |
'cannot determine display I am running on' errorPrintCR. |
5 | 182 |
] ifFalse:[ |
23 | 183 |
" |
184 |
if there is a corresponding file d_<displayName>.rc ... |
|
25 | 185 |
thats the one to take. |
23 | 186 |
" |
7 | 187 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc'). |
188 |
s notNil ifTrue:[ |
|
189 |
displayType := display. |
|
190 |
s close. |
|
191 |
]. |
|
8 | 192 |
|
25 | 193 |
" |
194 |
if the X-server gives some info, |
|
195 |
take that as a base |
|
196 |
" |
|
197 |
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
|
198 |
|serverVendor| |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
199 |
serverVendor := Display serverVendor. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
200 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
201 |
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
|
202 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
203 |
displayType := 'xfree' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
204 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
205 |
serverVendor = 'Silicon Graphics' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
206 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
207 |
displayType := 'iris' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
208 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
209 |
serverVendor = 'International Business Machines' |
25 | 210 |
ifTrue:[ |
211 |
displayType := 'aix' |
|
212 |
]. |
|
213 |
]. |
|
214 |
||
215 |
" |
|
216 |
otherwise ... |
|
217 |
" |
|
7 | 218 |
displayType isNil ifTrue:[ |
23 | 219 |
" |
220 |
just an example - stuff can also be hardwired here ... |
|
221 |
" |
|
7 | 222 |
display notNil ifTrue:[ |
223 |
(display startsWith:'clam') ifTrue:[ |
|
224 |
displayType := 'next' |
|
225 |
]. |
|
226 |
(display startsWith:'porty') ifTrue:[ |
|
227 |
displayType := 'portable' |
|
228 |
]. |
|
229 |
(display startsWith:'blue') ifTrue:[ |
|
230 |
displayType := 'iris' |
|
231 |
]. |
|
232 |
(display startsWith:'sun') ifTrue:[ |
|
233 |
displayType := 'sun' |
|
234 |
]. |
|
235 |
(display startsWith:'hp') ifTrue:[ |
|
236 |
displayType := 'hpux' |
|
237 |
]. |
|
23 | 238 |
" |
239 |
if, in your organization, the display type can |
|
240 |
be deduced from the hostname, |
|
241 |
use something like: |
|
242 |
" |
|
8 | 243 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 244 |
"/ "all those machines at SEL are suns" |
8 | 245 |
"/ displayType := 'sun' |
246 |
"/ ]. |
|
23 | 247 |
"/ (display startsWith:'frxt') ifTrue:[ |
248 |
"/ "all those machines at AEG are xterminals" |
|
249 |
"/ displayType := 'xterminal' |
|
250 |
"/ ]. |
|
251 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
252 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
253 |
"/ displayType := 'linux_olwm' |
|
254 |
"/ ]. |
|
7 | 255 |
]. |
256 |
]. |
|
5 | 257 |
]. |
258 |
||
25 | 259 |
" |
260 |
final fallback: take OperatingSystem if we are running a local |
|
261 |
connection. |
|
26 | 262 |
the used name is one of: |
263 |
d_next.rc |
|
264 |
d_iris.rc |
|
265 |
etc. |
|
25 | 266 |
" |
5 | 267 |
displayType isNil ifTrue:[ |
7 | 268 |
"use type of machine smalltalk is running on as default ..." |
5 | 269 |
|
7 | 270 |
(displayVar startsWith:':0') ifTrue:[ |
271 |
displayType := OperatingSystem getSystemType. |
|
272 |
] ifFalse:[ |
|
273 |
(displayVar startsWith:(OperatingSystem getHostName , ':0')) ifTrue:[ |
|
274 |
displayType := OperatingSystem getSystemType. |
|
275 |
] |
|
276 |
] |
|
5 | 277 |
] |
278 |
]. |
|
279 |
||
280 |
"now, if the above mess found something, we have it in displayType; |
|
281 |
fileIn d_<displayType>.rc" |
|
282 |
||
283 |
displayType notNil ifTrue:[ |
|
284 |
(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
|
285 |
"Default for supportsDeepIcons is false. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
286 |
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
|
287 |
and d_displayType is called. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
288 |
" |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
289 |
Display supportsDeepIcons:false. |
84 | 290 |
Smalltalk isStandAloneApp ifFalse:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
291 |
('trying display setup d_' , displayType , '.rc ...') infoPrintCR. |
84 | 292 |
]. |
7 | 293 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 294 |
]. |
295 |
Smalltalk at:#'_ImageDisplayName' put:displayType |
|
296 |
] |
|
297 |
! |
|
298 |
||
299 |
"* |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
300 |
* 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
|
301 |
* |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
302 |
* 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
|
303 |
* 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
|
304 |
*" |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
305 |
|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
|
306 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
307 |
depthChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
308 |
colorChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
309 |
greyChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
310 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
311 |
(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
|
312 |
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
|
313 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
314 |
(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
|
315 |
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
|
316 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
317 |
(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
|
318 |
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
|
319 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
320 |
(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
|
321 |
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
|
322 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
323 |
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
|
324 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
325 |
reconfigure ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
326 |
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
|
327 |
aView notNil ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
328 |
aView reinitStyle. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
329 |
] |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
330 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
331 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
332 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
333 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
334 |
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
|
335 |
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
|
336 |
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
|
337 |
! |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
338 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
339 |
"* |
5 | 340 |
* set a default style, if not been set by rc-file |
341 |
* this is set according the system we are running on. |
|
342 |
* Notice: normally, the below is not needed, since the style |
|
343 |
* is always set by the d_xxx.rc file. |
|
344 |
* Except, when the d_xxx.rc is not present. |
|
345 |
*" |
|
346 |
|type| |
|
347 |
||
348 |
View defaultStyle isNil ifTrue:[ |
|
349 |
type := OperatingSystem getSystemType. |
|
350 |
type = 'sunos' ifTrue:[ |
|
7 | 351 |
View defaultStyle:#openwin |
5 | 352 |
]. |
353 |
type = 'next' ifTrue:[ |
|
7 | 354 |
View defaultStyle:#next |
5 | 355 |
]. |
356 |
type = 'iris' ifTrue:[ |
|
7 | 357 |
View defaultStyle:#iris |
5 | 358 |
]. |
359 |
type = 'linux' ifTrue:[ |
|
7 | 360 |
View defaultStyle:#iris |
5 | 361 |
]. |
362 |
type = 'hpux' ifTrue:[ |
|
26 | 363 |
View defaultStyle:#'motif' |
23 | 364 |
]. |
365 |
type = 'ultrix' ifTrue:[ |
|
26 | 366 |
View defaultStyle:#'motif_dec2' |
367 |
]. |
|
368 |
type = 'os2' ifTrue:[ |
|
369 |
View defaultStyle:#'os2' |
|
370 |
]. |
|
371 |
(type = 'mswindows' or:[type = 'nt']) ifTrue:[ |
|
372 |
View defaultStyle:#'mswindows' |
|
373 |
]. |
|
374 |
type = 'win95' ifTrue:[ |
|
375 |
View defaultStyle:#'mswindows3' |
|
5 | 376 |
]. |
8 | 377 |
View defaultStyle isNil ifTrue:[ |
378 |
Display hasGreyscales ifTrue:[ |
|
379 |
View defaultStyle:#iris |
|
380 |
] ifFalse:[ |
|
381 |
View defaultStyle:#normal |
|
382 |
] |
|
383 |
]. |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
384 |
'no style set in display.rc - default to ' infoPrint. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
385 |
View defaultStyle infoPrintCR |
5 | 386 |
] |
387 |
! |