plug-ins: use new item API instead of deprecated drawable API

This commit is contained in:
Michael Natterer 2010-07-09 12:27:36 +02:00
parent ce9ea1e8d7
commit c6a2eaa5c4
40 changed files with 96 additions and 96 deletions

View file

@ -226,7 +226,7 @@ rcm_reduce_image (GimpDrawable *drawable,
/* clamp to image size since this is the size of the mask */
gimp_drawable_offsets (drawable->drawable_id, &offx, &offy);
image = gimp_drawable_get_image (drawable->drawable_id);
image = gimp_item_get_image (drawable->drawable_id);
x1 = CLAMP (x1, - offx, gimp_image_width (image) - offx);
x2 = CLAMP (x2, - offx, gimp_image_width (image) - offx);

View file

@ -222,14 +222,14 @@ align_layers (gint32 image_id)
for (index = 0; index < layer_num; index++)
{
if (gimp_drawable_get_visible (layers[index]))
if (gimp_item_get_visible (layers[index]))
visible_layer_num++;
}
if (VALS.ignore_bottom)
{
layer_num--;
if (gimp_drawable_get_visible (layers[bg_index]))
if (gimp_item_get_visible (layers[bg_index]))
visible_layer_num--;
}
@ -243,7 +243,7 @@ align_layers (gint32 image_id)
/* 0 is the top layer */
for (index = 0; index < layer_num; index++)
{
if (gimp_drawable_get_visible (layers[index]))
if (gimp_item_get_visible (layers[index]))
{
gimp_drawable_offsets (layers[index], &orig_x, &orig_y);
align_layers_get_align_offsets (layers[index], &offset_x,
@ -286,7 +286,7 @@ align_layers (gint32 image_id)
for (vindex = -1, index = 0; index < layer_num; index++)
{
if (gimp_drawable_get_visible (layers[index]))
if (gimp_item_get_visible (layers[index]))
vindex++;
else
continue;

View file

@ -1004,7 +1004,7 @@ do_optimizations (GimpRunMode run_mode,
*/
oldlayer_name =
gimp_drawable_get_name(layers[total_frames-(this_frame_num+1)]);
gimp_item_get_name(layers[total_frames-(this_frame_num+1)]);
buflen = strlen(oldlayer_name) + 40;
@ -1032,7 +1032,7 @@ do_optimizations (GimpRunMode run_mode,
g_free (newlayer_name);
oldlayer_name = gimp_drawable_get_name (last_true_frame);
oldlayer_name = gimp_item_get_name (last_true_frame);
buflen = strlen (oldlayer_name) + 40;
@ -1050,7 +1050,7 @@ do_optimizations (GimpRunMode run_mode,
(this_frame_num == 0) ? "" :
can_combine ? "(combine)" : "(replace)");
gimp_drawable_set_name (last_true_frame, newlayer_name);
gimp_item_set_name (last_true_frame, newlayer_name);
g_free (newlayer_name);
}
@ -1120,7 +1120,7 @@ get_frame_disposal (guint whichframe)
gchar *layer_name;
DisposeType disposal;
layer_name = gimp_drawable_get_name(layers[total_frames-(whichframe+1)]);
layer_name = gimp_item_get_name(layers[total_frames-(whichframe+1)]);
disposal = parse_disposal_tag(layer_name);
g_free(layer_name);
@ -1133,7 +1133,7 @@ get_frame_duration (guint whichframe)
gchar* layer_name;
gint duration = 0;
layer_name = gimp_drawable_get_name(layers[total_frames-(whichframe+1)]);
layer_name = gimp_item_get_name(layers[total_frames-(whichframe+1)]);
if (layer_name)
{
duration = parse_ms_tag(layer_name);

View file

@ -1643,7 +1643,7 @@ get_frame_disposal (guint whichframe)
DisposeType disposal;
gchar *layer_name;
layer_name = gimp_drawable_get_name (layers[total_frames-(whichframe+1)]);
layer_name = gimp_item_get_name (layers[total_frames-(whichframe+1)]);
disposal = parse_disposal_tag (layer_name);
g_free (layer_name);
@ -1656,7 +1656,7 @@ get_frame_duration (guint whichframe)
gchar *layer_name;
gint duration = 0;
layer_name = gimp_drawable_get_name (layers[total_frames-(whichframe+1)]);
layer_name = gimp_item_get_name (layers[total_frames-(whichframe+1)]);
if (layer_name)
{
duration = parse_ms_tag (layer_name);

View file

@ -215,8 +215,8 @@ analyze (GimpDrawable *drawable)
gimp_pixel_rgn_init (&srcPR, drawable, 0, 0, width, height, FALSE, FALSE);
cmap = gimp_image_get_colormap (imageID, &numcol);
gray = (gimp_drawable_is_gray (drawable->drawable_id)
|| gimp_drawable_is_channel (drawable->drawable_id));
gray = (gimp_drawable_is_gray (drawable->drawable_id) ||
gimp_item_is_channel (drawable->drawable_id));
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
selDrawable = gimp_drawable_get (gimp_image_get_selection (imageID));

View file

@ -164,7 +164,7 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS &&
gimp_drawable_is_rgb (drawable->drawable_id) &&
gimp_drawable_is_layer (drawable->drawable_id))
gimp_item_is_layer (drawable->drawable_id))
{
gboolean lock_alpha;

View file

@ -702,7 +702,7 @@ compose (const gchar *compose_type,
/* Check image sizes */
if (compose_by_drawable)
{
if (! gimp_drawable_is_valid (inputs[first_ID].comp.ID))
if (! gimp_item_is_valid (inputs[first_ID].comp.ID))
{
g_message (_("Specified layer %d not found"),
inputs[first_ID].comp.ID);
@ -716,7 +716,7 @@ compose (const gchar *compose_type,
{
if (inputs[j].is_ID)
{
if (! gimp_drawable_is_valid (inputs[j].comp.ID))
if (! gimp_item_is_valid (inputs[j].comp.ID))
{
g_message (_("Specified layer %d not found"),
inputs[j].comp.ID);
@ -818,7 +818,7 @@ compose (const gchar *compose_type,
{
layer_ID_dst = composevals.source_layer_ID;
if (! gimp_drawable_is_valid (layer_ID_dst))
if (! gimp_item_is_valid (layer_ID_dst))
{
g_message (_("Unable to recompose, source layer not found"));
return -1;
@ -831,7 +831,7 @@ compose (const gchar *compose_type,
gimp_pixel_rgn_init (&pixel_rgn_dst_read, drawable_dst,
0, 0, drawable_dst->width, drawable_dst->height,
FALSE, FALSE);
image_ID_dst = gimp_drawable_get_image (layer_ID_dst);
image_ID_dst = gimp_item_get_image (layer_ID_dst);
}
else
{
@ -1475,7 +1475,7 @@ compose_dialog (const gchar *compose_type,
gimp_ui_init (PLUG_IN_BINARY, TRUE);
layer_list = gimp_image_get_layers (gimp_drawable_get_image (drawable_ID),
layer_list = gimp_image_get_layers (gimp_item_get_image (drawable_ID),
&nlayers);
dialog = gimp_dialog_new (_("Compose"), PLUG_IN_BINARY,

View file

@ -670,7 +670,7 @@ run (const gchar *name,
l_image_id = param[1].data.d_int32;
l_layer_id = param[2].data.d_drawable;
if (! gimp_drawable_is_layer (l_layer_id))
if (! gimp_item_is_layer (l_layer_id))
{
g_set_error (&error, 0, 0, "%s",
_("Can operate on layers only "
@ -2664,7 +2664,7 @@ p_create_pv_image (GimpDrawable *src_drawable,
t_GDRW l_dst_gdrw;
l_new_image_id = gimp_image_new (PREVIEW_SIZE_X, PREVIEW_SIZE_Y,
gimp_image_base_type (gimp_drawable_get_image (src_drawable->drawable_id)));
gimp_image_base_type (gimp_item_get_image (src_drawable->drawable_id)));
gimp_image_undo_disable (l_new_image_id);
l_type = gimp_drawable_type(src_drawable->drawable_id);
@ -2734,14 +2734,14 @@ p_add_layer (gint width,
gint32 image_id;
gint stack_position;
image_id = gimp_drawable_get_image (src_drawable->drawable_id);
image_id = gimp_item_get_image (src_drawable->drawable_id);
stack_position = 0; /* TODO: should be same as src_layer */
/* copy type, name, opacity and mode from src_drawable */
l_type = gimp_drawable_type (src_drawable->drawable_id);
l_visible = gimp_drawable_get_visible (src_drawable->drawable_id);
l_visible = gimp_item_get_visible (src_drawable->drawable_id);
l_name2 = gimp_drawable_get_name (src_drawable->drawable_id);
l_name2 = gimp_item_get_name (src_drawable->drawable_id);
l_name = g_strdup_printf ("%s_b", l_name2);
g_free (l_name2);
@ -2772,7 +2772,7 @@ p_add_layer (gint width,
gimp_image_add_layer (image_id, l_new_layer_id, stack_position);
/* copy visiblity state */
gimp_drawable_set_visible (l_new_layer_id, l_visible);
gimp_item_set_visible (l_new_layer_id, l_visible);
return l_new_drawable;
}
@ -3196,7 +3196,7 @@ p_main_bend (BenderDialog *cd,
gint32 xmax, ymax;
l_interpolation = cd->smoothing;
l_image_id = gimp_drawable_get_image (original_drawable->drawable_id);
l_image_id = gimp_item_get_image (original_drawable->drawable_id);
gimp_drawable_offsets(original_drawable->drawable_id, &l_offset_x, &l_offset_y);
l_center_x = l_offset_x + (gimp_drawable_width (original_drawable->drawable_id) / 2 );
@ -3210,8 +3210,8 @@ p_main_bend (BenderDialog *cd,
* that the layer was part of the image)
*/
gimp_image_add_layer (l_image_id, l_tmp_layer_id, 0);
gimp_drawable_set_visible (l_tmp_layer_id, FALSE);
gimp_drawable_set_name (l_tmp_layer_id, "curve_bend_dummylayer");
gimp_item_set_visible (l_tmp_layer_id, FALSE);
gimp_item_set_name (l_tmp_layer_id, "curve_bend_dummylayer");
if(gb_debug) printf("p_main_bend l_tmp_layer_id %d\n", (int)l_tmp_layer_id);

View file

@ -169,7 +169,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
if (! gimp_drawable_is_layer (param[2].data.d_drawable))
if (! gimp_item_is_layer (param[2].data.d_drawable))
{
g_set_error (&error, 0, 0, "%s",
_("Can operate on layers only "
@ -466,13 +466,13 @@ dog (gint32 image_ID,
gimp_drawable_flush (drawable);
layer1 = gimp_layer_copy (drawable_id);
gimp_drawable_set_visible (layer1, FALSE);
gimp_drawable_set_name (layer1, "dog_scratch_layer1");
gimp_item_set_visible (layer1, FALSE);
gimp_item_set_name (layer1, "dog_scratch_layer1");
gimp_image_add_layer (image_ID, layer1, 0);
layer2 = gimp_layer_copy (drawable_id);
gimp_drawable_set_visible (layer2, FALSE);
gimp_drawable_set_name (layer2, "dog_scratch_layer2");
gimp_item_set_visible (layer2, FALSE);
gimp_item_set_name (layer2, "dog_scratch_layer2");
gimp_image_add_layer (image_ID, layer2, 0);
drawable1 = gimp_drawable_get (layer1);
@ -977,7 +977,7 @@ preview_update_preview (GimpPreview *preview,
x1, y1, width, height);
/* set up gimp drawable for rendering preview into */
src_image_id = gimp_drawable_get_image (drawable->drawable_id);
src_image_id = gimp_item_get_image (drawable->drawable_id);
image_id = gimp_image_new (width, height,
gimp_image_base_type (src_image_id));
preview_id = gimp_layer_new (image_id, "preview", width, height,

View file

@ -901,7 +901,7 @@ save_image (const gchar *filename,
{
if (i > 0 && ! gsvals.always_use_default_dispose)
{
layer_name = gimp_drawable_get_name (layers[i - 1]);
layer_name = gimp_item_get_name (layers[i - 1]);
Disposal = parse_disposal_tag (layer_name);
g_free (layer_name);
}
@ -910,7 +910,7 @@ save_image (const gchar *filename,
Disposal = gsvals.default_dispose;
}
layer_name = gimp_drawable_get_name (layers[i]);
layer_name = gimp_item_get_name (layers[i]);
Delay89 = parse_ms_tag (layer_name);
g_free (layer_name);

View file

@ -1294,7 +1294,7 @@ gih_save_image (const gchar *filename,
for (layer = 0, k = 0; layer < nlayers; layer++)
{
GimpDrawable *drawable = gimp_drawable_get (layer_ID[layer]);
gchar *name = gimp_drawable_get_name (drawable->drawable_id);
gchar *name = gimp_item_get_name (drawable->drawable_id);
gimp_drawable_offsets (drawable->drawable_id, &offsetx, &offsety);

View file

@ -643,7 +643,7 @@ mng_save_image (const gchar *filename,
if ((num_layers > 1) && (mng_data.loop))
{
gint32 ms =
parse_ms_tag_from_layer_name (gimp_drawable_get_name (layers[0]));
parse_ms_tag_from_layer_name (gimp_item_get_name (layers[0]));
if (mng_putchunk_term (handle, MNG_TERMACTION_REPEAT,
MNG_ITERACTION_LASTFRAME,
@ -656,7 +656,7 @@ mng_save_image (const gchar *filename,
else
{
gint32 ms =
parse_ms_tag_from_layer_name (gimp_drawable_get_name (layers[0]));
parse_ms_tag_from_layer_name (gimp_item_get_name (layers[0]));
if (mng_putchunk_term (handle, MNG_TERMACTION_LASTFRAME,
MNG_ITERACTION_LASTFRAME,
@ -804,7 +804,7 @@ mng_save_image (const gchar *filename,
guchar *fixed;
guchar layer_remap[256];
layer_name = gimp_drawable_get_name (layers[i]);
layer_name = gimp_item_get_name (layers[i]);
layer_chunks_type = parse_chunks_type_from_layer_name (layer_name);
layer_drawable_type = gimp_drawable_type (layers[i]);

View file

@ -1133,10 +1133,10 @@ load_image (const gchar *filename,
tmp_ID = gimp_image_get_active_drawable (image_list[k]);
name = gimp_drawable_get_name (tmp_ID);
name = gimp_item_get_name (tmp_ID);
current_layer = gimp_layer_new_from_drawable (tmp_ID, image_ID);
gimp_drawable_set_name (current_layer, name);
gimp_item_set_name (current_layer, name);
gimp_image_add_layer (image_ID, current_layer, -1);
gimp_image_delete (image_list[k]);
@ -2437,7 +2437,7 @@ save_ps_preview (FILE *ofp,
cmap = NULL; /* Check if we need a colour table */
if (gimp_drawable_type (drawable_ID) == GIMP_INDEXED_IMAGE)
cmap = gimp_image_get_colormap (gimp_drawable_get_image (drawable_ID),
cmap = gimp_image_get_colormap (gimp_item_get_image (drawable_ID),
&ncols);
for (y = 0; y < height; y++)

View file

@ -1458,7 +1458,7 @@ read_layer_block (FILE *f,
saved_image_rect[0], saved_image_rect[1]);
if (!visibility)
gimp_drawable_set_visible (layer_ID, FALSE);
gimp_item_set_visible (layer_ID, FALSE);
gimp_layer_set_lock_alpha (layer_ID, transparency_protected);

View file

@ -1495,7 +1495,7 @@ save_image (const gchar *filename,
return FALSE;
}
/* get framename of this layer */
framename = gimp_drawable_get_name (layers[nlayers - 1 - i]);
framename = gimp_item_get_name (layers[nlayers - 1 - i]);
/* get offset of this layer. */
gimp_drawable_offsets (layers[nlayers - 1 - i], &layer_xoffset, &layer_yoffset);
@ -1649,7 +1649,7 @@ save_image (const gchar *filename,
if (!framename)
return FALSE;
gimp_drawable_set_name (orig_layers[nlayers - 1 - i], framename);
gimp_item_set_name (orig_layers[nlayers - 1 - i], framename);
g_free (framename);
gimp_progress_update ((i + 1) / imagesp->nimage);

View file

@ -676,7 +676,7 @@ draw_number (gint32 layer_ID,
g_snprintf (buf, sizeof (buf), "%d", num);
drw = gimp_drawable_get (layer_ID);
image_ID = gimp_drawable_get_image (layer_ID);
image_ID = gimp_item_get_image (layer_ID);
max_delta = height / 10;
if (max_delta < 1)

View file

@ -553,7 +553,7 @@ update_preview (GimpPreview *preview,
{
update_values ();
grid (gimp_drawable_get_image (drawable->drawable_id), drawable, preview);
grid (gimp_item_get_image (drawable->drawable_id), drawable, preview);
}
static void

View file

@ -793,7 +793,7 @@ iwarp (void)
animlayers[i] = gimp_layer_copy (layerID);
gimp_layer_add_alpha (animlayers[i]);
gimp_drawable_set_name (animlayers[i], st);
gimp_item_set_name (animlayers[i], st);
g_free (st);
gimp_image_add_layer (imageID, animlayers[i], 0);
@ -825,7 +825,7 @@ iwarp (void)
gimp_layer_add_alpha (layerID);
st = g_strdup_printf (_("Frame %d"), i + animate_num_frames);
gimp_drawable_set_name (layerID, st);
gimp_item_set_name (layerID, st);
g_free (st);
gimp_image_add_layer (imageID, layerID, 0);
@ -979,7 +979,7 @@ iwarp_init (void)
image_bpp = gimp_drawable_bpp (drawable->drawable_id);
if (gimp_drawable_is_layer (drawable->drawable_id))
if (gimp_item_is_layer (drawable->drawable_id))
lock_alpha = gimp_layer_get_lock_alpha (drawable->drawable_id);
else
lock_alpha = FALSE;

View file

@ -762,7 +762,7 @@ flare_center_create (GimpDrawable *drawable,
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
image_ID = gimp_drawable_get_image (drawable->drawable_id);
image_ID = gimp_item_get_image (drawable->drawable_id);
gimp_image_get_resolution (image_ID, &res_x, &res_y);
center->coords = gimp_coordinates_new (GIMP_UNIT_PIXEL, "%p", TRUE, TRUE, -1,

View file

@ -1238,7 +1238,7 @@ newsprint_dialog (GimpDrawable *drawable)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
gimp_image_get_resolution (gimp_drawable_get_image (drawable->drawable_id),
gimp_image_get_resolution (gimp_item_get_image (drawable->drawable_id),
&xres, &yres);
/* XXX hack: should really note both resolutions, and use
* rectangular cells, not square cells. But I'm being lazy,

View file

@ -453,7 +453,7 @@ nova_center_create (GimpDrawable *drawable,
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
image_ID = gimp_drawable_get_image (drawable->drawable_id);
image_ID = gimp_item_get_image (drawable->drawable_id);
gimp_image_get_resolution (image_ID, &res_x, &res_y);
center->coords = gimp_coordinates_new (GIMP_UNIT_PIXEL, "%p", TRUE, TRUE, -1,

View file

@ -341,7 +341,7 @@ pixelize_dialog (GimpDrawable *drawable)
G_CALLBACK (pixelize),
drawable);
image_id = gimp_drawable_get_image (drawable->drawable_id);
image_id = gimp_item_get_image (drawable->drawable_id);
unit = gimp_image_get_unit (image_id);
gimp_image_get_resolution (image_id, &xres, &yres);

View file

@ -176,7 +176,7 @@ dialog (gint32 image_id,
_("Threshold for the red eye color to remove."),
NULL);
if (gimp_selection_is_empty (gimp_drawable_get_image (drawable->drawable_id)))
if (gimp_selection_is_empty (gimp_item_get_image (drawable->drawable_id)))
{
GtkWidget *hints = gimp_hint_box_new (_("Manually selecting the eyes may "
"improve the results."));

View file

@ -413,7 +413,7 @@ rotate (void)
gimp_drawable_detach (active_drawable);
return;
}
if (gimp_drawable_is_layer (active_drawable->drawable_id) &&
if (gimp_item_is_layer (active_drawable->drawable_id) &&
gimp_layer_is_floating_sel (active_drawable->drawable_id))
{
gimp_message (_("You can not rotate the whole image if there's a floating selection."));
@ -425,7 +425,7 @@ rotate (void)
/* if we are trying to rotate a channel or a mask,
create an error message and exit */
{
if (! gimp_drawable_is_layer (active_drawable->drawable_id))
if (! gimp_item_is_layer (active_drawable->drawable_id))
{
gimp_message (_("Sorry, channels and masks can not be rotated."));
gimp_drawable_detach (active_drawable);

View file

@ -424,7 +424,7 @@ dialog (GimpDrawable *drawable)
gimp_window_set_transient (GTK_WINDOW (dlg));
image_id = gimp_drawable_get_image (drawable->drawable_id);
image_id = gimp_item_get_image (drawable->drawable_id);
unit = gimp_image_get_unit (image_id);
gimp_image_get_resolution (image_id, &xres, &yres);

View file

@ -285,7 +285,7 @@ tile (gint32 image_id,
tvals.new_width, tvals.new_height,
0, 0);
if (gimp_drawable_is_layer (drawable_id))
if (gimp_item_is_layer (drawable_id))
gimp_layer_resize (drawable_id,
tvals.new_width, tvals.new_height,
0, 0);

View file

@ -932,7 +932,7 @@ diff (GimpDrawable *drawable,
16-bit pixel value. This is either clever, or a kluge,
depending on your point of view. */
image_id = gimp_drawable_get_image (drawable->drawable_id);
image_id = gimp_item_get_image (drawable->drawable_id);
layer_active = gimp_image_get_active_layer (image_id);
/* create new image for X,Y diff */
@ -1249,7 +1249,7 @@ warp (GimpDrawable *orig_draw)
map_x = gimp_drawable_get (xdlayer);
map_y = gimp_drawable_get (ydlayer);
orig_image_id = gimp_drawable_get_image (orig_draw->drawable_id);
orig_image_id = gimp_item_get_image (orig_draw->drawable_id);
for (warp_iter = 0; warp_iter < dvals.iter; warp_iter++)
{
@ -1268,7 +1268,7 @@ warp (GimpDrawable *orig_draw)
first_time = FALSE;
}
image_ID = gimp_drawable_get_image (map_x->drawable_id);
image_ID = gimp_item_get_image (map_x->drawable_id);
gimp_drawable_detach (map_x);
gimp_drawable_detach (map_y);

View file

@ -244,7 +244,7 @@ ico_dialog_update_icon_preview (GtkWidget *dialog,
guchar *cmap;
gint num_colors;
image = gimp_drawable_get_image (layer);
image = gimp_item_get_image (layer);
tmp_image = gimp_image_new (w, h, gimp_image_base_type (image));
gimp_image_undo_disable (tmp_image);
@ -337,7 +337,7 @@ ico_dialog_update_icon_preview (GtkWidget *dialog,
GimpParam *return_vals;
gint n_return_vals;
image = gimp_drawable_get_image (layer);
image = gimp_item_get_image (layer);
tmp_image = gimp_image_new (w, h, gimp_image_base_type (image));
gimp_image_undo_disable (tmp_image);
@ -485,9 +485,9 @@ ico_dialog_check_compat (GtkWidget *dialog,
for (i = 0; i < info->num_icons; i++)
{
if (gimp_drawable_width (info->layers[i]) > 255
|| gimp_drawable_height (info->layers[i]) > 255
|| info->compress[i])
if (gimp_drawable_width (info->layers[i]) > 255 ||
gimp_drawable_height (info->layers[i]) > 255 ||
info->compress[i])
{
warn = TRUE;
break;

View file

@ -556,7 +556,7 @@ ico_image_get_reduced_buf (guint32 layer,
if (bpp <= 8 || bpp == 24 || drawable->bpp != 4)
{
gint32 image = gimp_drawable_get_image (layer);
gint32 image = gimp_item_get_image (layer);
GimpDrawable *tmp;
tmp_image = gimp_image_new (gimp_drawable_width (layer),

View file

@ -794,7 +794,7 @@ destroy_preview (void)
}
if (gimp_image_is_valid (preview_image_ID) &&
gimp_drawable_is_valid (preview_layer_ID))
gimp_item_is_valid (preview_layer_ID))
{
/* assuming that reference counting is working correctly,
we do not need to delete the layer, removing it from

View file

@ -1254,11 +1254,11 @@ add_layers (const gint32 image_id,
gimp_image_add_layer (image_id, layer_id, -1);
drawable = gimp_drawable_get (layer_id);
gimp_drawable_fill (drawable->drawable_id, GIMP_TRANSPARENT_FILL);
gimp_drawable_set_visible (drawable->drawable_id, lyr_a[lidx]->layer_flags.visible);
gimp_item_set_visible (drawable->drawable_id, lyr_a[lidx]->layer_flags.visible);
if (lyr_a[lidx]->id)
gimp_drawable_set_tattoo (drawable->drawable_id, lyr_a[lidx]->id);
gimp_item_set_tattoo (drawable->drawable_id, lyr_a[lidx]->id);
if (lyr_a[lidx]->layer_flags.irrelevant)
gimp_drawable_set_visible (drawable->drawable_id, FALSE);
gimp_item_set_visible (drawable->drawable_id, FALSE);
gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable);
}
@ -1296,9 +1296,9 @@ add_layers (const gint32 image_id,
drawable->width, drawable->height, TRUE, FALSE);
gimp_pixel_rgn_set_rect (&pixel_rgn, pixels,
0, 0, drawable->width, drawable->height);
gimp_drawable_set_visible (drawable->drawable_id, lyr_a[lidx]->layer_flags.visible);
gimp_item_set_visible (drawable->drawable_id, lyr_a[lidx]->layer_flags.visible);
if (lyr_a[lidx]->id)
gimp_drawable_set_tattoo (drawable->drawable_id, lyr_a[lidx]->id);
gimp_item_set_tattoo (drawable->drawable_id, lyr_a[lidx]->id);
gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable);
g_free (pixels);
@ -1669,8 +1669,8 @@ add_merged_image (const gint32 image_id,
g_free (alpha_name);
drawable = gimp_drawable_get (channel_id);
if (alpha_id)
gimp_drawable_set_tattoo (drawable->drawable_id, alpha_id);
gimp_drawable_set_visible (drawable->drawable_id, alpha_visible);
gimp_item_set_tattoo (drawable->drawable_id, alpha_id);
gimp_item_set_visible (drawable->drawable_id, alpha_visible);
gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0,
drawable->width, drawable->height,
TRUE, FALSE);

View file

@ -853,7 +853,7 @@ save_resources (FILE *fd,
for (i = PSDImageData.nChannels - 1; i >= 0; i--)
{
char *chName = gimp_drawable_get_name (PSDImageData.lChannels[i]);
char *chName = gimp_item_get_name (PSDImageData.lChannels[i]);
write_string (fd, chName, "channel name");
g_free (chName);
}
@ -1151,7 +1151,7 @@ save_layer_and_mask (FILE *fd,
flags = 0;
if (gimp_layer_get_lock_alpha (PSDImageData.lLayers[i])) flags |= 1;
if (! gimp_drawable_get_visible (PSDImageData.lLayers[i])) flags |= 2;
if (! gimp_item_get_visible (PSDImageData.lLayers[i])) flags |= 2;
IFDBG printf ("\t\tFlags: %u\n", flags);
write_gchar (fd, flags, "Flags");
@ -1190,7 +1190,7 @@ save_layer_and_mask (FILE *fd,
write_gint32 (fd, 0, "Layer blending size");
IFDBG printf ("\t\tLayer blending size: %d\n", 0);
layerName = gimp_drawable_get_name (PSDImageData.lLayers[i]);
layerName = gimp_item_get_name (PSDImageData.lLayers[i]);
write_pascalstring (fd, layerName, 4, "layer name");
IFDBG printf ("\t\tLayer name: %s\n", layerName);
@ -1360,7 +1360,7 @@ write_pixel_data (FILE *fd,
}
/* Write layer mask, as last channel, id -2 */
if (gimp_drawable_is_layer (drawableID))
if (gimp_item_is_layer (drawableID))
{
gint32 maskID = gimp_layer_get_mask (drawableID);
@ -1663,7 +1663,7 @@ save_image (const gchar *filename,
/* Delete merged image now */
gimp_drawable_delete (PSDImageData.merged_layer);
gimp_item_delete (PSDImageData.merged_layer);
IFDBG printf ("----- Closing PSD file, done -----\n\n");

View file

@ -67,7 +67,7 @@ gimp_guides_ok_cb(gpointer data)
GSList *vguides, *vg;
gboolean all;
const gchar *url;
gint32 image_ID = gimp_drawable_get_image (param->drawable->drawable_id);
gint32 image_ID = gimp_item_get_image (param->drawable->drawable_id);
/* First get some dialog values */

View file

@ -144,7 +144,7 @@ render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
if (has_alpha)
alpha--;
cmap = gimp_image_get_colormap (gimp_drawable_get_image (srcrgn->drawable->drawable_id),
cmap = gimp_image_get_colormap (gimp_item_get_image (srcrgn->drawable->drawable_id),
&ncols);
src_row = g_new(guchar, dwidth * bpp);

View file

@ -121,7 +121,7 @@ check_drawables (void)
if (mapvals.bump_mapped)
{
if (mapvals.bumpmap_id != -1 &&
gimp_drawable_get_image (mapvals.bumpmap_id) == -1)
gimp_item_get_image (mapvals.bumpmap_id) == -1)
{
mapvals.bump_mapped = FALSE;
mapvals.bumpmap_id = -1;
@ -141,7 +141,7 @@ check_drawables (void)
if (mapvals.env_mapped)
{
if (mapvals.envmap_id != -1 &&
gimp_drawable_get_image (mapvals.envmap_id) == -1)
gimp_item_get_image (mapvals.envmap_id) == -1)
{
mapvals.env_mapped = FALSE;
mapvals.envmap_id = -1;

View file

@ -111,7 +111,7 @@ check_drawables (GimpDrawable *drawable)
if (mapvals.boxmap_id[i] == -1)
mapvals.boxmap_id[i] = drawable->drawable_id;
else if (mapvals.boxmap_id[i] != -1 &&
gimp_drawable_get_image (mapvals.boxmap_id[i]) == -1)
gimp_item_get_image (mapvals.boxmap_id[i]) == -1)
mapvals.boxmap_id[i] = drawable->drawable_id;
else if (gimp_drawable_is_gray (mapvals.boxmap_id[i]))
mapvals.boxmap_id[i] = drawable->drawable_id;
@ -125,7 +125,7 @@ check_drawables (GimpDrawable *drawable)
if (mapvals.cylindermap_id[i] == -1)
mapvals.cylindermap_id[i] = drawable->drawable_id;
else if (mapvals.cylindermap_id[i]!=-1 &&
gimp_drawable_get_image (mapvals.cylindermap_id[i]) == -1)
gimp_item_get_image (mapvals.cylindermap_id[i]) == -1)
mapvals.cylindermap_id[i] = drawable->drawable_id;
else if (gimp_drawable_is_gray (mapvals.cylindermap_id[i]))
mapvals.cylindermap_id[i] = drawable->drawable_id;

View file

@ -564,7 +564,7 @@ mask_maze (gint32 drawable_ID,
guchar *linebuf;
selection_ID =
gimp_image_get_selection (gimp_drawable_get_image (drawable_ID));
gimp_image_get_selection (gimp_item_get_image (drawable_ID));
if (selection_ID == -1)
return;

View file

@ -189,7 +189,7 @@ print_surface_from_drawable (gint32 drawable_ID)
guchar *colors;
gint num_colors;
colors = gimp_image_get_colormap (gimp_drawable_get_image (drawable_ID),
colors = gimp_image_get_colormap (gimp_item_get_image (drawable_ID),
&num_colors);
memcpy (cmap, colors, 3 * num_colors);
g_free (colors);

View file

@ -481,7 +481,7 @@ print_preview_expose_event (GtkWidget *widget,
}
if (preview->thumbnail == NULL &&
gimp_drawable_is_valid (preview->drawable->drawable_id))
gimp_item_is_valid (preview->drawable->drawable_id))
{
preview->thumbnail =
print_preview_get_thumbnail (preview->drawable,

View file

@ -278,8 +278,8 @@ print_image (gint32 image_ID,
g_object_unref (operation);
if (gimp_drawable_is_valid (layer))
gimp_drawable_delete (layer);
if (gimp_item_is_valid (layer))
gimp_item_delete (layer);
switch (result)
{
@ -379,9 +379,9 @@ end_print (GtkPrintOperation *operation,
gint32 *layer_ID)
{
/* we don't need the print layer any longer, delete it */
if (gimp_drawable_is_valid (*layer_ID))
if (gimp_item_is_valid (*layer_ID))
{
gimp_drawable_delete (*layer_ID);
gimp_item_delete (*layer_ID);
*layer_ID = -1;
}