removed the "name" parameter and use GimpObject's name instead.

2001-01-10  Michael Natterer  <mitch@gimp.org>

	* app/gimpdrawable.[ch]: removed the "name" parameter and use
	GimpObject's name instead.

	* app/channel.c
	* app/channel_ops.c
	* app/channels_dialog.c
	* app/drawable.h
	* app/gimpimage.c
	* app/interface.c
	* app/layer.c
	* app/layer_select.c
	* app/layers_dialog.c
	* app/qmask.c
	* app/undo.c
	* app/xcf.c: changed accordingly, cleanup.
This commit is contained in:
Michael Natterer 2001-01-10 03:13:03 +00:00 committed by Michael Natterer
parent 6554397178
commit 6642bc2c94
47 changed files with 736 additions and 686 deletions

View file

@ -1,3 +1,21 @@
2001-01-10 Michael Natterer <mitch@gimp.org>
* app/gimpdrawable.[ch]: removed the "name" parameter and use
GimpObject's name instead.
* app/channel.c
* app/channel_ops.c
* app/channels_dialog.c
* app/drawable.h
* app/gimpimage.c
* app/interface.c
* app/layer.c
* app/layer_select.c
* app/layers_dialog.c
* app/qmask.c
* app/undo.c
* app/xcf.c: changed accordingly, cleanup.
2001-01-10 Michael Natterer <mitch@gimp.org>
* app/gimpbrushlist.c

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -187,7 +187,8 @@ channel_copy (const Channel *channel)
gint len;
/* formulate the new channel name */
name = drawable_get_name (GIMP_DRAWABLE (channel));
name = gimp_object_get_name (GIMP_OBJECT (channel));
ext = strrchr (name, '#');
len = strlen (_("copy"));
if ((strlen (name) >= len &&
@ -231,13 +232,13 @@ void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (channel), name);
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (channel));
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void

View file

@ -612,8 +612,8 @@ duplicate (GimpImage *gimage)
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
{
gimp_drawable_set_name(GIMP_DRAWABLE(new_layer->mask),
gimp_drawable_get_name(GIMP_DRAWABLE(layer->mask)));
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
@ -643,8 +643,8 @@ duplicate (GimpImage *gimage)
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_drawable_set_name(GIMP_DRAWABLE(new_channel),
gimp_drawable_get_name(GIMP_DRAWABLE(channel)));
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
active_channel = (new_channel);

View file

@ -1462,7 +1462,7 @@ channel_widget_create (GimpImage *gimage,
case AUXILLARY_CHANNEL:
channel_widget->label =
gtk_label_new (drawable_get_name (GIMP_DRAWABLE (channel)));
gtk_label_new (gimp_object_get_name (GIMP_OBJECT (channel)));
break;
}
@ -2650,10 +2650,10 @@ edit_channel_query_ok_callback (GtkWidget *widget,
if (options->gimage)
{
/* Set the new channel name */
drawable_set_name (GIMP_DRAWABLE (channel),
gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gimp_object_set_name (GIMP_OBJECT (channel),
gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gtk_label_set_text (GTK_LABEL (options->channel_widget->label),
drawable_get_name (GIMP_DRAWABLE (channel)));
gimp_object_get_name (GIMP_OBJECT (channel)));
if (channel->opacity != opacity)
{
@ -2755,7 +2755,7 @@ channels_dialog_edit_channel_query (ChannelWidget *channel_widget)
1, 2, 0, 1);
gtk_entry_set_text
(GTK_ENTRY (options->name_entry),
drawable_get_name (GIMP_DRAWABLE (channel_widget->channel)));
gimp_object_get_name (GIMP_OBJECT (channel_widget->channel)));
gtk_widget_show (options->name_entry);
/* The opacity scale */

View file

@ -187,7 +187,8 @@ channel_copy (const Channel *channel)
gint len;
/* formulate the new channel name */
name = drawable_get_name (GIMP_DRAWABLE (channel));
name = gimp_object_get_name (GIMP_OBJECT (channel));
ext = strrchr (name, '#');
len = strlen (_("copy"));
if ((strlen (name) >= len &&
@ -231,13 +232,13 @@ void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (channel), name);
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (channel));
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void

View file

@ -187,7 +187,8 @@ channel_copy (const Channel *channel)
gint len;
/* formulate the new channel name */
name = drawable_get_name (GIMP_DRAWABLE (channel));
name = gimp_object_get_name (GIMP_OBJECT (channel));
ext = strrchr (name, '#');
len = strlen (_("copy"));
if ((strlen (name) >= len &&
@ -231,13 +232,13 @@ void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (channel), name);
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (channel));
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void

View file

@ -612,8 +612,8 @@ duplicate (GimpImage *gimage)
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
{
gimp_drawable_set_name(GIMP_DRAWABLE(new_layer->mask),
gimp_drawable_get_name(GIMP_DRAWABLE(layer->mask)));
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
@ -643,8 +643,8 @@ duplicate (GimpImage *gimage)
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_drawable_set_name(GIMP_DRAWABLE(new_channel),
gimp_drawable_get_name(GIMP_DRAWABLE(channel)));
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
active_channel = (new_channel);

View file

@ -52,9 +52,10 @@ enum
LAST_SIGNAL
};
static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static void gimp_drawable_name_changed (GimpObject *drawable);
static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 };
@ -90,9 +91,11 @@ gimp_drawable_get_type (void)
static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
GtkObjectClass *object_class;
GtkObjectClass *object_class;
GimpObjectClass *gimp_object_class;
object_class = (GtkObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
gimp_object_class = (GimpObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
@ -110,9 +113,105 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
object_class->destroy = gimp_drawable_destroy;
gimp_object_class->name_changed = gimp_drawable_name_changed;
klass->invalidate_preview = NULL;
}
static void
gimp_drawable_name_changed (GimpObject *object)
{
GimpDrawable *drawable;
GimpDrawable *drawable2;
GSList *list, *list2, *base_list;
gint unique_ext = 0;
gchar *ext;
gchar *new_name = NULL;
g_return_if_fail (GIMP_IS_DRAWABLE (object));
drawable = GIMP_DRAWABLE (object);
/* if no other layers to check name against */
if (drawable->gimage == NULL || drawable->gimage->layers == NULL)
return;
if (GIMP_IS_LAYER (drawable))
base_list = drawable->gimage->layers;
else if (GIMP_IS_CHANNEL (drawable))
base_list = drawable->gimage->channels;
else
base_list = NULL;
for (list = base_list; list; list = g_slist_next (list))
{
drawable2 = GIMP_DRAWABLE (list->data);
if (drawable != drawable2 &&
strcmp (gimp_object_get_name (GIMP_OBJECT (drawable)),
gimp_object_get_name (GIMP_OBJECT (drawable2))) == 0)
{
ext = strrchr (GIMP_OBJECT (drawable)->name, '#');
if (ext)
{
gchar *ext_str;
unique_ext = atoi (ext + 1);
ext_str = g_strdup_printf ("%d", unique_ext);
/* check if the extension really is of the form "#<n>" */
if (! strcmp (ext_str, ext + 1))
{
*ext = '\0';
}
else
{
unique_ext = 0;
}
g_free (ext_str);
}
else
{
unique_ext = 0;
}
do
{
unique_ext++;
g_free (new_name);
new_name = g_strdup_printf ("%s#%d",
GIMP_OBJECT (drawable)->name,
unique_ext);
for (list2 = base_list; list2; list2 = g_slist_next (list2))
{
drawable2 = GIMP_DRAWABLE (list2->data);
if (drawable == drawable2)
continue;
if (! strcmp (GIMP_OBJECT (drawable2)->name, new_name))
{
break;
}
}
}
while (list2);
g_free (GIMP_OBJECT (drawable)->name);
GIMP_OBJECT (drawable)->name = new_name;
break;
}
}
}
/*
* Static variables
@ -358,100 +457,6 @@ gimp_drawable_visible (const GimpDrawable *drawable)
return drawable->visible;
}
const gchar *
gimp_drawable_get_name (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
}
void
gimp_drawable_set_name (GimpDrawable *drawable,
const gchar *name)
{
GSList *list, *listb, *base_list;
GimpDrawable *drawableb;
gint number = 1;
gchar *newname;
gchar *ext;
gchar numberbuf[20];
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (name != NULL);
if (drawable->name)
{
g_free (drawable->name);
drawable->name = NULL;
}
if (drawable->gimage == NULL || drawable->gimage->layers == NULL)
{
/* no other layers to check name against */
drawable->name = g_strdup (name);
return;
}
if (GIMP_IS_LAYER (drawable))
base_list = drawable->gimage->layers;
else if (GIMP_IS_CHANNEL (drawable))
base_list = drawable->gimage->channels;
else
base_list = NULL;
for (list = base_list; list; list = g_slist_next (list))
{
drawableb = GIMP_DRAWABLE (list->data);
if (drawable != drawableb &&
strcmp (name, gimp_drawable_get_name (drawableb)) == 0)
{ /* names conflict */
newname = g_malloc (strlen (name) + 10); /* if this aint enough
yer screwed */
strcpy (newname, name);
if ((ext = strrchr (newname, '#')))
{
number = atoi(ext+1);
/* Check if there really was the number we think after the # */
g_snprintf (numberbuf, sizeof (numberbuf), "#%d", number);
if (strcmp (ext, numberbuf) != 0)
{
/* No, so just ignore the # */
number = 1;
ext = &newname[strlen (newname)];
}
}
else
{
number = 1;
ext = &newname[strlen (newname)];
}
sprintf (ext, "#%d", number + 1);
listb = base_list;
while (listb) /* make sure the new name is unique */
{
drawableb = GIMP_DRAWABLE (listb->data);
if (drawable != drawableb &&
strcmp (newname, gimp_drawable_get_name (drawableb)) == 0)
{
number++;
sprintf (ext, "#%d", number+1);
/* Rescan from beginning */
listb = base_list;
continue;
}
listb = listb->next;
}
drawable->name = g_strdup (newname);
g_free (newname);
return;
}
}
drawable->name = g_strdup (name);
}
guchar *
gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
@ -727,7 +732,6 @@ gimp_drawable_deallocate (GimpDrawable *drawable)
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->name = NULL;
drawable->tiles = NULL;
drawable->visible = FALSE;
drawable->width = 0;
@ -764,9 +768,6 @@ gimp_drawable_destroy (GtkObject *object)
drawable = GIMP_DRAWABLE (object);
g_hash_table_remove (gimp_drawable_table, (gpointer) drawable->ID);
if (drawable->name)
g_free (drawable->name);
if (drawable->tiles)
tile_manager_destroy (drawable->tiles);
@ -816,7 +817,6 @@ gimp_drawable_configure (GimpDrawable *drawable,
return;
}
drawable->name = NULL;
drawable->width = width;
drawable->height = height;
drawable->bytes = bpp;
@ -834,7 +834,7 @@ gimp_drawable_configure (GimpDrawable *drawable,
if (gimage)
gimp_drawable_set_gimage (drawable, gimage);
gimp_drawable_set_name (drawable, name);
gimp_object_set_name (GIMP_OBJECT (drawable), name);
/* preview variables */
drawable->preview_cache = NULL;

View file

@ -36,7 +36,6 @@ struct _GimpDrawable
{
GimpObject data;
gchar *name; /* name of drawable */
TileManager *tiles; /* tiles for drawable data */
gboolean visible; /* controls visibility */
gint width, height; /* size of drawable */
@ -96,13 +95,11 @@ gint gimp_drawable_bytes (GimpDrawable *);
gint gimp_drawable_width (GimpDrawable *);
gint gimp_drawable_height (GimpDrawable *);
gboolean gimp_drawable_visible (const GimpDrawable *drawable);
void gimp_drawable_offsets (GimpDrawable *,
gint *, gint *);
void gimp_drawable_offsets (GimpDrawable *drawable,
gint *offset_x,
gint *offset_y);
guchar * gimp_drawable_cmap (const GimpDrawable *drawable);
const gchar * gimp_drawable_get_name (const GimpDrawable *drawable);
void gimp_drawable_set_name (GimpDrawable *drawable,
const gchar *name);
guchar * gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
@ -133,4 +130,5 @@ void gimp_drawable_configure (GimpDrawable *drawable,
GimpImageType type,
const gchar *name);
#endif /* __GIMP_DRAWABLE_H__ */

View file

@ -612,8 +612,8 @@ duplicate (GimpImage *gimage)
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
{
gimp_drawable_set_name(GIMP_DRAWABLE(new_layer->mask),
gimp_drawable_get_name(GIMP_DRAWABLE(layer->mask)));
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
@ -643,8 +643,8 @@ duplicate (GimpImage *gimage)
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_drawable_set_name(GIMP_DRAWABLE(new_channel),
gimp_drawable_get_name(GIMP_DRAWABLE(channel)));
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
active_channel = (new_channel);

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -183,7 +183,7 @@ layer_size (Layer *layer)
sizeof (Layer) +
GIMP_DRAWABLE (layer)->width * GIMP_DRAWABLE (layer)->height *
GIMP_DRAWABLE (layer)->bytes +
strlen (GIMP_DRAWABLE (layer)->name);
strlen (GIMP_OBJECT (layer)->name);
if (layer_get_mask (layer))
size += channel_size (GIMP_CHANNEL (layer_get_mask (layer)));
@ -200,7 +200,7 @@ channel_size (Channel *channel)
size =
sizeof (Channel) +
GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
strlen (GIMP_DRAWABLE (channel)->name);
strlen (GIMP_OBJECT (channel)->name);
return size;
}

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -327,7 +327,8 @@ layer_copy (Layer *layer,
PixelRegion destPR;
/* formulate the new layer name */
name = layer_get_name (layer);
name = gimp_object_get_name (GIMP_OBJECT (layer));
ext = strrchr (name, '#');
len = strlen (_("copy"));
@ -529,7 +530,8 @@ layer_create_mask (Layer *layer,
guchar white_mask = OPAQUE_OPACITY;
guchar black_mask = TRANSPARENT_OPACITY;
mask_name = g_strdup_printf (_("%s mask"), GIMP_DRAWABLE (layer)->name);
mask_name = g_strdup_printf (_("%s mask"),
gimp_object_get_name (GIMP_OBJECT (layer)));
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE (layer)->gimage,
@ -1289,13 +1291,13 @@ void
layer_set_name (Layer *layer,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (layer), name);
gimp_object_set_name (GIMP_OBJECT (layer), name);
}
const gchar *
layer_get_name (const Layer *layer)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (layer));
return gimp_object_get_name (GIMP_OBJECT (layer));
}
guchar *
@ -1804,8 +1806,9 @@ layer_mask_copy (LayerMask *layer_mask)
PixelRegion srcPR, destPR;
/* formulate the new layer_mask name */
layer_mask_name = g_strdup_printf (_("%s copy"),
GIMP_DRAWABLE(layer_mask)->name);
layer_mask_name =
g_strdup_printf (_("%s copy"),
gimp_object_get_name (GIMP_OBJECT (layer_mask)));
/* allocate a new layer_mask object */
new_layer_mask = layer_mask_new (GIMP_DRAWABLE(layer_mask)->gimage,

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -1262,7 +1262,7 @@ toolbox_drag_drop (GtkWidget *widget,
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer),
gimp_drawable_get_name (drawable));
gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer)
{
@ -1274,8 +1274,8 @@ toolbox_drag_drop (GtkWidget *widget,
if (new_mask)
{
gimp_drawable_set_name (GIMP_DRAWABLE (new_mask),
gimp_drawable_get_name (GIMP_DRAWABLE (mask)));
gimp_object_set_name (GIMP_OBJECT (new_mask),
gimp_object_get_name (GIMP_OBJECT (mask)));
}
}

View file

@ -324,7 +324,7 @@ layer_select_set_layer (LayerSelect *layer_select)
/* Set the layer label */
gtk_label_set_text (GTK_LABEL (layer_select->label),
drawable_get_name (GIMP_DRAWABLE (layer)));
gimp_object_get_name (GIMP_OBJECT (layer)));
}
static gint

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -1262,7 +1262,7 @@ toolbox_drag_drop (GtkWidget *widget,
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer),
gimp_drawable_get_name (drawable));
gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer)
{
@ -1274,8 +1274,8 @@ toolbox_drag_drop (GtkWidget *widget,
if (new_mask)
{
gimp_drawable_set_name (GIMP_DRAWABLE (new_mask),
gimp_drawable_get_name (GIMP_DRAWABLE (mask)));
gimp_object_set_name (GIMP_OBJECT (new_mask),
gimp_object_get_name (GIMP_OBJECT (mask)));
}
}

View file

@ -23,12 +23,21 @@
#include "gimpdrawable.h"
gint drawable_ID (GimpDrawable *);
void drawable_fill (GimpDrawable *drawable, GimpFillType fill_type);
gint drawable_ID (GimpDrawable *drawable);
void drawable_fill (GimpDrawable *drawable,
GimpFillType fill_type);
void drawable_update (GimpDrawable *drawable,
gint x, gint y, gint w, gint h);
void drawable_apply_image (GimpDrawable *, gint, gint, gint, gint,
TileManager *, gint);
gint x,
gint y,
gint w,
gint h);
void drawable_apply_image (GimpDrawable *drawable,
gint x1,
gint y1,
gint x2,
gint y2,
TileManager *,
gint );
#define drawable_merge_shadow gimp_drawable_merge_shadow
@ -48,8 +57,6 @@ void drawable_apply_image (GimpDrawable *, gint, gint, gint, gint,
#define drawable_visible gimp_drawable_visible
#define drawable_offsets gimp_drawable_offsets
#define drawable_cmap gimp_drawable_cmap
#define drawable_get_name gimp_drawable_get_name
#define drawable_set_name gimp_drawable_set_name
#define drawable_get_ID gimp_drawable_get_ID
#define drawable_deallocate gimp_drawable_deallocate

View file

@ -187,7 +187,8 @@ channel_copy (const Channel *channel)
gint len;
/* formulate the new channel name */
name = drawable_get_name (GIMP_DRAWABLE (channel));
name = gimp_object_get_name (GIMP_OBJECT (channel));
ext = strrchr (name, '#');
len = strlen (_("copy"));
if ((strlen (name) >= len &&
@ -231,13 +232,13 @@ void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (channel), name);
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (channel));
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void

View file

@ -612,8 +612,8 @@ duplicate (GimpImage *gimage)
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
{
gimp_drawable_set_name(GIMP_DRAWABLE(new_layer->mask),
gimp_drawable_get_name(GIMP_DRAWABLE(layer->mask)));
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
@ -643,8 +643,8 @@ duplicate (GimpImage *gimage)
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_drawable_set_name(GIMP_DRAWABLE(new_channel),
gimp_drawable_get_name(GIMP_DRAWABLE(channel)));
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
active_channel = (new_channel);

View file

@ -52,9 +52,10 @@ enum
LAST_SIGNAL
};
static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static void gimp_drawable_class_init (GimpDrawableClass *klass);
static void gimp_drawable_init (GimpDrawable *drawable);
static void gimp_drawable_destroy (GtkObject *object);
static void gimp_drawable_name_changed (GimpObject *drawable);
static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 };
@ -90,9 +91,11 @@ gimp_drawable_get_type (void)
static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
GtkObjectClass *object_class;
GtkObjectClass *object_class;
GimpObjectClass *gimp_object_class;
object_class = (GtkObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
gimp_object_class = (GimpObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
@ -110,9 +113,105 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
object_class->destroy = gimp_drawable_destroy;
gimp_object_class->name_changed = gimp_drawable_name_changed;
klass->invalidate_preview = NULL;
}
static void
gimp_drawable_name_changed (GimpObject *object)
{
GimpDrawable *drawable;
GimpDrawable *drawable2;
GSList *list, *list2, *base_list;
gint unique_ext = 0;
gchar *ext;
gchar *new_name = NULL;
g_return_if_fail (GIMP_IS_DRAWABLE (object));
drawable = GIMP_DRAWABLE (object);
/* if no other layers to check name against */
if (drawable->gimage == NULL || drawable->gimage->layers == NULL)
return;
if (GIMP_IS_LAYER (drawable))
base_list = drawable->gimage->layers;
else if (GIMP_IS_CHANNEL (drawable))
base_list = drawable->gimage->channels;
else
base_list = NULL;
for (list = base_list; list; list = g_slist_next (list))
{
drawable2 = GIMP_DRAWABLE (list->data);
if (drawable != drawable2 &&
strcmp (gimp_object_get_name (GIMP_OBJECT (drawable)),
gimp_object_get_name (GIMP_OBJECT (drawable2))) == 0)
{
ext = strrchr (GIMP_OBJECT (drawable)->name, '#');
if (ext)
{
gchar *ext_str;
unique_ext = atoi (ext + 1);
ext_str = g_strdup_printf ("%d", unique_ext);
/* check if the extension really is of the form "#<n>" */
if (! strcmp (ext_str, ext + 1))
{
*ext = '\0';
}
else
{
unique_ext = 0;
}
g_free (ext_str);
}
else
{
unique_ext = 0;
}
do
{
unique_ext++;
g_free (new_name);
new_name = g_strdup_printf ("%s#%d",
GIMP_OBJECT (drawable)->name,
unique_ext);
for (list2 = base_list; list2; list2 = g_slist_next (list2))
{
drawable2 = GIMP_DRAWABLE (list2->data);
if (drawable == drawable2)
continue;
if (! strcmp (GIMP_OBJECT (drawable2)->name, new_name))
{
break;
}
}
}
while (list2);
g_free (GIMP_OBJECT (drawable)->name);
GIMP_OBJECT (drawable)->name = new_name;
break;
}
}
}
/*
* Static variables
@ -358,100 +457,6 @@ gimp_drawable_visible (const GimpDrawable *drawable)
return drawable->visible;
}
const gchar *
gimp_drawable_get_name (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
}
void
gimp_drawable_set_name (GimpDrawable *drawable,
const gchar *name)
{
GSList *list, *listb, *base_list;
GimpDrawable *drawableb;
gint number = 1;
gchar *newname;
gchar *ext;
gchar numberbuf[20];
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (name != NULL);
if (drawable->name)
{
g_free (drawable->name);
drawable->name = NULL;
}
if (drawable->gimage == NULL || drawable->gimage->layers == NULL)
{
/* no other layers to check name against */
drawable->name = g_strdup (name);
return;
}
if (GIMP_IS_LAYER (drawable))
base_list = drawable->gimage->layers;
else if (GIMP_IS_CHANNEL (drawable))
base_list = drawable->gimage->channels;
else
base_list = NULL;
for (list = base_list; list; list = g_slist_next (list))
{
drawableb = GIMP_DRAWABLE (list->data);
if (drawable != drawableb &&
strcmp (name, gimp_drawable_get_name (drawableb)) == 0)
{ /* names conflict */
newname = g_malloc (strlen (name) + 10); /* if this aint enough
yer screwed */
strcpy (newname, name);
if ((ext = strrchr (newname, '#')))
{
number = atoi(ext+1);
/* Check if there really was the number we think after the # */
g_snprintf (numberbuf, sizeof (numberbuf), "#%d", number);
if (strcmp (ext, numberbuf) != 0)
{
/* No, so just ignore the # */
number = 1;
ext = &newname[strlen (newname)];
}
}
else
{
number = 1;
ext = &newname[strlen (newname)];
}
sprintf (ext, "#%d", number + 1);
listb = base_list;
while (listb) /* make sure the new name is unique */
{
drawableb = GIMP_DRAWABLE (listb->data);
if (drawable != drawableb &&
strcmp (newname, gimp_drawable_get_name (drawableb)) == 0)
{
number++;
sprintf (ext, "#%d", number+1);
/* Rescan from beginning */
listb = base_list;
continue;
}
listb = listb->next;
}
drawable->name = g_strdup (newname);
g_free (newname);
return;
}
}
drawable->name = g_strdup (name);
}
guchar *
gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
@ -727,7 +732,6 @@ gimp_drawable_deallocate (GimpDrawable *drawable)
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->name = NULL;
drawable->tiles = NULL;
drawable->visible = FALSE;
drawable->width = 0;
@ -764,9 +768,6 @@ gimp_drawable_destroy (GtkObject *object)
drawable = GIMP_DRAWABLE (object);
g_hash_table_remove (gimp_drawable_table, (gpointer) drawable->ID);
if (drawable->name)
g_free (drawable->name);
if (drawable->tiles)
tile_manager_destroy (drawable->tiles);
@ -816,7 +817,6 @@ gimp_drawable_configure (GimpDrawable *drawable,
return;
}
drawable->name = NULL;
drawable->width = width;
drawable->height = height;
drawable->bytes = bpp;
@ -834,7 +834,7 @@ gimp_drawable_configure (GimpDrawable *drawable,
if (gimage)
gimp_drawable_set_gimage (drawable, gimage);
gimp_drawable_set_name (drawable, name);
gimp_object_set_name (GIMP_OBJECT (drawable), name);
/* preview variables */
drawable->preview_cache = NULL;

View file

@ -36,7 +36,6 @@ struct _GimpDrawable
{
GimpObject data;
gchar *name; /* name of drawable */
TileManager *tiles; /* tiles for drawable data */
gboolean visible; /* controls visibility */
gint width, height; /* size of drawable */
@ -96,13 +95,11 @@ gint gimp_drawable_bytes (GimpDrawable *);
gint gimp_drawable_width (GimpDrawable *);
gint gimp_drawable_height (GimpDrawable *);
gboolean gimp_drawable_visible (const GimpDrawable *drawable);
void gimp_drawable_offsets (GimpDrawable *,
gint *, gint *);
void gimp_drawable_offsets (GimpDrawable *drawable,
gint *offset_x,
gint *offset_y);
guchar * gimp_drawable_cmap (const GimpDrawable *drawable);
const gchar * gimp_drawable_get_name (const GimpDrawable *drawable);
void gimp_drawable_set_name (GimpDrawable *drawable,
const gchar *name);
guchar * gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
@ -133,4 +130,5 @@ void gimp_drawable_configure (GimpDrawable *drawable,
GimpImageType type,
const gchar *name);
#endif /* __GIMP_DRAWABLE_H__ */

View file

@ -612,8 +612,8 @@ duplicate (GimpImage *gimage)
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
{
gimp_drawable_set_name(GIMP_DRAWABLE(new_layer->mask),
gimp_drawable_get_name(GIMP_DRAWABLE(layer->mask)));
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
@ -643,8 +643,8 @@ duplicate (GimpImage *gimage)
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_drawable_set_name(GIMP_DRAWABLE(new_channel),
gimp_drawable_get_name(GIMP_DRAWABLE(channel)));
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
active_channel = (new_channel);

View file

@ -839,7 +839,7 @@ gimp_image_apply_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations[drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -847,13 +847,13 @@ gimp_image_apply_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -861,10 +861,10 @@ gimp_image_apply_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -878,9 +878,9 @@ gimp_image_apply_image (GimpImage *gimage,
pixel_region_init (&src1PR, src1_tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
else
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -898,7 +898,7 @@ gimp_image_apply_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -946,7 +946,7 @@ gimp_image_replace_image (GimpImage *gimage,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = valid_combinations [drawable_type (drawable)][src2PR->bytes];
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
@ -954,13 +954,13 @@ gimp_image_replace_image (GimpImage *gimage,
}
/* get the layer offsets */
drawable_offsets (drawable, &offset_x, &offset_y);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
/* make sure the image application coordinates are within gimage bounds */
x1 = CLAMP (x, 0, drawable_width (drawable));
y1 = CLAMP (y, 0, drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, drawable_height (drawable));
x1 = CLAMP (x, 0, gimp_drawable_width (drawable));
y1 = CLAMP (y, 0, gimp_drawable_height (drawable));
x2 = CLAMP (x + src2PR->w, 0, gimp_drawable_width (drawable));
y2 = CLAMP (y + src2PR->h, 0, gimp_drawable_height (drawable));
if (mask)
{
@ -968,10 +968,10 @@ gimp_image_replace_image (GimpImage *gimage,
* we need to add the layer offset to transform coords
* into the mask coordinate system
*/
x1 = CLAMP (x1, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x1 = CLAMP (x1, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y1 = CLAMP (y1, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
x2 = CLAMP (x2, -offset_x, gimp_drawable_width (GIMP_DRAWABLE (mask))-offset_x);
y2 = CLAMP (y2, -offset_y, gimp_drawable_height(GIMP_DRAWABLE (mask))-offset_y);
}
/* If the calling procedure specified an undo step... */
@ -981,9 +981,9 @@ gimp_image_replace_image (GimpImage *gimage,
/* configure the pixel regions
* If an alternative to using the drawable's data as src1 was provided...
*/
pixel_region_init (&src1PR, drawable_data (drawable),
pixel_region_init (&src1PR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, drawable_data (drawable),
pixel_region_init (&destPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR,
src2PR->x + (x1 - x), src2PR->y + (y1 - y),
@ -1001,7 +1001,7 @@ gimp_image_replace_image (GimpImage *gimage,
my = y1 + offset_y;
pixel_region_init (&mask2PR,
drawable_data (GIMP_DRAWABLE(mask)),
gimp_drawable_data (GIMP_DRAWABLE (mask)),
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
@ -1652,19 +1652,19 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (!layer_is_floating_sel (layer) &&
drawable_visible (GIMP_DRAWABLE (layer)))
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
}
while (reverse_list)
{
layer = (Layer *) reverse_list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x1 = CLAMP (off_x, x, x + w);
y1 = CLAMP (off_y, y, y + h);
x2 = CLAMP (off_x + drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
x2 = CLAMP (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)), x, x + w);
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
@ -1675,7 +1675,7 @@ gimp_image_construct_layers (GimpImage *gimage,
if (layer->mask && layer->show_mask)
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
@ -1685,14 +1685,14 @@ gimp_image_construct_layers (GimpImage *gimage,
else
{
pixel_region_init (&src2PR,
drawable_data (GIMP_DRAWABLE (layer)),
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->apply_mask)
{
pixel_region_init (&maskPR,
drawable_data (GIMP_DRAWABLE (layer->mask)),
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
mask = &maskPR;
@ -1703,7 +1703,7 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Based on the type of the layer, project the layer onto the
* projection image...
*/
switch (drawable_type (GIMP_DRAWABLE (layer)))
switch (gimp_drawable_type (GIMP_DRAWABLE (layer)))
{
case RGB_GIMAGE: case GRAY_GIMAGE:
/* no mask possible */
@ -1756,13 +1756,15 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (Channel *) reverse_list->data;
if (drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR, drawable_data (GIMP_DRAWABLE (channel)),
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
@ -1800,14 +1802,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
gint off_x, off_y;
layer = (Layer *) list->data;
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
! layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
(off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)) >= x + w) &&
(off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)) >= y + h))
{
coverage = 1;
break;
@ -1848,7 +1850,7 @@ gimp_image_get_active_channels (GimpImage *gimage,
{
layer = GIMP_LAYER (drawable);
if (layer_has_alpha (layer) && layer->preserve_trans)
active[drawable_bytes (drawable) - 1] = 0;
active[gimp_drawable_bytes (drawable) - 1] = 0;
}
}
}
@ -2219,7 +2221,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels = g_slist_next (channels))
{
channel = (Channel *) channels->data;
if (! strcmp (drawable_get_name (GIMP_DRAWABLE (channel)), name))
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2862,7 +2864,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup (drawable_get_name (GIMP_DRAWABLE(layer)));
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
@ -2875,7 +2877,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
type, drawable_get_name (GIMP_DRAWABLE (layer)),
type, gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
@ -3044,7 +3046,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* set the name after the original layers have been removed so we don't
end up with #2 appended to the name */
drawable_set_name (GIMP_DRAWABLE (merge_layer), name);
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
/* End the merge undo group */

View file

@ -327,7 +327,8 @@ layer_copy (Layer *layer,
PixelRegion destPR;
/* formulate the new layer name */
name = layer_get_name (layer);
name = gimp_object_get_name (GIMP_OBJECT (layer));
ext = strrchr (name, '#');
len = strlen (_("copy"));
@ -529,7 +530,8 @@ layer_create_mask (Layer *layer,
guchar white_mask = OPAQUE_OPACITY;
guchar black_mask = TRANSPARENT_OPACITY;
mask_name = g_strdup_printf (_("%s mask"), GIMP_DRAWABLE (layer)->name);
mask_name = g_strdup_printf (_("%s mask"),
gimp_object_get_name (GIMP_OBJECT (layer)));
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE (layer)->gimage,
@ -1289,13 +1291,13 @@ void
layer_set_name (Layer *layer,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (layer), name);
gimp_object_set_name (GIMP_OBJECT (layer), name);
}
const gchar *
layer_get_name (const Layer *layer)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (layer));
return gimp_object_get_name (GIMP_OBJECT (layer));
}
guchar *
@ -1804,8 +1806,9 @@ layer_mask_copy (LayerMask *layer_mask)
PixelRegion srcPR, destPR;
/* formulate the new layer_mask name */
layer_mask_name = g_strdup_printf (_("%s copy"),
GIMP_DRAWABLE(layer_mask)->name);
layer_mask_name =
g_strdup_printf (_("%s copy"),
gimp_object_get_name (GIMP_OBJECT (layer_mask)));
/* allocate a new layer_mask object */
new_layer_mask = layer_mask_new (GIMP_DRAWABLE(layer_mask)->gimage,

View file

@ -1462,7 +1462,7 @@ channel_widget_create (GimpImage *gimage,
case AUXILLARY_CHANNEL:
channel_widget->label =
gtk_label_new (drawable_get_name (GIMP_DRAWABLE (channel)));
gtk_label_new (gimp_object_get_name (GIMP_OBJECT (channel)));
break;
}
@ -2650,10 +2650,10 @@ edit_channel_query_ok_callback (GtkWidget *widget,
if (options->gimage)
{
/* Set the new channel name */
drawable_set_name (GIMP_DRAWABLE (channel),
gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gimp_object_set_name (GIMP_OBJECT (channel),
gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gtk_label_set_text (GTK_LABEL (options->channel_widget->label),
drawable_get_name (GIMP_DRAWABLE (channel)));
gimp_object_get_name (GIMP_OBJECT (channel)));
if (channel->opacity != opacity)
{
@ -2755,7 +2755,7 @@ channels_dialog_edit_channel_query (ChannelWidget *channel_widget)
1, 2, 0, 1);
gtk_entry_set_text
(GTK_ENTRY (options->name_entry),
drawable_get_name (GIMP_DRAWABLE (channel_widget->channel)));
gimp_object_get_name (GIMP_OBJECT (channel_widget->channel)));
gtk_widget_show (options->name_entry);
/* The opacity scale */

View file

@ -324,7 +324,7 @@ layer_select_set_layer (LayerSelect *layer_select)
/* Set the layer label */
gtk_label_set_text (GTK_LABEL (layer_select->label),
drawable_get_name (GIMP_DRAWABLE (layer)));
gimp_object_get_name (GIMP_OBJECT (layer)));
}
static gint

View file

@ -3695,7 +3695,7 @@ edit_layer_query_ok_callback (GtkWidget *widget,
if ((layer = options->layer))
{
/* Set the new layer name */
if (GIMP_DRAWABLE (layer)->name && layer_is_floating_sel (layer))
if (GIMP_OBJECT (layer)->name && layer_is_floating_sel (layer))
{
/* If the layer is a floating selection, make it a layer */
floating_sel_to_layer (layer);

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -1262,7 +1262,7 @@ toolbox_drag_drop (GtkWidget *widget,
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer),
gimp_drawable_get_name (drawable));
gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer)
{
@ -1274,8 +1274,8 @@ toolbox_drag_drop (GtkWidget *widget,
if (new_mask)
{
gimp_drawable_set_name (GIMP_DRAWABLE (new_mask),
gimp_drawable_get_name (GIMP_DRAWABLE (mask)));
gimp_object_set_name (GIMP_OBJECT (new_mask),
gimp_object_get_name (GIMP_OBJECT (mask)));
}
}

View file

@ -327,7 +327,8 @@ layer_copy (Layer *layer,
PixelRegion destPR;
/* formulate the new layer name */
name = layer_get_name (layer);
name = gimp_object_get_name (GIMP_OBJECT (layer));
ext = strrchr (name, '#');
len = strlen (_("copy"));
@ -529,7 +530,8 @@ layer_create_mask (Layer *layer,
guchar white_mask = OPAQUE_OPACITY;
guchar black_mask = TRANSPARENT_OPACITY;
mask_name = g_strdup_printf (_("%s mask"), GIMP_DRAWABLE (layer)->name);
mask_name = g_strdup_printf (_("%s mask"),
gimp_object_get_name (GIMP_OBJECT (layer)));
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE (layer)->gimage,
@ -1289,13 +1291,13 @@ void
layer_set_name (Layer *layer,
const gchar *name)
{
gimp_drawable_set_name (GIMP_DRAWABLE (layer), name);
gimp_object_set_name (GIMP_OBJECT (layer), name);
}
const gchar *
layer_get_name (const Layer *layer)
{
return gimp_drawable_get_name (GIMP_DRAWABLE (layer));
return gimp_object_get_name (GIMP_OBJECT (layer));
}
guchar *
@ -1804,8 +1806,9 @@ layer_mask_copy (LayerMask *layer_mask)
PixelRegion srcPR, destPR;
/* formulate the new layer_mask name */
layer_mask_name = g_strdup_printf (_("%s copy"),
GIMP_DRAWABLE(layer_mask)->name);
layer_mask_name =
g_strdup_printf (_("%s copy"),
gimp_object_get_name (GIMP_OBJECT (layer_mask)));
/* allocate a new layer_mask object */
new_layer_mask = layer_mask_new (GIMP_DRAWABLE(layer_mask)->gimage,

View file

@ -324,7 +324,7 @@ layer_select_set_layer (LayerSelect *layer_select)
/* Set the layer label */
gtk_label_set_text (GTK_LABEL (layer_select->label),
drawable_get_name (GIMP_DRAWABLE (layer)));
gimp_object_get_name (GIMP_OBJECT (layer)));
}
static gint

View file

@ -3695,7 +3695,7 @@ edit_layer_query_ok_callback (GtkWidget *widget,
if ((layer = options->layer))
{
/* Set the new layer name */
if (GIMP_DRAWABLE (layer)->name && layer_is_floating_sel (layer))
if (GIMP_OBJECT (layer)->name && layer_is_floating_sel (layer))
{
/* If the layer is a floating selection, make it a layer */
floating_sel_to_layer (layer);

View file

@ -229,7 +229,7 @@ qmask_activate (GtkWidget *widget,
gmask = channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, color);
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
channel_set_opacity (gmask, opacity);
gimage_mask_none (gimg); /* Clear the selection */
}

View file

@ -183,7 +183,7 @@ layer_size (Layer *layer)
sizeof (Layer) +
GIMP_DRAWABLE (layer)->width * GIMP_DRAWABLE (layer)->height *
GIMP_DRAWABLE (layer)->bytes +
strlen (GIMP_DRAWABLE (layer)->name);
strlen (GIMP_OBJECT (layer)->name);
if (layer_get_mask (layer))
size += channel_size (GIMP_CHANNEL (layer_get_mask (layer)));
@ -200,7 +200,7 @@ channel_size (Channel *channel)
size =
sizeof (Channel) +
GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
strlen (GIMP_DRAWABLE (channel)->name);
strlen (GIMP_OBJECT (channel)->name);
return size;
}

View file

@ -1304,7 +1304,7 @@ xcf_save_layer (XcfInfo *info,
info->cp += xcf_write_int32 (info->fp, (guint32*) &GIMP_DRAWABLE(layer)->type, 1);
/* write out the layers name */
info->cp += xcf_write_string (info->fp, &GIMP_DRAWABLE(layer)->name, 1);
info->cp += xcf_write_string (info->fp, &GIMP_OBJECT (layer)->name, 1);
/* write out the layer properties */
xcf_save_layer_props (info, gimage, layer);
@ -1363,7 +1363,7 @@ xcf_save_channel (XcfInfo *info,
info->cp += xcf_write_int32 (info->fp, (guint32*) &GIMP_DRAWABLE(channel)->height, 1);
/* write out the channels name */
info->cp += xcf_write_string (info->fp, &GIMP_DRAWABLE(channel)->name, 1);
info->cp += xcf_write_string (info->fp, &GIMP_OBJECT (channel)->name, 1);
/* write out the channel properties */
xcf_save_channel_props (info, gimage, channel);

View file

@ -1304,7 +1304,7 @@ xcf_save_layer (XcfInfo *info,
info->cp += xcf_write_int32 (info->fp, (guint32*) &GIMP_DRAWABLE(layer)->type, 1);
/* write out the layers name */
info->cp += xcf_write_string (info->fp, &GIMP_DRAWABLE(layer)->name, 1);
info->cp += xcf_write_string (info->fp, &GIMP_OBJECT (layer)->name, 1);
/* write out the layer properties */
xcf_save_layer_props (info, gimage, layer);
@ -1363,7 +1363,7 @@ xcf_save_channel (XcfInfo *info,
info->cp += xcf_write_int32 (info->fp, (guint32*) &GIMP_DRAWABLE(channel)->height, 1);
/* write out the channels name */
info->cp += xcf_write_string (info->fp, &GIMP_DRAWABLE(channel)->name, 1);
info->cp += xcf_write_string (info->fp, &GIMP_OBJECT (channel)->name, 1);
/* write out the channel properties */
xcf_save_channel_props (info, gimage, channel);