From: Jon A. Cruz Date: Fri, 15 Jan 2010 01:02:46 +0000 (-0800) Subject: Warning cleanup. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=24cd4c083c480d02226e8120b6211fea650a0004;p=inkscape.git Warning cleanup. --- diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 43f4b5725..1ea9ac506 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,7 +195,7 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) } void -PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) +PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) { using namespace Inkscape::UI; @@ -222,7 +222,7 @@ PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) void PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) -{ +{ // TODO this method should not exist at all! } diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 11685e25c..6396569e9 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -757,7 +757,12 @@ void Inkscape::ObjectSnapper::_getBorderNodes(std::vector *p points->push_back(Inkscape::SnapCandidatePoint(Geom::Point(w,0), SNAPSOURCE_UNDEFINED, SNAPTARGET_PAGE_CORNER)); } -void Inkscape::getBBoxPoints(Geom::OptRect const bbox, std::vector *points, bool const isTarget, bool const includeCorners, bool const includeLineMidpoints, bool const includeObjectMidpoints) +void Inkscape::getBBoxPoints(Geom::OptRect const bbox, + std::vector *points, + bool const /*isTarget*/, + bool const includeCorners, + bool const includeLineMidpoints, + bool const includeObjectMidpoints) { if (bbox) { // collect the corners of the bounding box diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index d4978af3b..dfe47bee8 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1751,7 +1751,7 @@ void sp_selection_next_patheffect_param(SPDesktop * dt) return false; }*/ -void sp_selection_edit_clip_or_mask(SPDesktop * dt, bool clip) +void sp_selection_edit_clip_or_mask(SPDesktop * /*dt*/, bool /*clip*/) { return; /*if (!dt) return; diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index fa4360137..7002c9723 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -128,7 +128,7 @@ GList *ShapeEditor::save_nodepath_selection () { return NULL; } -void ShapeEditor::restore_nodepath_selection (GList *saved) { +void ShapeEditor::restore_nodepath_selection (GList */*saved*/) { // defunct stub } diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 40bfc041e..dc5618eef 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -422,7 +422,7 @@ double get_move_standard_deviation(SPSprayContext *tc) * @param[in] choice : */ -void random_position( double &radius, double &angle, double &a, double &s, int choice) +void random_position( double &radius, double &angle, double &a, double &s, int /*choice*/) { // angle is taken from an uniform distribution angle = g_random_double_range(0, M_PI*2.0); diff --git a/src/text-context.cpp b/src/text-context.cpp index fc28dc8e4..4f89bd1e1 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -1597,7 +1597,7 @@ sp_text_context_update_cursor(SPTextContext *tc, bool scroll_to_see) Inkscape::Text::Layout const *layout = te_get_layout(tc->text); int const nChars = layout->iteratorToCharIndex(layout->end()); - char *trunc = ""; + char const *trunc = ""; bool truncated = false; if (layout->inputTruncated()) { truncated = true; 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 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); /// @} - 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", "Ctrl: 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", "%s: 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", "Scale handle: 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", "Rotation handle: 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 _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: "Skew handle: 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 _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", "Rotation center: drag to change the origin of transforms"); } + private: + static Glib::RefPtr _get_pixbuf() { sp_select_context_get_type(); return Glib::wrap(handles[12], true); } + TransformHandleSet &_th; }; diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index e4a585fb3..e37e1f828 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1135,13 +1135,13 @@ void sp_node_path_edit_nextLPEparam (GtkAction */*act*/, gpointer data) { sp_selection_next_patheffect_param( reinterpret_cast(data) ); } -void toggle_edit_clip (GtkToggleAction *act, gpointer data) { +void toggle_edit_clip (GtkToggleAction *act, gpointer /*data*/) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool edit = gtk_toggle_action_get_active( act ); prefs->setBool("/tools/nodes/edit_clipping_paths", edit); } -void toggle_edit_mask (GtkToggleAction *act, gpointer data) { +void toggle_edit_mask (GtkToggleAction *act, gpointer /*data*/) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool edit = gtk_toggle_action_get_active( act ); prefs->setBool("/tools/nodes/edit_masks", edit);