[gimp] Change PDB wrappers to check for "is group" separately



commit 585a3fa6e443a90ab432e210a01143715165cc9f
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 29 09:16:35 2009 +0200

    Change PDB wrappers to check for "is group" separately
    
    "lock-content" will be separate from "is-group" soon, so add separate
    checks for groups. Also remove some checks that were added to make
    wrappers invokable even though the group appeared locked.

 app/pdb/color-cmds.c                    |   15 ++++++
 app/pdb/drawable-cmds.c                 |   10 +++-
 app/pdb/drawable-transform-cmds.c       |   10 +---
 app/pdb/edit-cmds.c                     |   32 +++++++++----
 app/pdb/floating-sel-cmds.c             |    3 +-
 app/pdb/layer-cmds.c                    |   16 +++----
 app/pdb/paint-tools-cmds.c              |   68 ++++++++++++++++++++++-------
 app/pdb/paths-cmds.c                    |    3 +-
 app/pdb/selection-cmds.c                |    3 +-
 app/pdb/text-tool-cmds.c                |    8 +++-
 app/pdb/vectors-cmds.c                  |    6 ++-
 tools/pdbgen/pdb/color.pdb              |   15 ++++++
 tools/pdbgen/pdb/drawable.pdb           |   10 +++-
 tools/pdbgen/pdb/drawable_transform.pdb |   10 +---
 tools/pdbgen/pdb/edit.pdb               |   32 +++++++++----
 tools/pdbgen/pdb/floating_sel.pdb       |    3 +-
 tools/pdbgen/pdb/layer.pdb              |   16 +++----
 tools/pdbgen/pdb/paint_tools.pdb        |   72 +++++++++++++++++++++++--------
 tools/pdbgen/pdb/paths.pdb              |    3 +-
 tools/pdbgen/pdb/selection.pdb          |    3 +-
 tools/pdbgen/pdb/text_tool.pdb          |    8 +++-
 tools/pdbgen/pdb/vectors.pdb            |    6 ++-
 22 files changed, 241 insertions(+), 111 deletions(-)
---
diff --git a/app/pdb/color-cmds.c b/app/pdb/color-cmds.c
index c0d79f5..b3e8ce0 100644
--- a/app/pdb/color-cmds.c
+++ b/app/pdb/color-cmds.c
@@ -67,6 +67,7 @@ brightness_contrast_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -107,6 +108,7 @@ levels_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable) ||
           (! gimp_drawable_has_alpha (drawable) &&
            channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -142,6 +144,7 @@ levels_auto_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -169,6 +172,7 @@ levels_stretch_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -198,6 +202,7 @@ posterize_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -225,6 +230,7 @@ desaturate_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           ! gimp_drawable_is_rgb (drawable))
         success = FALSE;
 
@@ -254,6 +260,7 @@ desaturate_full_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           ! gimp_drawable_is_rgb (drawable))
         success = FALSE;
 
@@ -283,6 +290,7 @@ equalize_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -310,6 +318,7 @@ invert_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -343,6 +352,7 @@ curves_spline_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
           (! gimp_drawable_has_alpha (drawable) &&
            channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -381,6 +391,7 @@ curves_explicit_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
           (! gimp_drawable_has_alpha (drawable) &&
            channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -423,6 +434,7 @@ color_balance_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -459,6 +471,7 @@ colorize_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           ! gimp_drawable_is_rgb (drawable))
         success = FALSE;
 
@@ -568,6 +581,7 @@ hue_saturation_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable))
         success = FALSE;
 
@@ -600,6 +614,7 @@ threshold_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
           gimp_drawable_is_indexed (drawable) ||
           (low_threshold > high_threshold))
         success = FALSE;
diff --git a/app/pdb/drawable-cmds.c b/app/pdb/drawable-cmds.c
index b69289e..c8a39cb 100644
--- a/app/pdb/drawable-cmds.c
+++ b/app/pdb/drawable-cmds.c
@@ -935,7 +935,8 @@ drawable_merge_shadow_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           const gchar *undo_desc = _("Plug-In");
 
@@ -1093,6 +1094,7 @@ drawable_set_pixel_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
           x_coord < gimp_item_get_width  (GIMP_ITEM (drawable)) &&
           y_coord < gimp_item_get_height (GIMP_ITEM (drawable)) &&
           num_channels == gimp_drawable_bytes (drawable))
@@ -1139,7 +1141,8 @@ drawable_fill_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error))
+      if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         gimp_drawable_fill_by_type (drawable, context, (GimpFillType) fill_type);
       else
         success = FALSE;
@@ -1172,7 +1175,8 @@ drawable_offset_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         gimp_drawable_offset (drawable, context, wrap_around, fill_type,
                               offset_x, offset_y);
       else
diff --git a/app/pdb/drawable-transform-cmds.c b/app/pdb/drawable-transform-cmds.c
index 983b4ed..efc3b97 100644
--- a/app/pdb/drawable-transform-cmds.c
+++ b/app/pdb/drawable-transform-cmds.c
@@ -68,10 +68,7 @@ drawable_transform_flip_simple_invoker (GimpProcedure      *procedure,
     {
       gint x, y, width, height;
 
-      /*  group items are transformable even though they appear locked  */
-      success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error) &&
-                 (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
-                  gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error)));
+      success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
 
       if (success &&
           gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
@@ -444,10 +441,7 @@ drawable_transform_rotate_simple_invoker (GimpProcedure      *procedure,
     {
       gint x, y, width, height;
 
-      /*  group items are transformable even though they appear locked  */
-      success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error) &&
-                 (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
-                  gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error)));
+      success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error);
 
       if (success &&
           gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
diff --git a/app/pdb/edit-cmds.c b/app/pdb/edit-cmds.c
index 24fde84..15faa01 100644
--- a/app/pdb/edit-cmds.c
+++ b/app/pdb/edit-cmds.c
@@ -63,7 +63,8 @@ edit_cut_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image    = gimp_item_get_image (GIMP_ITEM (drawable));
           GError    *my_error = NULL;
@@ -195,7 +196,8 @@ edit_paste_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (gimp->global_buffer &&
-          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
                                           drawable, gimp->global_buffer,
@@ -269,7 +271,8 @@ edit_named_cut_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image    = gimp_item_get_image (GIMP_ITEM (drawable));
           GError    *my_error = NULL;
@@ -423,7 +426,9 @@ edit_named_paste_invoker (GimpProcedure      *procedure,
     {
       GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
 
-      if (buffer && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (buffer &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
                                           drawable, buffer,
@@ -498,7 +503,8 @@ edit_clear_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
@@ -529,7 +535,8 @@ edit_fill_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
@@ -573,7 +580,8 @@ edit_bucket_fill_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
           gboolean   do_seed_fill;
@@ -629,7 +637,8 @@ edit_bucket_fill_full_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
           gboolean   do_seed_fill;
@@ -697,7 +706,8 @@ edit_blend_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
+      success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+                 gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
 
       if (success && supersample)
         {
@@ -749,7 +759,8 @@ edit_stroke_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage         *image   = gimp_item_get_image (GIMP_ITEM (drawable));
           GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
@@ -790,6 +801,7 @@ edit_stroke_vectors_invoker (GimpProcedure      *procedure,
   if (success)
     {
       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
           gimp_pdb_item_is_attached (GIMP_ITEM (vectors), FALSE, error))
         {
           GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
diff --git a/app/pdb/floating-sel-cmds.c b/app/pdb/floating-sel-cmds.c
index 3af6bfc..32fe2e2 100644
--- a/app/pdb/floating-sel-cmds.c
+++ b/app/pdb/floating-sel-cmds.c
@@ -152,7 +152,8 @@ floating_sel_attach_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         floating_sel_attach (layer, drawable);
       else
         success = FALSE;
diff --git a/app/pdb/layer-cmds.c b/app/pdb/layer-cmds.c
index aede46e..fc769fb 100644
--- a/app/pdb/layer-cmds.c
+++ b/app/pdb/layer-cmds.c
@@ -232,7 +232,8 @@ layer_add_alpha_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
+      if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
         gimp_layer_add_alpha (layer);
       else
        success = FALSE;
@@ -257,7 +258,8 @@ layer_flatten_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
+      if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
         gimp_layer_flatten (layer, context);
       else
        success = FALSE;
@@ -288,10 +290,7 @@ layer_scale_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      /*  group items are transformable even though they appear locked  */
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
-          (gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
-           gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
         {
           if (progress)
             gimp_progress_start (progress, _("Scaling"), FALSE);
@@ -336,10 +335,7 @@ layer_scale_full_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      /*  group items are transformable even though they appear locked  */
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
-          (gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
-           gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
         {
           if (progress)
             gimp_progress_start (progress, _("Scaling"), FALSE);
diff --git a/app/pdb/paint-tools-cmds.c b/app/pdb/paint-tools-cmds.c
index 62a0106..5e740e4 100644
--- a/app/pdb/paint-tools-cmds.c
+++ b/app/pdb/paint-tools-cmds.c
@@ -116,7 +116,9 @@ airbrush_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -158,7 +160,9 @@ airbrush_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -204,7 +208,9 @@ clone_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -249,7 +255,9 @@ clone_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -291,7 +299,9 @@ convolve_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -334,7 +344,9 @@ convolve_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -378,7 +390,9 @@ dodgeburn_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -422,7 +436,9 @@ dodgeburn_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -464,7 +480,9 @@ eraser_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -507,7 +525,9 @@ eraser_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -551,7 +571,9 @@ heal_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -592,7 +614,9 @@ heal_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -636,7 +660,9 @@ paintbrush_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -682,7 +708,9 @@ paintbrush_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -720,7 +748,9 @@ pencil_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-pencil", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -760,7 +790,9 @@ smudge_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-smudge", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -802,7 +834,9 @@ smudge_default_invoker (GimpProcedure      *procedure,
     {
       GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-smudge", error);
 
-      if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (info &&
+          gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpPaintOptions *options = gimp_paint_options_new (info);
 
diff --git a/app/pdb/paths-cmds.c b/app/pdb/paths-cmds.c
index 188ee24..04f73a8 100644
--- a/app/pdb/paths-cmds.c
+++ b/app/pdb/paths-cmds.c
@@ -332,7 +332,8 @@ path_stroke_current_invoker (GimpProcedure      *procedure,
       GimpDrawable *drawable = gimp_image_get_active_drawable (image);
 
       if (vectors && drawable &&
-          gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error))
+          gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
 
diff --git a/app/pdb/selection-cmds.c b/app/pdb/selection-cmds.c
index a5f9111..3ecb43f 100644
--- a/app/pdb/selection-cmds.c
+++ b/app/pdb/selection-cmds.c
@@ -190,7 +190,8 @@ selection_float_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
diff --git a/app/pdb/text-tool-cmds.c b/app/pdb/text-tool-cmds.c
index 485695e..2437192 100644
--- a/app/pdb/text-tool-cmds.c
+++ b/app/pdb/text-tool-cmds.c
@@ -72,7 +72,9 @@ text_fontname_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (drawable && ! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (drawable &&
+          (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+           ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
         success = FALSE;
 
       if (success)
@@ -194,7 +196,9 @@ text_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (drawable && ! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      if (drawable &&
+          (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+           ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
         success = FALSE;
 
       if (success)
diff --git a/app/pdb/vectors-cmds.c b/app/pdb/vectors-cmds.c
index 1a16458..7c49882 100644
--- a/app/pdb/vectors-cmds.c
+++ b/app/pdb/vectors-cmds.c
@@ -1121,7 +1121,8 @@ vectors_bezier_stroke_new_moveto_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error))
+      if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
         {
           GimpStroke *stroke;
           GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;
@@ -1339,7 +1340,8 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error))
+      if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
         {
           GimpStroke *stroke;
           GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;
diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb
index 8f9a819..bea3fdd 100644
--- a/tools/pdbgen/pdb/color.pdb
+++ b/tools/pdbgen/pdb/color.pdb
@@ -42,6 +42,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -94,6 +95,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable) ||
       (! gimp_drawable_has_alpha (drawable) &&
        channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -136,6 +138,7 @@ HELP
         code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -159,6 +162,7 @@ sub levels_auto {
         code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -192,6 +196,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -222,6 +227,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       ! gimp_drawable_is_rgb (drawable))
     success = FALSE;
 
@@ -259,6 +265,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       ! gimp_drawable_is_rgb (drawable))
     success = FALSE;
 
@@ -296,6 +303,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -327,6 +335,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -369,6 +378,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
       (! gimp_drawable_has_alpha (drawable) &&
        channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -415,6 +425,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
       (! gimp_drawable_has_alpha (drawable) &&
        channel == GIMP_HISTOGRAM_ALPHA) ||
@@ -466,6 +477,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -506,6 +518,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       ! gimp_drawable_is_rgb (drawable))
     success = FALSE;
 
@@ -633,6 +646,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable))
     success = FALSE;
 
@@ -670,6 +684,7 @@ HELP
 	code => <<'CODE'
 {
   if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
       gimp_drawable_is_indexed (drawable) ||
       (low_threshold > high_threshold))
     success = FALSE;
diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb
index dc36044..b25abed 100644
--- a/tools/pdbgen/pdb/drawable.pdb
+++ b/tools/pdbgen/pdb/drawable.pdb
@@ -71,7 +71,8 @@ HELP
                         "plug-in/gimppluginmanager.h") ],
 	code    => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       const gchar *undo_desc = _("Plug-In");
 
@@ -148,7 +149,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error))
+  if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     gimp_drawable_fill_by_type (drawable, context, (GimpFillType) fill_type);
   else
     success = FALSE;
@@ -1065,6 +1067,7 @@ HELP
 	code => <<'CODE'
 {
   if (gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
       x_coord < gimp_item_get_width  (GIMP_ITEM (drawable)) &&
       y_coord < gimp_item_get_height (GIMP_ITEM (drawable)) &&
       num_channels == gimp_drawable_bytes (drawable))
@@ -1309,7 +1312,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     gimp_drawable_offset (drawable, context, wrap_around, fill_type,
                           offset_x, offset_y);
   else
diff --git a/tools/pdbgen/pdb/drawable_transform.pdb b/tools/pdbgen/pdb/drawable_transform.pdb
index 3248462..90ae02a 100644
--- a/tools/pdbgen/pdb/drawable_transform.pdb
+++ b/tools/pdbgen/pdb/drawable_transform.pdb
@@ -165,10 +165,7 @@ HELP
 {
   gint x, y, width, height;
 
-  /*  group items are transformable even though they appear locked  */
-  success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error) &&
-             (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
-              gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error)));
+  success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
 
   if (success &&
       gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
@@ -465,10 +462,7 @@ HELP
 {
   gint x, y, width, height;
 
-  /*  group items are transformable even though they appear locked  */
-  success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error) &&
-             (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
-              gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error)));
+  success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), FALSE, error);
 
   if (success &&
       gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb
index 13a9e22..51946d0 100644
--- a/tools/pdbgen/pdb/edit.pdb
+++ b/tools/pdbgen/pdb/edit.pdb
@@ -46,7 +46,8 @@ HELP
     %invoke = (
 	code => <<CODE
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image    = gimp_item_get_image (GIMP_ITEM (drawable));
       GError    *my_error = NULL;
@@ -200,7 +201,8 @@ HELP
 	code => <<CODE
 {
   if (gimp->global_buffer &&
-      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
                                       drawable, gimp->global_buffer,
@@ -277,7 +279,8 @@ HELP
     %invoke = (
 	code => <<CODE
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image    = gimp_item_get_image (GIMP_ITEM (drawable));
       GError    *my_error = NULL;
@@ -435,7 +438,9 @@ HELP
 {
   GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
 
-  if (buffer && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (buffer &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
                                       drawable, buffer,
@@ -510,7 +515,8 @@ HELP
     %invoke = (
 	code => <<CODE
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
@@ -550,7 +556,8 @@ HELP
     %invoke = (
 	code => <<CODE
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
@@ -618,7 +625,8 @@ HELP
 	                 "core/gimpchannel.h") ],
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
       gboolean   do_seed_fill;
@@ -702,7 +710,8 @@ HELP
 	                 "core/gimpchannel.h") ],
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
       gboolean   do_seed_fill;
@@ -779,7 +788,8 @@ HELP
         headers => [ qw("core/gimpdrawable-blend.h") ],
 	code => <<'CODE'
 {
-  success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error);
+  success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+             gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
 
   if (success && supersample)
     {
@@ -835,7 +845,8 @@ HELP
 	headers => [ qw("core/gimpstrokeoptions.h") ],
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage         *image   = gimp_item_get_image (GIMP_ITEM (drawable));
       GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
@@ -879,6 +890,7 @@ HELP
 	code => <<'CODE'
 {
   if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
       gimp_pdb_item_is_attached (GIMP_ITEM (vectors), FALSE, error))
     {
       GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
diff --git a/tools/pdbgen/pdb/floating_sel.pdb b/tools/pdbgen/pdb/floating_sel.pdb
index ae0a8be..8be541f 100644
--- a/tools/pdbgen/pdb/floating_sel.pdb
+++ b/tools/pdbgen/pdb/floating_sel.pdb
@@ -150,7 +150,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     floating_sel_attach (layer, drawable);
   else
     success = FALSE;
diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb
index 8a3439f..e587511 100644
--- a/tools/pdbgen/pdb/layer.pdb
+++ b/tools/pdbgen/pdb/layer.pdb
@@ -343,10 +343,7 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  /*  group items are transformable even though they appear locked  */
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
-      (gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
-       gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
     {
       if (progress)
         gimp_progress_start (progress, _("Scaling"), FALSE);
@@ -397,10 +394,7 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  /*  group items are transformable even though they appear locked  */
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
-      (gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
-       gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
     {
       if (progress)
         gimp_progress_start (progress, _("Scaling"), FALSE);
@@ -552,7 +546,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
+  if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
     gimp_layer_add_alpha (layer);
   else
    success = FALSE;
@@ -583,7 +578,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error))
+  if (gimp_pdb_item_is_writable (GIMP_ITEM (layer), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
     gimp_layer_flatten (layer, context);
   else
    success = FALSE;
diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb
index b8ea5c3..1d916b3 100644
--- a/tools/pdbgen/pdb/paint_tools.pdb
+++ b/tools/pdbgen/pdb/paint_tools.pdb
@@ -54,7 +54,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -99,7 +101,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-airbrush", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -155,7 +159,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -204,7 +210,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-clone", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -245,7 +253,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -288,7 +298,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-convolve", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -332,7 +344,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -376,7 +390,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -425,7 +441,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-eraser", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -479,7 +497,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -524,7 +544,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-heal", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -576,7 +598,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -633,7 +657,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-paintbrush", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -673,7 +699,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-pencil", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -712,7 +740,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-smudge", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -757,7 +787,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-smudge", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -801,7 +833,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
@@ -848,7 +882,9 @@ HELP
 {
   GimpPaintInfo *info = gimp_pdb_get_paint_info (gimp, "gimp-dodge-burn", error);
 
-  if (info && gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (info &&
+      gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpPaintOptions *options = gimp_paint_options_new (info);
 
diff --git a/tools/pdbgen/pdb/paths.pdb b/tools/pdbgen/pdb/paths.pdb
index bee2fc7..f027c06 100644
--- a/tools/pdbgen/pdb/paths.pdb
+++ b/tools/pdbgen/pdb/paths.pdb
@@ -266,7 +266,8 @@ sub path_stroke_current {
   GimpDrawable *drawable = gimp_image_get_active_drawable (image);
 
   if (vectors && drawable &&
-      gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error))
+      gimp_pdb_item_is_writable (GIMP_ITEM (drawable), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context, TRUE);
 
diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb
index b166f3b..809579d 100644
--- a/tools/pdbgen/pdb/selection.pdb
+++ b/tools/pdbgen/pdb/selection.pdb
@@ -183,7 +183,8 @@ HELP
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
     {
       GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb
index 0f6472c..08caf28 100644
--- a/tools/pdbgen/pdb/text_tool.pdb
+++ b/tools/pdbgen/pdb/text_tool.pdb
@@ -72,7 +72,9 @@ HELP
     %invoke = (
         code => <<'CODE'
 {
-  if (drawable && ! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (drawable &&
+      (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+       ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
     success = FALSE;
 
   if (success)
@@ -192,7 +194,9 @@ sub text {
     %invoke = (
         code => <<'CODE'
 {
-  if (drawable && ! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error))
+  if (drawable &&
+      (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), TRUE, error) ||
+       ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
     success = FALSE;
 
   if (success)
diff --git a/tools/pdbgen/pdb/vectors.pdb b/tools/pdbgen/pdb/vectors.pdb
index 04ade6d..6e6e54b 100644
--- a/tools/pdbgen/pdb/vectors.pdb
+++ b/tools/pdbgen/pdb/vectors.pdb
@@ -1077,7 +1077,8 @@ HELP
     %invoke = (
         code => <<"CODE"
 {
-  if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error))
+  if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
     {
       GimpStroke *stroke;
       GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;
@@ -1300,7 +1301,8 @@ HELP
     %invoke = (
         code => <<"CODE"
 {
-  if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error))
+  if (gimp_pdb_item_is_writable (GIMP_ITEM (vectors), error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error))
     {
       GimpStroke *stroke;
       GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;



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