From 1d8f1753cd8cab38d19fcc26a4ad70ba2e794ac8 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 9 Apr 2013 22:12:07 +0200 Subject: Added constructors to EventContext tree / some missing virtual pads. (bzr r11608.1.90) --- src/spray-context.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 11 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 6a5684891..855e0508a 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -104,9 +104,9 @@ static void sp_spray_context_class_init(SPSprayContextClass *klass) object_class->dispose = sp_spray_context_dispose; - event_context_class->setup = sp_spray_context_setup; - event_context_class->set = sp_spray_context_set; - event_context_class->root_handler = sp_spray_context_root_handler; +// event_context_class->setup = sp_spray_context_setup; +// event_context_class->set = sp_spray_context_set; +// event_context_class->root_handler = sp_spray_context_root_handler; } /* Method to rotate items */ @@ -133,8 +133,26 @@ static void sp_spray_scale_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *it item->doWriteTransform(item->getRepr(), item->transform); } -static void sp_spray_context_init(SPSprayContext *tc) -{ +CSprayContext::CSprayContext(SPSprayContext* spraycontext) : CEventContext(spraycontext) { + this->spspraycontext = spraycontext; +} + +SPSprayContext::SPSprayContext() : SPEventContext() { + SPSprayContext* tc = this; + + tc->cspraycontext = new CSprayContext(tc); + delete tc->ceventcontext; + tc->ceventcontext = tc->cspraycontext; + + tc->usetilt = 0; + tc->_message_context = 0; + tc->dilate_area = 0; + tc->usetext = false; + tc->population = 0; + tc->is_drawing = false; + tc->mode = 0; + tc->usepressure = 0; + SPEventContext *event_context = SP_EVENT_CONTEXT(tc); event_context->cursor_shape = cursor_spray_xpm; @@ -161,6 +179,11 @@ static void sp_spray_context_init(SPSprayContext *tc) new (&tc->style_set_connection) sigc::connection(); } +static void sp_spray_context_init(SPSprayContext *tc) +{ + new (tc) SPSprayContext(); +} + static void sp_spray_context_dispose(GObject *object) { SPSprayContext *tc = SP_SPRAY_CONTEXT(object); @@ -225,11 +248,18 @@ static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) static void sp_spray_context_setup(SPEventContext *ec) { + ec->ceventcontext->setup(); +} + +void CSprayContext::setup() { + SPEventContext* ec = this->speventcontext; + SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); - if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup) { - (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup(ec); - } +// if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup) { +// (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup(ec); +// } + CEventContext::setup(); { /* TODO: have a look at sp_dyna_draw_context_setup where the same is done.. generalize? at least make it an arcto! */ @@ -277,6 +307,12 @@ static void sp_spray_context_setup(SPEventContext *ec) static void sp_spray_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val) { + ec->ceventcontext->set(val); +} + +void CSprayContext::set(Inkscape::Preferences::Entry* val) { + SPEventContext* ec = this->speventcontext; + SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); Glib::ustring path = val->getEntryName(); @@ -612,6 +648,12 @@ static void sp_spray_switch_mode(SPSprayContext *tc, gint mode, bool with_shift) gint sp_spray_context_root_handler(SPEventContext *event_context, GdkEvent *event) { + return event_context->ceventcontext->root_handler(event); +} + +gint CSprayContext::root_handler(GdkEvent* event) { + SPEventContext* event_context = this->speventcontext; + SPSprayContext *tc = SP_SPRAY_CONTEXT(event_context); SPDesktop *desktop = event_context->desktop; @@ -889,9 +931,10 @@ gint sp_spray_context_root_handler(SPEventContext *event_context, GdkEvent *even } if (!ret) { - if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler) { - ret = (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler(event_context, event); - } +// if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler) { +// ret = (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler(event_context, event); +// } + ret = CEventContext::root_handler(event); } return ret; -- cgit v1.2.3 From fbb85064cfaaf03cc09bacedb16a8561f61f2b3d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 13 Apr 2013 00:37:18 +0200 Subject: Added prefPaths to contexts; modified SPFactory (bzr r11608.1.94) --- src/spray-context.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 855e0508a..7d4980355 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -84,6 +84,8 @@ static void sp_spray_context_setup(SPEventContext *ec); static void sp_spray_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val); static gint sp_spray_context_root_handler(SPEventContext *ec, GdkEvent *event); +const std::string SPSprayContext::prefsPath = "/tools/spray"; + G_DEFINE_TYPE(SPSprayContext, sp_spray_context, SP_TYPE_EVENT_CONTEXT); /** -- cgit v1.2.3 From fbdc8b84ff670c684dafc7d7d403ed01e7077e70 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 13 Apr 2013 18:13:17 +0200 Subject: Replaced casting macros for EventContext tree; added contructors. (bzr r11608.1.96) --- src/spray-context.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 7d4980355..bb9f05530 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -80,9 +80,19 @@ using namespace std; static void sp_spray_context_dispose(GObject *object); -static void sp_spray_context_setup(SPEventContext *ec); -static void sp_spray_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val); -static gint sp_spray_context_root_handler(SPEventContext *ec, GdkEvent *event); +#include "sp-factory.h" + +namespace { + SPEventContext* createSprayContext() { + return new SPSprayContext(); + } + + bool sprayContextRegistered = ToolFactory::instance().registerObject("/tools/spray", createSprayContext); +} + +const std::string& CSprayContext::getPrefsPath() { + return SPSprayContext::prefsPath; +} const std::string SPSprayContext::prefsPath = "/tools/spray"; @@ -145,6 +155,7 @@ SPSprayContext::SPSprayContext() : SPEventContext() { tc->cspraycontext = new CSprayContext(tc); delete tc->ceventcontext; tc->ceventcontext = tc->cspraycontext; + types.insert(typeid(SPSprayContext)); tc->usetilt = 0; tc->_message_context = 0; @@ -248,11 +259,6 @@ static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) g_free(sel_message); } -static void sp_spray_context_setup(SPEventContext *ec) -{ - ec->ceventcontext->setup(); -} - void CSprayContext::setup() { SPEventContext* ec = this->speventcontext; @@ -307,11 +313,6 @@ void CSprayContext::setup() { } } -static void sp_spray_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val) -{ - ec->ceventcontext->set(val); -} - void CSprayContext::set(Inkscape::Preferences::Entry* val) { SPEventContext* ec = this->speventcontext; @@ -648,11 +649,6 @@ static void sp_spray_switch_mode(SPSprayContext *tc, gint mode, bool with_shift) sp_spray_update_cursor(tc, with_shift); } -gint sp_spray_context_root_handler(SPEventContext *event_context, GdkEvent *event) -{ - return event_context->ceventcontext->root_handler(event); -} - gint CSprayContext::root_handler(GdkEvent* event) { SPEventContext* event_context = this->speventcontext; -- cgit v1.2.3 From 65ba6ad9a82f8f47974eb10665478fd783692bb5 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 20 Apr 2013 23:19:46 +0200 Subject: Merging of EventContext classes complete. (bzr r11608.1.98) --- src/spray-context.cpp | 61 +++++++++++++-------------------------------------- 1 file changed, 15 insertions(+), 46 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index bb9f05530..95017810d 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -78,8 +78,6 @@ using namespace std; #define DDC_RED_RGBA 0xff0000ff #define DYNA_MIN_WIDTH 1.0e-6 -static void sp_spray_context_dispose(GObject *object); - #include "sp-factory.h" namespace { @@ -90,14 +88,12 @@ namespace { bool sprayContextRegistered = ToolFactory::instance().registerObject("/tools/spray", createSprayContext); } -const std::string& CSprayContext::getPrefsPath() { +const std::string& SPSprayContext::getPrefsPath() { return SPSprayContext::prefsPath; } const std::string SPSprayContext::prefsPath = "/tools/spray"; -G_DEFINE_TYPE(SPSprayContext, sp_spray_context, SP_TYPE_EVENT_CONTEXT); - /** * This function returns pseudo-random numbers from a normal distribution * @param mu : mean @@ -109,18 +105,6 @@ inline double NormalDistribution(double mu, double sigma) return mu + sigma * sqrt( -2.0 * log(g_random_double_range(0, 1)) ) * cos( 2.0*M_PI*g_random_double_range(0, 1) ); } -static void sp_spray_context_class_init(SPSprayContextClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS(klass); - SPEventContextClass *event_context_class = SP_EVENT_CONTEXT_CLASS(klass); - - object_class->dispose = sp_spray_context_dispose; - -// event_context_class->setup = sp_spray_context_setup; -// event_context_class->set = sp_spray_context_set; -// event_context_class->root_handler = sp_spray_context_root_handler; -} - /* Method to rotate items */ static void sp_spray_rotate_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *item, Geom::Rotate const &rotation) { @@ -145,18 +129,9 @@ static void sp_spray_scale_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *it item->doWriteTransform(item->getRepr(), item->transform); } -CSprayContext::CSprayContext(SPSprayContext* spraycontext) : CEventContext(spraycontext) { - this->spspraycontext = spraycontext; -} - SPSprayContext::SPSprayContext() : SPEventContext() { SPSprayContext* tc = this; - tc->cspraycontext = new CSprayContext(tc); - delete tc->ceventcontext; - tc->ceventcontext = tc->cspraycontext; - types.insert(typeid(SPSprayContext)); - tc->usetilt = 0; tc->_message_context = 0; tc->dilate_area = 0; @@ -189,23 +164,17 @@ SPSprayContext::SPSprayContext() : SPEventContext() { tc->is_dilating = false; tc->has_dilated = false; - new (&tc->style_set_connection) sigc::connection(); + //new (&tc->style_set_connection) sigc::connection(); } -static void sp_spray_context_init(SPSprayContext *tc) -{ - new (tc) SPSprayContext(); -} - -static void sp_spray_context_dispose(GObject *object) -{ - SPSprayContext *tc = SP_SPRAY_CONTEXT(object); - SPEventContext *ec = SP_EVENT_CONTEXT(object); +SPSprayContext::~SPSprayContext() { + SPSprayContext *tc = SP_SPRAY_CONTEXT(this); + SPEventContext *ec = SP_EVENT_CONTEXT(this); ec->enableGrDrag(false); tc->style_set_connection.disconnect(); - tc->style_set_connection.~connection(); + //tc->style_set_connection.~connection(); if (tc->dilate_area) { sp_canvas_item_destroy(tc->dilate_area); @@ -216,7 +185,7 @@ static void sp_spray_context_dispose(GObject *object) delete tc->_message_context; } - G_OBJECT_CLASS(sp_spray_context_parent_class)->dispose(object); + //G_OBJECT_CLASS(sp_spray_context_parent_class)->dispose(object); } static bool is_transform_modes(gint mode) @@ -259,15 +228,15 @@ static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) g_free(sel_message); } -void CSprayContext::setup() { - SPEventContext* ec = this->speventcontext; +void SPSprayContext::setup() { + SPEventContext* ec = this; SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); // if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup) { // (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup(ec); // } - CEventContext::setup(); + SPEventContext::setup(); { /* TODO: have a look at sp_dyna_draw_context_setup where the same is done.. generalize? at least make it an arcto! */ @@ -313,8 +282,8 @@ void CSprayContext::setup() { } } -void CSprayContext::set(Inkscape::Preferences::Entry* val) { - SPEventContext* ec = this->speventcontext; +void SPSprayContext::set(Inkscape::Preferences::Entry* val) { + SPEventContext* ec = this; SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); Glib::ustring path = val->getEntryName(); @@ -649,8 +618,8 @@ static void sp_spray_switch_mode(SPSprayContext *tc, gint mode, bool with_shift) sp_spray_update_cursor(tc, with_shift); } -gint CSprayContext::root_handler(GdkEvent* event) { - SPEventContext* event_context = this->speventcontext; +gint SPSprayContext::root_handler(GdkEvent* event) { + SPEventContext* event_context = this; SPSprayContext *tc = SP_SPRAY_CONTEXT(event_context); SPDesktop *desktop = event_context->desktop; @@ -932,7 +901,7 @@ gint CSprayContext::root_handler(GdkEvent* event) { // if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler) { // ret = (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->root_handler(event_context, event); // } - ret = CEventContext::root_handler(event); + ret = SPEventContext::root_handler(event); } return ret; -- cgit v1.2.3 From 5512f857e2f33f1aa40124dc82b353e5f2e5a0b0 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 20 Apr 2013 23:58:53 +0200 Subject: Moved factories to different files. (bzr r11608.1.100) --- src/spray-context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 95017810d..9c4a22053 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -78,7 +78,7 @@ using namespace std; #define DDC_RED_RGBA 0xff0000ff #define DYNA_MIN_WIDTH 1.0e-6 -#include "sp-factory.h" +#include "tool-factory.h" namespace { SPEventContext* createSprayContext() { -- cgit v1.2.3 From bdde74bbab299f2ee448f1c55469c56a66fb01f7 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 21 Apr 2013 23:58:15 +0200 Subject: Removed some unused files; more refactoring in EventContext tree. (bzr r11608.1.104) --- src/spray-context.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 9c4a22053..8bedb237b 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -282,38 +282,38 @@ void SPSprayContext::setup() { } } -void SPSprayContext::set(Inkscape::Preferences::Entry* val) { +void SPSprayContext::set(const Inkscape::Preferences::Entry& val) { SPEventContext* ec = this; SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); - Glib::ustring path = val->getEntryName(); + Glib::ustring path = val.getEntryName(); if (path == "mode") { - tc->mode = val->getInt(); + tc->mode = val.getInt(); sp_spray_update_cursor(tc, false); } else if (path == "width") { - tc->width = 0.01 * CLAMP(val->getInt(10), 1, 100); + tc->width = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "usepressure") { - tc->usepressure = val->getBool(); + tc->usepressure = val.getBool(); } else if (path == "population") { - tc->population = 0.01 * CLAMP(val->getInt(10), 1, 100); + tc->population = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "rotation_variation") { - tc->rotation_variation = CLAMP(val->getDouble(0.0), 0, 100.0); + tc->rotation_variation = CLAMP(val.getDouble(0.0), 0, 100.0); } else if (path == "scale_variation") { - tc->scale_variation = CLAMP(val->getDouble(1.0), 0, 100.0); + tc->scale_variation = CLAMP(val.getDouble(1.0), 0, 100.0); } else if (path == "standard_deviation") { - tc->standard_deviation = 0.01 * CLAMP(val->getInt(10), 1, 100); + tc->standard_deviation = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "mean") { - tc->mean = 0.01 * CLAMP(val->getInt(10), 1, 100); + tc->mean = 0.01 * CLAMP(val.getInt(10), 1, 100); // Not implemented in the toolbar and preferences yet } else if (path == "distribution") { - tc->distrib = val->getInt(1); + tc->distrib = val.getInt(1); } else if (path == "tilt") { - tc->tilt = CLAMP(val->getDouble(0.1), 0, 1000.0); + tc->tilt = CLAMP(val.getDouble(0.1), 0, 1000.0); } else if (path == "ratio") { - tc->ratio = CLAMP(val->getDouble(), 0.0, 0.9); + tc->ratio = CLAMP(val.getDouble(), 0.0, 0.9); } else if (path == "force") { - tc->force = CLAMP(val->getDouble(1.0), 0, 1.0); + tc->force = CLAMP(val.getDouble(1.0), 0, 1.0); } } -- cgit v1.2.3 From b2dd3583e7372d23d18bbc6e861f4f645ec3dc37 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 30 Jul 2013 23:17:21 +0200 Subject: Further refactoring of EventContexts. (bzr r11608.1.109) --- src/spray-context.cpp | 334 +++++++++++++++++++++++--------------------------- 1 file changed, 153 insertions(+), 181 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 66cc30c6d..c96df20b2 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -130,62 +130,49 @@ static void sp_spray_scale_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *it } SPSprayContext::SPSprayContext() : SPEventContext() { - SPSprayContext* tc = this; - - tc->usetilt = 0; - tc->_message_context = 0; - tc->dilate_area = 0; - tc->usetext = false; - tc->population = 0; - tc->is_drawing = false; - tc->mode = 0; - tc->usepressure = 0; - - SPEventContext *event_context = SP_EVENT_CONTEXT(tc); - - event_context->cursor_shape = cursor_spray_xpm; - event_context->hot_x = 4; - event_context->hot_y = 4; + this->usetilt = 0; + this->message_context = 0; + this->dilate_area = 0; + this->usetext = false; + this->population = 0; + this->is_drawing = false; + this->mode = 0; + this->usepressure = 0; + + this->cursor_shape = cursor_spray_xpm; + this->hot_x = 4; + this->hot_y = 4; /* attributes */ - tc->dragging = FALSE; - tc->distrib = 1; - tc->width = 0.2; - tc->force = 0.2; - tc->ratio = 0; - tc->tilt = 0; - tc->mean = 0.2; - tc->rotation_variation = 0; - tc->standard_deviation = 0.2; - tc->scale = 1; - tc->scale_variation = 1; - tc->pressure = TC_DEFAULT_PRESSURE; - - tc->is_dilating = false; - tc->has_dilated = false; - - //new (&tc->style_set_connection) sigc::connection(); + this->dragging = FALSE; + this->distrib = 1; + this->width = 0.2; + this->force = 0.2; + this->ratio = 0; + this->tilt = 0; + this->mean = 0.2; + this->rotation_variation = 0; + this->standard_deviation = 0.2; + this->scale = 1; + this->scale_variation = 1; + this->pressure = TC_DEFAULT_PRESSURE; + + this->is_dilating = false; + this->has_dilated = false; } SPSprayContext::~SPSprayContext() { - SPSprayContext *tc = SP_SPRAY_CONTEXT(this); - SPEventContext *ec = SP_EVENT_CONTEXT(this); + this->enableGrDrag(false); + this->style_set_connection.disconnect(); - ec->enableGrDrag(false); - - tc->style_set_connection.disconnect(); - //tc->style_set_connection.~connection(); - - if (tc->dilate_area) { - sp_canvas_item_destroy(tc->dilate_area); - tc->dilate_area = NULL; + if (this->dilate_area) { + sp_canvas_item_destroy(this->dilate_area); + this->dilate_area = NULL; } - if (tc->_message_context) { - delete tc->_message_context; + if (this->message_context) { + delete this->message_context; } - - //G_OBJECT_CLASS(sp_spray_context_parent_class)->dispose(object); } static bool is_transform_modes(gint mode) @@ -213,29 +200,22 @@ static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) switch (tc->mode) { case SPRAY_MODE_COPY: - tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray copies of the initial selection."), sel_message); + tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray copies of the initial selection."), sel_message); break; case SPRAY_MODE_CLONE: - tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray clones of the initial selection."), sel_message); + tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray clones of the initial selection."), sel_message); break; case SPRAY_MODE_SINGLE_PATH: - tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray in a single path of the initial selection."), sel_message); + tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray in a single path of the initial selection."), sel_message); break; default: break; } - sp_event_context_update_cursor(event_context); + event_context->sp_event_context_update_cursor(); g_free(sel_message); } void SPSprayContext::setup() { - SPEventContext* ec = this; - - SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); - -// if ((SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup) { -// (SP_EVENT_CONTEXT_CLASS(sp_spray_context_parent_class))->setup(ec); -// } SPEventContext::setup(); { @@ -248,72 +228,69 @@ void SPSprayContext::setup() { c->curveto(1, -C1, C1, -1, 0, -1 ); c->curveto(-C1, -1, -1, -C1, -1, 0 ); c->closepath(); - tc->dilate_area = sp_canvas_bpath_new(sp_desktop_controls(ec->desktop), c); + this->dilate_area = sp_canvas_bpath_new(sp_desktop_controls(this->desktop), c); c->unref(); - sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(tc->dilate_area), 0x00000000,(SPWindRule)0); - sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(tc->dilate_area), 0xff9900ff, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); - sp_canvas_item_hide(tc->dilate_area); + sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(this->dilate_area), 0x00000000,(SPWindRule)0); + sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->dilate_area), 0xff9900ff, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); + sp_canvas_item_hide(this->dilate_area); } - tc->is_drawing = false; + this->is_drawing = false; - tc->_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack()); + this->message_context = new Inkscape::MessageContext((this->desktop)->messageStack()); - sp_event_context_read(ec, "distrib"); - sp_event_context_read(ec, "width"); - sp_event_context_read(ec, "ratio"); - sp_event_context_read(ec, "tilt"); - sp_event_context_read(ec, "rotation_variation"); - sp_event_context_read(ec, "scale_variation"); - sp_event_context_read(ec, "mode"); - sp_event_context_read(ec, "population"); - sp_event_context_read(ec, "force"); - sp_event_context_read(ec, "mean"); - sp_event_context_read(ec, "standard_deviation"); - sp_event_context_read(ec, "usepressure"); - sp_event_context_read(ec, "Scale"); + sp_event_context_read(this, "distrib"); + sp_event_context_read(this, "width"); + sp_event_context_read(this, "ratio"); + sp_event_context_read(this, "tilt"); + sp_event_context_read(this, "rotation_variation"); + sp_event_context_read(this, "scale_variation"); + sp_event_context_read(this, "mode"); + sp_event_context_read(this, "population"); + sp_event_context_read(this, "force"); + sp_event_context_read(this, "mean"); + sp_event_context_read(this, "standard_deviation"); + sp_event_context_read(this, "usepressure"); + sp_event_context_read(this, "Scale"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/tools/spray/selcue")) { - ec->enableSelectionCue(); + this->enableSelectionCue(); } if (prefs->getBool("/tools/spray/gradientdrag")) { - ec->enableGrDrag(); + this->enableGrDrag(); } } void SPSprayContext::set(const Inkscape::Preferences::Entry& val) { - SPEventContext* ec = this; - - SPSprayContext *tc = SP_SPRAY_CONTEXT(ec); Glib::ustring path = val.getEntryName(); if (path == "mode") { - tc->mode = val.getInt(); - sp_spray_update_cursor(tc, false); + this->mode = val.getInt(); + sp_spray_update_cursor(this, false); } else if (path == "width") { - tc->width = 0.01 * CLAMP(val.getInt(10), 1, 100); + this->width = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "usepressure") { - tc->usepressure = val.getBool(); + this->usepressure = val.getBool(); } else if (path == "population") { - tc->population = 0.01 * CLAMP(val.getInt(10), 1, 100); + this->population = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "rotation_variation") { - tc->rotation_variation = CLAMP(val.getDouble(0.0), 0, 100.0); + this->rotation_variation = CLAMP(val.getDouble(0.0), 0, 100.0); } else if (path == "scale_variation") { - tc->scale_variation = CLAMP(val.getDouble(1.0), 0, 100.0); + this->scale_variation = CLAMP(val.getDouble(1.0), 0, 100.0); } else if (path == "standard_deviation") { - tc->standard_deviation = 0.01 * CLAMP(val.getInt(10), 1, 100); + this->standard_deviation = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "mean") { - tc->mean = 0.01 * CLAMP(val.getInt(10), 1, 100); + this->mean = 0.01 * CLAMP(val.getInt(10), 1, 100); // Not implemented in the toolbar and preferences yet } else if (path == "distribution") { - tc->distrib = val.getInt(1); + this->distrib = val.getInt(1); } else if (path == "tilt") { - tc->tilt = CLAMP(val.getDouble(0.1), 0, 1000.0); + this->tilt = CLAMP(val.getDouble(0.1), 0, 1000.0); } else if (path == "ratio") { - tc->ratio = CLAMP(val.getDouble(), 0.0, 0.9); + this->ratio = CLAMP(val.getDouble(), 0.0, 0.9); } else if (path == "force") { - tc->force = CLAMP(val.getDouble(1.0), 0, 1.0); + this->force = CLAMP(val.getDouble(1.0), 0, 1.0); } } @@ -618,43 +595,38 @@ static void sp_spray_switch_mode(SPSprayContext *tc, gint mode, bool with_shift) sp_spray_update_cursor(tc, with_shift); } -gint SPSprayContext::root_handler(GdkEvent* event) { - SPEventContext* event_context = this; - - SPSprayContext *tc = SP_SPRAY_CONTEXT(event_context); - SPDesktop *desktop = event_context->desktop; - +bool SPSprayContext::root_handler(GdkEvent* event) { gint ret = FALSE; switch (event->type) { case GDK_ENTER_NOTIFY: - sp_canvas_item_show(tc->dilate_area); + sp_canvas_item_show(this->dilate_area); break; case GDK_LEAVE_NOTIFY: - sp_canvas_item_hide(tc->dilate_area); + sp_canvas_item_hide(this->dilate_area); break; case GDK_BUTTON_PRESS: - if (event->button.button == 1 && !event_context->space_panning) { - if (Inkscape::have_viable_layer(desktop, tc->_message_context) == false) { + if (event->button.button == 1 && !this->space_panning) { + if (Inkscape::have_viable_layer(desktop, this->message_context) == false) { return TRUE; } Geom::Point const motion_w(event->button.x, event->button.y); Geom::Point const motion_dt(desktop->w2d(motion_w)); - tc->last_push = desktop->dt2doc(motion_dt); + this->last_push = desktop->dt2doc(motion_dt); - sp_spray_extinput(tc, event); + sp_spray_extinput(this, event); desktop->canvas->forceFullRedrawAfterInterruptions(3); - tc->is_drawing = true; - tc->is_dilating = true; - tc->has_dilated = false; + this->is_drawing = true; + this->is_dilating = true; + this->has_dilated = false; - if(tc->is_dilating && event->button.button == 1 && !event_context->space_panning) { - sp_spray_dilate(tc, motion_w, desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD__SHIFT(event)); + if(this->is_dilating && event->button.button == 1 && !this->space_panning) { + sp_spray_dilate(this, motion_w, desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD__SHIFT(event)); } - tc->has_dilated = true; + this->has_dilated = true; ret = TRUE; } break; @@ -663,27 +635,27 @@ gint SPSprayContext::root_handler(GdkEvent* event) { event->motion.y); Geom::Point motion_dt(desktop->w2d(motion_w)); Geom::Point motion_doc(desktop->dt2doc(motion_dt)); - sp_spray_extinput(tc, event); + sp_spray_extinput(this, event); // draw the dilating cursor - double radius = get_dilate_radius(tc); - Geom::Affine const sm (Geom::Scale(radius/(1-tc->ratio), radius/(1+tc->ratio)) ); - sp_canvas_item_affine_absolute(tc->dilate_area, (sm*Geom::Rotate(tc->tilt))*Geom::Translate(desktop->w2d(motion_w))); - sp_canvas_item_show(tc->dilate_area); + double radius = get_dilate_radius(this); + Geom::Affine const sm (Geom::Scale(radius/(1-this->ratio), radius/(1+this->ratio)) ); + sp_canvas_item_affine_absolute(this->dilate_area, (sm*Geom::Rotate(this->tilt))*Geom::Translate(desktop->w2d(motion_w))); + sp_canvas_item_show(this->dilate_area); guint num = 0; if (!desktop->selection->isEmpty()) { num = g_slist_length(const_cast(desktop->selection->itemList())); } if (num == 0) { - tc->_message_context->flash(Inkscape::ERROR_MESSAGE, _("Nothing selected! Select objects to spray.")); + this->message_context->flash(Inkscape::ERROR_MESSAGE, _("Nothing selected! Select objects to spray.")); } // dilating: - if (tc->is_drawing && ( event->motion.state & GDK_BUTTON1_MASK )) { - sp_spray_dilate(tc, motion_w, motion_doc, motion_doc - tc->last_push, event->button.state & GDK_SHIFT_MASK? true : false); - //tc->last_push = motion_doc; - tc->has_dilated = true; + if (this->is_drawing && ( event->motion.state & GDK_BUTTON1_MASK )) { + sp_spray_dilate(this, motion_w, motion_doc, motion_doc - this->last_push, event->button.state & GDK_SHIFT_MASK? true : false); + //this->last_push = motion_doc; + this->has_dilated = true; // it's slow, so prevent clogging up with events gobble_motion_events(GDK_BUTTON1_MASK); @@ -695,31 +667,31 @@ gint SPSprayContext::root_handler(GdkEvent* event) { case GDK_SCROLL: { if (event->scroll.state & GDK_BUTTON1_MASK) { double temp ; - temp = tc->population; - tc->population = 1.0; - desktop->setToolboxAdjustmentValue("population", tc->population * 100); + temp = this->population; + this->population = 1.0; + desktop->setToolboxAdjustmentValue("population", this->population * 100); Geom::Point const scroll_w(event->button.x, event->button.y); Geom::Point const scroll_dt = desktop->point();; Geom::Point motion_doc(desktop->dt2doc(scroll_dt)); switch (event->scroll.direction) { case GDK_SCROLL_DOWN: case GDK_SCROLL_UP: { - if (Inkscape::have_viable_layer(desktop, tc->_message_context) == false) { + if (Inkscape::have_viable_layer(desktop, this->message_context) == false) { return TRUE; } - tc->last_push = desktop->dt2doc(scroll_dt); - sp_spray_extinput(tc, event); + this->last_push = desktop->dt2doc(scroll_dt); + sp_spray_extinput(this, event); desktop->canvas->forceFullRedrawAfterInterruptions(3); - tc->is_drawing = true; - tc->is_dilating = true; - tc->has_dilated = false; - if(tc->is_dilating && !event_context->space_panning) { - sp_spray_dilate(tc, scroll_w, desktop->dt2doc(scroll_dt), Geom::Point(0,0), false); + this->is_drawing = true; + this->is_dilating = true; + this->has_dilated = false; + if(this->is_dilating && !this->space_panning) { + sp_spray_dilate(this, scroll_w, desktop->dt2doc(scroll_dt), Geom::Point(0,0), false); } - tc->has_dilated = true; + this->has_dilated = true; - tc->population = temp; - desktop->setToolboxAdjustmentValue("population", tc->population * 100); + this->population = temp; + desktop->setToolboxAdjustmentValue("population", this->population * 100); ret = TRUE; } @@ -738,27 +710,27 @@ gint SPSprayContext::root_handler(GdkEvent* event) { Geom::Point const motion_dt(desktop->w2d(motion_w)); desktop->canvas->endForcedFullRedraws(); - tc->is_drawing = false; + this->is_drawing = false; - if (tc->is_dilating && event->button.button == 1 && !event_context->space_panning) { - if (!tc->has_dilated) { + if (this->is_dilating && event->button.button == 1 && !this->space_panning) { + if (!this->has_dilated) { // if we did not rub, do a light tap - tc->pressure = 0.03; - sp_spray_dilate(tc, motion_w, desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD__SHIFT(event)); + this->pressure = 0.03; + sp_spray_dilate(this, motion_w, desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD__SHIFT(event)); } - tc->is_dilating = false; - tc->has_dilated = false; - switch (tc->mode) { + this->is_dilating = false; + this->has_dilated = false; + switch (this->mode) { case SPRAY_MODE_COPY: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop), + DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), SP_VERB_CONTEXT_SPRAY, _("Spray with copies")); break; case SPRAY_MODE_CLONE: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop), + DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), SP_VERB_CONTEXT_SPRAY, _("Spray with clones")); break; case SPRAY_MODE_SINGLE_PATH: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop), + DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), SP_VERB_CONTEXT_SPRAY, _("Spray in single path")); break; } @@ -771,83 +743,83 @@ gint SPSprayContext::root_handler(GdkEvent* event) { case GDK_KEY_j: case GDK_KEY_J: if (MOD__SHIFT_ONLY(event)) { - sp_spray_switch_mode(tc, SPRAY_MODE_COPY, MOD__SHIFT(event)); + sp_spray_switch_mode(this, SPRAY_MODE_COPY, MOD__SHIFT(event)); ret = TRUE; } break; case GDK_KEY_k: case GDK_KEY_K: if (MOD__SHIFT_ONLY(event)) { - sp_spray_switch_mode(tc, SPRAY_MODE_CLONE, MOD__SHIFT(event)); + sp_spray_switch_mode(this, SPRAY_MODE_CLONE, MOD__SHIFT(event)); ret = TRUE; } break; case GDK_KEY_l: case GDK_KEY_L: if (MOD__SHIFT_ONLY(event)) { - sp_spray_switch_mode(tc, SPRAY_MODE_SINGLE_PATH, MOD__SHIFT(event)); + sp_spray_switch_mode(this, SPRAY_MODE_SINGLE_PATH, MOD__SHIFT(event)); ret = TRUE; } break; case GDK_KEY_Up: case GDK_KEY_KP_Up: if (!MOD__CTRL_ONLY(event)) { - tc->population += 0.01; - if (tc->population > 1.0) { - tc->population = 1.0; + this->population += 0.01; + if (this->population > 1.0) { + this->population = 1.0; } - desktop->setToolboxAdjustmentValue("spray-population", tc->population * 100); + desktop->setToolboxAdjustmentValue("spray-population", this->population * 100); ret = TRUE; } break; case GDK_KEY_Down: case GDK_KEY_KP_Down: if (!MOD__CTRL_ONLY(event)) { - tc->population -= 0.01; - if (tc->population < 0.0) { - tc->population = 0.0; + this->population -= 0.01; + if (this->population < 0.0) { + this->population = 0.0; } - desktop->setToolboxAdjustmentValue("spray-population", tc->population * 100); + desktop->setToolboxAdjustmentValue("spray-population", this->population * 100); ret = TRUE; } break; case GDK_KEY_Right: case GDK_KEY_KP_Right: if (!MOD__CTRL_ONLY(event)) { - tc->width += 0.01; - if (tc->width > 1.0) { - tc->width = 1.0; + this->width += 0.01; + if (this->width > 1.0) { + this->width = 1.0; } // the same spinbutton is for alt+x - desktop->setToolboxAdjustmentValue("altx-spray", tc->width * 100); - sp_spray_update_area(tc); + desktop->setToolboxAdjustmentValue("altx-spray", this->width * 100); + sp_spray_update_area(this); ret = TRUE; } break; case GDK_KEY_Left: case GDK_KEY_KP_Left: if (!MOD__CTRL_ONLY(event)) { - tc->width -= 0.01; - if (tc->width < 0.01) { - tc->width = 0.01; + this->width -= 0.01; + if (this->width < 0.01) { + this->width = 0.01; } - desktop->setToolboxAdjustmentValue("altx-spray", tc->width * 100); - sp_spray_update_area(tc); + desktop->setToolboxAdjustmentValue("altx-spray", this->width * 100); + sp_spray_update_area(this); ret = TRUE; } break; case GDK_KEY_Home: case GDK_KEY_KP_Home: - tc->width = 0.01; - desktop->setToolboxAdjustmentValue("altx-spray", tc->width * 100); - sp_spray_update_area(tc); + this->width = 0.01; + desktop->setToolboxAdjustmentValue("altx-spray", this->width * 100); + sp_spray_update_area(this); ret = TRUE; break; case GDK_KEY_End: case GDK_KEY_KP_End: - tc->width = 1.0; - desktop->setToolboxAdjustmentValue("altx-spray", tc->width * 100); - sp_spray_update_area(tc); + this->width = 1.0; + desktop->setToolboxAdjustmentValue("altx-spray", this->width * 100); + sp_spray_update_area(this); ret = TRUE; break; case GDK_KEY_x: @@ -859,7 +831,7 @@ gint SPSprayContext::root_handler(GdkEvent* event) { break; case GDK_KEY_Shift_L: case GDK_KEY_Shift_R: - sp_spray_update_cursor(tc, true); + sp_spray_update_cursor(this, true); break; case GDK_KEY_Control_L: case GDK_KEY_Control_R: @@ -867,7 +839,7 @@ gint SPSprayContext::root_handler(GdkEvent* event) { case GDK_KEY_Delete: case GDK_KEY_KP_Delete: case GDK_KEY_BackSpace: - ret = event_context->deleteSelectedDrag(MOD__CTRL_ONLY(event)); + ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); break; default: @@ -880,15 +852,15 @@ gint SPSprayContext::root_handler(GdkEvent* event) { switch (get_group0_keyval(&event->key)) { case GDK_KEY_Shift_L: case GDK_KEY_Shift_R: - sp_spray_update_cursor(tc, false); + sp_spray_update_cursor(this, false); break; case GDK_KEY_Control_L: case GDK_KEY_Control_R: - sp_spray_switch_mode (tc, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); - tc->_message_context->clear(); + sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); + this->message_context->clear(); break; default: - sp_spray_switch_mode (tc, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); + sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); break; } } -- cgit v1.2.3 From 989abbac025a8b3349748d19a613a08586c5fdcd Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 31 Jul 2013 21:11:20 +0200 Subject: Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes. (bzr r11608.1.110) --- src/spray-context.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index c96df20b2..8256d6861 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -131,7 +131,6 @@ static void sp_spray_scale_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *it SPSprayContext::SPSprayContext() : SPEventContext() { this->usetilt = 0; - this->message_context = 0; this->dilate_area = 0; this->usetext = false; this->population = 0; @@ -169,10 +168,6 @@ SPSprayContext::~SPSprayContext() { sp_canvas_item_destroy(this->dilate_area); this->dilate_area = NULL; } - - if (this->message_context) { - delete this->message_context; - } } static bool is_transform_modes(gint mode) @@ -237,8 +232,6 @@ void SPSprayContext::setup() { this->is_drawing = false; - this->message_context = new Inkscape::MessageContext((this->desktop)->messageStack()); - sp_event_context_read(this, "distrib"); sp_event_context_read(this, "width"); sp_event_context_read(this, "ratio"); -- cgit v1.2.3 From bf4a1d2d49850170b936c30cfe2b30e798716406 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 3 Aug 2013 03:03:43 +0200 Subject: Cleaned up. (bzr r11608.1.117) --- src/spray-context.cpp | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'src/spray-context.cpp') diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 8256d6861..51fdab6ff 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -178,13 +178,10 @@ static bool is_transform_modes(gint mode) mode == SPRAY_OPTION); } -static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) -{ - SPEventContext *event_context = SP_EVENT_CONTEXT(tc); - SPDesktop *desktop = event_context->desktop; - +void SPSprayContext::update_cursor(bool /*with_shift*/) { guint num = 0; gchar *sel_message = NULL; + if (!desktop->selection->isEmpty()) { num = g_slist_length(const_cast(desktop->selection->itemList())); sel_message = g_strdup_printf(ngettext("%i object selected","%i objects selected",num), num); @@ -192,22 +189,22 @@ static void sp_spray_update_cursor(SPSprayContext *tc, bool /*with_shift*/) sel_message = g_strdup_printf(_("Nothing selected")); } + switch (this->mode) { + case SPRAY_MODE_COPY: + this->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray copies of the initial selection."), sel_message); + break; + case SPRAY_MODE_CLONE: + this->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray clones of the initial selection."), sel_message); + break; + case SPRAY_MODE_SINGLE_PATH: + this->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray in a single path of the initial selection."), sel_message); + break; + default: + break; + } - switch (tc->mode) { - case SPRAY_MODE_COPY: - tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray copies of the initial selection."), sel_message); - break; - case SPRAY_MODE_CLONE: - tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray clones of the initial selection."), sel_message); - break; - case SPRAY_MODE_SINGLE_PATH: - tc->message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag, click or click and scroll to spray in a single path of the initial selection."), sel_message); - break; - default: - break; - } - event_context->sp_event_context_update_cursor(); - g_free(sel_message); + this->sp_event_context_update_cursor(); + g_free(sel_message); } void SPSprayContext::setup() { @@ -260,7 +257,7 @@ void SPSprayContext::set(const Inkscape::Preferences::Entry& val) { if (path == "mode") { this->mode = val.getInt(); - sp_spray_update_cursor(this, false); + this->update_cursor(false); } else if (path == "width") { this->width = 0.01 * CLAMP(val.getInt(10), 1, 100); } else if (path == "usepressure") { @@ -585,7 +582,7 @@ static void sp_spray_switch_mode(SPSprayContext *tc, gint mode, bool with_shift) SP_EVENT_CONTEXT(tc)->desktop->setToolboxSelectOneValue("spray_tool_mode", mode); // need to set explicitly, because the prefs may not have changed by the previous tc->mode = mode; - sp_spray_update_cursor(tc, with_shift); + tc->update_cursor(with_shift); } bool SPSprayContext::root_handler(GdkEvent* event) { @@ -824,7 +821,7 @@ bool SPSprayContext::root_handler(GdkEvent* event) { break; case GDK_KEY_Shift_L: case GDK_KEY_Shift_R: - sp_spray_update_cursor(this, true); + this->update_cursor(true); break; case GDK_KEY_Control_L: case GDK_KEY_Control_R: @@ -845,7 +842,7 @@ bool SPSprayContext::root_handler(GdkEvent* event) { switch (get_group0_keyval(&event->key)) { case GDK_KEY_Shift_L: case GDK_KEY_Shift_R: - sp_spray_update_cursor(this, false); + this->update_cursor(false); break; case GDK_KEY_Control_L: case GDK_KEY_Control_R: -- cgit v1.2.3