diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-11-10 02:08:46 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2013-11-10 02:08:46 +0000 |
| commit | ca1286aa677b5ff8d80fe274dfa3e759478570b3 (patch) | |
| tree | 36c7edfa575cea3d3bddfc4b034f7a35a8374ade /src/ui/tools/freehand-base.cpp | |
| parent | Fixing bugs on update to trunk (diff) | |
| parent | Revert unintentional change. (diff) | |
| download | inkscape-ca1286aa677b5ff8d80fe274dfa3e759478570b3.tar.gz inkscape-ca1286aa677b5ff8d80fe274dfa3e759478570b3.zip | |
Update to trunk
(bzr r11950.1.195)
Diffstat (limited to '')
| -rw-r--r-- | src/ui/tools/freehand-base.cpp (renamed from src/draw-context.cpp) | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/draw-context.cpp b/src/ui/tools/freehand-base.cpp index 714e43783..fa9eaa6b4 100644 --- a/src/draw-context.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -33,8 +33,8 @@ #include "draw-anchor.h" #include "macros.h" #include "message-stack.h" -#include "pen-context.h" -#include "lpe-tool-context.h" +#include "ui/tools/pen-tool.h" +#include "ui/tools/lpe-tool.h" #include "preferences.h" #include "selection.h" #include "selection-chemistry.h" @@ -44,7 +44,7 @@ #include "live_effects/lpe-powerstroke.h" #include "style.h" #include "ui/control-manager.h" -#include "draw-context.h" +#include "ui/tools/freehand-base.h" #include <gdk/gdkkeysyms.h> @@ -54,10 +54,10 @@ namespace Inkscape { namespace UI { namespace Tools { -static void spdc_selection_changed(Inkscape::Selection *sel, SPDrawContext *dc); -static void spdc_selection_modified(Inkscape::Selection *sel, guint flags, SPDrawContext *dc); +static void spdc_selection_changed(Inkscape::Selection *sel, FreehandBase *dc); +static void spdc_selection_modified(Inkscape::Selection *sel, guint flags, FreehandBase *dc); -static void spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection *sel); +static void spdc_attach_selection(FreehandBase *dc, Inkscape::Selection *sel); /** * Flushes white curve(s) and additional curve into object. @@ -65,12 +65,12 @@ static void spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection *sel); * No cleaning of colored curves - this has to be done by caller * No rereading of white data, so if you cannot rely on ::modified, do it in caller */ -static void spdc_flush_white(SPDrawContext *dc, SPCurve *gc); +static void spdc_flush_white(FreehandBase *dc, SPCurve *gc); -static void spdc_reset_white(SPDrawContext *dc); -static void spdc_free_colors(SPDrawContext *dc); +static void spdc_reset_white(FreehandBase *dc); +static void spdc_free_colors(FreehandBase *dc); -SPDrawContext::SPDrawContext() : ToolBase() { +FreehandBase::FreehandBase() : ToolBase() { this->selection = 0; this->grab = 0; this->anchor_statusbar = false; @@ -103,7 +103,7 @@ SPDrawContext::SPDrawContext() : ToolBase() { this->waiting_LPE_type = Inkscape::LivePathEffect::INVALID_LPE; } -SPDrawContext::~SPDrawContext() { +FreehandBase::~FreehandBase() { if (this->grab) { sp_canvas_item_ungrab(this->grab, GDK_CURRENT_TIME); this->grab = NULL; @@ -116,7 +116,7 @@ SPDrawContext::~SPDrawContext() { spdc_free_colors(this); } -void SPDrawContext::setup() { +void FreehandBase::setup() { ToolBase::setup(); this->selection = sp_desktop_selection(desktop); @@ -154,7 +154,7 @@ void SPDrawContext::setup() { spdc_attach_selection(this, this->selection); } -void SPDrawContext::finish() { +void FreehandBase::finish() { this->sel_changed_connection.disconnect(); this->sel_modified_connection.disconnect(); @@ -169,10 +169,10 @@ void SPDrawContext::finish() { spdc_free_colors(this); } -void SPDrawContext::set(const Inkscape::Preferences::Entry& /*value*/) { +void FreehandBase::set(const Inkscape::Preferences::Entry& /*value*/) { } -bool SPDrawContext::root_handler(GdkEvent* event) { +bool FreehandBase::root_handler(GdkEvent* event) { gint ret = FALSE; switch (event->type) { @@ -202,14 +202,14 @@ bool SPDrawContext::root_handler(GdkEvent* event) { return ret; } -static Glib::ustring const tool_name(SPDrawContext *dc) +static Glib::ustring const tool_name(FreehandBase *dc) { return ( SP_IS_PEN_CONTEXT(dc) ? "/tools/freehand/pen" : "/tools/freehand/pencil" ); } -static void spdc_paste_curve_as_freehand_shape(const SPCurve *c, SPDrawContext *dc, SPItem *item) +static void spdc_paste_curve_as_freehand_shape(const SPCurve *c, FreehandBase *dc, SPItem *item) { using namespace Inkscape::LivePathEffect; @@ -221,7 +221,7 @@ static void spdc_paste_curve_as_freehand_shape(const SPCurve *c, SPDrawContext * static_cast<LPEPatternAlongPath*>(lpe)->pattern.paste_param_path(svgd); } -static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points, SPDrawContext *dc, SPItem *item) +static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points, FreehandBase *dc, SPItem *item) { using namespace Inkscape::LivePathEffect; @@ -238,7 +238,7 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points lpe->getRepr()->setAttribute("interpolator_beta", "0.2"); } -static void spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item, SPCurve *curve) +static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve) { using namespace Inkscape::LivePathEffect; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -350,7 +350,7 @@ static void spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item * Selection handlers */ -static void spdc_selection_changed(Inkscape::Selection *sel, SPDrawContext *dc) +static void spdc_selection_changed(Inkscape::Selection *sel, FreehandBase *dc) { if (dc->attach) { spdc_attach_selection(dc, sel); @@ -359,14 +359,14 @@ static void spdc_selection_changed(Inkscape::Selection *sel, SPDrawContext *dc) /* fixme: We have to ensure this is not delayed (Lauris) */ -static void spdc_selection_modified(Inkscape::Selection *sel, guint /*flags*/, SPDrawContext *dc) +static void spdc_selection_modified(Inkscape::Selection *sel, guint /*flags*/, FreehandBase *dc) { if (dc->attach) { spdc_attach_selection(dc, sel); } } -static void spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection */*sel*/) +static void spdc_attach_selection(FreehandBase *dc, Inkscape::Selection */*sel*/) { // We reset white and forget white/start/end anchors spdc_reset_white(dc); @@ -465,7 +465,7 @@ static SPCurve *reverse_then_unref(SPCurve *orig) return ret; } -void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed) +void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) { // Concat RBG SPCurve *c = dc->green_curve; @@ -560,7 +560,7 @@ void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed) c->unref(); } -static void spdc_flush_white(SPDrawContext *dc, SPCurve *gc) +static void spdc_flush_white(FreehandBase *dc, SPCurve *gc) { SPCurve *c; @@ -641,7 +641,7 @@ static void spdc_flush_white(SPDrawContext *dc, SPCurve *gc) doc->ensureUpToDate(); } -SPDrawAnchor *spdc_test_inside(SPDrawContext *dc, Geom::Point p) +SPDrawAnchor *spdc_test_inside(FreehandBase *dc, Geom::Point p) { SPDrawAnchor *active = NULL; @@ -675,7 +675,7 @@ SPDrawAnchor *spdc_test_inside(SPDrawContext *dc, Geom::Point p) return active; } -static void spdc_reset_white(SPDrawContext *dc) +static void spdc_reset_white(FreehandBase *dc) { if (dc->white_item) { // We do not hold refcount @@ -691,7 +691,7 @@ static void spdc_reset_white(SPDrawContext *dc) } } -static void spdc_free_colors(SPDrawContext *dc) +static void spdc_free_colors(FreehandBase *dc) { // Red if (dc->red_bpath) { |
