diff options
| author | Karl Cheng <qantas94heavy@gmail.com> | 2019-05-10 07:56:07 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-05-12 12:45:27 +0000 |
| commit | e6ad8433954db069908bac240f39911fc32e5025 (patch) | |
| tree | e655e16ddc932b6e936ca8ff85626ee5c0fdf023 /src/ui/widget | |
| parent | rename to avoid name clashes. (diff) | |
| download | inkscape-e6ad8433954db069908bac240f39911fc32e5025.tar.gz inkscape-e6ad8433954db069908bac240f39911fc32e5025.zip | |
Remove support for LCMS 1
Now that all platforms (including macOS) now support LCMS 2, we no
longer need to support LCMS 1.
Fixes: https://bugs.launchpad.net/inkscape/+bug/1133014
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/color-icc-selector.cpp | 74 | ||||
| -rw-r--r-- | src/ui/widget/color-notebook.cpp | 14 | ||||
| -rw-r--r-- | src/ui/widget/color-notebook.h | 4 |
3 files changed, 44 insertions, 48 deletions
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp index a8e1d255f..27c4b4bea 100644 --- a/src/ui/widget/color-icc-selector.cpp +++ b/src/ui/widget/color-icc-selector.cpp @@ -32,7 +32,7 @@ #define noDEBUG_LCMS -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) #include "object/color-profile.h" #include "cms-system.h" #include "color-profile-cms-fns.h" @@ -40,7 +40,7 @@ #ifdef DEBUG_LCMS #include "preferences.h" #endif // DEBUG_LCMS -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) #ifdef DEBUG_LCMS extern guint update_in_progress; @@ -71,7 +71,7 @@ namespace { size_t maxColorspaceComponentCount = 0; -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) /** * Internal variable to track all known colorspaces. @@ -132,7 +132,7 @@ colorspace::Component::Component(std::string name, std::string tip, guint scale) { } -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) static cmsUInt16Number *getScratch() { // bytes per pixel * input channels * width @@ -206,7 +206,7 @@ std::vector<colorspace::Component> colorspace::getColorSpaceInfo(Inkscape::Color return getColorSpaceInfo(asICColorSpaceSig(prof->getColorSpace())); } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) namespace Inkscape { namespace UI { @@ -263,7 +263,7 @@ class ColorICCSelectorImpl { static void _profileSelected(GtkWidget *src, gpointer data); static void _fixupHit(GtkWidget *src, gpointer data); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) void _setProfile(SVGICCColor *profile); void _switchToProfile(gchar const *name); #endif @@ -287,12 +287,12 @@ class ColorICCSelectorImpl { GtkWidget *_sbtn; // Spinbutton GtkWidget *_label; // Label -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) std::string _profileName; Inkscape::ColorProfile *_prof; guint _profChannelCount; gulong _profChangedID; -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) }; @@ -331,12 +331,12 @@ ColorICCSelectorImpl::ColorICCSelectorImpl(ColorICCSelector *owner, SelectedColo , _slider(nullptr) , _sbtn(nullptr) , _label(nullptr) -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) , _profileName() , _prof(nullptr) , _profChannelCount(0) , _profChangedID(0) -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) { } @@ -388,23 +388,23 @@ void ColorICCSelector::init() attachToGridOrTable(t, _impl->_profileSel, 1, row, 1, 1); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) _impl->_profChangedID = g_signal_connect(G_OBJECT(_impl->_profileSel), "changed", G_CALLBACK(ColorICCSelectorImpl::_profileSelected), (gpointer)_impl); #else gtk_widget_set_sensitive(_impl->_profileSel, false); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) row++; // populate the data for colorspaces and channels: -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) std::vector<colorspace::Component> things = colorspace::getColorSpaceInfo(cmsSigRgbData); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) for (size_t i = 0; i < maxColorspaceComponentCount; i++) { -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) if (i < things.size()) { _impl->_compUI.emplace_back(things[i]); } @@ -437,22 +437,22 @@ void ColorICCSelector::init() // Slider _impl->_compUI[i]._slider = Gtk::manage(new Inkscape::UI::Widget::ColorSlider(Glib::wrap(_impl->_compUI[i]._adj, true))); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) _impl->_compUI[i]._slider->set_tooltip_text((i < things.size()) ? things[i].tip.c_str() : ""); #else _impl->_compUI[i]._slider->set_tooltip_text("."); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) _impl->_compUI[i]._slider->show(); _impl->_compUI[i]._slider->set_no_show_all(); attachToGridOrTable(t, _impl->_compUI[i]._slider->gobj(), 1, row, 1, 1, true); _impl->_compUI[i]._btn = gtk_spin_button_new(_impl->_compUI[i]._adj, step, digits); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) gtk_widget_set_tooltip_text(_impl->_compUI[i]._btn, (i < things.size()) ? things[i].tip.c_str() : ""); #else gtk_widget_set_tooltip_text(_impl->_compUI[i]._btn, "."); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) sp_dialog_defocus_on_enter(_impl->_compUI[i]._btn); gtk_label_set_mnemonic_widget(GTK_LABEL(_impl->_compUI[i]._label), _impl->_compUI[i]._btn); gtk_widget_show(_impl->_compUI[i]._btn); @@ -526,7 +526,7 @@ void ColorICCSelectorImpl::_fixupHit(GtkWidget * /*src*/, gpointer data) self->_adjustmentChanged(self->_compUI[0]._adj, self); } -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) void ColorICCSelectorImpl::_profileSelected(GtkWidget * /*src*/, gpointer data) { ColorICCSelectorImpl *self = reinterpret_cast<ColorICCSelectorImpl *>(data); @@ -545,9 +545,9 @@ void ColorICCSelectorImpl::_profileSelected(GtkWidget * /*src*/, gpointer data) } } } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) void ColorICCSelectorImpl::_switchToProfile(gchar const *name) { bool dirty = false; @@ -588,9 +588,7 @@ void ColorICCSelectorImpl::_switchToProfile(gchar const *name) #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 +#if HAVE_LIBLCMS2 guint count = cmsChannelsOf(asICColorSpaceSig(newProf->getColorSpace())); #endif @@ -649,9 +647,9 @@ void ColorICCSelectorImpl::_switchToProfile(gchar const *name) #endif // DEBUG_LCMS } } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) struct _cmp { bool operator()(const SPObject * const & a, const SPObject * const & b) { @@ -711,7 +709,7 @@ void ColorICCSelectorImpl::_profilesChanged(std::string const &name) } #else void ColorICCSelectorImpl::_profilesChanged(std::string const & /*name*/) {} -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) void ColorICCSelector::on_show() { @@ -739,7 +737,7 @@ void ColorICCSelector::_colorChanged() _impl->_profilesChanged((_impl->_color.color().icc) ? _impl->_color.color().icc->colorProfile : std::string("")); ColorScales::setScaled(_impl->_adj, _impl->_color.alpha()); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) _impl->_setProfile(_impl->_color.color().icc); _impl->_fixupNeeded = 0; gtk_widget_set_sensitive(_impl->_fixupBtn, FALSE); @@ -778,7 +776,7 @@ void ColorICCSelector::_colorChanged() } #else //(void)color; -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) _impl->_updateSliders(-1); @@ -788,7 +786,7 @@ void ColorICCSelector::_colorChanged() #endif // DEBUG_LCMS } -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) void ColorICCSelectorImpl::_setProfile(SVGICCColor *profile) { #ifdef DEBUG_LCMS @@ -815,9 +813,7 @@ void ColorICCSelectorImpl::_setProfile(SVGICCColor *profile) if (profile) { _prof = SP_ACTIVE_DOCUMENT->getProfileManager()->find(profile->colorProfile.c_str()); if (_prof && (asICColorProfileClassSig(_prof->getProfileClass()) != cmsSigNamedColorClass)) { -#if HAVE_LIBLCMS1 - _profChannelCount = _cmsChannelsOf(asICColorSpaceSig(_prof->getColorSpace())); -#elif HAVE_LIBLCMS2 +#if HAVE_LIBLCMS2 _profChannelCount = cmsChannelsOf(asICColorSpaceSig(_prof->getColorSpace())); #endif @@ -873,11 +869,11 @@ void ColorICCSelectorImpl::_setProfile(SVGICCColor *profile) g_message("\\_________ %p::_setProfile()", this); #endif // DEBUG_LCMS } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) void ColorICCSelectorImpl::_updateSliders(gint ignore) { -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) if (_color.color().icc) { for (guint i = 0; i < _profChannelCount; i++) { gdouble val = 0.0; @@ -929,7 +925,7 @@ void ColorICCSelectorImpl::_updateSliders(gint ignore) } #else (void)ignore; -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) guint32 start = _color.color().toRGBA32(0x00); guint32 mid = _color.color().toRGBA32(0x7f); @@ -962,7 +958,7 @@ void ColorICCSelectorImpl::_adjustmentChanged(GtkAdjustment *adjustment, ColorIC #endif // DEBUG_LCMS } else { -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) for (size_t i = 0; i < iccSelector->_impl->_compUI.size(); i++) { if (iccSelector->_impl->_compUI[i]._adj == adjustment) { match = i; @@ -1012,7 +1008,7 @@ void ColorICCSelectorImpl::_adjustmentChanged(GtkAdjustment *adjustment, ColorIC newColor.icc->colors.push_back(val); } } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) } iccSelector->_impl->_color.setColorAlpha(newColor, scaled); // iccSelector->_updateInternals( newColor, scaled, iccSelector->_impl->_dragging ); diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp index 963e5093d..67347d8a4 100644 --- a/src/ui/widget/color-notebook.cpp +++ b/src/ui/widget/color-notebook.cpp @@ -73,7 +73,7 @@ ColorNotebook::ColorNotebook(SelectedColor &color) _available_pages.push_back(page); page = new Page(new ColorWheelSelectorFactory, true); _available_pages.push_back(page); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) page = new Page(new ColorICCSelectorFactory, true); _available_pages.push_back(page); #endif @@ -156,7 +156,7 @@ void ColorNotebook::_initUI() GtkWidget *rgbabox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) /* Create color management icons */ _box_colormanaged = gtk_event_box_new(); GtkWidget *colormanaged = sp_get_icon_image("color-management", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -178,7 +178,7 @@ void ColorNotebook::_initUI() gtk_widget_set_tooltip_text(_box_toomuchink, _("Too much ink!")); gtk_widget_set_sensitive(_box_toomuchink, false); gtk_box_pack_start(GTK_BOX(rgbabox), _box_toomuchink, FALSE, FALSE, 2); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) /* Color picker */ @@ -203,10 +203,10 @@ void ColorNotebook::_initUI() sp_set_font_size_smaller(rgbabox); gtk_widget_show_all(rgbabox); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) // the "too much ink" icon is initially hidden gtk_widget_hide(GTK_WIDGET(_box_toomuchink)); -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) #if GTK_CHECK_VERSION(3, 12, 0) gtk_widget_set_margin_start(rgbabox, XPAD); @@ -269,7 +269,7 @@ void ColorNotebook::_updateICCButtons() g_return_if_fail((0.0 <= alpha) && (alpha <= 1.0)); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) /* update color management icon*/ gtk_widget_set_sensitive(_box_colormanaged, color.icc != nullptr); @@ -305,7 +305,7 @@ void ColorNotebook::_updateICCButtons() gtk_widget_hide(GTK_WIDGET(_box_toomuchink)); } } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) } void ColorNotebook::_setCurrentPage(int i) diff --git a/src/ui/widget/color-notebook.h b/src/ui/widget/color-notebook.h index ddc8ea85f..c7bc7b56b 100644 --- a/src/ui/widget/color-notebook.h +++ b/src/ui/widget/color-notebook.h @@ -60,9 +60,9 @@ protected: GtkWidget *_buttonbox; GtkWidget **_buttons; GtkWidget *_rgbal; /* RGBA entry */ -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#if defined(HAVE_LIBLCMS2) GtkWidget *_box_outofgamut, *_box_colormanaged, *_box_toomuchink; -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif // defined(HAVE_LIBLCMS2) GtkWidget *_btn_picker; GtkWidget *_p; /* Color preview */ boost::ptr_vector<Page> _available_pages; |
