The BonoboClientSite implements the
Bonobo::ClientSite CORBA interface. It acts
as the container-side contact for
BonoboEmbeddable objects.
For each object embedded in your application, you should create a
BonoboClientSite object.
Once you have a handle on a remote object that implements the
Bonobo::Embeddable interface (typically
returned by bonobo_object_activate() or
bonobo_get_object() or wrapper with
bonobo_object_client_from_corba()) of type
BonoboObjectClient), you will have to bind
this object to the BonoboClientSite using the
bonobo_client_site_bind_embeddable(). Once this is done, you will
be able to request a BonoboView on the BonoboClientSite.
The BonoboClientSite object also provides access to the remote
BonoboEmbeddable object's verb list.
Example 1. Sample usage
This demostrates the use of the BonoboClientSite object. This
launches the object specified, creates a BonoboClientSite,
then requests a new BonoboViewFrame and finally it returns the
widget that represents that component.
GtkWidget *
create_widget_from_component (BonoboContainer *container, const char *id)
{
BonoboObjectClient *server;
BonoboClientSite *client_site;
BonoboViewFrame *view_frame;
/*
* Launch the requested component
*/
server = bonobo_object_activate (id, 0);
if (!server){
printf ("Could not activate the server");
return NULL;
}
client_site = bonobo_client_site_new (app->container);
/*
* Add this client site to the container
*/
bonobo_container_add (container, BONOBO_OBJECT (client_site));
/*
* Bind the component to the client site
*/
bonobo_client_site_bind_embeddable (client_site, server);
/*
* Create a new BonoboView, and then get a GtkWidget
*/
view_frame = bonobo_client_site_embeddable_new_view (client_site);
/*
* Get the widget for this view.
*/
return bonobo_view_frame_get_wrapper (view_frame);
}
Container programs should provide a BonoboClientSite GTK object (ie,
a Bonobo::ClientSite CORBA server) for each Embeddable which they
embed. This is the contact end point for the remote
Bonobo::Embeddable object.
This routine creates a new BonoboClientSite.
container :
The container to which this client_site belongs.
Returns :
The activated BonoboClientSite object bound to the container
container.
This routine binds a remote Embeddable object to a local
BonoboClientSite object. The idea is that there is always a
one-to-one mapping between BonoboClientSites and BonoboEmbeddables.
The Embeddable uses its BonoboClientSite to communicate with the
container in which it is embedded.
client_site :
the client site to which the remote Embeddable object will be bound.
object :
The remote object which supports the Bonobo::Embeddable interface.
Returns :
TRUE if object was successfully bound to client_siteclient_site.
Creates a ViewFrame and asks the remote server_object (which must
support the Bonobo::Embeddable interface) to provide a new view of
its data. The remote server_object will construct a BonoboView
object which corresponds to the new BonoboViewFrame returned by this
function.
client_site :
the client site that contains a remote Embeddable object.
uic :
The CORBA object for the container's UIContainer server.
visible_cover :
TRUE if the cover should draw a border when it is active.
active_view :
TRUE if the view should be uncovered when it is created.
Returns :
A BonoboViewFrame object that contains the view frame for
the new view of server_object.