Code

When switching context by pressing a key, while dragging to create a new shape, the...
authordvlierop2 <dvlierop2@users.sourceforge.net>
Sat, 1 Aug 2009 12:29:37 +0000 (12:29 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Sat, 1 Aug 2009 12:29:37 +0000 (12:29 +0000)
src/arc-context.cpp
src/box3d-context.cpp
src/rect-context.cpp
src/spiral-context.cpp
src/star-context.cpp

index dcb326bcd3e718635f3d8617845c9e762c49eea8..e689c93db186669b3768243e8d755cb40536aa6a 100644 (file)
@@ -50,6 +50,7 @@ static void sp_arc_context_init(SPArcContext *arc_context);
 static void sp_arc_context_dispose(GObject *object);
 
 static void sp_arc_context_setup(SPEventContext *ec);
+static void sp_arc_context_finish(SPEventContext *ec);
 static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent *event);
 static gint sp_arc_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
 
@@ -89,6 +90,7 @@ static void sp_arc_context_class_init(SPArcContextClass *klass)
     object_class->dispose = sp_arc_context_dispose;
 
     event_context_class->setup = sp_arc_context_setup;
+    event_context_class->finish = sp_arc_context_finish;
     event_context_class->root_handler = sp_arc_context_root_handler;
     event_context_class->item_handler = sp_arc_context_item_handler;
 }
@@ -111,6 +113,20 @@ static void sp_arc_context_init(SPArcContext *arc_context)
     new (&arc_context->sel_changed_connection) sigc::connection();
 }
 
+static void sp_arc_context_finish(SPEventContext *ec)
+{
+    SPArcContext *ac = SP_ARC_CONTEXT(ec);
+       SPDesktop *desktop = ec->desktop;
+
+       sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+       sp_arc_finish(ac);
+    ac->sel_changed_connection.disconnect();
+
+    if (((SPEventContextClass *) parent_class)->finish) {
+               ((SPEventContextClass *) parent_class)->finish(ec);
+       }
+}
+
 static void sp_arc_context_dispose(GObject *object)
 {
     SPEventContext *ec = SP_EVENT_CONTEXT(object);
index fd72e406bd5da6ed29d760cef73ff407e80eccd9..128b5f2ff187bd27f882963d59180c587e857e87 100644 (file)
@@ -54,6 +54,7 @@ static void sp_box3d_context_init(Box3DContext *box3d_context);
 static void sp_box3d_context_dispose(GObject *object);
 
 static void sp_box3d_context_setup(SPEventContext *ec);
+static void sp_box3d_context_finish(SPEventContext *ec);
 
 static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEvent *event);
 static gint sp_box3d_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
@@ -92,6 +93,7 @@ static void sp_box3d_context_class_init(Box3DContextClass *klass)
     object_class->dispose = sp_box3d_context_dispose;
 
     event_context_class->setup = sp_box3d_context_setup;
+    event_context_class->finish = sp_box3d_context_finish;
     event_context_class->root_handler  = sp_box3d_context_root_handler;
     event_context_class->item_handler  = sp_box3d_context_item_handler;
 }
@@ -119,6 +121,21 @@ static void sp_box3d_context_init(Box3DContext *box3d_context)
     new (&box3d_context->sel_changed_connection) sigc::connection();
 }
 
+static void sp_box3d_context_finish(SPEventContext *ec)
+{
+       Box3DContext *bc = SP_BOX3D_CONTEXT(ec);
+       SPDesktop *desktop = ec->desktop;
+
+       sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+       sp_box3d_finish(bc);
+    bc->sel_changed_connection.disconnect();
+
+    if (((SPEventContextClass *) parent_class)->finish) {
+               ((SPEventContextClass *) parent_class)->finish(ec);
+       }
+}
+
+
 static void sp_box3d_context_dispose(GObject *object)
 {
     Box3DContext *bc = SP_BOX3D_CONTEXT(object);
index ef5881378fd0fd7b17fcafdfdc1ebacfc958426d..b88b4b83aba5a5f1443f01cf2fce2646fff87752 100644 (file)
@@ -50,6 +50,7 @@ static void sp_rect_context_init(SPRectContext *rect_context);
 static void sp_rect_context_dispose(GObject *object);
 
 static void sp_rect_context_setup(SPEventContext *ec);
+static void sp_rect_context_finish(SPEventContext *ec);
 static void sp_rect_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val);
 
 static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent *event);
@@ -91,6 +92,7 @@ static void sp_rect_context_class_init(SPRectContextClass *klass)
     object_class->dispose = sp_rect_context_dispose;
 
     event_context_class->setup = sp_rect_context_setup;
+    event_context_class->finish = sp_rect_context_finish;
     event_context_class->set = sp_rect_context_set;
     event_context_class->root_handler  = sp_rect_context_root_handler;
     event_context_class->item_handler  = sp_rect_context_item_handler;
@@ -117,6 +119,21 @@ static void sp_rect_context_init(SPRectContext *rect_context)
     new (&rect_context->sel_changed_connection) sigc::connection();
 }
 
+static void sp_rect_context_finish(SPEventContext *ec)
+{
+    SPRectContext *rc = SP_RECT_CONTEXT(ec);
+       SPDesktop *desktop = ec->desktop;
+
+       sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+       sp_rect_finish(rc);
+    rc->sel_changed_connection.disconnect();
+
+    if (((SPEventContextClass *) parent_class)->finish) {
+               ((SPEventContextClass *) parent_class)->finish(ec);
+       }
+}
+
+
 static void sp_rect_context_dispose(GObject *object)
 {
     SPRectContext *rc = SP_RECT_CONTEXT(object);
index 5c7c43c83808f325d5ada1ccbb1424b33ab6f392..3825f74c7909376eba419ad1571d2f8e56bfc4e7 100644 (file)
@@ -46,6 +46,7 @@ static void sp_spiral_context_class_init(SPSpiralContextClass * klass);
 static void sp_spiral_context_init(SPSpiralContext *spiral_context);
 static void sp_spiral_context_dispose(GObject *object);
 static void sp_spiral_context_setup(SPEventContext *ec);
+static void sp_spiral_context_finish(SPEventContext *ec);
 static void sp_spiral_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val);
 
 static gint sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event);
@@ -87,6 +88,7 @@ sp_spiral_context_class_init(SPSpiralContextClass *klass)
     object_class->dispose = sp_spiral_context_dispose;
 
     event_context_class->setup = sp_spiral_context_setup;
+    event_context_class->finish = sp_spiral_context_finish;
     event_context_class->set = sp_spiral_context_set;
     event_context_class->root_handler = sp_spiral_context_root_handler;
 }
@@ -114,6 +116,20 @@ sp_spiral_context_init(SPSpiralContext *spiral_context)
     new (&spiral_context->sel_changed_connection) sigc::connection();
 }
 
+static void sp_spiral_context_finish(SPEventContext *ec)
+{
+    SPSpiralContext *sc = SP_SPIRAL_CONTEXT(ec);
+       SPDesktop *desktop = ec->desktop;
+
+       sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+       sp_spiral_finish(sc);
+    sc->sel_changed_connection.disconnect();
+
+    if (((SPEventContextClass *) parent_class)->finish) {
+               ((SPEventContextClass *) parent_class)->finish(ec);
+       }
+}
+
 static void
 sp_spiral_context_dispose(GObject *object)
 {
index 80d378f27f69ecb3495826cbc8a079d14a205e04..3d6825e31414d973319adfe5304016ddf26fe3b0 100644 (file)
@@ -52,6 +52,7 @@ static void sp_star_context_init (SPStarContext * star_context);
 static void sp_star_context_dispose (GObject *object);
 
 static void sp_star_context_setup (SPEventContext *ec);
+static void sp_star_context_finish(SPEventContext *ec);
 static void sp_star_context_set (SPEventContext *ec, Inkscape::Preferences::Entry *val);
 static gint sp_star_context_root_handler (SPEventContext *ec, GdkEvent *event);
 
@@ -92,6 +93,7 @@ sp_star_context_class_init (SPStarContextClass * klass)
     object_class->dispose = sp_star_context_dispose;
 
     event_context_class->setup = sp_star_context_setup;
+    event_context_class->finish = sp_star_context_finish;
     event_context_class->set = sp_star_context_set;
     event_context_class->root_handler = sp_star_context_root_handler;
 }
@@ -119,6 +121,21 @@ sp_star_context_init (SPStarContext * star_context)
     new (&star_context->sel_changed_connection) sigc::connection();
 }
 
+static void sp_star_context_finish(SPEventContext *ec)
+{
+    SPStarContext *sc = SP_STAR_CONTEXT(ec);
+       SPDesktop *desktop = ec->desktop;
+
+       sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), GDK_CURRENT_TIME);
+       sp_star_finish(sc);
+    sc->sel_changed_connection.disconnect();
+
+    if (((SPEventContextClass *) parent_class)->finish) {
+               ((SPEventContextClass *) parent_class)->finish(ec);
+       }
+}
+
+
 static void
 sp_star_context_dispose (GObject *object)
 {