summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2013-01-11 07:30:09 +0000
committerJon A. Cruz <jon@joncruz.org>2013-01-11 07:30:09 +0000
commitcfe9c94712a2ff6849b123672e51b603f20e76ae (patch)
treed3377768830691887a801cc7b45c3e8adb0c2c55 /src
parentgimpcolorwheel: Clean up drawing functions (diff)
downloadinkscape-cfe9c94712a2ff6849b123672e51b603f20e76ae.tar.gz
inkscape-cfe9c94712a2ff6849b123672e51b603f20e76ae.zip
Warning and dead code cleanup.
(bzr r12014)
Diffstat (limited to 'src')
-rw-r--r--src/dialogs/find.cpp150
-rw-r--r--src/dialogs/find.h2
-rw-r--r--src/display/cairo-utils.h3
-rw-r--r--src/dom/prop-css2.cpp3
-rw-r--r--src/dropper-context.cpp10
-rw-r--r--src/ege-adjustment-action.cpp6
-rw-r--r--src/ink-comboboxentry-action.cpp2
-rw-r--r--src/libavoid/orthogonal.cpp6
-rw-r--r--src/selection-chemistry.cpp2
-rw-r--r--src/shortcuts.cpp2
-rw-r--r--src/sp-image.cpp12
-rw-r--r--src/sp-mesh-array.cpp6
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp4
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/dialog/layers.cpp2
-rw-r--r--src/ui/dialog/ocaldialogs.cpp6
-rw-r--r--src/ui/dialog/symbols.cpp4
-rw-r--r--src/ui/widget/gimpcolorwheel.c13
-rw-r--r--src/ui/widget/spin-scale.cpp3
-rw-r--r--src/widgets/eek-preview.cpp16
-rw-r--r--src/widgets/fill-style.cpp2
-rw-r--r--src/widgets/gradient-selector.cpp4
-rw-r--r--src/widgets/icon.cpp2
-rw-r--r--src/widgets/sp-color-notebook.cpp2
-rw-r--r--src/widgets/sp-xmlview-tree.cpp10
-rw-r--r--src/widgets/spinbutton-events.cpp184
-rw-r--r--src/widgets/stroke-style.cpp9
27 files changed, 133 insertions, 334 deletions
diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index 2810f065c..3fabe4d97 100644
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
@@ -15,18 +15,6 @@
#include "widgets/icon.h"
#include "message-stack.h"
-//TODO : delete this
-GtkWidget * sp_find_dialog_old (void);
-
-static void
-//GtkWidget *
-sp_find_dialog(){
- // DialogFind::get().present();
- sp_find_dialog_old ();
- return;
-}
-
-
#include <gtk/gtk.h>
#include <glibmm/i18n.h>
@@ -684,144 +672,6 @@ sp_find_types ()
}
-GtkWidget *
-sp_find_dialog_old (void)
-{
- if (!dlg)
- {
- gchar title[500];
- sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_FIND), title);
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
-
- dlg = sp_window_new (title, TRUE);
- if (x == -1000 || y == -1000) {
- x = prefs->getInt(prefs_path + "x", -1000);
- y = prefs->getInt(prefs_path + "y", -1000);
- }
- if (w ==0 || h == 0) {
- w = prefs->getInt(prefs_path + "w", 0);
- h = prefs->getInt(prefs_path + "h", 0);
- }
-
- prefs->setInt(prefs_path + "visible", 1);
-
-// if (x<0) x=0;
-// if (y<0) y=0;
-
- if (w && h)
- gtk_window_resize(GTK_WINDOW(dlg), w, h);
- if (x >= 0 && y >= 0 && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE))) {
- gtk_window_move(GTK_WINDOW(dlg), x, y);
- } else {
- gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
- }
-
- sp_transientize (dlg);
- wd.win = dlg;
- wd.stop = 0;
- g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd );
-
- g_signal_connect ( G_OBJECT (dlg), "event", G_CALLBACK (sp_dialog_event_handler), dlg);
-
- g_signal_connect ( G_OBJECT (dlg), "destroy", G_CALLBACK (sp_find_dialog_destroy), NULL );
- g_signal_connect ( G_OBJECT (dlg), "delete_event", G_CALLBACK (sp_find_dialog_delete), dlg);
- g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (sp_find_dialog_delete), dlg);
-
- g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg);
- g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg);
-
- gtk_container_set_border_width (GTK_CONTAINER (dlg), 4);
-
- /* Toplevel vbox */
-#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget *vb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_set_homogeneous(GTK_BOX(vb), FALSE);
-#else
- GtkWidget *vb = gtk_vbox_new (FALSE, 0);
-#endif
- gtk_container_add (GTK_CONTAINER (dlg), vb);
-
- sp_find_new_searchfield (dlg, vb, _("_Text:"), "text", _("Find objects by their text content (exact or partial match)"));
- sp_find_new_searchfield (dlg, vb, _("_ID:"), "id", _("Find objects by the value of the id attribute (exact or partial match)"));
- sp_find_new_searchfield (dlg, vb, _("_Style:"), "style", _("Find objects by the value of the style attribute (exact or partial match)"));
- sp_find_new_searchfield (dlg, vb, _("_Attribute:"), "attr", _("Find objects by the name of an attribute (exact or partial match)"));
-
- gtk_widget_show_all (vb);
-
- GtkWidget *types = sp_find_types ();
- g_object_set_data (G_OBJECT (dlg), "types", types);
- gtk_box_pack_start (GTK_BOX (vb), types, FALSE, FALSE, 0);
-
- {
-#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget *w = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-#else
- GtkWidget *w = gtk_hseparator_new ();
-#endif
- gtk_widget_show (w);
- gtk_box_pack_start (GTK_BOX (vb), w, FALSE, FALSE, 3);
-
- {
- GtkWidget *b = gtk_check_button_new_with_mnemonic (_("Search in s_election"));
- gtk_widget_show (b);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b), FALSE);
- g_object_set_data (G_OBJECT (dlg), "inselection", b);
- gtk_widget_set_tooltip_text (b, _("Limit search to the current selection"));
- gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
- }
-
- {
- GtkWidget *b = gtk_check_button_new_with_mnemonic (_("Search in current _layer"));
- gtk_widget_show (b);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b), FALSE);
- g_object_set_data (G_OBJECT (dlg), "inlayer", b);
- gtk_widget_set_tooltip_text (b, _("Limit search to the current layer"));
- gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
- }
-
- {
- GtkWidget *b = gtk_check_button_new_with_mnemonic (_("Include _hidden"));
- gtk_widget_show (b);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b), FALSE);
- g_object_set_data (G_OBJECT (dlg), "includehidden", b);
- gtk_widget_set_tooltip_text (b, _("Include hidden objects in search"));
- gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
- }
-
- {
- GtkWidget *b = gtk_check_button_new_with_mnemonic (_("Include l_ocked"));
- gtk_widget_show (b);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b), FALSE);
- g_object_set_data (G_OBJECT (dlg), "includelocked", b);
- gtk_widget_set_tooltip_text (b, _("Include locked objects in search"));
- gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
- }
- }
-
- {
-#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget *hb = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_box_set_homogeneous(GTK_BOX(hb), FALSE);
-#else
- GtkWidget *hb = gtk_hbox_new (FALSE, 0);
-#endif
- gtk_widget_show (hb);
- gtk_box_pack_start (GTK_BOX (vb), hb, FALSE, FALSE, 0);
-
- // TRANSLATORS: "Clear" is a verb here
- sp_find_new_button (dlg, hb, _("_Clear"), _("Clear values"), sp_find_dialog_reset);
- sp_find_new_button (dlg, hb, _("_Find"), _("Select objects matching all of the fields you filled in"), sp_find_dialog_find);
- }
- }
-
- gtk_widget_show(GTK_WIDGET(dlg));
- gtk_window_present(GTK_WINDOW(dlg));
- sp_find_dialog_reset (NULL, G_OBJECT (dlg));
-
- return dlg;
-}
-
-
/*
Local Variables:
mode:c++
diff --git a/src/dialogs/find.h b/src/dialogs/find.h
index 219c36bf2..c06d3735f 100644
--- a/src/dialogs/find.h
+++ b/src/dialogs/find.h
@@ -14,8 +14,6 @@
#include <gtk/gtk.h>
-void sp_find_dialog();
-
#endif /* !SEEN_FIND_H */
diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h
index d240545eb..e88c6d4e8 100644
--- a/src/display/cairo-utils.h
+++ b/src/display/cairo-utils.h
@@ -87,7 +87,10 @@ public:
* Only the address of the structure is used, it is never initialized. See:
* http://www.cairographics.org/manual/cairo-Types.html#cairo-user-data-key-t
*/
+// TODO fixme check this usage. A static here in a header file is probably not doing what was intended:
static cairo_user_data_key_t ci_key;
+
+
SPColorInterpolation get_cairo_surface_ci(cairo_surface_t *surface);
void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation cif);
void copy_cairo_surface_ci(cairo_surface_t *in, cairo_surface_t *out);
diff --git a/src/dom/prop-css2.cpp b/src/dom/prop-css2.cpp
index 9fe998552..192295d1c 100644
--- a/src/dom/prop-css2.cpp
+++ b/src/dom/prop-css2.cpp
@@ -1279,6 +1279,7 @@ bool parseProperty(char *name, char *value)
}
+/*
static bool printTable()
{
for (CssProp *prop=cssProps; prop->name ; prop++)
@@ -1294,7 +1295,7 @@ static bool printTable()
}
return true;
}
-
+*/
int main(int /*argc*/, char **/*argv*/)
{
diff --git a/src/dropper-context.cpp b/src/dropper-context.cpp
index 38b981444..2be112706 100644
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
@@ -178,16 +178,6 @@ static void sp_dropper_context_finish(SPEventContext *ec)
/**
- * Returns the current dropper context icc-color.
- */
-static SPColor* sp_dropper_context_get_icc_color(SPEventContext */*ec*/)
-{
- //TODO: implement-me!
-
- return 0; // At least we will cause a clean crash, instead of random corruption.
-}
-
-/**
* Returns the current dropper context color.
*/
guint32 sp_dropper_context_get_color(SPEventContext *ec)
diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp
index 78f3f48d6..8253818d2 100644
--- a/src/ege-adjustment-action.cpp
+++ b/src/ege-adjustment-action.cpp
@@ -810,12 +810,6 @@ static gboolean event_cb( EgeAdjustmentAction* act, GdkEvent* evt )
return handled;
}
-static gchar *slider_format_falue( GtkScale* scale, gdouble value, gchar *label )
-{
- (void)scale;
- return g_strdup_printf("%s %d", label, (int) round(value));
-}
-
static GtkWidget* create_tool_item( GtkAction* action )
{
GtkWidget* item = 0;
diff --git a/src/ink-comboboxentry-action.cpp b/src/ink-comboboxentry-action.cpp
index 8033d1fab..d9b1b0965 100644
--- a/src/ink-comboboxentry-action.cpp
+++ b/src/ink-comboboxentry-action.cpp
@@ -788,7 +788,7 @@ static void ink_comboboxentry_action_defocus( Ink_ComboBoxEntry_Action* action )
}
}
-gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
+gboolean keypress_cb( GtkWidget * /*widget*/, GdkEventKey *event, gpointer data )
{
gboolean wasConsumed = FALSE; /* default to report event not consumed */
guint key = 0;
diff --git a/src/libavoid/orthogonal.cpp b/src/libavoid/orthogonal.cpp
index 772fc9668..d0a899252 100644
--- a/src/libavoid/orthogonal.cpp
+++ b/src/libavoid/orthogonal.cpp
@@ -204,12 +204,6 @@ class ShiftSegment
};
typedef std::list<ShiftSegment> ShiftSegmentList;
-static bool cmpShiftSegment(const ShiftSegment& u, const ShiftSegment& v)
-{
- return u < v;
-}
-
-
struct Node;
struct CmpNodePos { bool operator()(const Node* u, const Node* v) const; };
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 3b1028ab8..946858ec4 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2892,7 +2892,7 @@ void sp_selection_to_guides(SPDesktop *desktop)
/*
* Convert <g> to <symbol>, leaving all <use> elements referencing group unchanged.
*/
-void sp_selection_symbol(SPDesktop *desktop, bool apply )
+void sp_selection_symbol(SPDesktop *desktop, bool /*apply*/ )
{
if (desktop == NULL) {
diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp
index 9ececbb3b..5af75a9a5 100644
--- a/src/shortcuts.cpp
+++ b/src/shortcuts.cpp
@@ -420,7 +420,7 @@ void sp_shortcut_file_export_do(char const *exportname) {
* Element (b) is used in shortcut lookup and contains an uppercase version of the gdk_keyval_name,
* or a gdk_keyval_name name and the "Shift" modifier for Shift altered hardware code keys (see get_group0_keyval() for explanation)
*/
-void sp_shortcut_delete_from_file(char const *action, unsigned int const shortcut) {
+void sp_shortcut_delete_from_file(char const * /*action*/, unsigned int const shortcut) {
char const *filename = get_path(USER, KEYS, "default.xml");
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 7293c49fa..7b5d56638 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -108,8 +108,6 @@ static SPItemClass *parent_class;
extern "C"
{
void user_read_data( png_structp png_ptr, png_bytep data, png_size_t length );
- void user_write_data( png_structp png_ptr, png_bytep data, png_size_t length );
- void user_flush_data( png_structp png_ptr );
}
@@ -255,16 +253,6 @@ static void user_read_data( png_structp png_ptr, png_bytep data, png_size_t leng
// g_message("things out");
}
-static void user_write_data( png_structp /*png_ptr*/, png_bytep /*data*/, png_size_t /*length*/ )
-{
- //g_message( "user_write_data(%d)", length );
-}
-
-static void user_flush_data( png_structp /*png_ptr*/ )
-{
- //g_message( "user_flush_data" );
-}
-
static bool readPngAndHeaders( PushPull &youme, gint & dpiX, gint & dpiY )
{
diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp
index 3b2d33bbd..249f9562e 100644
--- a/src/sp-mesh-array.cpp
+++ b/src/sp-mesh-array.cpp
@@ -72,12 +72,6 @@
enum { ROW, COL };
-static void swap_p( Geom::Point *p1, Geom::Point *p2 ) {
- Geom::Point temp = *p1;
- *p1 = *p2;
- *p2 = temp;
-};
-
SPMeshPatchI::SPMeshPatchI( std::vector<std::vector< SPMeshNode* > > * n, int r, int c ) {
nodes = n;
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 0e25fece9..418132abb 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1186,7 +1186,7 @@ void FilterEffectsDialog::FilterModifier::setTargetDesktop(SPDesktop *desktop)
}
// When the document changes, update connection to resources
-void FilterEffectsDialog::FilterModifier::on_document_replaced(SPDesktop *desktop, SPDocument *document)
+void FilterEffectsDialog::FilterModifier::on_document_replaced(SPDesktop * /*desktop*/, SPDocument *document)
{
if (_resource_changed) {
_resource_changed.disconnect();
@@ -1686,7 +1686,7 @@ void FilterEffectsDialog::PrimitiveList::remove_selected()
}
#if !WITH_GTKMM_3_0
-bool FilterEffectsDialog::PrimitiveList::on_expose_signal(GdkEventExpose *e)
+bool FilterEffectsDialog::PrimitiveList::on_expose_signal(GdkEventExpose * /*evt*/)
{
bool result = false;
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 6e6473c5a..c7760c5bd 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1527,7 +1527,7 @@ void InkscapePreferences::onKBExport()
sp_shortcut_file_export();
}
-bool InkscapePreferences::onKBSearchKeyEvent(GdkEventKey *event)
+bool InkscapePreferences::onKBSearchKeyEvent(GdkEventKey * /*event*/)
{
_kb_filter->refilter();
return FALSE;
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 4f7b8f27c..fdc33b2a6 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -655,7 +655,7 @@ bool LayersPanel::_handleButtonEvent(GdkEventButton* event)
* Drap and drop within the tree
* Save the drag source and drop target SPObjects and if its a drag between layers or into (sublayer) a layer
*/
-bool LayersPanel::_handleDragDrop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)
+bool LayersPanel::_handleDragDrop(const Glib::RefPtr<Gdk::DragContext>& /*context*/, int x, int y, guint /*time*/)
{
int cell_x = 0, cell_y = 0;
Gtk::TreeModel::Path target_path;
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp
index 75c766566..09ce59e9c 100644
--- a/src/ui/dialog/ocaldialogs.cpp
+++ b/src/ui/dialog/ocaldialogs.cpp
@@ -324,7 +324,11 @@ bool LoadingBox::_on_expose_event(GdkEventExpose* /*event*/)
}
#endif
-bool LoadingBox::_on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
+bool LoadingBox::_on_draw(const Cairo::RefPtr<Cairo::Context> &
+#if WITH_GTKMM_3_0
+cr
+#endif
+)
{
// Draw shadow
int x = get_allocation().get_x();
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 3188f1681..71674368b 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -231,8 +231,8 @@ void SymbolsDialog::rebuild() {
draw_symbols( symbolDocument );
}
-void SymbolsDialog::iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& data, guint info, guint time) {
-
+void SymbolsDialog::iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& /*context*/, Gtk::SelectionData& data, guint /*info*/, guint /*time*/)
+{
#if WITH_GTKMM_3_0
std::vector<Gtk::TreePath> iconArray = iconView->get_selected_items();
#else
diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c
index f617089a4..4fb79edd8 100644
--- a/src/ui/widget/gimpcolorwheel.c
+++ b/src/ui/widget/gimpcolorwheel.c
@@ -698,16 +698,15 @@ set_cross_grab (GimpColorWheel *wheel,
#endif
}
-static gboolean
-gimp_color_wheel_grab_broken (GtkWidget *widget,
- GdkEventGrabBroken *event)
+static gboolean gimp_color_wheel_grab_broken(GtkWidget *widget, GdkEventGrabBroken *event)
{
- GimpColorWheel *wheel = GIMP_COLOR_WHEEL (widget);
- GimpColorWheelPrivate *priv = wheel->priv;
+ (void)event;
+ GimpColorWheel *wheel = GIMP_COLOR_WHEEL (widget);
+ GimpColorWheelPrivate *priv = wheel->priv;
- priv->mode = DRAG_NONE;
+ priv->mode = DRAG_NONE;
- return TRUE;
+ return TRUE;
}
static gboolean
diff --git a/src/ui/widget/spin-scale.cpp b/src/ui/widget/spin-scale.cpp
index 00c575568..8aab57a34 100644
--- a/src/ui/widget/spin-scale.cpp
+++ b/src/ui/widget/spin-scale.cpp
@@ -19,10 +19,9 @@ namespace UI {
namespace Widget {
SpinScale::SpinScale(const char* label, double value, double lower, double upper, double step_inc,
- double climb_rate, int digits, const SPAttributeEnum a, const char* tip_text)
+ double /*climb_rate*/, int digits, const SPAttributeEnum a, const char* tip_text)
: AttrWidget(a, value)
{
-
#if WITH_GTKMM_3_0
_adjustment = Gtk::Adjustment::create(value, lower, upper, step_inc);
_spinscale = gimp_spin_scale_new (_adjustment->gobj(), label, digits);
diff --git a/src/widgets/eek-preview.cpp b/src/widgets/eek-preview.cpp
index 535a5d101..d637e4299 100644
--- a/src/widgets/eek-preview.cpp
+++ b/src/widgets/eek-preview.cpp
@@ -581,22 +581,6 @@ static gboolean eek_preview_button_release_cb( GtkWidget* widget, GdkEventButton
return FALSE;
}
-static gboolean eek_preview_key_press_event( GtkWidget* widget, GdkEventKey* event)
-{
- (void)widget;
- (void)event;
- g_message("TICK");
- return FALSE;
-}
-
-static gboolean eek_preview_key_release_event( GtkWidget* widget, GdkEventKey* event)
-{
- (void)widget;
- (void)event;
- g_message("tock");
- return FALSE;
-}
-
static void eek_preview_get_property( GObject *object,
guint property_id,
GValue *value,
diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp
index 32619de1f..d4186cd93 100644
--- a/src/widgets/fill-style.cpp
+++ b/src/widgets/fill-style.cpp
@@ -220,7 +220,7 @@ void FillNStroke::setDesktop(SPDesktop *desktop)
* Listen to this "change in tool" event, in case a subselection tool (such as Gradient or Node) selection
* is changed back to a selection tool - especially needed for selected gradient stops.
*/
-void FillNStroke::eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext)
+void FillNStroke::eventContextCB(SPDesktop * /*desktop*/, SPEventContext * /*eventcontext*/)
{
performUpdate();
}
diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp
index 2c6774fe9..972155ea9 100644
--- a/src/widgets/gradient-selector.cpp
+++ b/src/widgets/gradient-selector.cpp
@@ -487,8 +487,7 @@ SPGradient *SPGradientSelector::getVector()
}
-static void
-sp_gradient_selector_vector_set (SPGradientVectorSelector *gvs, SPGradient *gr, SPGradientSelector *sel)
+static void sp_gradient_selector_vector_set(SPGradientVectorSelector * /*gvs*/, SPGradient *gr, SPGradientSelector *sel)
{
if (!sel->blocked) {
@@ -497,7 +496,6 @@ sp_gradient_selector_vector_set (SPGradientVectorSelector *gvs, SPGradient *gr,
sel->setVector((gr) ? gr->document : 0, gr);
g_signal_emit (G_OBJECT (sel), signals[CHANGED], 0, gr);
sel->blocked = FALSE;
-
}
}
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index ff443504d..7866989b1 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -309,7 +309,7 @@ gboolean IconImpl::draw(GtkWidget *widget, cairo_t* cr)
}
#if !GTK_CHECK_VERSION(3,0,0)
-gboolean IconImpl::expose(GtkWidget *widget, GdkEventExpose *event)
+gboolean IconImpl::expose(GtkWidget *widget, GdkEventExpose * /*event*/)
{
gboolean result = TRUE;
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index fa586ce5f..07cafc391 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -539,7 +539,7 @@ void ColorNotebook::_colorChanged()
_updateRgbaEntry( _color, _alpha );
}
-void ColorNotebook::_picker_clicked(GtkWidget *widget, SPColorNotebook *colorbook)
+void ColorNotebook::_picker_clicked(GtkWidget * /*widget*/, SPColorNotebook * /*colorbook*/)
{
// Set the dropper into a "one click" mode, so it reverts to the previous tool after a click
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp
index bc6031c1e..43b7dc289 100644
--- a/src/widgets/sp-xmlview-tree.cpp
+++ b/src/widgets/sp-xmlview-tree.cpp
@@ -35,7 +35,6 @@ static void sp_xmlview_tree_destroy(GtkObject * object);
#endif
static NodeData * node_data_new (SPXMLViewTree * tree, GtkTreeIter * node, GtkTreeRowReference *rowref, Inkscape::XML::Node * repr);
-static void node_data_free (gpointer data);
static GtkTreeRowReference * add_node (SPXMLViewTree * tree, GtkTreeIter * parent, GtkTreeIter * before, Inkscape::XML::Node * repr);
@@ -261,15 +260,6 @@ NodeData *node_data_new(SPXMLViewTree * tree, GtkTreeIter * /*node*/, GtkTreeRow
return data;
}
-void node_data_free(gpointer ptr)
-{
- NodeData *data = static_cast<NodeData *>(ptr);
- sp_repr_remove_listener_by_data (data->repr, data);
- g_assert (data->repr != NULL);
- Inkscape::GC::release(data->repr);
- g_free (data);
-}
-
void element_child_added (Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node * child, Inkscape::XML::Node * ref, gpointer ptr)
{
NodeData *data = static_cast<NodeData *>(ptr);
diff --git a/src/widgets/spinbutton-events.cpp b/src/widgets/spinbutton-events.cpp
index 96d746468..7a481aea8 100644
--- a/src/widgets/spinbutton-events.cpp
+++ b/src/widgets/spinbutton-events.cpp
@@ -3,7 +3,9 @@
*
* Authors:
* bulia byak <bulia@users.sourceforge.net>
+ * Jon A. Cruz <jon@joncruz.org>
*
+ * Copyright (C) 2013 authors
* Copyright (C) 2003 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
@@ -22,122 +24,136 @@
#include "widget-sizes.h"
#include "spinbutton-events.h"
-gboolean
-spinbutton_focus_in (GtkWidget *w, GdkEventKey * /*event*/, gpointer /*data*/)
+gboolean spinbutton_focus_in(GtkWidget *w, GdkEventKey * /*event*/, gpointer /*data*/)
{
- gdouble *ini = static_cast<gdouble *>(g_object_get_data(G_OBJECT(w), "ini"));
- if (ini) g_free (ini); // free the old value if any
+ gdouble *ini = static_cast<gdouble *>(g_object_get_data(G_OBJECT(w), "ini"));
+ if (ini) {
+ g_free(ini); // free the old value if any
+ }
- // retrieve the value
- ini = g_new (gdouble, 1);
- *ini = gtk_spin_button_get_value (GTK_SPIN_BUTTON(w));
+ // retrieve the value
+ ini = g_new(gdouble, 1);
+ *ini = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
- // remember it
- g_object_set_data (G_OBJECT (w), "ini", ini);
+ // remember it
+ g_object_set_data(G_OBJECT(w), "ini", ini);
- return FALSE; // I didn't consume the event
+ return FALSE; // I didn't consume the event
}
-void
-spinbutton_undo (GtkWidget *w)
+void spinbutton_undo(GtkWidget *w)
{
- gdouble *ini = static_cast<gdouble *>(g_object_get_data(G_OBJECT (w), "ini"));
- if (ini) {
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), *ini);
- }
+ gdouble *ini = static_cast<gdouble *>(g_object_get_data(G_OBJECT(w), "ini"));
+ if (ini) {
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), *ini);
+ }
}
-void
-spinbutton_defocus (GtkWidget *container)
+void spinbutton_defocus(GtkWidget *container)
{
- // defocus spinbuttons by moving focus to the canvas, unless "stay" is on
- gboolean stay = GPOINTER_TO_INT(g_object_get_data(G_OBJECT (container), "stay"));
- if (stay) {
- g_object_set_data (G_OBJECT (container), "stay", GINT_TO_POINTER (FALSE));
- } else {
- GtkWidget *canvas = GTK_WIDGET(g_object_get_data(G_OBJECT (container), "dtw"));
- if (canvas) {
- gtk_widget_grab_focus (GTK_WIDGET(canvas));
- }
- }
+ // defocus spinbuttons by moving focus to the canvas, unless "stay" is on
+ gboolean stay = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(container), "stay"));
+ if (stay) {
+ g_object_set_data(G_OBJECT(container), "stay", GINT_TO_POINTER(FALSE));
+ } else {
+ GtkWidget *canvas = GTK_WIDGET(g_object_get_data(G_OBJECT(container), "dtw"));
+ if (canvas) {
+ gtk_widget_grab_focus(GTK_WIDGET(canvas));
+ }
+ }
}
-gboolean spinbutton_keypress(GtkWidget *w, GdkEventKey *event, gpointer data)
+gboolean spinbutton_keypress(GtkWidget *w, GdkEventKey *event, gpointer /*data*/)
{
- gdouble v;
- gdouble step;
- gdouble page;
+ gboolean result = FALSE; // I didn't consume the event
- switch (get_group0_keyval (event)) {
+ switch (get_group0_keyval(event)) {
case GDK_KEY_Escape: // defocus
- spinbutton_undo(w);
- spinbutton_defocus(w);
- return TRUE; // I consumed the event
- break;
+ spinbutton_undo(w);
+ spinbutton_defocus(w);
+ result = TRUE; // I consumed the event
+ break;
case GDK_KEY_Return: // defocus
case GDK_KEY_KP_Enter:
- spinbutton_defocus(w);
- return TRUE; // I consumed the event
- break;
+ spinbutton_defocus(w);
+ result = TRUE; // I consumed the event
+ break;
case GDK_KEY_Tab:
case GDK_KEY_ISO_Left_Tab:
- // set the flag meaning "do not leave toolbar when changing value"
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- return FALSE; // I didn't consume the event
- break;
+ // set the flag meaning "do not leave toolbar when changing value"
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ result = FALSE; // I didn't consume the event
+ break;
- // The following keys are processed manually because GTK implements them in strange ways
- // (increments start with double step value and seem to grow as you press the key continuously)
+ // The following keys are processed manually because GTK implements them in strange ways
+ // (increments start with double step value and seem to grow as you press the key continuously)
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
- gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
- v += step;
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
- return TRUE; // I consumed the event
- break;
+ {
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ gdouble v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
+ gdouble step = 0;
+ gdouble page = 0;
+ gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
+ v += step;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
+ result = TRUE; // I consumed the event
+ break;
+ }
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
- gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
- v -= step;
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
- return TRUE; // I consumed the event
- break;
+ {
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ gdouble v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
+ gdouble step = 0;
+ gdouble page = 0;
+ gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
+ v -= step;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
+ result = TRUE; // I consumed the event
+ break;
+ }
case GDK_KEY_Page_Up:
case GDK_KEY_KP_Page_Up:
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
- gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
- v += page;
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
- return TRUE; // I consumed the event
- break;
+ {
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ gdouble v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
+ gdouble step = 0;
+ gdouble page = 0;
+ gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
+ v += page;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
+ result = TRUE; // I consumed the event
+ break;
+ }
case GDK_KEY_Page_Down:
case GDK_KEY_KP_Page_Down:
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
- gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
- v -= page;
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
- return TRUE; // I consumed the event
- break;
+ {
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ gdouble v = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
+ gdouble step = 0;
+ gdouble page = 0;
+ gtk_spin_button_get_increments(GTK_SPIN_BUTTON(w), &step, &page);
+ v -= page;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), v);
+ result = TRUE; // I consumed the event
+ break;
+ }
case GDK_KEY_z:
case GDK_KEY_Z:
- g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
- if (event->state & GDK_CONTROL_MASK) {
- spinbutton_undo(w);
- return TRUE; // I consumed the event
- }
- break;
+ g_object_set_data(G_OBJECT(w), "stay", GINT_TO_POINTER(TRUE));
+ if (event->state & GDK_CONTROL_MASK) {
+ spinbutton_undo(w);
+ result = TRUE; // I consumed the event
+ }
+ break;
default:
- return FALSE;
- break;
- }
- return FALSE; // I didn't consume the event
+ result = FALSE;
+ break;
+ }
+
+ return result;
}
/*
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index 7912b654a..ede98a48a 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -434,8 +434,7 @@ StrokeStyle::makeRadioButton(Gtk::RadioButton *tb, char const *icon,
* Gets the marker uri string and applies it to all selected
* items in the current desktop.
*/
-void
-StrokeStyle::markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMarkerLoc const which)
+void StrokeStyle::markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMarkerLoc const /*which*/)
{
if (spw->update) {
return;
@@ -485,12 +484,10 @@ StrokeStyle::markerSelectCB(MarkerComboBox *marker_combo, StrokeStyle *spw, SPMa
css = 0;
spw->update = false;
-
};
-void
-StrokeStyle::updateMarkerHist(SPMarkerLoc const which) {
-
+void StrokeStyle::updateMarkerHist(SPMarkerLoc const which)
+{
switch (which) {
case SP_MARKER_LOC_START:
startMarkerConn.block();