author | Stefan Vogel <sv@exept.de> |
Thu, 20 Jun 1996 00:31:48 +0200 | |
changeset 121 | 0974ee733cf4 |
parent 120 | 3cfc91f3bb3c |
child 123 | a974136fe017 |
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. |
71 | 152 |
arguments notNil ifTrue:[ |
153 |
idx := arguments indexOf:'-display'. |
|
154 |
idx ~~ 0 ifTrue:[ |
|
87 | 155 |
displayVar := arguments at:idx + 1. |
71 | 156 |
]. |
157 |
]. |
|
158 |
displayVar isNil ifTrue:[ |
|
5 | 159 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'. |
160 |
]. |
|
161 |
display := displayVar. |
|
162 |
||
163 |
displayVar notNil ifTrue:[ |
|
8 | 164 |
((displayVar startsWith:':0') |
165 |
or:[(displayVar startsWith:'unix:') |
|
166 |
or:[displayVar startsWith:'shm:']]) ifTrue:[ |
|
167 |
"running on a local display" |
|
7 | 168 |
display := OperatingSystem getHostName. |
5 | 169 |
] ifFalse:[ |
7 | 170 |
(displayVar endsWith:':0') ifTrue:[ |
171 |
display := displayVar copyTo:(displayVar size - 2) |
|
172 |
] ifFalse:[ |
|
173 |
(displayVar endsWith:':0.0') ifTrue:[ |
|
174 |
display := displayVar copyTo:(displayVar size - 4) |
|
175 |
] |
|
176 |
] |
|
5 | 177 |
]. |
178 |
display isNil ifTrue:[ |
|
7 | 179 |
'cannot determine display I am running on' errorPrintNL. |
5 | 180 |
] ifFalse:[ |
23 | 181 |
" |
182 |
if there is a corresponding file d_<displayName>.rc ... |
|
25 | 183 |
thats the one to take. |
23 | 184 |
" |
7 | 185 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc'). |
186 |
s notNil ifTrue:[ |
|
187 |
displayType := display. |
|
188 |
s close. |
|
189 |
]. |
|
8 | 190 |
|
25 | 191 |
" |
192 |
if the X-server gives some info, |
|
193 |
take that as a base |
|
194 |
" |
|
195 |
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
|
196 |
|serverVendor| |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
197 |
serverVendor := Display serverVendor. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
198 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
199 |
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
|
200 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
201 |
displayType := 'xfree' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
202 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
203 |
serverVendor = 'Silicon Graphics' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
204 |
ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
205 |
displayType := 'iris' |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
206 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
207 |
serverVendor = 'International Business Machines' |
25 | 208 |
ifTrue:[ |
209 |
displayType := 'aix' |
|
210 |
]. |
|
211 |
]. |
|
212 |
||
213 |
" |
|
214 |
otherwise ... |
|
215 |
" |
|
7 | 216 |
displayType isNil ifTrue:[ |
23 | 217 |
" |
218 |
just an example - stuff can also be hardwired here ... |
|
219 |
" |
|
7 | 220 |
display notNil ifTrue:[ |
221 |
(display startsWith:'clam') ifTrue:[ |
|
222 |
displayType := 'next' |
|
223 |
]. |
|
224 |
(display startsWith:'porty') ifTrue:[ |
|
225 |
displayType := 'portable' |
|
226 |
]. |
|
227 |
(display startsWith:'blue') ifTrue:[ |
|
228 |
displayType := 'iris' |
|
229 |
]. |
|
230 |
(display startsWith:'sun') ifTrue:[ |
|
231 |
displayType := 'sun' |
|
232 |
]. |
|
233 |
(display startsWith:'hp') ifTrue:[ |
|
234 |
displayType := 'hpux' |
|
235 |
]. |
|
23 | 236 |
" |
237 |
if, in your organization, the display type can |
|
238 |
be deduced from the hostname, |
|
239 |
use something like: |
|
240 |
" |
|
8 | 241 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 242 |
"/ "all those machines at SEL are suns" |
8 | 243 |
"/ displayType := 'sun' |
244 |
"/ ]. |
|
23 | 245 |
"/ (display startsWith:'frxt') ifTrue:[ |
246 |
"/ "all those machines at AEG are xterminals" |
|
247 |
"/ displayType := 'xterminal' |
|
248 |
"/ ]. |
|
249 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
250 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
251 |
"/ displayType := 'linux_olwm' |
|
252 |
"/ ]. |
|
7 | 253 |
]. |
254 |
]. |
|
5 | 255 |
]. |
256 |
||
25 | 257 |
" |
258 |
final fallback: take OperatingSystem if we are running a local |
|
259 |
connection. |
|
26 | 260 |
the used name is one of: |
261 |
d_next.rc |
|
262 |
d_iris.rc |
|
263 |
etc. |
|
25 | 264 |
" |
5 | 265 |
displayType isNil ifTrue:[ |
7 | 266 |
"use type of machine smalltalk is running on as default ..." |
5 | 267 |
|
7 | 268 |
(displayVar startsWith:':0') ifTrue:[ |
269 |
displayType := OperatingSystem getSystemType. |
|
270 |
] ifFalse:[ |
|
271 |
(displayVar startsWith:(OperatingSystem getHostName , ':0')) ifTrue:[ |
|
272 |
displayType := OperatingSystem getSystemType. |
|
273 |
] |
|
274 |
] |
|
5 | 275 |
] |
276 |
]. |
|
277 |
||
278 |
"now, if the above mess found something, we have it in displayType; |
|
279 |
fileIn d_<displayType>.rc" |
|
280 |
||
281 |
displayType notNil ifTrue:[ |
|
282 |
(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
|
283 |
"Default for supportsDeepIcons is false. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
284 |
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
|
285 |
and d_displayType is called. |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
286 |
" |
3cfc91f3bb3c
Set supportsDeepIcons to default value (false), when DisplayType changes
Stefan Vogel <sv@exept.de>
parents:
92
diff
changeset
|
287 |
Display supportsDeepIcons:false. |
84 | 288 |
Smalltalk isStandAloneApp ifFalse:[ |
289 |
('trying display setup d_' , displayType , '.rc ...') errorPrintNL. |
|
290 |
]. |
|
7 | 291 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 292 |
]. |
293 |
Smalltalk at:#'_ImageDisplayName' put:displayType |
|
294 |
] |
|
295 |
! |
|
296 |
||
297 |
"* |
|
121
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
298 |
* 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
|
299 |
* |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
300 |
* 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
|
301 |
* 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
|
302 |
*" |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
303 |
|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
|
304 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
305 |
depthChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
306 |
colorChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
307 |
greyChange := false. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
308 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
309 |
(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
|
310 |
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
|
311 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
312 |
(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
|
313 |
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
|
314 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
315 |
(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
|
316 |
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
|
317 |
]. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
318 |
(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
|
319 |
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
|
320 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
321 |
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
|
322 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
323 |
reconfigure ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
324 |
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
|
325 |
aView notNil ifTrue:[ |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
326 |
aView reinitStyle. |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
327 |
] |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
328 |
]. |
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 |
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
|
333 |
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
|
334 |
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
|
335 |
! |
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
336 |
|
0974ee733cf4
Move display specific stuff from smalltalk(_r).rc to display.rc.
Stefan Vogel <sv@exept.de>
parents:
120
diff
changeset
|
337 |
"* |
5 | 338 |
* set a default style, if not been set by rc-file |
339 |
* this is set according the system we are running on. |
|
340 |
* Notice: normally, the below is not needed, since the style |
|
341 |
* is always set by the d_xxx.rc file. |
|
342 |
* Except, when the d_xxx.rc is not present. |
|
343 |
*" |
|
344 |
|type| |
|
345 |
||
346 |
View defaultStyle isNil ifTrue:[ |
|
347 |
type := OperatingSystem getSystemType. |
|
348 |
type = 'sunos' ifTrue:[ |
|
7 | 349 |
View defaultStyle:#openwin |
5 | 350 |
]. |
351 |
type = 'next' ifTrue:[ |
|
7 | 352 |
View defaultStyle:#next |
5 | 353 |
]. |
354 |
type = 'iris' ifTrue:[ |
|
7 | 355 |
View defaultStyle:#iris |
5 | 356 |
]. |
357 |
type = 'linux' ifTrue:[ |
|
7 | 358 |
View defaultStyle:#iris |
5 | 359 |
]. |
360 |
type = 'hpux' ifTrue:[ |
|
26 | 361 |
View defaultStyle:#'motif' |
23 | 362 |
]. |
363 |
type = 'ultrix' ifTrue:[ |
|
26 | 364 |
View defaultStyle:#'motif_dec2' |
365 |
]. |
|
366 |
type = 'os2' ifTrue:[ |
|
367 |
View defaultStyle:#'os2' |
|
368 |
]. |
|
369 |
(type = 'mswindows' or:[type = 'nt']) ifTrue:[ |
|
370 |
View defaultStyle:#'mswindows' |
|
371 |
]. |
|
372 |
type = 'win95' ifTrue:[ |
|
373 |
View defaultStyle:#'mswindows3' |
|
5 | 374 |
]. |
8 | 375 |
View defaultStyle isNil ifTrue:[ |
376 |
Display hasGreyscales ifTrue:[ |
|
377 |
View defaultStyle:#iris |
|
378 |
] ifFalse:[ |
|
379 |
View defaultStyle:#normal |
|
380 |
] |
|
381 |
]. |
|
23 | 382 |
'no style set in display.rc - default to ' errorPrint. |
383 |
View defaultStyle errorPrintNL |
|
5 | 384 |
] |
385 |
! |