Commit 80a8d5a7 authored by Nate Summers's avatar Nate Summers

Introduced GimpPaintTool and GimpDrawTool

parent 2fd2a4e6
2001-02-26 Nathan Summers <rock@gimp.org>
app/tools/gimpdrawtool.c
* app/tools/gimpdrawtool.h
* app/tools/gimppainttool.c
* app/tools/gimppainttool.h
* app/tools/gimppainttool_kernels.h: Created GimpDrawTool and
GimpPaintTool, real classes that replace the old DrawCore and
PaintCore
* app/Makefile.am
* app/apptypes.h
* app/context_manager.c
* app/gdisplay.c
* app/gimage_mask.c
* app/gimpbrush.c
* app/gimpbrush.h
* app/gimpbrushgenerated.c
* app/gimpbrushpipe.c
* app/gimpcontext.c
* app/info_window.c
* app/path_transform.h
* app/undo.c
* app/pdb/tools_cmds.c
* app/tools/Makefile.am
* app/tools/bezier_selectP.h
* app/tools/gimptoolinfo.c
* app/tools/measure.c
* app/tools/measure.h
* app/tools/move.c
* app/tools/paint_options.c
* app/tools/tool.c
* app/tools/tool.h
* app/tools/tools.c
* app/tools/transform_core.h
* tools/pdbgen/Makefile.am: changed accordingly
* libgimp/Makefile.am: fixed glitch in build
* app/tools/gimpcolorpickertool.c
* app/tools/gimpcolorpickertool.h
* app/tools/gimppaintbrushtool.c
* app/tools/gimppaintbrushtool.h:new names
* app/draw_core.c
* app/draw_core.h
* app/tools/color_picker.c
* app/tools/color_picker.h
* app/tools/paint_core.c
* app/tools/paint_core.h
* app/tools/paint_core_kernels.h
* app/tools/paintbrush.c
* app/tools/paintbrush.h: removed
2001-02-25 Michael Natterer <mitch@gimp.org>
* app/channel_ops.c
......
......@@ -72,8 +72,6 @@ gimp_SOURCES = \
disp_callbacks.h \
docindex.c \
docindex.h \
draw_core.c \
draw_core.h \
drawable.c \
drawable.h \
errorconsole.c \
......
......@@ -111,7 +111,7 @@ typedef struct _BoundSeg BoundSeg;
typedef struct _ColorNotebook ColorNotebook;
typedef struct _DrawCore DrawCore;
typedef struct _GimpDrawTool GimpDrawTool;
typedef struct _GDisplay GDisplay;
......@@ -133,7 +133,7 @@ typedef gpointer ImageMap;
typedef struct _InfoDialog InfoDialog;
typedef struct _PaintCore PaintCore;
typedef struct _GimpPaintTool GimpPaintTool;
typedef struct _Path Path;
typedef struct _PathPoint PathPoint;
......
......@@ -46,7 +46,6 @@
#include "gimppattern.h"
#include "gimprc.h"
/*
* the list of all images
*/
......
......@@ -51,7 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#include "brush_scale.h"
#include "libgimp/gimpintl.h"
......@@ -65,8 +65,8 @@ static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint height);
static gchar * gimp_brush_get_extension (GimpData *data);
static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static GimpBrush * gimp_brush_select_brush (GimpPaintTool *paint_tool);
static gboolean gimp_brush_want_null_motion (GimpPaintTool *paint_tool);
static GimpViewableClass *parent_class = NULL;
......@@ -108,7 +108,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
data_class = (GimpDataClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DATA);
object_class->destroy = gimp_brush_destroy;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
......@@ -180,7 +180,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gdouble ratio_x = (gdouble) brush_width / width;
gdouble ratio_y = (gdouble) brush_height / height;
brush_width = (gdouble) brush_width / MAX (ratio_x, ratio_y) + 0.5;
brush_width = (gdouble) brush_width / MAX (ratio_x, ratio_y) + 0.5;
brush_height = (gdouble) brush_height / MAX (ratio_x, ratio_y) + 0.5;
mask_buf = brush_scale_mask (mask_buf, brush_width, brush_height);
......@@ -218,7 +218,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
bg = (255 - *mask);
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
mask++;
......@@ -305,7 +305,7 @@ gimp_brush_load (const gchar *filename)
g_return_val_if_fail (filename != NULL, NULL);
fd = open (filename, O_RDONLY | _O_BINARY);
if (fd == -1)
if (fd == -1)
return NULL;
brush = gimp_brush_load_brush (fd, filename);
......@@ -330,13 +330,13 @@ gimp_brush_load (const gchar *filename)
}
static GimpBrush *
gimp_brush_select_brush (PaintCore *paint_core)
gimp_brush_select_brush (GimpPaintTool *paint_core)
{
return paint_core->brush;
}
static gboolean
gimp_brush_want_null_motion (PaintCore *paint_core)
gimp_brush_want_null_motion (GimpPaintTool *paint_core)
{
return TRUE;
}
......
......@@ -51,7 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#include "brush_scale.h"
#include "libgimp/gimpintl.h"
......@@ -65,8 +65,8 @@ static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint height);
static gchar * gimp_brush_get_extension (GimpData *data);
static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static GimpBrush * gimp_brush_select_brush (GimpPaintTool *paint_tool);
static gboolean gimp_brush_want_null_motion (GimpPaintTool *paint_tool);
static GimpViewableClass *parent_class = NULL;
......@@ -108,7 +108,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
data_class = (GimpDataClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_DATA);
object_class->destroy = gimp_brush_destroy;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
......@@ -180,7 +180,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gdouble ratio_x = (gdouble) brush_width / width;
gdouble ratio_y = (gdouble) brush_height / height;
brush_width = (gdouble) brush_width / MAX (ratio_x, ratio_y) + 0.5;
brush_width = (gdouble) brush_width / MAX (ratio_x, ratio_y) + 0.5;
brush_height = (gdouble) brush_height / MAX (ratio_x, ratio_y) + 0.5;
mask_buf = brush_scale_mask (mask_buf, brush_width, brush_height);
......@@ -218,7 +218,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
bg = (255 - *mask);
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
*b++ = bg + (*mask * *pixmap++) / 255;
mask++;
......@@ -305,7 +305,7 @@ gimp_brush_load (const gchar *filename)
g_return_val_if_fail (filename != NULL, NULL);
fd = open (filename, O_RDONLY | _O_BINARY);
if (fd == -1)
if (fd == -1)
return NULL;
brush = gimp_brush_load_brush (fd, filename);
......@@ -330,13 +330,13 @@ gimp_brush_load (const gchar *filename)
}
static GimpBrush *
gimp_brush_select_brush (PaintCore *paint_core)
gimp_brush_select_brush (GimpPaintTool *paint_core)
{
return paint_core->brush;
}
static gboolean
gimp_brush_want_null_motion (PaintCore *paint_core)
gimp_brush_want_null_motion (GimpPaintTool *paint_core)
{
return TRUE;
}
......
......@@ -53,8 +53,8 @@ struct _GimpBrushClass
GimpDataClass parent_class;
/* FIXME: these are no virtual function pointers but bad hacks: */
GimpBrush * (* select_brush) (PaintCore *paint_core);
gboolean (* want_null_motion) (PaintCore *paint_core);
GimpBrush * (* select_brush) (GimpPaintTool *paint_tool);
gboolean (* want_null_motion) (GimpPaintTool *paint_tool);
};
......
......@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#define OVERSAMPLING 5
......
......@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#define OVERSAMPLING 5
......
......@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#define OVERSAMPLING 5
......
......@@ -53,15 +53,15 @@
#include "gimprc.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#include "libgimp/gimpparasiteio.h"
#include "libgimp/gimpintl.h"
static GimpBrush * gimp_brush_pipe_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_pipe_want_null_motion (PaintCore *paint_core);
static GimpBrush * gimp_brush_pipe_select_brush (GimpPaintTool *paint_tool);
static gboolean gimp_brush_pipe_want_null_motion (GimpPaintTool *paint_tool);
static void gimp_brush_pipe_destroy (GtkObject *object);
......@@ -69,16 +69,16 @@ static GimpBrushClass *parent_class = NULL;
static GimpBrush *
gimp_brush_pipe_select_brush (PaintCore *paint_core)
gimp_brush_pipe_select_brush (GimpPaintTool *paint_tool)
{
GimpBrushPipe *pipe;
gint i, brushix, ix;
gdouble angle;
g_return_val_if_fail (paint_core != NULL, NULL);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_core->brush), NULL);
g_return_val_if_fail (paint_tool != NULL, NULL);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_tool->brush), NULL);
pipe = GIMP_BRUSH_PIPE (paint_core->brush);
pipe = GIMP_BRUSH_PIPE (paint_tool->brush);
if (pipe->nbrushes == 1)
return GIMP_BRUSH (pipe->current);
......@@ -92,8 +92,8 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix = (pipe->index[i] + 1) % pipe->rank[i];
break;
case PIPE_SELECT_ANGULAR:
angle = atan2 (paint_core->cury - paint_core->lasty,
paint_core->curx - paint_core->lastx);
angle = atan2 (paint_tool->cury - paint_tool->lasty,
paint_tool->curx - paint_tool->lastx);
/* Offset angle to be compatible with PSP tubes */
angle += G_PI_2;
/* Map it to the [0..2*G_PI) interval */
......@@ -108,13 +108,13 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix = rand () % pipe->rank[i];
break;
case PIPE_SELECT_PRESSURE:
ix = RINT (paint_core->curpressure * (pipe->rank[i] - 1));
ix = RINT (paint_tool->curpressure * (pipe->rank[i] - 1));
break;
case PIPE_SELECT_TILT_X:
ix = RINT (paint_core->curxtilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
ix = RINT (paint_tool->curxtilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
break;
case PIPE_SELECT_TILT_Y:
ix = RINT (paint_core->curytilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
ix = RINT (paint_tool->curytilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
break;
case PIPE_SELECT_CONSTANT:
default:
......@@ -134,15 +134,15 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
}
static gboolean
gimp_brush_pipe_want_null_motion (PaintCore *paint_core)
gimp_brush_pipe_want_null_motion (GimpPaintTool *paint_tool)
{
GimpBrushPipe *pipe;
gint i;
g_return_val_if_fail (paint_core != NULL, TRUE);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_core->brush), TRUE);
g_return_val_if_fail (paint_tool != NULL, TRUE);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_tool->brush), TRUE);
pipe = GIMP_BRUSH_PIPE (paint_core->brush);
pipe = GIMP_BRUSH_PIPE (paint_tool->brush);
if (pipe->nbrushes == 1)
return TRUE;
......
......@@ -53,15 +53,15 @@
#include "gimprc.h"
/* this needs to go away */
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#include "libgimp/gimpparasiteio.h"
#include "libgimp/gimpintl.h"
static GimpBrush * gimp_brush_pipe_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_pipe_want_null_motion (PaintCore *paint_core);
static GimpBrush * gimp_brush_pipe_select_brush (GimpPaintTool *paint_tool);
static gboolean gimp_brush_pipe_want_null_motion (GimpPaintTool *paint_tool);
static void gimp_brush_pipe_destroy (GtkObject *object);
......@@ -69,16 +69,16 @@ static GimpBrushClass *parent_class = NULL;
static GimpBrush *
gimp_brush_pipe_select_brush (PaintCore *paint_core)
gimp_brush_pipe_select_brush (GimpPaintTool *paint_tool)
{
GimpBrushPipe *pipe;
gint i, brushix, ix;
gdouble angle;
g_return_val_if_fail (paint_core != NULL, NULL);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_core->brush), NULL);
g_return_val_if_fail (paint_tool != NULL, NULL);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_tool->brush), NULL);
pipe = GIMP_BRUSH_PIPE (paint_core->brush);
pipe = GIMP_BRUSH_PIPE (paint_tool->brush);
if (pipe->nbrushes == 1)
return GIMP_BRUSH (pipe->current);
......@@ -92,8 +92,8 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix = (pipe->index[i] + 1) % pipe->rank[i];
break;
case PIPE_SELECT_ANGULAR:
angle = atan2 (paint_core->cury - paint_core->lasty,
paint_core->curx - paint_core->lastx);
angle = atan2 (paint_tool->cury - paint_tool->lasty,
paint_tool->curx - paint_tool->lastx);
/* Offset angle to be compatible with PSP tubes */
angle += G_PI_2;
/* Map it to the [0..2*G_PI) interval */
......@@ -108,13 +108,13 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix = rand () % pipe->rank[i];
break;
case PIPE_SELECT_PRESSURE:
ix = RINT (paint_core->curpressure * (pipe->rank[i] - 1));
ix = RINT (paint_tool->curpressure * (pipe->rank[i] - 1));
break;
case PIPE_SELECT_TILT_X:
ix = RINT (paint_core->curxtilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
ix = RINT (paint_tool->curxtilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
break;
case PIPE_SELECT_TILT_Y:
ix = RINT (paint_core->curytilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
ix = RINT (paint_tool->curytilt / 2.0 * pipe->rank[i]) + pipe->rank[i]/2;
break;
case PIPE_SELECT_CONSTANT:
default:
......@@ -134,15 +134,15 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
}
static gboolean
gimp_brush_pipe_want_null_motion (PaintCore *paint_core)
gimp_brush_pipe_want_null_motion (GimpPaintTool *paint_tool)
{
GimpBrushPipe *pipe;
gint i;
g_return_val_if_fail (paint_core != NULL, TRUE);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_core->brush), TRUE);
g_return_val_if_fail (paint_tool != NULL, TRUE);
g_return_val_if_fail (GIMP_IS_BRUSH_PIPE (paint_tool->brush), TRUE);
pipe = GIMP_BRUSH_PIPE (paint_core->brush);
pipe = GIMP_BRUSH_PIPE (paint_tool->brush);
if (pipe->nbrushes == 1)
return TRUE;
......
......@@ -1394,6 +1394,8 @@ gimp_context_real_set_tool (GimpContext *context,
GTK_SIGNAL_FUNC (gimp_context_tool_dirty),
context);
/* FIXME if (tool_info != standard_tool_info) */
if (tool_info != standard_tool_info)
context->tool_name = g_strdup (GIMP_OBJECT (tool_info)->name);
}
......
......@@ -22,7 +22,7 @@
#include "apptypes.h"
#include "tools/paint_core.h"
#include "tools/gimppainttool.h"
#include "tools/paint_options.h"
#include "tools/tool.h"
#include "tools/tool_manager.h"
......
......@@ -24,11 +24,13 @@
#include "libgimpwidgets/gimpwidgets.h"
#include "apptypes.h"
#include "appenv.h"
#include "color_picker.h"
#include "tools/gimpdrawtool.h"
#include "tools/gimpcolorpickertool.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
......@@ -44,26 +46,25 @@
#include "pixmaps2.h"
/* maximum information buffer size */
#define MAX_INFO_BUF 8
/* the color picker structures */
typedef struct _ColorPickerOptions ColorPickerOptions;
typedef struct _GimpColorPickerToolOptions GimpColorPickerToolOptions;
struct _ColorPickerOptions
struct _GimpColorPickerToolOptions
{
ToolOptions tool_options;
gboolean sample_merged;
gboolean sample_merged_d;
GtkWidget *sample_merged_w;
gboolean sample_average;
gboolean sample_average_d;
GtkWidget *sample_average_w;
gdouble average_radius;
gdouble average_radius_d;
GtkObject *average_radius_w;
......@@ -76,36 +77,45 @@ struct _ColorPickerOptions
/* local function prototypes */
static void gimp_color_picker_class_init (GimpColorPickerClass *klass);
static void gimp_color_picker_init (GimpColorPicker *color_picker);
static void gimp_color_picker_destroy (GtkObject *object);
static void color_picker_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void color_picker_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void color_picker_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void color_picker_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void color_picker_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
static void colorpicker_draw (GimpTool *tool);
static ColorPickerOptions * color_picker_options_new (void);
static void color_picker_options_reset (void);
static void color_picker_info_window_close_callback (GtkWidget *widget,
gpointer data);
static void color_picker_info_update (GimpTool *tool,
gboolean valid);
static void gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass);
static void gimp_color_picker_tool_init (GimpColorPickerTool *color_picker_tool);
static void gimp_color_picker_tool_destroy (GtkObject *object);
static void gimp_color_picker_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_color_picker_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_color_picker_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_color_picker_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_color_picker_tool_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
static void gimp_color_picker_tool_draw (GimpTool *tool);
static GimpColorPickerToolOptions * gimp_color_picker_tool_options_new (void);
static void gimp_color_picker_tool_options_reset (void);
static void gimp_color_picker_tool_info_window_close_callback (GtkWidget *widget,
gpointer data);
static void gimp_color_picker_tool_info_update (GimpTool *tool,
gboolean valid);
static gboolean pick_color_do (GimpImage *gimage,
GimpDrawable *drawable,
gint x,
......@@ -118,7 +128,7 @@ static gboolean pick_color_do (GimpImage *gimage,
/* the color picker tool options */
static ColorPickerOptions * color_picker_options = NULL;
static GimpColorPickerToolOptions * gimp_color_picker_tool_options = NULL;
/* the color value */
gint col_value[5] = { 0, 0, 0, 0, 0 };
......@@ -126,7 +136,7 @@ gint col_value[5] = { 0, 0, 0, 0, 0 };
/* the color picker dialog */
static gint update_type;
static GimpImageType sample_type;
static InfoDialog *color_picker_info = NULL;
static InfoDialog *gimp_color_picker_tool_info = NULL;
static GtkWidget *color_area = NULL;
static gchar red_buf [MAX_INFO_BUF];
static gchar green_buf[MAX_INFO_BUF];
......@@ -136,14 +146,13 @@ static gchar index_buf[MAX_INFO_BUF];
static gchar gray_buf [MAX_INFO_BUF];
static gchar hex_buf [MAX_INFO_BUF];
static GimpToolClass *parent_class = NULL;
void
gimp_color_picker_register (void)
gimp_color_picker_tool_register (void)
{
tool_manager_register_tool (GIMP_TYPE_COLOR_PICKER,
tool_manager_register_tool (GIMP_TYPE_COLOR_PICKER_TOOL,
"gimp:color_picker_tool",
_("Color Picker"),
_("Pick colors from the image"),
......@@ -153,7 +162,7 @@ gimp_color_picker_register (void)
}
GtkType
gimp_color_picker_get_type (void)
gimp_color_picker_tool_get_type (void)
{
static GtkType tool_type = 0;
......@@ -161,80 +170,80 @@ gimp_color_picker_get_type (void)
{
GtkTypeInfo tool_info =
{
"GimpColorPicker",
sizeof (GimpColorPicker),
sizeof (GimpColorPickerClass),
(GtkClassInitFunc) gimp_color_picker_class_init,
(GtkObjectInitFunc) gimp_color_picker_init,
"GimpColorPickerTool",
sizeof (GimpColorPickerTool),
sizeof (GimpColorPickerToolClass),
(GtkClassInitFunc) gimp_color_picker_tool_class_init,
(GtkObjectInitFunc) gimp_color_picker_tool_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
tool_type = gtk_type_unique (GIMP_TYPE_TOOL, &tool_info);
tool_type = gtk_type_unique (GIMP_TYPE_DRAW_TOOL, &tool_info);
}
return tool_type;
}
static void
gimp_color_picker_class_init (GimpColorPickerClass *klass)
gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
GtkObjectClass *object_class;
GimpToolClass *tool_class;
GimpDrawToolClass *draw_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_TOOL);
parent_class = gtk_type_class (GIMP_TYPE_DRAW_TOOL);
object_class->destroy = gimp_color_picker_destroy;
object_class->destroy = gimp_color_picker_tool_destroy;
tool_class->control = color_picker_control;
tool_class->button_press = color_picker_button_press;
tool_class->button_release = color_picker_button_release;
tool_class->motion = color_picker_motion;
tool_class->cursor_update = color_picker_cursor_update;
tool_class->control = gimp_color_picker_tool_control;
tool_class->button_press = gimp_color_picker_tool_button_press;
tool_class->button_release = gimp_color_picker_tool_button_release;
tool_class->motion = gimp_color_picker_tool_motion;
tool_class->cursor_update = gimp_color_picker_tool_cursor_update;
draw_class->draw = gimp_color_picker_tool_draw;
}
static void
gimp_color_picker_init (GimpColorPicker *color_picker)
gimp_color_picker_tool_init (GimpColorPickerTool *color_picker_tool)
{
GimpTool *tool;
tool = GIMP_TOOL (color_picker);
tool = GIMP_TOOL (color_picker_tool);
if (! color_picker_options)
if (! gimp_color_picker_tool_options)
{
color_picker_options = color_picker_options_new ();
gimp_color_picker_tool_options = gimp_color_picker_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_COLOR_PICKER,
(ToolOptions *) color_picker_options);
tool_manager_register_tool_options (GIMP_TYPE_COLOR_PICKER_TOOL,
(ToolOptions *) gimp_color_picker_tool_options);
}
color_picker->core = draw_core_new (colorpicker_draw);
tool->preserve = FALSE; /* Don't preserve on drawable change */
}
static void
gimp_color_picker_destroy (GtkObject *object)
gimp_color_picker_tool_destroy (GtkObject *object)