Commit 17475c5f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Applied patch from David Gowers which adds actions to select palette and

2006-05-28  Michael Natterer  <mitch@gimp.org>

	Applied patch from David Gowers which adds actions to select
	palette and colormap colors with actions. Modified the patch quite
	a bit. Fixes bug #130123.

	* app/widgets/gimpcolormapeditor.[ch]
	* app/widgets/gimppaletteeditor.[ch]: add functions get_index()
	which gets the currently selected color's index (optionally the
	index of a passed color), set_index() which sets the selected
	color by index, and max_index() which returns the maximum possible
	color index.

	* app/dialogs/dialogs-constructors.c: changed accordingly.

	* app/actions/context-actions.c
	* app/actions/context-commands.[ch]: actions and callbacks which
	use the new functions.
parent fa71c34b
2006-05-28 Michael Natterer <mitch@gimp.org>
Applied patch from David Gowers which adds actions to select
palette and colormap colors with actions. Modified the patch quite
a bit. Fixes bug #130123.
* app/widgets/gimpcolormapeditor.[ch]
* app/widgets/gimppaletteeditor.[ch]: add functions get_index()
which gets the currently selected color's index (optionally the
index of a passed color), set_index() which sets the selected
color by index, and max_index() which returns the maximum possible
color index.
* app/dialogs/dialogs-constructors.c: changed accordingly.
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: actions and callbacks which
use the new functions.
2006-05-28 Akkana Peck <akkana@cvs.gnome.org>
* plug-ins/script-fu/scripts/reverse-layers.scm: revert
......
......@@ -74,6 +74,198 @@ static const GimpActionEntry context_actions[] =
GIMP_HELP_TOOLBOX_SWAP_COLORS }
};
static GimpEnumActionEntry context_palette_foreground_actions[] =
{
{ "context-palette-foreground-set", GIMP_STOCK_PALETTE,
"Foreground Palette color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-palette-foreground-first", GIMP_STOCK_PALETTE,
"Foreground Palette color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-palette-foreground-last", GIMP_STOCK_PALETTE,
"Foreground Palette color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-palette-foreground-previous", GIMP_STOCK_PALETTE,
"Foreground Palette color Previous", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-palette-foreground-next", GIMP_STOCK_PALETTE,
"Foreground Palette color Next", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-palette-foreground-previous-skip", GIMP_STOCK_PALETTE,
"Foreground Palette color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-palette-foreground-next-skip", GIMP_STOCK_PALETTE,
"Foreground Palette color Skip Forward", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_palette_background_actions[] =
{
{ "context-palette-background-set", GIMP_STOCK_PALETTE,
"Background Palette color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-palette-background-first", GIMP_STOCK_PALETTE,
"Background Palette color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-palette-background-last", GIMP_STOCK_PALETTE,
"Background Palette color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-palette-background-previous", GIMP_STOCK_PALETTE,
"Background Palette color Previous", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-palette-background-next", GIMP_STOCK_PALETTE,
"Background Palette color Next", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-palette-background-previous-skip", GIMP_STOCK_PALETTE,
"Background Palette color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-palette-background-next-skip", GIMP_STOCK_PALETTE,
"Background Palette color Skip ahead", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_colormap_foreground_actions[] =
{
{ "context-colormap-foreground-set", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-colormap-foreground-first", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-colormap-foreground-last", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-colormap-foreground-previous", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Previous", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-colormap-foreground-next", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Next", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-colormap-foreground-previous-skip", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-colormap-foreground-next-skip", GIMP_STOCK_INDEXED_PALETTE,
"Foreground Colormap color Skip Forward", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_colormap_background_actions[] =
{
{ "context-colormap-background-set", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-colormap-background-first", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-colormap-background-last", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-colormap-background-previous", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Previous", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-colormap-background-next", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Next", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-colormap-background-previous-skip", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-colormap-background-next-skip", GIMP_STOCK_INDEXED_PALETTE,
"Background Colormap color Skip ahead", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_swatch_foreground_actions[] =
{
{ "context-swatch-foreground-set", GIMP_STOCK_PALETTE,
"Foreground Swatch color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-swatch-foreground-first", GIMP_STOCK_PALETTE,
"Foreground Swatch color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-swatch-foreground-last", GIMP_STOCK_PALETTE,
"Foreground Swatch color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-swatch-foreground-previous", GIMP_STOCK_PALETTE,
"Foreground Swatch color Previous", "9", NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-swatch-foreground-next", GIMP_STOCK_PALETTE,
"Foreground Swatch color Next", "0", NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-swatch-foreground-previous-skip", GIMP_STOCK_PALETTE,
"Foreground Swatch color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-swatch-foreground-next-skip", GIMP_STOCK_PALETTE,
"Foreground Swatch color Skip Forward", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_swatch_background_actions[] =
{
{ "context-swatch-background-set", GIMP_STOCK_PALETTE,
"Background Swatch color Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, FALSE,
NULL },
{ "context-swatch-background-first", GIMP_STOCK_PALETTE,
"Background Swatch color First", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-swatch-background-last", GIMP_STOCK_PALETTE,
"Background Swatch color Last", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-swatch-background-previous", GIMP_STOCK_PALETTE,
"Background Swatch color Previous", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-swatch-background-next", GIMP_STOCK_PALETTE,
"Background Swatch color Next", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-swatch-background-previous-skip", GIMP_STOCK_PALETTE,
"Background Swatch color Skip Back", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-swatch-background-next-skip", GIMP_STOCK_PALETTE,
"Background Swatch color Skip ahead", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static const GimpEnumActionEntry context_foreground_red_actions[] =
{
{ "context-foreground-red-set", GIMP_STOCK_CHANNEL_RED,
......@@ -838,6 +1030,34 @@ context_actions_setup (GimpActionGroup *group)
context_actions,
G_N_ELEMENTS (context_actions));
gimp_action_group_add_enum_actions (group,
context_palette_foreground_actions,
G_N_ELEMENTS (context_palette_foreground_actions),
G_CALLBACK (context_palette_foreground_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_palette_background_actions,
G_N_ELEMENTS (context_palette_background_actions),
G_CALLBACK (context_palette_background_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_colormap_foreground_actions,
G_N_ELEMENTS (context_colormap_foreground_actions),
G_CALLBACK (context_colormap_foreground_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_colormap_background_actions,
G_N_ELEMENTS (context_colormap_background_actions),
G_CALLBACK (context_colormap_background_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_swatch_foreground_actions,
G_N_ELEMENTS (context_swatch_foreground_actions),
G_CALLBACK (context_swatch_foreground_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_swatch_background_actions,
G_N_ELEMENTS (context_swatch_background_actions),
G_CALLBACK (context_swatch_background_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_foreground_red_actions,
G_N_ELEMENTS (context_foreground_red_actions),
......
......@@ -33,6 +33,11 @@
#include "core/gimpdatafactory.h"
#include "core/gimplist.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpsessioninfo.h"
#include "widgets/gimppaletteeditor.h"
#include "widgets/gimpcolormapeditor.h"
#include "actions.h"
#include "context-commands.h"
......@@ -64,12 +69,31 @@ static const GimpLayerModeEffects paint_modes[] =
GIMP_VALUE_MODE
};
/* local function prototypes */
static void context_select_object (GimpActionSelectType select_type,
GimpContext *context,
GimpContainer *container);
static gint context_paint_mode_index (GimpLayerModeEffects paint_mode);
static void context_select_object (GimpActionSelectType select_type,
GimpContext *context,
GimpContainer *container);
static gint context_paint_mode_index (GimpLayerModeEffects paint_mode);
static void context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
gboolean use_colormap,
gboolean use_palette);
static gint context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color);
static gint context_max_color_index (gboolean use_colormap,
gboolean use_palette);
static gboolean context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color);
static GimpPaletteEditor * context_get_palette_editor (void);
static GimpColormapEditor * context_get_colormap_editor (void);
/* public functions */
......@@ -94,6 +118,29 @@ context_colors_swap_cmd_callback (GtkAction *action,
gimp_context_swap_colors (context);
}
#define SELECT_COLOR_CMD_CALLBACK(name, fgbg, usec, usep) \
void \
context_##name##_##fgbg##ground_cmd_callback (GtkAction *action, \
gint value, \
gpointer data) \
{ \
GimpRGB color; \
GimpContext *context; \
return_if_no_context (context, data); \
\
gimp_context_get_##fgbg##ground (context, &color); \
context_select_color ((GimpActionSelectType) value, &color, usec, usep); \
gimp_context_set_##fgbg##ground (context, &color); \
\
}
SELECT_COLOR_CMD_CALLBACK (palette, fore, FALSE, TRUE)
SELECT_COLOR_CMD_CALLBACK (palette, back, FALSE, TRUE)
SELECT_COLOR_CMD_CALLBACK (colormap, fore, TRUE, FALSE)
SELECT_COLOR_CMD_CALLBACK (colormap, back, TRUE, FALSE)
SELECT_COLOR_CMD_CALLBACK (swatch, fore, TRUE, TRUE)
SELECT_COLOR_CMD_CALLBACK (swatch, back, TRUE, TRUE)
void
context_foreground_red_cmd_callback (GtkAction *action,
gint value,
......@@ -608,3 +655,150 @@ context_paint_mode_index (GimpLayerModeEffects paint_mode)
return i;
}
static void
context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
gboolean use_colormap,
gboolean use_palette)
{
gint index;
gint max;
index = context_get_color_index (use_colormap, use_palette, color);
max = context_max_color_index (use_colormap, use_palette);
index = action_select_value (select_type, index,
0, max,
1, 4, FALSE);
context_set_color_index (index, use_colormap, use_palette, color);
}
static gint
context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color)
{
if (use_colormap)
{
GimpColormapEditor *editor = context_get_colormap_editor ();
if (editor)
{
gint index = gimp_colormap_editor_get_index (editor, color);
if (index != -1)
return index;
}
}
if (use_palette)
{
GimpPaletteEditor *editor = context_get_palette_editor ();
if (editor)
{
gint index = gimp_palette_editor_get_index (editor, color);
if (index != -1)
return index;
}
}
return 0;
}
static gint
context_max_color_index (gboolean use_colormap,
gboolean use_palette)
{
if (use_colormap)
{
GimpColormapEditor *editor = context_get_colormap_editor ();
if (editor)
{
gint index = gimp_colormap_editor_max_index (editor);
if (index != -1)
return index;
}
}
if (use_palette)
{
GimpPaletteEditor *editor = context_get_palette_editor ();
if (editor)
{
gint index = gimp_palette_editor_max_index (editor);
if (index != -1)
return index;
}
}
return 0;
}
static gboolean
context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color)
{
if (use_colormap)
{
GimpColormapEditor *editor = context_get_colormap_editor ();
if (editor && gimp_colormap_editor_set_index (editor, index, color))
return TRUE;
}
if (use_palette)
{
GimpPaletteEditor *editor = context_get_palette_editor ();
if (editor && gimp_palette_editor_set_index (editor, index, color))
return TRUE;
}
return FALSE;
}
static GimpPaletteEditor *
context_get_palette_editor (void)
{
GimpDialogFactory *dialog_factory;
GimpSessionInfo *info;
dialog_factory = gimp_dialog_factory_from_name ("dock");
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
info = gimp_dialog_factory_find_session_info (dialog_factory,
"gimp-palette-editor");
if (info && info->widget)
return GIMP_PALETTE_EDITOR (gtk_bin_get_child (GTK_BIN (info->widget)));
return NULL;
}
static GimpColormapEditor *
context_get_colormap_editor (void)
{
GimpDialogFactory *dialog_factory;
GimpSessionInfo *info;
dialog_factory = gimp_dialog_factory_from_name ("dock");
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
info = gimp_dialog_factory_find_session_info (dialog_factory,
"gimp-indexed-palette");
if (info && info->widget)
return GIMP_COLORMAP_EDITOR (gtk_bin_get_child (GTK_BIN (info->widget)));
return NULL;
}
......@@ -20,95 +20,117 @@
#define __CONTEXT_COMMANDS_H__
void context_colors_default_cmd_callback (GtkAction *action,
gpointer data);
void context_colors_swap_cmd_callback (GtkAction *action,
gpointer data);
void context_foreground_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_green_cmd_callback(GtkAction *action,
gint value,
gpointer data);
void context_foreground_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_green_cmd_callback(GtkAction *action,
gint value,
gpointer data);
void context_background_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_colors_default_cmd_callback (GtkAction *action,
gpointer data);
void context_colors_swap_cmd_callback (GtkAction *action,
gpointer data);
void context_palette_foreground_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_palette_background_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_colormap_foreground_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_colormap_background_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_swatch_foreground_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_swatch_background_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_green_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_green_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_value_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
gint value,
gpointer data);
void context_foreground_value_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_value_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_tool_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_pattern_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_palette_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_gradient_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_font_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_shape_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_spikes_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_hardness_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
gint value,
gpointer data);
void context_background_value_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_tool_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_pattern_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_palette_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_gradient_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_font_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_shape_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_spikes_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_hardness_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __CONTEXT_COMMANDS_H__ */
......@@ -710,7 +710,7 @@ dialogs_indexed_palette_selected (GimpColormapEditor *editor,
GimpRGB color;
gint index;
index = gimp_colormap_editor_col_index (editor);
index = gimp_colormap_editor_get_index (editor, NULL);
gimp_image_get_colormap_entry (image_editor->image, index, &color);
......
......@@ -63,6 +63,7 @@ enum
LAST_SIGNAL
};
#define EPSILON 1e-10
#define HAVE_COLORMAP(image) \
(image != NULL && \
......@@ -86,8 +87,6 @@ static void gimp_colormap_editor_draw_cell (GimpColormapEditor *editor,
static void gimp_colormap_editor_clear (GimpColormapEditor *editor,
gint start_row);
static void gimp_colormap_editor_update_entries (GimpColormapEditor *editor);
static void gimp_colormap_editor_set_index (GimpColormapEditor *editor,
gint i);
static void gimp_colormap_preview_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
......@@ -344,21 +343,98 @@ gimp_colormap_editor_new (GimpMenuFactory *menu_factory)
NULL);
}
void
gimp_colormap_editor_selected (GimpColormapEditor *editor,
GdkModifierType state)
gint
gimp_colormap_editor_get_index (GimpColormapEditor *editor,
const GimpRGB *search)
{
g_return_if_fail (GIMP_IS_COLORMAP_EDITOR (editor));
GimpImage *image;
gint index;