author | Claus Gittinger <cg@exept.de> |
Mon, 04 May 2020 19:16:37 +0200 | |
changeset 9043 | a69c50e2542c |
parent 8970 | c232c2692e1a |
permissions | -rw-r--r-- |
7107 | 1 |
"{ Encoding: utf8 }" |
2 |
||
5747 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libview' }" |
|
15 |
||
7107 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
5747 | 18 |
SimpleView subclass:#XEmbedContainerView |
19 |
instanceVariableNames:'clientViewId clientView workarounds' |
|
20 |
classVariableNames:'XEMBED_EMBEDDED_NOTIFY XEMBED_WINDOW_ACTIVATE |
|
21 |
XEMBED_WINDOW_DEACTIVATE XEMBED_REQUEST_FOCUS XEMBED_FOCUS_IN |
|
22 |
XEMBED_FOCUS_OUT XEMBED_FOCUS_NEXT XEMBED_FOCUS_PREV |
|
23 |
XEMBED_MODALITY_ON XEMBED_MODALITY_OFF |
|
24 |
XEMBED_REGISTER_ACCELERATOR XEMBED_UNREGISTER_ACCELERATOR |
|
25 |
XEMBED_ACTIVATE_ACCELERATOR XEMBED_FOCUS_CURRENT |
|
26 |
XEMBED_FOCUS_FIRST XEMBED_FOCUS_LAST' |
|
27 |
poolDictionaries:'' |
|
28 |
category:'Views-XEmbed' |
|
29 |
! |
|
30 |
||
31 |
SimpleView subclass:#ClientView |
|
32 |
instanceVariableNames:'' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:XEmbedContainerView |
|
36 |
! |
|
37 |
||
38 |
!XEmbedContainerView class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
42 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
! |
|
53 |
||
54 |
documentation |
|
55 |
" |
|
56 |
I can be used to embed alien views under X Window. |
|
57 |
I implement the XEmbed protocol: |
|
58 |
http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html |
|
59 |
||
60 |
||
61 |
[author:] |
|
62 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
63 |
||
64 |
[instance variables:] |
|
65 |
||
66 |
[class variables:] |
|
67 |
||
68 |
[see also:] |
|
69 |
||
70 |
" |
|
71 |
! ! |
|
72 |
||
73 |
!XEmbedContainerView class methodsFor:'initialization'! |
|
74 |
||
75 |
initialize |
|
76 |
||
77 |
"From http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html: |
|
78 |
||
79 |
#define XEMBED_EMBEDDED_NOTIFY 0 |
|
80 |
#define XEMBED_WINDOW_ACTIVATE 1 |
|
81 |
#define XEMBED_WINDOW_DEACTIVATE 2 |
|
82 |
#define XEMBED_REQUEST_FOCUS 3 |
|
83 |
#define XEMBED_FOCUS_IN 4 |
|
84 |
#define XEMBED_FOCUS_OUT 5 |
|
85 |
#define XEMBED_FOCUS_NEXT 6 |
|
86 |
#define XEMBED_FOCUS_PREV 7 |
|
87 |
||
88 |
#define XEMBED_MODALITY_ON 10 |
|
89 |
#define XEMBED_MODALITY_OFF 11 |
|
90 |
#define XEMBED_REGISTER_ACCELERATOR 12 |
|
91 |
#define XEMBED_UNREGISTER_ACCELERATOR 13 |
|
92 |
#define XEMBED_ACTIVATE_ACCELERATOR 14 |
|
93 |
||
94 |
||
95 |
A detail code is required for XEMBED_FOCUS_IN. The following values are valid: |
|
96 |
#define XEMBED_FOCUS_CURRENT 0 |
|
97 |
#define XEMBED_FOCUS_FIRST 1 |
|
98 |
#define XEMBED_FOCUS_LAST 2 |
|
99 |
||
100 |
" |
|
101 |
||
102 |
||
103 |
XEMBED_EMBEDDED_NOTIFY := 0. |
|
104 |
XEMBED_WINDOW_ACTIVATE := 1. |
|
105 |
XEMBED_WINDOW_DEACTIVATE := 2. |
|
106 |
XEMBED_REQUEST_FOCUS := 3. |
|
107 |
XEMBED_FOCUS_IN := 4. |
|
108 |
XEMBED_FOCUS_OUT := 5. |
|
109 |
XEMBED_FOCUS_NEXT := 6. |
|
110 |
XEMBED_FOCUS_PREV := 7. |
|
111 |
||
112 |
XEMBED_MODALITY_ON := 10. |
|
113 |
XEMBED_MODALITY_OFF := 11. |
|
114 |
XEMBED_REGISTER_ACCELERATOR := 12. |
|
115 |
XEMBED_UNREGISTER_ACCELERATOR := 13. |
|
116 |
XEMBED_ACTIVATE_ACCELERATOR := 14. |
|
117 |
||
118 |
||
119 |
XEMBED_FOCUS_CURRENT := 0. |
|
120 |
XEMBED_FOCUS_FIRST := 1. |
|
121 |
XEMBED_FOCUS_LAST := 2. |
|
122 |
||
123 |
"Created: / 30-05-2011 / 19:47:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
124 |
! ! |
|
125 |
||
126 |
!XEmbedContainerView class methodsFor:'startup'! |
|
127 |
||
128 |
open |
|
129 |
"launch a new workspace" |
|
130 |
||
131 |
|xembed topView| |
|
132 |
||
7107 | 133 |
topView := StandardSystemView extent:(640 @ 480). |
5747 | 134 |
xembed := self in:topView. |
135 |
xembed origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
136 |
||
137 |
"/ adjust topViews extent according to my font |
|
138 |
||
139 |
topView open. |
|
140 |
Delay waitForMilliseconds:5. |
|
141 |
topView |
|
142 |
label:(self classResources string:'XEmbedContainerView ' |
|
6277 | 143 |
, xembed embeddingWindowId printString). |
5747 | 144 |
self == XEmbedContainerView |
145 |
ifTrue: |
|
146 |
[ Transcript |
|
6277 | 147 |
show:'XEmbed Socket WID: ' , xembed embeddingWindowId printString; |
5747 | 148 |
cr ]. |
149 |
^ xembed |
|
150 |
||
151 |
" |
|
6277 | 152 |
Workspace open |
153 |
" |
|
5747 | 154 |
|
155 |
"Modified: / 16-05-1998 / 16:53:53 / cg" |
|
156 |
"Created: / 30-05-2011 / 23:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
157 |
"Modified: / 06-06-2011 / 18:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
158 |
! ! |
|
159 |
||
160 |
!XEmbedContainerView methodsFor:'accessing'! |
|
161 |
||
162 |
embeddingWindowId |
|
6277 | 163 |
^ self drawableId address |
5747 | 164 |
|
165 |
"Created: / 06-06-2011 / 10:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
166 |
! |
|
167 |
||
168 |
workarounds |
|
169 |
^ workarounds ? #() |
|
170 |
||
171 |
"Modified: / 03-06-2011 / 09:58:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
172 |
! |
|
173 |
||
174 |
workarounds:something |
|
175 |
workarounds := something. |
|
176 |
! ! |
|
177 |
||
178 |
!XEmbedContainerView methodsFor:'event handling'! |
|
179 |
||
180 |
clientPlugged |
|
181 |
||
182 |
"Triggered when client application plugged into |
|
183 |
the view" |
|
184 |
||
185 |
"Modified: / 06-06-2011 / 10:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
186 |
! |
|
187 |
||
188 |
clientUnplugged: clientInitiated |
|
189 |
||
190 |
"Triggered when client uplugs. If the client itself |
|
191 |
unplugs, then clientInitiated is true, false otherwise" |
|
192 |
||
193 |
"Created: / 06-06-2011 / 10:02:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
194 |
! |
|
195 |
||
196 |
createWindowX:x y:y width:w height:h |
|
197 |
|childWindowIds| |
|
198 |
||
6277 | 199 |
childWindowIds := self graphicsDevice childIdsOf:self drawableId. |
5747 | 200 |
childWindowIds size == 1 |
201 |
ifFalse:[ self error:'I should have exactly one child'. ]. |
|
202 |
clientViewId := childWindowIds first. |
|
203 |
clientView := ClientView new setContainer: self id: clientViewId. |
|
204 |
self sendXEmbeddedNotify. |
|
205 |
self clientPlugged. |
|
206 |
||
207 |
" |
|
208 |
device getGeometryOf:clientWindowId" |
|
209 |
"/device mapWindow: clientWindowId. |
|
210 |
||
211 |
"Created: / 01-06-2011 / 12:56:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
212 |
"Modified: / 02-06-2011 / 18:11:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
213 |
! |
|
214 |
||
215 |
destroyed |
|
216 |
"A client just destroyed its window" |
|
217 |
||
218 |
| childWindowIds | |
|
219 |
||
8970 | 220 |
childWindowIds := device childIdsOf: self drawableId. |
5747 | 221 |
childWindowIds size == 0 ifTrue:[ |
8970 | 222 |
device removeKnownView: clientView withId: clientViewId. |
5747 | 223 |
clientViewId := nil. |
224 |
clientView := nil. |
|
225 |
]. |
|
226 |
self clientUnplugged: true. |
|
227 |
||
228 |
"Created: / 30-05-2011 / 19:24:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
229 |
"Modified: / 06-06-2011 / 10:05:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
230 |
! |
|
231 |
||
232 |
focusIn |
|
233 |
||
234 |
super focusIn. |
|
235 |
||
236 |
self sendXEmbedEvent: XEMBED_FOCUS_IN |
|
237 |
detail: 0 data1: 0 data2: 0 |
|
238 |
||
239 |
"Created: / 31-05-2011 / 00:05:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
240 |
! |
|
241 |
||
242 |
focusOut |
|
243 |
||
244 |
super focusOut. |
|
245 |
||
246 |
self sendXEmbedEvent: XEMBED_FOCUS_OUT |
|
247 |
detail: 0 data1: 0 data2: 0 |
|
248 |
||
249 |
"Created: / 31-05-2011 / 00:05:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5900
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
250 |
! |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
251 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
252 |
hasKeyboardFocus:aBoolean |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
253 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
254 |
super hasKeyboardFocus:aBoolean. |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
255 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
256 |
self sendXEmbedEvent: (aBoolean ifTrue:[XEMBED_FOCUS_IN] ifFalse:[XEMBED_FOCUS_OUT]) |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
257 |
detail: 0 data1: 0 data2: 0 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
258 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
259 |
"Created: / 03-04-2012 / 10:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5747 | 260 |
! ! |
261 |
||
262 |
!XEmbedContainerView methodsFor:'event sending'! |
|
263 |
||
264 |
sendXEmbedEvent: message detail: detail data1: data1 data2: data2 |
|
265 |
||
266 |
clientViewId ifNil:[^self]. |
|
267 |
||
6277 | 268 |
(self graphicsDevice |
6340
78263ccba8d0
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
6277
diff
changeset
|
269 |
sendClientEvent: (self graphicsDevice atomIDOf:'_XEMBED') |
5747 | 270 |
format:32 |
271 |
to:clientViewId |
|
272 |
propagate:false |
|
273 |
eventMask:nil |
|
274 |
window:clientViewId |
|
275 |
data1:0 |
|
276 |
data2:message |
|
277 |
data3:detail |
|
278 |
data4:data1 |
|
279 |
data5:data2) ifFalse:[self breakPoint: #jv]. |
|
280 |
||
281 |
"Created: / 30-05-2011 / 19:40:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
282 |
"Modified: / 01-06-2011 / 13:04:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
283 |
! |
|
284 |
||
285 |
sendXEmbeddedNotify |
|
286 |
self |
|
287 |
sendXEmbedEvent: XEMBED_EMBEDDED_NOTIFY |
|
288 |
detail: nil |
|
6277 | 289 |
data1: self drawableId |
5747 | 290 |
data2: 0 |
291 |
||
292 |
"Created: / 30-05-2011 / 19:42:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
293 |
! ! |
|
294 |
||
295 |
!XEmbedContainerView methodsFor:'initialization & release'! |
|
296 |
||
297 |
initEvents |
|
298 |
||
299 |
super initEvents. |
|
300 |
self enableEvent: #substructureNotify. |
|
301 |
self enableEvent: #substructureRedirect. |
|
302 |
||
303 |
"Created: / 31-05-2011 / 00:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5900
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
304 |
"Modified: / 03-04-2012 / 10:12:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5747 | 305 |
! ! |
306 |
||
307 |
!XEmbedContainerView methodsFor:'workarounds'! |
|
308 |
||
309 |
hasWorkaround: symbol |
|
310 |
||
311 |
workarounds ifNil:[^false]. |
|
312 |
^workarounds includes: symbol. |
|
313 |
||
314 |
"Created: / 03-06-2011 / 10:00:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
315 |
! |
|
316 |
||
317 |
useWorkaround: symbol |
|
318 |
||
319 |
workarounds := (workarounds ? #()) , (Array with: symbol) |
|
320 |
||
321 |
"Created: / 03-06-2011 / 10:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
322 |
! ! |
|
323 |
||
324 |
!XEmbedContainerView::ClientView methodsFor:'event handling'! |
|
325 |
||
5900
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
326 |
focusIn |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
327 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
328 |
super focusIn. |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
329 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
330 |
superView sendXEmbedEvent: "XEMBED_FOCUS_IN"4 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
331 |
detail: 0 data1: 0 data2: 0 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
332 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
333 |
"Created: / 31-05-2011 / 00:05:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
334 |
! |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
335 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
336 |
focusOut |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
337 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
338 |
super focusOut. |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
339 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
340 |
superView sendXEmbedEvent: "XEMBED_FOCUS_OUT"5 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
341 |
detail: 0 data1: 0 data2: 0 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
342 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
343 |
"Created: / 31-05-2011 / 00:05:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
344 |
! |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
345 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
346 |
hasKeyboardFocus:aBoolean |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
347 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
348 |
super hasKeyboardFocus:aBoolean. |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
349 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
350 |
superView sendXEmbedEvent: (aBoolean ifTrue:[4] ifFalse:[5]) |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
351 |
detail: 0 data1: 0 data2: 0 |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
352 |
|
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
353 |
"Created: / 03-04-2012 / 10:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
354 |
! |
1715009ebe66
added: #hasKeyboardFocus:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5844
diff
changeset
|
355 |
|
5747 | 356 |
propertyChange:propertyId state:state |
6277 | 357 |
propertyId == (self graphicsDevice atomIDOf:'_XEMBED_INFO') ifTrue:[ |
5747 | 358 |
self mapUnmapAccordingToXEmbedInfo. |
359 |
^self. |
|
360 |
]. |
|
361 |
||
362 |
(superView notNil and:[superView hasWorkaround: #uzbl]) ifTrue:[ |
|
6277 | 363 |
propertyId == (self graphicsDevice atomIDOf:'WM_NORMAL_HINTS') ifTrue:[ |
364 |
self graphicsDevice |
|
365 |
resizeWindow:self drawableId |
|
366 |
width: 0 height: 0. |
|
367 |
self graphicsDevice |
|
368 |
resizeWindow:self drawableId |
|
369 |
width: self width - 1 height: self height - 1. |
|
370 |
] |
|
5747 | 371 |
] |
372 |
||
373 |
"Created: / 01-06-2011 / 13:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
374 |
"Modified: / 10-06-2011 / 23:29:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
375 |
! ! |
|
376 |
||
377 |
!XEmbedContainerView::ClientView methodsFor:'initialization & release'! |
|
378 |
||
379 |
destroy |
|
8970 | 380 |
|id| |
381 |
||
5844 | 382 |
superView notNil ifTrue:[ |
383 |
superView clientUnplugged: false. |
|
384 |
superView removeSubView:self. |
|
385 |
]. |
|
8970 | 386 |
(id := self drawableId) notNil ifTrue:[ |
6277 | 387 |
self graphicsDevice |
8970 | 388 |
reparentWindow:id to:(self graphicsDevice rootWindowId); |
389 |
removeKnownView:self withId:id. |
|
5747 | 390 |
] |
391 |
||
392 |
"Created: / 02-06-2011 / 17:39:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5844 | 393 |
"Modified: / 11-02-2012 / 17:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5747 | 394 |
! |
395 |
||
396 |
initEvents |
|
6277 | 397 |
|graphicsDevice| |
5747 | 398 |
|
6277 | 399 |
graphicsDevice := self graphicsDevice. |
400 |
||
401 |
graphicsDevice |
|
5747 | 402 |
setEventMask: |
6277 | 403 |
((graphicsDevice eventMaskFor:#structureNotify) bitOr: |
404 |
((graphicsDevice eventMaskFor:#propertyChange) bitOr: |
|
405 |
(graphicsDevice eventMaskFor:#focusChange))) |
|
406 |
in:self drawableId. |
|
5747 | 407 |
|
408 |
"Created: / 02-06-2011 / 17:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
409 |
! |
|
410 |
||
411 |
setContainer: container id: wid |
|
6277 | 412 |
self setDevice:container device id:wid gcId:nil. |
5747 | 413 |
superView := container. |
414 |
windowGroup := container windowGroup. |
|
6277 | 415 |
self graphicsDevice addKnownView: self withId: wid. |
5747 | 416 |
container add: self. |
417 |
self initEvents. |
|
418 |
self origin: 0.0@0.0 corner: 1.0@1.0. |
|
419 |
||
420 |
"Created: / 02-06-2011 / 17:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
421 |
"Modified: / 02-06-2011 / 19:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
422 |
! ! |
|
423 |
||
424 |
!XEmbedContainerView::ClientView methodsFor:'private'! |
|
425 |
||
426 |
mapUnmapAccordingToXEmbedInfo |
|
427 |
|val| |
|
8343 | 428 |
val := self graphicsDevice |
429 |
getProperty:'_XEMBED_INFO' |
|
430 |
from:self |
|
431 |
delete:false. |
|
432 |
val isNil ifTrue:[ |
|
433 |
self map. |
|
434 |
^ self |
|
435 |
]. |
|
5747 | 436 |
|
8343 | 437 |
val key == 0 ifTrue:[ |
438 |
^ self "Huh. may this happen?" |
|
439 |
]. |
|
440 |
val value second == 1 ifTrue:[ |
|
441 |
shown ifFalse:[self map] |
|
442 |
] ifFalse:[ |
|
443 |
shown ifTrue:[self unmap] |
|
444 |
]. |
|
5747 | 445 |
|
446 |
"Created: / 02-06-2011 / 18:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8343 | 447 |
"Modified: / 25-04-2018 / 15:11:45 / stefan" |
5747 | 448 |
! ! |
449 |
||
450 |
!XEmbedContainerView class methodsFor:'documentation'! |
|
451 |
||
452 |
version_CVS |
|
7107 | 453 |
^ '$Header$' |
5747 | 454 |
! |
455 |
||
456 |
version_SVN |
|
6241 | 457 |
^ '$ Id $' |
5747 | 458 |
! ! |
459 |
||
6241 | 460 |
|
5747 | 461 |
XEmbedContainerView initialize! |