summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b761658)
raw | patch | inline | side by side (parent: b761658)
author | cilix42 <cilix42@users.sourceforge.net> | |
Mon, 18 Aug 2008 00:38:15 +0000 (00:38 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Mon, 18 Aug 2008 00:38:15 +0000 (00:38 +0000) |
src/lpe-tool-context.cpp | patch | blob | history | |
src/lpe-tool-context.h | patch | blob | history |
index 631207b1075cef0c4b584bca466ee17b2896d4a9..d8d3fb6ec2d5a0a5878a069c549fcddbf9f5435c 100644 (file)
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
static void sp_lpetool_context_set(SPEventContext *ec, gchar const *key, gchar const *val);
static gint sp_lpetool_context_root_handler(SPEventContext *ec, GdkEvent *event);
+void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer data);
+
const int num_subtools = 4;
Inkscape::LivePathEffect::EffectType lpesubtools[] = {
lc->hot_x = 4;
lc->hot_y = 4;
+ new (&lc->sel_changed_connection) sigc::connection();
+
//lc->tool_state = LPETOOL_STATE_NODE;
}
SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(object);
delete lc->shape_editor;
+ lc->sel_changed_connection.disconnect();
+ lc->sel_changed_connection.~connection();
+
G_OBJECT_CLASS(lpetool_parent_class)->dispose(object);
}
Inkscape::Selection *selection = sp_desktop_selection (ec->desktop);
SPItem *item = selection->singleItem();
+ lc->sel_changed_connection.disconnect();
+ lc->sel_changed_connection =
+ selection->connectChanged(sigc::bind(sigc::ptr_fun(&sp_lpetool_context_selection_changed), (gpointer)lc));
+
//lc->my_nc = new NodeContextCpp(lc->desktop, lc->prefs_repr, lc->key);
lc->shape_editor = new ShapeEditor(ec->desktop);
sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
{
SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(event_context);
- //SPDesktop *desktop = event_context->desktop;
+ SPDesktop *desktop = event_context->desktop;
+ Inkscape::Selection *selection = sp_desktop_selection (desktop);
//gint ret = FALSE;
bool ret = false;
if (sp_pen_context_has_waiting_LPE(lc)) {
// quit when we are waiting for a LPE to be applied
g_print ("LPETool has waiting LPE. We call the pen tool parent context and return\n");
-
+
if (((SPEventContextClass *) lpetool_parent_class)->root_handler) {
ret = ((SPEventContextClass *) lpetool_parent_class)->root_handler(event_context, event);
}
}
ret = true;
- break;
+ break;
/**
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h
index 032d89b687645b23c25b5b233e1992647a1c1a4f..dc609ac278391ff99ed18d7b9d840ff9dcef212e 100644 (file)
--- a/src/lpe-tool-context.h
+++ b/src/lpe-tool-context.h
//int tool_state;
ShapeEditor* shape_editor;
+
+ sigc::connection sel_changed_connection;
};
struct SPLPEToolContextClass : public SPEventContextClass{};