From ce88465b100dc0c48e434e1ec36df908b76188fd Mon Sep 17 00:00:00 2001 From: bryce Date: Wed, 30 Jan 2008 21:25:22 +0000 Subject: [PATCH] Fix for if LCMS is disabled. (LP# 174854) --- src/widgets/desktop-widget.cpp | 10 +++++++++- src/widgets/sp-color-icc-selector.cpp | 8 +++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 76452d851..146717fc2 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -156,11 +156,13 @@ PrefWatcher::~PrefWatcher() void PrefWatcher::hook(EgeColorProfTracker */*tracker*/, gint screen, gint monitor, PrefWatcher */*watcher*/) { +#if ENABLE_LCMS unsigned char* buf = 0; guint len = 0; ege_color_prof_tracker_get_profile_for( screen, monitor, reinterpret_cast(&buf), &len ); Glib::ustring id = Inkscape::colorprofile_set_display_per( buf, len, screen, monitor ); +#endif // ENABLE_LCMS } void PrefWatcher::add( SPDesktopWidget* dtw ) @@ -205,9 +207,9 @@ void PrefWatcher::notifyAttributeChanged( Node &node, GQuark name, } } #else + { (void)node; (void)name; - (void)new_value; #endif // ENABLE_LCMS } } @@ -527,6 +529,7 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) gtk_box_pack_start(GTK_BOX(dtw->statusbar), GTK_WIDGET(dtw->layer_selector->gobj()), FALSE, FALSE, 1); dtw->_tracker = ege_color_prof_tracker_new(GTK_WIDGET(dtw->layer_selector->gobj())); +#if ENABLE_LCMS { Glib::ustring id = Inkscape::colorprofile_get_display_id( 0, 0 ); bool enabled = false; @@ -536,6 +539,7 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) } cms_adjust_set_sensitive( dtw, enabled ); } +#endif // ENABLE_LCMS g_signal_connect( G_OBJECT(dtw->_tracker), "changed", G_CALLBACK(sp_dtw_color_profile_event), dtw ); dtw->select_status_eventbox = gtk_event_box_new (); @@ -744,6 +748,7 @@ sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dt void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidget *dtw) { +#if ENABLE_LCMS // Handle profile changes GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(dtw)); gint screenNum = gdk_screen_get_number(screen); @@ -756,10 +761,12 @@ void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidge enabled = !dtw->canvas->cms_key->empty(); } cms_adjust_set_sensitive( dtw, enabled ); +#endif // ENABLE_LCMS } void cms_adjust_toggled( GtkWidget */*button*/, gpointer data ) { +#if ENABLE_LCMS SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(data); bool down = SP_BUTTON_IS_DOWN(dtw->cms_adjust); @@ -768,6 +775,7 @@ void cms_adjust_toggled( GtkWidget */*button*/, gpointer data ) dtw->requestCanvasUpdate(); prefs_set_int_attribute( "options.displayprofile", "enable", down ? 1 : 0 ); } +#endif // ENABLE_LCMS } void cms_adjust_set_sensitive( SPDesktopWidget *dtw, bool enabled ) diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 6dcdfc977..43a2a3cbe 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -466,6 +466,7 @@ void ColorICCSelector::_profileSelected( GtkWidget* /*src*/, gpointer data ) } #endif // ENABLE_LCMS +#ifdef ENABLE_LCMS void ColorICCSelector::_switchToProfile( gchar const* name ) { bool dirty = false; @@ -486,7 +487,6 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) tmp.icc = new SVGICCColor(); } tmp.icc->colorProfile = name; -#if ENABLE_LCMS Inkscape::ColorProfile* newProf = SP_ACTIVE_DOCUMENT->profileManager->find(name); if ( newProf ) { cmsHTRANSFORM trans = newProf->getTransfFromSRGB8(); @@ -529,7 +529,6 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) } } } -#endif // ENABLE_LCMS dirty = true; } } else { @@ -561,9 +560,11 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) #endif // DEBUG_LCMS } } +#endif // ENABLE_LCMS void ColorICCSelector::_profilesChanged( std::string const & name ) { +#ifdef ENABLE_LCMS GtkComboBox* combo = GTK_COMBO_BOX(_profileSel); g_signal_handler_block( G_OBJECT(_profileSel), _profChangedID ); @@ -593,6 +594,7 @@ void ColorICCSelector::_profilesChanged( std::string const & name ) } g_signal_handler_unblock( G_OBJECT(_profileSel), _profChangedID ); +#endif // ENABLE_LCMS } /* Helpers for setting color value */ @@ -645,7 +647,7 @@ void ColorICCSelector::_colorChanged() } } #else - (void)color; + //(void)color; #endif // ENABLE_LCMS _updateSliders( -1 ); -- 2.30.2