Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / display / sp-canvas.h
index 5cd2016180dd6be2edfe22a572dc50b6524c3457..9c8b199823db70799ded17afa50920ea4b94bc56 100644 (file)
@@ -2,7 +2,7 @@
 #define SEEN_SP_CANVAS_H
 
 /** \file
- * SPCanvas, SPCanvasBuf, and SPCanvasItem.
+ * SPCanvas, SPCanvasBuf.
  *
  * Authors:
  *   Federico Mena <federico@nuclecu.unam.mx>
 
 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,58 +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);
-bool sp_canvas_item_is_visible(SPCanvasItem *item);
-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.