summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62d835b)
raw | patch | inline | side by side (parent: 62d835b)
author | joncruz <joncruz@users.sourceforge.net> | |
Sun, 4 Nov 2007 07:22:23 +0000 (07:22 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sun, 4 Nov 2007 07:22:23 +0000 (07:22 +0000) |
40 files changed:
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 53c272566af1e33faa0ae0d272eb3a4c070f8eb3..7556d2e8fed7df52a16ad5c00f551d8a006b62af 100644 (file)
--- 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 {
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 0b89b75551bd5c21f7e358d9de587e81f5a65ea8..078061318f4206eeff634645f6552d370e084be9 100644 (file)
--- a/src/dom/views.h
+++ b/src/dom/views.h
/**
*
*/
- Match(const Match &other)
+ Match(const Match &/*other*/)
{
}
/**
*
*/
- 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;
/**
*
*/
- 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;
/**
*
*/
- 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;
/**
*
*/
- 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;
/**
*
*/
- virtual MatchSet createMatchSet(unsigned short test)
+ virtual MatchSet createMatchSet(unsigned short /*test*/)
{
MatchSet ret;
return ret;
/**
*
*/
- virtual StringItem createStringItem(const DOMString &name)
+ virtual StringItem createStringItem(const DOMString &/*name*/)
{
StringItem ret;
return ret;
/**
*
*/
- virtual IntegerItem createIntegerItem(const DOMString &name)
+ virtual IntegerItem createIntegerItem(const DOMString &/*name*/)
{
IntegerItem ret;
return ret;
/**
*
*/
- virtual BooleanItem createBooleanItem(const DOMString &name)
+ virtual BooleanItem createBooleanItem(const DOMString &/*name*/)
{
BooleanItem ret;
return ret;
/**
*
*/
- virtual ContentItem createContentItem(const DOMString &name)
+ virtual ContentItem createContentItem(const DOMString &/*name*/)
{
ContentItem ret;
return ret;
/**
*
*/
- 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 bool matchFirstSegment(Segment &todo) //inout parm, not const
+ virtual bool matchFirstSegment(Segment &/*todo*/) //inout parm, not const
throw(dom::DOMException)
{
return false;
/**
*
*/
- virtual long getIntegerProperty(const DOMString &name)
+ virtual long getIntegerProperty(const DOMString &/*name*/)
throw(dom::DOMException)
{
long val=0;
/**
*
*/
- virtual DOMString getStringProperty(const DOMString &name)
+ virtual DOMString getStringProperty(const DOMString &/*name*/)
throw(dom::DOMException)
{
DOMString val;
/**
*
*/
- virtual bool getBooleanProperty(bool name)
+ virtual bool getBooleanProperty(bool /*name*/)
throw(dom::DOMException)
{
bool val=false;
/**
*
*/
- virtual NodePtr getContentPropertyNode(const DOMString &name)
+ virtual NodePtr getContentPropertyNode(const DOMString &/*name*/)
throw(dom::DOMException)
{
NodePtr val = NULL;
/**
*
*/
- virtual unsigned long getContentPropertyOffset(const DOMString &name)
+ virtual unsigned long getContentPropertyOffset(const DOMString &/*name*/)
throw(dom::DOMException)
{
long val=0;
/**
*
*/
- View(const View &other)
+ View(const View &/*other*/)
{
}
/**
*
*/
- VisualResource(const VisualResource &other)
+ VisualResource(const VisualResource &/*other*/)
{
}
/**
*
*/
- 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 8cffa6b7a27f0aff10b6cd52cc22397635ca574b..346f17891626e50522d3534da97c834293c0c9a5 100644 (file)
--- 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 = "";
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;
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);
*/
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
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.");
}
// 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)){
result = gnome_vfs_close (to_handle);
return true;
}
-
+
if (result != GNOME_VFS_OK) {
g_warning("%s", gnome_vfs_result_to_string(result));
return false;
g_warning("%s", gnome_vfs_result_to_string(result));
return false;
}
-
-
+
+
if (bytes_read != bytes_written){
return false;
}
-
+
}
return true;
#else
// 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
}
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"),
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<Gtk::FileChooser *>(saveDialog)->add_shortcut_folder(templates);
Inkscape::Extension::Extension *selectionType = saveDialog->getSelectionType();
delete saveDialog;
-
+
saveDialog = 0;
if (fileName.size() > 0) {
if (fileName.size() > 0) {
-
+
Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
if ( newFileName.size() > 0)
//# 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);
// 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
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
// 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(
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
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){
return success;
}
-
+
// Start now the submition
-
+
// Create the uri
Glib::ustring uri = "dav://";
char *username = (char *)prefs_get_string_attribute("options.ocalusername", "str");
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 ff15e8b8e8382370bf2e206ed19961f760701368..2da6d6ef40046834232c20c7d23abb2ce180920b 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
};
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) {
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;
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) ) {
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)) {
/**
\brief Select all stops/draggers that match the coords
*/
-void
+void
GrDrag::selectByCoords(std::vector<NR::Point> coords)
{
for (GList *l = this->draggers; l != NULL; l = l->next) {
/**
\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) {
{
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;
}
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 984d646621b845cf84c3b197b3bdbc9d966cf65d..473198af34d3fbfe9ebfb21e6fc3d31fc4e5d895 100644 (file)
--- a/src/guide-snapper.cpp
+++ b/src/guide-snapper.cpp
}
-Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point const &p) const
+Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point const &/*p*/) const
{
LineList s;
index 0086d86b1f9a7638ce0c7dea17b645ec16187bfe..ccb4506f0307d0e57a4b1a3a7575dd39e3289199 100644 (file)
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
};
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;
};
{
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);
{
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;
};
{
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
};
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
{
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;
{
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;
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.
*/
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.
*/
#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 :
index 614f799c0c2166f362aa57f409342afed8c352d0..78d12ca6917ef22d2aeb3969f31fd23ad73ba34a 100644 (file)
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;
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);
} //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 5b75651955e7ecb93ec57c55afcb62a175e7dc7a..3b9063f33ad7ca06a4458ac3dc53151f4deedf55 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
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.
*
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;
//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
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;
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;
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;
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
} else {
sample_cursor = delete_cursor->p.other;
}
-
+
//calculate points for each segment
int rate = 5;
float period = 1.0 / rate;
just_delete = true;
break;
}
-
+
//sample points on the contiguous selected segment
NR::Point *bez;
bez = new NR::Point [4];
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?
//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;
}
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;
}
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;
/**
* 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) {
/**
* 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;
/**
* 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;
/**
* 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;
* \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;
/**
* 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 63ccf827e740cf4b55c1a632686031a9f104bdcc..1ef02672f4c04b222350b25f42691d8ec58301be 100644 (file)
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
#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);
}
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);
}
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));
{
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();
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
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.
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);
}
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);
}
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);
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] );
}
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] );
/* 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;
* [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);
/* 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 7739238b428fed733f0ef81a815f79f2e8f1a888..10e0c43d4bef3f6529b7a9d2f38eb0c53c464be4 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
#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<Path*>;
}
-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<Path*>::const_iterator k = _paths_to_snap_to->begin(); k != _paths_to_snap_to->end(); k++) {
delete *k;
}
}
/**
- * 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.
*/
std::vector<NR::Point> &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<SPItem const *>::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<NR::Rect> b = sp_item_bbox_desktop(SP_ITEM(o));
if (b) {
for (std::vector<NR::Point>::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<SPItem*>::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<NR::Point>::const_iterator k = _points_to_snap_to->begin(); k != _points_to_snap_to->end(); k++) {
/* Try to snap to this node of the path */
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<Path*>::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<SPItem*>::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;
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<Path*>::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<Path::cut_position> 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;
}
-void Inkscape::ObjectSnapper::_doConstrainedSnap(SnappedConstraints &sc,
- Inkscape::Snapper::PointType const &t,
- NR::Point const &p,
- bool const &first_point,
- std::vector<NR::Point> &points_to_snap,
- ConstraintLine const &c,
- std::list<SPItem const *> const &it) const
+void Inkscape::ObjectSnapper::_doConstrainedSnap( SnappedConstraints &sc,
+ Inkscape::Snapper::PointType const &t,
+ NR::Point const &p,
+ bool const &first_point,
+ std::vector<NR::Point> &points_to_snap,
+ ConstraintLine const &/*c*/,
+ std::list<SPItem const *> const &it) const
{
/* FIXME: this needs implementing properly; I think we have to do the
** intersection of c with the objects.
/* Get a list of all the SPItems that we will try to snap to */
std::vector<SPItem*> cand;
std::list<SPItem const *> const it; //just an empty list
-
+
std::vector<NR::Point> 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 3c7529c16aff11d884f2d7d057b738d68068d0ef..489e88dfc859d46786ec28cb4872b229b2f90fca 100644 (file)
--- a/src/perspective3d.cpp
+++ b/src/perspective3d.cpp
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;
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);
}
g_print ("====================================================\n");
}
-} // namespace Box3D
-
+} // namespace Box3D
+
/*
Local Variables:
mode:c++
diff --git a/src/print.cpp b/src/print.cpp
index 872a0234f4d4e6847fd03e14b05a150a517bebbe..4252298a4731c928d4d00be7efdb5b46ce452fc1 100644 (file)
--- a/src/print.cpp
+++ b/src/print.cpp
#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);
#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
index ce14bd0f521affc65389b4343f8cfcd92082d6a4..95a2cac0df4ed5bf8386df7dc22b580591dee389 100644 (file)
@@ -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);
*/
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"));
}
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);
// 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);
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"));
}
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"));
}
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"));
}
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"));
}
sp_selection_move_relative(selection, m);
}
- sp_document_done(document, SP_VERB_EDIT_PASTE,
+ sp_document_done(document, SP_VERB_EDIT_PASTE,
_("Paste"));
}
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;
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;
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;
}
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);
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"));
}
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"));
}
( (angle > 0)
? "selector:rotate:ccw"
: "selector:rotate:cw" ),
- SP_VERB_CONTEXT_SELECT,
+ SP_VERB_CONTEXT_SELECT,
_("Rotate by pixels"));
}
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"));
}
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"));
}
}
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"));
}
}
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); }
}
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);
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);
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);
}
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;
}
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);
// 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;
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);
g_slist_free (items);
- sp_document_done (doc, SP_VERB_EDIT_TILE,
+ sp_document_done (doc, SP_VERB_EDIT_TILE,
_("Objects to pattern"));
}
if (!did) {
desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No pattern fills</b> 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;
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
* 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)
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
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
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());
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);
}
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<SPItem *>(i->data);
}
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"));
}
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);
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> 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);
// remember referenced mask/clippath, so orphaned masks can be moved back to document
SPItem *item = reinterpret_cast<SPItem *>(i->data);
Inkscape::URIReference *uri_ref = NULL;
-
+
if (apply_clip_path) {
uri_ref = item->clip_ref;
} else {
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"));
}
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);
}
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 c680e0cd3b4908b11f2f64c8b4b7ee8dd23e2bcd..b95e70c4ae001285589e9870f7e64c9251c99590 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
{
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<NR::Point> 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<NR::Point>::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<NR::Point>::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);
//Update the bboxes
_bbox = selection->bounds(_snap_bbox_type);
_approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX);
-
+
if (!_bbox) {
_empty = true;
return;
);
}
-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();
}
);
}
-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
}
}
-void Inkscape::SelTrans::_selModified(Inkscape::Selection *selection, guint flags)
+void Inkscape::SelTrans::_selModified(Inkscape::Selection */*selection*/, guint /*flags*/)
{
if (!_grabbed) {
_updateVolatileState();
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)));
}
}
} 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
} else {
/* Scale aspect ratio is unlocked */
-
+
std::pair<NR::scale, bool> 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<NR::Coord, bool> 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;
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;
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;
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);
}
it,
Inkscape::Snapper::ConstraintLine(component_vectors[dim]),
dxy));
-
+
s.push_back(m.constrainedSnapTranslation(Inkscape::Snapper::SNAPPOINT_NODE,
_snap_points,
it,
/* 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 508d2228d3cdec2f551f8d2c0ec23d0955a0c83c..7fa400092d286a7b3a6788f28386d33c5097d3ab 100644 (file)
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
#include "shape-editor.h"
-ShapeEditorsCollective::ShapeEditorsCollective(SPDesktop *dt) {
+ShapeEditorsCollective::ShapeEditorsCollective(SPDesktop */*dt*/) {
}
ShapeEditorsCollective::~ShapeEditorsCollective() {
}
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;
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();
}
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);
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();
}
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 () {
void ShapeEditor::flip (NR::Dim2 axis, NR::Maybe<NR::Point> 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 3a55c52f76cb5d3c6a4c06eff8a17e2712a00bbd..f21a15cdfebcd2596a69f69e0755d0781bf7e19f 100644 (file)
--- 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);
}
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;
}
index 7c85277768d7e87581e4d118f01b00091f030ec2..d13ef9e86a00f022f0f3c31df91e484928adec2d 100644 (file)
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
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);
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 dd64975262b2a430806f673b167ecd8bd98822de..3840daf97487d1cf5ecf16544896689503b8a4c5 100644 (file)
--- a/src/sp-conn-end.cpp
+++ b/src/sp-conn-end.cpp
}
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)
{
}
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 5a8dce6df7f8640729edec44eeb6b44bfe47af98..35324c62f15809818d8f5028d913f0d498b7eb4a 100644 (file)
--- a/src/sp-defs.cpp
+++ b/src/sp-defs.cpp
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 f558bc229322735dc33a728f1d6edb12666b367c..7a1b0f33e0ef41cc118a6a9d862ed873263a2340 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
}
static void
-sp_ellipse_init(SPEllipse *ellipse)
+sp_ellipse_init(SPEllipse */*ellipse*/)
{
/* Nothing special */
}
}
}
-static gchar *sp_ellipse_description(SPItem *item)
+static gchar *sp_ellipse_description(SPItem */*item*/)
{
return g_strdup(_("<b>Ellipse</b>"));
}
}
static void
-sp_circle_init(SPCircle *circle)
+sp_circle_init(SPCircle */*circle*/)
{
/* Nothing special */
}
}
}
-static gchar *sp_circle_description(SPItem *item)
+static gchar *sp_circle_description(SPItem */*item*/)
{
return g_strdup(_("<b>Circle</b>"));
}
}
static void
-sp_arc_init(SPArc *arc)
+sp_arc_init(SPArc */*arc*/)
{
/* Nothing special */
}
index d8d931db1c3165fe6e6b05851b2b8ffbc94fec5b..f13e12809ff9f48657f28e6e8ac0e2f0b8ee3bd2 100644 (file)
--- a/src/sp-fecolormatrix.cpp
+++ b/src/sp-fecolormatrix.cpp
{
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;
}
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
}
}
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);
index a878e1ad7cf23dc63c9caac050e30a7e392cc47f..7125b50abb375fff2623c046f89eec09f0cc64fa 100644 (file)
}
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);
}
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 837ccf4aeed7f9670baedecf1199f24aa64510b6..a9dcb4e71c40d81452b55676646812fec12a7e8f 100644 (file)
--- a/src/sp-feflood.cpp
+++ b/src/sp-feflood.cpp
{
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;
}
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 4288faa10f685a31830b0ea31811455d03369f77..a360151803d7cbbec92b8e6e938a4318b31afea9 100644 (file)
--- a/src/sp-feimage.cpp
+++ b/src/sp-feimage.cpp
}
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");
}
{
SPFeImage *feImage = SP_FEIMAGE(object);
(void)feImage;
-
+
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_X:
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::FilterImage*>(nr_primitive);
diff --git a/src/sp-femerge.cpp b/src/sp-femerge.cpp
index dfa664941d27263eb55225ae1ddf3ce5c8abd889..3cf5ea31225bf24a2a1126ed0f53dd7da9f6063a 100644 (file)
--- a/src/sp-femerge.cpp
+++ b/src/sp-femerge.cpp
}
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 09687e54b37a8779a6330489b38524144cfbc857..6098fb7b011af1924c0872f0db8704acd9c50c5e 100644 (file)
--- a/src/sp-femergenode.cpp
+++ b/src/sp-femergenode.cpp
* 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");
}
index 88af356219cebd7fb9ba331488754e3a0e7f5286..211fb726b55d6d0d655c9f547a87daed58469c3d 100644 (file)
--- a/src/sp-fepointlight.cpp
+++ b/src/sp-fepointlight.cpp
fepointlight->x = 0;
fepointlight->y = 0;
fepointlight->z = 0;
-
+
fepointlight->x_set = FALSE;
fepointlight->y_set = FALSE;
fepointlight->z_set = FALSE;
}
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);
}
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? */
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 2730b0d8fcdbc073ec1e14429c131e81304d0523..e45b123edf84ee5ff3152f9c249d4b350acc79fa 100644 (file)
--- a/src/sp-fespotlight.cpp
+++ b/src/sp-fespotlight.cpp
fespotlight->pointsAtZ = 0;
fespotlight->specularExponent = 1;
fespotlight->limitingConeAngle = 90;
-
+
fespotlight->x_set = FALSE;
fespotlight->y_set = FALSE;
fespotlight->z_set = FALSE;
{
SPFeSpotLight *fespotlight = SP_FESPOTLIGHT(object);
gchar *end_ptr;
-
+
switch (key) {
case SP_ATTR_X:
end_ptr = NULL;
if(!value || !end_ptr) {
fespotlight->x = 0;
fespotlight->x_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->y = 0;
fespotlight->y_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->z = 0;
fespotlight->z_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->pointsAtX = 0;
fespotlight->pointsAtX_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->pointsAtY = 0;
fespotlight->pointsAtY_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->pointsAtZ = 0;
fespotlight->pointsAtZ_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->specularExponent = 1;
fespotlight->specularExponent_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
if(!value || !end_ptr) {
fespotlight->limitingConeAngle = 90;
fespotlight->limitingConeAngle_set = FALSE;
- }
+ }
if (object->parent &&
(SP_IS_FEDIFFUSELIGHTING(object->parent) ||
SP_IS_FESPECULARLIGHTING(object->parent))) {
}
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);
}
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? */
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);
}
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)
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 bb86a46278888b912c3c94d40d1b7d4e41a8f62a..472c921399258bd67fa2009fce44d9b6da8611d1 100644 (file)
--- a/src/sp-fetile.cpp
+++ b/src/sp-fetile.cpp
}
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 9d2abcddf53e341f57593cabe3b9646fcac493f6..e89108d1cae83c3773dd7fc31921a30da7ebeb0f 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
filter->primitiveUnits_set = FALSE;
filter->_renderer = NULL;
-
+
filter->_image_name = map<gchar *, int, ltstr>();
filter->filterRes = NumberOptNumber();
}
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);
}
if ( SP_IS_FILTER(ref)
&& ref != filter )
{
- filter->modified_connection =
+ filter->modified_connection =
ref->connectModified(sigc::bind(sigc::ptr_fun(&filter_ref_modified), 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 8c84d6128d278edb7242b0785ba9908aec7f0ae6..308831d28f033087703b96f90cd5ab81230921ab 100644 (file)
--- a/src/sp-flowdiv.cpp
+++ b/src/sp-flowdiv.cpp
}
static void
-sp_flowdiv_init (SPFlowdiv *group)
+sp_flowdiv_init (SPFlowdiv */*group*/)
{
}
}
static void
-sp_flowtspan_init (SPFlowtspan *group)
+sp_flowtspan_init (SPFlowtspan */*group*/)
{
}
}
static void
-sp_flowpara_init (SPFlowpara *group)
+sp_flowpara_init (SPFlowpara */*group*/)
{
}
static void
}
static void
-sp_flowline_init (SPFlowline *group)
+sp_flowline_init (SPFlowline */*group*/)
{
}
static void
}
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 3981aa9ba4874fbd7daff7abc69055ec2ecba0ba..6e8c014f1f74def060b112b7c96aa43bc322595c 100644 (file)
--- 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
index 8b7578fe8f058b751e54715cb95c412725487624..4d1c37880a7bf3bc27d1c767efe99bbc6ed0d8f3 100644 (file)
--- a/src/sp-gaussian-blur.cpp
+++ b/src/sp-gaussian-blur.cpp
}
static void
-sp_gaussianBlur_init(SPGaussianBlur *gaussianBlur)
+sp_gaussianBlur_init(SPGaussianBlur */*gaussianBlur*/)
{
}
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 b4c42e866d92950867f1685ef6de7a1d56cca1e5..a00924029c8970d5d427f380099ad4057d824ea7 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
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);
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;
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);
*/
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);
}
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);
}
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 e52042e35a0b0f16a81f7831ffa7e25758767b12..2f3125a5856d65263cbc6bedcd2a5b587c5c5deb 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
NRRect item_bbox;
sp_item_invoke_bbox(item, &item_bbox, NR::identity(), TRUE, SPItem::GEOMETRIC_BBOX);
NR::Maybe<NR::Rect> i_bbox = item_bbox;
-
+
SPItemView *itemview = item->display;
do {
if (itemview->arenaitem)
NR::Maybe<NR::Rect> 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();
}
}
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 f63dfd3236d0f276483836a4a4ffdaa083621f56..9be7cf928a0f9307b5a30379b23d16f573cf3f08 100644 (file)
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
}
static gchar *
-sp_line_description(SPItem *item)
+sp_line_description(SPItem */*item*/)
{
- return g_strdup(_("<b>Line</b>"));
+ return g_strdup(_("<b>Line</b>"));
}
static NR::Matrix
index cdd71c4105226f416d53c41acfc432d472cc2fc0..bb18d7422be8b77b072193d4c84e0f3f7fade850 100644 (file)
--- a/src/ui/context-menu.cpp
+++ b/src/ui/context-menu.cpp
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");
}
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));
}
static void
-sp_anchor_link_remove(GtkMenuItem *menuitem, SPAnchor *anchor)
+sp_anchor_link_remove(GtkMenuItem */*menuitem*/, SPAnchor *anchor)
{
GSList *children;
}
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");
}
index 344efc557b4e7caf03ebd4c2304cd89b092cd5ac..344c446e09991908b4bf4fa3ee885e7e3041df1f 100644 (file)
/* Rendering functions for custom cell renderers */
-void
+void
CellRendererSPIcon::render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
Gtk::Widget& widget,
const Gdk::Rectangle& background_area,
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;
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);
}
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);
}
}
_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);
{
}
-void
+void
UndoHistory::_onListSelectionChange()
{
} else { // this should not happen
_event_list_selection->select(curr_event);
}
-
+
} else {
EventLog::const_iterator last_selected = _event_log->getCurrEvent();
* 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();
}
// 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() &&
}
}
}
- _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.
}
}
}
- _event_log->blockNotifications(false);
-
+ _event_log->blockNotifications(false);
+
}
_event_log->setCurrEvent(selected);
}
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;
index d7b00f343edc970f290ac7b35636e768942483d4..7d7426675e436ad44dda4acad8ddc4decd0b76f9 100644 (file)
Glib::Property<int> _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; } };
};
index ab563139d750259bba4e7d8b4ee00e09cadf01ff..17e283f2a4ed0b5571770e3e363e32bba65522d7 100644 (file)
_initBindings();
}
- SimpleNode *_duplicate(Document* doc) const
- {
- return new SimpleDocument(*this);
+ SimpleNode *_duplicate(Document* /*doc*/) const
+ {
+ return new SimpleDocument(*this);
}
private: