summaryrefslogtreecommitdiffstats
path: root/src/ui/tool
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-01-15 01:02:46 +0000
committerJon A. Cruz <jon@joncruz.org>2010-01-15 01:02:46 +0000
commit2ab01d69f9d427bdf3536e1508a465372cd040c6 (patch)
tree492bccf7855315612ecd295d84c34688c232db79 /src/ui/tool
parentReplace std::tr1::unordered_(map|set) with __gnu_cxx::hash_(map|set), (diff)
downloadinkscape-2ab01d69f9d427bdf3536e1508a465372cd040c6.tar.gz
inkscape-2ab01d69f9d427bdf3536e1508a465372cd040c6.zip
Warning cleanup.
(bzr r8981)
Diffstat (limited to 'src/ui/tool')
-rw-r--r--src/ui/tool/control-point-selection.cpp2
-rw-r--r--src/ui/tool/control-point.cpp2
-rw-r--r--src/ui/tool/control-point.h4
-rw-r--r--src/ui/tool/curve-drag-point.cpp8
-rw-r--r--src/ui/tool/node-tool.cpp14
-rw-r--r--src/ui/tool/node.cpp16
-rw-r--r--src/ui/tool/transform-handle-set.cpp31
7 files changed, 50 insertions, 27 deletions
diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp
index 245feae1d..2a3498d7f 100644
--- a/src/ui/tool/control-point-selection.cpp
+++ b/src/ui/tool/control-point-selection.cpp
@@ -318,7 +318,7 @@ void ControlPointSelection::_pointGrabbed()
}
void ControlPointSelection::_pointDragged(Geom::Point const &old_pos, Geom::Point &new_pos,
- GdkEventMotion *event)
+ GdkEventMotion */*event*/)
{
Geom::Point delta = new_pos - old_pos;
for (iterator i = _points.begin(); i != _points.end(); ++i) {
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp
index 73dd0d19e..941924e0a 100644
--- a/src/ui/tool/control-point.cpp
+++ b/src/ui/tool/control-point.cpp
@@ -355,7 +355,7 @@ void ControlPoint::_setPixbuf(Glib::RefPtr<Gdk::Pixbuf> p)
}
// re-routes events into the virtual function
-int ControlPoint::_event_handler(SPCanvasItem *item, GdkEvent *event, ControlPoint *point)
+int ControlPoint::_event_handler(SPCanvasItem */*item*/, GdkEvent *event, ControlPoint *point)
{
return point->_eventHandler(event) ? TRUE : FALSE;
}
diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h
index 4997c5ef4..e59d6d5cf 100644
--- a/src/ui/tool/control-point.h
+++ b/src/ui/tool/control-point.h
@@ -115,8 +115,8 @@ protected:
void _setPixbuf(Glib::RefPtr<Gdk::Pixbuf>);
/// @}
- virtual Glib::ustring _getTip(unsigned state) { return ""; }
- virtual Glib::ustring _getDragTip(GdkEventMotion *event) { return ""; }
+ virtual Glib::ustring _getTip(unsigned /*state*/) { return ""; }
+ virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) { return ""; }
virtual bool _hasDragTips() { return false; }
SPDesktop *const _desktop; ///< The desktop this control point resides on.
diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp
index 182362259..dbd19c754 100644
--- a/src/ui/tool/curve-drag-point.cpp
+++ b/src/ui/tool/curve-drag-point.cpp
@@ -58,19 +58,19 @@ CurveDragPoint::CurveDragPoint(PathManipulator &pm)
sigc::mem_fun(*this, &CurveDragPoint::_doubleclickedHandler));
}
-void CurveDragPoint::_grabbedHandler(GdkEventMotion *event)
+void CurveDragPoint::_grabbedHandler(GdkEventMotion */*event*/)
{
_pm._selection.hideTransformHandles();
NodeList::iterator second = first.next();
// move the handles to 1/3 the length of the segment for line segments
if (first->front()->isDegenerate() && second->back()->isDegenerate()) {
-
+
// delta is a vector equal 1/3 of distance from first to second
Geom::Point delta = (second->position() - first->position()) / 3.0;
first->front()->move(first->front()->position() + delta);
second->back()->move(second->back()->position() - delta);
-
+
signal_update.emit();
}
}
@@ -146,7 +146,7 @@ bool CurveDragPoint::_doubleclickedHandler(GdkEventButton *event)
NodeList::iterator inserted = _pm.subdivideSegment(first, _t);
_pm._selection.clear();
_pm._selection.insert(inserted.ptr());
-
+
signal_update.emit();
_pm._commit(_("Add node"));
return true;
diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp
index 1e98f0859..092ce7d87 100644
--- a/src/ui/tool/node-tool.cpp
+++ b/src/ui/tool/node-tool.cpp
@@ -558,7 +558,7 @@ void ink_node_tool_select_area(InkNodeTool *nt, Geom::Rect const &sel, GdkEventB
nt->_selected_nodes->selectArea(sel);
}
}
-void ink_node_tool_select_point(InkNodeTool *nt, Geom::Point const &sel, GdkEventButton *event)
+void ink_node_tool_select_point(InkNodeTool *nt, Geom::Point const &/*sel*/, GdkEventButton *event)
{
using namespace Inkscape::UI; // pull in event helpers
if (!event) return;
@@ -574,14 +574,14 @@ void ink_node_tool_select_point(InkNodeTool *nt, Geom::Point const &sel, GdkEven
if (!(event->state & GDK_SHIFT_MASK)) {
selection->clear();
}
- return;
- }
- if (held_shift(*event)) {
- selection->toggle(item_clicked);
} else {
- selection->set(item_clicked);
+ if (held_shift(*event)) {
+ selection->toggle(item_clicked);
+ } else {
+ selection->set(item_clicked);
+ }
+ nt->desktop->updateNow();
}
- nt->desktop->updateNow();
}
void ink_node_tool_mouseover_changed(InkNodeTool *nt, Inkscape::UI::ControlPoint *p)
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index 303c0fb75..c1dfcdeaa 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -33,7 +33,7 @@
#include "ui/tool/path-manipulator.h"
namespace Inkscape {
-namespace UI {
+namespace UI {
static SelectableControlPoint::ColorSet node_colors = {
{
@@ -261,7 +261,7 @@ void Handle::_ungrabbedHandler()
// hide the handle if it's less than dragtolerance away from the node
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int drag_tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
-
+
Geom::Point dist = _desktop->d2w(_parent->position()) - _desktop->d2w(position());
if (dist.length() <= drag_tolerance) {
move(_parent->position());
@@ -303,7 +303,7 @@ Glib::ustring Handle::_getTip(unsigned state)
}
}
-Glib::ustring Handle::_getDragTip(GdkEventMotion *event)
+Glib::ustring Handle::_getDragTip(GdkEventMotion */*event*/)
{
Geom::Point dist = position() - _last_drag_origin();
// report angle in mathematical convention
@@ -396,14 +396,14 @@ void Node::_fixNeighbors(Geom::Point const &old_pos, Geom::Point const &new_pos)
{
/* This method restores handle invariants for neighboring nodes,
* and invariants that are based on positions of those nodes for this one. */
-
+
/* Fix auto handles */
if (_type == NODE_AUTO) _updateAutoHandles();
if (old_pos != new_pos) {
if (_next() && _next()->_type == NODE_AUTO) _next()->_updateAutoHandles();
if (_prev() && _prev()->_type == NODE_AUTO) _prev()->_updateAutoHandles();
}
-
+
/* Fix smooth handles at the ends of linear segments.
* Rotate the appropriate handle to be colinear with the segment.
* If there is a smooth node at the other end of the segment, rotate it too. */
@@ -538,7 +538,7 @@ void Node::setType(NodeType type, bool update_handles)
double len_next = vec_next.length(), len_prev = vec_prev.length();
double len = (len_next + len_prev) / 6; // take 1/3 of average
if (len == 0) return;
-
+
Geom::Point dir = Geom::unit_vector((len_prev / len_next) * vec_next - vec_prev);
_back.setRelativePos(-dir * len);
_front.setRelativePos(dir * len);
@@ -960,14 +960,14 @@ Glib::ustring Node::_getTip(unsigned state)
return C_("Path node tip",
"<b>Ctrl:</b> move along axes, click to change node type");
}
-
+
// assemble tip from node name
char const *nodetype = node_type_to_localized_string(_type);
return format_tip(C_("Path node tip",
"<b>%s:</b> drag to shape the path, click to select this node"), nodetype);
}
-Glib::ustring Node::_getDragTip(GdkEventMotion *event)
+Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/)
{
Geom::Point dist = position() - _last_drag_origin();
GString *x = SP_PX_TO_METRIC_STRING(dist[Geom::X], _desktop->namedview->getDefaultMetric());
diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp
index cf8907299..f9086950d 100644
--- a/src/ui/tool/transform-handle-set.cpp
+++ b/src/ui/tool/transform-handle-set.cpp
@@ -160,10 +160,12 @@ protected:
}
return C_("Transform handle tip", "<b>Scale handle:</b> drag to scale the selection");
}
- virtual Glib::ustring _getDragTip(GdkEventMotion *event) {
+
+ virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) {
return format_tip(C_("Transform handle tip",
"Scale by %.2f%% x %.2f%%"), _last_scale_x * 100, _last_scale_y * 100);
}
+
virtual bool _hasDragTips() { return true; }
static double _last_scale_x, _last_scale_y;
@@ -289,11 +291,13 @@ public:
, _corner(corner)
{}
protected:
+
virtual void startTransform() {
_rot_center = _th.rotationCenter();
_rot_opposite = _th.bounds().corner(_corner + 2);
_last_angle = 0;
}
+
virtual Geom::Matrix computeTransform(Geom::Point const &new_pos, GdkEventMotion *event)
{
Geom::Point rotc = held_shift(*event) ? _rot_opposite : _rot_center;
@@ -307,7 +311,9 @@ protected:
* Geom::Translate(rotc);
return t;
}
+
virtual CommitEvent getCommitEvent() { return COMMIT_MOUSE_ROTATE; }
+
virtual Glib::ustring _getTip(unsigned state) {
if (state_held_shift(state)) {
if (state_held_control(state)) {
@@ -324,11 +330,14 @@ protected:
return C_("Transform handle tip", "<b>Rotation handle:</b> drag to rotate "
"the selection around the rotation center");
}
- virtual Glib::ustring _getDragTip(GdkEventMotion *event) {
+
+ virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) {
return format_tip(C_("Transform handle tip", "Rotate by %.2f°"),
_last_angle * 360.0);
}
+
virtual bool _hasDragTips() { return true; }
+
private:
static Glib::RefPtr<Gdk::Pixbuf> _corner_to_pixbuf(unsigned c) {
sp_select_context_get_type();
@@ -352,7 +361,9 @@ public:
: TransformHandle(th, side_to_anchor(side), _side_to_pixbuf(side))
, _side(side)
{}
+
protected:
+
virtual void startTransform() {
_skew_center = _th.rotationCenter();
Geom::Rect b = _th.bounds();
@@ -360,6 +371,7 @@ protected:
_last_angle = 0;
_last_horizontal = _side % 2;
}
+
virtual Geom::Matrix computeTransform(Geom::Point const &new_pos, GdkEventMotion *event)
{
Geom::Point scc = held_shift(*event) ? _skew_center : _skew_opposite;
@@ -403,11 +415,13 @@ protected:
* Geom::Translate(scc);
return t;
}
+
virtual CommitEvent getCommitEvent() {
return _side % 2
? COMMIT_MOUSE_SKEW_Y
: COMMIT_MOUSE_SKEW_X;
}
+
virtual Glib::ustring _getTip(unsigned state) {
if (state_held_shift(state)) {
if (state_held_control(state)) {
@@ -425,7 +439,8 @@ protected:
"<b>Skew handle:</b> drag to skew (shear) selection about "
"the opposite handle");
}
- virtual Glib::ustring _getDragTip(GdkEventMotion *event) {
+
+ virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) {
if (_last_horizontal) {
return format_tip(C_("Transform handle tip", "Skew horizontally by %.2f°"),
_last_angle * 360.0);
@@ -434,8 +449,11 @@ protected:
_last_angle * 360.0);
}
}
+
virtual bool _hasDragTips() { return true; }
+
private:
+
static Glib::RefPtr<Gdk::Pixbuf> _side_to_pixbuf(unsigned s) {
sp_select_context_get_type();
switch (s % 4) {
@@ -463,16 +481,21 @@ public:
{
setVisible(false);
}
+
protected:
- virtual Glib::ustring _getTip(unsigned state) {
+
+ virtual Glib::ustring _getTip(unsigned /*state*/) {
return C_("Transform handle tip",
"<b>Rotation center:</b> drag to change the origin of transforms");
}
+
private:
+
static Glib::RefPtr<Gdk::Pixbuf> _get_pixbuf() {
sp_select_context_get_type();
return Glib::wrap(handles[12], true);
}
+
TransformHandleSet &_th;
};