/*
* bulia byak <buliabyak@users.sf.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include <gtkmm/adjustment.h>
#include "svg/svg-icc-color.h"
#include "ui/dialog-events.h"
#include "ui/widget/color-scales.h"
#include "ui/widget/color-slider.h"
#define CSC_CHANNELS_ALL 0
namespace Inkscape {
namespace UI {
namespace Widget {
static const gchar *sp_color_scales_hue_map();
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
, _rangeLimit(255.0)
{
for (gint i = 0; i < 5; i++) {
_l[i] = 0;
_a[i] = 0;
_s[i] = 0;
_b[i] = 0;
}
}
{
for (gint i = 0; i < 5; i++) {
_l[i] = 0;
_a[i] = 0;
_s[i] = 0;
_b[i] = 0;
}
}
{
gint i;
/* Create components */
/* Label */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
gtk_widget_show(_l[i]);
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#else
#endif
/* Adjustment */
/* Slider */
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
_s[i]->set_hexpand(true);
#else
gtk_table_attach(GTK_TABLE(t), _s[i]->gobj(), 1, 2, i, i + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
#endif
/* Spinbutton */
gtk_widget_show(_b[i]);
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
#else
gtk_table_attach(GTK_TABLE(t), _b[i], 2, 3, i, i + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, XPAD, YPAD);
#endif
/* Attach channel value to adjustment */
/* Signals */
}
//Prevent 5th bar from being shown by PanelDialog::show_all_children
/* Initial mode is none, so it works */
}
{
gfloat c[5];
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
case SP_COLOR_SCALES_MODE_HSV:
_getRgbaFloatv(c);
alpha = c[3];
break;
case SP_COLOR_SCALES_MODE_CMYK: {
_getCmykaFloatv(c);
alpha = c[4];
break;
}
default:
break;
}
}
{
#ifdef DUMP_CHANGE_INFO
#endif
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
sp_color_get_rgb_floatv(&color, c);
c[4] = 0.0;
break;
case SP_COLOR_SCALES_MODE_HSV:
c[4] = 0.0;
break;
break;
default:
break;
}
}
/* Helpers for setting color value */
{
gtk_adjustment_get_upper(const_cast<GtkAdjustment *>(a));
return val;
}
{
}
{
_rangeLimit = upper;
gtk_adjustment_changed(_a[i]);
}
}
{
if (!get_visible()) {
return;
}
}
{
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
}
{
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
break;
case SP_COLOR_SCALES_MODE_HSV:
break;
sp_color_cmyk_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
break;
default:
break;
}
}
{
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
break;
case SP_COLOR_SCALES_MODE_HSV:
break;
break;
default:
break;
}
}
{
gfloat c[4];
_getRgbaFloatv(c);
return rgba;
}
{
gfloat c[4];
return;
(_mode == SP_COLOR_SCALES_MODE_CMYK)) {
}
else {
}
switch (mode) {
case SP_COLOR_SCALES_MODE_RGB:
_setRangeLimit(255.0);
break;
case SP_COLOR_SCALES_MODE_HSV:
_setRangeLimit(255.0);
c[0] = 0.0;
break;
_setRangeLimit(100.0);
break;
default:
break;
}
}
{
}
{
if (_updating) {
return;
}
if (!_dragging) {
}
}
{
if (_updating) {
return;
}
if (_dragging) {
}
}
{
if (_updating) {
return;
}
_recalcColor();
}
{
return;
}
scales->_recalcColor();
}
{
#ifdef SPCS_PREVIEW
#endif
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
/* Update red */
}
/* Update green */
}
/* Update blue */
}
if (channels != CSC_CHANNEL_A) {
/* Update alpha */
}
break;
case SP_COLOR_SCALES_MODE_HSV:
/* Hue is never updated */
/* Update saturation */
}
/* Update value */
}
if (channels != CSC_CHANNEL_A) {
/* Update alpha */
}
break;
/* Update C */
}
/* Update M */
}
/* Update Y */
}
/* Update K */
}
if (channels != CSC_CHANNEL_CMYKA) {
/* Update alpha */
}
break;
default:
break;
}
#ifdef SPCS_PREVIEW
#endif
}
{
if (!map) {
gchar *p;
gint h;
p = map;
for (h = 0; h < 1024; h++) {
*p++ = SP_COLOR_F_TO_U(rgb[0]);
*p++ = 255;
}
}
return map;
}
{
}
{
return w;
}
}
}
}
}