[gimp/goat-invasion: 483/526] app: don't use gimp_drawable_type() in more places



commit 20afb99cfcd96c20a3f6f01d90c1aa258561aa18
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 11 01:22:29 2012 +0200

    app: don't use gimp_drawable_type() in more places
    
    that talk to the outside world.

 app/pdb/drawable-cmds.c           |    2 +-
 app/plug-in/gimppluginprocedure.c |    8 +++++++-
 tools/pdbgen/pdb/drawable.pdb     |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/pdb/drawable-cmds.c b/app/pdb/drawable-cmds.c
index 21be798..8206bd8 100644
--- a/app/pdb/drawable-cmds.c
+++ b/app/pdb/drawable-cmds.c
@@ -63,7 +63,7 @@ drawable_type_invoker (GimpProcedure      *procedure,
 
   if (success)
     {
-      type = gimp_drawable_type (drawable);
+      type = gimp_babl_format_get_image_type (gimp_drawable_get_format (drawable));
     }
 
   return_vals = gimp_procedure_get_return_values (procedure, success,
diff --git a/app/plug-in/gimppluginprocedure.c b/app/plug-in/gimppluginprocedure.c
index 52a2b4b..8d3f6dd 100644
--- a/app/plug-in/gimppluginprocedure.c
+++ b/app/plug-in/gimppluginprocedure.c
@@ -28,6 +28,8 @@
 
 #include "plug-in-types.h"
 
+#include "gegl/gimp-gegl-utils.h"
+
 #include "core/gimp.h"
 #include "core/gimp-utils.h"
 #include "core/gimpdrawable.h"
@@ -687,7 +689,11 @@ gimp_plug_in_procedure_get_sensitive (const GimpPlugInProcedure *proc,
   g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), FALSE);
 
   if (drawable)
-    image_type = gimp_drawable_type (drawable);
+    {
+      const Babl *format = gimp_drawable_get_format (drawable);
+
+      image_type = gimp_babl_format_get_image_type (format);
+    }
 
   switch (image_type)
     {
diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb
index b419237..7cc6946 100644
--- a/tools/pdbgen/pdb/drawable.pdb
+++ b/tools/pdbgen/pdb/drawable.pdb
@@ -283,7 +283,7 @@ sub drawable_type {
     %invoke = (
 	code => <<'CODE'
 {
-  type = gimp_drawable_type (drawable);
+  type = gimp_babl_format_get_image_type (gimp_drawable_get_format (drawable));
 }
 CODE
     );



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