[gimp/goat-invasion: 22/608] app: always use GEGL to invert drawables



commit fdecca5841f9ea6a350be046da3dc648b210ac4b
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 14 10:26:33 2012 +0100

    app: always use GEGL to invert drawables
    
    and remove the now useless gimpdrawable-invert.[ch].

 app/actions/drawable-commands.c |    6 ++-
 app/core/Makefile.am            |    2 -
 app/core/gimpdrawable-invert.c  |   65 ---------------------------------------
 app/core/gimpdrawable-invert.h  |   26 ---------------
 app/core/gimplayer.c            |    1 -
 app/pdb/color-cmds.c            |   17 ++++++----
 tools/pdbgen/pdb/color.pdb      |   17 ++++++----
 7 files changed, 24 insertions(+), 110 deletions(-)
---
diff --git a/app/actions/drawable-commands.c b/app/actions/drawable-commands.c
index b0e5eb4..9191b26 100644
--- a/app/actions/drawable-commands.c
+++ b/app/actions/drawable-commands.c
@@ -26,8 +26,8 @@
 
 #include "core/gimp.h"
 #include "core/gimpdrawable-equalize.h"
-#include "core/gimpdrawable-invert.h"
 #include "core/gimpdrawable-levels.h"
+#include "core/gimpdrawable-operation.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-undo.h"
 #include "core/gimpitem-linked.h"
@@ -87,7 +87,9 @@ drawable_invert_cmd_callback (GtkAction *action,
       return;
     }
 
-  gimp_drawable_invert (drawable, GIMP_PROGRESS (display));
+  gimp_drawable_apply_operation_by_name (drawable, GIMP_PROGRESS (display),
+                                         _("Invert"), "gegl:invert",
+                                         NULL, TRUE);
   gimp_image_flush (image);
 }
 
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index b98a0d0..fbe0dcc 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -140,8 +140,6 @@ libappcore_a_sources = \
 	gimpdrawable-histogram.h		\
 	gimpdrawable-hue-saturation.c		\
 	gimpdrawable-hue-saturation.h		\
-	gimpdrawable-invert.c			\
-	gimpdrawable-invert.h			\
 	gimpdrawable-levels.c			\
 	gimpdrawable-levels.h			\
 	gimpdrawable-offset.c			\
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 5666d27..1853acf 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -40,7 +40,6 @@
 #include "gimpcontext.h"
 #include "gimpcontainer.h"
 #include "gimpdrawable-convert.h"
-#include "gimpdrawable-invert.h"
 #include "gimperror.h"
 #include "gimpimage-undo-push.h"
 #include "gimpimage-undo.h"
diff --git a/app/pdb/color-cmds.c b/app/pdb/color-cmds.c
index ca80b52..db1a130 100644
--- a/app/pdb/color-cmds.c
+++ b/app/pdb/color-cmds.c
@@ -30,7 +30,6 @@
 #include "core/gimpdrawable-equalize.h"
 #include "core/gimpdrawable-histogram.h"
 #include "core/gimpdrawable-hue-saturation.h"
-#include "core/gimpdrawable-invert.h"
 #include "core/gimpdrawable-levels.h"
 #include "core/gimpdrawable-operation.h"
 #include "core/gimpdrawable.h"
@@ -348,13 +347,17 @@ invert_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) ||
-          ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
-          gimp_drawable_is_indexed (drawable))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
+          ! gimp_drawable_is_indexed (drawable))
+        {
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 _("Invert"),
+                                                 "gegl:invert",
+                                                 NULL, TRUE);
+        }
+      else
         success = FALSE;
-
-      if (success)
-        gimp_drawable_invert (drawable, progress);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb
index 1c5d362..c56b816 100644
--- a/tools/pdbgen/pdb/color.pdb
+++ b/tools/pdbgen/pdb/color.pdb
@@ -361,16 +361,19 @@ HELP
     );
 
     %invoke = (
-	headers => [ qw("core/gimpdrawable-invert.h") ],
 	code => <<'CODE'
 {
-  if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) ||
-      ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
-      gimp_drawable_is_indexed (drawable))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
+      ! gimp_drawable_is_indexed (drawable))
+    {
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Invert"),
+                                             "gegl:invert",
+                                             NULL, TRUE);
+    }
+  else
     success = FALSE;
-
-  if (success)
-    gimp_drawable_invert (drawable, progress);
 }
 CODE
     );



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