0
|
1 |
"*
|
|
2 |
* $Header$
|
|
3 |
* display related configuration
|
|
4 |
* first do some common setup, then try to find a
|
|
5 |
* display specific initialization file.
|
|
6 |
*"
|
|
7 |
|
|
8 |
"*
|
|
9 |
* key bindings common to all display types
|
|
10 |
*"
|
|
11 |
|map|
|
|
12 |
|
|
13 |
map := Display keyboardMap.
|
|
14 |
|
3
|
15 |
map bindValue:#DoIt to:#Cmdd.
|
|
16 |
map bindValue:#InspectIt to:#Cmdi.
|
|
17 |
map bindValue:#PrintIt to:#Cmdp.
|
|
18 |
|
1
|
19 |
map bindValue:#Copy to:#Cmdc.
|
|
20 |
map bindValue:#Cut to:#Cmdx.
|
|
21 |
map bindValue:#Paste to:#Cmdv.
|
|
22 |
map bindValue:#Replace to:#Cmdr.
|
|
23 |
map bindValue:#Find to:#Cmds.
|
|
24 |
map bindValue:#FindNext to:#Cmdf.
|
|
25 |
map bindValue:#FindPrev to:#Cmdb.
|
2
|
26 |
map bindValue:#SelectAll to:#CmdA. "that is cmd-shift-a"
|
1
|
27 |
|
|
28 |
map bindValue:#Accept to:#Cmda.
|
|
29 |
map bindValue:#Explain to:#Cmde.
|
|
30 |
|
2
|
31 |
map bindValue:#BeginOfLine to:#Ctrla.
|
1
|
32 |
map bindValue:#EndOfLine to:#Ctrle.
|
|
33 |
|
3
|
34 |
map bindValue:#SearchMatchingParent to:#Ctrlm.
|
|
35 |
map bindValue:#SelectMatchingParents to:#Cmdm.
|
|
36 |
map bindValue:#SelectMatchingParents to:#Cmd.
|
0
|
37 |
|
2
|
38 |
map bindValue:#SelectToEnd to:#CtrlE. "that is ctrl-shift-e"
|
|
39 |
map bindValue:#SelectFromBeginning to:#CtrlA. "that is ctrl-shift-a"
|
|
40 |
|
0
|
41 |
"*
|
|
42 |
* international characters - map to iso8859 values
|
|
43 |
*"
|
|
44 |
map bindValue:(Character value:16rFC) to:#udiaeresis.
|
|
45 |
map bindValue:(Character value:16rE4) to:#adiaeresis.
|
|
46 |
map bindValue:(Character value:16rF6) to:#odiaeresis.
|
|
47 |
map bindValue:(Character value:16rDC) to:#Udiaeresis.
|
|
48 |
map bindValue:(Character value:16rC4) to:#Adiaeresis.
|
|
49 |
map bindValue:(Character value:16rD6) to:#Odiaeresis.
|
|
50 |
map bindValue:(Character value:16rDF) to:#ssharp.
|
|
51 |
|
|
52 |
"*
|
|
53 |
* need more here (french ...)
|
|
54 |
*"
|
|
55 |
|
|
56 |
"*
|
|
57 |
* misc characters
|
|
58 |
*"
|
|
59 |
map bindValue:(Character value:16rA7) to:#section.
|
|
60 |
map bindValue:(Character value:16rB0) to:#degree.
|
|
61 |
map bindValue:(Character value:16rB2) to:#twosuperior.
|
|
62 |
map bindValue:(Character value:16rB3) to:#threesuperior.
|
|
63 |
map bindValue:(Character value:16rB5) to:#mu.
|
|
64 |
!
|
|
65 |
|
|
66 |
"*
|
|
67 |
* take a smaller font on small (i.e. vga) screens
|
|
68 |
*"
|
|
69 |
|sz|
|
|
70 |
|
|
71 |
sz := 12.
|
|
72 |
Display width < 800 ifTrue:[
|
|
73 |
sz := 10
|
|
74 |
].
|
|
75 |
|
|
76 |
"*
|
|
77 |
* this defines the default font for all views (actually for all GC's)
|
|
78 |
*"
|
|
79 |
GraphicsContext defaultFont:(Font family:'courier' face:'medium' style:'roman' size:sz).
|
|
80 |
|
|
81 |
"*
|
|
82 |
* this defines the default font for menu views
|
|
83 |
*"
|
|
84 |
(View defaultStyle == #openwin) ifTrue:[
|
|
85 |
MenuView defaultFont:(Font family:'lucida' face:'medium' style:'roman' size:sz).
|
|
86 |
Launcher defaultFont:(Font family:'lucida' face:'medium' style:'roman' size:sz).
|
|
87 |
] ifFalse:[
|
|
88 |
(View defaultStyle == #iris) ifTrue:[
|
|
89 |
MenuView defaultFont:(Font family:'helvetica' face:'bold' style:'oblique' size:sz).
|
|
90 |
SelectionInListView defaultFont:(Font family:'helvetica' face:'medium' style:'roman' size:sz).
|
|
91 |
Launcher defaultFont:(Font family:'helvetica' face:'bold' style:'oblique' size:sz).
|
|
92 |
] ifFalse:[
|
|
93 |
MenuView defaultFont:(Font family:'helvetica' face:'bold' style:'roman' size:sz).
|
|
94 |
Launcher defaultFont:(Font family:'helvetica' face:'bold' style:'roman' size:sz).
|
|
95 |
]
|
|
96 |
].
|
|
97 |
|
|
98 |
"*
|
|
99 |
* this defines the default font for code views
|
|
100 |
*"
|
|
101 |
CodeView defaultFont:(Font family:'courier' face:'medium' style:'roman' size:sz).
|
|
102 |
|
|
103 |
' '
|
|
104 |
!
|
|
105 |
|
|
106 |
"*
|
|
107 |
* find out, on what type of display we run
|
|
108 |
* (they should have added this to the x-protocol)
|
|
109 |
*
|
|
110 |
* look for a file named 'd_<displays-hostname>.rc' and file it in
|
|
111 |
*"
|
|
112 |
|
|
113 |
|displayVar display displayType s idx|
|
|
114 |
|
|
115 |
"find display name from environment or -display argument"
|
|
116 |
|
|
117 |
idx := Arguments indexOf:'-display'.
|
|
118 |
idx ~~ 0 ifTrue:[
|
|
119 |
displayVar := Arguments at:idx + 1.
|
|
120 |
] ifFalse:[
|
|
121 |
displayVar := OperatingSystem getEnvironment:'DISPLAY'.
|
|
122 |
].
|
|
123 |
display := displayVar.
|
|
124 |
|
|
125 |
displayVar notNil ifTrue:[
|
2
|
126 |
((displayVar startsWith:':0') or:[displayVar startsWith:'unix:0']) ifTrue:[
|
0
|
127 |
display := OperatingSystem getHostName.
|
|
128 |
] ifFalse:[
|
|
129 |
(displayVar endsWith:':0') ifTrue:[
|
|
130 |
display := displayVar copyTo:(displayVar size - 2)
|
|
131 |
]
|
|
132 |
].
|
2
|
133 |
display isNil ifTrue:[
|
3
|
134 |
'cannot determine display I am running on' printNewline.
|
2
|
135 |
] ifFalse:[
|
|
136 |
"if there is a corresponding file ..."
|
|
137 |
s := Smalltalk systemFileStreamFor:('d_' , display , '.rc').
|
|
138 |
s notNil ifTrue:[
|
|
139 |
displayType := display.
|
|
140 |
s close.
|
|
141 |
].
|
|
142 |
"otherwise ..."
|
|
143 |
displayType isNil ifTrue:[
|
|
144 |
"just an example - stuff could also be hardwired here ..."
|
|
145 |
display notNil ifTrue:[
|
|
146 |
(display startsWith:'clam') ifTrue:[
|
|
147 |
displayType := 'next'
|
|
148 |
].
|
|
149 |
(display startsWith:'porty') ifTrue:[
|
|
150 |
displayType := 'portable'
|
|
151 |
].
|
|
152 |
(display startsWith:'blue') ifTrue:[
|
|
153 |
displayType := 'iris'
|
|
154 |
].
|
|
155 |
(display startsWith:'sun') ifTrue:[
|
|
156 |
displayType := 'sun'
|
|
157 |
].
|
|
158 |
(display startsWith:'slsv') ifTrue:[
|
|
159 |
"all those machines here at SEL are suns"
|
|
160 |
displayType := 'sun'
|
|
161 |
].
|
0
|
162 |
].
|
|
163 |
].
|
|
164 |
].
|
|
165 |
|
|
166 |
displayType isNil ifTrue:[
|
|
167 |
"use type of machine smalltalk is running on as default ..."
|
|
168 |
|
|
169 |
(displayVar startsWith:':0') ifTrue:[
|
|
170 |
displayType := OperatingSystem getSystemType.
|
|
171 |
]
|
|
172 |
]
|
|
173 |
].
|
|
174 |
|
|
175 |
displayType notNil ifTrue:[
|
|
176 |
('reading display setup d_' , displayType , '.rc ...') printNewline.
|
|
177 |
Smalltalk fileIn:('d_' , displayType , '.rc')
|
|
178 |
].
|
|
179 |
!
|
|
180 |
|
|
181 |
"*
|
|
182 |
* set a default style, if not been set by rc-file
|
|
183 |
* this is set acc. the system we are running on
|
|
184 |
*"
|
|
185 |
|type|
|
|
186 |
|
|
187 |
View defaultStyle isNil ifTrue:[
|
|
188 |
type := OperatingSystem getSystemType.
|
|
189 |
type = 'sunos' ifTrue:[
|
|
190 |
View defaultStyle:#openwin
|
|
191 |
].
|
|
192 |
type = 'next' ifTrue:[
|
|
193 |
View defaultStyle:#next
|
|
194 |
].
|
|
195 |
type = 'iris' ifTrue:[
|
|
196 |
View defaultStyle:#iris
|
|
197 |
].
|
|
198 |
]
|
|
199 |
!
|