summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/dynamic-base.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-11-13 00:00:04 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-11-13 00:00:04 +0000
commit152a0caf7e216e7ceafeed20822500c385e3e2df (patch)
treea3b5d60e08f3bd8221ba2e50eea80b087e5d541a /src/ui/tools/dynamic-base.cpp
parentUpdate to trunk (diff)
parentfix C++11 compilation. There A LOT of const_casts in this file... :-( (diff)
downloadinkscape-152a0caf7e216e7ceafeed20822500c385e3e2df.tar.gz
inkscape-152a0caf7e216e7ceafeed20822500c385e3e2df.zip
Update to trunk
(bzr r12588.1.26)
Diffstat (limited to '')
-rw-r--r--src/ui/tools/dynamic-base.cpp (renamed from src/common-context.cpp)22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/common-context.cpp b/src/ui/tools/dynamic-base.cpp
index 2155f9739..cec58dce9 100644
--- a/src/common-context.cpp
+++ b/src/ui/tools/dynamic-base.cpp
@@ -1,5 +1,5 @@
-#include "common-context.h"
+#include "ui/tools/dynamic-base.h"
#include <gtk/gtk.h>
@@ -19,8 +19,12 @@
#define DRAG_DEFAULT 1.0
#define DRAG_MAX 1.0
-SPCommonContext::SPCommonContext() :
- SPEventContext(),
+namespace Inkscape {
+namespace UI {
+namespace Tools {
+
+DynamicBase::DynamicBase() :
+ ToolBase(),
accumulated(NULL),
segments(NULL),
currentshape(NULL),
@@ -56,7 +60,7 @@ SPCommonContext::SPCommonContext() :
{
}
-SPCommonContext::~SPCommonContext() {
+DynamicBase::~DynamicBase() {
if (this->accumulated) {
this->accumulated = this->accumulated->unref();
this->accumulated = 0;
@@ -88,7 +92,7 @@ SPCommonContext::~SPCommonContext() {
}
}
-void SPCommonContext::set(const Inkscape::Preferences::Entry& value) {
+void DynamicBase::set(const Inkscape::Preferences::Entry& value) {
Glib::ustring path = value.getEntryName();
// ignore preset modifications
@@ -125,7 +129,7 @@ void SPCommonContext::set(const Inkscape::Preferences::Entry& value) {
}
/* Get normalized point */
-Geom::Point SPCommonContext::getNormalizedPoint(Geom::Point v) const {
+Geom::Point DynamicBase::getNormalizedPoint(Geom::Point v) const {
Geom::Rect drect = this->desktop->get_display_area();
double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] );
@@ -134,7 +138,7 @@ Geom::Point SPCommonContext::getNormalizedPoint(Geom::Point v) const {
}
/* Get view point */
-Geom::Point SPCommonContext::getViewPoint(Geom::Point n) const {
+Geom::Point DynamicBase::getViewPoint(Geom::Point n) const {
Geom::Rect drect = this->desktop->get_display_area();
double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] );
@@ -142,6 +146,10 @@ Geom::Point SPCommonContext::getViewPoint(Geom::Point n) const {
return Geom::Point(n[Geom::X] * max + drect.min()[Geom::X], n[Geom::Y] * max + drect.min()[Geom::Y]);
}
+}
+}
+}
+
/*
Local Variables:
mode:c++