From: joncruz Date: Sun, 4 Nov 2007 07:22:23 +0000 (+0000) Subject: Warning cleanup X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e7333a0a54c8d33b7397406dd76938aa430836d5;p=inkscape.git Warning cleanup --- diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 53c272566..7556d2e8f 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -124,10 +124,10 @@ sp_document_done (SPDocument *doc, const unsigned int event_type, Glib::ustring } void -sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop *desktop, GtkObject *base) +sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base) { - SPDocument *doc = (SPDocument *) base; - doc->actionkey = NULL; + SPDocument *doc = (SPDocument *) base; + doc->actionkey = NULL; } namespace { @@ -146,7 +146,7 @@ public: CommitEvent(SPDocument *doc, const gchar *key, const unsigned int type) : InteractionEvent(share_static_string("commit")) { - _addProperty(share_static_string("timestamp"), timestamp()); + _addProperty(share_static_string("timestamp"), timestamp()); gchar *serial = g_strdup_printf("%lu", doc->serial()); _addProperty(share_static_string("document"), serial); g_free(serial); diff --git a/src/dom/views.h b/src/dom/views.h index 0b89b7555..078061318 100644 --- a/src/dom/views.h +++ b/src/dom/views.h @@ -109,7 +109,7 @@ public: /** * */ - Match(const Match &other) + Match(const Match &/*other*/) { } @@ -727,9 +727,9 @@ public: /** * */ - virtual MatchString createMatchString(unsigned short test, - const DOMString &name, - const DOMString &value) + virtual MatchString createMatchString(unsigned short /*test*/, + const DOMString &/*name*/, + const DOMString &/*value*/) { MatchString ret; return ret; @@ -738,9 +738,9 @@ public: /** * */ - virtual MatchInteger createMatchInteger(unsigned short test, - const DOMString &name, - long value) + virtual MatchInteger createMatchInteger(unsigned short /*test*/, + const DOMString &/*name*/, + long /*value*/) { MatchInteger ret; return ret; @@ -749,9 +749,9 @@ public: /** * */ - virtual MatchBoolean createMatchBoolean(unsigned short test, - const DOMString &name, - bool value) + virtual MatchBoolean createMatchBoolean(unsigned short /*test*/, + const DOMString &/*name*/, + bool /*value*/) { MatchBoolean ret; return ret; @@ -760,10 +760,10 @@ public: /** * */ - virtual MatchContent createMatchContent(unsigned short test, - const DOMString &name, - unsigned long offset, - const NodePtr nodeArg) + virtual MatchContent createMatchContent(unsigned short /*test*/, + const DOMString &/*name*/, + unsigned long /*offset*/, + const NodePtr /*nodeArg*/) { MatchContent ret; return ret; @@ -772,7 +772,7 @@ public: /** * */ - virtual MatchSet createMatchSet(unsigned short test) + virtual MatchSet createMatchSet(unsigned short /*test*/) { MatchSet ret; return ret; @@ -781,7 +781,7 @@ public: /** * */ - virtual StringItem createStringItem(const DOMString &name) + virtual StringItem createStringItem(const DOMString &/*name*/) { StringItem ret; return ret; @@ -790,7 +790,7 @@ public: /** * */ - virtual IntegerItem createIntegerItem(const DOMString &name) + virtual IntegerItem createIntegerItem(const DOMString &/*name*/) { IntegerItem ret; return ret; @@ -799,7 +799,7 @@ public: /** * */ - virtual BooleanItem createBooleanItem(const DOMString &name) + virtual BooleanItem createBooleanItem(const DOMString &/*name*/) { BooleanItem ret; return ret; @@ -808,7 +808,7 @@ public: /** * */ - virtual ContentItem createContentItem(const DOMString &name) + virtual ContentItem createContentItem(const DOMString &/*name*/) { ContentItem ret; return ret; @@ -902,10 +902,10 @@ public: /** * */ - virtual void select(const NodePtr boundary, - unsigned long offset, - bool extend, - bool add) + virtual void select(const NodePtr /*boundary*/, + unsigned long /*offset*/, + bool /*extend*/, + bool /*add*/) { } @@ -921,7 +921,7 @@ public: /** * */ - virtual bool matchFirstSegment(Segment &todo) //inout parm, not const + virtual bool matchFirstSegment(Segment &/*todo*/) //inout parm, not const throw(dom::DOMException) { return false; @@ -930,7 +930,7 @@ public: /** * */ - virtual long getIntegerProperty(const DOMString &name) + virtual long getIntegerProperty(const DOMString &/*name*/) throw(dom::DOMException) { long val=0; @@ -940,7 +940,7 @@ public: /** * */ - virtual DOMString getStringProperty(const DOMString &name) + virtual DOMString getStringProperty(const DOMString &/*name*/) throw(dom::DOMException) { DOMString val; @@ -950,7 +950,7 @@ public: /** * */ - virtual bool getBooleanProperty(bool name) + virtual bool getBooleanProperty(bool /*name*/) throw(dom::DOMException) { bool val=false; @@ -960,7 +960,7 @@ public: /** * */ - virtual NodePtr getContentPropertyNode(const DOMString &name) + virtual NodePtr getContentPropertyNode(const DOMString &/*name*/) throw(dom::DOMException) { NodePtr val = NULL; @@ -970,7 +970,7 @@ public: /** * */ - virtual unsigned long getContentPropertyOffset(const DOMString &name) + virtual unsigned long getContentPropertyOffset(const DOMString &/*name*/) throw(dom::DOMException) { long val=0; @@ -989,7 +989,7 @@ public: /** * */ - View(const View &other) + View(const View &/*other*/) { } @@ -1024,7 +1024,7 @@ public: /** * */ - VisualResource(const VisualResource &other) + VisualResource(const VisualResource &/*other*/) { } @@ -1890,17 +1890,17 @@ public: /** * */ - virtual void select(const NodePtr boundary, - unsigned long offset, - bool extend, - bool add) + virtual void select(const NodePtr /*boundary*/, + unsigned long /*offset*/, + bool /*extend*/, + bool /*add*/) { } /** * */ - virtual void matchSegment(const VisualResource *segment) + virtual void matchSegment(const VisualResource */*segment*/) { } diff --git a/src/file.cpp b/src/file.cpp index 8cffa6b7a..346f17891 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -384,7 +384,7 @@ sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d open_path = attr; - //# Test if the open_path directory exists + //# Test if the open_path directory exists if (!Inkscape::IO::file_test(open_path.c_str(), (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) open_path = ""; @@ -480,7 +480,7 @@ sp_file_vacuum() unsigned int diff = vacuum_document (doc); - sp_document_done(doc, SP_VERB_FILE_VACUUM, + sp_document_done(doc, SP_VERB_FILE_VACUUM, _("Vacuum <defs>")); SPDesktop *dt = SP_ACTIVE_DESKTOP; @@ -517,7 +517,7 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri, try { Inkscape::Extension::save(key, doc, uri.c_str(), false, - saveas, official); + saveas, official); } catch (Inkscape::Extension::Output::no_extension_found &e) { gchar *safeUri = Inkscape::IO::sanitizeString(uri.c_str()); gchar *text = g_strdup_printf(_("No Inkscape extension found to save document (%s). This may have been caused by an unknown filename extension."), safeUri); @@ -547,7 +547,7 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri, */ bool file_save_remote(SPDocument */*doc*/, const Glib::ustring &uri, - Inkscape::Extension::Extension */*key*/, bool /*saveas*/, bool official) + Inkscape::Extension::Extension */*key*/, bool /*saveas*/, bool /*official*/) { #ifdef WITH_GNOME_VFS @@ -562,7 +562,7 @@ file_save_remote(SPDocument */*doc*/, const Glib::ustring &uri, guint8 buffer[8192]; gchar* uri_local = g_filename_from_utf8( uri.c_str(), -1, NULL, NULL, NULL); - + if ( uri_local == NULL ) { g_warning( "Error converting filename to locale encoding."); } @@ -574,22 +574,22 @@ file_save_remote(SPDocument */*doc*/, const Glib::ustring &uri, // Open the temp file to send. result = gnome_vfs_open (&from_handle, fileName.c_str(), GNOME_VFS_OPEN_READ); - + if (result != GNOME_VFS_OK) { g_warning("Could not find the temp saving."); return false; } - + result = gnome_vfs_create (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE, FALSE, GNOME_VFS_PERM_USER_ALL); result = gnome_vfs_open (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE); - + if (result != GNOME_VFS_OK) { g_warning("file creating: %s", gnome_vfs_result_to_string(result)); return false; } while (1) { - + result = gnome_vfs_read (from_handle, buffer, 8192, &bytes_read); if ((result == GNOME_VFS_ERROR_EOF) &&(!bytes_read)){ @@ -597,7 +597,7 @@ file_save_remote(SPDocument */*doc*/, const Glib::ustring &uri, result = gnome_vfs_close (to_handle); return true; } - + if (result != GNOME_VFS_OK) { g_warning("%s", gnome_vfs_result_to_string(result)); return false; @@ -607,12 +607,12 @@ file_save_remote(SPDocument */*doc*/, const Glib::ustring &uri, g_warning("%s", gnome_vfs_result_to_string(result)); return false; } - - + + if (bytes_read != bytes_written){ return false; } - + } return true; #else @@ -691,7 +691,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) // Inkscape::IO? Glib::ustring save_loc_local = Glib::filename_from_utf8(save_loc); - if ( save_loc_local.size() > 0) + if ( save_loc_local.size() > 0) save_loc = save_loc_local; //# Show the SaveAs dialog @@ -703,7 +703,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) } Inkscape::UI::Dialog::FileSaveDialog *saveDialog = Inkscape::UI::Dialog::FileSaveDialog::create( - parentWindow, + parentWindow, save_loc, Inkscape::UI::Dialog::SVG_TYPES, (char const *) _("Select file to save to"), @@ -713,7 +713,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) saveDialog->change_title(dialog_title); saveDialog->setSelectionType(extension); - // allow easy access to the user's own templates folder + // allow easy access to the user's own templates folder gchar *templates = profile_path ("templates"); if (Inkscape::IO::file_test(templates, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { dynamic_cast(saveDialog)->add_shortcut_folder(templates); @@ -730,7 +730,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) Inkscape::Extension::Extension *selectionType = saveDialog->getSelectionType(); delete saveDialog; - + saveDialog = 0; if (fileName.size() > 0) { @@ -998,7 +998,7 @@ sp_file_import(Gtk::Window &parentWindow) if (fileName.size() > 0) { - + Glib::ustring newFileName = Glib::filename_to_utf8(fileName); if ( newFileName.size() > 0) @@ -1040,8 +1040,8 @@ sp_file_export_dialog(void *widget) //# temp hack for 'doc' until we can switch to this dialog SPDocument *doc = SP_ACTIVE_DOCUMENT; - Glib::ustring export_path; - Glib::ustring export_loc; + Glib::ustring export_path; + Glib::ustring export_loc; Inkscape::XML::Node *repr = sp_document_repr_root(doc); @@ -1093,7 +1093,7 @@ sp_file_export_dialog(void *widget) // is this needed any more, now that everything is handled in // Inkscape::IO? Glib::ustring export_path_local = Glib::filename_from_utf8(export_path); - if ( export_path_local.size() > 0) + if ( export_path_local.size() > 0) export_path = export_path_local; //# Show the SaveAs dialog @@ -1163,23 +1163,23 @@ sp_file_export_dialog(void */*widget*/) bool sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) { - + if (!SP_ACTIVE_DOCUMENT) return false; SPDocument *doc = SP_ACTIVE_DOCUMENT; - Glib::ustring export_path; - Glib::ustring export_loc; + Glib::ustring export_path; + Glib::ustring export_loc; Glib::ustring fileName; Inkscape::Extension::Extension *selectionType; bool success = false; - + static Inkscape::UI::Dialog::FileExportToOCALDialog *exportDialogInstance = NULL; static Inkscape::UI::Dialog::FileExportToOCALPasswordDialog *exportPasswordDialogInstance = NULL; static bool gotSuccess = false; - + Inkscape::XML::Node *repr = sp_document_repr_root(doc); // Verify whether the document is saved, so save this as temporary @@ -1190,24 +1190,24 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) // Get the default extension name Glib::ustring default_extension = "org.inkscape.output.svg.inkscape"; char formatBuf[256]; - + Glib::ustring filename_extension = ".svg"; selectionType = Inkscape::Extension::db.get(default_extension.c_str()); - + export_path = Glib::get_tmp_dir (); - + export_loc = export_path; export_loc.append(G_DIR_SEPARATOR_S); snprintf(formatBuf, 255, _("drawing%s"), filename_extension.c_str()); export_loc.append(formatBuf); - + // convert save_loc from utf-8 to locale // is this needed any more, now that everything is handled in // Inkscape::IO? Glib::ustring export_path_local = Glib::filename_from_utf8(export_path); - if ( export_path_local.size() > 0) + if ( export_path_local.size() > 0) export_path = export_path_local; - + // Show the Export To OCAL dialog if (!exportDialogInstance) exportDialogInstance = new Inkscape::UI::Dialog::FileExportToOCALDialog( @@ -1215,17 +1215,17 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) Inkscape::UI::Dialog::EXPORT_TYPES, (char const *) _("Select file to export to") ); - + success = exportDialogInstance->show(); if (!success) return success; - + fileName = exportDialogInstance->getFilename(); - fileName.append(filename_extension.c_str()); + fileName.append(filename_extension.c_str()); if (fileName.size() > 0) { Glib::ustring newFileName = Glib::filename_to_utf8(fileName); - + if ( newFileName.size()>0 ) fileName = newFileName; else @@ -1234,9 +1234,9 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) Glib::ustring filePath = export_path; filePath.append(G_DIR_SEPARATOR_S); filePath.append(Glib::path_get_basename(fileName)); - - fileName = filePath; - + + fileName = filePath; + success = file_save(parentWindow, doc, filePath, selectionType, FALSE, FALSE); if (!success){ @@ -1245,9 +1245,9 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) return success; } - + // Start now the submition - + // Create the uri Glib::ustring uri = "dav://"; char *username = (char *)prefs_get_string_attribute("options.ocalusername", "str"); @@ -1295,12 +1295,12 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) void sp_file_export_to_ocal(Gtk::Window &parentWindow) { - + // Try to execute the new code and return; if (!SP_ACTIVE_DOCUMENT) return; bool success = sp_file_export_to_ocal_dialog(parentWindow); - if (success) + if (success) SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::IMMEDIATE_MESSAGE, _("Document exported...")); } diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index ff15e8b8e..2da6d6ef4 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -82,16 +82,16 @@ const gchar *gr_knot_descr [] = { }; static void -gr_drag_sel_changed(Inkscape::Selection *selection, gpointer data) +gr_drag_sel_changed(Inkscape::Selection */*selection*/, gpointer data) { - GrDrag *drag = (GrDrag *) data; - drag->updateDraggers (); - drag->updateLines (); - drag->updateLevels (); + GrDrag *drag = (GrDrag *) data; + drag->updateDraggers (); + drag->updateLines (); + drag->updateLevels (); } static void -gr_drag_sel_modified (Inkscape::Selection *selection, guint flags, gpointer data) +gr_drag_sel_modified (Inkscape::Selection */*selection*/, guint flags, gpointer data) { GrDrag *drag = (GrDrag *) data; if (drag->local_change) { @@ -372,14 +372,14 @@ GrDrag::addStopNearPoint (SPItem *item, NR::Point mouse_p, double tolerance) updateDraggers(); return newstop; - } + } return NULL; } -bool -GrDrag::dropColor(SPItem *item, gchar *c, NR::Point p) +bool +GrDrag::dropColor(SPItem */*item*/, gchar *c, NR::Point p) { // first, see if we can drop onto one of the existing draggers for (GList *i = draggers; i != NULL; i = i->next) { // for all draggables of dragger @@ -766,14 +766,14 @@ gr_midpoint_limits(GrDragger *dragger, SPObject *server, NR::Point *begin, NR::P } else { d_temp = drag->getDraggerFor (draggable->item, POINT_LG_MID, lowest_i - 1, draggable->fill_or_stroke); } - if (d_temp) + if (d_temp) *begin = d_temp->point; d_temp = drag->getDraggerFor (draggable->item, POINT_LG_MID, highest_i + 1, draggable->fill_or_stroke); if (d_temp == NULL) { d_temp = drag->getDraggerFor (draggable->item, POINT_LG_END, num-1, draggable->fill_or_stroke); } - if (d_temp) + if (d_temp) *end = d_temp->point; } else if ( SP_IS_RADIALGRADIENT(server) ) { guint num = SP_RADIALGRADIENT(server)->vector.stops.size(); @@ -783,14 +783,14 @@ gr_midpoint_limits(GrDragger *dragger, SPObject *server, NR::Point *begin, NR::P } else { d_temp = drag->getDraggerFor (draggable->item, draggable->point_type, lowest_i - 1, draggable->fill_or_stroke); } - if (d_temp) + if (d_temp) *begin = d_temp->point; d_temp = drag->getDraggerFor (draggable->item, draggable->point_type, highest_i + 1, draggable->fill_or_stroke); if (d_temp == NULL) { d_temp = drag->getDraggerFor (draggable->item, (draggable->point_type==POINT_RG_MID1) ? POINT_RG_R1 : POINT_RG_R2, num-1, draggable->fill_or_stroke); } - if (d_temp) + if (d_temp) *end = d_temp->point; } @@ -804,7 +804,7 @@ gr_midpoint_limits(GrDragger *dragger, SPObject *server, NR::Point *begin, NR::P Called when a midpoint knot is dragged. */ static void -gr_knot_moved_midpoint_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpointer data) +gr_knot_moved_midpoint_handler(SPKnot */*knot*/, NR::Point const *ppointer, guint state, gpointer data) { GrDragger *dragger = (GrDragger *) data; GrDrag *drag = dragger->parent; @@ -859,7 +859,7 @@ gr_knot_moved_midpoint_handler(SPKnot *knot, NR::Point const *ppointer, guint st static void -gr_knot_grabbed_handler (SPKnot *knot, unsigned int state, gpointer data) +gr_knot_grabbed_handler (SPKnot */*knot*/, unsigned int state, gpointer data) { GrDragger *dragger = (GrDragger *) data; @@ -909,7 +909,7 @@ Called when a dragger knot is clicked; selects the dragger or deletes it dependi state of the keyboard keys */ static void -gr_knot_clicked_handler(SPKnot *knot, guint state, gpointer data) +gr_knot_clicked_handler(SPKnot */*knot*/, guint state, gpointer data) { GrDragger *dragger = (GrDragger *) data; GrDraggable *draggable = (GrDraggable *) dragger->draggables->data; @@ -972,7 +972,7 @@ gr_knot_clicked_handler(SPKnot *knot, guint state, gpointer data) Called when a dragger knot is doubleclicked; opens gradient editor with the stop from the first draggable */ static void -gr_knot_doubleclicked_handler (SPKnot *knot, guint state, gpointer data) +gr_knot_doubleclicked_handler (SPKnot */*knot*/, guint state, gpointer data) { GrDragger *dragger = (GrDragger *) data; @@ -1181,7 +1181,7 @@ GrDragger::moveThisToDraggable (SPItem *item, gint point_type, gint point_i, boo for (GSList const* i = this->draggables; i != NULL; i = i->next) { GrDraggable *da = (GrDraggable *) i->data; - if ( (da->item == item) && + if ( (da->item == item) && (point_type == -1 || da->point_type == point_type) && (point_i == -1 || da->point_i == point_i) && (da->fill_or_stroke == fill_or_stroke) ) { @@ -1199,7 +1199,7 @@ Moves all midstop draggables that depend on this one void GrDragger::updateMidstopDependencies (GrDraggable *draggable, bool write_repr) { SPObject *server = draggable->getServer(); - if (!server) + if (!server) return; guint num = SP_GRADIENT(server)->vector.stops.size(); if (num <= 2) return; @@ -1353,7 +1353,7 @@ GrDrag::getDraggerFor (SPItem *item, gint point_type, gint point_i, bool fill_or GrDragger *dragger = (GrDragger *) i->data; for (GSList const* j = dragger->draggables; j != NULL; j = j->next) { GrDraggable *da2 = (GrDraggable *) j->data; - if ( (da2->item == item) && + if ( (da2->item == item) && (point_type == -1 || da2->point_type == point_type) && // -1 means this does not matter (point_i == -1 || da2->point_i == point_i) && // -1 means this does not matter (da2->fill_or_stroke == fill_or_stroke)) { @@ -1438,7 +1438,7 @@ GrDrag::selectAll() /** \brief Select all stops/draggers that match the coords */ -void +void GrDrag::selectByCoords(std::vector coords) { for (GList *l = this->draggers; l != NULL; l = l->next) { @@ -1455,7 +1455,7 @@ GrDrag::selectByCoords(std::vector coords) /** \brief Select all stops/draggers that fall within the rect */ -void +void GrDrag::selectRect(NR::Rect const &r) { for (GList *l = this->draggers; l != NULL; l = l->next) { @@ -1770,7 +1770,7 @@ GrDrag::selected_move (double x, double y, bool write_repr, bool scale_radial) if (selected == NULL) return; - bool did = false; + bool did = false; for (GList *i = selected; i != NULL; i = i->next) { GrDragger *d = (GrDragger *) i->data; @@ -1781,7 +1781,7 @@ GrDrag::selected_move (double x, double y, bool write_repr, bool scale_radial) // Moving an rg center moves its focus and radii as well. // therefore, if this is a focus or radius and if selection // contains the center as well, do not move this one - if (d->isA(POINT_RG_R1) || d->isA(POINT_RG_R2) || + if (d->isA(POINT_RG_R1) || d->isA(POINT_RG_R2) || (d->isA(POINT_RG_FOCUS) && !d->isA(POINT_RG_CENTER))) { bool skip_radius_with_center = false; for (GList *di = selected; di != NULL; di = di->next) { @@ -1871,7 +1871,7 @@ GrDrag::select_next () { GrDragger *d = NULL; if (selected == NULL || g_list_find(draggers, selected->data)->next == NULL) { - if (draggers) + if (draggers) d = (GrDragger *) draggers->data; } else { d = (GrDragger *) g_list_find(draggers, selected->data)->next->data; @@ -2126,7 +2126,7 @@ GrDrag::deleteSelected (bool just_one) } sp_repr_css_attr_unref (stopcss); } - + sp_repr_css_change (SP_OBJECT_REPR (stopinfo->draggable->item), css, "style"); sp_repr_css_attr_unref (css); } diff --git a/src/guide-snapper.cpp b/src/guide-snapper.cpp index 984d64662..473198af3 100644 --- a/src/guide-snapper.cpp +++ b/src/guide-snapper.cpp @@ -22,7 +22,7 @@ Inkscape::GuideSnapper::GuideSnapper(SPNamedView const *nv, NR::Coord const d) : } -Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point const &p) const +Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point const &/*p*/) const { LineList s; diff --git a/src/livarot/path-description.h b/src/livarot/path-description.h index 0086d86b1..ccb4506f0 100644 --- a/src/livarot/path-description.h +++ b/src/livarot/path-description.h @@ -19,7 +19,7 @@ enum descr_interm_bezier = 6, // control point of the bezier spline descr_forced = 7, - descr_type_mask = 15 // the command no will be stored in a "flags" field, potentially with other info, so we need + descr_type_mask = 15 // the command no will be stored in a "flags" field, potentially with other info, so we need // a mask to AND the field and extract the command }; @@ -34,14 +34,14 @@ struct PathDescr flags &= ~descr_type_mask; flags |= t; } - - virtual void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const {} - virtual PathDescr *clone() const = 0; - virtual void transform(NR::Matrix const &t) {} - virtual void dump(std::ostream &s) const {} - + + virtual void dumpSVG(Inkscape::SVGOStringStream &/*s*/, NR::Point const &/*last*/) const {} + virtual PathDescr *clone() const = 0; + virtual void transform(NR::Matrix const &/*t*/) {} + virtual void dump(std::ostream &/*s*/) const {} + int flags; // most notably contains the path command no - int associated; // index in the polyline of the point that ends the path portion of this command + int associated; // index in the polyline of the point that ends the path portion of this command double tSt; double tEn; }; @@ -50,7 +50,7 @@ struct PathDescrMoveTo : public PathDescr { PathDescrMoveTo(NR::Point const &pp) : PathDescr(descr_moveto), p(pp) {} - + void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const; PathDescr *clone() const; void transform(NR::Matrix const &t); @@ -63,12 +63,12 @@ struct PathDescrLineTo : public PathDescr { PathDescrLineTo(NR::Point const &pp) : PathDescr(descr_lineto), p(pp) {} - + void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const; PathDescr *clone() const; void transform(NR::Matrix const &t); void dump(std::ostream &s) const; - + NR::Point p; }; @@ -77,12 +77,12 @@ struct PathDescrBezierTo : public PathDescr { PathDescrBezierTo(NR::Point const &pp, int n) : PathDescr(descr_bezierto), p(pp), nb(n) {} - + PathDescr *clone() const; void transform(NR::Matrix const &t); void dump(std::ostream &s) const; - - NR::Point p; // the endpoint's coordinates + + NR::Point p; // the endpoint's coordinates int nb; // number of control points, stored in the next path description commands }; @@ -97,8 +97,8 @@ struct PathDescrIntermBezierTo : public PathDescr PathDescr *clone() const; void transform(NR::Matrix const &t); void dump(std::ostream &s) const; - - NR::Point p; // control point coordinates + + NR::Point p; // control point coordinates }; // cubic spline curve: 2 tangents and one endpoint @@ -106,12 +106,12 @@ struct PathDescrCubicTo : public PathDescr { PathDescrCubicTo(NR::Point const &pp, NR::Point const &s, NR::Point const& e) : PathDescr(descr_cubicto), p(pp), start(s), end(e) {} - + void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const; PathDescr *clone() const; void transform(NR::Matrix const &t); void dump(std::ostream &s) const; - + NR::Point p; NR::Point start; NR::Point end; @@ -122,12 +122,12 @@ struct PathDescrArcTo : public PathDescr { PathDescrArcTo(NR::Point const &pp, double x, double y, double a, bool l, bool c) : PathDescr(descr_arcto), p(pp), rx(x), ry(y), angle(a), large(l), clockwise(c) {} - + void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const; PathDescr *clone() const; void transform(NR::Matrix const &t); void dump(std::ostream &s) const; - + NR::Point p; double rx; double ry; @@ -139,9 +139,9 @@ struct PathDescrArcTo : public PathDescr struct PathDescrForced : public PathDescr { PathDescrForced() : PathDescr(descr_forced), p(0, 0) {} - + PathDescr *clone() const; - + /* FIXME: not sure whether _forced should have a point associated with it; ** Path::ConvertForcedToMoveTo suggests that maybe it should. */ @@ -151,10 +151,10 @@ struct PathDescrForced : public PathDescr struct PathDescrClose : public PathDescr { PathDescrClose() : PathDescr(descr_close) {} - + void dumpSVG(Inkscape::SVGOStringStream &s, NR::Point const &last) const; PathDescr *clone() const; - + /* FIXME: not sure whether _forced should have a point associated with it; ** Path::ConvertForcedToMoveTo suggests that maybe it should. */ @@ -163,3 +163,14 @@ struct PathDescrClose : public PathDescr #endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 614f799c0..78d12ca69 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -52,8 +52,8 @@ public: virtual Gtk::Widget * param_getWidget() = 0; virtual Glib::ustring * param_getTooltip() { return ¶m_tooltip; }; - virtual void param_editOncanvas(SPItem * item, SPDesktop * dt) { return; }; - virtual void param_setup_notepath(Inkscape::NodePath::Path *np) { return; }; + virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {}; + virtual void param_setup_notepath(Inkscape::NodePath::Path */*np*/) {}; Glib::ustring param_key; Inkscape::UI::Widget::Registry * param_wr; @@ -76,7 +76,7 @@ class ScalarParam : public Parameter { public: ScalarParam( const Glib::ustring& label, const Glib::ustring& tip, - const Glib::ustring& key, + const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr, Effect* effect, gdouble default_value = 1.0); @@ -118,3 +118,14 @@ private: } //namespace Inkscape #endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 5b7565195..3b9063f33 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -291,7 +291,7 @@ void sp_nodepath_destroy(Inkscape::NodePath::Path *np) { delete np->livarot_path; np->livarot_path = NULL; } - + if (np->helper_path) { GtkObject *temp = np->helper_path; np->helper_path = NULL; @@ -402,7 +402,7 @@ static gint sp_nodepath_selection_get_subpath_count(Inkscape::NodePath::Path *np } return count; } - + /** * Clean up a nodepath after editing. * @@ -548,7 +548,7 @@ static void update_repr_internal(Inkscape::NodePath::Path *np) sp_curve_unref(np->curve); np->curve = create_curve(np); - + gchar *typestr = create_typestr(np); gchar *svgpath = sp_svg_write_path(SP_CURVE_BPATH(np->curve)); @@ -589,8 +589,8 @@ void sp_nodepath_update_repr(Inkscape::NodePath::Path *np, const gchar *annotati update_repr_internal(np); sp_canvas_end_forced_full_redraws(np->desktop->canvas); - - sp_document_done(sp_desktop_document(np->desktop), SP_VERB_CONTEXT_NODE, + + sp_document_done(sp_desktop_document(np->desktop), SP_VERB_CONTEXT_NODE, annotation); } @@ -605,7 +605,7 @@ static void sp_nodepath_update_repr_keyed(Inkscape::NodePath::Path *np, gchar co } update_repr_internal(np); - sp_document_maybe_done(sp_desktop_document(np->desktop), key, SP_VERB_CONTEXT_NODE, + sp_document_maybe_done(sp_desktop_document(np->desktop), key, SP_VERB_CONTEXT_NODE, annotation); } @@ -828,7 +828,7 @@ static Inkscape::NodePath::Node *sp_nodepath_line_add_node(Inkscape::NodePath::N g_assert( start->n.other == end ); Inkscape::NodePath::Node *newnode = sp_nodepath_node_new(end->subpath, end, - (NRPathcode)end->code == NR_LINETO? + (NRPathcode)end->code == NR_LINETO? Inkscape::NodePath::NODE_CUSP : Inkscape::NodePath::NODE_SMOOTH, (NRPathcode)end->code, &start->pos, &start->pos, &start->n.pos); @@ -1009,7 +1009,7 @@ void sp_nodepath_convert_node_type(Inkscape::NodePath::Node *node, Inkscape::Nod if (type == Inkscape::NodePath::NODE_SYMM || type == Inkscape::NodePath::NODE_SMOOTH) { if (p_line && n_line) { - // only if both adjacent segments are lines, + // only if both adjacent segments are lines, // convert both to curves: // BEFORE: @@ -1085,7 +1085,7 @@ static void sp_nodepath_selected_nodes_move(Inkscape::NodePath::Path *nodepath, if (snap) { SnapManager const &m = nodepath->desktop->namedview->snap_manager; - + for (GList *l = nodepath->selected; l != NULL; l = l->next) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) l->data; Inkscape::SnappedPoint const s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, n->pos + delta, SP_PATH(n->subpath->nodepath->item)); @@ -1153,7 +1153,7 @@ sp_nodepath_move_node_and_handles (Inkscape::NodePath::Node *n, NR::Point delta, * Displace selected nodes and their handles by fractions of delta (from their origins), depending * on how far they are from the dragged node n. */ -static void +static void sp_nodepath_selected_nodes_sculpt(Inkscape::NodePath::Path *nodepath, Inkscape::NodePath::Node *n, NR::Point delta) { g_assert (n); @@ -1239,7 +1239,7 @@ sp_nodepath_selected_nodes_sculpt(Inkscape::NodePath::Path *nodepath, Inkscape:: } else { n_range += bezier_length (n_node->p.other->origin, n_node->p.other->n.origin, n_node->p.origin, n_node->origin); if (n_node->selected) { - sp_nodepath_move_node_and_handles (n_node, + sp_nodepath_move_node_and_handles (n_node, sculpt_profile (n_range / n_sel_range, alpha, profile) * delta, sculpt_profile ((n_range + NR::L2(n_node->n.origin - n_node->origin)) / n_sel_range, alpha, profile) * delta, sculpt_profile ((n_range - NR::L2(n_node->p.origin - n_node->origin)) / n_sel_range, alpha, profile) * delta); @@ -1256,7 +1256,7 @@ sp_nodepath_selected_nodes_sculpt(Inkscape::NodePath::Path *nodepath, Inkscape:: } else { p_range += bezier_length (p_node->n.other->origin, p_node->n.other->p.origin, p_node->n.origin, p_node->origin); if (p_node->selected) { - sp_nodepath_move_node_and_handles (p_node, + sp_nodepath_move_node_and_handles (p_node, sculpt_profile (p_range / p_sel_range, alpha, profile) * delta, sculpt_profile ((p_range - NR::L2(p_node->n.origin - p_node->origin)) / p_sel_range, alpha, profile) * delta, sculpt_profile ((p_range + NR::L2(p_node->p.origin - p_node->origin)) / p_sel_range, alpha, profile) * delta); @@ -1272,7 +1272,7 @@ sp_nodepath_selected_nodes_sculpt(Inkscape::NodePath::Path *nodepath, Inkscape:: } else { // Multiple subpaths have selected nodes: // use spatial mode, where the distance from n to node being dragged is measured directly as NR::L2. - // TODO: correct these distances taking into account their angle relative to the bisector, so as to + // TODO: correct these distances taking into account their angle relative to the bisector, so as to // fix the pear-like shape when sculpting e.g. a ring // First pass: calculate range @@ -1403,7 +1403,7 @@ static void sp_node_update_handle(Inkscape::NodePath::Node *node, gint which, gb sp_node_ensure_knot_exists(node->subpath->nodepath->desktop, node, side); // Just created, so we shouldn't fire the node_moved callback - instead set the knot position directly side->knot->pos = side->pos; - if (side->knot->item) + if (side->knot->item) SP_CTRL(side->knot->item)->moveto(side->pos); sp_ctrlline_set_coords(SP_CTRLLINE(side->line), node->pos, side->pos); sp_knot_show(side->knot); @@ -1450,7 +1450,7 @@ static void sp_node_update_handles(Inkscape::NodePath::Node *node, bool fire_mov if (node->knot->pos != node->pos) { // visible knot is in a different position, need to update if (fire_move_signals) sp_knot_set_position(node->knot, &node->pos, 0); - else + else sp_knot_moveto(node->knot, &node->pos); } @@ -1663,7 +1663,7 @@ sp_nodepath_select_segment_near_point(Inkscape::NodePath::Path *nodepath, NR::Po //fixme: this can return NULL, so check before proceeding. g_return_if_fail(e != NULL); - + gboolean force = FALSE; if (!(e->selected && (!e->p.other || e->p.other->selected))) { force = TRUE; @@ -1727,7 +1727,7 @@ sp_nodepath_curve_drag(int node, double t, NR::Point delta) //fixme: e and e->p can be NULL, so check for those before proceeding g_return_if_fail(e != NULL); g_return_if_fail(&e->p != NULL); - + /* feel good is an arbitrary parameter that distributes the delta between handles * if t of the drag point is less than 1/6 distance form the endpoint only * the corresponding hadle is adjusted. This matches the behavior in GIMP @@ -1836,7 +1836,7 @@ void sp_node_selected_join(Inkscape::NodePath::Path *nodepath) Inkscape::NodePath::Node *b = (Inkscape::NodePath::Node *) nodepath->selected->next->data; g_assert(a != b); - if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { + if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { // someone tried to join an orphan node (i.e. a single-node subpath). // this is not worth an error message, just fail silently. return; @@ -1937,7 +1937,7 @@ void sp_node_selected_join_segment(Inkscape::NodePath::Path *nodepath) Inkscape::NodePath::Node *b = (Inkscape::NodePath::Node *) nodepath->selected->next->data; g_assert(a != b); - if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { + if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { // someone tried to join an orphan node (i.e. a single-node subpath). // this is not worth an error message, just fail silently. return; @@ -2028,7 +2028,7 @@ void sp_node_selected_join_segment(Inkscape::NodePath::Path *nodepath) void sp_node_delete_preserve(GList *nodes_to_delete) { GSList *nodepaths = NULL; - + while (nodes_to_delete) { Inkscape::NodePath::Node *node = (Inkscape::NodePath::Node*) g_list_first(nodes_to_delete)->data; Inkscape::NodePath::SubPath *sp = node->subpath; @@ -2037,7 +2037,7 @@ void sp_node_delete_preserve(GList *nodes_to_delete) Inkscape::NodePath::Node *sample_end = NULL; Inkscape::NodePath::Node *delete_cursor = node; bool just_delete = false; - + //find the start of this contiguous selection //move left to the first node that is not selected //or the start of the non-closed path @@ -2052,7 +2052,7 @@ void sp_node_delete_preserve(GList *nodes_to_delete) } else { sample_cursor = delete_cursor->p.other; } - + //calculate points for each segment int rate = 5; float period = 1.0 / rate; @@ -2065,7 +2065,7 @@ void sp_node_delete_preserve(GList *nodes_to_delete) just_delete = true; break; } - + //sample points on the contiguous selected segment NR::Point *bez; bez = new NR::Point [4]; @@ -2093,7 +2093,7 @@ void sp_node_delete_preserve(GList *nodes_to_delete) NR::Point *adata; adata = new NR::Point [data.size()]; copy(data.begin(), data.end(), adata); - + NR::Point *bez; bez = new NR::Point [4]; //would decreasing error create a better fitting approximation? @@ -2106,18 +2106,18 @@ void sp_node_delete_preserve(GList *nodes_to_delete) //the resulting nodes behave as expected. sp_nodepath_convert_node_type(sample_cursor, Inkscape::NodePath::NODE_CUSP); sp_nodepath_convert_node_type(sample_end, Inkscape::NodePath::NODE_CUSP); - + //adjust endpoints sample_cursor->n.pos = bez[1]; sample_end->p.pos = bez[2]; } - + //destroy this contiguous selection while (delete_cursor && g_list_find(nodes_to_delete, delete_cursor)) { Inkscape::NodePath::Node *temp = delete_cursor; if (delete_cursor->n.other == delete_cursor) { // delete_cursor->n points to itself, which means this is the last node on a closed subpath - delete_cursor = NULL; + delete_cursor = NULL; } else { delete_cursor = delete_cursor->n.other; } @@ -2182,7 +2182,7 @@ void sp_node_selected_delete(Inkscape::NodePath::Path *nodepath) sp_nodepath_get_node_count(nodepath) < 2) { SPDocument *document = sp_desktop_document (nodepath->desktop); sp_selection_delete(); - sp_document_done (document, SP_VERB_CONTEXT_NODE, + sp_document_done (document, SP_VERB_CONTEXT_NODE, _("Delete nodes")); return; } @@ -2810,7 +2810,7 @@ sp_nodepath_remember_origins(Inkscape::NodePath::Path *nodepath) n->n.origin = n->n.pos; } } -} +} /** \brief Saves selected nodes in a nodepath into a list containing integer positions of all selected nodes @@ -2901,7 +2901,7 @@ static void sp_node_adjust_handle(Inkscape::NodePath::Node *node, gint which_adj len = NR::L2(me->pos - node->pos); delta = node->pos - othernode->pos; linelen = NR::L2(delta); - if (linelen < 1e-18) + if (linelen < 1e-18) return; me->pos = node->pos + (len / linelen)*delta; return; @@ -2971,7 +2971,7 @@ static void sp_node_adjust_handles(Inkscape::NodePath::Node *node) /** * Node event callback. */ -static gboolean node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n) +static gboolean node_event(SPKnot */*knot*/, GdkEvent *event, Inkscape::NodePath::Node *n) { gboolean ret = FALSE; switch (event->type) { @@ -3088,7 +3088,7 @@ gboolean node_key(GdkEvent *event) /** * Mouseclick on node callback. */ -static void node_clicked(SPKnot *knot, guint state, gpointer data) +static void node_clicked(SPKnot */*knot*/, guint state, gpointer data) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data; @@ -3120,7 +3120,7 @@ static void node_clicked(SPKnot *knot, guint state, gpointer data) /** * Mouse grabbed node callback. */ -static void node_grabbed(SPKnot *knot, guint state, gpointer data) +static void node_grabbed(SPKnot */*knot*/, guint state, gpointer data) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data; @@ -3137,7 +3137,7 @@ static void node_grabbed(SPKnot *knot, guint state, gpointer data) /** * Mouse ungrabbed node callback. */ -static void node_ungrabbed(SPKnot *knot, guint state, gpointer data) +static void node_ungrabbed(SPKnot */*knot*/, guint /*state*/, gpointer data) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data; @@ -3182,7 +3182,7 @@ static double point_line_distance(NR::Point *p, double a) * \todo fixme: This goes to "moved" event? (lauris) */ static gboolean -node_request(SPKnot *knot, NR::Point *p, guint state, gpointer data) +node_request(SPKnot */*knot*/, NR::Point *p, guint state, gpointer data) { double yn, xn, yp, xp; double an, ap, na, pa; @@ -3435,7 +3435,7 @@ static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data) /** * Node handle "request" signal callback. */ -static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data) +static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint /*state*/, gpointer data) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data; diff --git a/src/object-edit.cpp b/src/object-edit.cpp index 63ccf827e..1ef02672f 100644 --- a/src/object-edit.cpp +++ b/src/object-edit.cpp @@ -50,7 +50,7 @@ #define sp_round(v,m) (((v) < 0.0) ? ((ceil((v) / (m) - 0.5)) * (m)) : ((floor((v) / (m) + 0.5)) * (m))) static SPKnotHolder *sp_rect_knot_holder(SPItem *item, SPDesktop *desktop); -//static +//static SPKnotHolder *sp_3dbox_knot_holder(SPItem *item, SPDesktop *desktop); static SPKnotHolder *sp_arc_knot_holder(SPItem *item, SPDesktop *desktop); static SPKnotHolder *sp_star_knot_holder(SPItem *item, SPDesktop *desktop); @@ -152,7 +152,7 @@ static NR::Point sp_pattern_angle_get(SPItem *item) } static void -sp_pattern_angle_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_pattern_angle_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { int const snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -177,7 +177,7 @@ sp_pattern_angle_set(SPItem *item, NR::Point const &p, NR::Point const &origin, } static void -sp_pattern_scale_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_pattern_scale_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) { SPPattern *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); @@ -223,7 +223,7 @@ static NR::Point snap_knot_position(SPItem *item, NR::Point const &p) { SPDesktop const *desktop = inkscape_active_desktop(); NR::Matrix const i2d (sp_item_i2d_affine (item)); - NR::Point s = p * i2d; + NR::Point s = p * i2d; SnapManager const &m = desktop->namedview->snap_manager; s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, s, item).getPoint(); return s * i2d.inverse(); @@ -236,10 +236,10 @@ static NR::Point sp_rect_rx_get(SPItem *item) return NR::Point(rect->x.computed + rect->width.computed - rect->rx.computed, rect->y.computed); } -static void sp_rect_rx_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +static void sp_rect_rx_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPRect *rect = SP_RECT(item); - + //In general we cannot just snap this radius to an arbitrary point, as we have only a single //degree of freedom. For snapping to an arbitrary point we need two DOF. If we're going to snap //the radius then we should have a constrained snap. snap_knot_position() is unconstrained @@ -265,10 +265,10 @@ static NR::Point sp_rect_ry_get(SPItem *item) return NR::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->ry.computed); } -static void sp_rect_ry_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +static void sp_rect_ry_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPRect *rect = SP_RECT(item); - + //In general we cannot just snap this radius to an arbitrary point, as we have only a single //degree of freedom. For snapping to an arbitrary point we need two DOF. If we're going to snap //the radius then we should have a constrained snap. snap_knot_position() is unconstrained @@ -548,7 +548,7 @@ static inline Box3D::Axis movement_axis_of_3dbox_corner (guint corner, guint sta return Box3D::NONE; } -/* +/* * To keep the snappoint from jumping randomly between the two lines when the mouse pointer is close to * their intersection, we remember the last snapped line and keep snapping to this specific line as long * as the distance from the intersection to the mouse pointer is less than remember_snap_threshold. @@ -559,7 +559,7 @@ static double remember_snap_threshold = 30; static guint remember_snap_index = 0; static guint remember_snap_index_center = 0; -static NR::Point snap_knot_position_3dbox (SP3DBox *box, guint corner, Box3D::Axis direction, NR::Point const &origin, NR::Point const &p, guint state) +static NR::Point snap_knot_position_3dbox (SP3DBox *box, guint corner, Box3D::Axis direction, NR::Point const &origin, NR::Point const &p, guint /*state*/) { SPDesktop * desktop = inkscape_active_desktop(); Box3D::Perspective3D *persp = sp_desktop_document (desktop)->get_persp_of_box (box); @@ -876,7 +876,7 @@ sp_genericellipse_side(SPGenericEllipse *ellipse, NR::Point const &p) } static void -sp_arc_start_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_arc_start_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { int snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -906,7 +906,7 @@ static NR::Point sp_arc_start_get(SPItem *item) } static void -sp_arc_end_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_arc_end_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { int snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -948,11 +948,11 @@ sp_arc_startend_click(SPItem *item, guint state) static void -sp_arc_rx_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_arc_rx_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPGenericEllipse *ge = SP_GENERICELLIPSE(item); SPArc *arc = SP_ARC(item); - + NR::Point const s = snap_knot_position(arc, p); ge->rx.computed = fabs( ge->cx.computed - s[NR::X] ); @@ -972,11 +972,11 @@ static NR::Point sp_arc_rx_get(SPItem *item) } static void -sp_arc_ry_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_arc_ry_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPGenericEllipse *ge = SP_GENERICELLIPSE(item); SPArc *arc = SP_ARC(item); - + NR::Point const s = snap_knot_position(arc, p); ge->ry.computed = fabs( ge->cy.computed - s[NR::Y] ); @@ -1043,10 +1043,10 @@ sp_arc_knot_holder(SPItem *item, SPDesktop *desktop) /* SPStar */ static void -sp_star_knot1_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_star_knot1_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPStar *star = SP_STAR(item); - + NR::Point const s = snap_knot_position(star, p); NR::Point d = s - star->center; @@ -1069,12 +1069,12 @@ sp_star_knot1_set(SPItem *item, NR::Point const &p, NR::Point const &origin, gui } static void -sp_star_knot2_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_star_knot2_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { SPStar *star = SP_STAR(item); - + NR::Point const s = snap_knot_position(star, p); - + if (star->flatsided == false) { NR::Point d = s - star->center; @@ -1162,7 +1162,7 @@ sp_star_knot_holder(SPItem *item, SPDesktop *desktop) * [control] constrain inner arg to round per PI/4 */ static void -sp_spiral_inner_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_spiral_inner_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { int snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -1204,7 +1204,7 @@ sp_spiral_inner_set(SPItem *item, NR::Point const &p, NR::Point const &origin, g * [control] constrain inner arg to round per PI/4 */ static void -sp_spiral_outer_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_spiral_outer_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint state) { int snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -1322,7 +1322,7 @@ sp_spiral_knot_holder(SPItem *item, SPDesktop *desktop) /* SPOffset */ static void -sp_offset_offset_set(SPItem *item, NR::Point const &p, NR::Point const &origin, guint state) +sp_offset_offset_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) { SPOffset *offset = SP_OFFSET(item); diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 7739238b4..10e0c43d4 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -27,7 +27,7 @@ #include "text-editing.h" Inkscape::ObjectSnapper::ObjectSnapper(SPNamedView const *nv, NR::Coord const d) - : Snapper(nv, d), _snap_to_itemnode(true), _snap_to_itempath(true), + : Snapper(nv, d), _snap_to_itemnode(true), _snap_to_itempath(true), _snap_to_bboxnode(true), _snap_to_bboxpath(true), _strict_snapping(true), _include_item_center(false) { @@ -36,14 +36,14 @@ Inkscape::ObjectSnapper::ObjectSnapper(SPNamedView const *nv, NR::Coord const d) _paths_to_snap_to = new std::vector; } -Inkscape::ObjectSnapper::~ObjectSnapper() +Inkscape::ObjectSnapper::~ObjectSnapper() { _candidates->clear(); //Don't delete the candidates themselves, as these are not ours! - delete _candidates; - + delete _candidates; + _points_to_snap_to->clear(); delete _points_to_snap_to; - + for (std::vector::const_iterator k = _paths_to_snap_to->begin(); k != _paths_to_snap_to->end(); k++) { delete *k; } @@ -52,11 +52,11 @@ Inkscape::ObjectSnapper::~ObjectSnapper() } /** - * Find all items within snapping range. + * Find all items within snapping range. * \param r Pointer to the current document - * \param it List of items to ignore - * \param first_point If true then this point is the first one from a whole bunch of points - * \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation + * \param it List of items to ignore + * \param first_point If true then this point is the first one from a whole bunch of points + * \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation * \param DimensionToSnap Snap in X, Y, or both directions. */ @@ -66,47 +66,47 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* r, std::vector &points_to_snap, DimensionToSnap const snap_dim) const { - if (ThisSnapperMightSnap()) { + if (ThisSnapperMightSnap()) { SPDesktop const *desktop = SP_ACTIVE_DESKTOP; - - if (first_point) { + + if (first_point) { _candidates->clear(); - } - + } + for (SPObject* o = sp_object_first_child(r); o != NULL; o = SP_OBJECT_NEXT(o)) { if (SP_IS_ITEM(o) && !SP_ITEM(o)->isLocked() && !desktop->itemIsHidden(SP_ITEM(o))) { - + /* See if this item is on the ignore list */ std::list::const_iterator i = it.begin(); while (i != it.end() && *i != o) { i++; } - + if (i == it.end()) { /* See if the item is within range */ if (SP_IS_GROUP(o)) { _findCandidates(o, it, false, points_to_snap, snap_dim); } else { // Now let's see if any of the snapping points is within - // snapping range of this object + // snapping range of this object NR::Maybe b = sp_item_bbox_desktop(SP_ITEM(o)); if (b) { for (std::vector::const_iterator i = points_to_snap.begin(); i != points_to_snap.end(); i++) { NR::Point b_min = b->min(); - NR::Point b_max = b->max(); + NR::Point b_max = b->max(); double d = getDistance(); - bool withinX = ((*i)[NR::X] >= b_min[NR::X] - d) && ((*i)[NR::X] <= b_max[NR::X] + d); + bool withinX = ((*i)[NR::X] >= b_min[NR::X] - d) && ((*i)[NR::X] <= b_max[NR::X] + d); bool withinY = ((*i)[NR::Y] >= b_min[NR::Y] - d) && ((*i)[NR::Y] <= b_max[NR::Y] + d); if (snap_dim == SNAP_X && withinX || snap_dim == SNAP_Y && withinY || snap_dim == SNAP_XY && withinX && withinY) { - //We've found a point that is within snapping range + //We've found a point that is within snapping range //of this object, so record it as a candidate _candidates->push_back(SP_ITEM(o)); break; - } - } + } + } } } - } + } } } } @@ -120,20 +120,20 @@ bool Inkscape::ObjectSnapper::_snapNodes(Inkscape::Snapper::PointType const &t, DimensionToSnap const snap_dim) const { bool success = false; - + // Determine the type of bounding box we should snap to - SPItem::BBoxType bbox_type = SPItem::GEOMETRIC_BBOX; - if (_snap_to_bboxnode) { + SPItem::BBoxType bbox_type = SPItem::GEOMETRIC_BBOX; + if (_snap_to_bboxnode) { gchar const *prefs_bbox = prefs_get_string_attribute("tools.select", "bounding_box"); bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX; - } - - bool p_is_a_node = t & Inkscape::Snapper::SNAPPOINT_NODE; - bool p_is_a_bbox = t & Inkscape::Snapper::SNAPPOINT_BBOX; + } + + bool p_is_a_node = t & Inkscape::Snapper::SNAPPOINT_NODE; + bool p_is_a_bbox = t & Inkscape::Snapper::SNAPPOINT_BBOX; bool p_is_a_guide = t & Inkscape::Snapper::SNAPPOINT_GUIDE; - - // A point considered for snapping should be either a node, a bbox corner or a guide. Pick only ONE! - g_assert(!(p_is_a_node && p_is_a_bbox || p_is_a_bbox && p_is_a_guide || p_is_a_node && p_is_a_guide)); + + // A point considered for snapping should be either a node, a bbox corner or a guide. Pick only ONE! + g_assert(!(p_is_a_node && p_is_a_bbox || p_is_a_bbox && p_is_a_guide || p_is_a_node && p_is_a_guide)); // Now, let's first collect all points to snap to. If we have a whole bunch of points to snap, // e.g. when translating an item using the selector tool, then we will only do this for the @@ -141,20 +141,20 @@ bool Inkscape::ObjectSnapper::_snapNodes(Inkscape::Snapper::PointType const &t, if (first_point) { _points_to_snap_to->clear(); for (std::vector::const_iterator i = _candidates->begin(); i != _candidates->end(); i++) { - + //NR::Matrix i2doc(NR::identity()); SPItem *root_item = *i; if (SP_IS_USE(*i)) { root_item = sp_use_root(SP_USE(*i)); } - + //Collect all nodes so we can snap to them if (_snap_to_itemnode) { if (!(_strict_snapping && !p_is_a_node) || p_is_a_guide) { sp_item_snappoints(root_item, _include_item_center, SnapPointsIter(*_points_to_snap_to)); } } - + //Collect the bounding box's corners so we can snap to them if (_snap_to_bboxnode) { if (!(_strict_snapping && !p_is_a_bbox) || p_is_a_guide) { @@ -164,11 +164,11 @@ bool Inkscape::ObjectSnapper::_snapNodes(Inkscape::Snapper::PointType const &t, _points_to_snap_to->push_back(b->corner(k)); } } - } + } } } } - + //Do the snapping, using all the nodes and corners collected above for (std::vector::const_iterator k = _points_to_snap_to->begin(); k != _points_to_snap_to->end(); k++) { /* Try to snap to this node of the path */ @@ -177,7 +177,7 @@ bool Inkscape::ObjectSnapper::_snapNodes(Inkscape::Snapper::PointType const &t, switch (snap_dim) { case SNAP_X: dist = fabs((*k)[NR::X] - p[NR::X]); - snapped_point = NR::Point((*k)[NR::X], p[NR::Y]); + snapped_point = NR::Point((*k)[NR::X], p[NR::Y]); break; case SNAP_Y: dist = fabs((*k)[NR::Y] - p[NR::Y]); @@ -188,13 +188,13 @@ bool Inkscape::ObjectSnapper::_snapNodes(Inkscape::Snapper::PointType const &t, snapped_point = *k; break; } - + if (dist < getDistance() && dist < s.getDistance()) { s = SnappedPoint(snapped_point, dist); success = true; - } + } } - + return success; } @@ -211,26 +211,26 @@ bool Inkscape::ObjectSnapper::_snapPaths(Inkscape::Snapper::PointType const &t, SPDesktop const *desktop = SP_ACTIVE_DESKTOP; NR::Point const p_doc = desktop->dt2doc(p); - + // Determine the type of bounding box we should snap to - SPItem::BBoxType bbox_type = SPItem::GEOMETRIC_BBOX; - if (_snap_to_bboxpath) { + SPItem::BBoxType bbox_type = SPItem::GEOMETRIC_BBOX; + if (_snap_to_bboxpath) { gchar const *prefs_bbox = prefs_get_string_attribute("tools.select", "bounding_box"); - bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX; + bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX; } - - bool p_is_a_node = t & Inkscape::Snapper::SNAPPOINT_NODE; - + + bool p_is_a_node = t & Inkscape::Snapper::SNAPPOINT_NODE; + // Now, let's first collect all paths to snap to. If we have a whole bunch of points to snap, // e.g. when translating an item using the selector tool, then we will only do this for the // first point and store the collection for later use. This dramatically improves the performance - if (first_point) { + if (first_point) { for (std::vector::const_iterator k = _paths_to_snap_to->begin(); k != _paths_to_snap_to->end(); k++) { delete *k; } _paths_to_snap_to->clear(); for (std::vector::const_iterator i = _candidates->begin(); i != _candidates->end(); i++) { - + /* Transform the requested snap point to this item's coordinates */ NR::Matrix i2doc(NR::identity()); SPItem *root_item = NULL; @@ -242,9 +242,9 @@ bool Inkscape::ObjectSnapper::_snapPaths(Inkscape::Snapper::PointType const &t, i2doc = sp_item_i2doc_affine(*i); root_item = *i; } - - //Build a list of all paths considered for snapping to - + + //Build a list of all paths considered for snapping to + //Add the item's path to snap to if (_snap_to_itempath) { if (!(_strict_snapping && !p_is_a_node)) { @@ -253,29 +253,29 @@ bool Inkscape::ObjectSnapper::_snapPaths(Inkscape::Snapper::PointType const &t, // containing max. 240 characters. Snapping the bbox will not be affected bool very_lenghty_prose = false; if (SP_IS_TEXT(root_item) || SP_IS_FLOWTEXT(root_item)) { - very_lenghty_prose = sp_text_get_length(SP_TEXT(root_item)) > 240; + very_lenghty_prose = sp_text_get_length(SP_TEXT(root_item)) > 240; } // On my AMD 3000+, the snapping lag becomes annoying at approx. 240 chars // which corresponds to a lag of 500 msec. This is for snapping a rect - // to a single line of text. - - // Snapping for example to a traced bitmap is also very stressing for + // to a single line of text. + + // Snapping for example to a traced bitmap is also very stressing for // the CPU, so we'll only snap to paths having no more than 500 nodes - // This also leads to a lag of approx. 500 msec (in my lousy test set-up). + // This also leads to a lag of approx. 500 msec (in my lousy test set-up). bool very_complex_path = false; if (SP_IS_PATH(root_item)) { - very_complex_path = sp_nodes_in_path(SP_PATH(root_item)) > 500; - } - + very_complex_path = sp_nodes_in_path(SP_PATH(root_item)) > 500; + } + if (!very_lenghty_prose && !very_complex_path) { _paths_to_snap_to->push_back(Path_for_item(root_item, true, true)); } } } - + //Add the item's bounding box to snap to if (_snap_to_bboxpath) { - if (!(_strict_snapping && p_is_a_node)) { + if (!(_strict_snapping && p_is_a_node)) { //This will get ugly... rect -> curve -> bpath NRRect rect; sp_item_invoke_bbox(root_item, &rect, i2doc, TRUE, bbox_type); @@ -284,43 +284,43 @@ bool Inkscape::ObjectSnapper::_snapPaths(Inkscape::Snapper::PointType const &t, if (curve) { NArtBpath *bpath = SP_CURVE_BPATH(curve); if (bpath) { - Path *path = bpath_to_Path(bpath); + Path *path = bpath_to_Path(bpath); if (path) { _paths_to_snap_to->push_back(path); } delete bpath; - } - delete curve; + } + delete curve; } } } } } - //Now we can finally do the real snapping, using the paths collected above + //Now we can finally do the real snapping, using the paths collected above for (std::vector::const_iterator k = _paths_to_snap_to->begin(); k != _paths_to_snap_to->end(); k++) { if (*k) { if (first_point) { (*k)->ConvertWithBackData(0.01); //This is extremely time consuming! } - + /* Look for the nearest position on this SPItem to our snap point */ NR::Maybe const o = get_nearest_position_on_Path(*k, p_doc); if (o && o->t >= 0 && o->t <= 1) { - + /* Convert the nearest point back to desktop coordinates */ - NR::Point const o_it = get_point_on_Path(*k, o->piece, o->t); + NR::Point const o_it = get_point_on_Path(*k, o->piece, o->t); NR::Point const o_dt = desktop->doc2dt(o_it); - + NR::Coord const dist = NR::L2(o_dt - p); if (dist < getDistance() && dist < s.getDistance()) { s = SnappedPoint(o_dt, dist); success = true; } } - } + } } - + return success; } @@ -359,13 +359,13 @@ void Inkscape::ObjectSnapper::_doFreeSnap(SnappedConstraints &sc, -void Inkscape::ObjectSnapper::_doConstrainedSnap(SnappedConstraints &sc, - Inkscape::Snapper::PointType const &t, - NR::Point const &p, - bool const &first_point, - std::vector &points_to_snap, - ConstraintLine const &c, - std::list const &it) const +void Inkscape::ObjectSnapper::_doConstrainedSnap( SnappedConstraints &sc, + Inkscape::Snapper::PointType const &t, + NR::Point const &p, + bool const &first_point, + std::vector &points_to_snap, + ConstraintLine const &/*c*/, + std::list const &it) const { /* FIXME: this needs implementing properly; I think we have to do the ** intersection of c with the objects. @@ -385,15 +385,15 @@ Inkscape::SnappedPoint Inkscape::ObjectSnapper::guideSnap(NR::Point const &p, /* Get a list of all the SPItems that we will try to snap to */ std::vector cand; std::list const it; //just an empty list - + std::vector points_to_snap; points_to_snap.push_back(p); - + _findCandidates(sp_document_root(_named_view->document), it, true, points_to_snap, snap_dim); SnappedPoint s(p, NR_HUGE); _snapNodes(Inkscape::Snapper::SNAPPOINT_GUIDE, s, p, true, snap_dim); - + return s; } diff --git a/src/perspective3d.cpp b/src/perspective3d.cpp index 3c7529c16..489e88dfc 100644 --- a/src/perspective3d.cpp +++ b/src/perspective3d.cpp @@ -49,7 +49,7 @@ NR::Point perspective_line_snap (NR::Point line_pt, Box3D::Axis dir, NR::Point ext_pt, Perspective3D *persp) { return PerspectiveLine(line_pt, dir, persp).closest_to(ext_pt); -} +} Perspective3D::Perspective3D (VanishingPoint const &pt_x, VanishingPoint const &pt_y, VanishingPoint const &pt_z, SPDocument *doc) : boxes (NULL), @@ -208,7 +208,7 @@ Perspective3D::rotate (Box3D::Axis const axis, double const angle, bool const al { Box3D::VanishingPoint *vp = get_vanishing_point (axis); if (!vp->is_finite()) { - double add_value = angle; + //double add_value = angle; double a = NR::atan2 (vp->v_dir) * 180/M_PI; a += alt_pressed ? 0.5 * ((angle > 0 ) - (angle < 0)) : angle; // the r.h.s. yields +/-0.5 or angle a *= M_PI/180; @@ -332,7 +332,7 @@ Perspective3D::reshape_boxes (Box3D::Axis axes) new_pt = vp->get_pos() + box->ratio_z * (box->corners[0] - vp->get_pos()); sp_3dbox_move_corner_in_Z_direction (box, 4, new_pt); } - } + } sp_3dbox_set_shape (box, true); } @@ -439,8 +439,8 @@ Perspective3D::print_debugging_info () g_print ("====================================================\n"); } -} // namespace Box3D - +} // namespace Box3D + /* Local Variables: mode:c++ diff --git a/src/print.cpp b/src/print.cpp index 872a0234f..4252298a4 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -139,8 +139,8 @@ sp_print_preview_document(SPDocument *doc) #ifdef HAVE_GTK_UNIX_PRINT static void -unix_print_complete (GtkPrintJob *print_job, - gpointer user_data, +unix_print_complete (GtkPrintJob */*print_job*/, + gpointer /*user_data*/, GError *error) { fprintf(stderr,"print job finished: %s\n",error ? error->message : "no error"); @@ -161,7 +161,7 @@ unix_print_dialog (const gchar * ps_file, const gchar * jobname, gdouble doc_wid /* * It would be nice to merge the PrintPS::setup routine with a custom * configuration dialog: - + gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog, GtkWidget *child, GtkWidget *tab_label); @@ -173,27 +173,28 @@ unix_print_dialog (const gchar * ps_file, const gchar * jobname, gdouble doc_wid GtkPrinter* printer = gtk_print_unix_dialog_get_selected_printer(GTK_PRINT_UNIX_DIALOG(dlg)); if (gtk_printer_accepts_ps (printer)) { - GtkPageSetup *page_setup = gtk_print_unix_dialog_get_page_setup(GTK_PRINT_UNIX_DIALOG(dlg)); - - //It's important to set the right paper size here, otherwise it will - //default to letter; if for example an A4 is printed as a letter, then - //part of it will be truncated even when printing on A4 paper - - //TODO: let the user decide upon the paper size, by enabling - //the drop down widget in the printing dialog. For now, we'll simply - //take the document's dimensions and communicate these to the printer - //driver - - GtkPaperSize *page_size = gtk_paper_size_new_custom("custom", "custom", doc_width, doc_height, GTK_UNIT_POINTS); - - gtk_page_setup_set_paper_size (page_setup, page_size); - + GtkPageSetup *page_setup = gtk_print_unix_dialog_get_page_setup(GTK_PRINT_UNIX_DIALOG(dlg)); + + //It's important to set the right paper size here, otherwise it will + //default to letter; if for example an A4 is printed as a letter, then + //part of it will be truncated even when printing on A4 paper + + //TODO: let the user decide upon the paper size, by enabling + //the drop down widget in the printing dialog. For now, we'll simply + //take the document's dimensions and communicate these to the printer + //driver + + GtkPaperSize *page_size = gtk_paper_size_new_custom("custom", "custom", doc_width, doc_height, GTK_UNIT_POINTS); + + gtk_page_setup_set_paper_size (page_setup, page_size); + GtkPrintJob* job = gtk_print_job_new (jobname, printer, - gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(dlg)), - page_setup); - - GtkPaperSize* tmp = gtk_page_setup_get_paper_size(gtk_print_unix_dialog_get_page_setup(GTK_PRINT_UNIX_DIALOG(dlg))); - + gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(dlg)), + page_setup); + + GtkPaperSize* tmp = gtk_page_setup_get_paper_size(gtk_print_unix_dialog_get_page_setup(GTK_PRINT_UNIX_DIALOG(dlg))); + (void)tmp; + GError * error = NULL; if ( gtk_print_job_set_source_file (job, ps_file, &error)) { gtk_print_job_send (job, unix_print_complete, NULL, NULL); @@ -282,11 +283,11 @@ sp_print_document(SPDocument *doc, unsigned int direct) #ifdef HAVE_GTK_UNIX_PRINT // redirect output to new print dialog - + // width and height in pt gdouble width = sp_document_width(doc) * PT_PER_PX; gdouble height = sp_document_height(doc) * PT_PER_PX; - + unix_print_dialog(tmpfile.c_str(),doc->name ? doc->name : _("SVG Document"), width, height); unlink(tmpfile.c_str()); // end redirected new print dialog diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index ce14bd0f5..95a2cac0d 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -105,7 +105,7 @@ void sp_selection_copy_one (Inkscape::XML::Node *repr, NR::Matrix full_t, GSList sp_repr_css_attr_unref(css); // write the complete accumulated transform passed to us - // (we're dealing with unattached repr, so we write to its attr + // (we're dealing with unattached repr, so we write to its attr // instead of using sp_item_set_transform) gchar *affinestr=sp_svg_transform_write(full_t); copy->setAttribute("transform", affinestr); @@ -250,7 +250,7 @@ void sp_selection_delete() */ tools_switch ( desktop, tools_active ( desktop ) ); - sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DELETE, + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DELETE, _("Delete")); } @@ -290,7 +290,7 @@ void sp_selection_duplicate() Inkscape::GC::release(copy); } - sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE, + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE, _("Duplicate")); selection->setReprList(newsel); @@ -512,7 +512,7 @@ void sp_selection_group() // Move to the position of the topmost, reduced by the number of items deleted from topmost_parent group->setPosition(topmost + 1); - sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP, + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP, _("Group")); selection->set(group); @@ -574,7 +574,7 @@ void sp_selection_ungroup() g_slist_free(items); - sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP, + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP, _("Ungroup")); } @@ -716,7 +716,7 @@ void sp_selection_raise_to_top() g_slist_free(rl); - sp_document_done(document, SP_VERB_SELECTION_TO_FRONT, + sp_document_done(document, SP_VERB_SELECTION_TO_FRONT, _("Raise to top")); } @@ -780,7 +780,7 @@ sp_selection_lower() g_slist_free(rev); } - sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER, + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER, _("Lower")); } @@ -828,7 +828,7 @@ void sp_selection_lower_to_bottom() g_slist_free(rl); - sp_document_done(document, SP_VERB_SELECTION_TO_BACK, + sp_document_done(document, SP_VERB_SELECTION_TO_BACK, _("Lower to bottom")); } @@ -1168,7 +1168,7 @@ void sp_selection_paste(bool in_place) sp_selection_move_relative(selection, m); } - sp_document_done(document, SP_VERB_EDIT_PASTE, + sp_document_done(document, SP_VERB_EDIT_PASTE, _("Paste")); } @@ -1356,7 +1356,7 @@ void sp_selection_to_next_layer () g_slist_free (copied); if (temp_clip) g_slist_free (temp_clip); if (next) dt->setCurrentLayer(next); - sp_document_done(sp_desktop_document (dt), SP_VERB_LAYER_MOVE_TO_NEXT, + sp_document_done(sp_desktop_document (dt), SP_VERB_LAYER_MOVE_TO_NEXT, _("Raise to next layer")); } else { no_more = true; @@ -1418,7 +1418,7 @@ bool selection_contains_original (SPItem *item, Inkscape::Selection *selection) { bool contains_original = false; - + bool is_use = SP_IS_USE(item); SPItem *item_use = item; SPItem *item_use_first = item; @@ -1430,13 +1430,13 @@ selection_contains_original (SPItem *item, Inkscape::Selection *selection) break; is_use = SP_IS_USE(item_use); } - + // If it's a tref, check whether the object containing the character // data is part of the selection if (!contains_original && SP_IS_TREF(item)) { contains_original = selection->includes(SP_TREF(item)->getObjectReferredTo()); } - + return contains_original; } @@ -1448,7 +1448,7 @@ selection_contains_both_clone_and_original (Inkscape::Selection *selection) for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { SPItem *item = SP_ITEM(l->data); clone_with_original |= selection_contains_original(item, selection); - if (clone_with_original) + if (clone_with_original) break; } return clone_with_original; @@ -1486,21 +1486,21 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, NR::Matrix const bool transform_flowtext_with_frame = (SP_IS_FLOWTEXT(item) && selection->includes( SP_FLOWTEXT(item)->get_frame (NULL))); // (only the first frame is checked so far) // ...both an offset and its source? bool transform_offset_with_source = (SP_IS_OFFSET(item) && SP_OFFSET (item)->sourceHref) && selection->includes( sp_offset_get_source (SP_OFFSET(item)) ); - + // If we're moving a connector, we want to detach it // from shapes that aren't part of the selection, but // leave it attached if they are if (cc_item_is_connector(item)) { SPItem *attItem[2]; SP_PATH(item)->connEndPair.getAttachedItems(attItem); - + for (int n = 0; n < 2; ++n) { if (!selection->includes(attItem[n])) { sp_conn_end_detach(item, n); } } } - + // "clones are unmoved when original is moved" preference int compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED); bool prefs_unmoved = (compensation == SP_CLONE_COMPENSATION_UNMOVED); @@ -1594,7 +1594,7 @@ void sp_selection_remove_transform() l = l->next; } - sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_FLATTEN, + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_FLATTEN, _("Remove transform")); } @@ -1703,7 +1703,7 @@ void sp_selection_rotate_90_cw() sp_item_rotate_rel(item, rot_neg_90); } - sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_ROTATE_90_CCW, + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_ROTATE_90_CCW, _("Rotate 90° CW")); } @@ -1751,8 +1751,8 @@ sp_selection_rotate(Inkscape::Selection *selection, gdouble const angle_degrees) sp_document_maybe_done(sp_desktop_document(selection->desktop()), ( ( angle_degrees > 0 ) ? "selector:rotate:ccw" - : "selector:rotate:cw" ), - SP_VERB_CONTEXT_SELECT, + : "selector:rotate:cw" ), + SP_VERB_CONTEXT_SELECT, _("Rotate")); } @@ -1784,7 +1784,7 @@ sp_selection_rotate_screen(Inkscape::Selection *selection, gdouble angle) ( (angle > 0) ? "selector:rotate:ccw" : "selector:rotate:cw" ), - SP_VERB_CONTEXT_SELECT, + SP_VERB_CONTEXT_SELECT, _("Rotate by pixels")); } @@ -1839,7 +1839,7 @@ sp_selection_scale_times(Inkscape::Selection *selection, gdouble times) NR::Point const center(sel_bbox->midpoint()); sp_selection_scale_relative(selection, center, NR::scale(times, times)); - sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_CONTEXT_SELECT, + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_CONTEXT_SELECT, _("Scale by whole factor")); } @@ -1855,13 +1855,13 @@ sp_selection_move(gdouble dx, gdouble dy) sp_selection_move_relative(selection, dx, dy); if (dx == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically")); } else if (dy == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, _("Move horizontally")); } else { - sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, _("Move")); } } @@ -1883,13 +1883,13 @@ sp_selection_move_screen(gdouble dx, gdouble dy) sp_selection_move_relative(selection, zdx, zdy); if (dx == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, _("Move vertically by pixels")); } else if (dy == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, _("Move horizontally by pixels")); } else { - sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, _("Move")); } } @@ -1909,7 +1909,7 @@ struct Forward { static Iterator children(SPObject *o) { return sp_object_first_child(o); } static Iterator siblings_after(SPObject *o) { return SP_OBJECT_NEXT(o); } - static void dispose(Iterator i) {} + static void dispose(Iterator /*i*/) {} static SPObject *object(Iterator i) { return i; } static Iterator next(Iterator i) { return SP_OBJECT_NEXT(i); } @@ -2142,14 +2142,14 @@ sp_selection_clone() } GSList *reprs = g_slist_copy((GSList *) selection->reprList()); - + selection->clear(); - + // sorting items from different parents sorts each parent's subset without possibly mixing them, just what we need reprs = g_slist_sort(reprs, (GCompareFunc) sp_repr_compare_position); GSList *newsel = NULL; - + while (reprs) { Inkscape::XML::Node *sel_repr = (Inkscape::XML::Node *) reprs->data; Inkscape::XML::Node *parent = sp_repr_parent(sel_repr); @@ -2161,7 +2161,7 @@ sp_selection_clone() sp_repr_set_attr(clone, "inkscape:transform-center-x", sel_repr->attribute("inkscape:transform-center-x")); sp_repr_set_attr(clone, "inkscape:transform-center-y", sel_repr->attribute("inkscape:transform-center-y")); - + // add the new clone to the top of the original's parent parent->appendChild(clone); @@ -2169,14 +2169,14 @@ sp_selection_clone() reprs = g_slist_remove(reprs, sel_repr); Inkscape::GC::release(clone); } - + // TRANSLATORS: only translate "string" in "context|string". // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE, + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE, Q_("action|Clone")); selection->setReprList(newsel); - + g_slist_free(newsel); } @@ -2205,11 +2205,11 @@ sp_selection_unlink() if (SP_IS_TEXT(item)) { SPObject *tspan = sp_tref_convert_to_tspan(SP_OBJECT(item)); - - if (tspan) { + + if (tspan) { SP_OBJECT(item)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } - + // Set unlink to true, and fall into the next if which // will include this text item in the new selection unlinked = true; @@ -2222,12 +2222,12 @@ sp_selection_unlink() } SPItem *unlink; - if (SP_IS_USE(item)) { + if (SP_IS_USE(item)) { unlink = sp_use_unlink(SP_USE(item)); } else /*if (SP_IS_TREF(use))*/ { unlink = SP_ITEM(sp_tref_convert_to_tspan(SP_OBJECT(item))); } - + unlinked = true; // Add ungrouped items to the new selection. new_select = g_slist_prepend(new_select, unlink); @@ -2340,6 +2340,7 @@ void sp_selection_to_marker(bool apply) // remember the position of the first item gint pos = SP_OBJECT_REPR (items->data)->position(); + (void)pos; // TODO check why this was remembered // create a list of duplicates GSList *repr_copies = NULL; @@ -2369,6 +2370,7 @@ void sp_selection_to_marker(bool apply) r->max()[NR::Y])))) * parent_transform.inverse() ), parent_transform * move); + (void)mark_id; // restore compensation setting prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); @@ -2478,7 +2480,7 @@ sp_selection_tile(bool apply) g_slist_free (items); - sp_document_done (doc, SP_VERB_EDIT_TILE, + sp_document_done (doc, SP_VERB_EDIT_TILE, _("Objects to pattern")); } @@ -2551,14 +2553,14 @@ sp_selection_untile() if (!did) { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No pattern fills in the selection.")); } else { - sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNTILE, + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNTILE, _("Pattern to objects")); selection->setList(new_select); } } void -sp_selection_get_export_hints (Inkscape::Selection *selection, char const **filename, float *xdpi, float *ydpi) +sp_selection_get_export_hints (Inkscape::Selection *selection, char const **filename, float *xdpi, float *ydpi) { if (selection->isEmpty()) { return; @@ -2739,7 +2741,7 @@ sp_selection_create_bitmap_copy () NR::Matrix t; double shift_x = bbox.x0; - double shift_y = bbox.y1; + double shift_y = bbox.y1; if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid shift_x = round (shift_x); shift_y = -round (-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone @@ -2815,7 +2817,7 @@ sp_selection_create_bitmap_copy () * and is applied to current layer * otherwise, topmost object is used as mask for other objects * If \a apply_clip_path parameter is true, clipPath is created, otherwise mask - * + * */ void sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) @@ -2826,7 +2828,7 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); - + Inkscape::Selection *selection = sp_desktop_selection(desktop); // check if something is selected @@ -2839,18 +2841,18 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) return; } - // FIXME: temporary patch to prevent crash! + // FIXME: temporary patch to prevent crash! // Remove this when bboxes are fixed to not blow up on an item clipped/masked with its own clone bool clone_with_original = selection_contains_both_clone_and_original (selection); if (clone_with_original) { return; // in this version, you cannot clip/mask an object with its own clone } // /END FIXME - + sp_document_ensure_up_to_date(doc); GSList *items = g_slist_copy((GSList *) selection->itemList()); - + items = g_slist_sort (items, (GCompareFunc) sp_object_compare_position); // create a list of duplicates @@ -2859,7 +2861,7 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) GSList *items_to_delete = NULL; bool topmost = prefs_get_int_attribute ("options.maskobject", "topmost", 1); bool remove_original = prefs_get_int_attribute ("options.maskobject", "remove", 1); - + if (apply_to_layer) { // all selected items are used for mask, which is applied to a layer apply_to_items = g_slist_prepend (apply_to_items, desktop->currentLayer()); @@ -2883,7 +2885,7 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) SPObject *item = SP_OBJECT (i->data); items_to_delete = g_slist_prepend (items_to_delete, item); } - + for (i = i->next; i != NULL; i = i->next) { apply_to_items = g_slist_prepend (apply_to_items, i->data); } @@ -2901,10 +2903,10 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) items_to_delete = g_slist_prepend (items_to_delete, item); } } - + g_slist_free (items); items = NULL; - + gchar const *attributeName = apply_clip_path ? "clip-path" : "mask"; for (GSList *i = apply_to_items; NULL != i; i = i->next) { SPItem *item = reinterpret_cast(i->data); @@ -2940,9 +2942,9 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) } g_slist_free (items_to_delete); - if (apply_clip_path) + if (apply_clip_path) sp_document_done (doc, SP_VERB_OBJECT_SET_CLIPPATH, _("Set clipping path")); - else + else sp_document_done (doc, SP_VERB_OBJECT_SET_MASK, _("Set mask")); } @@ -2950,8 +2952,8 @@ void sp_selection_unset_mask(bool apply_clip_path) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (desktop == NULL) return; - - SPDocument *doc = sp_desktop_document(desktop); + + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2960,7 +2962,7 @@ void sp_selection_unset_mask(bool apply_clip_path) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to remove clippath or mask from.")); return; } - + bool remove_original = prefs_get_int_attribute ("options.maskobject", "remove", 1); sp_document_ensure_up_to_date(doc); @@ -2971,7 +2973,7 @@ void sp_selection_unset_mask(bool apply_clip_path) { // remember referenced mask/clippath, so orphaned masks can be moved back to document SPItem *item = reinterpret_cast(i->data); Inkscape::URIReference *uri_ref = NULL; - + if (apply_clip_path) { uri_ref = item->clip_ref; } else { @@ -3024,9 +3026,9 @@ void sp_selection_unset_mask(bool apply_clip_path) { g_slist_free (items_to_move); } - if (apply_clip_path) + if (apply_clip_path) sp_document_done (doc, SP_VERB_OBJECT_UNSET_CLIPPATH, _("Release clipping path")); - else + else sp_document_done (doc, SP_VERB_OBJECT_UNSET_MASK, _("Release mask")); } @@ -3071,7 +3073,7 @@ void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) { fit_canvas_to_selection(desktop); } - sp_document_done(doc, SP_VERB_FIT_CANVAS_TO_DRAWING, + sp_document_done(doc, SP_VERB_FIT_CANVAS_TO_DRAWING, _("Fit page to selection")); }; @@ -3088,7 +3090,7 @@ static void itemtree_map(void (*f)(SPItem *, SPDesktop *), SPObject *root, SPDes } } -static void unlock(SPItem *item, SPDesktop *desktop) { +static void unlock(SPItem *item, SPDesktop */*desktop*/) { if (item->isLocked()) { item->setLocked(FALSE); } @@ -3102,14 +3104,14 @@ static void unhide(SPItem *item, SPDesktop *desktop) { static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, bool layer_only) { if (!dt) return; - + SPObject *root; if (layer_only) { root = dt->currentLayer(); } else { root = dt->currentRoot(); } - + itemtree_map(f, root, dt); } diff --git a/src/seltrans.cpp b/src/seltrans.cpp index c680e0cd3..b95e70c4a 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -96,7 +96,7 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : { gchar const *prefs_bbox = prefs_get_string_attribute("tools.select", "bounding_box"); _snap_bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX; - + g_return_if_fail(desktop != NULL); for (int i = 0; i < 8; i++) { @@ -258,12 +258,12 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho _current.set_identity(); _point = p; - + // The selector tool should snap the bbox and the special snappoints, but not path nodes // (The special points are the handles, center, rotation axis, font baseline, ends of spiral, etc.) // First, determine the bounding box for snapping ... - _bbox = selection->bounds(_snap_bbox_type); + _bbox = selection->bounds(_snap_bbox_type); _approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX); // Used for correctly scaling the strokewidth @@ -273,14 +273,14 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho std::vector snap_points_hull = selection->getSnapPointsConvexHull(); // Includes path nodes if (_snap_points.size() > 100) { /* Snapping a huge number of nodes will take way too long, so limit the number of snappable nodes - An average user would rarely ever try to snap such a large number of nodes anyway, because + An average user would rarely ever try to snap such a large number of nodes anyway, because (s)he could hardly discern which node would be snapping */ _snap_points = snap_points_hull; // Unfortunately, by now we will have lost the font-baseline snappoints :-( } - + // Find bbox hulling all special points, which excludes stroke width. Here we need to include the - // path nodes, for example because a rectangle which has been converted to a path doesn't have + // path nodes, for example because a rectangle which has been converted to a path doesn't have // any other special points NR::Rect snap_points_bbox; if ( snap_points_hull.empty() == false ) { @@ -292,7 +292,7 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho i++; } } - + _bbox_points.clear(); if (_bbox) { // ... and add the bbox corners to _bbox_points @@ -303,28 +303,28 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho // - one for snapping the boundingbox, which can be either visual or geometric // - one for snapping the special points // The "opposite" in case of a geometric boundingbox always coincides with the "opposite" for the special points - // These distinct "opposites" are needed in the snapmanager to avoid bugs such as #1540195 (in which + // These distinct "opposites" are needed in the snapmanager to avoid bugs such as #1540195 (in which // a box is caught between to guides) _opposite_for_bboxpoints = _bbox->min() + _bbox->dimensions() * NR::scale(1-x, 1-y); _opposite_for_specpoints = (snap_points_bbox.min() + (snap_points_bbox.dimensions() * NR::scale(1-x, 1-y) ) ); // Only a single "opposite" can be used in calculating transformations. _opposite = _opposite_for_bboxpoints; } - + // The lines below are usefull for debugging any snapping issues, as they'll spit out all points that are considered for snapping - + /*std::cout << "Number of snap points: " << _snap_points.size() << std::endl; for (std::vector::const_iterator i = _snap_points.begin(); i != _snap_points.end(); i++) { std::cout << " " << *i << std::endl; } - + std::cout << "Number of bbox points: " << _bbox_points.size() << std::endl; for (std::vector::const_iterator i = _bbox_points.begin(); i != _bbox_points.end(); i++) { std::cout << " " << *i << std::endl; }*/ - + if ((x != -1) && (y != -1)) { sp_canvas_item_show(_norm); sp_canvas_item_show(_grip); @@ -601,7 +601,7 @@ void Inkscape::SelTrans::_updateVolatileState() //Update the bboxes _bbox = selection->bounds(_snap_bbox_type); _approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX); - + if (!_bbox) { _empty = true; return; @@ -667,7 +667,7 @@ static void sp_sel_trans_handle_grab(SPKnot *knot, guint state, gpointer data) ); } -static void sp_sel_trans_handle_ungrab(SPKnot *knot, guint state, gpointer data) +static void sp_sel_trans_handle_ungrab(SPKnot *knot, guint /*state*/, gpointer /*data*/) { SP_SELECT_CONTEXT(knot->desktop->event_context)->_seltrans->ungrab(); } @@ -693,7 +693,7 @@ static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data) ); } -void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle const &handle) +void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHandle const &handle) { switch (handle.anchor) { case GTK_ANCHOR_CENTER: @@ -706,7 +706,7 @@ void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle _center_is_set = false; // center has changed _updateHandles(); } - sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, + sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Reset center")); } break; @@ -715,7 +715,7 @@ void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle } } -void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint state, SPSelTransHandle const &handle) +void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHandle const &handle) { switch (handle.anchor) { case GTK_ANCHOR_CENTER: @@ -788,14 +788,14 @@ gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, NR::Point *position, gu } -void Inkscape::SelTrans::_selChanged(Inkscape::Selection *selection) +void Inkscape::SelTrans::_selChanged(Inkscape::Selection */*selection*/) { if (!_grabbed) { // reread in case it changed on the fly: gchar const *prefs_bbox = prefs_get_string_attribute("tools.select", "bounding_box"); _snap_bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX; //SPItem::APPROXIMATE_BBOX will be replaced by SPItem::VISUAL_BBOX, as soon as the latter is implemented properly - + _updateVolatileState(); _current.set_identity(); _center_is_set = false; // center(s) may have changed @@ -803,7 +803,7 @@ void Inkscape::SelTrans::_selChanged(Inkscape::Selection *selection) } } -void Inkscape::SelTrans::_selModified(Inkscape::Selection *selection, guint flags) +void Inkscape::SelTrans::_selModified(Inkscape::Selection */*selection*/, guint /*flags*/) { if (!_grabbed) { _updateVolatileState(); @@ -880,9 +880,9 @@ gboolean Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) if (state & GDK_MOD1_MASK) { // scale by an integer multiplier/divider for ( unsigned int i = 0 ; i < 2 ; i++ ) { - if (fabs(s[i]) > 1) + if (fabs(s[i]) > 1) s[i] = round(s[i]); - else + else s[i] = 1/round(1/(MIN(s[i], 10))); } } @@ -906,7 +906,7 @@ gboolean Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) } else { s[NR::Y] = fabs(s[NR::X]) * sign(s[NR::Y]); } - + // Snap along a suitable constraint vector from the origin. // The inclination of the constraint vector is calculated from the aspect ratio @@ -946,7 +946,7 @@ gboolean Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) } else { /* Scale aspect ratio is unlocked */ - + std::pair bb = m.freeSnapScale(Snapper::SNAPPOINT_BBOX, _bbox_points, it, @@ -1016,9 +1016,9 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR:: } if (state & GDK_MOD1_MASK) { // scale by an integer multiplier/divider - if (fabs(s[axis]) > 1) + if (fabs(s[axis]) > 1) s[axis] = round(s[axis]); - else + else s[axis] = 1/round(1/(MIN(s[axis], 10))); } @@ -1061,7 +1061,7 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR:: s[axis] = fabs(ratio) * sign(s[axis]); s[perp] = fabs(s[axis]); } else { - + std::pair const bb = m.freeSnapStretch( Snapper::SNAPPOINT_BBOX, _bbox_points, @@ -1165,7 +1165,7 @@ gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, NR::Poi skew[dim_a], _origin_for_specpoints, dim_b); - + if (bb.second || sn.second) { /* We snapped something, so change the skew to reflect it */ NR::Coord const bd = bb.second ? bb.first : NR_HUGE; @@ -1370,7 +1370,7 @@ void Inkscape::SelTrans::stretch(SPSelTransHandle const &handle, NR::Point &pt, transform(scaler, NR::Point(0, 0)); // we have already accounted for origin, so pass 0,0 } -void Inkscape::SelTrans::scale(NR::Point &pt, guint state) +void Inkscape::SelTrans::scale(NR::Point &pt, guint /*state*/) { if (!_bbox) { return; @@ -1385,10 +1385,10 @@ void Inkscape::SelTrans::scale(NR::Point &pt, guint state) if (fabs(s[i]) < 1e-9) s[i] = 1e-9; } - + NR::Point new_bbox_min = _approximate_bbox->min() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin)); NR::Point new_bbox_max = _approximate_bbox->max() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin)); - + int transform_stroke = false; gdouble strokewidth = 0; @@ -1396,14 +1396,14 @@ void Inkscape::SelTrans::scale(NR::Point &pt, guint state) transform_stroke = prefs_get_int_attribute ("options.transform", "stroke", 1); strokewidth = _strokewidth; } - + NR::Matrix scaler = get_scale_transform_with_stroke (*_approximate_bbox, strokewidth, transform_stroke, new_bbox_min[NR::X], new_bbox_min[NR::Y], new_bbox_max[NR::X], new_bbox_max[NR::Y]); - + transform(scaler, NR::Point(0, 0)); // we have already accounted for origin, so pass 0,0 } -void Inkscape::SelTrans::skew(SPSelTransHandle const &handle, NR::Point &pt, guint state) +void Inkscape::SelTrans::skew(SPSelTransHandle const &handle, NR::Point &pt, guint /*state*/) { NR::Point const offset = _point - _origin; @@ -1437,7 +1437,7 @@ void Inkscape::SelTrans::skew(SPSelTransHandle const &handle, NR::Point &pt, gui transform(skew, _origin); } -void Inkscape::SelTrans::rotate(NR::Point &pt, guint state) +void Inkscape::SelTrans::rotate(NR::Point &pt, guint /*state*/) { NR::Point const offset = _point - _origin; @@ -1458,7 +1458,7 @@ void Inkscape::SelTrans::rotate(NR::Point &pt, guint state) transform(rotate, _origin); } -void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, NR::Point &pt, guint state) +void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, NR::Point &pt, guint /*state*/) { seltrans->setCenter(pt); } @@ -1511,7 +1511,7 @@ void Inkscape::SelTrans::moveTo(NR::Point const &xy, guint state) it, Inkscape::Snapper::ConstraintLine(component_vectors[dim]), dxy)); - + s.push_back(m.constrainedSnapTranslation(Inkscape::Snapper::SNAPPOINT_NODE, _snap_points, it, @@ -1525,13 +1525,13 @@ void Inkscape::SelTrans::moveTo(NR::Point const &xy, guint state) /* GTimeVal starttime; GTimeVal endtime; g_get_current_time(&starttime); */ - + /* Snap to things with no constraint */ s.push_back(m.freeSnapTranslation(Inkscape::Snapper::SNAPPOINT_BBOX, _bbox_points, it, dxy)); s.push_back(m.freeSnapTranslation(Inkscape::Snapper::SNAPPOINT_NODE, _snap_points, it, dxy)); - + /*g_get_current_time(&endtime); double elapsed = ((((double)endtime.tv_sec - starttime.tv_sec) * G_USEC_PER_SEC + (endtime.tv_usec - starttime.tv_usec))) / 1000.0; std::cout << "Time spent snapping: " << elapsed << std::endl; */ diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index 508d2228d..7fa400092 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -31,7 +31,7 @@ #include "shape-editor.h" -ShapeEditorsCollective::ShapeEditorsCollective(SPDesktop *dt) { +ShapeEditorsCollective::ShapeEditorsCollective(SPDesktop */*dt*/) { } ShapeEditorsCollective::~ShapeEditorsCollective() { @@ -94,9 +94,9 @@ bool ShapeEditor::has_knotholder () { } bool ShapeEditor::has_local_change () { - if (this->nodepath) + if (this->nodepath) return (this->nodepath->local_change != 0); - else if (this->knotholder) + else if (this->knotholder) return (this->knotholder->local_change != 0); else return false; @@ -140,9 +140,9 @@ bool ShapeEditor::nodepath_edits_repr_key(gchar const *name) { return false; } -static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar const *name, - gchar const *old_value, gchar const *new_value, - bool is_interactive, gpointer data) +static void shapeeditor_event_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *name, + gchar const */*old_value*/, gchar const */*new_value*/, + bool /*is_interactive*/, gpointer data) { gboolean changed = FALSE; @@ -151,7 +151,7 @@ static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar cons if ( sh->has_knotholder() || ( sh->has_nodepath() && sh->nodepath_edits_repr_key(name) ) ) { - changed = !sh->has_local_change(); + changed = !sh->has_local_change(); sh->decrement_local_change(); } @@ -190,7 +190,7 @@ void ShapeEditor::set_item(SPItem *item) { if (item) { this->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0)); if (this->nodepath) { - this->nodepath->shape_editor = this; + this->nodepath->shape_editor = this; } this->knotholder = sp_item_knot_holder(item, desktop); @@ -221,11 +221,11 @@ void ShapeEditor::set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeo if (lpeobject) { this->knotholder = NULL; // it's a path, no special knotholder needed. - this->nodepath = sp_nodepath_new( desktop, lpeobject, + this->nodepath = sp_nodepath_new( desktop, lpeobject, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0), key, item); if (this->nodepath) { - this->nodepath->shape_editor = this; + this->nodepath->shape_editor = this; // setting new listener Inkscape::XML::Node *repr = SP_OBJECT_REPR(lpeobject); @@ -264,7 +264,7 @@ void ShapeEditor::update_statusbar () { bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) { - if (!this->nodepath) + if (!this->nodepath) return false; // no stroke in knotholder SPItem *item = get_item(); @@ -451,11 +451,11 @@ void ShapeEditor::scale_nodes_screen(gdouble const grow, int const which) { } void ShapeEditor::select_all (bool invert) { - if (this->nodepath) + if (this->nodepath) sp_nodepath_select_all (this->nodepath, invert); } void ShapeEditor::select_all_from_subpath (bool invert) { - if (this->nodepath) + if (this->nodepath) sp_nodepath_select_all_from_subpath (this->nodepath, invert); } void ShapeEditor::select_next () { @@ -482,16 +482,16 @@ void ShapeEditor::show_handles (bool show) { void ShapeEditor::flip (NR::Dim2 axis, NR::Maybe center) { - if (this->nodepath) + if (this->nodepath) sp_nodepath_flip (this->nodepath, axis, center); } void ShapeEditor::distribute (NR::Dim2 axis) { - if (this->nodepath) + if (this->nodepath) sp_nodepath_selected_distribute (this->nodepath, axis); } void ShapeEditor::align (NR::Dim2 axis) { - if (this->nodepath) + if (this->nodepath) sp_nodepath_selected_align (this->nodepath, axis); } diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 3a55c52f7..f21a15cdf 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -164,9 +164,9 @@ sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape:: if (SP_IS_ITEM(ochild)) { SPClipPath *cp = SP_CLIPPATH(object); for (SPClipPathView *v = cp->display; v != NULL; v = v->next) { - NRArenaItem *ac = sp_item_invoke_show(SP_ITEM(ochild), - NR_ARENA_ITEM_ARENA(v->arenaitem), - v->key, + NRArenaItem *ac = sp_item_invoke_show(SP_ITEM(ochild), + NR_ARENA_ITEM_ARENA(v->arenaitem), + v->key, SP_ITEM_REFERENCE_FLAGS); if (ac) { nr_arena_item_add_child(v->arenaitem, ac, NULL); @@ -328,14 +328,14 @@ sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox) } void -sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, NR::Matrix const &transform, unsigned const flags) +sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, NR::Matrix const &transform, unsigned const /*flags*/) { - SPObject *i; + SPObject *i; for (i = sp_object_first_child(SP_OBJECT(cp)); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i)); if (!i) return; sp_item_invoke_bbox_full(SP_ITEM(i), bbox, NR::Matrix(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE); - SPObject *i_start = i; + SPObject *i_start = i; while (i != NULL) { if (i != i_start) { @@ -391,22 +391,22 @@ sp_clippath_create (GSList *reprs, SPDocument *document, NR::Matrix const* apply Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *repr = xml_doc->createElement("svg:clipPath"); repr->setAttribute("clipPathUnits", "userSpaceOnUse"); - + defsrepr->appendChild(repr); const gchar *id = repr->attribute("id"); SPObject *clip_path_object = document->getObjectById(id); - + for (GSList *it = reprs; it != NULL; it = it->next) { Inkscape::XML::Node *node = (Inkscape::XML::Node *)(it->data); SPItem *item = SP_ITEM(clip_path_object->appendChildRepr(node)); - + if (NULL != applyTransform) { NR::Matrix transform (item->transform); transform *= (*applyTransform); sp_item_write_transform(item, SP_OBJECT_REPR(item), transform); } } - + Inkscape::GC::release(repr); return id; } diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index 7c8527776..d13ef9e86 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -77,7 +77,7 @@ sp_conn_end_pair_build(SPObject *object) static void -avoid_conn_move(NR::Matrix const *mp, SPItem *moved_item) +avoid_conn_move(NR::Matrix const */*mp*/, SPItem *moved_item) { // Reroute connector SPPath *path = SP_PATH(moved_item); @@ -141,7 +141,7 @@ SPConnEndPair::getAttachedItems(SPItem *h2attItem[2]) const { h2attItem[h] = this->_connEnd[h]->ref.getObject(); // Deal with the case of the attached object being an empty group. - // A group containing no items does not have a valid bbox, so + // A group containing no items does not have a valid bbox, so // causes problems for the auto-routing code. Also, since such a // group no longer has an onscreen representation and can only be // selected through the XML editor, it makes sense just to detach diff --git a/src/sp-conn-end.cpp b/src/sp-conn-end.cpp index dd6497526..3840daf97 100644 --- a/src/sp-conn-end.cpp +++ b/src/sp-conn-end.cpp @@ -34,7 +34,7 @@ get_nearest_common_ancestor(SPObject const *const obj, SPItem const *const objs[ } static void -sp_conn_end_move_compensate(NR::Matrix const *mp, SPItem *moved_item, +sp_conn_end_move_compensate(NR::Matrix const */*mp*/, SPItem */*moved_item*/, SPPath *const path, bool const updatePathRepr = true) { @@ -277,7 +277,7 @@ SPConnEnd::setAttacherHref(gchar const *value) } void -sp_conn_end_href_changed(SPObject *old_ref, SPObject *ref, +sp_conn_end_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPConnEnd *connEndPtr, SPPath *const path, unsigned const handle_ix) { g_return_if_fail(connEndPtr != NULL); diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp index 5a8dce6df..35324c62f 100644 --- a/src/sp-defs.cpp +++ b/src/sp-defs.cpp @@ -64,7 +64,7 @@ static void sp_defs_class_init(SPDefsClass *dc) sp_object_class->write = sp_defs_write; } -static void sp_defs_init(SPDefs *defs) +static void sp_defs_init(SPDefs */*defs*/) { } diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index f558bc229..7a1b0f33e 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -382,7 +382,7 @@ static void sp_ellipse_class_init(SPEllipseClass *klass) } static void -sp_ellipse_init(SPEllipse *ellipse) +sp_ellipse_init(SPEllipse */*ellipse*/) { /* Nothing special */ } @@ -457,7 +457,7 @@ sp_ellipse_set(SPObject *object, unsigned int key, gchar const *value) } } -static gchar *sp_ellipse_description(SPItem *item) +static gchar *sp_ellipse_description(SPItem */*item*/) { return g_strdup(_("Ellipse")); } @@ -531,7 +531,7 @@ sp_circle_class_init(SPCircleClass *klass) } static void -sp_circle_init(SPCircle *circle) +sp_circle_init(SPCircle */*circle*/) { /* Nothing special */ } @@ -599,7 +599,7 @@ sp_circle_set(SPObject *object, unsigned int key, gchar const *value) } } -static gchar *sp_circle_description(SPItem *item) +static gchar *sp_circle_description(SPItem */*item*/) { return g_strdup(_("Circle")); } @@ -657,7 +657,7 @@ sp_arc_class_init(SPArcClass *klass) } static void -sp_arc_init(SPArc *arc) +sp_arc_init(SPArc */*arc*/) { /* Nothing special */ } diff --git a/src/sp-fecolormatrix.cpp b/src/sp-fecolormatrix.cpp index d8d931db1..f13e12809 100644 --- a/src/sp-fecolormatrix.cpp +++ b/src/sp-fecolormatrix.cpp @@ -67,7 +67,7 @@ sp_feColorMatrix_class_init(SPFeColorMatrixClass *klass) { SPObjectClass *sp_object_class = (SPObjectClass *)klass; SPFilterPrimitiveClass *sp_primitive_class = (SPFilterPrimitiveClass *)klass; - + feColorMatrix_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass); sp_object_class->build = sp_feColorMatrix_build; @@ -79,7 +79,7 @@ sp_feColorMatrix_class_init(SPFeColorMatrixClass *klass) } static void -sp_feColorMatrix_init(SPFeColorMatrix *feColorMatrix) +sp_feColorMatrix_init(SPFeColorMatrix */*feColorMatrix*/) { } @@ -124,7 +124,7 @@ static NR::FilterColorMatrixType sp_feColorMatrix_read_type(gchar const *value){ break; case 'l': if (strcmp(value, "luminanceToAlpha") == 0) return NR::COLORMATRIX_LUMINANCETOALPHA; - break; + break; } return NR::COLORMATRIX_MATRIX; //matrix is default } @@ -149,7 +149,7 @@ sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *str) } break; case SP_ATTR_VALUES: - if (str){ + if (str){ feColorMatrix->values = helperfns_read_vector(str, 20); feColorMatrix->value = helperfns_read_number(str); object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); diff --git a/src/sp-fedistantlight.cpp b/src/sp-fedistantlight.cpp index a878e1ad7..7125b50ab 100644 --- a/src/sp-fedistantlight.cpp +++ b/src/sp-fedistantlight.cpp @@ -170,7 +170,7 @@ sp_fedistantlight_set(SPObject *object, unsigned int key, gchar const *value) } break; default: - // See if any parents need this value. + // See if any parents need this value. if (((SPObjectClass *) feDistantLight_parent_class)->set) { ((SPObjectClass *) feDistantLight_parent_class)->set(object, key, value); } @@ -185,13 +185,14 @@ static void sp_fedistantlight_update(SPObject *object, SPCtx *ctx, guint flags) { SPFeDistantLight *feDistantLight = SP_FEDISTANTLIGHT(object); + (void)feDistantLight; if (flags & SP_OBJECT_MODIFIED_FLAG) { /* do something to trigger redisplay, updates? */ sp_object_read_attr(object, "azimuth"); sp_object_read_attr(object, "elevation"); } - + if (((SPObjectClass *) feDistantLight_parent_class)->update) { ((SPObjectClass *) feDistantLight_parent_class)->update(object, ctx, flags); } @@ -208,12 +209,12 @@ sp_fedistantlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags if (!repr) { repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME } - + if (fedistantlight->azimuth_set) sp_repr_set_css_double(repr, "azimuth", fedistantlight->azimuth); if (fedistantlight->elevation_set) sp_repr_set_css_double(repr, "elevation", fedistantlight->elevation); - + if (((SPObjectClass *) feDistantLight_parent_class)->write) { ((SPObjectClass *) feDistantLight_parent_class)->write(object, repr, flags); } diff --git a/src/sp-feflood.cpp b/src/sp-feflood.cpp index 837ccf4ae..a9dcb4e71 100644 --- a/src/sp-feflood.cpp +++ b/src/sp-feflood.cpp @@ -63,7 +63,7 @@ sp_feFlood_class_init(SPFeFloodClass *klass) { SPObjectClass *sp_object_class = (SPObjectClass *)klass; SPFilterPrimitiveClass *sp_primitive_class = (SPFilterPrimitiveClass *)klass; - + feFlood_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass); sp_object_class->build = sp_feFlood_build; @@ -75,7 +75,7 @@ sp_feFlood_class_init(SPFeFloodClass *klass) } static void -sp_feFlood_init(SPFeFlood *feFlood) +sp_feFlood_init(SPFeFlood */*feFlood*/) { } @@ -169,6 +169,7 @@ static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, NR::Filter * g_assert(filter != NULL); SPFeFlood *sp_flood = SP_FEFLOOD(primitive); + (void)sp_flood; int primitive_n = filter->add_primitive(NR::NR_FILTER_FLOOD); NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n); diff --git a/src/sp-feimage.cpp b/src/sp-feimage.cpp index 4288faa10..a36015180 100644 --- a/src/sp-feimage.cpp +++ b/src/sp-feimage.cpp @@ -81,7 +81,7 @@ sp_feImage_class_init(SPFeImageClass *klass) } static void -sp_feImage_init(SPFeImage *feImage) +sp_feImage_init(SPFeImage */*feImage*/) { } @@ -98,14 +98,14 @@ sp_feImage_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *re } /*LOAD ATTRIBUTES FROM REPR HERE*/ -/* apparently there's no attribute to load here +/* apparently there's no attribute to load here since 'in' and 'xlink:href' are common filter attributes. --Juca */ sp_object_read_attr(object, "x"); sp_object_read_attr(object, "y"); sp_object_read_attr(object, "width"); - sp_object_read_attr(object, "height"); + sp_object_read_attr(object, "height"); } @@ -128,7 +128,7 @@ sp_feImage_set(SPObject *object, unsigned int key, gchar const *value) { SPFeImage *feImage = SP_FEIMAGE(object); (void)feImage; - + switch(key) { /*DEAL WITH SETTING ATTRIBUTES HERE*/ case SP_ATTR_X: @@ -161,7 +161,7 @@ sp_feImage_set(SPObject *object, unsigned int key, gchar const *value) static void sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags) { - + if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { @@ -201,7 +201,7 @@ static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, NR::Filter * g_assert(filter != NULL); SPFeImage *sp_image = SP_FEIMAGE(primitive); - + int primitive_n = filter->add_primitive(NR::NR_FILTER_IMAGE); NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n); NR::FilterImage *nr_image = dynamic_cast(nr_primitive); diff --git a/src/sp-femerge.cpp b/src/sp-femerge.cpp index dfa664941..3cf5ea312 100644 --- a/src/sp-femerge.cpp +++ b/src/sp-femerge.cpp @@ -78,7 +78,7 @@ sp_feMerge_class_init(SPFeMergeClass *klass) } static void -sp_feMerge_init(SPFeMerge *feMerge) +sp_feMerge_init(SPFeMerge */*feMerge*/) { } @@ -169,6 +169,7 @@ static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, NR::Filter * g_assert(filter != NULL); SPFeMerge *sp_merge = SP_FEMERGE(primitive); + (void)sp_merge; int primitive_n = filter->add_primitive(NR::NR_FILTER_MERGE); NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n); diff --git a/src/sp-femergenode.cpp b/src/sp-femergenode.cpp index 09687e54b..6098fb7b0 100644 --- a/src/sp-femergenode.cpp +++ b/src/sp-femergenode.cpp @@ -82,7 +82,7 @@ sp_feMergeNode_init(SPFeMergeNode *feMergeNode) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feMergeNode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) +sp_feMergeNode_build(SPObject *object, SPDocument */*document*/, Inkscape::XML::Node */*repr*/) { sp_object_read_attr(object, "in"); } diff --git a/src/sp-fepointlight.cpp b/src/sp-fepointlight.cpp index 88af35621..211fb726b 100644 --- a/src/sp-fepointlight.cpp +++ b/src/sp-fepointlight.cpp @@ -85,7 +85,7 @@ sp_fepointlight_init(SPFePointLight *fepointlight) fepointlight->x = 0; fepointlight->y = 0; fepointlight->z = 0; - + fepointlight->x_set = FALSE; fepointlight->y_set = FALSE; fepointlight->z_set = FALSE; @@ -192,7 +192,7 @@ sp_fepointlight_set(SPObject *object, unsigned int key, gchar const *value) } break; default: - // See if any parents need this value. + // See if any parents need this value. if (((SPObjectClass *) fePointLight_parent_class)->set) { ((SPObjectClass *) fePointLight_parent_class)->set(object, key, value); } @@ -207,6 +207,7 @@ static void sp_fepointlight_update(SPObject *object, SPCtx *ctx, guint flags) { SPFePointLight *fePointLight = SP_FEPOINTLIGHT(object); + (void)fePointLight; if (flags & SP_OBJECT_MODIFIED_FLAG) { /* do something to trigger redisplay, updates? */ @@ -214,7 +215,7 @@ sp_fepointlight_update(SPObject *object, SPCtx *ctx, guint flags) sp_object_read_attr(object, "y"); sp_object_read_attr(object, "z"); } - + if (((SPObjectClass *) fePointLight_parent_class)->update) { ((SPObjectClass *) fePointLight_parent_class)->update(object, ctx, flags); } @@ -231,14 +232,14 @@ sp_fepointlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) if (!repr) { repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME } - + if (fepointlight->x_set) sp_repr_set_css_double(repr, "x", fepointlight->x); if (fepointlight->y_set) sp_repr_set_css_double(repr, "y", fepointlight->y); if (fepointlight->z_set) sp_repr_set_css_double(repr, "z", fepointlight->z); - + if (((SPObjectClass *) fePointLight_parent_class)->write) { ((SPObjectClass *) fePointLight_parent_class)->write(object, repr, flags); } diff --git a/src/sp-fespotlight.cpp b/src/sp-fespotlight.cpp index 2730b0d8f..e45b123ed 100644 --- a/src/sp-fespotlight.cpp +++ b/src/sp-fespotlight.cpp @@ -90,7 +90,7 @@ sp_fespotlight_init(SPFeSpotLight *fespotlight) fespotlight->pointsAtZ = 0; fespotlight->specularExponent = 1; fespotlight->limitingConeAngle = 90; - + fespotlight->x_set = FALSE; fespotlight->y_set = FALSE; fespotlight->z_set = FALSE; @@ -151,7 +151,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) { SPFeSpotLight *fespotlight = SP_FESPOTLIGHT(object); gchar *end_ptr; - + switch (key) { case SP_ATTR_X: end_ptr = NULL; @@ -163,7 +163,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->x = 0; fespotlight->x_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -180,7 +180,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->y = 0; fespotlight->y_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -197,7 +197,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->z = 0; fespotlight->z_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -214,7 +214,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->pointsAtX = 0; fespotlight->pointsAtX_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -231,7 +231,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->pointsAtY = 0; fespotlight->pointsAtY_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -248,7 +248,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->pointsAtZ = 0; fespotlight->pointsAtZ_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -265,7 +265,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->specularExponent = 1; fespotlight->specularExponent_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -282,7 +282,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) if(!value || !end_ptr) { fespotlight->limitingConeAngle = 90; fespotlight->limitingConeAngle_set = FALSE; - } + } if (object->parent && (SP_IS_FEDIFFUSELIGHTING(object->parent) || SP_IS_FESPECULARLIGHTING(object->parent))) { @@ -290,7 +290,7 @@ sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value) } break; default: - // See if any parents need this value. + // See if any parents need this value. if (((SPObjectClass *) feSpotLight_parent_class)->set) { ((SPObjectClass *) feSpotLight_parent_class)->set(object, key, value); } @@ -305,6 +305,7 @@ static void sp_fespotlight_update(SPObject *object, SPCtx *ctx, guint flags) { SPFeSpotLight *feSpotLight = SP_FESPOTLIGHT(object); + (void)feSpotLight; if (flags & SP_OBJECT_MODIFIED_FLAG) { /* do something to trigger redisplay, updates? */ @@ -317,7 +318,7 @@ sp_fespotlight_update(SPObject *object, SPCtx *ctx, guint flags) sp_object_read_attr(object, "specularExponent"); sp_object_read_attr(object, "limitingConeAngle"); } - + if (((SPObjectClass *) feSpotLight_parent_class)->update) { ((SPObjectClass *) feSpotLight_parent_class)->update(object, ctx, flags); } @@ -334,7 +335,7 @@ sp_fespotlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) if (!repr) { repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME } - + if (fespotlight->x_set) sp_repr_set_css_double(repr, "x", fespotlight->x); if (fespotlight->y_set) @@ -351,7 +352,7 @@ sp_fespotlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) sp_repr_set_css_double(repr, "specularExponent", fespotlight->specularExponent); if (fespotlight->limitingConeAngle_set) sp_repr_set_css_double(repr, "limitingConeAngle", fespotlight->limitingConeAngle); - + if (((SPObjectClass *) feSpotLight_parent_class)->write) { ((SPObjectClass *) feSpotLight_parent_class)->write(object, repr, flags); } diff --git a/src/sp-fetile.cpp b/src/sp-fetile.cpp index bb86a4627..472c92139 100644 --- a/src/sp-fetile.cpp +++ b/src/sp-fetile.cpp @@ -75,7 +75,7 @@ sp_feTile_class_init(SPFeTileClass *klass) } static void -sp_feTile_init(SPFeTile *feTile) +sp_feTile_init(SPFeTile */*feTile*/) { } @@ -169,6 +169,7 @@ static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, NR::Filter *f g_assert(filter != NULL); SPFeTile *sp_tile = SP_FETILE(primitive); + (void)sp_tile; int primitive_n = filter->add_primitive(NR::NR_FILTER_TILE); NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n); diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 9d2abcddf..e89108d1c 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -109,7 +109,7 @@ sp_filter_init(SPFilter *filter) filter->primitiveUnits_set = FALSE; filter->_renderer = NULL; - + filter->_image_name = map(); filter->filterRes = NumberOptNumber(); @@ -242,7 +242,7 @@ sp_filter_set(SPObject *object, unsigned int key, gchar const *value) } break; default: - // See if any parents need this value. + // See if any parents need this value. if (((SPObjectClass *) filter_parent_class)->set) { ((SPObjectClass *) filter_parent_class)->set(object, key, value); } @@ -362,7 +362,7 @@ filter_ref_changed(SPObject *old_ref, SPObject *ref, SPFilter *filter) if ( SP_IS_FILTER(ref) && ref != filter ) { - filter->modified_connection = + filter->modified_connection = ref->connectModified(sigc::bind(sigc::ptr_fun(&filter_ref_modified), filter)); } @@ -370,7 +370,7 @@ filter_ref_changed(SPObject *old_ref, SPObject *ref, SPFilter *filter) } static void -filter_ref_modified(SPObject *href, guint flags, SPFilter *filter) +filter_ref_modified(SPObject */*href*/, guint /*flags*/, SPFilter *filter) { SP_OBJECT(filter)->requestModified(SP_OBJECT_MODIFIED_FLAG); } diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp index 8c84d6128..308831d28 100644 --- a/src/sp-flowdiv.cpp +++ b/src/sp-flowdiv.cpp @@ -104,7 +104,7 @@ sp_flowdiv_class_init (SPFlowdivClass *klass) } static void -sp_flowdiv_init (SPFlowdiv *group) +sp_flowdiv_init (SPFlowdiv */*group*/) { } @@ -282,7 +282,7 @@ sp_flowtspan_class_init (SPFlowtspanClass *klass) } static void -sp_flowtspan_init (SPFlowtspan *group) +sp_flowtspan_init (SPFlowtspan */*group*/) { } @@ -455,7 +455,7 @@ sp_flowpara_class_init (SPFlowparaClass *klass) } static void -sp_flowpara_init (SPFlowpara *group) +sp_flowpara_init (SPFlowpara */*group*/) { } static void @@ -624,7 +624,7 @@ sp_flowline_class_init (SPFlowlineClass *klass) } static void -sp_flowline_init (SPFlowline *group) +sp_flowline_init (SPFlowline */*group*/) { } static void @@ -701,7 +701,7 @@ sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass) } static void -sp_flowregionbreak_init (SPFlowregionbreak *group) +sp_flowregionbreak_init (SPFlowregionbreak */*group*/) { } static void diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 3981aa9ba..6e8c014f1 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -259,12 +259,12 @@ sp_flowregion_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) if (((SPObjectClass *) (flowregion_parent_class))->write) ((SPObjectClass *) (flowregion_parent_class))->write (object, repr, flags); - + return repr; } -static gchar *sp_flowregion_description(SPItem *item) +static gchar *sp_flowregion_description(SPItem */*item*/) { // TRANSLATORS: "Flow region" is an area where text is allowed to flow return g_strdup_printf(_("Flow region")); @@ -476,12 +476,12 @@ sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint f if (((SPObjectClass *) (flowregionexclude_parent_class))->write) ((SPObjectClass *) (flowregionexclude_parent_class))->write (object, repr, flags); - + return repr; } -static gchar *sp_flowregionexclude_description(SPItem *item) +static gchar *sp_flowregionexclude_description(SPItem */*item*/) { /* TRANSLATORS: A region "cut out of" a flow region; text is not allowed to flow inside the * flow excluded region. flowRegionExclude in SVG 1.2: see diff --git a/src/sp-gaussian-blur.cpp b/src/sp-gaussian-blur.cpp index 8b7578fe8..4d1c37880 100644 --- a/src/sp-gaussian-blur.cpp +++ b/src/sp-gaussian-blur.cpp @@ -84,7 +84,7 @@ sp_gaussianBlur_class_init(SPGaussianBlurClass *klass) } static void -sp_gaussianBlur_init(SPGaussianBlur *gaussianBlur) +sp_gaussianBlur_init(SPGaussianBlur */*gaussianBlur*/) { } @@ -122,7 +122,7 @@ static void sp_gaussianBlur_set(SPObject *object, unsigned int key, gchar const *value) { SPGaussianBlur *gaussianBlur = SP_GAUSSIANBLUR(object); - + switch(key) { case SP_ATTR_STDDEVIATION: gaussianBlur->stdDeviation.set(value); diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp index b4c42e866..a00924029 100644 --- a/src/sp-gradient.cpp +++ b/src/sp-gradient.cpp @@ -539,9 +539,9 @@ gradient_ref_changed(SPObject *old_ref, SPObject *ref, SPGradient *gr) gr->modified_connection = ref->connectModified(sigc::bind<2>(sigc::ptr_fun(&gradient_ref_modified), gr)); } - // Per SVG, all unset attributes must be inherited from linked gradient. + // Per SVG, all unset attributes must be inherited from linked gradient. // So, as we're now (re)linked, we assign linkee's values to this gradient if they are not yet set - - // but without setting the _set flags. + // but without setting the _set flags. // FIXME: do the same for gradientTransform too if (!gr->units_set) gr->units = sp_gradient_get_units (gr); @@ -615,7 +615,7 @@ sp_gradient_modified(SPObject *object, guint flags) if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { sp_gradient_ensure_colors(gr); } - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; @@ -937,7 +937,7 @@ sp_gradient_repr_write_vector(SPGradient *gr) static void -gradient_ref_modified(SPObject *href, guint flags, SPGradient *gradient) +gradient_ref_modified(SPObject */*href*/, guint /*flags*/, SPGradient *gradient) { if (sp_gradient_invalidate_vector(gradient)) { SP_OBJECT(gradient)->requestModified(SP_OBJECT_MODIFIED_FLAG); @@ -1202,7 +1202,7 @@ sp_gradient_render_vector_block_rgba(SPGradient *const gradient, guchar *buf, */ void sp_gradient_render_vector_block_rgb(SPGradient *gradient, guchar *buf, - gint const width, gint const height, gint const rowstride, + gint const width, gint const height, gint const /*rowstride*/, gint const pos, gint const span, bool const horizontal) { g_return_if_fail(gradient != NULL); @@ -1470,7 +1470,7 @@ sp_lineargradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags static SPPainter * sp_lineargradient_painter_new(SPPaintServer *ps, NR::Matrix const &full_transform, - NR::Matrix const &parent_transform, + NR::Matrix const &/*parent_transform*/, NRRect const *bbox) { SPLinearGradient *lg = SP_LINEARGRADIENT(ps); @@ -1527,7 +1527,7 @@ sp_lineargradient_painter_new(SPPaintServer *ps, } static void -sp_lineargradient_painter_free(SPPaintServer *ps, SPPainter *painter) +sp_lineargradient_painter_free(SPPaintServer */*ps*/, SPPainter *painter) { g_free(painter); } @@ -1756,7 +1756,7 @@ sp_radialgradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags static SPPainter * sp_radialgradient_painter_new(SPPaintServer *ps, NR::Matrix const &full_transform, - NR::Matrix const &parent_transform, + NR::Matrix const &/*parent_transform*/, NRRect const *bbox) { SPRadialGradient *rg = SP_RADIALGRADIENT(ps); @@ -1808,7 +1808,7 @@ sp_radialgradient_painter_new(SPPaintServer *ps, } static void -sp_radialgradient_painter_free(SPPaintServer *ps, SPPainter *painter) +sp_radialgradient_painter_free(SPPaintServer */*ps*/, SPPainter *painter) { g_free(painter); } diff --git a/src/sp-item.cpp b/src/sp-item.cpp index e52042e35..2f3125a58 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -628,7 +628,7 @@ sp_item_update(SPObject *object, SPCtx *ctx, guint flags) NRRect item_bbox; sp_item_invoke_bbox(item, &item_bbox, NR::identity(), TRUE, SPItem::GEOMETRIC_BBOX); NR::Maybe i_bbox = item_bbox; - + SPItemView *itemview = item->display; do { if (itemview->arenaitem) @@ -681,7 +681,7 @@ sp_item_write(SPObject *const object, Inkscape::XML::Node *repr, guint flags) NR::Maybe SPItem::getBounds(NR::Matrix const &transform, SPItem::BBoxType type, - unsigned int dkey) const + unsigned int /*dkey*/) const { NRRect r; sp_item_invoke_bbox_full(this, &r, transform, type, TRUE); @@ -800,7 +800,7 @@ void sp_item_snappoints(SPItem const *item, bool includeItemCenter, SnapPointsIt if (item_class.snappoints) { item_class.snappoints(item, p); } - + if (includeItemCenter) { *p = item->getCenter(); } @@ -825,7 +825,7 @@ sp_item_invoke_print(SPItem *item, SPPrintContext *ctx) } static gchar * -sp_item_private_description(SPItem *item) +sp_item_private_description(SPItem */*item*/) { return g_strdup(_("Object")); } @@ -1127,7 +1127,7 @@ sp_item_adjust_paint_recursive (SPItem *item, NR::Matrix advertized_transform, N NR::Matrix paint_delta = t_item * t_ancestors * advertized_transform * t_ancestors.inverse() * t_item.inverse(); // Within text, we do not fork gradients, and so must not recurse to avoid double compensation; -// also we do not recurse into clones, because a clone's child is the ghost of its original - +// also we do not recurse into clones, because a clone's child is the ghost of its original - // we must not touch it if (!(item && (SP_IS_TEXT(item) || SP_IS_USE(item)))) { for (SPObject *o = SP_OBJECT(item)->children; o != NULL; o = o->next) { @@ -1186,20 +1186,20 @@ sp_item_write_transform(SPItem *item, Inkscape::XML::Node *repr, NR::Matrix cons } else { advertized_transform = sp_item_transform_repr (item).inverse() * transform; } - + if (compensate) { - + // recursively compensate for stroke scaling, depending on user preference if (prefs_get_int_attribute("options.transform", "stroke", 1) == 0) { double const expansion = 1. / NR::expansion(advertized_transform); sp_item_adjust_stroke_width_recursive(item, expansion); } - + // recursively compensate rx/ry of a rect if requested if (prefs_get_int_attribute("options.transform", "rectcorners", 1) == 0) { sp_item_adjust_rects_recursive(item, advertized_transform); } - + // recursively compensate pattern fill if it's not to be transformed if (prefs_get_int_attribute("options.transform", "pattern", 1) == 0) { sp_item_adjust_paint_recursive (item, advertized_transform.inverse(), NR::identity(), true); @@ -1212,8 +1212,8 @@ sp_item_write_transform(SPItem *item, Inkscape::XML::Node *repr, NR::Matrix cons // this converts the gradient/pattern fill/stroke, if any, to userSpaceOnUse; we need to do // it here _before_ the new transform is set, so as to use the pre-transform bbox sp_item_adjust_paint_recursive (item, NR::identity(), NR::identity(), false); - } - + } + } // endif(compensate) gint preserve = prefs_get_int_attribute("options.preservetransform", "value", 0); @@ -1223,7 +1223,7 @@ sp_item_write_transform(SPItem *item, Inkscape::XML::Node *repr, NR::Matrix cons !preserve && // user did not chose to preserve all transforms !item->clip_ref->getObject() && // the object does not have a clippath !item->mask_ref->getObject() && // the object does not have a mask - !(!transform.is_translation() && SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->getFilter()) + !(!transform.is_translation() && SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->getFilter()) // the object does not have a filter, or the transform is translation (which is supposed to not affect filters) ) { transform_attr = ((SPItemClass *) G_OBJECT_GET_CLASS(item))->set_transform(item, transform); diff --git a/src/sp-line.cpp b/src/sp-line.cpp index f63dfd323..9be7cf928 100644 --- a/src/sp-line.cpp +++ b/src/sp-line.cpp @@ -184,9 +184,9 @@ sp_line_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } static gchar * -sp_line_description(SPItem *item) +sp_line_description(SPItem */*item*/) { - return g_strdup(_("Line")); + return g_strdup(_("Line")); } static NR::Matrix diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index cdd71c410..bb18d7422 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -171,7 +171,7 @@ sp_item_create_link(GtkMenuItem *menuitem, SPItem *item) SP_OBJECT(item)->deleteObject(false); repr->addChild(child, NULL); child->setAttribute("id", id); - sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE, + sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE, _("Create link")); sp_object_attributes_dialog(object, "SPAnchor"); @@ -249,13 +249,13 @@ sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) } static void -sp_anchor_link_properties(GtkMenuItem *menuitem, SPAnchor *anchor) +sp_anchor_link_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor) { sp_object_attributes_dialog(SP_OBJECT(anchor), "Link"); } static void -sp_anchor_link_follow(GtkMenuItem *menuitem, SPAnchor *anchor) +sp_anchor_link_follow(GtkMenuItem */*menuitem*/, SPAnchor *anchor) { g_return_if_fail(anchor != NULL); g_return_if_fail(SP_IS_ANCHOR(anchor)); @@ -264,7 +264,7 @@ sp_anchor_link_follow(GtkMenuItem *menuitem, SPAnchor *anchor) } static void -sp_anchor_link_remove(GtkMenuItem *menuitem, SPAnchor *anchor) +sp_anchor_link_remove(GtkMenuItem */*menuitem*/, SPAnchor *anchor) { GSList *children; @@ -298,7 +298,7 @@ sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) } static void -sp_image_image_properties(GtkMenuItem *menuitem, SPAnchor *anchor) +sp_image_image_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor) { sp_object_attributes_dialog(SP_OBJECT(anchor), "Image"); } diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp index 344efc557..344c446e0 100644 --- a/src/ui/dialog/undo-history.cpp +++ b/src/ui/dialog/undo-history.cpp @@ -31,7 +31,7 @@ namespace Dialog { /* Rendering functions for custom cell renderers */ -void +void CellRendererSPIcon::render_vfunc(const Glib::RefPtr& window, Gtk::Widget& widget, const Gdk::Rectangle& background_area, @@ -50,13 +50,13 @@ CellRendererSPIcon::render_vfunc(const Glib::RefPtr& window, if (icon) { - // check icon type (inkscape, gtk, none) - if ( SP_IS_ICON(icon->gobj()) ) { + // check icon type (inkscape, gtk, none) + if ( SP_IS_ICON(icon->gobj()) ) { SPIcon* sp_icon = SP_ICON(icon->gobj()); sp_icon_fetch_pixbuf(sp_icon); _property_icon = Glib::wrap(sp_icon->pb, true); } else if ( GTK_IS_IMAGE(icon->gobj()) ) { - _property_icon = Gtk::Invisible().render_icon(Gtk::StockID(image), + _property_icon = Gtk::Invisible().render_icon(Gtk::StockID(image), Gtk::ICON_SIZE_MENU); } else { delete icon; @@ -71,7 +71,7 @@ CellRendererSPIcon::render_vfunc(const Glib::RefPtr& window, property_pixbuf() = _icon_cache[_property_event_type]; } - Gtk::CellRendererPixbuf::render_vfunc(window, widget, background_area, + Gtk::CellRendererPixbuf::render_vfunc(window, widget, background_area, cell_area, expose_area, flags); } @@ -88,7 +88,7 @@ CellRendererInt::render_vfunc(const Glib::RefPtr& window, std::ostringstream s; s << _property_number << std::flush; property_text() = s.str(); - Gtk::CellRendererText::render_vfunc(window, widget, background_area, + Gtk::CellRendererText::render_vfunc(window, widget, background_area, cell_area, expose_area, flags); } } @@ -138,7 +138,7 @@ UndoHistory::UndoHistory(Behavior::BehaviorFactory behavior_factory) _event_log (_desktop ? _desktop->event_log : NULL), _columns (_event_log ? &_event_log->getColumns() : NULL), _event_list_selection (_event_list_view.get_selection()) -{ +{ if( !_document || !_event_log || !_columns ) return; set_size_request(300, 200); @@ -209,7 +209,7 @@ UndoHistory::~UndoHistory() { } -void +void UndoHistory::_onListSelectionChange() { @@ -239,7 +239,7 @@ UndoHistory::_onListSelectionChange() } else { // this should not happen _event_list_selection->select(curr_event); } - + } else { EventLog::const_iterator last_selected = _event_log->getCurrEvent(); @@ -248,7 +248,7 @@ UndoHistory::_onListSelectionChange() * of that parent's branch. */ - if ( !selected->children().empty() && + if ( !selected->children().empty() && !_event_list_view.row_expanded(_event_list_store->get_path(selected)) ) { selected = selected->children().end(); @@ -256,13 +256,13 @@ UndoHistory::_onListSelectionChange() } // An event before the current one has been selected. Undo to the selected event. - if ( _event_list_store->get_path(selected) < - _event_list_store->get_path(last_selected) ) + if ( _event_list_store->get_path(selected) < + _event_list_store->get_path(last_selected) ) { _event_log->blockNotifications(); while ( selected != last_selected ) { - + sp_document_undo(_document); if ( last_selected->parent() && @@ -279,7 +279,7 @@ UndoHistory::_onListSelectionChange() } } } - _event_log->blockNotifications(false); + _event_log->blockNotifications(false); _event_log->updateUndoVerbs(); } else { // An event after the current one has been selected. Redo to the selected event. @@ -304,8 +304,8 @@ UndoHistory::_onListSelectionChange() } } } - _event_log->blockNotifications(false); - + _event_log->blockNotifications(false); + } _event_log->setCurrEvent(selected); @@ -315,7 +315,7 @@ UndoHistory::_onListSelectionChange() } void -UndoHistory::_onExpandEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) +UndoHistory::_onExpandEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &/*path*/) { if ( iter == _event_list_selection->get_selected() ) { @@ -324,7 +324,7 @@ UndoHistory::_onExpandEvent(const Gtk::TreeModel::iterator &iter, const Gtk::Tre } void -UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) +UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &/*path*/) { // Collapsing a branch we're currently in is equal to stepping to the last event in that branch if ( iter == _event_log->getCurrEvent() ) @@ -349,26 +349,26 @@ UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::T const CellRendererInt::Filter& UndoHistory::greater_than_1 = UndoHistory::GreaterThan(1); -static void +static void on_activate_desktop(Inkscape::Application*, SPDesktop* desktop, void*) { if (!_instance) return; - _instance->_document_replaced_connection = + _instance->_document_replaced_connection = SP_ACTIVE_DESKTOP->connectDocumentReplaced(sigc::ptr_fun(on_document_replaced)); _instance->setDesktop(desktop); } -static void -on_deactivate_desktop(Inkscape::Application*, SPDesktop* desktop, void*) +static void +on_deactivate_desktop(Inkscape::Application*, SPDesktop* /*desktop*/, void*) { if (!_instance) return; _instance->_document_replaced_connection.disconnect(); } -static void +static void on_document_replaced(SPDesktop* desktop, SPDocument*) { if (!_instance) return; diff --git a/src/ui/dialog/undo-history.h b/src/ui/dialog/undo-history.h index d7b00f343..7d7426675 100644 --- a/src/ui/dialog/undo-history.h +++ b/src/ui/dialog/undo-history.h @@ -108,7 +108,7 @@ private: Glib::Property _property_number; const Filter& _filter; - struct NoFilter : Filter { bool operator() (const int& x) const { return true; } }; + struct NoFilter : Filter { bool operator() (const int& /*x*/) const { return true; } }; }; diff --git a/src/xml/simple-document.h b/src/xml/simple-document.h index ab563139d..17e283f2a 100644 --- a/src/xml/simple-document.h +++ b/src/xml/simple-document.h @@ -73,9 +73,9 @@ protected: _initBindings(); } - SimpleNode *_duplicate(Document* doc) const - { - return new SimpleDocument(*this); + SimpleNode *_duplicate(Document* /*doc*/) const + { + return new SimpleDocument(*this); } private: