X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdisplay%2Fsp-canvas.h;h=9c8b199823db70799ded17afa50920ea4b94bc56;hb=0dc33d4ce43e0bb49c63aa53b826ec4a1ff68e28;hp=a17e2e086ffc4854cfcfd2d12c83baecc2569ac6;hpb=45660a4d22b900c4e70963313065f2f9bf57c9f7;p=inkscape.git diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index a17e2e086..9c8b19982 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -2,7 +2,7 @@ #define SEEN_SP_CANVAS_H /** \file - * SPCanvas, SPCanvasBuf, and SPCanvasItem. + * SPCanvas, SPCanvasBuf. * * Authors: * Federico Mena @@ -42,9 +42,15 @@ G_BEGIN_DECLS +#define SP_TYPE_CANVAS sp_canvas_get_type() +#define SP_CANVAS(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS, SPCanvas)) +#define SP_IS_CANVAS(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS)) + +GType sp_canvas_get_type(); + struct SPCanvas; +struct SPCanvasItem; struct SPCanvasGroup; -typedef struct _SPCanvasItemClass SPCanvasItemClass; enum { SP_CANVAS_UPDATE_REQUESTED = 1 << 0, @@ -66,57 +72,8 @@ struct SPCanvasBuf{ cairo_t *ct; }; -/** - * An SPCanvasItem refers to a SPCanvas and to its parent item; it has - * four coordinates, a bounding rectangle, and a transformation matrix. - */ -struct SPCanvasItem : public GtkObject { - SPCanvas *canvas; - SPCanvasItem *parent; - - double x1, y1, x2, y2; - Geom::Rect bounds; - Geom::Matrix xform; -}; - -/** - * The vtable of an SPCanvasItem. - */ -struct _SPCanvasItemClass : public GtkObjectClass { - void (* update) (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags); - - void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); - double (* point) (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item); - - int (* event) (SPCanvasItem *item, GdkEvent *event); -}; - -SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...); - G_END_DECLS -#define sp_canvas_item_set gtk_object_set - -void sp_canvas_item_affine_absolute(SPCanvasItem *item, Geom::Matrix const &aff); - -void sp_canvas_item_raise(SPCanvasItem *item, int positions); -void sp_canvas_item_lower(SPCanvasItem *item, int positions); -void sp_canvas_item_show(SPCanvasItem *item); -void sp_canvas_item_hide(SPCanvasItem *item); -int sp_canvas_item_grab(SPCanvasItem *item, unsigned int event_mask, GdkCursor *cursor, guint32 etime); -void sp_canvas_item_ungrab(SPCanvasItem *item, guint32 etime); - -Geom::Matrix sp_canvas_item_i2w_affine(SPCanvasItem const *item); - -void sp_canvas_item_grab_focus(SPCanvasItem *item); - -void sp_canvas_item_request_update(SPCanvasItem *item); - -/* get item z-order in parent group */ - -gint sp_canvas_item_order(SPCanvasItem * item); - - // SPCanvas ------------------------------------------------- /** * Port of GnomeCanvas for inkscape needs.