0
|
1 |
"*
|
|
2 |
* $Header$
|
5
|
3 |
*
|
|
4 |
* DONT add site specific things here - use your own d_xxx.rc file instead
|
|
5 |
*
|
|
6 |
* display related configuration:
|
|
7 |
* first do some common setup, then try to find a
|
|
8 |
* display specific initialization file.
|
0
|
9 |
*"
|
|
10 |
|
|
11 |
"*
|
|
12 |
* key bindings common to all display types
|
5
|
13 |
* use event monitor, to see what the Xserver sends us;
|
|
14 |
* put display-specific stuff into a d_hostName.rc file.
|
0
|
15 |
*"
|
|
16 |
|map|
|
|
17 |
|
|
18 |
map := Display keyboardMap.
|
|
19 |
|
3
|
20 |
map bindValue:#DoIt to:#Cmdd.
|
|
21 |
map bindValue:#InspectIt to:#Cmdi.
|
|
22 |
map bindValue:#PrintIt to:#Cmdp.
|
|
23 |
|
1
|
24 |
map bindValue:#Copy to:#Cmdc.
|
|
25 |
map bindValue:#Cut to:#Cmdx.
|
|
26 |
map bindValue:#Paste to:#Cmdv.
|
|
27 |
map bindValue:#Replace to:#Cmdr.
|
|
28 |
map bindValue:#Find to:#Cmds.
|
|
29 |
map bindValue:#FindNext to:#Cmdf.
|
|
30 |
map bindValue:#FindPrev to:#Cmdb.
|
2
|
31 |
map bindValue:#SelectAll to:#CmdA. "that is cmd-shift-a"
|
1
|
32 |
|
|
33 |
map bindValue:#Accept to:#Cmda.
|
|
34 |
map bindValue:#Explain to:#Cmde.
|
5
|
35 |
map bindValue:#Explain to:#Cmdh.
|
1
|
36 |
|
2
|
37 |
map bindValue:#BeginOfLine to:#Ctrla.
|
1
|
38 |
map bindValue:#EndOfLine to:#Ctrle.
|
|
39 |
|
3
|
40 |
map bindValue:#SearchMatchingParent to:#Ctrlm.
|
|
41 |
map bindValue:#SelectMatchingParents to:#Cmdm.
|
|
42 |
map bindValue:#SelectMatchingParents to:#Cmd.
|
0
|
43 |
|
2
|
44 |
map bindValue:#SelectToEnd to:#CtrlE. "that is ctrl-shift-e"
|
|
45 |
map bindValue:#SelectFromBeginning to:#CtrlA. "that is ctrl-shift-a"
|
|
46 |
|
5
|
47 |
"
|
|
48 |
* on some german keyboards, the x-server does NOT correctly
|
|
49 |
* xlate characters ....
|
|
50 |
*"
|
|
51 |
"
|
|
52 |
map bindValue:$[ to:#'Alt['.
|
|
53 |
map bindValue:$] to:#'Alt]'.
|
|
54 |
map bindValue:${ to:#'Alt{'.
|
|
55 |
map bindValue:$} to:#'Alt}'.
|
|
56 |
map bindValue:$\ to:#'Alt\'.
|
|
57 |
map bindValue:$| to:#'Alt|'.
|
|
58 |
"
|
|
59 |
|
0
|
60 |
"*
|
|
61 |
* international characters - map to iso8859 values
|
|
62 |
*"
|
|
63 |
map bindValue:(Character value:16rFC) to:#udiaeresis.
|
|
64 |
map bindValue:(Character value:16rE4) to:#adiaeresis.
|
|
65 |
map bindValue:(Character value:16rF6) to:#odiaeresis.
|
|
66 |
map bindValue:(Character value:16rDC) to:#Udiaeresis.
|
|
67 |
map bindValue:(Character value:16rC4) to:#Adiaeresis.
|
|
68 |
map bindValue:(Character value:16rD6) to:#Odiaeresis.
|
|
69 |
map bindValue:(Character value:16rDF) to:#ssharp.
|
|
70 |
|
|
71 |
"*
|
|
72 |
* need more here (french ...)
|
|
73 |
*"
|
|
74 |
|
|
75 |
"*
|
|
76 |
* misc characters
|
|
77 |
*"
|
|
78 |
map bindValue:(Character value:16rA7) to:#section.
|
|
79 |
map bindValue:(Character value:16rB0) to:#degree.
|
|
80 |
map bindValue:(Character value:16rB2) to:#twosuperior.
|
|
81 |
map bindValue:(Character value:16rB3) to:#threesuperior.
|
|
82 |
map bindValue:(Character value:16rB5) to:#mu.
|
|
83 |
!
|
|
84 |
|
|
85 |
"*
|
5
|
86 |
* mouse-button translation
|
|
87 |
*
|
|
88 |
* the default translation is #(1 2 3) (i.e. identity).
|
|
89 |
* If you dont want the 3rd button (some x-servers dont produce button2-
|
|
90 |
* but button3-events instead), uncomment the following line:
|
|
91 |
* (this translates the 3rd button into 2nd button).
|
|
92 |
*"
|
|
93 |
"/ XWorkstation buttonTranslation:#(1 2 2)
|
|
94 |
|
|
95 |
"*
|
|
96 |
* lefthanders can uncomment this:
|
|
97 |
*"
|
|
98 |
"/ XWorkstation buttonTranslation:#(3 2 1)
|
|
99 |
|
|
100 |
"*
|
|
101 |
* or:
|
|
102 |
* (notice, that this is usually already done for you in the Xserver's configuration).
|
|
103 |
*"
|
|
104 |
"/ XWorkstation buttonTranslation:#(2 2 1)
|
|
105 |
|
|
106 |
"*
|
|
107 |
* you can also use symbolic buttons:
|
|
108 |
* (allowed are #select #menu and #paste)
|
|
109 |
*
|
|
110 |
* the following line puts paste onto the right button (as in xterm):
|
|
111 |
*"
|
|
112 |
XWorkstation buttonTranslation:#(select #menu #paste)
|
|
113 |
|
|
114 |
"*
|
|
115 |
* while that one puts the pop-up menu both on the middle and right buttons:
|
|
116 |
*"
|
|
117 |
"/ XWorkstation buttonTranslation:#(select #menu #menu)
|
|
118 |
!
|
|
119 |
|
|
120 |
|
|
121 |
"*
|
|
122 |
* define extensions for image files
|
|
123 |
* moved this from code to here (from Image-class), for more flexibility
|
|
124 |
* actually since this is not display- but host specific (naming conventions)
|
|
125 |
* it should be moved into the host.rc or h_xxx.rc file
|
|
126 |
*"
|
|
127 |
|formats|
|
|
128 |
|
|
129 |
formats := Image fileFormats.
|
|
130 |
formats at:'.xbm' put:XBMReader.
|
|
131 |
formats at:'.tiff' put:TIFFReader.
|
|
132 |
formats at:'.tif' put:TIFFReader.
|
|
133 |
formats at:'.gif' put:GIFReader.
|
|
134 |
formats at:'.img' put:IMGReader.
|
|
135 |
"formats at:'.pcx' put:PCXReader. "
|
|
136 |
"formats at:'.mac' put:MacPaintReader. "
|
|
137 |
formats at:'.im8' put:SunRasterReader.
|
|
138 |
formats at:'.icon' put:SunRasterReader.
|
|
139 |
formats at:'.face' put:FaceReader.
|
|
140 |
"formats at:'.g3' put:G3FileReader. "
|
|
141 |
formats at:'.bmp' put:WindowsIconReader.
|
|
142 |
formats at:'.ico' put:WindowsIconReader.
|
|
143 |
formats at:'.BMP' put:WindowsIconReader.
|
|
144 |
formats at:'.ICO' put:WindowsIconReader.
|
|
145 |
formats at:'.jpg' put:JPEGReader.
|
|
146 |
formats at:'.jpeg' put:JPEGReader.
|
|
147 |
formats at:'.ppm' put:PBMReader.
|
|
148 |
formats at:'.pbm' put:PBMReader.
|
|
149 |
formats at:'.pgm' put:PBMReader.
|
|
150 |
formats at:'.form' put:ST80FormReader.
|
|
151 |
formats at:'.bm' put:XBMReader.
|
|
152 |
formats at:'.pm' put:XPMReader.
|
|
153 |
formats at:'.xpm' put:XPMReader.
|
|
154 |
!
|
|
155 |
|
|
156 |
"*
|
|
157 |
* find out, on what type of display we run
|
|
158 |
* (they should have added this to the x-protocol)
|
|
159 |
*
|
|
160 |
* look for a file named 'd_<displays-hostname>.rc' and file it in
|
|
161 |
*"
|
|
162 |
|
|
163 |
|displayVar display displayType s idx|
|
|
164 |
|
|
165 |
"find display name from environment or -display argument"
|
|
166 |
|
|
167 |
idx := Arguments indexOf:'-display'.
|
|
168 |
idx ~~ 0 ifTrue:[
|
|
169 |
displayVar := Arguments at:idx + 1.
|
|
170 |
] ifFalse:[
|
|
171 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'.
|
|
172 |
].
|
|
173 |
display := displayVar.
|
|
174 |
|
|
175 |
displayVar notNil ifTrue:[
|
|
176 |
((displayVar startsWith:':0') or:[displayVar startsWith:'unix:0']) ifTrue:[
|
|
177 |
display := OperatingSystem getHostName.
|
|
178 |
] ifFalse:[
|
|
179 |
(displayVar endsWith:':0') ifTrue:[
|
|
180 |
display := displayVar copyTo:(displayVar size - 2)
|
|
181 |
] ifFalse:[
|
|
182 |
(displayVar endsWith:':0.0') ifTrue:[
|
|
183 |
display := displayVar copyTo:(displayVar size - 4)
|
|
184 |
]
|
|
185 |
]
|
|
186 |
].
|
|
187 |
display isNil ifTrue:[
|
|
188 |
'cannot determine display I am running on' errorPrintNL.
|
|
189 |
] ifFalse:[
|
|
190 |
"if there is a corresponding file ..."
|
|
191 |
|
|
192 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc').
|
|
193 |
s notNil ifTrue:[
|
|
194 |
displayType := display.
|
|
195 |
s close.
|
|
196 |
].
|
|
197 |
"otherwise ..."
|
|
198 |
displayType isNil ifTrue:[
|
|
199 |
"just an example - stuff could also be hardwired here ..."
|
|
200 |
display notNil ifTrue:[
|
|
201 |
(display startsWith:'clam') ifTrue:[
|
|
202 |
displayType := 'next'
|
|
203 |
].
|
|
204 |
(display startsWith:'porty') ifTrue:[
|
|
205 |
displayType := 'portable'
|
|
206 |
].
|
|
207 |
(display startsWith:'blue') ifTrue:[
|
|
208 |
displayType := 'iris'
|
|
209 |
].
|
|
210 |
(display startsWith:'sun') ifTrue:[
|
|
211 |
displayType := 'sun'
|
|
212 |
].
|
|
213 |
(display startsWith:'hp') ifTrue:[
|
|
214 |
displayType := 'hpux'
|
|
215 |
].
|
|
216 |
(display startsWith:'slsv') ifTrue:[
|
|
217 |
"all those machines here at SEL are suns"
|
|
218 |
displayType := 'sun'
|
|
219 |
].
|
|
220 |
].
|
|
221 |
].
|
|
222 |
].
|
|
223 |
|
|
224 |
displayType isNil ifTrue:[
|
|
225 |
"use type of machine smalltalk is running on as default ..."
|
|
226 |
|
|
227 |
(displayVar startsWith:':0') ifTrue:[
|
|
228 |
displayType := OperatingSystem getSystemType.
|
|
229 |
] ifFalse:[
|
|
230 |
(displayVar startsWith:(OperatingSystem getHostName , ':0')) ifTrue:[
|
|
231 |
displayType := OperatingSystem getSystemType.
|
|
232 |
]
|
|
233 |
]
|
|
234 |
]
|
|
235 |
].
|
|
236 |
|
|
237 |
"now, if the above mess found something, we have it in displayType;
|
|
238 |
fileIn d_<displayType>.rc"
|
|
239 |
|
|
240 |
displayType notNil ifTrue:[
|
|
241 |
(Smalltalk at:#'_ImageDisplayName') ~= displayType ifTrue:[
|
|
242 |
('trying display setup d_' , displayType , '.rc ...') errorPrintNewline.
|
|
243 |
Smalltalk fileIn:('d_' , displayType , '.rc')
|
|
244 |
].
|
|
245 |
Smalltalk at:#'_ImageDisplayName' put:displayType
|
|
246 |
]
|
|
247 |
!
|
|
248 |
|
|
249 |
"*
|
|
250 |
* set a default style, if not been set by rc-file
|
|
251 |
* this is set according the system we are running on.
|
|
252 |
* Notice: normally, the below is not needed, since the style
|
|
253 |
* is always set by the d_xxx.rc file.
|
|
254 |
* Except, when the d_xxx.rc is not present.
|
|
255 |
*"
|
|
256 |
|type|
|
|
257 |
|
|
258 |
View defaultStyle isNil ifTrue:[
|
|
259 |
type := OperatingSystem getSystemType.
|
|
260 |
type = 'sunos' ifTrue:[
|
|
261 |
View defaultStyle:#openwin
|
|
262 |
].
|
|
263 |
type = 'next' ifTrue:[
|
|
264 |
View defaultStyle:#next
|
|
265 |
].
|
|
266 |
type = 'iris' ifTrue:[
|
|
267 |
View defaultStyle:#iris
|
|
268 |
].
|
|
269 |
type = 'linux' ifTrue:[
|
|
270 |
View defaultStyle:#iris
|
|
271 |
].
|
|
272 |
type = 'hpux' ifTrue:[
|
|
273 |
View defaultStyle:#motif
|
|
274 |
].
|
|
275 |
]
|
|
276 |
!
|
|
277 |
|
|
278 |
"*
|
0
|
279 |
* take a smaller font on small (i.e. vga) screens
|
|
280 |
*"
|
|
281 |
|sz|
|
|
282 |
|
|
283 |
sz := 12.
|
|
284 |
Display width < 800 ifTrue:[
|
|
285 |
sz := 10
|
|
286 |
].
|
|
287 |
|
|
288 |
"*
|
|
289 |
* this defines the default font for all views (actually for all GC's)
|
|
290 |
*"
|
|
291 |
GraphicsContext defaultFont:(Font family:'courier' face:'medium' style:'roman' size:sz).
|
|
292 |
|
|
293 |
"*
|
|
294 |
* this defines the default font for menu views
|
|
295 |
*"
|
|
296 |
(View defaultStyle == #openwin) ifTrue:[
|
|
297 |
MenuView defaultFont:(Font family:'lucida' face:'medium' style:'roman' size:sz).
|
|
298 |
Launcher defaultFont:(Font family:'lucida' face:'medium' style:'roman' size:sz).
|
|
299 |
] ifFalse:[
|
|
300 |
(View defaultStyle == #iris) ifTrue:[
|
|
301 |
MenuView defaultFont:(Font family:'helvetica' face:'bold' style:'oblique' size:sz).
|
|
302 |
SelectionInListView defaultFont:(Font family:'helvetica' face:'medium' style:'roman' size:sz).
|
|
303 |
Launcher defaultFont:(Font family:'helvetica' face:'bold' style:'oblique' size:sz).
|
|
304 |
] ifFalse:[
|
|
305 |
MenuView defaultFont:(Font family:'helvetica' face:'bold' style:'roman' size:sz).
|
|
306 |
Launcher defaultFont:(Font family:'helvetica' face:'bold' style:'roman' size:sz).
|
5
|
307 |
(View defaultStyle == #mswindows) ifTrue:[
|
|
308 |
SelectionInListView defaultFont:(Font family:'courier' face:'bold' style:'roman' size:sz).
|
|
309 |
]
|
0
|
310 |
]
|
|
311 |
].
|
|
312 |
|
|
313 |
"*
|
|
314 |
* this defines the default font for code views
|
|
315 |
*"
|
|
316 |
CodeView defaultFont:(Font family:'courier' face:'medium' style:'roman' size:sz).
|
|
317 |
!
|