author | Claus Gittinger <cg@exept.de> |
Thu, 16 Nov 1995 18:00:31 +0100 | |
changeset 48 | 892180489f28 |
parent 47 | b0b5d02a07ac |
child 68 | 8c5ca6e3fda4 |
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 |
"* |
|
13 |
* key bindings common to all display types |
|
5 | 14 |
* use event monitor, to see what the Xserver sends us; |
15 |
* put display-specific stuff into a d_hostName.rc file. |
|
0 | 16 |
*" |
17 |
|map| |
|
18 |
||
19 |
map := Display keyboardMap. |
|
20 |
||
25 | 21 |
map bindValue:#UserInterrupt to:#Ctrlc. "interrupt window process" |
26 | 22 |
map bindValue:#FlushInput to:#CtrlX. "flush typeahead input" |
25 | 23 |
map bindValue:#DestroyView to:#CmdCtrlX. "to destroy dead views" |
24 |
map bindValue:#DestroyTopView to:#CmdCtrlx. "to destroy dead views" |
|
10 | 25 |
|
25 | 26 |
map bindValue:#DoIt to:#Cmdd. "i.e. Cmd-d / Alt-d (sometimes Meta-d)" |
27 |
map bindValue:#InspectIt to:#Cmdi. "evaluate & inspect result" |
|
28 |
map bindValue:#PrintIt to:#Cmdp. "evaluate and paste result" |
|
3 | 29 |
|
25 | 30 |
map bindValue:#Copy to:#Cmdc. "copy selection to buffer" |
31 |
map bindValue:#Cut to:#Cmdx. "cut selection into buffer" |
|
32 |
map bindValue:#Paste to:#Cmdv. "paste buffer or external selection" |
|
33 |
map bindValue:#Replace to:#Cmdr. "same as paste" |
|
34 |
map bindValue:#Find to:#Cmds. "open searchbox" |
|
35 |
map bindValue:#FindNext to:#Cmdf. "search fwd for last searchpattern or selection" |
|
36 |
map bindValue:#FindPrev to:#Cmdb. "search bwd for last searchpattern or selection" |
|
37 |
map bindValue:#SelectAll to:#CmdA. "that is Alt-shift-a" |
|
7 | 38 |
map bindValue:#GotoLine to:#Cmdg. |
25 | 39 |
map bindValue:#SelectWord to:#Cmdw. "select word under cursor" |
1 | 40 |
|
7 | 41 |
map bindValue:#Accept to:#Cmda. |
42 |
map bindValue:#Explain to:#Cmde. |
|
43 |
map bindValue:#Explain to:#Cmdh. |
|
1 | 44 |
|
26 | 45 |
map bindValue:#DeleteLine to:#Ctrlx. |
24 | 46 |
|
47 |
map bindValue:#NextPage to:#Next. "typically labelled PageDown on keyboard" |
|
48 |
map bindValue:#PreviousPage to:#Prior. "typically labelled PageUp on keyboard" |
|
49 |
||
50 |
map bindValue:#PreviousPage to:#Ctrlb. "vi behavior" |
|
51 |
map bindValue:#NextPage to:#Ctrlf. "vi behavior" |
|
52 |
map bindValue:#HalfPageUp to:#Ctrlu. |
|
53 |
map bindValue:#HalfPageDown to:#Ctrld. |
|
1 | 54 |
|
25 | 55 |
map bindValue:#BeginOfText to:#Home. "some prefer to bind #BeginOfLine to #Home" |
56 |
map bindValue:#EndOfText to:#End. "some prefer to bind #EndOfLine to #End" |
|
24 | 57 |
map bindValue:#BeginOfLine to:#Ctrla. |
58 |
map bindValue:#EndOfLine to:#Ctrle. |
|
59 |
map bindValue:#NextWord to:#Ctrlw. |
|
10 | 60 |
|
24 | 61 |
map bindValue:#ScrollUp to:#CtrlCursorUp. |
62 |
map bindValue:#ScrollDown to:#CtrlCursorDown. |
|
63 |
||
64 |
map bindValue:#SearchMatchingParent to:#Ctrlm. |
|
3 | 65 |
map bindValue:#SelectMatchingParents to:#Cmdm. |
0 | 66 |
|
25 | 67 |
map bindValue:#SelectToEnd to:#CtrlE. "that is ctrl-shift-e" |
68 |
map bindValue:#SelectFromBeginning to:#CtrlA. "that is ctrl-shift-a" |
|
69 |
map bindValue:#ExpandSelectionByLine to:#Ctrll. "try multiple Ctrl-l's ..." |
|
70 |
||
2 | 71 |
|
10 | 72 |
"Notice: |
73 |
Cmd-CursorLeft/Right and Alt-CursorLeft/Right |
|
26 | 74 |
are also used by some winmdowmanagers (fvwm) |
10 | 75 |
if this is the case on your system, either |
76 |
change the following to use different keys, |
|
26 | 77 |
or change the windowmanagers configuration file |
78 |
(usr/lib/X11/xxxwm/*rc). |
|
79 |
The above is the reason that the following defines Ctrl-xxx |
|
80 |
as an alternative (mwm in the INDY also uses the alt-sequences) |
|
10 | 81 |
" |
82 |
map bindValue:#FocusNext to:#CmdCursorRight. "experimental" |
|
83 |
map bindValue:#FocusPrevious to:#CmdCursorLeft. "experimental" |
|
84 |
map bindValue:#FocusNext to:#CtrlCursorRight. "experimental" |
|
85 |
map bindValue:#FocusPrevious to:#CtrlCursorLeft. "experimental" |
|
86 |
||
20 | 87 |
"/ cannot do this: otherwise tab character is lost ... |
88 |
"/ map bindValue:#FilenameCompletion to:#Tab. |
|
10 | 89 |
|
5 | 90 |
" |
91 |
* on some german keyboards, the x-server does NOT correctly |
|
92 |
* xlate characters .... |
|
93 |
*" |
|
94 |
" |
|
95 |
map bindValue:$[ to:#'Alt['. |
|
96 |
map bindValue:$] to:#'Alt]'. |
|
97 |
map bindValue:${ to:#'Alt{'. |
|
98 |
map bindValue:$} to:#'Alt}'. |
|
99 |
map bindValue:$\ to:#'Alt\'. |
|
100 |
map bindValue:$| to:#'Alt|'. |
|
101 |
" |
|
102 |
||
0 | 103 |
"* |
104 |
* international characters - map to iso8859 values |
|
105 |
*" |
|
106 |
map bindValue:(Character value:16rFC) to:#udiaeresis. |
|
107 |
map bindValue:(Character value:16rE4) to:#adiaeresis. |
|
108 |
map bindValue:(Character value:16rF6) to:#odiaeresis. |
|
109 |
map bindValue:(Character value:16rDC) to:#Udiaeresis. |
|
110 |
map bindValue:(Character value:16rC4) to:#Adiaeresis. |
|
111 |
map bindValue:(Character value:16rD6) to:#Odiaeresis. |
|
112 |
map bindValue:(Character value:16rDF) to:#ssharp. |
|
113 |
||
114 |
"* |
|
115 |
* need more here (french ...) |
|
116 |
*" |
|
117 |
||
118 |
"* |
|
26 | 119 |
* misc characters (if your keyboard supports them) |
0 | 120 |
*" |
121 |
map bindValue:(Character value:16rA7) to:#section. |
|
122 |
map bindValue:(Character value:16rB0) to:#degree. |
|
123 |
map bindValue:(Character value:16rB2) to:#twosuperior. |
|
124 |
map bindValue:(Character value:16rB3) to:#threesuperior. |
|
125 |
map bindValue:(Character value:16rB5) to:#mu. |
|
10 | 126 |
|
0 | 127 |
|
128 |
"* |
|
26 | 129 |
* numeric keypad - binding to normal numeric keys |
130 |
*" |
|
131 |
"/ map bindValue:$0 to:#'KP_Insert'. |
|
132 |
"/ map bindValue:$1 to:#'KP_End'. |
|
133 |
"/ map bindValue:$2 to:#'KP_Down'. |
|
134 |
"/ map bindValue:$3 to:#'KP_Next'. |
|
135 |
"/ map bindValue:$4 to:#'KP_Left'. |
|
136 |
"/ map bindValue:$5 to:#'KP_Begin'. |
|
137 |
"/ map bindValue:$6 to:#'KP_Right'. |
|
138 |
"/ map bindValue:$7 to:#'KP_Home'. |
|
139 |
"/ map bindValue:$8 to:#'KP_Up'. |
|
140 |
"/ map bindValue:$9 to:#'KP_Prior'. |
|
141 |
"/ map bindValue:#Retrun to:#'KP_Enter'. |
|
142 |
"/ map bindValue:#Backspace to:#'KP_Delete'. |
|
143 |
||
144 |
||
145 |
"* |
|
5 | 146 |
* mouse-button translation |
147 |
* |
|
148 |
* (allowed are #select #menu and #paste) |
|
149 |
* |
|
150 |
* the following line puts paste onto the right button (as in xterm): |
|
151 |
*" |
|
25 | 152 |
"/ Screen buttonTranslation:#(select #menu #paste). |
5 | 153 |
|
154 |
"* |
|
155 |
* while that one puts the pop-up menu both on the middle and right buttons: |
|
156 |
*" |
|
25 | 157 |
"/ Screen buttonTranslation:#(select #menu #menu). |
158 |
Screen buttonTranslation:#(1 2 2). |
|
7 | 159 |
|
160 |
"* |
|
161 |
* lefthanders can use: |
|
162 |
*" |
|
25 | 163 |
"/ Screen buttonTranslation:#(#menu #menu #select). |
5 | 164 |
! |
165 |
||
166 |
"* |
|
7 | 167 |
* define extensions for image files (i.e. extension-to-readerClass |
168 |
* mappings). Some of the readers are autoloaded (see patches file). |
|
169 |
* Moved this from code to here (from Image-class), for more flexibility |
|
5 | 170 |
* actually since this is not display- but host specific (naming conventions) |
171 |
* it should be moved into the host.rc or h_xxx.rc file |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
172 |
* Some readers are optional and therefore, only installed if the |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
173 |
* corresponding Smalltalk class is nonNil - this avoids warning messages |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
174 |
* during startup, if classes are missing. |
5 | 175 |
*" |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
176 |
|formats rdr| |
5 | 177 |
|
178 |
formats := Image fileFormats. |
|
179 |
formats at:'.xbm' put:XBMReader. |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
180 |
formats at:'.bm' put:XBMReader. |
5 | 181 |
formats at:'.tiff' put:TIFFReader. |
182 |
formats at:'.tif' put:TIFFReader. |
|
7 | 183 |
formats at:'.TIF' put:TIFFReader. |
5 | 184 |
formats at:'.gif' put:GIFReader. |
7 | 185 |
formats at:'.GIF' put:GIFReader. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
186 |
|
7 | 187 |
"/ formats at:'.img' put:IMGReader. |
188 |
"/ formats at:'.IMG' put:IMGReader. |
|
189 |
"/ formats at:'.mac' put:MacPaintReader. |
|
190 |
||
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
191 |
rdr := Smalltalk at:#SunRasterReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
192 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
193 |
formats at:'.im8' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
194 |
formats at:'.icon' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
195 |
]. |
7 | 196 |
|
197 |
"/ formats at:'.g3' put:G3FileReader. |
|
198 |
||
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
199 |
rdr := Smalltalk at:#WindowsIconReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
200 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
201 |
formats at:'.bmp' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
202 |
formats at:'.ico' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
203 |
formats at:'.BMP' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
204 |
formats at:'.ICO' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
205 |
]. |
7 | 206 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
207 |
rdr := Smalltalk at:#JPEGReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
208 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
209 |
formats at:'.JPG' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
210 |
formats at:'.jpg' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
211 |
formats at:'.jpeg' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
212 |
]. |
7 | 213 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
214 |
rdr := Smalltalk at:#PBMReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
215 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
216 |
formats at:'.ppm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
217 |
formats at:'.pbm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
218 |
formats at:'.pgm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
219 |
]. |
7 | 220 |
|
5 | 221 |
formats at:'.form' put:ST80FormReader. |
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
222 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
223 |
rdr := Smalltalk at:#FaceReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
224 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
225 |
formats at:'.face' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
226 |
]. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
227 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
228 |
rdr := Smalltalk at:#XPMReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
229 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
230 |
formats at:'.pm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
231 |
formats at:'.xpm' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
232 |
]. |
7 | 233 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
234 |
rdr := Smalltalk at:#PCXReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
235 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
236 |
formats at:'.pcx' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
237 |
formats at:'.PCX' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
238 |
]. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
239 |
|
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
240 |
rdr := Smalltalk at:#TargaReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
241 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
242 |
formats at:'.tga' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
243 |
formats at:'.TGA' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
244 |
]. |
14 | 245 |
|
246 |
formats at:'.xwd' put:XWDReader. |
|
47 | 247 |
|
48
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
248 |
rdr := Smalltalk at:#BlitImageReader ifAbsent:nil. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
249 |
rdr notNil ifTrue:[ |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
250 |
formats at:'48x48x1' put:rdr. |
892180489f28
avoid warnings, if ImageReader classes are not available
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
251 |
] |
5 | 252 |
! |
253 |
||
254 |
"* |
|
255 |
* find out, on what type of display we run |
|
8 | 256 |
* (boy, they should have added this to the x-protocol) |
5 | 257 |
* |
23 | 258 |
* look for a file named 'd_<displayname>.rc' and file it in |
5 | 259 |
*" |
260 |
||
261 |
|displayVar display displayType s idx| |
|
262 |
||
263 |
"find display name from environment or -display argument" |
|
264 |
||
265 |
idx := Arguments indexOf:'-display'. |
|
266 |
idx ~~ 0 ifTrue:[ |
|
267 |
displayVar := Arguments at:idx + 1. |
|
268 |
] ifFalse:[ |
|
269 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'. |
|
270 |
]. |
|
271 |
display := displayVar. |
|
272 |
||
273 |
displayVar notNil ifTrue:[ |
|
8 | 274 |
((displayVar startsWith:':0') |
275 |
or:[(displayVar startsWith:'unix:') |
|
276 |
or:[displayVar startsWith:'shm:']]) ifTrue:[ |
|
277 |
"running on a local display" |
|
7 | 278 |
display := OperatingSystem getHostName. |
5 | 279 |
] ifFalse:[ |
7 | 280 |
(displayVar endsWith:':0') ifTrue:[ |
281 |
display := displayVar copyTo:(displayVar size - 2) |
|
282 |
] ifFalse:[ |
|
283 |
(displayVar endsWith:':0.0') ifTrue:[ |
|
284 |
display := displayVar copyTo:(displayVar size - 4) |
|
285 |
] |
|
286 |
] |
|
5 | 287 |
]. |
288 |
display isNil ifTrue:[ |
|
7 | 289 |
'cannot determine display I am running on' errorPrintNL. |
5 | 290 |
] ifFalse:[ |
23 | 291 |
" |
292 |
if there is a corresponding file d_<displayName>.rc ... |
|
25 | 293 |
thats the one to take. |
23 | 294 |
" |
7 | 295 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc'). |
296 |
s notNil ifTrue:[ |
|
297 |
displayType := display. |
|
298 |
s close. |
|
299 |
]. |
|
8 | 300 |
|
25 | 301 |
" |
302 |
if the X-server gives some info, |
|
303 |
take that as a base |
|
304 |
" |
|
305 |
displayType isNil ifTrue:[ |
|
306 |
Display serverVendor = 'International Business Machines' |
|
307 |
ifTrue:[ |
|
308 |
displayType := 'aix' |
|
309 |
]. |
|
310 |
Display serverVendor = 'Silicon Graphics' |
|
311 |
ifTrue:[ |
|
312 |
displayType := 'iris' |
|
313 |
]. |
|
314 |
]. |
|
315 |
||
316 |
" |
|
317 |
otherwise ... |
|
318 |
" |
|
7 | 319 |
displayType isNil ifTrue:[ |
23 | 320 |
" |
321 |
just an example - stuff can also be hardwired here ... |
|
322 |
" |
|
7 | 323 |
display notNil ifTrue:[ |
324 |
(display startsWith:'clam') ifTrue:[ |
|
325 |
displayType := 'next' |
|
326 |
]. |
|
327 |
(display startsWith:'porty') ifTrue:[ |
|
328 |
displayType := 'portable' |
|
329 |
]. |
|
330 |
(display startsWith:'blue') ifTrue:[ |
|
331 |
displayType := 'iris' |
|
332 |
]. |
|
333 |
(display startsWith:'sun') ifTrue:[ |
|
334 |
displayType := 'sun' |
|
335 |
]. |
|
336 |
(display startsWith:'hp') ifTrue:[ |
|
337 |
displayType := 'hpux' |
|
338 |
]. |
|
23 | 339 |
" |
340 |
if, in your organization, the display type can |
|
341 |
be deduced from the hostname, |
|
342 |
use something like: |
|
343 |
" |
|
8 | 344 |
"/ (display startsWith:'slsv') ifTrue:[ |
23 | 345 |
"/ "all those machines at SEL are suns" |
8 | 346 |
"/ displayType := 'sun' |
347 |
"/ ]. |
|
23 | 348 |
"/ (display startsWith:'frxt') ifTrue:[ |
349 |
"/ "all those machines at AEG are xterminals" |
|
350 |
"/ displayType := 'xterminal' |
|
351 |
"/ ]. |
|
352 |
"/ (display startsWith:'frlx') ifTrue:[ |
|
353 |
"/ "all those machines at AEG are linux boxes with olwm" |
|
354 |
"/ displayType := 'linux_olwm' |
|
355 |
"/ ]. |
|
7 | 356 |
]. |
357 |
]. |
|
5 | 358 |
]. |
359 |
||
25 | 360 |
" |
361 |
final fallback: take OperatingSystem if we are running a local |
|
362 |
connection. |
|
26 | 363 |
the used name is one of: |
364 |
d_next.rc |
|
365 |
d_iris.rc |
|
366 |
etc. |
|
25 | 367 |
" |
5 | 368 |
displayType isNil ifTrue:[ |
7 | 369 |
"use type of machine smalltalk is running on as default ..." |
5 | 370 |
|
7 | 371 |
(displayVar startsWith:':0') ifTrue:[ |
372 |
displayType := OperatingSystem getSystemType. |
|
373 |
] ifFalse:[ |
|
374 |
(displayVar startsWith:(OperatingSystem getHostName , ':0')) ifTrue:[ |
|
375 |
displayType := OperatingSystem getSystemType. |
|
376 |
] |
|
377 |
] |
|
5 | 378 |
] |
379 |
]. |
|
380 |
||
381 |
"now, if the above mess found something, we have it in displayType; |
|
382 |
fileIn d_<displayType>.rc" |
|
383 |
||
384 |
displayType notNil ifTrue:[ |
|
385 |
(Smalltalk at:#'_ImageDisplayName') ~= displayType ifTrue:[ |
|
8 | 386 |
('trying display setup d_' , displayType , '.rc ...') errorPrintNL. |
7 | 387 |
Smalltalk fileIn:('d_' , displayType , '.rc') |
5 | 388 |
]. |
389 |
Smalltalk at:#'_ImageDisplayName' put:displayType |
|
390 |
] |
|
391 |
! |
|
392 |
||
393 |
"* |
|
394 |
* set a default style, if not been set by rc-file |
|
395 |
* this is set according the system we are running on. |
|
396 |
* Notice: normally, the below is not needed, since the style |
|
397 |
* is always set by the d_xxx.rc file. |
|
398 |
* Except, when the d_xxx.rc is not present. |
|
399 |
*" |
|
400 |
|type| |
|
401 |
||
402 |
View defaultStyle isNil ifTrue:[ |
|
403 |
type := OperatingSystem getSystemType. |
|
404 |
type = 'sunos' ifTrue:[ |
|
7 | 405 |
View defaultStyle:#openwin |
5 | 406 |
]. |
407 |
type = 'next' ifTrue:[ |
|
7 | 408 |
View defaultStyle:#next |
5 | 409 |
]. |
410 |
type = 'iris' ifTrue:[ |
|
7 | 411 |
View defaultStyle:#iris |
5 | 412 |
]. |
413 |
type = 'linux' ifTrue:[ |
|
7 | 414 |
View defaultStyle:#iris |
5 | 415 |
]. |
416 |
type = 'hpux' ifTrue:[ |
|
26 | 417 |
View defaultStyle:#'motif' |
23 | 418 |
]. |
419 |
type = 'ultrix' ifTrue:[ |
|
26 | 420 |
View defaultStyle:#'motif_dec2' |
421 |
]. |
|
422 |
type = 'os2' ifTrue:[ |
|
423 |
View defaultStyle:#'os2' |
|
424 |
]. |
|
425 |
(type = 'mswindows' or:[type = 'nt']) ifTrue:[ |
|
426 |
View defaultStyle:#'mswindows' |
|
427 |
]. |
|
428 |
type = 'win95' ifTrue:[ |
|
429 |
View defaultStyle:#'mswindows3' |
|
5 | 430 |
]. |
8 | 431 |
View defaultStyle isNil ifTrue:[ |
432 |
Display hasGreyscales ifTrue:[ |
|
433 |
View defaultStyle:#iris |
|
434 |
] ifFalse:[ |
|
435 |
View defaultStyle:#normal |
|
436 |
] |
|
437 |
]. |
|
23 | 438 |
'no style set in display.rc - default to ' errorPrint. |
439 |
View defaultStyle errorPrintNL |
|
5 | 440 |
] |
441 |
! |