Commit 79e27e98 authored by Michael Natterer's avatar Michael Natterer

More context & dnd stuff...

parent d5183932
1999-10-28 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/Makefile.am
* app/gradient_select.h
* app/gradientP.h: new files. Put the function prototypes from
gradient_header.h there and renamed them to match the naming
scheme used elsewhere.
* app/gradient.[ch]
* app/gradient_cmds.c
* app/gradient_header.h
* app/gradient_select.c
* app/gradient_select_cmds.c
* tools/pdbgen/pdb/gradient.pdb
* tools/pdbgen/pdb/gradient_select.pdb: separated the gradient
editor and the selections (no more common variables used).
Allocate own contexts for each gradient selection. Tweaked the
code and function names to match the brush and pattern selection.
Enabled dropping gradients to the editor and the selections.
Renamed all public functions of the gradient editor (see above).
* app/app_procs.c
* app/commands.[ch]
* app/menus.c
* app/plug_in.c
* app/session.c: changed according to the new gradient function
names and includes.
* app/brush_select.[ch]
* app/pattern_select.[ch]: scroll to active brush/pattern if it's
outside the preview area. Minor fixes/cleanups. Allow dropping a
brush/pattern.
* app/color_select.c: prefixed all enum constants with
COLOR_SELECT_* due to a name clash with the new gradient header
structure (HUE_SATURATION was defined in both places).
* app/convert.[ch]
* app/convert_cmds.c
* tools/pdbgen/pdb/convert.pdb
* app/palette.c
* app/palette_entries.h
* app/palette_select.[ch]: removed the special
Palette[Entries|Entry]P poiner type.
* app/devices.c: added gradients to the device status dialog.
* app/disp_callbacks.[ch]
* app/gimpcontext.c
* app/gimpcontextpreview.[ch]
* app/gimpdnd.[ch]
* app/indicator_area.c
* app/interface.c: moved the whole tool/brush/pattern/gradient dnd
stuff to gimpdnd.[ch] and provide simple functions to connect dnd
callbacks. All those types are passed as real (cross-application)
GtkSelections now, so the app-side of gimp<->plugin dnd is done.
Added dnd for tools.
* app/tools.[ch]: added a tooltip for all non-toolbox tools
because the device status dialog displays tooltips for all tools.
Use the ToolType enum instead of int in the ToolInfo structure.
* libgimp/gimplimits.h: put the size and color of the transparency
checks here (rename the file to gimpconstants.h ??)
Thu Oct 28 11:45:29 1999 ape@gandalf.spacetec.no (Asbjorn Pettersen)
* app/datafiles.h: include <time.h> for time_t.
......
......@@ -228,7 +228,9 @@ gimp_SOURCES = \
global_edit.c \
global_edit.h \
gradient.c \
gradientP.h \
gradient_header.h \
gradient_select.h \
gradient_select.c \
gradient_select_cmds.c \
gradient.h \
......
......@@ -39,7 +39,7 @@
#include "gimprc.h"
#include "gimpui.h"
#include "global_edit.h"
#include "gradient.h"
#include "gradient_select.h"
#include "image_render.h"
#include "info_window.h"
#include "nav_window.h"
......@@ -1103,10 +1103,10 @@ dialogs_palette_cmd_callback (GtkWidget *widget,
}
void
dialogs_gradient_editor_cmd_callback (GtkWidget *widget,
gpointer client_data)
dialogs_gradient_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
grad_create_gradient_editor ();
gradient_dialog_create ();
}
void
......
......@@ -99,7 +99,7 @@ void filters_repeat_cmd_callback (GtkWidget *widget,
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
......
......@@ -94,7 +94,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "gradient_select.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......
......@@ -61,6 +61,7 @@
#include "gimpset.h"
#include "gimpui.h"
#include "global_edit.h"
#include "gradient_select.h"
#include "gradient.h"
#include "gximage.h"
#include "hue_saturation.h"
......@@ -665,7 +666,7 @@ app_exit_finish (void)
patterns_free ();
palette_dialog_free ();
palettes_free ();
grad_free_gradient_editor ();
gradient_dialog_free ();
gradients_free ();
context_manager_free ();
hue_saturation_free ();
......
......@@ -27,6 +27,7 @@
#include "gimpbrushpipe.h"
#include "gimpbrushpipeP.h"
#include "gimpcontext.h"
#include "gimpdnd.h"
#include "gimplist.h"
#include "gimprc.h"
#include "gimpui.h"
......@@ -63,41 +64,13 @@
#define BLK { 0, 0, 0}
#define RED {255, 127, 127}
static unsigned char scale_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, BLK, BLK, BLK, BLK, BLK, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT }
};
static unsigned char pipe_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, WHT, WHT, WHT, RED },
{ WHT, WHT, WHT, WHT, WHT, RED, RED },
{ WHT, WHT, WHT, WHT, RED, RED, RED },
{ WHT, WHT, WHT, RED, RED, RED, RED },
{ WHT, WHT, RED, RED, RED, RED, RED },
{ WHT, RED, RED, RED, RED, RED, RED }
};
static unsigned char scale_pipe_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, RED },
{ WHT, WHT, WHT, BLK, WHT, RED, RED },
{ WHT, BLK, BLK, BLK, BLK, BLK, RED },
{ WHT, WHT, WHT, BLK, RED, RED, RED },
{ WHT, WHT, RED, BLK, RED, RED, RED },
{ WHT, RED, RED, RED, RED, RED, RED }
};
/* local function prototypes */
static void brush_change_callbacks (BrushSelect *bsp,
gboolean closing);
static void brush_select_drop_brush (GtkWidget *widget,
GimpBrush *brush,
gpointer data);
static void brush_select_brush_changed (GimpContext *context,
GimpBrush *brush,
BrushSelect *bsp);
......@@ -162,6 +135,47 @@ static void brush_select_new_brush_callback (GtkWidget *, gpointer);
static void brush_select_edit_brush_callback (GtkWidget *, gpointer);
static void brush_select_delete_brush_callback (GtkWidget *, gpointer);
static unsigned char scale_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, BLK, BLK, BLK, BLK, BLK, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, WHT },
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT }
};
static unsigned char pipe_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, WHT, WHT, WHT, RED },
{ WHT, WHT, WHT, WHT, WHT, RED, RED },
{ WHT, WHT, WHT, WHT, RED, RED, RED },
{ WHT, WHT, WHT, RED, RED, RED, RED },
{ WHT, WHT, RED, RED, RED, RED, RED },
{ WHT, RED, RED, RED, RED, RED, RED }
};
static unsigned char scale_pipe_indicator_bits[7][7][3] =
{
{ WHT, WHT, WHT, WHT, WHT, WHT, WHT },
{ WHT, WHT, WHT, BLK, WHT, WHT, RED },
{ WHT, WHT, WHT, BLK, WHT, RED, RED },
{ WHT, BLK, BLK, BLK, BLK, BLK, RED },
{ WHT, WHT, WHT, BLK, RED, RED, RED },
{ WHT, WHT, RED, BLK, RED, RED, RED },
{ WHT, RED, RED, RED, RED, RED, RED }
};
/* dnd stuff */
static GtkTargetEntry preview_target_table[] =
{
GIMP_TARGET_BRUSH
};
static guint preview_n_targets = (sizeof (preview_target_table) /
sizeof (preview_target_table[0]));
/* The main brush selection dialog */
BrushSelect *brush_select_dialog = NULL;
......@@ -178,21 +192,15 @@ brush_dialog_create (void)
{
if (! brush_select_dialog)
{
/* Create the dialog... */
brush_select_dialog = brush_select_new (NULL, NULL, 0.0, 0, 0);
/* register this one only */
dialog_register (brush_select_dialog->shell);
}
else
{
/* Popup the dialog */
if (!GTK_WIDGET_VISIBLE (brush_select_dialog->shell))
gtk_widget_show (brush_select_dialog->shell);
else
gdk_window_raise (brush_select_dialog->shell->window);
}
}
void
......@@ -200,6 +208,15 @@ brush_dialog_free ()
{
if (brush_select_dialog)
{
session_get_window_info (brush_select_dialog->shell,
&brush_select_session_info);
/* save the size of the preview */
brush_select_session_info.width =
brush_select_dialog->preview->allocation.width;
brush_select_session_info.height =
brush_select_dialog->preview->allocation.height;
brush_select_free (brush_select_dialog);
brush_select_dialog = NULL;
}
......@@ -231,7 +248,7 @@ brush_select_new (gchar *title,
GimpBrush *active = NULL;
/* gboolean gotinitbrush = FALSE; */
static gboolean first_call = TRUE;
bsp = g_new (BrushSelect, 1);
bsp->callback_name = NULL;
......@@ -267,14 +284,18 @@ brush_select_new (gchar *title,
}
else
{
bsp->context = gimp_context_get_user ();
session_set_window_geometry (bsp->shell, &brush_select_session_info,
FALSE);
bsp->context = gimp_context_get_user ();
dialog_register (bsp->shell);
}
if (no_data)
if (no_data && first_call)
brushes_init (FALSE);
first_call = FALSE;
if (title && init_name && strlen (init_name))
{
active = gimp_brush_list_get_brush (brush_list, init_name);
......@@ -349,6 +370,13 @@ brush_select_new (gchar *title,
GTK_SIGNAL_FUNC (brush_select_resize),
bsp);
/* dnd stuff */
gtk_drag_dest_set (bsp->preview,
GTK_DEST_DEFAULT_ALL,
preview_target_table, preview_n_targets,
GDK_ACTION_COPY);
gimp_dnd_brush_dest_set (bsp->preview, brush_select_drop_brush, bsp);
gtk_container_add (GTK_CONTAINER (frame), bsp->preview);
gtk_widget_show (bsp->preview);
......@@ -535,15 +563,6 @@ brush_select_free (BrushSelect *bsp)
/* remove from active list */
brush_active_dialogs = g_slist_remove (brush_active_dialogs, bsp);
/* Only main one is saved */
if (bsp == brush_select_dialog)
{
session_get_window_info (bsp->shell, &brush_select_session_info);
/* save the size of the preview */
brush_select_session_info.width = bsp->preview->allocation.width;
brush_select_session_info.height = bsp->preview->allocation.height;
}
gtk_signal_disconnect_by_data (GTK_OBJECT (bsp->context), bsp);
if (bsp->brush_popup != NULL)
......@@ -576,6 +595,7 @@ brush_select_freeze_all (void)
bsp->freeze = TRUE;
}
}
void
brush_select_thaw_all (void)
{
......@@ -633,9 +653,9 @@ brush_select_show_paint_options (BrushSelect *bsp,
/* call this dialog's PDB callback */
void
static void
brush_change_callbacks (BrushSelect *bsp,
gint closing)
gboolean closing)
{
gchar *name;
ProcRecord *prec = NULL;
......@@ -661,15 +681,15 @@ brush_change_callbacks (BrushSelect *bsp,
return_vals =
procedural_db_run_proc (name,
&nreturn_vals,
PDB_STRING, brush->name,
PDB_FLOAT, gimp_context_get_opacity (bsp->context),
PDB_INT32, bsp->spacing_value,
PDB_INT32, (gint)gimp_context_get_paint_mode (bsp->context),
PDB_INT32, brush->mask->width,
PDB_INT32, brush->mask->height,
PDB_INT32, brush->mask->width * brush->mask->height,
PDB_STRING, brush->name,
PDB_FLOAT, gimp_context_get_opacity (bsp->context),
PDB_INT32, bsp->spacing_value,
PDB_INT32, (gint) gimp_context_get_paint_mode (bsp->context),
PDB_INT32, brush->mask->width,
PDB_INT32, brush->mask->height,
PDB_INT32, brush->mask->width * brush->mask->height,
PDB_INT8ARRAY, temp_buf_data (brush->mask),
PDB_INT32, closing,
PDB_INT32, (gint) closing,
PDB_END);
if (!return_vals || return_vals[0].value.pdb_int != PDB_SUCCESS)
......@@ -695,7 +715,7 @@ brushes_check_dialogs (void)
while (list)
{
bsp = (BrushSelect *) list->data;
list = list->next;
list = g_slist_next (list);
name = bsp->callback_name;
......@@ -716,6 +736,18 @@ brushes_check_dialogs (void)
* Local functions
*/
static void
brush_select_drop_brush (GtkWidget *widget,
GimpBrush *brush,
gpointer data)
{
BrushSelect *bsp;
bsp = (BrushSelect *) data;
gimp_context_set_brush (bsp->context, brush);
}
static void
brush_select_brush_changed (GimpContext *context,
GimpBrush *brush,
......@@ -752,12 +784,14 @@ brush_select_select (BrushSelect *bsp,
{
gint index;
gint row, col;
gint scroll_offset = 0;
index = gimp_brush_list_get_brush_index (brush_list, brush);
if (index >= gimp_brush_list_length (brush_list))
index = gimp_brush_list_length (brush_list) - 1;
if (index < 0 || index >= gimp_brush_list_length (brush_list))
if (index < 0)
return;
if (GIMP_IS_BRUSH_GENERATED (brush))
......@@ -776,7 +810,23 @@ brush_select_select (BrushSelect *bsp,
row = index / bsp->NUM_BRUSH_COLUMNS;
col = index - row * (bsp->NUM_BRUSH_COLUMNS);
brush_select_show_selected (bsp, row, col);
/* check if the new active brush is already in the preview */
if (((row + 1) * bsp->cell_height) >
(bsp->preview->allocation.height + bsp->scroll_offset))
{
scroll_offset = (((row + 1) * bsp->cell_height) -
(bsp->scroll_offset + bsp->preview->allocation.height));
}
else if ((row * bsp->cell_height) < bsp->scroll_offset)
{
scroll_offset = (row * bsp->cell_height) - bsp->scroll_offset;
}
else
{
brush_select_show_selected (bsp, row, col);
}
gtk_adjustment_set_value (bsp->sbar_data, bsp->scroll_offset + scroll_offset);
}
static void
......@@ -1373,6 +1423,7 @@ preview_calc_scrollbar (BrushSelect *bsp)
bsp->sbar_data->page_increment = (page_size >> 1);
bsp->sbar_data->step_increment = bsp->cell_width;
gtk_signal_emit_by_name (GTK_OBJECT (bsp->sbar_data), "changed");
gtk_signal_emit_by_name (GTK_OBJECT (bsp->sbar_data), "value_changed");
}
......@@ -1507,8 +1558,8 @@ brush_select_events (GtkWidget *widget,
/* Close the brush popup window */
brush_popup_close (bsp);
/* Call any callbacks registered */
brush_change_callbacks (bsp, 0);
/* Call any callbacks registered */
brush_change_callbacks (bsp, FALSE);
}
break;
......@@ -1593,7 +1644,7 @@ opacity_scale_update (GtkAdjustment *adjustment,
if (bsp != brush_select_dialog)
{
brush_change_callbacks (bsp, 0);
brush_change_callbacks (bsp, FALSE);
}
}
......@@ -1609,7 +1660,7 @@ paint_mode_menu_callback (GtkWidget *widget,
if (bsp != brush_select_dialog)
{
brush_change_callbacks (bsp, 0);
brush_change_callbacks (bsp, FALSE);
}
}
......@@ -1631,7 +1682,7 @@ spacing_scale_update (GtkAdjustment *adjustment,
if (bsp->spacing_value != adjustment->value)
{
bsp->spacing_value = adjustment->value;
brush_change_callbacks (bsp, 0);
brush_change_callbacks (bsp, FALSE);
}
}
}
......@@ -1651,7 +1702,7 @@ brush_select_close_callback (GtkWidget *widget,
if (bsp != brush_select_dialog)
{
/* Send data back */
brush_change_callbacks (bsp, 1);
brush_change_callbacks (bsp, TRUE);
gtk_widget_destroy (bsp->shell);
brush_select_free (bsp);
}
......
......@@ -96,8 +96,6 @@ void brush_select_free (BrushSelect *bsp);
void brush_select_freeze_all (void);
void brush_select_thaw_all (void);
void brush_change_callbacks (BrushSelect *bsp,
gint closing);
void brushes_check_dialogs (void);
/* show/hide paint options (main brush dialog if bsp == NULL) */
......
......@@ -54,18 +54,18 @@ typedef enum
typedef enum
{
HUE = 0,
SATURATION,
VALUE,
RED,
GREEN,
BLUE,
HUE_SATURATION,
HUE_VALUE,
SATURATION_VALUE,
RED_GREEN,
RED_BLUE,
GREEN_BLUE
COLOR_SELECT_HUE = 0,
COLOR_SELECT_SATURATION,
COLOR_SELECT_VALUE,
COLOR_SELECT_RED,
COLOR_SELECT_GREEN,
COLOR_SELECT_BLUE,
COLOR_SELECT_HUE_SATURATION,
COLOR_SELECT_HUE_VALUE,
COLOR_SELECT_SATURATION_VALUE,
COLOR_SELECT_RED_GREEN,
COLOR_SELECT_RED_BLUE,
COLOR_SELECT_GREEN_BLUE
} ColorSelectFillType;
typedef enum
......@@ -452,9 +452,9 @@ color_select_drag_new_color (GtkWidget *widget,
csp = (ColorSelect *) data;
*r = (guchar) csp->values[RED];
*g = (guchar) csp->values[GREEN];
*b = (guchar) csp->values[BLUE];
*r = (guchar) csp->values[COLOR_SELECT_RED];
*g = (guchar) csp->values[COLOR_SELECT_GREEN];
*b = (guchar) csp->values[COLOR_SELECT_BLUE];
}
static void
......@@ -468,9 +468,9 @@ color_select_drop_new_color (GtkWidget *widget,
csp = (ColorSelect *) data;
csp->values[RED] = (gint) r;
csp->values[GREEN] = (gint) g;
csp->values[BLUE] = (gint) b;
csp->values[COLOR_SELECT_RED] = (gint) r;
csp->values[COLOR_SELECT_GREEN] = (gint) g;
csp->values[COLOR_SELECT_BLUE] = (gint) b;
color_select_update_hsv_values (csp);
color_select_update_pos (csp);
......@@ -515,9 +515,9 @@ color_select_set_color (ColorSelect *csp,
if (set_current)
{
csp->values[RED] = r;
csp->values[GREEN] = g;
csp->values[BLUE] = b;
csp->values[COLOR_SELECT_RED] = r;
csp->values[COLOR_SELECT_GREEN] = g;
csp->values[COLOR_SELECT_BLUE] = b;
color_select_update_hsv_values (csp);
color_select_update_pos (csp);
......@@ -578,9 +578,9 @@ color_select_update_caller (ColorSelect *csp)
{
if (csp && csp->wants_updates && csp->callback)
{
(* csp->callback) (csp->values[RED],
csp->values[GREEN],
csp->values[BLUE],
(* csp->callback) (csp->values[COLOR_SELECT_RED],
csp->values[COLOR_SELECT_GREEN],
csp->values[COLOR_SELECT_BLUE],
COLOR_SELECT_UPDATE,
csp->client_data);
}
......@@ -593,48 +593,48 @@ color_select_update_values (ColorSelect *csp)
{
switch (csp->z_color_fill)
{
case RED:
csp->values[BLUE] = csp->pos[0];
csp->values[GREEN] = csp->pos[1];
csp->values[RED] = csp->pos[2];
case COLOR_SELECT_RED:
csp->values[COLOR_SELECT_BLUE] = csp->pos[0];
csp->values[COLOR_SELECT_GREEN] = csp->pos[1];
csp->values[COLOR_SELECT_RED] = csp->pos[2];
break;
case GREEN:
csp->values[BLUE] = csp->pos[0];
csp->values[RED] = csp->pos[1];
csp->values[GREEN] = csp->pos[2];
case COLOR_SELECT_GREEN:
csp->values[COLOR_SELECT_BLUE] = csp->pos[0];
csp->values[COLOR_SELECT_RED] = csp->pos[1];
csp->values[COLOR_SELECT_GREEN] = csp->pos[2];
break;
case BLUE:
csp->values[GREEN] = csp->pos[0];
csp->values[RED] = csp->pos[1];
csp->values[BLUE] = csp->pos[2];
case COLOR_SELECT_BLUE:
csp->values[COLOR_SELECT_GREEN] = csp->pos[0];
csp->values[COLOR_SELECT_RED] = csp->pos[1];
csp->values[COLOR_SELECT_BLUE] = csp->pos[2];
break;
case HUE:
csp->values[VALUE] = csp->pos[0] * 100 / 255;
csp->values[SATURATION] = csp->pos[1] * 100 / 255;
csp->values[HUE] = csp->pos[2] * 360 / 255;
case COLOR_SELECT_HUE:
csp->values[COLOR_SELECT_VALUE] = csp->pos[0] * 100 / 255;
csp->values[COLOR_SELECT_SATURATION] = csp->pos[1] * 100 / 255;
csp->values[COLOR_SELECT_HUE] = csp->pos[2] * 360 / 255;
break;
case SATURATION:
csp->values[VALUE] = csp->pos[0] * 100 / 255;
csp->values[HUE] = csp->pos[1] * 360 / 255;
csp->values[SATURATION] = csp->pos[2] * 100 / 255;
case COLOR_SELECT_SATURATION:
csp->values[COLOR_SELECT_VALUE] = csp->pos[0] * 100 / 255;
csp->values[COLOR_SELECT_HUE] = csp->pos[1] * 360 / 255;
csp->values[COLOR_SELECT_SATURATION] = csp->pos[2] * 100 / 255;
break;
case VALUE:
csp->values[SATURATION] = csp->pos[0] * 100 / 255;
csp->values[HUE] = csp->pos[1] * 360 / 255;
csp->values[VALUE] = csp->pos[2] * 100 / 255;
case COLOR_SELECT_VALUE:
csp->values[COLOR_SELECT_SATURATION] = csp->pos[0] * 100 / 255;
csp->values[COLOR_SELECT_HUE] = csp->pos[1] * 360 / 255;
csp->values[COLOR_SELECT_VALUE] = csp->pos[2] * 100 / 255;
break;
}
switch (csp->z_color_fill)
{
case RED:
case GREEN:
case BLUE:
case COLOR_SELECT_RED:
case COLOR_SELECT_GREEN:
case COLOR_SELECT_BLUE:
color_select_update_hsv_values (csp);
break;
case HUE:
case SATURATION:
case VALUE:
case COLOR_SELECT_HUE:
case COLOR_SELECT_SATURATION:
case COLOR_SELECT_VALUE:
color_select_update_rgb_values (csp);
break;
}
......@@ -649,15 +649,15 @@ color_select_update_rgb_values (ColorSelect *csp)
if (csp)
{
h = csp->values[HUE];
s = csp->values[SATURATION] / 100.0;
v = csp->values[VALUE] / 100.0;
h = csp->values[COLOR_SELECT_HUE];
s = csp->values[COLOR_SELECT_SATURATION] / 100.0;
v = csp->values[COLOR_SELECT_VALUE] / 100.0;
if (s == 0)
{
csp->values[RED] = v * 255;
csp->values[GREEN] = v * 255;
csp->values[BLUE] = v * 255;
csp->values[COLOR_SELECT_RED] = v * 255;
csp->values[COLOR_SELECT_GREEN] = v * 255;
csp->values[COLOR_SELECT_BLUE] = v * 255;
}
else
{
......@@ -673,34 +673,34 @@ color_select_update_rgb_values (ColorSelect *csp)