136 |
136 |
137 topView open. |
137 topView open. |
138 Delay waitForMilliseconds:5. |
138 Delay waitForMilliseconds:5. |
139 topView |
139 topView |
140 label:(self classResources string:'XEmbedContainerView ' |
140 label:(self classResources string:'XEmbedContainerView ' |
141 , xembed embeddingWindowId address printString). |
141 , xembed embeddingWindowId printString). |
142 self == XEmbedContainerView |
142 self == XEmbedContainerView |
143 ifTrue: |
143 ifTrue: |
144 [ Transcript |
144 [ Transcript |
145 show:'XEmbed Socket WID: ' , xembed embeddingWindowId address printString; |
145 show:'XEmbed Socket WID: ' , xembed embeddingWindowId printString; |
146 cr ]. |
146 cr ]. |
147 ^ xembed |
147 ^ xembed |
148 |
148 |
149 " |
149 " |
150 Workspace open" |
150 Workspace open |
|
151 " |
151 |
152 |
152 "Modified: / 16-05-1998 / 16:53:53 / cg" |
153 "Modified: / 16-05-1998 / 16:53:53 / cg" |
153 "Created: / 30-05-2011 / 23:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
154 "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 "Modified: / 06-06-2011 / 18:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
155 ! ! |
156 ! ! |
156 |
157 |
157 !XEmbedContainerView methodsFor:'accessing'! |
158 !XEmbedContainerView methodsFor:'accessing'! |
158 |
159 |
159 embeddingWindowId |
160 embeddingWindowId |
160 ^ drawableId address |
161 ^ self drawableId address |
161 |
162 |
162 "Created: / 06-06-2011 / 10:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
163 "Created: / 06-06-2011 / 10:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
163 ! |
164 ! |
164 |
165 |
165 workarounds |
166 workarounds |
191 ! |
192 ! |
192 |
193 |
193 createWindowX:x y:y width:w height:h |
194 createWindowX:x y:y width:w height:h |
194 |childWindowIds| |
195 |childWindowIds| |
195 |
196 |
196 childWindowIds := device childIdsOf:drawableId. |
197 childWindowIds := self graphicsDevice childIdsOf:self drawableId. |
197 childWindowIds size == 1 |
198 childWindowIds size == 1 |
198 ifFalse:[ self error:'I should have exactly one child'. ]. |
199 ifFalse:[ self error:'I should have exactly one child'. ]. |
199 clientViewId := childWindowIds first. |
200 clientViewId := childWindowIds first. |
200 clientView := ClientView new setContainer: self id: clientViewId. |
201 clientView := ClientView new setContainer: self id: clientViewId. |
201 self sendXEmbeddedNotify. |
202 self sendXEmbeddedNotify. |
351 |
350 |
352 "Created: / 03-04-2012 / 10:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
351 "Created: / 03-04-2012 / 10:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
353 ! |
352 ! |
354 |
353 |
355 propertyChange:propertyId state:state |
354 propertyChange:propertyId state:state |
356 propertyId == (device atomIDOf:'_XEMBED_INFO') ifTrue:[ |
355 propertyId == (self graphicsDevice atomIDOf:'_XEMBED_INFO') ifTrue:[ |
357 self mapUnmapAccordingToXEmbedInfo. |
356 self mapUnmapAccordingToXEmbedInfo. |
358 ^self. |
357 ^self. |
359 ]. |
358 ]. |
360 |
359 |
361 |
|
362 (superView notNil and:[superView hasWorkaround: #uzbl]) ifTrue:[ |
360 (superView notNil and:[superView hasWorkaround: #uzbl]) ifTrue:[ |
363 propertyId == (device atomIDOf:'WM_NORMAL_HINTS') ifTrue:[ |
361 propertyId == (self graphicsDevice atomIDOf:'WM_NORMAL_HINTS') ifTrue:[ |
364 device |
362 self graphicsDevice |
365 resizeWindow:drawableId |
363 resizeWindow:self drawableId |
366 width: 0 height: 0. |
364 width: 0 height: 0. |
367 device |
365 self graphicsDevice |
368 resizeWindow:drawableId |
366 resizeWindow:self drawableId |
369 width: self width - 1 height: self height - 1. |
367 width: self width - 1 height: self height - 1. |
370 ] |
368 ] |
371 |
|
372 |
|
373 |
|
374 ] |
369 ] |
375 |
370 |
376 "Created: / 01-06-2011 / 13:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
371 "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>" |
372 "Modified: / 10-06-2011 / 23:29:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
378 ! ! |
373 ! ! |
379 |
374 |
380 !XEmbedContainerView::ClientView methodsFor:'initialization & release'! |
375 !XEmbedContainerView::ClientView methodsFor:'initialization & release'! |
381 |
376 |
382 destroy |
377 destroy |
383 |
|
384 superView notNil ifTrue:[ |
378 superView notNil ifTrue:[ |
385 superView clientUnplugged: false. |
379 superView clientUnplugged: false. |
386 superView removeSubView:self. |
380 superView removeSubView:self. |
387 ]. |
381 ]. |
388 drawableId ifNotNil:[ |
382 self drawableId notNil ifTrue:[ |
389 device |
383 self graphicsDevice |
390 reparentWindow: drawableId to: device rootWindowId; |
384 reparentWindow: self drawableId to: self graphicsDevice rootWindowId; |
391 removeKnownView:self withId:drawableId. |
385 removeKnownView:self withId:self drawableId. |
392 ] |
386 ] |
393 |
387 |
394 "Created: / 02-06-2011 / 17:39:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
388 "Created: / 02-06-2011 / 17:39:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
395 "Modified: / 11-02-2012 / 17:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
389 "Modified: / 11-02-2012 / 17:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
396 ! |
390 ! |
397 |
391 |
398 initEvents |
392 initEvents |
399 |
393 |graphicsDevice| |
400 device |
394 |
|
395 graphicsDevice := self graphicsDevice. |
|
396 |
|
397 graphicsDevice |
401 setEventMask: |
398 setEventMask: |
402 ((device eventMaskFor:#structureNotify) bitOr: |
399 ((graphicsDevice eventMaskFor:#structureNotify) bitOr: |
403 ((device eventMaskFor:#propertyChange) bitOr: |
400 ((graphicsDevice eventMaskFor:#propertyChange) bitOr: |
404 (device eventMaskFor:#focusChange))) |
401 (graphicsDevice eventMaskFor:#focusChange))) |
405 |
402 in:self drawableId. |
406 in:drawableId. |
|
407 |
403 |
408 "Created: / 02-06-2011 / 17:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
404 "Created: / 02-06-2011 / 17:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
409 ! |
405 ! |
410 |
406 |
411 setContainer: container id: wid |
407 setContainer: container id: wid |
412 |
408 self setDevice:container device id:wid gcId:nil. |
413 drawableId := wid. |
|
414 superView := container. |
409 superView := container. |
415 device := container device. |
|
416 windowGroup := container windowGroup. |
410 windowGroup := container windowGroup. |
417 device addKnownView: self withId: wid. |
411 self graphicsDevice addKnownView: self withId: wid. |
418 container add: self. |
412 container add: self. |
419 self initEvents. |
413 self initEvents. |
420 self origin: 0.0@0.0 corner: 1.0@1.0. |
414 self origin: 0.0@0.0 corner: 1.0@1.0. |
421 |
415 |
422 "Created: / 02-06-2011 / 17:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
416 "Created: / 02-06-2011 / 17:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |