Code

Clean up event handler functions of pointparam-knotholder.cpp
authorjohanengelen <johanengelen@users.sourceforge.net>
Fri, 21 Mar 2008 14:49:55 +0000 (14:49 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Fri, 21 Mar 2008 14:49:55 +0000 (14:49 +0000)
src/live_effects/parameter/pointparam-knotholder.cpp

index df8c18d41e16e38c10d459f1082d231612c1d4fd..faf310a6825d4a840cee18b050b9638fc3cd3ff8 100644 (file)
@@ -160,86 +160,17 @@ void pointparam_knot_holder_add_full(
     sp_knot_show(e->knot);\r
 }\r
 \r
-/**\r
- * \param p In desktop coordinates.\r
- */\r
-\r
- // don't write to XML yet...\r
-//static\r
-void pointparam_knotholder_update_knots(PointParamKnotHolder *knot_holder, SPItem *item)\r
+static void pointparam_knot_clicked_handler(SPKnot */*knot*/, guint /*state*/, gpointer data)\r
 {\r
-\r
-    NR::Matrix const i2d(sp_item_i2d_affine(item));\r
-/*\r
-    for (GSList *el = knot_holder->entity; el; el = el->next) {\r
-        SPKnotHolderEntity *e = (SPKnotHolderEntity *) el->data;\r
-        GObject *kob = e->knot;\r
-\r
-        NR::Point dp( e->knot_get(item) * i2d );\r
-        g_signal_handler_block(kob, e->handler_id);\r
-        sp_knot_set_position(e->knot, &dp, SP_KNOT_STATE_NORMAL);\r
-        g_signal_handler_unblock(kob, e->handler_id);\r
-    }\r
-    \r
-    knot_holder->lpeobject->lpe->setParameter(np->repr_key, svgpath);\r
-\r
-    knot_holder->lpeobject->requestModified(SP_OBJECT_MODIFIED_FLAG);\r
-*/\r
-}\r
-\r
-static void pointparam_knot_clicked_handler(SPKnot *knot, guint state, gpointer data)\r
-{\r
-\r
     SPKnotHolder *knot_holder = (SPKnotHolder *) data;\r
-    SPItem *item  = SP_ITEM (knot_holder->item);\r
-/*\r
-    g_object_ref(knot_holder);\r
-    for (GSList *el = knot_holder->entity; el; el = el->next) {\r
-        SPKnotHolderEntity *e = (SPKnotHolderEntity *) el->data;\r
-        if (e->knot == knot) {\r
-            if (e->knot_click) {\r
-                e->knot_click(item, state);\r
-            }\r
-            break;\r
-        }\r
-    }\r
-\r
-    if (SP_IS_SHAPE(item)) {\r
-        sp_shape_set_shape(SP_SHAPE(item));\r
-    }\r
-\r
-    knotholder_update_knots(knot_holder, item);\r
-    g_object_unref(knot_holder);\r
-\r
-    // for drag, this is done by ungrabbed_handler, but for click we must do it here\r
-    sp_document_done(SP_OBJECT_DOCUMENT(knot_holder->item), SP_VERB_CONTEXT_LPE, \r
-                     _("Change LPE point parameter"));\r
-*/\r
 }\r
 \r
-static void pointparam_knot_moved_handler(SPKnot *knot, NR::Point const *p, guint state, gpointer data)\r
+/**\r
+ * \param p In desktop coordinates.\r
+ */\r
+static void pointparam_knot_moved_handler(SPKnot */*knot*/, NR::Point const */*p*/, guint /*state*/, gpointer data)\r
 {\r
-\r
     SPKnotHolder *knot_holder = (SPKnotHolder *) data;\r
-    SPItem *item  = SP_ITEM (knot_holder->item);\r
-/*    // this was a local change and the knotholder does not need to be recreated:\r
-    knot_holder->local_change = TRUE;\r
-\r
-    for (GSList *el = knot_holder->entity; el; el = el->next) {\r
-        SPKnotHolderEntity *e = (SPKnotHolderEntity *) el->data;\r
-        if (e->knot == knot) {\r
-            NR::Point const q = *p / sp_item_i2d_affine(item);\r
-            e->knot_set(item, q, e->knot->drag_origin / sp_item_i2d_affine(item), state);\r
-            break;\r
-        }\r
-    }\r
-\r
-    if (SP_IS_SHAPE (item)) {\r
-        sp_shape_set_shape(SP_SHAPE (item));\r
-    }\r
-\r
-    knotholder_update_knots(knot_holder, item);\r
-*/\r
 }\r
 \r
 static void pointparam_knot_ungrabbed_handler(SPKnot *knot, unsigned int /*state*/, PointParamKnotHolder *kh)\r