Friday, June 22, 2007

ActiveX-like embedding of applications in OpenOffice.org?

I'm working on the problem of embedding applications in an OpenOffice docking window --- similar to the new API inside Word which allows to embed ActiveX applications in a task pane.

I just started “hacking” on the problem and I decided to try whether I can embed a Java Applet inside an OpenOffice.org docking window.

Well I “hacked” :-) the Navigator --- which is a docking window --- and reused some code from the sj module and here it is:





However there a some --- severe --- open problems:
- Focus: The framework knows nothing about XEMBED_REQUEST_FOCUS, etc
(http://standards.freedesktop.org/xembed-spec/latest/ar01s05.html)
So there is a focus problem when the applet is running in "docked" mode. (Maybe this is also the problem why the OOoBean is not working so good?)
- Need to clone the Navigator code...
- Resize problem and other events. Currently the embedded app is not notified
about resize events.
- Need to define an API to get link between embedded aps and the custom
pane.
- Some "solar mutex" problems as always :-)

2 comments:

Anonymous said...

Hi Florian, nice hack. :-)

I think the most promising way to embed Java applets and other external objects is to build upon the embedded object funtionality as seen in the code of the embeddedobj module and some sfx2 classes (sfx2/source/doc/plugin.cxx, iframe.cxx, applet.cxx). Another piece of code to learn from is the sfx2/source/dialog/partwnd.cxx that can be taken as a container for any of these objects. Some time ago I hacked something like this by myself but I didn't keep the code.

Florian Reuter said...

Hi Mathias,

Thanks.

At the end I was really suprised how easy it was and how good it looks :-)

I hope I can get it stable...