[gimp/goat-invasion: 12/608] app: remove the legacy colorize code



commit 34625138a411a5c2aae49ad5a926e19103ff3a49
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 14 00:44:46 2012 +0100

    app: remove the legacy colorize code

 app/base/Makefile.am             |    2 -
 app/base/colorize.c              |  134 --------------------------------------
 app/base/colorize.h              |   45 -------------
 app/core/gimpdrawable-colorize.c |   47 ++++----------
 app/gegl/gimpcolorizeconfig.c    |   20 ------
 app/gegl/gimpcolorizeconfig.h    |    4 -
 app/tools/gimpcolorizetool.c     |   35 ----------
 app/tools/gimpcolorizetool.h     |    1 -
 8 files changed, 13 insertions(+), 275 deletions(-)
---
diff --git a/app/base/Makefile.am b/app/base/Makefile.am
index 8f55bdc..7ac4ed0 100644
--- a/app/base/Makefile.am
+++ b/app/base/Makefile.am
@@ -26,8 +26,6 @@ libappbase_a_SOURCES = \
 	boundary.h		\
 	color-balance.c		\
 	color-balance.h		\
-	colorize.c		\
-	colorize.h		\
 	cpercep.c		\
 	cpercep.h		\
 	curves.c		\
diff --git a/app/core/gimpdrawable-colorize.c b/app/core/gimpdrawable-colorize.c
index 148d605..2b7a331 100644
--- a/app/core/gimpdrawable-colorize.c
+++ b/app/core/gimpdrawable-colorize.c
@@ -21,18 +21,11 @@
 
 #include "core-types.h"
 
-#include "base/colorize.h"
-
 #include "gegl/gimpcolorizeconfig.h"
 
-/* temp */
-#include "gimp.h"
-#include "gimpimage.h"
-
 #include "gimpdrawable.h"
 #include "gimpdrawable-operation.h"
 #include "gimpdrawable-colorize.h"
-#include "gimpdrawable-process.h"
 
 #include "gimp-intl.h"
 
@@ -46,44 +39,30 @@ gimp_drawable_colorize (GimpDrawable *drawable,
                         gdouble       saturation,
                         gdouble       lightness)
 {
-  GimpColorizeConfig *config;
+  GeglNode *node;
+  GObject  *config;
 
   g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
   g_return_if_fail (! gimp_drawable_is_indexed (drawable));
   g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
 
+  node = g_object_new (GEGL_TYPE_NODE,
+                       "operation", "gimp:colorize",
+                       NULL);
+
   config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
                          "hue",        hue        / 360.0,
                          "saturation", saturation / 100.0,
                          "lightness",  lightness  / 100.0,
                          NULL);
 
-  if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
-    {
-      GeglNode *node;
-
-      node = g_object_new (GEGL_TYPE_NODE,
-                           "operation", "gimp:colorize",
-                           NULL);
-      gegl_node_set (node,
-                     "config", config,
-                     NULL);
-
-      gimp_drawable_apply_operation (drawable, progress, C_("undo-type", "Colorize"),
-                                     node, TRUE);
-      g_object_unref (node);
-    }
-  else
-    {
-      Colorize cruft;
-
-      colorize_init (&cruft);
-
-      gimp_colorize_config_to_cruft (config, &cruft);
-
-      gimp_drawable_process (drawable, progress, C_("undo-type", "Colorize"),
-                             (PixelProcessorFunc) colorize, &cruft);
-    }
+  gegl_node_set (node,
+                 "config", config,
+                 NULL);
 
   g_object_unref (config);
+
+  gimp_drawable_apply_operation (drawable, progress, C_("undo-type", "Colorize"),
+                                 node, TRUE);
+  g_object_unref (node);
 }
diff --git a/app/gegl/gimpcolorizeconfig.c b/app/gegl/gimpcolorizeconfig.c
index 5d31bfe..8f6e947 100644
--- a/app/gegl/gimpcolorizeconfig.c
+++ b/app/gegl/gimpcolorizeconfig.c
@@ -26,9 +26,6 @@
 
 #include "gimp-gegl-types.h"
 
-/*  temp cruft  */
-#include "base/colorize.h"
-
 #include "gimpcolorizeconfig.h"
 
 
@@ -145,20 +142,3 @@ gimp_colorize_config_set_property (GObject      *object,
       break;
     }
 }
-
-
-/*  temp cruft  */
-
-void
-gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
-                               Colorize           *cruft)
-{
-  g_return_if_fail (GIMP_IS_COLORIZE_CONFIG (config));
-  g_return_if_fail (cruft != NULL);
-
-  cruft->hue        = config->hue        * 360.0;
-  cruft->saturation = config->saturation * 100.0;
-  cruft->lightness  = config->lightness  * 100.0;
-
-  colorize_calculate (cruft);
-}
diff --git a/app/gegl/gimpcolorizeconfig.h b/app/gegl/gimpcolorizeconfig.h
index 242f2bb..270e6e7 100644
--- a/app/gegl/gimpcolorizeconfig.h
+++ b/app/gegl/gimpcolorizeconfig.h
@@ -52,9 +52,5 @@ struct _GimpColorizeConfigClass
 
 GType   gimp_colorize_config_get_type (void) G_GNUC_CONST;
 
-/*  temp cruft  */
-void    gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
-                                       Colorize           *cruft);
-
 
 #endif /* __GIMP_COLORIZE_CONFIG_H__ */
diff --git a/app/tools/gimpcolorizetool.c b/app/tools/gimpcolorizetool.c
index 41743b5..8915c77 100644
--- a/app/tools/gimpcolorizetool.c
+++ b/app/tools/gimpcolorizetool.c
@@ -27,8 +27,6 @@
 
 #include "tools-types.h"
 
-#include "base/colorize.h"
-
 #include "gegl/gimpcolorizeconfig.h"
 
 #include "core/gimpdrawable.h"
@@ -51,15 +49,12 @@
 
 /*  local function prototypes  */
 
-static void       gimp_colorize_tool_finalize      (GObject          *object);
-
 static gboolean   gimp_colorize_tool_initialize    (GimpTool         *tool,
                                                     GimpDisplay      *display,
                                                     GError          **error);
 
 static GeglNode * gimp_colorize_tool_get_operation (GimpImageMapTool *im_tool,
                                                     GObject         **config);
-static void       gimp_colorize_tool_map           (GimpImageMapTool *im_tool);
 static void       gimp_colorize_tool_dialog        (GimpImageMapTool *im_tool);
 
 static void       gimp_colorize_tool_config_notify (GObject          *object,
@@ -98,12 +93,9 @@ gimp_colorize_tool_register (GimpToolRegisterCallback  callback,
 static void
 gimp_colorize_tool_class_init (GimpColorizeToolClass *klass)
 {
-  GObjectClass          *object_class  = G_OBJECT_CLASS (klass);
   GimpToolClass         *tool_class    = GIMP_TOOL_CLASS (klass);
   GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
 
-  object_class->finalize             = gimp_colorize_tool_finalize;
-
   tool_class->initialize             = gimp_colorize_tool_initialize;
 
   im_tool_class->dialog_desc         = _("Colorize the Image");
@@ -112,31 +104,12 @@ gimp_colorize_tool_class_init (GimpColorizeToolClass *klass)
   im_tool_class->export_dialog_title = _("Export Colorize Settings");
 
   im_tool_class->get_operation       = gimp_colorize_tool_get_operation;
-  im_tool_class->map                 = gimp_colorize_tool_map;
   im_tool_class->dialog              = gimp_colorize_tool_dialog;
 }
 
 static void
 gimp_colorize_tool_init (GimpColorizeTool *col_tool)
 {
-  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (col_tool);
-
-  col_tool->colorize = g_slice_new0 (Colorize);
-
-  colorize_init (col_tool->colorize);
-
-  im_tool->apply_func = (GimpImageMapApplyFunc) colorize;
-  im_tool->apply_data = col_tool->colorize;
-}
-
-static void
-gimp_colorize_tool_finalize (GObject *object)
-{
-  GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (object);
-
-  g_slice_free (Colorize, col_tool->colorize);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static gboolean
@@ -196,14 +169,6 @@ gimp_colorize_tool_get_operation (GimpImageMapTool  *im_tool,
   return node;
 }
 
-static void
-gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
-{
-  GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
-
-  gimp_colorize_config_to_cruft (col_tool->config, col_tool->colorize);
-}
-
 
 /***************************/
 /*  Hue-Saturation dialog  */
diff --git a/app/tools/gimpcolorizetool.h b/app/tools/gimpcolorizetool.h
index 03493aa..15d9a25 100644
--- a/app/tools/gimpcolorizetool.h
+++ b/app/tools/gimpcolorizetool.h
@@ -38,7 +38,6 @@ struct _GimpColorizeTool
   GimpImageMapTool    parent_instance;
 
   GimpColorizeConfig *config;
-  Colorize           *colorize;
 
   /*  dialog  */
   GtkAdjustment      *hue_data;



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