From a88ae89fce92b829569bae803c07ccac583d61f5 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 18 Aug 2008 00:39:23 +0000 Subject: [PATCH] Many debugging messages --- src/lpe-tool-context.cpp | 3 +++ src/pen-context.cpp | 1 + src/selection.cpp | 2 ++ src/shape-editor.cpp | 9 ++++++++- src/widgets/toolbox.cpp | 5 ++++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index 2ea652b18..fb3814ab7 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -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; diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 22f83a219..74498c6c0 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -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; diff --git a/src/selection.cpp b/src/selection.cpp index 9e134ff08..65ec9941d 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -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)); diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index b26b117ca..a7dc872b6 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -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(); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 9731436f0..aaa5dfa86 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -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) -- 2.30.2