Code

Many debugging messages
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:39:23 +0000 (00:39 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:39:23 +0000 (00:39 +0000)
src/lpe-tool-context.cpp
src/pen-context.cpp
src/selection.cpp
src/shape-editor.cpp
src/widgets/toolbox.cpp

index 2ea652b18be0c92141d356ce107c745a3b870b1a..fb3814ab736620fbab33a9e17ea8424903cd6c82 100644 (file)
@@ -231,6 +231,7 @@ sp_erc_update_toolbox (SPDesktop *desktop, const gchar *id, double value)
 gint
 sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
 {
+    //g_print ("sp_lpetool_context_root_handler()\n");
     SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(event_context);
     SPDesktop *desktop = event_context->desktop;
     Inkscape::Selection *selection = sp_desktop_selection (desktop);
@@ -247,7 +248,9 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
 
     switch (event->type) {
         case GDK_BUTTON_PRESS:
+            g_print ("GDK_BUTTON_PRESS\n");
             if (event->button.button == 1 && !event_context->space_panning) {
+                g_print ("   ... (passed if construct)\n");
                 // save drag origin
                 event_context->xp = (gint) event->button.x;
                 event_context->yp = (gint) event->button.y;
index 22f83a21941f9c7b1647614b3d58e5135d62687b..74498c6c0a803fc63b7ab2b350d7cac25d61e6d2 100644 (file)
@@ -361,6 +361,7 @@ sp_pen_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event)
 static gint
 sp_pen_context_root_handler(SPEventContext *ec, GdkEvent *event)
 {
+    g_print ("sp_pen_context_root_handler()\n");
     SPPenContext *const pc = SP_PEN_CONTEXT(ec);
 
     gint ret = FALSE;
index 9e134ff08022c5fa31aefcb8b0f109df6b1c00a0..65ec9941d1cb70cbde2da75aff9f2be873b2597e 100644 (file)
@@ -149,6 +149,7 @@ bool Selection::includes(SPObject *obj) const {
 }
 
 void Selection::add(SPObject *obj, bool persist_selection_context/* = false */) {
+    g_print ("Selection::add()\n");
     g_return_if_fail(obj != NULL);
     g_return_if_fail(SP_IS_OBJECT(obj));
 
@@ -210,6 +211,7 @@ void Selection::toggle(SPObject *obj) {
 }
 
 void Selection::remove(SPObject *obj) {
+    g_print ("Selection::remove()\n");
     g_return_if_fail(obj != NULL);
     g_return_if_fail(SP_IS_OBJECT(obj));
     g_return_if_fail(includes(obj));
index b26b117cae1bea838c07591b88b32bfddcf87b9b..a7dc872b62e036257fab0a8232d9d107f2fbd7df 100644 (file)
@@ -62,6 +62,7 @@ ShapeEditor::~ShapeEditor() {
 }
 
 void ShapeEditor::unset_item(SubType type, bool keep_knotholder) {
+    g_print ("ShapeEditor::unset_item()\n");
     Inkscape::XML::Node *old_repr = NULL;
 
     switch (type) {
@@ -172,6 +173,7 @@ static void shapeeditor_event_attr_changed(Inkscape::XML::Node */*repr*/, gchar
                                            gchar const */*old_value*/, gchar const */*new_value*/,
                                            bool /*is_interactive*/, gpointer data)
 {
+    g_print ("shapeeditor_event_attr_changed()\n");
     gboolean changed_np = FALSE;
     gboolean changed_kh = FALSE;
 
@@ -224,6 +226,7 @@ static Inkscape::XML::NodeEventVector shapeeditor_repr_events = {
 
 
 void ShapeEditor::set_item(SPItem *item, SubType type, bool keep_knotholder) {
+    g_print ("ShapeEditor::set_item()\n");
     // this happens (and should only happen) when for an LPEItem having both knotholder and nodepath the knotholder
     // is adapted; in this case we don't want to delete the knotholder since this freezes the handles
     unset_item(type, keep_knotholder);
@@ -269,6 +272,7 @@ void ShapeEditor::set_item(SPItem *item, SubType type, bool keep_knotholder) {
 */
 void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject, const char * key)
 {
+    g_print ("ShapeEditor::set_item_lpe_path_parameter()\n");
     unset_item(SH_NODEPATH);
 
     this->grab_node = -1;
@@ -310,6 +314,7 @@ ShapeEditor::set_knotholder(KnotHolder * knot_holder)
    Why not make a reload function in NodePath and in KnotHolder? */
 void ShapeEditor::reset_item (SubType type, bool keep_knotholder)
 {
+    g_print ("ShapeEditor::reset_item()\n");
     switch (type) {
         case SH_NODEPATH:
             if ( (this->nodepath) && (IS_LIVEPATHEFFECT(this->nodepath->object)) ) {
@@ -342,7 +347,7 @@ void ShapeEditor::update_statusbar () {
 }
 
 bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) {
-
+    g_print ("ShapeEditor::is_over_stroke ()");
     if (!this->nodepath)
         return false; // no stroke in knotholder
 
@@ -354,8 +359,10 @@ bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) {
 
     SPCurve *curve;
     if (SP_IS_SHAPE(item)) {
+        g_print ("; getting curve from shape\n");
         curve = sp_shape_get_curve(SP_SHAPE(item));
     } else {
+        g_print ("; getting curve from nodepath's curve\n");
         this->nodepath->curve;   // not sure if np->curve is always up to date...
     }
     Geom::PathVector const &pathv = curve->get_pathvector();
index 9731436f049c0435bcf434015c09c50d19ceacb2..aaa5dfa863e08df11061aee62c9977f3b69e189a 100644 (file)
@@ -4850,11 +4850,12 @@ void
 sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl)
 {
     using namespace Inkscape::LivePathEffect;
-    g_print ("sp_lpetool_toolbox_sel_changed()\n");
+    g_print ("sp_lpetool_toolbox_sel_changed()");
     {
         GtkAction* w = GTK_ACTION( g_object_get_data( tbl, "lpetool_test_action" ) );
         SPItem *item = selection->singleItem();
         if (item && SP_IS_LPE_ITEM(item)) {
+            g_print (" - item found\n");
             SPLPEItem *lpeitem = SP_LPE_ITEM(item);
             Effect* lpe = sp_lpe_item_get_current_lpe(lpeitem);
             if (lpe && lpe->effectType() == ANGLE_BISECTOR) {
@@ -4868,11 +4869,13 @@ sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl)
                 gtk_action_set_sensitive(w, FALSE);
             }
         } else {
+            g_print (" - unsetting item\n");
             g_object_set_data(tbl, "currentlpe", NULL);
             g_object_set_data(tbl, "currentlpeitem", NULL);
             gtk_action_set_sensitive(w, FALSE);
         }
     }
+    g_print ("\n");
 }
 
 static void sp_lpetool_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder)