summaryrefslogtreecommitdiffstats
path: root/src/ui/tool
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:10:02 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:10:02 +0000
commitd2df0412f728dd5bb54537dfdfe7c35b34d40e0e (patch)
treee2703384779e83312c456399999997fcc289c5cf /src/ui/tool
parentMerge branch 'master' into powerpencil (diff)
parentchange assignment to equality (diff)
downloadinkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.tar.gz
inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.zip
Merge branch 'master' into powerpencil
Diffstat (limited to 'src/ui/tool')
-rw-r--r--src/ui/tool/control-point-selection.h1
-rw-r--r--src/ui/tool/control-point.cpp2
-rw-r--r--src/ui/tool/control-point.h12
-rw-r--r--src/ui/tool/manipulator.h16
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp5
-rw-r--r--src/ui/tool/multi-path-manipulator.h8
-rw-r--r--src/ui/tool/node.cpp19
-rw-r--r--src/ui/tool/node.h8
-rw-r--r--src/ui/tool/path-manipulator.cpp2
-rw-r--r--src/ui/tool/path-manipulator.h4
10 files changed, 27 insertions, 50 deletions
diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h
index f122a468d..ec845b1b3 100644
--- a/src/ui/tool/control-point-selection.h
+++ b/src/ui/tool/control-point-selection.h
@@ -20,7 +20,6 @@
#include <2geom/forward.h>
#include <2geom/point.h>
#include <2geom/rect.h>
-#include "util/accumulators.h"
#include "util/unordered-containers.h"
#include "ui/tool/commit-events.h"
#include "ui/tool/manipulator.h"
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp
index d9374c790..8ab9fcbd7 100644
--- a/src/ui/tool/control-point.cpp
+++ b/src/ui/tool/control-point.cpp
@@ -380,7 +380,7 @@ bool ControlPoint::_eventHandler(Inkscape::UI::Tools::ToolBase *event_context, G
// update tips on modifier state change
// TODO add ESC keybinding as drag cancel
case GDK_KEY_PRESS:
- switch (Inkscape::UI::Tools::get_group0_keyval(&event->key))
+ switch (Inkscape::UI::Tools::get_latin_keyval(&event->key))
{
case GDK_KEY_Escape: {
// ignore Escape if this is not a drag
diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h
index 4a01b9f21..bc1f060cd 100644
--- a/src/ui/tool/control-point.h
+++ b/src/ui/tool/control-point.h
@@ -18,7 +18,6 @@
#include <2geom/point.h>
#include "ui/control-types.h"
-#include "util/accumulators.h"
#include "display/sodipodi-ctrl.h"
#include "enums.h"
@@ -76,8 +75,6 @@ namespace UI {
*/
class ControlPoint : boost::noncopyable, public sigc::trackable {
public:
- typedef Inkscape::Util::ReverseInterruptible RInt;
- typedef Inkscape::Util::Interruptible Int;
/**
* Enumeration representing the possible states of the control point, used to determine
@@ -162,15 +159,6 @@ public:
void transferGrab(ControlPoint *from, GdkEventMotion *event);
/// @}
- /// @name Receive notifications about control point events
- /// @{
- /*sigc::signal<void, Geom::Point const &, Geom::Point &, GdkEventMotion*> signal_dragged;
- sigc::signal<bool, GdkEventButton*>::accumulated<RInt> signal_clicked;
- sigc::signal<bool, GdkEventButton*>::accumulated<RInt> signal_doubleclicked;
- sigc::signal<bool, GdkEventMotion*>::accumulated<Int> signal_grabbed;
- sigc::signal<void, GdkEventButton*> signal_ungrabbed;*/
- /// @}
-
/// @name Inspect the state of the control point
/// @{
State state() const { return _state; }
diff --git a/src/ui/tool/manipulator.h b/src/ui/tool/manipulator.h
index 07e01a656..66b47ce98 100644
--- a/src/ui/tool/manipulator.h
+++ b/src/ui/tool/manipulator.h
@@ -17,7 +17,6 @@
#include <sigc++/sigc++.h>
#include <glib.h>
#include <gdk/gdk.h>
-#include <boost/shared_ptr.hpp>
#include "ui/tools/tool-base.h"
class SPDesktop;
@@ -76,14 +75,14 @@ template <typename T>
class MultiManipulator : public PointManipulator {
public:
//typedef typename T::ItemType ItemType;
- typedef typename std::pair<void*, boost::shared_ptr<T> > MapPair;
- typedef typename std::map<void*, boost::shared_ptr<T> > MapType;
+ typedef typename std::pair<void*, std::shared_ptr<T> > MapPair;
+ typedef typename std::map<void*, std::shared_ptr<T> > MapType;
MultiManipulator(SPDesktop *d, ControlPointSelection &sel)
: PointManipulator(d, sel)
{}
void addItem(void *item) {
- boost::shared_ptr<T> m(_createManipulator(item));
+ std::shared_ptr<T> m(_createManipulator(item));
_mmap.insert(MapPair(item, m));
}
void removeItem(void *item) {
@@ -98,16 +97,17 @@ public:
bool empty() {
return _mmap.empty();
}
- void setItems(GSList const *list) {
+
+ void setItems(std::vector<gpointer> list) { // this function is not called anywhere ... delete ?
std::set<void*> to_remove;
for (typename MapType::iterator mi = _mmap.begin(); mi != _mmap.end(); ++mi) {
to_remove.insert(mi->first);
}
- for (GSList *i = const_cast<GSList*>(list); i; i = i->next) {
- if (_isItemType(i->data)) {
+ for (auto i:list) {
+ if (_isItemType(i)) {
// erase returns the number of items removed
// if nothing was removed, it means this item did not have a manipulator - add it
- if (!to_remove.erase(i->data)) addItem(i->data);
+ if (!to_remove.erase(i)) addItem(i);
}
}
typedef typename std::set<void*>::iterator RmIter;
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index f30c7e349..9cfa4ed31 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -10,7 +10,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <boost/shared_ptr.hpp>
#include "node.h"
#include <glibmm/i18n.h>
#include "desktop.h"
@@ -161,7 +160,7 @@ void MultiPathManipulator::setItems(std::set<ShapeRecord> const &s)
if (sr.edit_transform != sr_new.edit_transform ||
sr.role != sr_new.role)
{
- boost::shared_ptr<PathManipulator> hold(i->second);
+ std::shared_ptr<PathManipulator> hold(i->second);
if (sr.edit_transform != sr_new.edit_transform)
hold->setControlsTransform(sr_new.edit_transform);
if (sr.role != sr_new.role) {
@@ -179,7 +178,7 @@ void MultiPathManipulator::setItems(std::set<ShapeRecord> const &s)
for (std::set<ShapeRecord>::iterator i = shapes.begin(); i != shapes.end(); ++i) {
ShapeRecord const &r = *i;
if (!SP_IS_PATH(r.item) && !IS_LIVEPATHEFFECT(r.item)) continue;
- boost::shared_ptr<PathManipulator> newpm(new PathManipulator(*this, (SPPath*) r.item,
+ std::shared_ptr<PathManipulator> newpm(new PathManipulator(*this, (SPPath*) r.item,
r.edit_transform, _getOutlineColor(r.role, r.item), r.lpe_key));
newpm->showHandles(_show_handles);
// always show outlines for clips and masks
diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h
index 4f152e0a2..742c6d421 100644
--- a/src/ui/tool/multi-path-manipulator.h
+++ b/src/ui/tool/multi-path-manipulator.h
@@ -77,8 +77,8 @@ public:
sigc::signal<void> signal_coords_changed; /// Emitted whenever the coordinates
/// shown in the status bar need updating
private:
- typedef std::pair<ShapeRecord, boost::shared_ptr<PathManipulator> > MapPair;
- typedef std::map<ShapeRecord, boost::shared_ptr<PathManipulator> > MapType;
+ typedef std::pair<ShapeRecord, std::shared_ptr<PathManipulator> > MapPair;
+ typedef std::map<ShapeRecord, std::shared_ptr<PathManipulator> > MapType;
template <typename R>
void invokeForAll(R (PathManipulator::*method)()) {
@@ -88,11 +88,11 @@ private:
// be a valid iterator and then assign i to it.
MapType::iterator next_i = i;
++next_i;
- // i->second is a boost::shared_ptr so try to hold on to it so
+ // i->second is a std::shared_ptr so try to hold on to it so
// it won't get freed prematurely by the WriteXML() method or
// whatever. See https://bugs.launchpad.net/inkscape/+bug/1617615
// Applicable to empty paths.
- boost::shared_ptr<PathManipulator> hold(i->second);
+ std::shared_ptr<PathManipulator> hold(i->second);
((hold.get())->*method)();
i = next_i;
}
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index d6e491ac3..4f42400d4 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -559,14 +559,11 @@ Glib::ustring Handle::_getDragTip(GdkEventMotion */*event*/) const
Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px");
Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px");
Inkscape::Util::Quantity len_q = Inkscape::Util::Quantity(length(), "px");
- GString *x = g_string_new(x_q.string(_desktop->namedview->display_units).c_str());
- GString *y = g_string_new(y_q.string(_desktop->namedview->display_units).c_str());
- GString *len = g_string_new(len_q.string(_desktop->namedview->display_units).c_str());
+ Glib::ustring x = x_q.string(_desktop->namedview->display_units);
+ Glib::ustring y = y_q.string(_desktop->namedview->display_units);
+ Glib::ustring len = len_q.string(_desktop->namedview->display_units);
Glib::ustring ret = format_tip(C_("Path handle tip",
- "Move handle by %s, %s; angle %.2f°, length %s"), x->str, y->str, angle, len->str);
- g_string_free(x, TRUE);
- g_string_free(y, TRUE);
- g_string_free(len, TRUE);
+ "Move handle by %s, %s; angle %.2f°, length %s"), x.c_str(), y.c_str(), angle, len.c_str());
return ret;
}
@@ -1458,11 +1455,9 @@ Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const
Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px");
Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px");
- GString *x = g_string_new(x_q.string(_desktop->namedview->display_units).c_str());
- GString *y = g_string_new(y_q.string(_desktop->namedview->display_units).c_str());
- Glib::ustring ret = format_tip(C_("Path node tip", "Move node by %s, %s"), x->str, y->str);
- g_string_free(x, TRUE);
- g_string_free(y, TRUE);
+ Glib::ustring x = x_q.string(_desktop->namedview->display_units);
+ Glib::ustring y = y_q.string(_desktop->namedview->display_units);
+ Glib::ustring ret = format_tip(C_("Path node tip", "Move node by %s, %s"), x.c_str(), y.c_str());
return ret;
}
diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h
index a05f0e3b9..2964b66ca 100644
--- a/src/ui/tool/node.h
+++ b/src/ui/tool/node.h
@@ -22,8 +22,6 @@
#include <cstddef>
#include <functional>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
#include "ui/tool/selectable-control-point.h"
#include "snapped-point.h"
#include "ui/tool/node-types.h"
@@ -357,7 +355,7 @@ private:
friend class NodeList;
};
-class NodeList : ListNode, boost::noncopyable, public boost::enable_shared_from_this<NodeList> {
+class NodeList : ListNode, boost::noncopyable {
public:
typedef std::size_t size_type;
typedef Node &reference;
@@ -465,9 +463,9 @@ private:
* List of node lists. Represents an editable path.
* Editable path composed of one or more subpaths.
*/
-class SubpathList : public std::list< boost::shared_ptr<NodeList> > {
+class SubpathList : public std::list< std::shared_ptr<NodeList> > {
public:
- typedef std::list< boost::shared_ptr<NodeList> > list_type;
+ typedef std::list< std::shared_ptr<NodeList> > list_type;
SubpathList(PathManipulator &pm) : _path_manipulator(pm) {}
PathManipulator &pm() { return _path_manipulator; }
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index f2899dd01..2c99e7fc8 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -68,7 +68,7 @@ public:
}
virtual void notifyAttributeChanged(Inkscape::XML::Node &/*node*/, GQuark attr,
- Util::ptr_shared<char>, Util::ptr_shared<char>)
+ Util::ptr_shared, Util::ptr_shared)
{
// do nothing if blocked
if (_blocked) return;
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 283cb610a..5fa24c23b 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -15,8 +15,6 @@
#include <memory>
#include <2geom/pathvector.h>
#include <2geom/affine.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
#include "ui/tool/node.h"
#include "ui/tool/manipulator.h"
#include "live_effects/lpe-bspline.h"
@@ -105,7 +103,7 @@ public:
static bool is_item_type(void *item);
private:
typedef NodeList Subpath;
- typedef boost::shared_ptr<NodeList> SubpathPtr;
+ typedef std::shared_ptr<NodeList> SubpathPtr;
void _createControlPointsFromGeometry();