summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-02-13 09:27:56 +0000
committerJon A. Cruz <jon@joncruz.org>2012-02-13 09:27:56 +0000
commit33e08823fec6157953453a938b10e2c731c8e1df (patch)
treef0c0214357fb5faeef6e2214d075384e72eccb8f /src/widgets
parentFix wrong placement in authors (diff)
downloadinkscape-33e08823fec6157953453a938b10e2c731c8e1df.tar.gz
inkscape-33e08823fec6157953453a938b10e2c731c8e1df.zip
Enable LCMS2 for other than OSX, where it still has some issues. Fixes bug #885324.
Fixed bugs: - https://launchpad.net/bugs/885324 (bzr r10969)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/desktop-widget.cpp38
-rw-r--r--src/widgets/sp-color-icc-selector.cpp116
-rw-r--r--src/widgets/sp-color-icc-selector.h8
-rw-r--r--src/widgets/sp-color-notebook.cpp16
-rw-r--r--src/widgets/sp-color-notebook.h4
5 files changed, 95 insertions, 87 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index e5058680f..2c41bf2d1 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -105,9 +105,9 @@ 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(EgeColorProfTracker *widget, SPDesktopWidget *dtw);
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
static void cms_adjust_toggled( GtkWidget *button, gpointer data );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
static void cms_adjust_set_sensitive( SPDesktopWidget *dtw, bool enabled );
static void sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget *dtw);
@@ -189,7 +189,7 @@ private:
friend class SoftproofWatcher;
};
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void CMSPrefWatcher::hook(EgeColorProfTracker * /*tracker*/, gint screen, gint monitor, CMSPrefWatcher * /*watcher*/)
{
unsigned char* buf = 0;
@@ -202,22 +202,22 @@ void CMSPrefWatcher::hook(EgeColorProfTracker * /*tracker*/, gint screen, gint m
void CMSPrefWatcher::hook(EgeColorProfTracker * /*tracker*/, gint /*screen*/, gint /*monitor*/, CMSPrefWatcher * /*watcher*/)
{
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/// @todo Use conditional compilation in saner places. The whole PrefWatcher
-/// object is unnecessary if ENABLE_LCMS is not defined.
+/// object is unnecessary if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) is not defined.
void CMSPrefWatcher::_refreshAll()
{
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
for ( std::list<SPDesktopWidget*>::iterator it = _widget_list.begin(); it != _widget_list.end(); ++it ) {
(*it)->requestCanvasUpdate();
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
void CMSPrefWatcher::_setCmsSensitive(bool enabled)
{
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
for ( std::list<SPDesktopWidget*>::iterator it = _widget_list.begin(); it != _widget_list.end(); ++it ) {
SPDesktopWidget *dtw = *it;
if ( gtk_widget_get_sensitive( dtw->cms_adjust ) != enabled ) {
@@ -226,7 +226,7 @@ void CMSPrefWatcher::_setCmsSensitive(bool enabled)
}
#else
(void) enabled;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
static CMSPrefWatcher* watcher = NULL;
@@ -420,7 +420,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
NULL,
INKSCAPE_ICON("color-management"),
tip );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
Glib::ustring current = prefs->getString("/options/displayprofile/uri");
bool enabled = current.length() > 0;
@@ -435,7 +435,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
g_signal_connect_after( G_OBJECT(dtw->cms_adjust), "clicked", G_CALLBACK(cms_adjust_toggled), dtw );
#else
cms_adjust_set_sensitive(dtw, FALSE);
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_table_attach( GTK_TABLE(canvas_tbl), dtw->cms_adjust, 2, 3, 2, 3, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_SHRINK), 0, 0);
{
if (!watcher) {
@@ -446,9 +446,9 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
/* Canvas */
dtw->canvas = SP_CANVAS(SPCanvas::createAA());
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
dtw->canvas->enable_cms_display_adj = prefs->getBool("/options/displayprofile/enable");
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_widget_set_can_focus (GTK_WIDGET (dtw->canvas), TRUE);
style = gtk_style_copy(gtk_widget_get_style(GTK_WIDGET(dtw->canvas)));
style->bg[GTK_STATE_NORMAL] = style->white;
@@ -546,7 +546,7 @@ void SPDesktopWidget::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
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
bool fromDisplay = prefs->getBool( "/options/displayprofile/from_display");
if ( fromDisplay ) {
Glib::ustring id = Inkscape::CMSSystem::getDisplayId( 0, 0 );
@@ -556,7 +556,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
enabled = !dtw->canvas->cms_key.empty();
cms_adjust_set_sensitive( dtw, enabled );
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
g_signal_connect( G_OBJECT(dtw->_tracker), "changed", G_CALLBACK(sp_dtw_color_profile_event), dtw );
dtw->select_status_eventbox = gtk_event_box_new ();
@@ -801,7 +801,7 @@ sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dt
return FALSE;
}
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidget *dtw)
{
// Handle profile changes
@@ -820,9 +820,9 @@ void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidge
void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidget * /*dtw*/)
{
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void cms_adjust_toggled( GtkWidget */*button*/, gpointer data )
{
SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(data);
@@ -840,7 +840,7 @@ void cms_adjust_toggled( GtkWidget */*button*/, gpointer data )
}
}
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
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 c9550f244..844ba0020 100644
--- a/src/widgets/sp-color-icc-selector.cpp
+++ b/src/widgets/sp-color-icc-selector.cpp
@@ -14,7 +14,7 @@
#define noDEBUG_LCMS
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#include "color-profile.h"
#include "cms-system.h"
#include "color-profile-cms-fns.h"
@@ -22,7 +22,7 @@
#ifdef DEBUG_LCMS
#include "preferences.h"
#endif // DEBUG_LCMS
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#ifdef DEBUG_LCMS
@@ -142,13 +142,13 @@ ColorICCSelector::ColorICCSelector( SPColorSelector* csel )
_slider(0),
_sbtn(0),
_label(0)
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
,
_profileName(""),
_prof(),
_profChannelCount(0),
_profChangedID(0)
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
}
@@ -180,32 +180,32 @@ icSigCmyData
#define SPACE_ID_CMYK 2
-#if ENABLE_LCMS
-static icUInt16Number* getScratch() {
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+static cmsUInt16Number* getScratch() {
// bytes per pixel * input channels * width
- static icUInt16Number* scritch = static_cast<icUInt16Number*>(g_new(icUInt16Number, 4 * 1024));
+ static cmsUInt16Number* scritch = static_cast<cmsUInt16Number*>(g_new(cmsUInt16Number, 4 * 1024));
return scritch;
}
struct MapMap {
- DWORD space;
- DWORD inForm;
+ cmsUInt32Number space;
+ cmsUInt32Number inForm;
};
-void getThings( DWORD space, gchar const**& namers, gchar const**& tippies, guint const*& scalies ) {
+void getThings( cmsUInt32Number space, gchar const**& namers, gchar const**& tippies, guint const*& scalies ) {
MapMap possible[] = {
- {icSigXYZData, TYPE_XYZ_16},
- {icSigLabData, TYPE_Lab_16},
- //icSigLuvData
- {icSigYCbCrData, TYPE_YCbCr_16},
- {icSigYxyData, TYPE_Yxy_16},
- {icSigRgbData, TYPE_RGB_16},
- {icSigGrayData, TYPE_GRAY_16},
- {icSigHsvData, TYPE_HSV_16},
- {icSigHlsData, TYPE_HLS_16},
- {icSigCmykData, TYPE_CMYK_16},
- {icSigCmyData, TYPE_CMY_16},
+ {cmsSigXYZData, TYPE_XYZ_16},
+ {cmsSigLabData, TYPE_Lab_16},
+ //cmsSigLuvData
+ {cmsSigYCbCrData, TYPE_YCbCr_16},
+ {cmsSigYxyData, TYPE_Yxy_16},
+ {cmsSigRgbData, TYPE_RGB_16},
+ {cmsSigGrayData, TYPE_GRAY_16},
+ {cmsSigHsvData, TYPE_HSV_16},
+ {cmsSigHlsData, TYPE_HLS_16},
+ {cmsSigCmykData, TYPE_CMYK_16},
+ {cmsSigCmyData, TYPE_CMY_16},
};
static gchar const *names[][6] = {
@@ -268,7 +268,7 @@ void getThings( Inkscape::ColorProfile *prof, gchar const**& namers, gchar const
getThings( asICColorSpaceSig(prof->getColorSpace()), namers, tippies, scalies );
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::init()
@@ -283,12 +283,12 @@ void ColorICCSelector::init()
gtk_widget_show (t);
gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 0);
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
//guint partCount = _cmsChannelsOf( icSigRgbData );
gchar const** names = 0;
gchar const** tips = 0;
- getThings( icSigRgbData, names, tips, _fooScales );
-#endif // ENABLE_LCMS
+ getThings( cmsSigRgbData, names, tips, _fooScales );
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Create components */
row = 0;
@@ -314,11 +314,11 @@ void ColorICCSelector::init()
gtk_combo_box_set_active( GTK_COMBO_BOX(_profileSel), 0 );
gtk_table_attach( GTK_TABLE(t), _profileSel, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_profChangedID = g_signal_connect( G_OBJECT(_profileSel), "changed", G_CALLBACK(_profileSelected), (gpointer)this );
#else
gtk_widget_set_sensitive( _profileSel, false );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
row++;
@@ -332,11 +332,11 @@ void ColorICCSelector::init()
for ( guint i = 0; i < _fooCount; i++ ) {
/* Label */
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_fooLabel[i] = gtk_label_new_with_mnemonic( names[i] );
#else
_fooLabel[i] = gtk_label_new_with_mnemonic( "." );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_misc_set_alignment( GTK_MISC (_fooLabel[i]), 1.0, 0.5 );
gtk_widget_show( _fooLabel[i] );
gtk_table_attach( GTK_TABLE (t), _fooLabel[i], 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD );
@@ -349,20 +349,20 @@ void ColorICCSelector::init()
/* Slider */
_fooSlider[i] = sp_color_slider_new( _fooAdj[i] );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_widget_set_tooltip_text( _fooSlider[i], tips[i] );
#else
gtk_widget_set_tooltip_text( _fooSlider[i], "." );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_widget_show( _fooSlider[i] );
gtk_table_attach( GTK_TABLE (t), _fooSlider[i], 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)GTK_FILL, XPAD, YPAD );
_fooBtn[i] = gtk_spin_button_new( _fooAdj[i], step, digits );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_widget_set_tooltip_text( _fooBtn[i], tips[i] );
#else
gtk_widget_set_tooltip_text( _fooBtn[i], "." );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
sp_dialog_defocus_on_enter( _fooBtn[i] );
gtk_label_set_mnemonic_widget( GTK_LABEL(_fooLabel[i]), _fooBtn[i] );
gtk_widget_show( _fooBtn[i] );
@@ -460,7 +460,7 @@ void ColorICCSelector::_fixupHit( GtkWidget* /*src*/, gpointer data )
self->_adjustmentChanged( self->_fooAdj[0], SP_COLOR_ICC_SELECTOR(self->_csel) );
}
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::_profileSelected( GtkWidget* /*src*/, gpointer data )
{
ColorICCSelector* self = reinterpret_cast<ColorICCSelector*>(data);
@@ -475,9 +475,9 @@ void ColorICCSelector::_profileSelected( GtkWidget* /*src*/, gpointer data )
g_free( name );
}
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-#ifdef ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::_switchToProfile( gchar const* name )
{
bool dirty = false;
@@ -511,12 +511,16 @@ void ColorICCSelector::_switchToProfile( gchar const* name )
#ifdef DEBUG_LCMS
g_message("Shoving in [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]);
#endif // DEBUG_LCMS
- icUInt16Number post[4] = {0,0,0,0};
+ cmsUInt16Number post[4] = {0,0,0,0};
cmsDoTransform( trans, pre, post, 1 );
#ifdef DEBUG_LCMS
g_message("got on out [%04x] [%04x] [%04x] [%04x]", post[0], post[1], post[2], post[3]);
#endif // DEBUG_LCMS
+#if HAVE_LIBLCMS1
guint count = _cmsChannelsOf( asICColorSpaceSig(newProf->getColorSpace()) );
+#elif HAVE_LIBLCMS2
+ guint count = cmsChannelsOf( asICColorSpaceSig(newProf->getColorSpace()) );
+#endif
gchar const** names = 0;
gchar const** tips = 0;
@@ -571,9 +575,9 @@ void ColorICCSelector::_switchToProfile( gchar const* name )
#endif // DEBUG_LCMS
}
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-#ifdef ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::_profilesChanged( std::string const & name )
{
GtkComboBox* combo = GTK_COMBO_BOX(_profileSel);
@@ -622,7 +626,7 @@ void ColorICCSelector::_profilesChanged( std::string const & name )
void ColorICCSelector::_profilesChanged( std::string const & /*name*/ )
{
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Helpers for setting color value */
@@ -644,13 +648,13 @@ void ColorICCSelector::_colorChanged()
_profilesChanged( (_color.icc) ? _color.icc->colorProfile : std::string("") );
ColorScales::setScaled( _adj, _alpha );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_setProfile( _color.icc );
_fixupNeeded = 0;
gtk_widget_set_sensitive( _fixupBtn, FALSE );
if ( _prof && _prof->getTransfToSRGB8() ) {
- icUInt16Number tmp[4];
+ cmsUInt16Number tmp[4];
for ( guint i = 0; i < _profChannelCount; i++ ) {
gdouble val = 0.0;
if ( _color.icc->colors.size() > i ) {
@@ -678,7 +682,7 @@ void ColorICCSelector::_colorChanged()
}
#else
//(void)color;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_updateSliders( -1 );
@@ -688,7 +692,7 @@ void ColorICCSelector::_colorChanged()
#endif // DEBUG_LCMS
}
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::_setProfile( SVGICCColor* profile )
{
#ifdef DEBUG_LCMS
@@ -715,8 +719,12 @@ void ColorICCSelector::_setProfile( SVGICCColor* profile )
if ( profile ) {
_prof = SP_ACTIVE_DOCUMENT->profileManager->find(profile->colorProfile.c_str());
- if ( _prof && (asICColorProfileClassSig(_prof->getProfileClass()) != icSigNamedColorClass) ) {
+ if ( _prof && (asICColorProfileClassSig(_prof->getProfileClass()) != cmsSigNamedColorClass) ) {
+#if HAVE_LIBLCMS1
_profChannelCount = _cmsChannelsOf( asICColorSpaceSig(_prof->getColorSpace()) );
+#elif HAVE_LIBLCMS2
+ _profChannelCount = cmsChannelsOf( asICColorSpaceSig(_prof->getColorSpace()) );
+#endif
gchar const** names = 0;
gchar const** tips = 0;
@@ -763,11 +771,11 @@ void ColorICCSelector::_setProfile( SVGICCColor* profile )
g_message( "\\_________ %p::_setProfile()", this );
#endif // DEBUG_LCMS
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void ColorICCSelector::_updateSliders( gint ignore )
{
-#ifdef ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if ( _color.icc )
{
for ( guint i = 0; i < _profChannelCount; i++ ) {
@@ -785,13 +793,13 @@ void ColorICCSelector::_updateSliders( gint ignore )
if ( _prof && _prof->getTransfToSRGB8() ) {
for ( guint i = 0; i < _profChannelCount; i++ ) {
if ( static_cast<gint>(i) != ignore ) {
- icUInt16Number* scratch = getScratch();
- icUInt16Number filler[4] = {0, 0, 0, 0};
+ cmsUInt16Number* scratch = getScratch();
+ cmsUInt16Number filler[4] = {0, 0, 0, 0};
for ( guint j = 0; j < _profChannelCount; j++ ) {
filler[j] = 0x0ffff * ColorScales::getScaled( _fooAdj[j] );
}
- icUInt16Number* p = scratch;
+ cmsUInt16Number* p = scratch;
for ( guint x = 0; x < 1024; x++ ) {
for ( guint j = 0; j < _profChannelCount; j++ ) {
if ( j == i ) {
@@ -813,7 +821,7 @@ void ColorICCSelector::_updateSliders( gint ignore )
}
#else
(void)ignore;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
guint32 start = _color.toRGBA32( 0x00 );
guint32 mid = _color.toRGBA32( 0x7f );
@@ -852,7 +860,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC
g_message("ALPHA");
#endif // DEBUG_LCMS
} else {
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
for ( guint i = 0; i < iccSelector->_fooCount; i++ ) {
if ( iccSelector->_fooAdj[i] == adjustment ) {
match = i;
@@ -866,7 +874,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC
}
- icUInt16Number tmp[4];
+ cmsUInt16Number tmp[4];
for ( guint i = 0; i < 4; i++ ) {
tmp[i] = ColorScales::getScaled( iccSelector->_fooAdj[i] ) * 0x0ffff;
}
@@ -904,7 +912,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC
newColor.icc->colors.push_back( val );
}
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
iccSelector->_updateInternals( newColor, scaled, iccSelector->_dragging );
iccSelector->_updateSliders( match );
diff --git a/src/widgets/sp-color-icc-selector.h b/src/widgets/sp-color-icc-selector.h
index 166348830..67fedf590 100644
--- a/src/widgets/sp-color-icc-selector.h
+++ b/src/widgets/sp-color-icc-selector.h
@@ -37,10 +37,10 @@ protected:
static void _profileSelected( GtkWidget* src, gpointer data );
void _recalcColor( gboolean changing );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void _setProfile( SVGICCColor* profile );
void _switchToProfile( gchar const* name );
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void _updateSliders( gint ignore );
void _profilesChanged( std::string const & name );
@@ -64,12 +64,12 @@ protected:
GtkWidget* _sbtn; /* Spinbutton */
GtkWidget* _label; /* Label */
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
std::string _profileName;
Inkscape::ColorProfile* _prof;
guint _profChannelCount;
gulong _profChangedID;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
private:
// By default, disallow copy constructor and assignment operator
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index 1324e0b16..2fbf6a763 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -208,9 +208,9 @@ void ColorNotebook::init()
/* tempory hardcoding to get types loaded */
SP_TYPE_COLOR_SCALES;
SP_TYPE_COLOR_WHEEL_SELECTOR;
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
SP_TYPE_COLOR_ICC_SELECTOR;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* REJON: Comment out the next line to not use the normal GTK Color
wheel. */
@@ -331,7 +331,7 @@ void ColorNotebook::init()
GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0);
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Create color management icons */
_box_colormanaged = gtk_event_box_new ();
GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
@@ -354,7 +354,7 @@ void ColorNotebook::init()
gtk_widget_set_sensitive (_box_toomuchink, false);
gtk_box_pack_start(GTK_BOX(rgbabox), _box_toomuchink, FALSE, FALSE, 2);
-#endif //ENABLE_LCMS
+#endif //defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Create RGBA entry and color preview */
_rgbal = gtk_label_new_with_mnemonic (_("RGBA_:"));
@@ -372,10 +372,10 @@ void ColorNotebook::init()
sp_set_font_size_smaller (rgbabox);
gtk_widget_show_all (rgbabox);
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
//the "too much ink" icon is initially hidden
gtk_widget_hide(GTK_WIDGET(_box_toomuchink));
-#endif //ENABLE_LCMS
+#endif //defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_table_attach (GTK_TABLE (table), rgbabox, 0, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD);
@@ -522,7 +522,7 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
{
g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) );
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* update color management icon*/
gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL);
@@ -554,7 +554,7 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
gtk_widget_hide(GTK_WIDGET(_box_toomuchink));
}
}
-#endif //ENABLE_LCMS
+#endif //defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if ( !_updatingrgba )
{
diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h
index 85b4315ed..8ea8464a9 100644
--- a/src/widgets/sp-color-notebook.h
+++ b/src/widgets/sp-color-notebook.h
@@ -59,9 +59,9 @@ protected:
gulong _entryId;
GtkWidget *_book;
GtkWidget *_rgbal, *_rgbae; /* RGBA entry */
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
GtkWidget *_box_outofgamut, *_box_colormanaged, *_box_toomuchink;
-#endif //ENABLE_LCMS
+#endif //defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
GtkWidget *_p; /* Color preview */
GtkWidget *_btn;
GtkWidget *_popup;