The interfaces

GNOME::container

The GNOME::container interface is rather simple:

module GNOME {

  interface ParseDisplayName : Unknown {
    exception SyntaxError {};
  };

  interface Container : ParseDisplayName {
    typedef sequence<Unknown> ObjectList;

    ObjectList enum_objects ();

    exception NotFound {};
    Unknown get_object (in string item_name, in boolean only_if_exists)
            raises (SyntaxError, NotFound);
  };
};

This interface is mainly used to activate the embedded components when linking is used. Nothing really interesting.

The other interfaces, mainly GNOME::ClientSite and GNOME::ViewFrame are much more interesting. They are responsible for the real embedding of the components.

GNOME::ClientSite

Here is the ClientSite idl ( bonobo/idl/gnome-client-site.idl )

module GNOME {
  interface ClientSite : GNOME::Unknown {

    Container get_container ();

    void show_window (in boolean shown);

    Persist::Status save_object ();
  };
};

GNOME::ViewFrame

Here is the GNOME::ViewFrame idl definition ( bonobo/idl/gnome-embeddable.idl ):

module GNOME {
  interface ViewFrame : GNOME::Unknown {
    typedef sequence<octet> pixbuf;

    ClientSite get_client_site ();

    UIHandler get_ui_handler ();

    void view_activated (in boolean state);

    void deactivate_and_undo ();

    void request_resize (in short new_width, in short new_height);

    void activate_uri (in string uri, in boolean relative);
  };
};

A summary

The complexity of the interfaces presented should not hide from you the fact that what happens is *REALLY* simple.

Let's imagine i ask the container to insert a component by the "insert from" menu. The container will first try to locate the desired component with the GOAD. The component's factory will be started if not already and an instance of the component will be build. The container will add to its internal list of components this component.

The container then creates a ClientSite for the new component and the designed ClientSite creates a ViewFrame. The ClientSite is passed to the component as well as the ViewFrame so that it may build the corresponding GNOME::embeddable and GNOME::View interfaces.

Once all the interfaces are build, the container intercepts all events on the non-activated component view. If a double-click occurs, the container notifies the component of this to allow the component to activate itself (ie: create a new window for editing or merge its toolbars/menus for in-place editing). The container waits for the component to tell him it is activated and then it greys the edited view to show the user it is being edited.

That's all ! The following section will show you how to implement such a set of interfaces and will show you how the different interfaces interact.