summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-08-18 00:46:44 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-08-18 00:46:44 +0000
commita5c525424eaeb11f84f8b3553f7f05f10c667eab (patch)
treec803e17ff019c6ac3cd6b28527377f2f2bc97a00 /src
parentAdd action to change the end type of line segments if an item has LPELineSegm... (diff)
downloadinkscape-a5c525424eaeb11f84f8b3553f7f05f10c667eab.tar.gz
inkscape-a5c525424eaeb11f84f8b3553f7f05f10c667eab.zip
Some debugging messages
(bzr r6684)
Diffstat (limited to 'src')
-rw-r--r--src/lpe-tool-context.cpp4
-rw-r--r--src/widgets/toolbox.cpp16
2 files changed, 19 insertions, 1 deletions
diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp
index f7b0091ec..0b3fb25bf 100644
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
@@ -167,6 +167,7 @@ destroys old and creates new nodepath and reassigns listeners to the new selecte
void
sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer data)
{
+ g_print ("sp_lpetool_context_selection_changed()\n");
SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(data);
// TODO: update ShapeEditorsCollective instead
@@ -329,13 +330,16 @@ lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) {
int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item)
{
if (!SP_IS_LPE_ITEM(item)) {
+ g_print ("item is not LPEItem; returning -1\n");
return -1;
}
Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item));
if (!lpe) {
+ g_print ("no valid construction; returning -1\n");
return -1;
}
+ g_print ("returning construction %d\n", lpetool_mode_to_index(lpe->effectType()));
return lpetool_mode_to_index(lpe->effectType());
}
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index eefc5de87..5676529c3 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -4835,6 +4835,7 @@ void
sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl)
{
using namespace Inkscape::LivePathEffect;
+ g_print ("sp_lpetool_toolbox_sel_changed()");
{
GtkAction* w = GTK_ACTION(g_object_get_data(tbl, "lpetool_line_segment_action"));
SPItem *item = selection->singleItem();
@@ -4843,22 +4844,26 @@ sp_lpetool_toolbox_sel_changed(Inkscape::Selection *selection, GObject *tbl)
SPLPEItem *lpeitem = SP_LPE_ITEM(item);
Effect* lpe = sp_lpe_item_get_current_lpe(lpeitem);
if (lpe && lpe->effectType() == LINE_SEGMENT) {
+ g_print (" - item with line segment LPE found\n");
LPELineSegment *lpels = static_cast<LPELineSegment*>(lpe);
g_object_set_data(tbl, "currentlpe", lpe);
g_object_set_data(tbl, "currentlpeitem", lpeitem);
gtk_action_set_sensitive(w, TRUE);
ege_select_one_action_set_active(act, lpels->end_type->get_value());
} 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);
}
} 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
@@ -4901,6 +4906,7 @@ sp_line_segment_build_list(GObject *tbl)
static void
sp_lpetool_change_line_segment_type(EgeSelectOneAction* act, GObject* tbl) {
+ g_print ("sp_lpetool_change_line_segment_type()\n");
using namespace Inkscape::LivePathEffect;
// quit if run by the attr_changed listener
@@ -4913,7 +4919,15 @@ sp_lpetool_change_line_segment_type(EgeSelectOneAction* act, GObject* tbl) {
LPELineSegment *lpe = static_cast<LPELineSegment *>(g_object_get_data(tbl, "currentlpe"));
SPLPEItem *lpeitem = static_cast<SPLPEItem *>(g_object_get_data(tbl, "currentlpeitem"));
- if (lpe) {
+ if (!lpeitem) {
+ g_print ("no lpeitem!\n");
+ } else {
+ g_print ("lpeitem found\n");
+ }
+ if (!lpe) {
+ g_print ("no LPE!\n");
+ } else {
+ g_print ("LPE found. Adjusting line segment type\n");
SPLPEItem *lpeitem = static_cast<SPLPEItem *>(g_object_get_data(tbl, "currentlpeitem"));
lpe->end_type.param_set_value(static_cast<Inkscape::LivePathEffect::EndType>(ege_select_one_action_get_active(act)));
sp_lpe_item_update_patheffect(lpeitem, true, true);