BonoboCanvasComponent

Name

BonoboCanvasComponent -- Class for exporting BonoboCanvasItems through BonoboEmbeddables to other applications.

Synopsis



#define     BONOBO_CANVAS_COMPONENT_TYPE
#define     BONOBO_CANVAS_COMPONENT         (o)
#define     BONOBO_CANVAS_COMPONENT_CLASS   (k)
#define     BONOBO_IS_CANVAS_COMPONENT      (o)
#define     BONOBO_IS_CANVAS_COMPONENT_CLASS(k)
typedef     BonoboCanvasComponent;
typedef     BonoboCanvasComponentClass;
Bonobo_Canvas_Component bonobo_canvas_component_object_create
                                            (BonoboObject *object);
void        bonobo_canvas_component_set_proxy
                                            (BonoboCanvasComponent *comp,
                                             Bonobo_Canvas_ComponentProxy proxy);
BonoboCanvasComponent* bonobo_canvas_component_construct
                                            (BonoboCanvasComponent *comp,
                                             Bonobo_Canvas_Component corba_canvas_comp,
                                             GnomeCanvasItem *item);
BonoboCanvasComponent* bonobo_canvas_component_new
                                            (GnomeCanvasItem *item);
GnomeCanvasItem* bonobo_canvas_component_get_item
                                            (BonoboCanvasComponent *comp);
POA_Bonobo_Canvas_Component__epv* bonobo_canvas_component_get_epv
                                            (void);

Description

The BonoboCanvasComponent objects are used to wrap a GnomeCanvasItems and export them to a container application. Typically the bonobo_component_canvas_new() function will be invoked in a callback from a BonoboEmbeddable object. Like this:

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),
                gnome_canvas_ellipse_get_type(),
                "x1", 5.0,  "y1", 5.0,
                "x2", 95.0, "y2", 95.0,
                "fill_color", "white",
                "outline_color", "black",
                NULL);

        return gnome_canvas_component_new (item);
}

/*
 * This is a routine that creates a BonoboEmbeddable that
 * uses CanvasItems.
 */
BonoboEmbeddable *make_embeddable (void)
{
       return bonobo_embeddable_new_canvas_item (my_item_creator, NULL);
}
    

Applications that do not use the base BonoboEmbeddable class, but use their own types derived from the BonoboEmbeddable can use the bonobo_embeddable_construct() during their construction phase.

On the client side (the application that will embed this component) an object of the type BonoboCanvasItem is used.

Details

BONOBO_CANVAS_COMPONENT_TYPE

#define BONOBO_CANVAS_COMPONENT_TYPE        (bonobo_canvas_component_get_type ())


BONOBO_CANVAS_COMPONENT()

#define BONOBO_CANVAS_COMPONENT(o)          (GTK_CHECK_CAST ((o), BONOBO_CANVAS_COMPONENT_TYPE, BonoboCanvasComponent))

o : 


BONOBO_CANVAS_COMPONENT_CLASS()

#define BONOBO_CANVAS_COMPONENT_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), BONOBO_CANVAS_COMPONENT__TYPE, BonoboCanvasComponentClass))

k : 


BONOBO_IS_CANVAS_COMPONENT()

#define BONOBO_IS_CANVAS_COMPONENT(o)       (GTK_CHECK_TYPE ((o), BONOBO_CANVAS_COMPONENT_TYPE))

o : 


BONOBO_IS_CANVAS_COMPONENT_CLASS()

#define BONOBO_IS_CANVAS_COMPONENT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_CANVAS_COMPONENT_TYPE))

k : 


BonoboCanvasComponent

typedef struct {
	BonoboObject base;
	BonoboCanvasComponentPrivate *priv;
} BonoboCanvasComponent;


BonoboCanvasComponentClass

typedef struct {
	BonoboObjectClass parent_class;

	/*
	 * Signals
	 */
	 void (*set_bounds) (BonoboCanvasComponent *component,
			     Bonobo_Canvas_DRect *bbox,
			     CORBA_Environment *ev);
} BonoboCanvasComponentClass;


bonobo_canvas_component_object_create ()

Bonobo_Canvas_Component bonobo_canvas_component_object_create
                                            (BonoboObject *object);

object : 
Returns : 


bonobo_canvas_component_set_proxy ()

void        bonobo_canvas_component_set_proxy
                                            (BonoboCanvasComponent *comp,
                                             Bonobo_Canvas_ComponentProxy proxy);

comp : 
proxy : 


bonobo_canvas_component_construct ()

BonoboCanvasComponent* bonobo_canvas_component_construct
                                            (BonoboCanvasComponent *comp,
                                             Bonobo_Canvas_Component corba_canvas_comp,
                                             GnomeCanvasItem *item);

comp : 
corba_canvas_comp : 
item : 
Returns : 


bonobo_canvas_component_new ()

BonoboCanvasComponent* bonobo_canvas_component_new
                                            (GnomeCanvasItem *item);

item : 
Returns : 


bonobo_canvas_component_get_item ()

GnomeCanvasItem* bonobo_canvas_component_get_item
                                            (BonoboCanvasComponent *comp);

comp : 
Returns : 


bonobo_canvas_component_get_epv ()

POA_Bonobo_Canvas_Component__epv* bonobo_canvas_component_get_epv
                                            (void);

Returns : 

See Also

BonoboEmbeddable, BonoboCanvasItem