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



commit c6a2eaa5c4f704118e525e478a2faca8c2ff0295
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 9 12:27:36 2010 +0200

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

 plug-ins/color-rotate/color-rotate-utils.c |    2 +-
 plug-ins/common/align-layers.c             |    8 ++++----
 plug-ins/common/animation-optimize.c       |   10 +++++-----
 plug-ins/common/animation-play.c           |    4 ++--
 plug-ins/common/color-cube-analyze.c       |    4 ++--
 plug-ins/common/color-to-alpha.c           |    2 +-
 plug-ins/common/compose.c                  |   10 +++++-----
 plug-ins/common/curve-bend.c               |   18 +++++++++---------
 plug-ins/common/edge-dog.c                 |   12 ++++++------
 plug-ins/common/file-gif-save.c            |    4 ++--
 plug-ins/common/file-gih.c                 |    2 +-
 plug-ins/common/file-mng.c                 |    6 +++---
 plug-ins/common/file-ps.c                  |    6 +++---
 plug-ins/common/file-psp.c                 |    2 +-
 plug-ins/common/file-xmc.c                 |    4 ++--
 plug-ins/common/film.c                     |    2 +-
 plug-ins/common/grid.c                     |    2 +-
 plug-ins/common/iwarp.c                    |    6 +++---
 plug-ins/common/lens-flare.c               |    2 +-
 plug-ins/common/newsprint.c                |    2 +-
 plug-ins/common/nova.c                     |    2 +-
 plug-ins/common/pixelize.c                 |    2 +-
 plug-ins/common/red-eye-removal.c          |    2 +-
 plug-ins/common/rotate.c                   |    4 ++--
 plug-ins/common/smooth-palette.c           |    2 +-
 plug-ins/common/tile.c                     |    2 +-
 plug-ins/common/warp.c                     |    6 +++---
 plug-ins/file-ico/ico-dialog.c             |   10 +++++-----
 plug-ins/file-ico/ico-save.c               |    2 +-
 plug-ins/file-jpeg/jpeg-save.c             |    2 +-
 plug-ins/file-psd/psd-load.c               |   14 +++++++-------
 plug-ins/file-psd/psd-save.c               |   10 +++++-----
 plug-ins/imagemap/imap_cmd_gimp_guides.c   |    2 +-
 plug-ins/imagemap/imap_preview.c           |    2 +-
 plug-ins/lighting/lighting-main.c          |    4 ++--
 plug-ins/map-object/map-object-main.c      |    4 ++--
 plug-ins/maze/maze.c                       |    2 +-
 plug-ins/print/print-draw-page.c           |    2 +-
 plug-ins/print/print-preview.c             |    2 +-
 plug-ins/print/print.c                     |    8 ++++----
 40 files changed, 96 insertions(+), 96 deletions(-)
---
diff --git a/plug-ins/color-rotate/color-rotate-utils.c b/plug-ins/color-rotate/color-rotate-utils.c
index 1af64c8..1fe8da7 100644
--- a/plug-ins/color-rotate/color-rotate-utils.c
+++ b/plug-ins/color-rotate/color-rotate-utils.c
@@ -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);
diff --git a/plug-ins/common/align-layers.c b/plug-ins/common/align-layers.c
index be11a7a..e863993 100644
--- a/plug-ins/common/align-layers.c
+++ b/plug-ins/common/align-layers.c
@@ -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;
diff --git a/plug-ins/common/animation-optimize.c b/plug-ins/common/animation-optimize.c
index 463da32..d9157d8 100644
--- a/plug-ins/common/animation-optimize.c
+++ b/plug-ins/common/animation-optimize.c
@@ -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);
diff --git a/plug-ins/common/animation-play.c b/plug-ins/common/animation-play.c
index 803d5f7..5854738 100644
--- a/plug-ins/common/animation-play.c
+++ b/plug-ins/common/animation-play.c
@@ -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);
diff --git a/plug-ins/common/color-cube-analyze.c b/plug-ins/common/color-cube-analyze.c
index 23f46de..6c15b89 100644
--- a/plug-ins/common/color-cube-analyze.c
+++ b/plug-ins/common/color-cube-analyze.c
@@ -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));
diff --git a/plug-ins/common/color-to-alpha.c b/plug-ins/common/color-to-alpha.c
index d3f3a73..e53f731 100644
--- a/plug-ins/common/color-to-alpha.c
+++ b/plug-ins/common/color-to-alpha.c
@@ -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;
 
diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c
index ffc5ac4..1c3c4da 100644
--- a/plug-ins/common/compose.c
+++ b/plug-ins/common/compose.c
@@ -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,
diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c
index a091de7..9e8e704 100644
--- a/plug-ins/common/curve-bend.c
+++ b/plug-ins/common/curve-bend.c
@@ -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);
 
diff --git a/plug-ins/common/edge-dog.c b/plug-ins/common/edge-dog.c
index ba96cc7..750ea64 100644
--- a/plug-ins/common/edge-dog.c
+++ b/plug-ins/common/edge-dog.c
@@ -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,
diff --git a/plug-ins/common/file-gif-save.c b/plug-ins/common/file-gif-save.c
index 78a492c..d382052 100644
--- a/plug-ins/common/file-gif-save.c
+++ b/plug-ins/common/file-gif-save.c
@@ -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);
 
diff --git a/plug-ins/common/file-gih.c b/plug-ins/common/file-gih.c
index ba6ef8c..5fc8f1b 100644
--- a/plug-ins/common/file-gih.c
+++ b/plug-ins/common/file-gih.c
@@ -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);
 
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index 8c4a76d..bb390c7 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -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]);
 
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index 0cacf7b..2734d7b 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -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++)
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index 38b03ac..5363307 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -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);
 
diff --git a/plug-ins/common/file-xmc.c b/plug-ins/common/file-xmc.c
index 9b9bac5..48e97d7 100644
--- a/plug-ins/common/file-xmc.c
+++ b/plug-ins/common/file-xmc.c
@@ -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);
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index 5515bc4..ea54780 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -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)
diff --git a/plug-ins/common/grid.c b/plug-ins/common/grid.c
index 8c82066..9fdb45d 100644
--- a/plug-ins/common/grid.c
+++ b/plug-ins/common/grid.c
@@ -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
diff --git a/plug-ins/common/iwarp.c b/plug-ins/common/iwarp.c
index aacf3f6..1ed61af 100644
--- a/plug-ins/common/iwarp.c
+++ b/plug-ins/common/iwarp.c
@@ -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;
diff --git a/plug-ins/common/lens-flare.c b/plug-ins/common/lens-flare.c
index 73dbcae..1c1a5a5 100644
--- a/plug-ins/common/lens-flare.c
+++ b/plug-ins/common/lens-flare.c
@@ -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,
diff --git a/plug-ins/common/newsprint.c b/plug-ins/common/newsprint.c
index 8bbc97a..3da732d 100644
--- a/plug-ins/common/newsprint.c
+++ b/plug-ins/common/newsprint.c
@@ -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,
diff --git a/plug-ins/common/nova.c b/plug-ins/common/nova.c
index da15d94..8f8a2e9 100644
--- a/plug-ins/common/nova.c
+++ b/plug-ins/common/nova.c
@@ -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,
diff --git a/plug-ins/common/pixelize.c b/plug-ins/common/pixelize.c
index 2d2074d..24d610d 100644
--- a/plug-ins/common/pixelize.c
+++ b/plug-ins/common/pixelize.c
@@ -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);
 
diff --git a/plug-ins/common/red-eye-removal.c b/plug-ins/common/red-eye-removal.c
index 31a113a..a1e6f36 100644
--- a/plug-ins/common/red-eye-removal.c
+++ b/plug-ins/common/red-eye-removal.c
@@ -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."));
diff --git a/plug-ins/common/rotate.c b/plug-ins/common/rotate.c
index 5b2e975..a6fc3fa 100644
--- a/plug-ins/common/rotate.c
+++ b/plug-ins/common/rotate.c
@@ -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);
diff --git a/plug-ins/common/smooth-palette.c b/plug-ins/common/smooth-palette.c
index 82fa274..73da590 100644
--- a/plug-ins/common/smooth-palette.c
+++ b/plug-ins/common/smooth-palette.c
@@ -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);
 
diff --git a/plug-ins/common/tile.c b/plug-ins/common/tile.c
index 08af029..3d05a14 100644
--- a/plug-ins/common/tile.c
+++ b/plug-ins/common/tile.c
@@ -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);
diff --git a/plug-ins/common/warp.c b/plug-ins/common/warp.c
index beaf28a..db84389 100644
--- a/plug-ins/common/warp.c
+++ b/plug-ins/common/warp.c
@@ -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);
diff --git a/plug-ins/file-ico/ico-dialog.c b/plug-ins/file-ico/ico-dialog.c
index 5d3d5db..8e2962a 100644
--- a/plug-ins/file-ico/ico-dialog.c
+++ b/plug-ins/file-ico/ico-dialog.c
@@ -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;
diff --git a/plug-ins/file-ico/ico-save.c b/plug-ins/file-ico/ico-save.c
index 8b254cb..011b8b8 100644
--- a/plug-ins/file-ico/ico-save.c
+++ b/plug-ins/file-ico/ico-save.c
@@ -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),
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index 6072c26..a25018c 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -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
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index eeafc36..bb6129a 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -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);
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index d91c07a..733190b 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -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");
 
diff --git a/plug-ins/imagemap/imap_cmd_gimp_guides.c b/plug-ins/imagemap/imap_cmd_gimp_guides.c
index 2891d6c..5bec647 100644
--- a/plug-ins/imagemap/imap_cmd_gimp_guides.c
+++ b/plug-ins/imagemap/imap_cmd_gimp_guides.c
@@ -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 */
 
diff --git a/plug-ins/imagemap/imap_preview.c b/plug-ins/imagemap/imap_preview.c
index 6d1d55a..3165ba8 100644
--- a/plug-ins/imagemap/imap_preview.c
+++ b/plug-ins/imagemap/imap_preview.c
@@ -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);
diff --git a/plug-ins/lighting/lighting-main.c b/plug-ins/lighting/lighting-main.c
index 0f80471..c7b5446 100644
--- a/plug-ins/lighting/lighting-main.c
+++ b/plug-ins/lighting/lighting-main.c
@@ -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;
diff --git a/plug-ins/map-object/map-object-main.c b/plug-ins/map-object/map-object-main.c
index 70d4b2a..a88e9e7 100644
--- a/plug-ins/map-object/map-object-main.c
+++ b/plug-ins/map-object/map-object-main.c
@@ -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;
diff --git a/plug-ins/maze/maze.c b/plug-ins/maze/maze.c
index 48ad75f..3c6e996 100644
--- a/plug-ins/maze/maze.c
+++ b/plug-ins/maze/maze.c
@@ -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;
diff --git a/plug-ins/print/print-draw-page.c b/plug-ins/print/print-draw-page.c
index 6abf21b..69628eb 100644
--- a/plug-ins/print/print-draw-page.c
+++ b/plug-ins/print/print-draw-page.c
@@ -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);
diff --git a/plug-ins/print/print-preview.c b/plug-ins/print/print-preview.c
index 410c1a0..aa7a98f 100644
--- a/plug-ins/print/print-preview.c
+++ b/plug-ins/print/print-preview.c
@@ -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,
diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c
index 4d588e9..2e421dc 100644
--- a/plug-ins/print/print.c
+++ b/plug-ins/print/print.c
@@ -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;
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]