[gimp/goat-invasion: 21/526] app: rename gimp_drawable_apply_operation_with_config()



commit 6d90a2a940230158dc9a33028235b3945bb376b4
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 14 10:15:28 2012 +0100

    app: rename gimp_drawable_apply_operation_with_config()
    
    to gimp_drawable_apply_operation_by_name() and allow to pass
    a NULL config.

 app/core/gimpdrawable-operation.c |   21 ++++++++++---------
 app/core/gimpdrawable-operation.h |   34 +++++++++++++++---------------
 app/pdb/color-cmds.c              |   40 ++++++++++++++++++------------------
 tools/pdbgen/pdb/color.pdb        |   40 ++++++++++++++++++------------------
 4 files changed, 68 insertions(+), 67 deletions(-)
---
diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c
index 1d14bb5..b2ca141 100644
--- a/app/core/gimpdrawable-operation.c
+++ b/app/core/gimpdrawable-operation.c
@@ -88,12 +88,12 @@ gimp_drawable_apply_operation (GimpDrawable *drawable,
 }
 
 void
-gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
-                                           GimpProgress *progress,
-                                           const gchar  *undo_desc,
-                                           const gchar  *operation_type,
-                                           GObject      *config,
-                                           gboolean      linear)
+gimp_drawable_apply_operation_by_name (GimpDrawable *drawable,
+                                       GimpProgress *progress,
+                                       const gchar  *undo_desc,
+                                       const gchar  *operation_type,
+                                       GObject      *config,
+                                       gboolean      linear)
 {
   GeglNode *node;
 
@@ -102,15 +102,16 @@ gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
   g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
   g_return_if_fail (undo_desc != NULL);
   g_return_if_fail (operation_type != NULL);
-  g_return_if_fail (GIMP_IS_IMAGE_MAP_CONFIG (config));
+  g_return_if_fail (config == NULL || GIMP_IS_IMAGE_MAP_CONFIG (config));
 
   node = g_object_new (GEGL_TYPE_NODE,
                        "operation", operation_type,
                        NULL);
 
-  gegl_node_set (node,
-                 "config", config,
-                 NULL);
+  if (config)
+    gegl_node_set (node,
+                   "config", config,
+                   NULL);
 
   gimp_drawable_apply_operation (drawable, progress, undo_desc,
                                  node, TRUE);
diff --git a/app/core/gimpdrawable-operation.h b/app/core/gimpdrawable-operation.h
index 8997c31..5341454 100644
--- a/app/core/gimpdrawable-operation.h
+++ b/app/core/gimpdrawable-operation.h
@@ -24,24 +24,24 @@
 #define __GIMP_DRAWABLE_OPERATION_H__
 
 
-void   gimp_drawable_apply_operation             (GimpDrawable *drawable,
-                                                  GimpProgress *progress,
-                                                  const gchar  *undo_desc,
-                                                  GeglNode     *operation,
-                                                  gboolean      linear);
-void   gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
-                                                  GimpProgress *progress,
-                                                  const gchar  *undo_desc,
-                                                  const gchar  *operation_type,
-                                                  GObject      *config,
-                                                  gboolean      linear);
+void   gimp_drawable_apply_operation          (GimpDrawable *drawable,
+                                               GimpProgress *progress,
+                                               const gchar  *undo_desc,
+                                               GeglNode     *operation,
+                                               gboolean      linear);
+void   gimp_drawable_apply_operation_by_name  (GimpDrawable *drawable,
+                                               GimpProgress *progress,
+                                               const gchar  *undo_desc,
+                                               const gchar  *operation_type,
+                                               GObject      *config,
+                                               gboolean      linear);
 
-void   gimp_drawable_apply_operation_to_tiles    (GimpDrawable *drawable,
-                                                  GimpProgress *progress,
-                                                  const gchar  *undo_desc,
-                                                  GeglNode     *operation,
-                                                  gboolean      linear,
-                                                  TileManager  *new_tiles);
+void   gimp_drawable_apply_operation_to_tiles (GimpDrawable *drawable,
+                                               GimpProgress *progress,
+                                               const gchar  *undo_desc,
+                                               GeglNode     *operation,
+                                               gboolean      linear,
+                                               TileManager  *new_tiles);
 
 
 #endif /* __GIMP_DRAWABLE_OPERATION_H__ */
diff --git a/app/pdb/color-cmds.c b/app/pdb/color-cmds.c
index f34c638..ca80b52 100644
--- a/app/pdb/color-cmds.c
+++ b/app/pdb/color-cmds.c
@@ -210,10 +210,10 @@ posterize_invoker (GimpProcedure      *procedure,
                                           "levels", levels,
                                           NULL);
 
-          gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                     _("Posterize"),
-                                                     "gimp:posterize",
-                                                     config, TRUE);
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 _("Posterize"),
+                                                 "gimp:posterize",
+                                                 config, TRUE);
 
           g_object_unref (config);
         }
@@ -248,10 +248,10 @@ desaturate_invoker (GimpProcedure      *procedure,
                                           "mode", GIMP_DESATURATE_LIGHTNESS,
                                           NULL);
 
-          gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                     _("Desaturate"),
-                                                     "gimp:desaturate",
-                                                     config, TRUE);
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 _("Desaturate"),
+                                                 "gimp:desaturate",
+                                                 config, TRUE);
 
           g_object_unref (config);
         }
@@ -288,10 +288,10 @@ desaturate_full_invoker (GimpProcedure      *procedure,
                                           "mode", desaturate_mode,
                                           NULL);
 
-          gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                     _("Desaturate"),
-                                                     "gimp:desaturate",
-                                                     config, TRUE);
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 _("Desaturate"),
+                                                 "gimp:desaturate",
+                                                 config, TRUE);
 
           g_object_unref (config);
         }
@@ -511,10 +511,10 @@ colorize_invoker (GimpProcedure      *procedure,
                                           "lightness",  lightness  / 100.0,
                                           NULL);
 
-          gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                     C_("undo-type", "Colorize"),
-                                                     "gimp:colorize",
-                                                     config, TRUE);
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 C_("undo-type", "Colorize"),
+                                                 "gimp:colorize",
+                                                 config, TRUE);
 
           g_object_unref (config);
         }
@@ -664,10 +664,10 @@ threshold_invoker (GimpProcedure      *procedure,
                                           "high", high_threshold / 255.0,
                                           NULL);
 
-          gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                     _("Threshold"),
-                                                     "gimp:threshold",
-                                                     config, TRUE);
+          gimp_drawable_apply_operation_by_name (drawable, progress,
+                                                 _("Threshold"),
+                                                 "gimp:threshold",
+                                                 config, TRUE);
 
           g_object_unref (config);
         }
diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb
index 39666dd..1c5d362 100644
--- a/tools/pdbgen/pdb/color.pdb
+++ b/tools/pdbgen/pdb/color.pdb
@@ -203,10 +203,10 @@ HELP
                                       "levels", levels,
                                       NULL);
 
-      gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                 _("Posterize"),
-                                                 "gimp:posterize",
-                                                 config, TRUE);
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Posterize"),
+                                             "gimp:posterize",
+                                             config, TRUE);
 
       g_object_unref (config);
     }
@@ -244,10 +244,10 @@ HELP
                                       "mode", GIMP_DESATURATE_LIGHTNESS,
                                       NULL);
 
-      gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                 _("Desaturate"),
-                                                 "gimp:desaturate",
-                                                 config, TRUE);
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Desaturate"),
+                                             "gimp:desaturate",
+                                             config, TRUE);
 
       g_object_unref (config);
     }
@@ -292,10 +292,10 @@ HELP
                                       "mode", desaturate_mode,
                                       NULL);
 
-      gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                 _("Desaturate"),
-                                                 "gimp:desaturate",
-                                                 config, TRUE);
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Desaturate"),
+                                             "gimp:desaturate",
+                                             config, TRUE);
 
       g_object_unref (config);
     }
@@ -557,10 +557,10 @@ HELP
                                       "lightness",  lightness  / 100.0,
                                       NULL);
 
-      gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                 C_("undo-type", "Colorize"),
-                                                 "gimp:colorize",
-                                                 config, TRUE);
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             C_("undo-type", "Colorize"),
+                                             "gimp:colorize",
+                                             config, TRUE);
 
       g_object_unref (config);
     }
@@ -733,10 +733,10 @@ HELP
                                       "high", high_threshold / 255.0,
                                       NULL);
 
-      gimp_drawable_apply_operation_with_config (drawable, progress,
-                                                 _("Threshold"),
-                                                 "gimp:threshold",
-                                                 config, TRUE);
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Threshold"),
+                                             "gimp:threshold",
+                                             config, TRUE);
 
       g_object_unref (config);
     }



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