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