index 9d92077da478c1b85469b154c20c3eea852e7d31..b7ec3eb2c5d2c3984eb6c9b2469439cfa98d2213 100644 (file)
*/
#undef SPCS_PREVIEW
+#define noDUMP_CHANGE_INFO
#ifdef HAVE_CONFIG_H
# include "config.h"
#include "sp-color-scales.h"
#include "sp-color-wheel-selector.h"
+#include "sp-color-icc-selector.h"
struct SPColorNotebookTracker {
const gchar* name;
};
static void sp_color_notebook_class_init (SPColorNotebookClass *klass);
-static void sp_color_notebook_init (SPColorNotebook *slider);
+static void sp_color_notebook_init (SPColorNotebook *colorbook);
static void sp_color_notebook_destroy (GtkObject *object);
static void sp_color_notebook_show_all (GtkWidget *widget);
/* tempory hardcoding to get types loaded */
SP_TYPE_COLOR_SCALES;
SP_TYPE_COLOR_WHEEL_SELECTOR;
+#if ENABLE_LCMS
+ SP_TYPE_COLOR_ICC_SELECTOR;
+#endif // ENABLE_LCMS
- /* REJON: Comment out the next line to not use the normal GTK Color
+ /* REJON: Comment out the next line to not use the normal GTK Color
wheel. */
// SP_TYPE_COLOR_GTKSELECTOR;
for ( i = 0; i < _trackerList->len; i++ )
{
- SPColorNotebookTracker *entry =
+ SPColorNotebookTracker *entry =
reinterpret_cast< SPColorNotebookTracker* > (g_ptr_array_index (_trackerList, i));
if ( entry )
{
gtk_widget_show (align);
gtk_container_add (GTK_CONTAINER (align), _btn);
- // uncomment to reenable the "show/hide modes" menu,
+ // uncomment to reenable the "show/hide modes" menu,
// but first fix it so it remembers its settings in prefs and does not take that much space (entire vertical column!)
//gtk_table_attach (GTK_TABLE (table), align, 2, 3, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD);
return csel;
}
-void ColorNotebook::_colorChanged(const SPColor& color, gfloat alpha)
+void ColorNotebook::_colorChanged()
{
- SPColorSelector* cselPage = 0;
-
- g_return_if_fail (_csel != NULL);
- g_return_if_fail (SP_IS_COLOR_NOTEBOOK (_csel));
- g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) );
-
- cselPage = getCurrentSelector();
- if ( cselPage )
- {
- cselPage->base->setColorAlpha( color, alpha );
- }
+ SPColorSelector* cselPage = getCurrentSelector();
+ if ( cselPage )
+ {
+ cselPage->base->setColorAlpha( _color, _alpha );
+ }
- _updateRgbaEntry( color, alpha );
+ _updateRgbaEntry( _color, _alpha );
}
void ColorNotebook::_rgbaEntryChangedHook(GtkEntry *entry, SPColorNotebook *colorbook)
@@ -437,29 +436,25 @@ void ColorNotebook::_rgbaEntryChangedHook(GtkEntry *entry, SPColorNotebook *colo
void ColorNotebook::_rgbaEntryChanged(GtkEntry* entry)
{
- const gchar *t;
- gchar *e;
- SPColor color;
- guint rgba;
-
- if (_updating) return;
- if (_updatingrgba) return;
-
- t = gtk_entry_get_text (entry);
-
- if (t) {
- rgba = strtoul (t, &e, 16);
- if ( e != t ) {
- ptrdiff_t len=e-t;
- if ( len < 8 ) {
- rgba = rgba << ( 4 * ( 8 - len ) );
- }
- _updatingrgba = TRUE;
- sp_color_set_rgb_rgba32 (&color, rgba);
- setColorAlpha( color, SP_RGBA32_A_F(rgba), true);
- _updatingrgba = FALSE;
- }
- }
+ if (_updating) return;
+ if (_updatingrgba) return;
+
+ const gchar *t = gtk_entry_get_text( entry );
+
+ if (t) {
+ gchar *e = 0;
+ guint rgba = strtoul (t, &e, 16);
+ if ( e != t ) {
+ ptrdiff_t len=e-t;
+ if ( len < 8 ) {
+ rgba = rgba << ( 4 * ( 8 - len ) );
+ }
+ _updatingrgba = TRUE;
+ SPColor color( rgba );
+ setColorAlpha( color, SP_RGBA32_A_F(rgba), true );
+ _updatingrgba = FALSE;
+ }
+ }
}
void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
guint32 rgba;
/* Update RGBA entry */
- rgba = sp_color_get_rgba32_falpha (&color, alpha);
+ rgba = color.toRGBA32( alpha );
g_snprintf (s, 32, "%08x", rgba);
const gchar* oldText = gtk_entry_get_text( GTK_ENTRY( _rgbae ) );
{
GtkWidget *page;
- page = sp_color_selector_new ( page_type, SP_COLORSPACE_TYPE_NONE);
+ page = sp_color_selector_new( page_type );
if ( page )
{
GtkWidget* tab_label = 0;
}
}
}
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :