Code

associate an item with the line, for grdrag
authorbuliabyak <buliabyak@users.sourceforge.net>
Tue, 16 Oct 2007 05:07:46 +0000 (05:07 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Tue, 16 Oct 2007 05:07:46 +0000 (05:07 +0000)
src/display/sp-ctrlline.cpp
src/display/sp-ctrlline.h

index 85f8fdc606663af846a1edd63095f62d95041422..e948058310edb9889f576257192142267d42552d 100644 (file)
@@ -78,6 +78,7 @@ sp_ctrlline_init (SPCtrlLine *ctrlline)
     ctrlline->rgba = 0x0000ff7f;
     ctrlline->s.x = ctrlline->s.y = ctrlline->e.x = ctrlline->e.y = 0.0;
     ctrlline->shp=NULL;
+    ctrlline->item=NULL;
 }
 
 static void
@@ -93,6 +94,8 @@ sp_ctrlline_destroy (GtkObject *object)
         ctrlline->shp = NULL;
     }
 
+    ctrlline->item=NULL;
+
     if (GTK_OBJECT_CLASS (parent_class)->destroy)
         (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
 }
index d466e16cfaac97ab9e3f104749bb500f518041b3..d7863bf19a0bf719d3699142dbed7e46cde6e77c 100644 (file)
 #include <livarot/Shape.h>
 
 
+struct SPItem;
 
 #define SP_TYPE_CTRLLINE (sp_ctrlline_get_type ())
 #define SP_CTRLLINE(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CTRLLINE, SPCtrlLine))
 #define SP_IS_CTRLLINE(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CTRLLINE))
 
 struct SPCtrlLine : public SPCanvasItem{
+    SPItem *item;  // the item to which this line belongs in some sense; may be NULL for some users
     guint32 rgba;
     NRPoint s, e;
     Shape* shp;