diff options
Diffstat (limited to 'src/ui/tool')
| -rw-r--r-- | src/ui/tool/control-point-selection.h | 4 | ||||
| -rw-r--r-- | src/ui/tool/curve-drag-point.h | 14 | ||||
| -rw-r--r-- | src/ui/tool/manipulator.h | 2 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.h | 4 | ||||
| -rw-r--r-- | src/ui/tool/node.h | 46 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.h | 4 | ||||
| -rw-r--r-- | src/ui/tool/selectable-control-point.h | 12 | ||||
| -rw-r--r-- | src/ui/tool/selector.cpp | 12 | ||||
| -rw-r--r-- | src/ui/tool/selector.h | 4 | ||||
| -rw-r--r-- | src/ui/tool/transform-handle-set.cpp | 46 | ||||
| -rw-r--r-- | src/ui/tool/transform-handle-set.h | 10 |
12 files changed, 82 insertions, 82 deletions
diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index d0cfce8d2..ca00800c0 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -41,7 +41,7 @@ namespace UI { class ControlPointSelection : public Manipulator, public sigc::trackable { public: ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group); - ~ControlPointSelection(); + ~ControlPointSelection() override; typedef INK_UNORDERED_SET<SelectableControlPoint *> set_type; typedef set_type Set; // convenience alias @@ -91,7 +91,7 @@ public: void invertSelection(); void spatialGrow(SelectableControlPoint *origin, int dir); - virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *); + bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *) override; void transform(Geom::Affine const &m); void align(Geom::Dim2 d); diff --git a/src/ui/tool/curve-drag-point.h b/src/ui/tool/curve-drag-point.h index c1d40575f..925d8d05d 100644 --- a/src/ui/tool/curve-drag-point.h +++ b/src/ui/tool/curve-drag-point.h @@ -37,16 +37,16 @@ public: double getTimeValue() { return _t; } void setIterator(NodeList::iterator i) { first = i; } NodeList::iterator getIterator() { return first; } - virtual bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event); + bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) override; protected: - virtual Glib::ustring _getTip(unsigned state) const; - virtual void dragged(Geom::Point &, GdkEventMotion *); - virtual bool grabbed(GdkEventMotion *); - virtual void ungrabbed(GdkEventButton *); - virtual bool clicked(GdkEventButton *); - virtual bool doubleclicked(GdkEventButton *); + Glib::ustring _getTip(unsigned state) const override; + void dragged(Geom::Point &, GdkEventMotion *) override; + bool grabbed(GdkEventMotion *) override; + void ungrabbed(GdkEventButton *) override; + bool clicked(GdkEventButton *) override; + bool doubleclicked(GdkEventButton *) override; private: double _t; diff --git a/src/ui/tool/manipulator.h b/src/ui/tool/manipulator.h index 66b47ce98..96861e660 100644 --- a/src/ui/tool/manipulator.h +++ b/src/ui/tool/manipulator.h @@ -145,7 +145,7 @@ public: } } - virtual bool event(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) { + bool event(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) override { for (typename MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) { if ((*i).second->event(event_context, event)) return true; } diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index 742c6d421..46f0d17ba 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -35,8 +35,8 @@ struct PathSharedData; class MultiPathManipulator : public PointManipulator { public: MultiPathManipulator(PathSharedData &data, sigc::connection &chg); - virtual ~MultiPathManipulator(); - virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *event); + ~MultiPathManipulator() override; + bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *event) override; bool empty() { return _mmap.empty(); } unsigned size() { return _mmap.size(); } diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index 231f57b7c..6a766125a 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -79,15 +79,15 @@ struct NodeSharedData { class Handle : public ControlPoint { public: - virtual ~Handle(); + ~Handle() override; inline Geom::Point relativePos() const; inline double length() const; bool isDegenerate() const { return _degenerate; } // True if the handle is retracted, i.e. has zero length. - virtual void setVisible(bool); - virtual void move(Geom::Point const &p); + void setVisible(bool) override; + void move(Geom::Point const &p) override; - virtual void setPosition(Geom::Point const &p); + void setPosition(Geom::Point const &p) override; inline void setRelativePos(Geom::Point const &p); void setLength(double len); void retract(); @@ -103,15 +103,15 @@ protected: Handle(NodeSharedData const &data, Geom::Point const &initial_pos, Node *parent); virtual void handle_2button_press(); - virtual bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event); - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event); - virtual bool grabbed(GdkEventMotion *event); - virtual void ungrabbed(GdkEventButton *event); - virtual bool clicked(GdkEventButton *event); + bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) override; + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override; + bool grabbed(GdkEventMotion *event) override; + void ungrabbed(GdkEventButton *event) override; + bool clicked(GdkEventButton *event) override; - virtual Glib::ustring _getTip(unsigned state) const; - virtual Glib::ustring _getDragTip(GdkEventMotion *event) const; - virtual bool _hasDragTips() const { return true; } + Glib::ustring _getTip(unsigned state) const override; + Glib::ustring _getDragTip(GdkEventMotion *event) const override; + bool _hasDragTips() const override { return true; } private: @@ -146,9 +146,9 @@ public: */ Node(NodeSharedData const &data, Geom::Point const &pos); - virtual void move(Geom::Point const &p); - virtual void transform(Geom::Affine const &m); - virtual Geom::Rect bounds() const; + void move(Geom::Point const &p) override; + void transform(Geom::Affine const &m) override; + Geom::Rect bounds() const override; NodeType type() const { return _type; } @@ -216,20 +216,20 @@ public: // temporarily public /** Customized event handler to catch scroll events needed for selection grow/shrink. */ - virtual bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event); + bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) override; Inkscape::SnapCandidatePoint snapCandidatePoint(); protected: - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event); - virtual bool grabbed(GdkEventMotion *event); - virtual bool clicked(GdkEventButton *event); + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override; + bool grabbed(GdkEventMotion *event) override; + bool clicked(GdkEventButton *event) override; - virtual void _setState(State state); - virtual Glib::ustring _getTip(unsigned state) const; - virtual Glib::ustring _getDragTip(GdkEventMotion *event) const; - virtual bool _hasDragTips() const { return true; } + void _setState(State state) override; + Glib::ustring _getTip(unsigned state) const override; + Glib::ustring _getDragTip(GdkEventMotion *event) const override; + bool _hasDragTips() const override { return true; } private: diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 192a02fe2..6582501cb 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -68,13 +68,13 @@ public: _node->addObserver(*this); } - ~PathManipulatorObserver() { + ~PathManipulatorObserver() override { _node->removeObserver(*this); Inkscape::GC::release(_node); } - virtual void notifyAttributeChanged(Inkscape::XML::Node &/*node*/, GQuark attr, - Util::ptr_shared, Util::ptr_shared) + void notifyAttributeChanged(Inkscape::XML::Node &/*node*/, GQuark attr, + Util::ptr_shared, Util::ptr_shared) override { // do nothing if blocked if (_blocked) return; diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 5fa24c23b..cf5142600 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -54,8 +54,8 @@ public: PathManipulator(MultiPathManipulator &mpm, SPPath *path, Geom::Affine const &edit_trans, guint32 outline_color, Glib::ustring lpe_key); - ~PathManipulator(); - virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *); + ~PathManipulator() override; + bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *) override; bool empty(); void writeXML(); diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h index c16f639b1..b3020b47f 100644 --- a/src/ui/tool/selectable-control-point.h +++ b/src/ui/tool/selectable-control-point.h @@ -22,7 +22,7 @@ class ControlPointSelection; class SelectableControlPoint : public ControlPoint { public: - ~SelectableControlPoint(); + ~SelectableControlPoint() override; bool selected() const; void updateState() { _setState(_state); } virtual Geom::Rect bounds() const { @@ -44,12 +44,12 @@ protected: ControlPointSelection &sel, ColorSet const &cset = _default_scp_color_set, SPCanvasGroup *group = 0); - virtual void _setState(State state); + void _setState(State state) override; - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event); - virtual bool grabbed(GdkEventMotion *event); - virtual void ungrabbed(GdkEventButton *event); - virtual bool clicked(GdkEventButton *event); + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override; + bool grabbed(GdkEventMotion *event) override; + void ungrabbed(GdkEventButton *event) override; + bool clicked(GdkEventButton *event) override; ControlPointSelection &_selection; diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index 84e96173d..3444de809 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -42,7 +42,7 @@ public: sp_canvas_item_hide(_rubber); } - ~SelectorPoint() { + ~SelectorPoint() override { sp_canvas_item_destroy(_rubber); } @@ -53,7 +53,7 @@ public: } protected: - virtual bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) { + bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) override { if (event->type == GDK_KEY_PRESS && shortcut_key(event->key) == GDK_KEY_Escape && sp_canvas_item_is_visible(_rubber)) { @@ -65,27 +65,27 @@ protected: } private: - virtual bool grabbed(GdkEventMotion *) { + bool grabbed(GdkEventMotion *) override { _cancel = false; _start = position(); sp_canvas_item_show(_rubber); return false; } - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *) { + void dragged(Geom::Point &new_pos, GdkEventMotion *) override { if (_cancel) return; Geom::Rect sel(_start, new_pos); _rubber->setRectangle(sel); } - virtual void ungrabbed(GdkEventButton *event) { + void ungrabbed(GdkEventButton *event) override { if (_cancel) return; sp_canvas_item_hide(_rubber); Geom::Rect sel(_start, position()); _selector->signal_area.emit(sel, event); } - virtual bool clicked(GdkEventButton *event) { + bool clicked(GdkEventButton *event) override { if (event->button != 1) return false; _selector->signal_point.emit(position(), event); return true; diff --git a/src/ui/tool/selector.h b/src/ui/tool/selector.h index bd8d3e1aa..450e318f6 100644 --- a/src/ui/tool/selector.h +++ b/src/ui/tool/selector.h @@ -27,8 +27,8 @@ class SelectorPoint; class Selector : public Manipulator { public: Selector(SPDesktop *d); - virtual ~Selector(); - virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *); + ~Selector() override; + bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *) override; virtual bool doubleClicked(); sigc::signal<void, Geom::Rect const &, GdkEventButton*> signal_area; diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 23cd6b79d..bb2e6c861 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -204,7 +204,7 @@ public: : TransformHandle(th, anchor, pb) {} protected: - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_control(state)) { if (state_held_shift(state)) { return C_("Transform handle tip", @@ -225,12 +225,12 @@ protected: return C_("Transform handle tip", "<b>Scale handle</b>: drag to scale the selection"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { return format_tip(C_("Transform handle tip", "Scale by %.2f%% x %.2f%%"), _last_scale_x * 100, _last_scale_y * 100); } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } static double _last_scale_x, _last_scale_y; }; @@ -249,13 +249,13 @@ public: {} protected: - virtual void startTransform() { + void startTransform() override { _sc_center = _th.rotationCenter(); _sc_opposite = _th.bounds().corner(_corner + 2); _last_scale_x = _last_scale_y = 1.0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) { + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _sc_center : _sc_opposite; Geom::Point vold = _origin - scc, vnew = new_pos - scc; // avoid exploding the selection @@ -300,7 +300,7 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return _last_transform.isUniformScale() ? COMMIT_MOUSE_SCALE_UNIFORM : COMMIT_MOUSE_SCALE; @@ -335,13 +335,13 @@ public: , _side(side) {} protected: - virtual void startTransform() { + void startTransform() override { _sc_center = _th.rotationCenter(); Geom::Rect b = _th.bounds(); _sc_opposite = Geom::middle_point(b.corner(_side + 2), b.corner(_side + 3)); _last_scale_x = _last_scale_y = 1.0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) { + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _sc_center : _sc_opposite; Geom::Point vs; Geom::Dim2 d1 = static_cast<Geom::Dim2>((_side + 1) % 2); @@ -386,7 +386,7 @@ protected: * Geom::Translate(scc); return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return _last_transform.isUniformScale() ? COMMIT_MOUSE_SCALE_UNIFORM : COMMIT_MOUSE_SCALE; @@ -415,13 +415,13 @@ public: {} protected: - virtual void startTransform() { + void startTransform() override { _rot_center = _th.rotationCenter(); _rot_opposite = _th.bounds().corner(_corner + 2); _last_angle = 0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point rotc = held_shift(*event) ? _rot_opposite : _rot_center; double angle = Geom::angle_between(_origin - rotc, new_pos - rotc); @@ -446,9 +446,9 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { return COMMIT_MOUSE_ROTATE; } + CommitEvent getCommitEvent() override { return COMMIT_MOUSE_ROTATE; } - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_shift(state)) { if (state_held_control(state)) { return format_tip(C_("Transform handle tip", @@ -465,12 +465,12 @@ protected: "the selection around the rotation center"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { return format_tip(C_("Transform handle tip", "Rotate by %.2f°"), _last_angle * 180.0 / M_PI); } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } private: static Glib::RefPtr<Gdk::Pixbuf> _corner_to_pixbuf(unsigned c) { @@ -498,7 +498,7 @@ public: protected: - virtual void startTransform() { + void startTransform() override { _skew_center = _th.rotationCenter(); Geom::Rect b = _th.bounds(); _skew_opposite = Geom::middle_point(b.corner(_side + 2), b.corner(_side + 3)); @@ -506,7 +506,7 @@ protected: _last_horizontal = _side % 2; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _skew_center : _skew_opposite; Geom::Dim2 d1 = static_cast<Geom::Dim2>((_side + 1) % 2); @@ -581,13 +581,13 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return (_side % 2) ? COMMIT_MOUSE_SKEW_Y : COMMIT_MOUSE_SKEW_X; } - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_shift(state)) { if (state_held_control(state)) { return format_tip(C_("Transform handle tip", @@ -605,7 +605,7 @@ protected: "the opposite handle"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { if (_last_horizontal) { return format_tip(C_("Transform handle tip", "Skew horizontally by %.2f°"), _last_angle * 360.0); @@ -615,7 +615,7 @@ protected: } } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } private: @@ -650,7 +650,7 @@ public: } protected: - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event) { + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override { SnapManager &sm = _th._desktop->namedview->snap_manager; sm.setup(_th._desktop); bool snap = !held_shift(*event) && sm.someSnapperMightSnap(); @@ -667,7 +667,7 @@ protected: } sm.unSetup(); } - virtual Glib::ustring _getTip(unsigned /*state*/) const { + Glib::ustring _getTip(unsigned /*state*/) const override { return C_("Transform handle tip", "<b>Rotation center</b>: drag to change the origin of transforms"); } diff --git a/src/ui/tool/transform-handle-set.h b/src/ui/tool/transform-handle-set.h index 54f81adf5..023e4f855 100644 --- a/src/ui/tool/transform-handle-set.h +++ b/src/ui/tool/transform-handle-set.h @@ -39,8 +39,8 @@ public: }; TransformHandleSet(SPDesktop *d, SPCanvasGroup *th_group); - virtual ~TransformHandleSet(); - virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *); + ~TransformHandleSet() override; + bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *) override; bool visible() const { return _visible; } Mode mode() const { return _mode; } @@ -117,9 +117,9 @@ protected: std::vector<Inkscape::SnapCandidatePoint>::iterator _all_snap_sources_iter; private: - virtual bool grabbed(GdkEventMotion *); - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event); - virtual void ungrabbed(GdkEventButton *); + bool grabbed(GdkEventMotion *) override; + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override; + void ungrabbed(GdkEventButton *) override; static ColorSet thandle_cset; }; |
