summaryrefslogtreecommitdiffstats
path: root/src/dropper-context.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-11-07 20:44:00 +0000
committerMarkus Engel <markus.engel@tum.de>2013-11-07 20:44:00 +0000
commit55b451bf382e0c3d5ed8728e42fbb535acfa8a33 (patch)
tree094d9faca06cfffc89a872732db4ac3ef60508d9 /src/dropper-context.cpp
parentFix for Bug #1247985 (Incorrect implementation of plural forms). (diff)
downloadinkscape-55b451bf382e0c3d5ed8728e42fbb535acfa8a33.tar.gz
inkscape-55b451bf382e0c3d5ed8728e42fbb535acfa8a33.zip
First step of moving tools into appropriate namespaces.
(bzr r12782)
Diffstat (limited to 'src/dropper-context.cpp')
-rw-r--r--src/dropper-context.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/dropper-context.cpp b/src/dropper-context.cpp
index dcb1ab66c..cf2f6b6c9 100644
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
@@ -54,21 +54,25 @@ static GdkCursor *cursor_dropper_stroke = NULL;
#include "tool-factory.h"
+namespace Inkscape {
+namespace UI {
+namespace Tools {
+
namespace {
- SPEventContext* createDropperContext() {
- return new SPDropperContext();
+ ToolBase* createDropperContext() {
+ return new DropperTool();
}
bool dropperContextRegistered = ToolFactory::instance().registerObject("/tools/dropper", createDropperContext);
}
-const std::string& SPDropperContext::getPrefsPath() {
- return SPDropperContext::prefsPath;
+const std::string& DropperTool::getPrefsPath() {
+ return DropperTool::prefsPath;
}
-const std::string SPDropperContext::prefsPath = "/tools/dropper";
+const std::string DropperTool::prefsPath = "/tools/dropper";
-SPDropperContext::SPDropperContext() : SPEventContext() {
+DropperTool::DropperTool() : ToolBase() {
this->R = 0;
this->G = 0;
this->B = 0;
@@ -87,13 +91,13 @@ SPDropperContext::SPDropperContext() : SPEventContext() {
cursor_dropper_stroke = sp_cursor_new_from_xpm(cursor_dropper_s_xpm , 7, 7);
}
-SPDropperContext::~SPDropperContext() {
+DropperTool::~DropperTool() {
}
-void SPDropperContext::setup() {
- SPEventContext::setup();
+void DropperTool::setup() {
+ ToolBase::setup();
- /* TODO: have a look at SPDynaDrawContext::setup where the same is done.. generalize? */
+ /* TODO: have a look at CalligraphicTool::setup where the same is done.. generalize? */
Geom::PathVector path;
Geom::Circle(0, 0, 1).getPath(path);
@@ -118,7 +122,7 @@ void SPDropperContext::setup() {
}
}
-void SPDropperContext::finish() {
+void DropperTool::finish() {
this->enableGrDrag(false);
if (this->grabbed) {
@@ -153,7 +157,7 @@ void SPDropperContext::finish() {
/**
* Returns the current dropper context color.
*/
-guint32 SPDropperContext::get_color() {
+guint32 DropperTool::get_color() {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int pick = prefs->getInt("/tools/dropper/pick", SP_DROPPER_PICK_VISIBLE);
@@ -165,7 +169,7 @@ guint32 SPDropperContext::get_color() {
(pick == SP_DROPPER_PICK_ACTUAL && setalpha) ? this->alpha : 1.0);
}
-bool SPDropperContext::root_handler(GdkEvent* event) {
+bool DropperTool::root_handler(GdkEvent* event) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int ret = FALSE;
@@ -387,12 +391,16 @@ bool SPDropperContext::root_handler(GdkEvent* event) {
}
if (!ret) {
- ret = SPEventContext::root_handler(event);
+ ret = ToolBase::root_handler(event);
}
return ret;
}
+}
+}
+}
+
/*
Local Variables: