Basic Live Connect support for java

Koos Vriezen koos.vriezen at xs4all.nl
Sun Apr 28 12:25:53 BST 2002


On Fri, 26 Apr 2002, Koos Vriezen wrote:

> On Fri, 26 Apr 2002, Koos Vriezen wrote:
> > I still think setting up a khtml_plugin interface should be done first.
> > So maybe
> >
> > Create a khtml/plugin dir which contains contains a khtml_plugin.so that
> > is loaded by khtml when needed. It also declares a DCOP interface in
> > the html widget (konqueror-xxx html-widgetx pluginx), that can do JS
> > calls (evalJS will do). A khtml_plugin has also a QWidget derive.

So this could be the khtml view of the plugin:

  class KHTMLPluginAdaptIface : public DCOPObject {
    K_DCOP
  public:
    KHTMLPluginAdaptIface( DOM::HTMLElement * );
    virtual ~KHTMLPartiAdaptIface();
    QWidget * getWidget();
  k_dcop:
    virtual void pluginEvent(const QString event, const QStringList args);
    virtual QString evalJS(const QString &script);
  private:
    DOM::HTMLElement *element;
  };

> > A libkhtmlplugin.so that contains a DCOP interface for
> > put/get/call/init/start/getWinId calls. These are called from
> > khtml_plugin.so.

Copied a bit from nsplugin and merged some LiveConnect for Java here:

  class KHTMLPlugin : virtual public DCOPObject {
    K_DCOP
  k_dcop:
    virtual DCOPRef newInstance(QString url, QString classId, bool embed,
                                QStringList argn, QStringList argv,
                                QString appId, QString callbackId ) = 0;
    virtual QString getMIMEDescription() = 0;
    virtual QStringList queryClassIds();
  };

  class KHTMLPluginInstanceIface : public DCOPObject {
    K_DCOP
  public:
    virtual ~KHTMLPartInstanceIface();
  k_dcop:
    virtual bool init();
    virtual bool start();
    virtual bool shutdown();
    virtual int winId() = 0;
    virtual void resize(int w, int h) = 0;
    virtual QString call(const QString func, const QStringList args);
    virtual bool put(const QString field, const QString val);
    virtual QString get(const QString field, const QString val);
  };

Don't know about getMIMEDescription and queryClassIds redundancy here. But
a plugin can support multible plugins (eg. nspluginviewer). Also didn't
know what to do with 'setWindow(int remove=0)'.

> Thinking of this a bit further, can DCOP be used for dynamic object
> traversal? E.g.
>    dcop konqueror-xxx html-widgetx pluginx
> shows all members of this plugin (applet).
>    dcop konqueror-xxx html-widgetx pluginx myobject
> shows all members of this applet's member object.
> Then we would need a JS->DCOP implementation in khtml_plugin.so.

Forget about this.

> > khtml/plugin/plugins dir contains subdirs
> > java/ns4/mozilla/crossover/kpart(for local browsing)/...
> > Each subdir contains a specialized excecutable linked against
> > libkhtmlplugin.so, and implements the DCOP calls.

Ultimate goal of course is to let third parties develop plugins ;-).

Does all this sounds very wrong?

Koos Vriezen





More information about the kfm-devel mailing list