From: joncruz Date: Tue, 20 Nov 2007 09:20:42 +0000 (+0000) Subject: Display CMS adjustment per-desktop view X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=713ffe6438216a16f37590dfcb78715b42906843;p=inkscape.git Display CMS adjustment per-desktop view --- diff --git a/src/color-profile.cpp b/src/color-profile.cpp index f676ceacf..2a17f698b 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -680,10 +680,9 @@ cmsHPROFILE Inkscape::colorprofile_get_system_profile_handle() init = true; } - long long int which = prefs_get_int_attribute_limited( "options.displayprofile", "enable", 0, 0, 1 ); gchar const * uri = prefs_get_string_attribute("options.displayprofile", "uri"); - if ( which && uri && *uri ) { + if ( uri && *uri ) { if ( lastURI != std::string(uri) ) { lastURI.clear(); if ( theOne ) { @@ -825,7 +824,7 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform() lastGamutColor = gamutColor; } - // Fecth these now, as they might clear the transform as a side effect. + // Fetch these now, as they might clear the transform as a side effect. cmsHPROFILE hprof = Inkscape::colorprofile_get_system_profile_handle(); cmsHPROFILE proofProf = hprof ? Inkscape::colorprofile_get_proof_profile_handle() : 0; diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index efd262890..80b9103eb 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1022,6 +1022,11 @@ sp_canvas_init (SPCanvas *canvas) canvas->forced_redraw_count = 0; canvas->forced_redraw_limit = -1; +#if ENABLE_LCMS + canvas->enable_cms_display_adj = false; + canvas->cms_key = new Glib::ustring(""); +#endif // ENABLE_LCMS + canvas->is_scrolling = false; } @@ -1593,7 +1598,7 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1, if (buf.is_empty) { #if ENABLE_LCMS - if ( transf ) { + if ( transf && canvas->enable_cms_display_adj ) { cmsDoTransform( transf, &buf.bg_color, &buf.bg_color, 1 ); } #endif // ENABLE_LCMS @@ -1627,7 +1632,7 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1, */ #if ENABLE_LCMS - if ( transf ) { + if ( transf && canvas->enable_cms_display_adj ) { for ( gint yy = 0; yy < (y1 - y0); yy++ ) { guchar* p = buf.buf + (sw * 3) * yy; cmsDoTransform( transf, p, p, (x1 - x0) ); diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index 3b4c7743f..4b6d7b3b8 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -33,6 +33,8 @@ #include #include +#include + #include #include #include @@ -60,13 +62,13 @@ struct SPCanvasBuf{ }; /** - * An SPCanvasItem refers to a SPCanvas and to its parent item; it has + * An SPCanvasItem refers to a SPCanvas and to its parent item; it has * four coordinates, a bounding rectangle, and a transformation matrix. */ struct SPCanvasItem : public GtkObject { SPCanvas *canvas; SPCanvasItem *parent; - + double x1, y1, x2, y2; NR::Rect bounds; NR::Matrix xform; @@ -77,10 +79,10 @@ struct SPCanvasItem : public GtkObject { */ struct SPCanvasItemClass : public GtkObjectClass { void (* update) (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags); - + void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); double (* point) (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item); - + int (* event) (SPCanvasItem *item, GdkEvent *event); }; @@ -114,45 +116,45 @@ gint sp_canvas_item_order(SPCanvasItem * item); */ struct SPCanvas { GtkWidget widget; - + guint idle_id; - + SPCanvasItem *root; - + double dx0, dy0; int x0, y0; - + /* Area that needs redrawing, stored as a microtile array */ int tLeft,tTop,tRight,tBottom; int tileH,tileV; uint8_t *tiles; - + /* Last known modifier state, for deferred repick when a button is down */ int state; - + /* The item containing the mouse pointer, or NULL if none */ SPCanvasItem *current_item; - + /* Item that is about to become current (used to track deletions and such) */ SPCanvasItem *new_current_item; - + /* Item that holds a pointer grab, or NULL if none */ SPCanvasItem *grabbed_item; - + /* Event mask specified when grabbing an item */ guint grabbed_event_mask; - + /* If non-NULL, the currently focused item */ SPCanvasItem *focused_item; - + /* Event on which selection of current item is based */ GdkEvent pick_event; - + int close_enough; - + /* GC for temporary draw pixmap */ GdkGC *pixmap_gc; - + unsigned int need_update : 1; unsigned int need_redraw : 1; unsigned int need_repick : 1; @@ -172,11 +174,16 @@ struct SPCanvas { // connector tool). If so, they may temporarily set this flag to // 'true'. bool gen_all_enter_events; - + int rendermode; +#if ENABLE_LCMS + bool enable_cms_display_adj; + Glib::ustring* cms_key; +#endif // ENABLE_LCMS + bool is_scrolling; - + NR::Rect getViewbox() const; }; diff --git a/src/dom/Makefile_insert b/src/dom/Makefile_insert index 15b590ec1..7777c4250 100644 --- a/src/dom/Makefile_insert +++ b/src/dom/Makefile_insert @@ -68,6 +68,8 @@ dom_libdom_a_SOURCES = \ dom/svg/svgparser.cpp \ dom/svg/svgparser.h \ dom/svg/svgtypes.h \ + dom/util/digest.h \ + dom/util/digest.cpp \ dom/util/thread.h \ dom/util/thread.cpp \ dom/util/ziptool.h \ diff --git a/src/dom/util/digest.h b/src/dom/util/digest.h index 46c60d2a3..045761d83 100644 --- a/src/dom/util/digest.h +++ b/src/dom/util/digest.h @@ -31,16 +31,16 @@ * replacement for the fine implementations already available. Rather, it * is a small and simple (and maybe a bit slow?) tool for moderate common * hashing requirements, like for communications and authentication. - * + * * These hashes are intended to be simple to use. For example: * Sha256Digest digest; * digest.append("The quick brown dog"); * std::string result = digest.finishHex(); - * + * * There are several forms of append() for convenience. * finish() and finishHex() call reset() for both security and * to prepare for the next use. - * + * */ #include @@ -49,7 +49,7 @@ /** * Base class. Do not use this class directly. Rather, use of of the - * subclasses below. + * subclasses below. * For all subclasses, overload reset(), update(unsigned char), and finish() */ class Digest @@ -69,7 +69,7 @@ public: HASH_SHA512, HASH_MD5 } HashType; - + /** * Constructor, with no type */ @@ -123,19 +123,19 @@ public: /** * Finish the hash and return a hexidecimal version of the computed - * value + * value */ virtual std::string finishHex(); /** - * Initialize the fields of this hash engine to its starting values. + * Initialize the fields of this hash engine to its starting values. * Overload this in every subclass */ virtual void reset() {} /** - * Finish the hash and return its computed value + * Finish the hash and return its computed value * Overload this in every subclass */ virtual std::vector finish() @@ -147,15 +147,15 @@ public: protected: /** - * Update the hash with a given byte + * Update the hash with a given byte * Overload this in every subclass */ - virtual void update(unsigned char ch) + virtual void update(unsigned char /*ch*/) {} /** * The enumerated type of the hash - */ + */ int hashType; }; @@ -164,7 +164,7 @@ protected: /** - * SHA-1, + * SHA-1, * Section 6.1, SECURE HASH STANDARD * Federal Information Processing Standards Publication 180-2 * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf @@ -219,7 +219,7 @@ private: /** - * SHA-224, + * SHA-224, * Section 6.1, SECURE HASH STANDARD * Federal Information Processing Standards Publication 180-2 * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf @@ -271,7 +271,7 @@ private: /** - * SHA-256, + * SHA-256, * Section 6.1, SECURE HASH STANDARD * Federal Information Processing Standards Publication 180-2 * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf @@ -375,7 +375,7 @@ private: /** - * SHA-512, + * SHA-512, * Section 6.1, SECURE HASH STANDARD * Federal Information Processing Standards Publication 180-2 * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf @@ -434,7 +434,7 @@ private: /** * IETF RFC 1321, MD5 Specification - * http://www.ietf.org/rfc/rfc1321.txt + * http://www.ietf.org/rfc/rfc1321.txt */ class Md5Digest : public Digest { diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index cd4727973..5d747807b 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -627,22 +627,18 @@ void InkscapePreferences::initPageImportExport() } #if ENABLE_LCMS -static void forceUpdates() { - std::list tops; - inkscape_get_all_desktops( tops ); - for ( std::list::iterator it = tops.begin(); it != tops.end(); ++it ) { - (*it)->requestRedraw(); - } -} - static void profileComboChanged( Gtk::ComboBoxText* combo ) { - Glib::ustring active = combo->get_active_text(); - - Glib::ustring path = get_path_for_profile(active); - if ( !path.empty() ) { - prefs_set_string_attribute( "options.displayprofile", "uri", path.c_str() ); - forceUpdates(); + int rowNum = combo->get_active_row_number(); + if ( rowNum < 1 ) { + prefs_set_string_attribute( "options.displayprofile", "uri", "" ); + } else { + Glib::ustring active = combo->get_active_text(); + + Glib::ustring path = get_path_for_profile(active); + if ( !path.empty() ) { + prefs_set_string_attribute( "options.displayprofile", "uri", path.c_str() ); + } } } @@ -653,7 +649,6 @@ static void proofComboChanged( Gtk::ComboBoxText* combo ) Glib::ustring path = get_path_for_profile(active); if ( !path.empty() ) { prefs_set_string_attribute( "options.softproof", "uri", path.c_str() ); - forceUpdates(); } } @@ -667,7 +662,6 @@ static void gamutColorChanged( Gtk::ColorButton* btn ) { prefs_set_string_attribute( "options.softproof", "gamutcolor", tmp ); g_free(tmp); - forceUpdates(); } #endif // ENABLE_LCMS @@ -685,10 +679,6 @@ void InkscapePreferences::initPageCMS() _page_cms.add_group_header( _("Display Calibration")); - _cms_display.init( _("Enable display calibration"), "options.displayprofile", "enable", false); - _page_cms.add_line( false, "", _cms_display, "", - _("Enables application of the display using an ICC profile."), false); - _page_cms.add_line( false, _("Display profile:"), _cms_display_profile, "", _("The ICC profile to use to calibrate display output."), false); @@ -743,6 +733,8 @@ void InkscapePreferences::initPageCMS() Glib::ustring current = prefs_get_string_attribute( "options.displayprofile", "uri" ); gint index = 0; + _cms_display_profile.append_text(_("")); + index++; for ( std::vector::iterator it = names.begin(); it != names.end(); ++it ) { _cms_display_profile.append_text( *it ); Glib::ustring path = get_path_for_profile(*it); @@ -751,6 +743,9 @@ void InkscapePreferences::initPageCMS() } index++; } + if ( current.empty() ) { + _cms_display_profile.set_active(0); + } names = ::Inkscape::colorprofile_get_softproof_names(); const gchar * tmp = prefs_get_string_attribute( "options.softproof", "uri" ); @@ -766,21 +761,12 @@ void InkscapePreferences::initPageCMS() } } - _cms_display.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); - _cms_softproof.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); - _cms_gamutwarn.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); _cms_gamutcolor.signal_color_set().connect( sigc::bind( sigc::ptr_fun(gamutColorChanged), &_cms_gamutcolor) ); - _cms_proof_blackpoint.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); - _cms_proof_preserveblack.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); - - _cms_intent.signal_changed().connect( sigc::ptr_fun(forceUpdates) ); - _cms_proof_intent.signal_changed().connect( sigc::ptr_fun(forceUpdates) ); _cms_display_profile.signal_changed().connect( sigc::bind( sigc::ptr_fun(profileComboChanged), &_cms_display_profile) ); _cms_proof_profile.signal_changed().connect( sigc::bind( sigc::ptr_fun(proofComboChanged), &_cms_proof_profile) ); #else // disable it, but leave it visible - _cms_display.set_sensitive( false ); _cms_intent.set_sensitive( false ); _cms_display_profile.set_sensitive( false ); _cms_softproof.set_sensitive( false ); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index a6da63617..12a73d017 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -165,7 +165,6 @@ protected: PrefCheckButton _misc_small_tools; PrefCombo _misc_overs_bitmap; - PrefCheckButton _cms_display; Gtk::ComboBoxText _cms_display_profile; PrefCombo _cms_intent; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 51355b3e5..1494d3c24 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -37,6 +37,7 @@ #include "interface.h" #include "toolbox.h" #include "prefs-utils.h" +#include "preferences.h" #include "file.h" #include "display/canvas-arena.h" #include "display/nr-arena.h" @@ -56,6 +57,8 @@ #include "conn-avoid-ref.h" #include "ege-select-one-action.h" #include "ege-color-prof-tracker.h" +#include "dom/util/digest.h" +#include "xml/node-observer.h" #if defined (SOLARIS_2_8) #include "round.h" @@ -88,8 +91,8 @@ static void sp_desktop_widget_realize (GtkWidget *widget); static gint sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dtw); -static void sp_dtw_color_profile_event(GtkWidget *widget, SPDesktopWidget *dtw); - +static void sp_dtw_color_profile_event(EgeColorProfTracker *widget, SPDesktopWidget *dtw); +static void cms_adjust_toggled( GtkWidget *button, gpointer data ); static void sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget *dtw); static void sp_desktop_widget_namedview_modified (SPObject *obj, guint flags, SPDesktopWidget *dtw); @@ -109,6 +112,91 @@ static void sp_dtw_zoom_selection (GtkMenuItem *item, gpointer data); SPViewWidgetClass *dtw_parent_class; +using Inkscape::XML::Node; + +class PrefWatcher : public Inkscape::XML::NodeObserver { +public: + PrefWatcher() : + NodeObserver(), + dtws() + { + } + + virtual ~PrefWatcher(); + + + virtual void notifyChildAdded( Node &/*node*/, Node &/*child*/, Node */*prev*/ ) {} + virtual void notifyChildRemoved( Node &/*node*/, Node &/*child*/, Node */*prev*/ ) {} + virtual void notifyChildOrderChanged( Node &/*node*/, Node &/*child*/, + Node */*old_prev*/, Node */*new_prev*/ ) {} + virtual void notifyContentChanged( Node &/*node*/, + Inkscape::Util::ptr_shared /*old_content*/, + Inkscape::Util::ptr_shared /*new_content*/ ) {} + virtual void notifyAttributeChanged( Node &node, GQuark name, + Inkscape::Util::ptr_shared old_value, + Inkscape::Util::ptr_shared new_value ); + void add( SPDesktopWidget* dtw ); + void remove( SPDesktopWidget* dtw ); + +private: + std::list dtws; +}; + +PrefWatcher::~PrefWatcher() +{ +} + +void PrefWatcher::add( SPDesktopWidget* dtw ) +{ + dtws.push_back(dtw); +} + +void PrefWatcher::remove( SPDesktopWidget* dtw ) +{ + dtws.remove(dtw); +} + +void PrefWatcher::notifyAttributeChanged( Node &node, GQuark name, + Inkscape::Util::ptr_shared /*old_value*/, + Inkscape::Util::ptr_shared /*new_value*/ ) +{ +#if ENABLE_LCMS + (void)name; + if ( strcmp("group", node.name()) == 0 ) { + gchar const* id = node.attribute("id"); + bool refresh = false; + if ( !id ) { + // bad + } else if (strcmp("displayprofile", id) == 0) { + Glib::ustring current = prefs_get_string_attribute( "options.displayprofile", "uri" ); + bool enabled = current.length() > 0; + + for ( std::list::iterator it = dtws.begin(); it != dtws.end(); ++it ) { + SPDesktopWidget* dtw = *it; + if ( GTK_WIDGET_SENSITIVE( dtw->cms_adjust ) != enabled ) { + gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + } + } + refresh = true; + } else if (strcmp("softproof", id) == 0) { + refresh = true; + } + + if ( refresh ) { + for ( std::list::iterator it = dtws.begin(); it != dtws.end(); ++it ) { + (*it)->requestCanvasUpdate(); + } + } +#else + (void)node; + (void)name; + (void)new_value; +#endif // ENABLE_LCMS + } +} + +static PrefWatcher* watcher = 0; + void SPDesktopWidget::setMessage (Inkscape::MessageType type, const gchar *message) { @@ -282,11 +370,41 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) "swatches", _("Adjust the display"), dtw->tt ); +#if ENABLE_LCMS + { + Glib::ustring current = prefs_get_string_attribute( "options.displayprofile", "uri" ); + bool enabled = current.length() > 0; + gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + if ( enabled ) { + long long int active = prefs_get_int_attribute_limited( "options.displayprofile", "enable", 0, 0, 1 ); + if ( active ) { + sp_button_toggle_set_down( SP_BUTTON(dtw->cms_adjust), TRUE ); + } + } + } + g_signal_connect_after( G_OBJECT(dtw->cms_adjust), "clicked", G_CALLBACK(cms_adjust_toggled), dtw ); +#else gtk_widget_set_sensitive(dtw->cms_adjust, FALSE); +#endif // ENABLE_LCMS gtk_table_attach( GTK_TABLE(canvas_tbl), dtw->cms_adjust, 2, 3, 2, 3, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_SHRINK), 0, 0); + { + Inkscape::XML::Node* prefs = Inkscape::Preferences::get(); + if ( prefs ) { + if (!watcher) { + watcher = new PrefWatcher(); + prefs->addSubtreeObserver( *watcher ); + } + watcher->add(dtw); + } else { + g_warning("NULL preferences instance encountered"); + } + } /* Canvas */ dtw->canvas = SP_CANVAS (sp_canvas_new_aa ()); +#if ENABLE_LCMS + dtw->canvas->enable_cms_display_adj = prefs_get_int_attribute_limited( "options.displayprofile", "enable", 0, 0, 1 ) != 0; +#endif // ENABLE_LCMS GTK_WIDGET_SET_FLAGS (GTK_WIDGET (dtw->canvas), GTK_CAN_FOCUS); style = gtk_style_copy (GTK_WIDGET (dtw->canvas)->style); style->bg[GTK_STATE_NORMAL] = style->white; @@ -412,6 +530,9 @@ sp_desktop_widget_destroy (GtkObject *object) SPDesktopWidget *dtw = SP_DESKTOP_WIDGET (object); if (dtw->desktop) { + if ( watcher ) { + watcher->remove(dtw); + } g_signal_handlers_disconnect_by_func(G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK(sp_dtw_zoom_input), dtw); g_signal_handlers_disconnect_by_func(G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK(sp_dtw_zoom_output), dtw); gtk_signal_disconnect_by_data (GTK_OBJECT (dtw->zoom_status), dtw->zoom_status); @@ -587,19 +708,40 @@ sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dt return FALSE; } -void sp_dtw_color_profile_event(GtkWidget */*widget*/, SPDesktopWidget */*dtw*/) +void sp_dtw_color_profile_event(EgeColorProfTracker *tracker, SPDesktopWidget */*dtw*/) { // Handle profile changes + Md5Digest digest; + unsigned char* buf = 0; + guint len = 0; + ege_color_prof_tracker_get_profile( tracker, reinterpret_cast(&buf), &len ); + if ( buf && len ) { + digest.append(buf, len); + } + std::string hash = digest.finishHex(); + //g_message("ICC profile %d bytes at %p is [%s]", len, buf, hash.c_str() ); +} + +void cms_adjust_toggled( GtkWidget */*button*/, gpointer data ) +{ + SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(data); + + bool down = SP_BUTTON_IS_DOWN(dtw->cms_adjust); + if ( down != dtw->canvas->enable_cms_display_adj ) { + dtw->canvas->enable_cms_display_adj = down; + dtw->requestCanvasUpdate(); + prefs_set_int_attribute( "options.displayprofile", "enable", down ? 1 : 0 ); + } } void -sp_dtw_desktop_activate (SPDesktopWidget *dtw) +sp_dtw_desktop_activate (SPDesktopWidget */*dtw*/) { /* update active desktop indicator */ } void -sp_dtw_desktop_deactivate (SPDesktopWidget *dtw) +sp_dtw_desktop_deactivate (SPDesktopWidget */*dtw*/) { /* update inactive desktop indicator */ } @@ -818,6 +960,7 @@ void SPDesktopWidget::getWindowGeometry (gint &x, gint &y, gint &w, gint &h) { gboolean vis = GTK_WIDGET_VISIBLE (this); + (void)vis; // TODO figure out why it is here but not used. Gtk::Window *window = (Gtk::Window*)gtk_object_get_data (GTK_OBJECT(this), "window"); @@ -1178,7 +1321,7 @@ sp_desktop_widget_namedview_modified (SPObject *obj, guint flags, SPDesktopWidge } static void -sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget *dtw) +sp_desktop_widget_adjustment_value_changed (GtkAdjustment */*adj*/, SPDesktopWidget *dtw) { if (dtw->update) return; @@ -1195,7 +1338,7 @@ sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget bool SPDesktopWidget::onFocusInEvent(GdkEventFocus*) { inkscape_activate_desktop (desktop); - + return false; } @@ -1212,7 +1355,7 @@ sp_dtw_zoom_display_to_value (gdouble value) } static gint -sp_dtw_zoom_input (GtkSpinButton *spin, gdouble *new_val, gpointer data) +sp_dtw_zoom_input (GtkSpinButton *spin, gdouble *new_val, gpointer /*data*/) { gdouble new_scrolled = gtk_spin_button_get_value (spin); const gchar *b = gtk_entry_get_text (GTK_ENTRY (spin)); @@ -1228,7 +1371,7 @@ sp_dtw_zoom_input (GtkSpinButton *spin, gdouble *new_val, gpointer data) } static bool -sp_dtw_zoom_output (GtkSpinButton *spin, gpointer data) +sp_dtw_zoom_output (GtkSpinButton *spin, gpointer /*data*/) { gchar b[64]; double val = sp_dtw_zoom_value_to_display (gtk_spin_button_get_value (spin)); @@ -1258,7 +1401,7 @@ sp_dtw_zoom_value_changed (GtkSpinButton *spin, gpointer data) } static void -sp_dtw_zoom_populate_popup (GtkEntry *entry, GtkMenu *menu, gpointer data) +sp_dtw_zoom_populate_popup (GtkEntry */*entry*/, GtkMenu *menu, gpointer data) { GList *children, *iter; GtkWidget *item; @@ -1309,37 +1452,37 @@ sp_dtw_zoom_menu_handler (SPDesktop *dt, gdouble factor) } static void -sp_dtw_zoom_50 (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_50 (GtkMenuItem */*item*/, gpointer data) { sp_dtw_zoom_menu_handler (static_cast(data), 0.5); } static void -sp_dtw_zoom_100 (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_100 (GtkMenuItem */*item*/, gpointer data) { sp_dtw_zoom_menu_handler (static_cast(data), 1.0); } static void -sp_dtw_zoom_200 (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_200 (GtkMenuItem */*item*/, gpointer data) { sp_dtw_zoom_menu_handler (static_cast(data), 2.0); } static void -sp_dtw_zoom_page (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_page (GtkMenuItem */*item*/, gpointer data) { static_cast(data)->zoom_page(); } static void -sp_dtw_zoom_drawing (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_drawing (GtkMenuItem */*item*/, gpointer data) { static_cast(data)->zoom_drawing(); } static void -sp_dtw_zoom_selection (GtkMenuItem *item, gpointer data) +sp_dtw_zoom_selection (GtkMenuItem */*item*/, gpointer data) { static_cast(data)->zoom_selection(); }