Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / display / sp-canvas.h
index cb63374e1f1f500d3875fc88f30effb78aafe270..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,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.
@@ -181,6 +138,9 @@ struct SPCanvas {
     // connector tool).  If so, they may temporarily set this flag to
     // 'true'.
     bool gen_all_enter_events;
+    
+    /* For scripting, sometimes we want to delay drawing. */
+    bool drawing_disabled;
 
     int rendermode;
 
@@ -193,10 +153,6 @@ struct SPCanvas {
 
     Geom::Rect getViewbox() const;
     NR::IRect getViewboxIntegers() const;
-
-    guint watchdog_id;
-    GdkEvent *watchdog_event;
-    bool context_snap_delay_active;
 };
 
 GtkWidget *sp_canvas_new_aa();
@@ -218,8 +174,6 @@ void sp_canvas_world_to_window(SPCanvas const *canvas, double worldx, double wor
 Geom::Point sp_canvas_window_to_world(SPCanvas const *canvas, Geom::Point const win);
 Geom::Point sp_canvas_world_to_window(SPCanvas const *canvas, Geom::Point const world);
 
-void sp_canvas_set_snap_delay_active(SPCanvas *canvas, bool snapping);
-
 #endif // SEEN_SP_CANVAS_H
 
 /*