sp-color-selector.cpp revision 9fb4864477462bc005fa792b095fd06549eca4ab
/*
* bulia byak <buliabyak@users.sf.net>
* Jon A. Cruz <jon@joncruz.org>
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <math.h>
#include <gtk/gtksignal.h>
#include "sp-color-selector.h"
enum {
};
#define noDUMP_CHANGE_INFO
static GtkVBoxClass *parent_class;
GType sp_color_selector_get_type( void )
{
if (!type) {
sizeof(SPColorSelectorClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPColorSelector),
0, /* n_preallocs */
};
"SPColorSelector",
&info,
static_cast<GTypeFlags>(0) );
}
return type;
}
{
GTK_TYPE_NONE, 0 );
GTK_TYPE_NONE, 0 );
GTK_TYPE_NONE, 0 );
GTK_TYPE_NONE, 0 );
}
{
{
}
/* gtk_signal_connect(GTK_OBJECT(csel->rgbae), "changed", GTK_SIGNAL_FUNC(sp_color_selector_rgba_entry_changed), csel); */
}
{
{
}
}
}
{
}
{
}
{
return GTK_WIDGET( csel );
}
{
}
{
return mode;
}
_color( 0 ),
_alpha(1.0),
virgin(true)
{
}
{
}
void ColorSelector::init()
{
}
{
}
{
return _color;
}
{
}
{
return _alpha;
}
#include "svg/svg-icc-color.h"
/**
Called from the outside to set the color; optionally emits signal (only when called from
downstream, e.g. the RGBA value field, but not from the rest of the program)
*/
{
#ifdef DUMP_CHANGE_INFO
g_message("ColorSelector::setColorAlpha( this=%p, %f, %f, %f, %s, %f, %s) in %s", this, color.v.c[0], color.v.c[1], color.v.c[2], (color.icc?color.icc->colorProfile.c_str():"<null>"), alpha, (emit?"YES":"no"), FOO_NAME(_csel));
#endif
#ifdef DUMP_CHANGE_INFO
g_message("---- ColorSelector::setColorAlpha virgin:%s !close:%s alpha is:%s in %s",
);
#endif
virgin = false;
if (emit) {
}
#ifdef DUMP_CHANGE_INFO
} else {
g_message("++++ ColorSelector::setColorAlpha color:%08x ==> _color:%08X isClose:%s in %s", color.toRGBA32(alpha), _color.toRGBA32(_alpha),
#endif
}
}
void ColorSelector::_grabbed()
{
#ifdef DUMP_CHANGE_INFO
"GRABBED",
#endif
}
void ColorSelector::_released()
{
_held = false;
#ifdef DUMP_CHANGE_INFO
"RELEASED",
#endif
}
// Called from subclasses to update color and broadcast if needed
{
// Store these before emmiting any signals
if ( colorDifferent )
{
}
if ( grabbed )
{
#ifdef DUMP_CHANGE_INFO
"GRABBED",
#endif
}
else if ( released )
{
#ifdef DUMP_CHANGE_INFO
"RELEASED",
#endif
}
if ( colorDifferent || released )
{
#ifdef DUMP_CHANGE_INFO
#endif
}
}
/**
* Called once the color actually changes. Allows subclasses to react to changes.
*/
void ColorSelector::_colorChanged()
{
}
{
gint i = 0;
if ( alpha )
{
}
// Try to catch uninitialized value usage
if ( color.v.c[0] )
{
i++;
}
if ( color.v.c[1] )
{
i++;
}
if ( color.v.c[2] )
{
i++;
}
if ( color.v.c[3] )
{
i++;
}
{
i++;
}
}
/*
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 :