summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Boczkowski <penginsbacon@gmail.com>2014-05-31 19:34:24 +0000
committerTomasz Boczkowski <penginsbacon@gmail.com>2014-05-31 19:34:24 +0000
commit9d88682d5df45121fec6350cc028e5fb666e4776 (patch)
tree9274e9f6f79359b14b7a52145b33cda5d4cb3145
parentSPColorICC c++sification: moved to ui/widget/ (diff)
downloadinkscape-9d88682d5df45121fec6350cc028e5fb666e4776.tar.gz
inkscape-9d88682d5df45121fec6350cc028e5fb666e4776.zip
SPColorICC c++sification: using SelectedColor
(bzr r13341.6.42)
-rw-r--r--src/ui/widget/color-icc-selector.cpp416
-rw-r--r--src/ui/widget/color-icc-selector.h58
2 files changed, 199 insertions, 275 deletions
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index 74e63f320..1187dd081 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -32,10 +32,6 @@
#endif // DEBUG_LCMS
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-
-using namespace Inkscape::UI::Widget;
-
-
#ifdef DEBUG_LCMS
extern guint update_in_progress;
#define DEBUG_MESSAGE(key, ...) \
@@ -67,106 +63,6 @@ extern guint update_in_progress;
#endif // DEBUG_LCMS
-
-G_BEGIN_DECLS
-
-static void sp_color_icc_selector_class_init (SPColorICCSelectorClass *klass);
-static void sp_color_icc_selector_init (SPColorICCSelector *cs);
-static void sp_color_icc_selector_dispose(GObject *object);
-
-static void sp_color_icc_selector_show_all (GtkWidget *widget);
-static void sp_color_icc_selector_hide(GtkWidget *widget);
-
-G_END_DECLS
-
-/**
- * Class containing the parts for a single color component's UI presence.
- */
-class ComponentUI
-{
-public:
- ComponentUI() :
- _component(),
- _adj(0),
- _slider(0),
- _btn(0),
- _label(0),
- _map(0)
- {
- }
-
- ComponentUI(colorspace::Component const &component) :
- _component(component),
- _adj(0),
- _slider(0),
- _btn(0),
- _label(0),
- _map(0)
- {
- }
-
- colorspace::Component _component;
- GtkAdjustment *_adj; // Component adjustment
- Inkscape::UI::Widget::ColorSlider *_slider;
- GtkWidget *_btn; // spinbutton
- GtkWidget *_label; // Label
- guchar *_map;
-};
-
-/**
- * Class that implements the internals of the selector.
- */
-class ColorICCSelectorImpl
-{
-public:
-
- ColorICCSelectorImpl( ColorICCSelector *owner);
-
- ~ColorICCSelectorImpl();
-
- static void _adjustmentChanged ( GtkAdjustment *adjustment, SPColorICCSelector *cs );
-
- void _sliderGrabbed();
- void _sliderReleased();
- void _sliderChanged();
-
- static void _profileSelected( GtkWidget* src, gpointer data );
- static void _fixupHit( GtkWidget* src, gpointer data );
-
-#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
- void _setProfile( SVGICCColor* profile );
- void _switchToProfile( gchar const* name );
-#endif
- void _updateSliders( gint ignore );
- void _profilesChanged( std::string const & name );
-
- ColorICCSelector *_owner;
-
- gboolean _updating : 1;
- gboolean _dragging : 1;
-
- guint32 _fixupNeeded;
- GtkWidget* _fixupBtn;
- GtkWidget* _profileSel;
-
- std::vector<ComponentUI> _compUI;
-
- GtkAdjustment* _adj; // Channel adjustment
- Inkscape::UI::Widget::ColorSlider* _slider;
- GtkWidget* _sbtn; // Spinbutton
- GtkWidget* _label; // Label
-
-#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
- std::string _profileName;
- Inkscape::ColorProfile* _prof;
- guint _profChannelCount;
- gulong _profChangedID;
-#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-};
-
-
-static SPColorSelectorClass *parent_class;
-
#define XPAD 4
#define YPAD 1
@@ -230,77 +126,6 @@ void attachToGridOrTable(GtkWidget *parent,
} // namespace
-GType sp_color_icc_selector_get_type(void)
-{
- static GType type = 0;
- if (!type) {
- static const GTypeInfo info = {
- sizeof (SPColorICCSelectorClass),
- NULL, // base_init
- NULL, // base_finalize
- (GClassInitFunc) sp_color_icc_selector_class_init,
- NULL, // class_finalize
- NULL, // class_data
- sizeof (SPColorICCSelector),
- 0, // n_preallocs
- (GInstanceInitFunc) sp_color_icc_selector_init,
- 0, // value_table
- };
-
- type = g_type_register_static (SP_TYPE_COLOR_SELECTOR,
- "SPColorICCSelector",
- &info,
- static_cast< GTypeFlags > (0) );
- }
- return type;
-}
-
-static void sp_color_icc_selector_class_init(SPColorICCSelectorClass *klass)
-{
- static const gchar* nameset[] = {N_("CMS"), 0};
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
- SPColorSelectorClass *selector_class = SP_COLOR_SELECTOR_CLASS (klass);
-
- parent_class = SP_COLOR_SELECTOR_CLASS (g_type_class_peek_parent (klass));
-
- selector_class->name = nameset;
- selector_class->submode_count = 1;
-
- object_class->dispose = sp_color_icc_selector_dispose;
-
- widget_class->show_all = sp_color_icc_selector_show_all;
- widget_class->hide = sp_color_icc_selector_hide;
-}
-
-const gchar* ColorICCSelector::MODE_NAME = N_("CMS");
-
-ColorICCSelector::ColorICCSelector( SPColorSelector* csel )
- : ColorSelector( csel ),
- _impl(NULL)
-{
-}
-
-ColorICCSelector::~ColorICCSelector()
-{
- if (_impl)
- {
- delete _impl;
- _impl = 0;
- }
-}
-
-void sp_color_icc_selector_init(SPColorICCSelector *cs)
-{
- SP_COLOR_SELECTOR(cs)->base = new ColorICCSelector( SP_COLOR_SELECTOR(cs) );
-
- if ( SP_COLOR_SELECTOR(cs)->base )
- {
- SP_COLOR_SELECTOR(cs)->base->init();
- }
-}
-
-
/*
icSigRgbData
icSigCmykData
@@ -403,8 +228,141 @@ std::vector<colorspace::Component> colorspace::getColorSpaceInfo( Inkscape::Colo
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
-ColorICCSelectorImpl::ColorICCSelectorImpl(ColorICCSelector *owner) :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace Inkscape {
+namespace UI {
+namespace Widget {
+
+/**
+ * Class containing the parts for a single color component's UI presence.
+ */
+class ComponentUI
+{
+public:
+ ComponentUI() :
+ _component(),
+ _adj(0),
+ _slider(0),
+ _btn(0),
+ _label(0),
+ _map(0)
+ {
+ }
+
+ ComponentUI(colorspace::Component const &component) :
+ _component(component),
+ _adj(0),
+ _slider(0),
+ _btn(0),
+ _label(0),
+ _map(0)
+ {
+ }
+
+ colorspace::Component _component;
+ GtkAdjustment *_adj; // Component adjustment
+ Inkscape::UI::Widget::ColorSlider *_slider;
+ GtkWidget *_btn; // spinbutton
+ GtkWidget *_label; // Label
+ guchar *_map;
+};
+
+/**
+ * Class that implements the internals of the selector.
+ */
+class ColorICCSelectorImpl
+{
+public:
+
+ ColorICCSelectorImpl(ColorICCSelector *owner, SelectedColor &color);
+
+ ~ColorICCSelectorImpl();
+
+ static void _adjustmentChanged ( GtkAdjustment *adjustment, ColorICCSelectorImpl *cs );
+
+ void _sliderGrabbed();
+ void _sliderReleased();
+ void _sliderChanged();
+
+ static void _profileSelected( GtkWidget* src, gpointer data );
+ static void _fixupHit( GtkWidget* src, gpointer data );
+
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+ void _setProfile( SVGICCColor* profile );
+ void _switchToProfile( gchar const* name );
+#endif
+ void _updateSliders( gint ignore );
+ void _profilesChanged( std::string const & name );
+
+ ColorICCSelector *_owner;
+ SelectedColor &_color;
+
+ gboolean _updating : 1;
+ gboolean _dragging : 1;
+
+ guint32 _fixupNeeded;
+ GtkWidget* _fixupBtn;
+ GtkWidget* _profileSel;
+
+ std::vector<ComponentUI> _compUI;
+
+ GtkAdjustment* _adj; // Channel adjustment
+ Inkscape::UI::Widget::ColorSlider* _slider;
+ GtkWidget* _sbtn; // Spinbutton
+ GtkWidget* _label; // Label
+
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+ std::string _profileName;
+ Inkscape::ColorProfile* _prof;
+ guint _profChannelCount;
+ gulong _profChangedID;
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+};
+
+
+
+
+const gchar* ColorICCSelector::MODE_NAME = N_("CMS");
+
+ColorICCSelector::ColorICCSelector(SelectedColor &color)
+ : _impl(NULL)
+{
+ _impl = new ColorICCSelectorImpl(this, color);
+ init();
+ color.signal_changed.connect(sigc::mem_fun(this, &ColorICCSelector::_colorChanged));
+ //color.signal_dragged.connect(sigc::mem_fun(this, &ColorICCSelector::_colorChanged));
+}
+
+ColorICCSelector::~ColorICCSelector()
+{
+ if (_impl)
+ {
+ delete _impl;
+ _impl = 0;
+ }
+}
+
+
+
+ColorICCSelectorImpl::ColorICCSelectorImpl(ColorICCSelector *owner, SelectedColor &color) :
_owner(owner),
+ _color(color),
_updating( FALSE ),
_dragging( FALSE ),
_fixupNeeded(0),
@@ -434,21 +392,14 @@ ColorICCSelectorImpl::~ColorICCSelectorImpl()
void ColorICCSelector::init()
{
- if (_impl) delete(_impl);
- _impl = new ColorICCSelectorImpl(this);
gint row = 0;
_impl->_updating = FALSE;
_impl->_dragging = FALSE;
-#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget *t = gtk_grid_new();
-#else
- GtkWidget *t = gtk_table_new(5, 3, FALSE);
-#endif
+ GtkWidget* t = GTK_WIDGET(gobj());
gtk_widget_show (t);
- gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 4);
_impl->_compUI.clear();
@@ -552,7 +503,7 @@ void ColorICCSelector::init()
// Signals
- g_signal_connect( G_OBJECT( _impl->_compUI[i]._adj ), "value_changed", G_CALLBACK( ColorICCSelectorImpl::_adjustmentChanged ), _csel );
+ g_signal_connect( G_OBJECT( _impl->_compUI[i]._adj ), "value_changed", G_CALLBACK( ColorICCSelectorImpl::_adjustmentChanged ), _impl );
_impl->_compUI[i]._slider->signal_grabbed.connect(sigc::mem_fun(_impl, &ColorICCSelectorImpl::_sliderGrabbed));
_impl->_compUI[i]._slider->signal_released.connect(sigc::mem_fun(_impl, &ColorICCSelectorImpl::_sliderReleased));
@@ -593,47 +544,18 @@ void ColorICCSelector::init()
attachToGridOrTable(t, _impl->_sbtn, 2, row, 1, 1, false, true);
// Signals
- g_signal_connect(G_OBJECT(_impl->_adj), "value_changed", G_CALLBACK(ColorICCSelectorImpl::_adjustmentChanged), _csel);
+ g_signal_connect(G_OBJECT(_impl->_adj), "value_changed", G_CALLBACK(ColorICCSelectorImpl::_adjustmentChanged), _impl);
_impl->_slider->signal_grabbed.connect(sigc::mem_fun(_impl, &ColorICCSelectorImpl::_sliderGrabbed));
_impl->_slider->signal_released.connect(sigc::mem_fun(_impl, &ColorICCSelectorImpl::_sliderReleased));
_impl->_slider->signal_value_changed.connect(sigc::mem_fun(_impl, &ColorICCSelectorImpl::_sliderChanged));
}
-static void sp_color_icc_selector_dispose(GObject *object)
-{
- if ((G_OBJECT_CLASS(parent_class))->dispose) {
- (* (G_OBJECT_CLASS(parent_class))->dispose)(object);
- }
-}
-
-static void
-sp_color_icc_selector_show_all (GtkWidget *widget)
-{
- gtk_widget_show (widget);
-}
-
-static void sp_color_icc_selector_hide(GtkWidget *widget)
-{
- gtk_widget_hide(widget);
-}
-
-GtkWidget *
-sp_color_icc_selector_new (void)
-{
- SPColorICCSelector *csel;
-
- csel = static_cast<SPColorICCSelector*>(g_object_new (SP_TYPE_COLOR_ICC_SELECTOR, NULL));
-
- return GTK_WIDGET (csel);
-}
-
-
void ColorICCSelectorImpl::_fixupHit( GtkWidget* /*src*/, gpointer data )
{
ColorICCSelectorImpl* self = reinterpret_cast<ColorICCSelectorImpl*>(data);
gtk_widget_set_sensitive( self->_fixupBtn, FALSE );
- self->_adjustmentChanged( self->_compUI[0]._adj, SP_COLOR_ICC_SELECTOR(self->_owner->_csel) );
+ self->_adjustmentChanged( self->_compUI[0]._adj, self );
}
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
@@ -661,7 +583,7 @@ void ColorICCSelectorImpl::_profileSelected( GtkWidget* /*src*/, gpointer data )
void ColorICCSelectorImpl::_switchToProfile( gchar const* name )
{
bool dirty = false;
- SPColor tmp( _owner->_color );
+ SPColor tmp( _color.color() );
if ( name ) {
if ( tmp.icc && tmp.icc->colorProfile == name ) {
@@ -682,7 +604,7 @@ void ColorICCSelectorImpl::_switchToProfile( gchar const* name )
if ( newProf ) {
cmsHTRANSFORM trans = newProf->getTransfFromSRGB8();
if ( trans ) {
- guint32 val = _owner->_color.toRGBA32(0);
+ guint32 val = _color.color().toRGBA32(0);
guchar pre[4] = {
static_cast<guchar>(SP_RGBA32_R_U(val)),
static_cast<guchar>(SP_RGBA32_G_U(val)),
@@ -746,7 +668,7 @@ void ColorICCSelectorImpl::_switchToProfile( gchar const* name )
#endif // DEBUG_LCMS
_setProfile( tmp.icc );
//_adjustmentChanged( _compUI[0]._adj, SP_COLOR_ICC_SELECTOR(_csel) );
- _owner->setColorAlpha( tmp, _owner->_alpha, true );
+ _color.setColor(tmp);
#ifdef DEBUG_LCMS
g_message("+_________________");
#endif // DEBUG_LCMS
@@ -805,19 +727,19 @@ void ColorICCSelector::_colorChanged()
#ifdef DEBUG_LCMS
g_message( "/^^^^^^^^^ %p::_colorChanged(%08x:%s)", this,
- _color.toRGBA32(_alpha), ( (_color.icc) ? _color.icc->colorProfile.c_str(): "<null>" )
+ _impl->_color.color().toRGBA32(_impl->_color.alpha()), ( (_impl->_color.color().icc) ? _impl->_color.color().icc->colorProfile.c_str(): "<null>" )
);
#endif // DEBUG_LCMS
#ifdef DEBUG_LCMS
- g_message("FLIPPIES!!!! %p '%s'", _color.icc, (_color.icc ? _color.icc->colorProfile.c_str():"<null>"));
+ g_message("FLIPPIES!!!! %p '%s'", _impl->_color.color().icc, (_impl->_color.color().icc ? _impl->_color.color().icc->colorProfile.c_str():"<null>"));
#endif // DEBUG_LCMS
- _impl->_profilesChanged( (_color.icc) ? _color.icc->colorProfile : std::string("") );
- ColorScales::setScaled( _impl->_adj, _alpha );
+ _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)
- _impl->_setProfile( _color.icc );
+ _impl->_setProfile( _impl->_color.color().icc );
_impl->_fixupNeeded = 0;
gtk_widget_set_sensitive( _impl->_fixupBtn, FALSE );
@@ -826,11 +748,11 @@ void ColorICCSelector::_colorChanged()
cmsUInt16Number tmp[4];
for ( guint i = 0; i < _impl->_profChannelCount; i++ ) {
gdouble val = 0.0;
- if ( _color.icc->colors.size() > i ) {
+ if ( _impl->_color.color().icc->colors.size() > i ) {
if ( _impl->_compUI[i]._component.scale == 256 ) {
- val = (_color.icc->colors[i] + 128.0) / static_cast<gdouble>(_impl->_compUI[i]._component.scale);
+ val = (_impl->_color.color().icc->colors[i] + 128.0) / static_cast<gdouble>(_impl->_compUI[i]._component.scale);
} else {
- val = _color.icc->colors[i] / static_cast<gdouble>(_impl->_compUI[i]._component.scale);
+ val = _impl->_color.color().icc->colors[i] / static_cast<gdouble>(_impl->_compUI[i]._component.scale);
}
}
tmp[i] = val * 0x0ffff;
@@ -840,7 +762,7 @@ void ColorICCSelector::_colorChanged()
if ( trans ) {
cmsDoTransform( trans, tmp, post, 1 );
guint32 other = SP_RGBA32_U_COMPOSE(post[0], post[1], post[2], 255 );
- if ( other != _color.toRGBA32(255) ) {
+ if ( other != _impl->_color.color().toRGBA32(255) ) {
_impl->_fixupNeeded = other;
gtk_widget_set_sensitive( _impl->_fixupBtn, TRUE );
#ifdef DEBUG_LCMS
@@ -947,15 +869,15 @@ void ColorICCSelectorImpl::_setProfile( SVGICCColor* profile )
void ColorICCSelectorImpl::_updateSliders( gint ignore )
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
- if ( _owner->_color.icc )
+ if ( _color.color().icc )
{
for ( guint i = 0; i < _profChannelCount; i++ ) {
gdouble val = 0.0;
- if ( _owner->_color.icc->colors.size() > i ) {
+ if ( _color.color().icc->colors.size() > i ) {
if ( _compUI[i]._component.scale == 256 ) {
- val = (_owner->_color.icc->colors[i] + 128.0) / static_cast<gdouble>(_compUI[i]._component.scale);
+ val = (_color.color().icc->colors[i] + 128.0) / static_cast<gdouble>(_compUI[i]._component.scale);
} else {
- val = _owner->_color.icc->colors[i] / static_cast<gdouble>(_compUI[i]._component.scale);
+ val = _color.color().icc->colors[i] / static_cast<gdouble>(_compUI[i]._component.scale);
}
}
gtk_adjustment_set_value( _compUI[i]._adj, val );
@@ -996,15 +918,15 @@ void ColorICCSelectorImpl::_updateSliders( gint ignore )
(void)ignore;
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
- guint32 start = _owner->_color.toRGBA32( 0x00 );
- guint32 mid = _owner->_color.toRGBA32( 0x7f );
- guint32 end = _owner->_color.toRGBA32( 0xff );
+ guint32 start = _color.color().toRGBA32( 0x00 );
+ guint32 mid = _color.color().toRGBA32( 0x7f );
+ guint32 end = _color.color().toRGBA32( 0xff );
_slider->setColors(start, mid, end);
}
-void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICCSelector *cs )
+void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, ColorICCSelectorImpl *cs )
{
// // TODO check this. It looks questionable:
// // if a value is entered between 0 and 1 exclusive, normalize it to (int) 0..255 or 0..100
@@ -1016,7 +938,7 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo
g_message( "/^^^^^^^^^ %p::_adjustmentChanged()", cs );
#endif // DEBUG_LCMS
- ColorICCSelector* iccSelector = static_cast<ColorICCSelector*>(SP_COLOR_SELECTOR(cs)->base);
+ ColorICCSelector* iccSelector = cs->_owner;
if (iccSelector->_impl->_updating) {
return;
}
@@ -1025,7 +947,7 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo
gint match = -1;
- SPColor newColor( iccSelector->_color );
+ SPColor newColor( iccSelector->_impl->_color.color() );
gfloat scaled = ColorScales::getScaled( iccSelector->_impl->_adj );
if ( iccSelector->_impl->_adj == adjustment ) {
#ifdef DEBUG_LCMS
@@ -1059,11 +981,11 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo
SPColor other( SP_RGBA32_U_COMPOSE(post[0], post[1], post[2], 255) );
other.icc = new SVGICCColor();
- if ( iccSelector->_color.icc ) {
- other.icc->colorProfile = iccSelector->_color.icc->colorProfile;
+ if ( iccSelector->_impl->_color.color().icc ) {
+ other.icc->colorProfile = iccSelector->_impl->_color.color().icc->colorProfile;
}
- guint32 prior = iccSelector->_color.toRGBA32(255);
+ guint32 prior = iccSelector->_impl->_color.color().toRGBA32(255);
guint32 newer = other.toRGBA32(255);
if ( prior != newer ) {
@@ -1084,7 +1006,8 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
- iccSelector->_updateInternals( newColor, scaled, iccSelector->_impl->_dragging );
+ iccSelector->_impl->_color.setColorAlpha(newColor, scaled, true);
+ //iccSelector->_updateInternals( newColor, scaled, iccSelector->_impl->_dragging );
iccSelector->_impl->_updateSliders( match );
iccSelector->_impl->_updating = FALSE;
@@ -1128,16 +1051,17 @@ void ColorICCSelectorImpl::_sliderChanged()
}
Gtk::Widget *ColorICCSelectorFactory::createWidget(Inkscape::UI::SelectedColor &color) const {
- GtkWidget *w = sp_color_selector_new(SP_TYPE_COLOR_ICC_SELECTOR);
- Gtk::Widget *wrapped = Gtk::manage(Glib::wrap(w));
- return wrapped;
+ Gtk::Widget *w = Gtk::manage(new ColorICCSelector(color));
+ return w;
}
Glib::ustring ColorICCSelectorFactory::modeName() const {
return gettext(ColorICCSelector::MODE_NAME);
}
-
+}
+}
+}
/*
Local Variables:
mode:c++
diff --git a/src/ui/widget/color-icc-selector.h b/src/ui/widget/color-icc-selector.h
index cee8305cd..b917066dd 100644
--- a/src/ui/widget/color-icc-selector.h
+++ b/src/ui/widget/color-icc-selector.h
@@ -1,27 +1,43 @@
#ifndef SEEN_SP_COLOR_ICC_SELECTOR_H
#define SEEN_SP_COLOR_ICC_SELECTOR_H
-#include <glib.h>
-#include <gtk/gtk.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
+#include <gtkmm/widget.h>
+#if GTK_CHECK_VERSION(3,0,0)
+#include <gtkmm/grid.h>
+#else
+#include <gtkmm/table.h>
+#endif
-#include "widgets/sp-color-selector.h"
#include "ui/selected-color.h"
namespace Inkscape {
+
class ColorProfile;
-}
-struct SPColorICCSelector;
-struct SPColorICCSelectorClass;
+namespace UI {
+namespace Widget {
class ColorICCSelectorImpl;
-class ColorICCSelector: public ColorSelector
+class ColorICCSelector
+#if GTK_CHECK_VERSION(3,0,0)
+ : public Gtk::Grid
+#else
+ : public Gtk::Table
+#endif
{
public:
static const gchar* MODE_NAME;
- ColorICCSelector( SPColorSelector* csel );
+ ColorICCSelector(SelectedColor &color);
virtual ~ColorICCSelector();
virtual void init();
@@ -42,31 +58,15 @@ private:
};
-
-#define SP_TYPE_COLOR_ICC_SELECTOR (sp_color_icc_selector_get_type())
-#define SP_COLOR_ICC_SELECTOR(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_COLOR_ICC_SELECTOR, SPColorICCSelector))
-#define SP_COLOR_ICC_SELECTOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_COLOR_ICC_SELECTOR, SPColorICCSelectorClass))
-#define SP_IS_COLOR_ICC_SELECTOR(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_COLOR_ICC_SELECTOR))
-#define SP_IS_COLOR_ICC_SELECTOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_COLOR_ICC_SELECTOR))
-
-struct SPColorICCSelector {
- SPColorSelector parent;
-};
-
-struct SPColorICCSelectorClass {
- SPColorSelectorClass parent_class;
-};
-
-GType sp_color_icc_selector_get_type(void);
-
-GtkWidget *sp_color_icc_selector_new(void);
-
-class ColorICCSelectorFactory: public Inkscape::UI::ColorSelectorFactory {
+class ColorICCSelectorFactory: public ColorSelectorFactory {
public:
- Gtk::Widget* createWidget(Inkscape::UI::SelectedColor &color) const;
+ Gtk::Widget* createWidget(SelectedColor &color) const;
Glib::ustring modeName() const;
};
+}
+}
+}
#endif // SEEN_SP_COLOR_ICC_SELECTOR_H
/*