diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-08-18 00:34:50 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-08-18 00:34:50 +0000 |
| commit | 5894666c2b7d5c580dba41acca27bd012b07db19 (patch) | |
| tree | 1ad9f5ae18143158968e4461b92ca39f94b8bcbb /src | |
| parent | Groundwork for new LPETool tool (which consists of subtools that are construc... (diff) | |
| download | inkscape-5894666c2b7d5c580dba41acca27bd012b07db19.tar.gz inkscape-5894666c2b7d5c580dba41acca27bd012b07db19.zip | |
Let LPEToolContext derive from PenContext so that we can use its LPE framework
(bzr r6646)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lpe-tool-context.cpp | 14 | ||||
| -rw-r--r-- | src/lpe-tool-context.h | 5 | ||||
| -rw-r--r-- | src/preferences-skeleton.h | 2 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 4 |
4 files changed, 17 insertions, 8 deletions
diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index a93176067..3df57027f 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -71,7 +71,7 @@ static void sp_lpetool_context_set(SPEventContext *ec, gchar const *key, gchar c static gint sp_lpetool_context_root_handler(SPEventContext *ec, GdkEvent *event); -static SPEventContextClass *lpetool_parent_class = 0; +static SPPenContextClass *lpetool_parent_class = 0; GType sp_lpetool_context_get_type(void) { @@ -89,7 +89,7 @@ GType sp_lpetool_context_get_type(void) (GInstanceInitFunc)sp_lpetool_context_init, 0 // value_table }; - type = g_type_register_static(SP_TYPE_EVENT_CONTEXT, "SPLPEToolContext", &info, static_cast<GTypeFlags>(0)); + type = g_type_register_static(SP_TYPE_PEN_CONTEXT, "SPLPEToolContext", &info, static_cast<GTypeFlags>(0)); } return type; } @@ -100,13 +100,13 @@ sp_lpetool_context_class_init(SPLPEToolContextClass *klass) GObjectClass *object_class = (GObjectClass *) klass; SPEventContextClass *event_context_class = (SPEventContextClass *) klass; - lpetool_parent_class = (SPEventContextClass*)g_type_class_peek_parent(klass); + lpetool_parent_class = (SPPenContextClass*)g_type_class_peek_parent(klass); object_class->dispose = sp_lpetool_context_dispose; event_context_class->setup = sp_lpetool_context_setup; event_context_class->set = sp_lpetool_context_set; - event_context_class->root_handler = sp_lpetool_context_root_handler; + //event_context_class->root_handler = sp_lpetool_context_root_handler; } static void @@ -145,10 +145,16 @@ sp_lpetool_context_setup(SPEventContext *ec) static void sp_lpetool_context_set(SPEventContext *ec, gchar const *key, gchar const *val) { + // FIXME: how to set this correcly? the value from preferences-skeleton.h doesn't seem to get + // read (it wants to set drag = 1) + lpetool_parent_class->set(ec, key, "drag"); + + /** //pass on up to parent class to handle common attributes. if ( lpetool_parent_class->set ) { lpetool_parent_class->set(ec, key, val); } + **/ } /** diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h index 73002143e..a5f849c7a 100644 --- a/src/lpe-tool-context.h +++ b/src/lpe-tool-context.h @@ -16,7 +16,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "event-context.h" +//#include "event-context.h" +#include "pen-context.h" #define SP_TYPE_LPETOOL_CONTEXT (sp_lpetool_context_get_type()) #define SP_LPETOOL_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_LPETOOL_CONTEXT, SPLPEToolContext)) @@ -27,7 +28,7 @@ class SPLPEToolContext; class SPLPEToolContextClass; -struct SPLPEToolContext : public SPEventContext { +struct SPLPEToolContext : public SPPenContext { }; struct SPLPEToolContextClass : public SPEventContextClass{}; diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index dfbbd61ee..6a14b044a 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -85,7 +85,7 @@ static char const preferences_skeleton[] = " mass=\"0.02\" drag=\"1\" angle=\"30\" width=\"0.15\" thinning=\"0.1\" flatness=\"0.9\" cap_rounding=\"0.0\" usecurrent=\"0\"\n" " tracebackground=\"0\" usepressure=\"1\" usetilt=\"0\" selcue=\"1\">\n" " </eventcontext>\n" -" <eventcontext id=\"lpetool\" mode=\"0\" style=\"fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;\">\n" +" <eventcontext id=\"lpetool\" mode=\"drag\" style=\"fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;\">\n" " </eventcontext>\n" " <eventcontext id=\"text\" usecurrent=\"0\" gradientdrag=\"1\"\n" " font_sample=\"AaBbCcIiPpQq12369$\342\202\254\302\242?.;/()\"\n" diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 18becfdb6..2a8f14a78 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4802,7 +4802,9 @@ static void sp_lpetool_mode_changed(EgeSelectOneAction *act, GObject *tbl) case 1: // circle through 3 points g_print ("circle through 3 points\n"); - sp_pen_context_put_into_waiting_mode(desktop, Inkscape::LivePathEffect::CIRCLE_3PTS, 3); + //sp_pen_context_put_into_waiting_mode(desktop, Inkscape::LivePathEffect::CIRCLE_3PTS, 3); + sp_pen_context_wait_for_LPE_mouse_clicks(SP_PEN_CONTEXT(desktop->event_context), Inkscape::LivePathEffect::CIRCLE_3PTS, 3); + //sp_pen_context_put_into_waiting_mode(desktop, Inkscape::LivePathEffect::CIRCLE_3PTS, 3); break; default: // don't do anything |
