Commit 54cc251b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/core/Makefile.am app/core/core-types.h new interface which has

2004-07-14  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimppickable.[ch]: new interface which has
	get_image_type(), get_tiles() and get_color_at() methods.

	* app/core/gimpdrawable.[ch]
	* app/core/gimpimagemap.[ch]
	* app/core/gimpprojection.[ch]: implement GimpPickableInterface
	and removed public get_colot_at() functions.

	* app/core/gimpimage-pick-color.[ch]: removed typedef
	GimpImagePickColorFunc and gimp_image_pick_color_by_func(). Use
	gimp_pickable_pick_color() instead.

	* app/core/gimpimage-contiguous-region.c
	* app/core/gimpimage-crop.c
	* app/gui/info-window.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpsmudge.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/widgets/gimpselectioneditor.c: use GimpPickable functions
	instead of the various get_color_at() functions. Simplifies code
	which has a "sample_merged" boolean. Various cleanups.
parent 0c3377bc
2004-07-14 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimppickable.[ch]: new interface which has
get_image_type(), get_tiles() and get_color_at() methods.
* app/core/gimpdrawable.[ch]
* app/core/gimpimagemap.[ch]
* app/core/gimpprojection.[ch]: implement GimpPickableInterface
and removed public get_colot_at() functions.
* app/core/gimpimage-pick-color.[ch]: removed typedef
GimpImagePickColorFunc and gimp_image_pick_color_by_func(). Use
gimp_pickable_pick_color() instead.
* app/core/gimpimage-contiguous-region.c
* app/core/gimpimage-crop.c
* app/gui/info-window.c
* app/paint/gimpconvolve.c
* app/paint/gimpsmudge.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpimagemaptool.c
* app/widgets/gimpselectioneditor.c: use GimpPickable functions
instead of the various get_color_at() functions. Simplifies code
which has a "sample_merged" boolean. Various cleanups.
2004-07-13 Shlomi Fish <shlomif@iglu.org.il>
* plug-ins/gimpressionist/presets.c: Added underscores between
......
......@@ -180,6 +180,8 @@ libappcore_a_sources = \
gimppalette-import.h \
gimpparasitelist.c \
gimpparasitelist.h \
gimppickable.c \
gimppickable.h \
gimppreviewcache.c \
gimppreviewcache.h \
gimpprojection.c \
......
......@@ -120,6 +120,11 @@ typedef struct _GimpParasiteList GimpParasiteList;
typedef struct _GimpProjection GimpProjection;
/* interfaces */
typedef struct _GimpPickable GimpPickable; /* dummy typedef */
/* non-object types */
typedef struct _GimpArea GimpArea;
......
......@@ -44,6 +44,7 @@
#include "gimplayer-floating-sel.h"
#include "gimpmarshal.h"
#include "gimppattern.h"
#include "gimppickable.h"
#include "gimppreviewcache.h"
#include "gimp-intl.h"
......@@ -61,6 +62,7 @@ enum
static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_pickable_iface_init (GimpPickableInterface *pickable_iface);
static void gimp_drawable_finalize (GObject *object);
......@@ -112,6 +114,10 @@ static void gimp_drawable_transform (GimpItem *item,
GimpProgressFunc progress_callback,
gpointer progress_data);
static guchar * gimp_drawable_get_color_at (GimpPickable *pickable,
gint x,
gint y);
static void gimp_drawable_real_update (GimpDrawable *drawable,
gint x,
gint y,
......@@ -170,9 +176,19 @@ gimp_drawable_get_type (void)
(GInstanceInitFunc) gimp_drawable_init,
};
static const GInterfaceInfo pickable_iface_info =
{
(GInterfaceInitFunc) gimp_drawable_pickable_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
drawable_type = g_type_register_static (GIMP_TYPE_ITEM,
"GimpDrawable",
&drawable_info, 0);
g_type_add_interface_static (drawable_type, GIMP_TYPE_PICKABLE,
&pickable_iface_info);
}
return drawable_type;
......@@ -252,6 +268,14 @@ gimp_drawable_init (GimpDrawable *drawable)
drawable->preview_valid = FALSE;
}
static void
gimp_drawable_pickable_iface_init (GimpPickableInterface *pickable_iface)
{
pickable_iface->get_image_type = gimp_drawable_type;
pickable_iface->get_tiles = gimp_drawable_data;
pickable_iface->get_color_at = gimp_drawable_get_color_at;
}
static void
gimp_drawable_finalize (GObject *object)
{
......@@ -589,6 +613,44 @@ gimp_drawable_transform (GimpItem *item,
}
}
static guchar *
gimp_drawable_get_color_at (GimpPickable *pickable,
gint x,
gint y)
{
GimpDrawable *drawable = GIMP_DRAWABLE (pickable);
GimpImage *gimage;
Tile *tile;
guchar *src;
guchar *dest;
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
/* do not make this a g_return_if_fail() */
if (x < 0 || x >= GIMP_ITEM (drawable)->width ||
y < 0 || y >= GIMP_ITEM (drawable)->height)
return NULL;
dest = g_new (guchar, 5);
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, FALSE);
src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
gimp_image_get_color (gimage, gimp_drawable_type (drawable), src, dest);
if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0];
else
dest[4] = 0;
tile_release (tile, FALSE);
return dest;
}
static void
gimp_drawable_real_update (GimpDrawable *drawable,
gint x,
......@@ -1317,42 +1379,3 @@ gimp_drawable_cmap (const GimpDrawable *drawable)
return NULL;
}
guchar *
gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
gint y)
{
GimpImage *gimage;
Tile *tile;
guchar *src;
guchar *dest;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
/* do not make this a g_return_if_fail() */
if (x < 0 || x >= GIMP_ITEM (drawable)->width ||
y < 0 || y >= GIMP_ITEM (drawable)->height)
return NULL;
dest = g_new (guchar, 5);
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, FALSE);
src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
gimp_image_get_color (gimage, gimp_drawable_type (drawable), src, dest);
if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0];
else
dest[4] = 0;
tile_release (tile, FALSE);
return dest;
}
......@@ -211,9 +211,5 @@ TileManager * gimp_drawable_data (const GimpDrawable *drawable);
guchar * gimp_drawable_cmap (const GimpDrawable *drawable);
guchar * gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
gint y);
#endif /* __GIMP_DRAWABLE_H__ */
......@@ -33,7 +33,7 @@
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimpimage-contiguous-region.h"
#include "gimpprojection.h"
#include "gimppickable.h"
/* local function prototypes */
......@@ -93,6 +93,8 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage,
gint y)
{
PixelRegion srcPR, maskPR;
GimpPickable *pickable;
TileManager *tiles;
GimpChannel *mask;
GimpImageType src_type;
gboolean has_alpha;
......@@ -103,28 +105,20 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage,
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (sample_merged)
{
GimpProjection *projection = gimage->projection;
pickable = GIMP_PICKABLE (gimage->projection);
else
pickable = GIMP_PICKABLE (drawable);
pixel_region_init (&srcPR, gimp_projection_get_tiles (projection),
0, 0, gimage->width, gimage->height, FALSE);
src_type = gimp_pickable_get_image_type (pickable);
has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (src_type);
bytes = GIMP_IMAGE_TYPE_BYTES (src_type);
src_type = gimp_projection_get_image_type (projection);
has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (src_type);
bytes = gimp_projection_get_bytes (projection);
}
else
{
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
0, 0,
gimp_item_width (GIMP_ITEM (drawable)),
gimp_item_height (GIMP_ITEM (drawable)),
FALSE);
src_type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
bytes = gimp_drawable_bytes (drawable);
}
tiles = gimp_pickable_get_tiles (pickable);
pixel_region_init (&srcPR, tiles,
0, 0,
tile_manager_width (tiles),
tile_manager_height (tiles),
FALSE);
mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h);
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
......@@ -194,6 +188,8 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage,
* use the same antialiasing scheme as in fuzzy_select. Modify the gimage's
* mask to reflect the additional selection
*/
GimpPickable *pickable;
TileManager *tiles;
GimpChannel *mask;
PixelRegion imagePR, maskPR;
guchar *image_data;
......@@ -214,32 +210,22 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage,
gimp_rgba_get_uchar (color, &col[0], &col[1], &col[2], &col[3]);
/* Get the image information */
if (sample_merged)
{
bytes = gimp_projection_get_bytes (gimage->projection);
d_type = gimp_projection_get_image_type (gimage->projection);
has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (d_type);
indexed = GIMP_IMAGE_TYPE_IS_INDEXED (d_type);
width = gimage->width;
height = gimage->height;
pixel_region_init (&imagePR,
gimp_projection_get_tiles (gimage->projection),
0, 0, width, height, FALSE);
}
pickable = GIMP_PICKABLE (gimage->projection);
else
{
bytes = gimp_drawable_bytes (drawable);
d_type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
indexed = gimp_drawable_is_indexed (drawable);
width = gimp_item_width (GIMP_ITEM (drawable));
height = gimp_item_height (GIMP_ITEM (drawable));
pixel_region_init (&imagePR, gimp_drawable_data (drawable),
0, 0, width, height, FALSE);
}
pickable = GIMP_PICKABLE (drawable);
d_type = gimp_pickable_get_image_type (pickable);
bytes = GIMP_IMAGE_TYPE_BYTES (d_type);
has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (d_type);
indexed = GIMP_IMAGE_TYPE_IS_INDEXED (d_type);
tiles = gimp_pickable_get_tiles (pickable);
width = tile_manager_width (tiles);
height = tile_manager_height (tiles);
pixel_region_init (&imagePR, tiles,
0, 0, width, height, FALSE);
if (has_alpha)
{
......
......@@ -35,7 +35,7 @@
#include "gimpimage-undo-push.h"
#include "gimplayer.h"
#include "gimplist.h"
#include "gimpprojection.h"
#include "gimppickable.h"
#include "gimp-intl.h"
......@@ -48,18 +48,14 @@ typedef enum
} AutoCropType;
typedef guchar * (* GetColorFunc) (GObject *crop_object,
gint ,
gint );
typedef AutoCropType (* ColorsEqualFunc) (guchar *,
guchar *,
gint );
typedef AutoCropType (* ColorsEqualFunc) (guchar *col1,
guchar *col2,
gint bytes);
/* local function prototypes */
static AutoCropType gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
GetColorFunc get_color_func,
static AutoCropType gimp_image_crop_guess_bgcolor (GimpPickable *pickable,
gint bytes,
gboolean has_alpha,
guchar *color,
......@@ -252,14 +248,14 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
gint *shrunk_y2)
{
GimpDrawable *active_drawable = NULL;
GetColorFunc get_color_func;
GimpPickable *pickable;
ColorsEqualFunc colors_equal_func;
GObject *get_color_obj;
guchar bgcolor[MAX_CHANNELS] = { 0, 0, 0, 0 };
gboolean has_alpha;
PixelRegion PR;
guchar *buffer = NULL;
gint width, height;
GimpImageType type;
gint bytes;
gint x, y, abort;
gboolean retval = FALSE;
......@@ -285,20 +281,18 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
if (! active_drawable)
goto FINISH;
bytes = gimp_drawable_bytes (GIMP_DRAWABLE (active_drawable));
has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (active_drawable));
get_color_obj = G_OBJECT (active_drawable);
get_color_func = (GetColorFunc) gimp_drawable_get_color_at;
pickable = GIMP_PICKABLE (active_drawable);
}
else
{
has_alpha = TRUE;
bytes = gimp_projection_get_bytes (gimage->projection);
get_color_obj = G_OBJECT (gimage->projection);
get_color_func = (GetColorFunc) gimp_projection_get_color_at;
pickable = GIMP_PICKABLE (gimage->projection);
}
switch (gimp_image_crop_guess_bgcolor (get_color_obj, get_color_func,
type = gimp_pickable_get_image_type (pickable);
bytes = GIMP_IMAGE_TYPE_BYTES (type);
has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
switch (gimp_image_crop_guess_bgcolor (pickable,
bytes, has_alpha, bgcolor,
x1, x2-1, y1, y2-1))
{
......@@ -316,12 +310,8 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
width = x2 - x1;
height = y2 - y1;
if (active_drawable_only)
pixel_region_init (&PR, gimp_drawable_data (active_drawable),
x1, y1, width, height, FALSE);
else
pixel_region_init (&PR, gimp_projection_get_tiles (gimage->projection),
x1, y1, width, height, FALSE);
pixel_region_init (&PR, gimp_pickable_get_tiles (pickable),
x1, y1, width, height, FALSE);
/* The following could be optimized further by processing
* the smaller side first instead of defaulting to width --Sven
......@@ -392,8 +382,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
/* private functions */
static AutoCropType
gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
GetColorFunc get_color_func,
gimp_image_crop_guess_bgcolor (GimpPickable *pickable,
gint bytes,
gboolean has_alpha,
guchar *color,
......@@ -415,13 +404,13 @@ gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
* background-color to see if at least 2 corners are equal.
*/
if (!(tl = (*get_color_func) (get_color_obj, x1, y1)))
if (!(tl = gimp_pickable_get_color_at (pickable, x1, y1)))
goto ERROR;
if (!(tr = (*get_color_func) (get_color_obj, x1, y2)))
if (!(tr = gimp_pickable_get_color_at (pickable, x1, y2)))
goto ERROR;
if (!(bl = (*get_color_func) (get_color_obj, x2, y1)))
if (!(bl = gimp_pickable_get_color_at (pickable, x2, y1)))
goto ERROR;
if (!(br = (*get_color_func) (get_color_obj, x2, y2)))
if (!(br = gimp_pickable_get_color_at (pickable, x2, y2)))
goto ERROR;
if (has_alpha)
......@@ -474,19 +463,15 @@ gimp_image_crop_colors_equal (guchar *col1,
guchar *col2,
gint bytes)
{
gboolean equal = TRUE;
gint b;
gint b;
for (b = 0; b < bytes; b++)
{
if (col1[b] != col2[b])
{
equal = FALSE;
break;
}
return FALSE;
}
return equal;
return TRUE;
}
static gboolean
......@@ -494,8 +479,5 @@ gimp_image_crop_colors_alpha (guchar *dummy,
guchar *col,
gint bytes)
{
if (col[bytes-1] == 0)
return TRUE;
else
return FALSE;
return (col[bytes - 1] == 0);
}
......@@ -20,14 +20,12 @@
#include <glib-object.h>
#include "libgimpcolor/gimpcolor.h"
#include "core-types.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-pick-color.h"
#include "core/gimpprojection.h"
#include "core/gimppickable.h"
gboolean
......@@ -42,24 +40,17 @@ gimp_image_pick_color (GimpImage *gimage,
GimpRGB *color,
gint *color_index)
{
GimpImageType my_sample_type;
gboolean is_indexed;
GimpImagePickColorFunc color_func;
GimpObject *color_obj;
GimpPickable *pickable;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (sample_merged || GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (! drawable ||
g_return_val_if_fail (drawable == NULL ||
gimp_item_get_image (GIMP_ITEM (drawable)) == gimage,
FALSE);
if (sample_merged)
{
my_sample_type = gimp_projection_get_image_type (gimage->projection);
is_indexed = FALSE;
color_func = (GimpImagePickColorFunc) gimp_projection_get_color_at;
color_obj = GIMP_OBJECT (gimage->projection);
pickable = GIMP_PICKABLE (gimage->projection);
}
else
{
......@@ -69,75 +60,13 @@ gimp_image_pick_color (GimpImage *gimage,
x -= off_x;
y -= off_y;
my_sample_type = gimp_drawable_type (drawable);
is_indexed = gimp_drawable_is_indexed (drawable);
color_func = (GimpImagePickColorFunc) gimp_drawable_get_color_at;
color_obj = GIMP_OBJECT (drawable);
pickable = GIMP_PICKABLE (drawable);
}
if (sample_type)
*sample_type = my_sample_type;
return gimp_image_pick_color_by_func (color_obj, x, y, color_func,
sample_average, average_radius,
color, color_index);
}
gboolean
gimp_image_pick_color_by_func (GimpObject *object,
gint x,
gint y,
GimpImagePickColorFunc pick_color_func,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color,
gint *color_index)
{
guchar *col;
if (! (col = pick_color_func (object, x, y)))
return FALSE;
if (sample_average)
{
gint i, j;
gint count = 0;
gint color_avg[4] = { 0, 0, 0, 0 };
guchar *tmp_col;
gint radius = (gint) average_radius;
for (i = x - radius; i <= x + radius; i++)
for (j = y - radius; j <= y + radius; j++)
if ((tmp_col = pick_color_func (object, i, j)))
{
count++;
color_avg[RED_PIX] += tmp_col[RED_PIX];
color_avg[GREEN_PIX] += tmp_col[GREEN_PIX];
color_avg[BLUE_PIX] += tmp_col[BLUE_PIX];
color_avg[ALPHA_PIX] += tmp_col[ALPHA_PIX];
g_free (tmp_col);
}
col[RED_PIX] = (guchar) (color_avg[RED_PIX] / count);
col[GREEN_PIX] = (guchar) (color_avg[GREEN_PIX] / count);
col[BLUE_PIX] = (guchar) (color_avg[BLUE_PIX] / count);
col[ALPHA_PIX] = (guchar) (color_avg[ALPHA_PIX] / count);
}
if (color)
gimp_rgba_set_uchar (color,
col[RED_PIX],
col[GREEN_PIX],
col[BLUE_PIX],
col[ALPHA_PIX]);
if (color_index)
*color_index = sample_average ? -1 : col[4];
g_free (col);
*sample_type = gimp_pickable_get_image_type (pickable);
return TRUE;
return gimp_pickable_pick_color (pickable, x, y,
sample_average, average_radius,
color, color_index);
}
......@@ -20,30 +20,16 @@
#define __GIMP_IMAGE_PICK_COLOR_H__
typedef guchar * (* GimpImagePickColorFunc) (GimpObject *object,
gint x,
gint y);
gboolean gimp_image_pick_color (GimpImage *gimage,
GimpDrawable *drawable,
gint x,
gint y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpImageType *sample_type,
GimpRGB *color,
gint *color_index);
gboolean gimp_image_pick_color_by_func (GimpObject *object,
gint x,
gint y,
GimpImagePickColorFunc pick_color_func,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color,
gint *color_index);
gboolean gimp_image_pick_color (GimpImage *gimage,
GimpDrawable *drawable,
gint x,
gint y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpImageType *sample_type,
GimpRGB *color,
gint *color_index);
#endif /* __GIMP_IMAGE_PICK_COLOR_H__ */
......@@ -32,6 +32,7 @@
#include "gimpimage.h"
#include "gimpimagemap.h"
#include "gimpmarshal.h"
#include "gimppickable.h"
enum
......@@ -50,8 +51,8 @@ struct _GimpImageMap
gchar *undo_desc;
TileManager *undo_tiles;
gint undo_offset_x;
gint undo_offset_y;
gint undo_offset_x;
gint undo_offset_y;
GimpImageMapApplyFunc apply_func;
gpointer user_data;
PixelRegion srcPR;
......@@ -61,12 +62,19 @@ struct _GimpImageMap
};
static void gimp_image_map_class_init (GimpImageMapClass *klass);
static void gimp_image_map_init (GimpImageMap *image_map);
static void gimp_image_map_class_init (GimpImageMapClass *klass);
static void gimp_image_map_init (GimpImageMap *image_map);
static void gimp_image_map_pickable_iface_init (GimpPickableInterface *pickable_iface);
static void gimp_image_map_finalize (GObject *object);
static void gimp_image_map_finalize (GObject *object);
static gboolean gimp_image_map_do (GimpImageMap *image_map);
static GimpImageType gimp_image_map_get_image_type (GimpPickable *pickable);
static TileManager * gimp_image_map_get_tiles (GimpPickable *pickable);
static guchar * gimp_image_map_get_color_at (GimpPickable *pickable,
gint x,
gint y);
static gboolean gimp_image_map_do (GimpImageMap *image_map);
static guint image_map_signals[LAST_SIGNAL] = { 0 };
......@@ -84,19 +92,29 @@ gimp_image_map_get_type (void)
static const GTypeInfo image_map_info =
{
sizeof (GimpImageMapClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_image_map_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpImageMap),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_image_map_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_image_map_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpImageMap),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_image_map_init,
};
static const GInterfaceInfo pickable_iface_info =
{
(GInterfaceInitFunc) gimp_image_map_pickable_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
image_map_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpImageMap",
&image_map_info, 0);
g_type_add_interface_static (image_map_type, GIMP_TYPE_PICKABLE,
&pickable_iface_info);
}
return image_map_type;
......@@ -105,20 +123,18 @@ gimp_image_map_get_type (void)
static void
gimp_image_map_class_init (GimpImageMapClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
image_map_signals[FLUSH] =
g_signal_new ("flush",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageMapClass, flush),
NULL, NULL,