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