| Bonobo API Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
typedef BonoboCanvasComponent; typedef BonoboCanvasComponentClass; |
"set-bounds" void user_function (BonoboCanvasComponent *bonobocanvascomponent, |
The BonoboCanvasComponent objects are used to wrap GnomeCanvasItems
and export them to container applications. Typically the
Here is an example of how to export Gnome Canvas Items in a simple way.
Example 1. Wrapping a Gnome Canvas Item
/*
* Here is where the GnomeCanvasItem (in this case an ellipse)
* is created and wrapped in a BonoboCanvasComponent.
*
* This function is invoked on demand on the embeddable
* argument. Embeddables are the document model, and the
* items returned are the views.
*/
BonoboCanvasComponent *
my_item_creator (BonoboEmbeddable *embeddable,
GnomeCanvas *canvas,
void *data)
{
GnomeCanvasItem *item = gnome_canvas_item_new (
gnome_canvas_root (canvas),
|
Applications that do not use the base
On the client side (the application that will embed this component) an object of the type BonoboCanvasItem is used.
typedef struct {
BonoboXObject base;
BonoboCanvasComponentPrivate *priv;
} BonoboCanvasComponent; |
typedef struct {
BonoboXObjectClass parent_class;
POA_Bonobo_Canvas_Component__epv epv;
/* Signals */
void (*set_bounds) (BonoboCanvasComponent *component,
Bonobo_Canvas_DRect *bbox,
CORBA_Environment *ev);
gboolean (*event) (BonoboCanvasComponent *component,
GdkEvent *event);
} BonoboCanvasComponentClass; |
|
| is_aa : | Flag indicating is antialiased canvas is desired |
| proxy : | Remote proxy for the component this canvas will support |
| Returns : | A |
BonoboCanvasComponent* bonobo_canvas_component_construct (BonoboCanvasComponent *comp, |
Creates a CORBA server for the interface Bonobo::Canvas::Item wrapping item.
| comp : | a BonoboCanvasComponent to initialize |
| item : | A |
| Returns : | The BonoboCanvasComponent. |
BonoboCanvasComponent* bonobo_canvas_component_new ( |
Creates a CORBA server for the interface Bonobo::Canvas::Item wrapping item.
| item : | A GnomeCanvasItem that is being exported |
| Returns : | The BonoboCanvasComponent. |
|
| comp : | A BonoboCanvasComponent object |
| Returns : | The GnomeCanvasItem that this BonoboCanvasComponent proxies |
|
| comp : | A BonoboCanvasComponent object |
| Returns : | The UI container for the component's remote proxy. |
void bonobo_canvas_component_grab (BonoboCanvasComponent *comp, |
Grabs the mouse focus via a call to the remote proxy.
| comp : | A BonoboCanvasComponent object |
| mask : | Mask of events to grab |
| cursor : | |
| time : | Time of last event before grab |
void bonobo_canvas_component_ungrab (BonoboCanvasComponent *comp, |
Grabs the mouse focus via a call to the remote proxy.
| comp : | A BonoboCanvasComponent object |
| time : | Time of last event before grab |
void user_function (BonoboCanvasComponent *bonobocanvascomponent, |
| bonobocanvascomponent : | the object which received the signal. |
| arg1 : | |
| arg2 : | |
| user_data : | user data set when the signal handler was connected. |
|
| bonobocanvascomponent : | the object which received the signal. |
| arg1 : | |
| user_data : | user data set when the signal handler was connected. |
| Returns : |