[gimp/goat-invasion: 280/412] app: use below new function for shapeburst blend and cage tool progress



commit e5f85637df21ff7fe28d2d0465f2bb62b6579785
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 27 17:07:42 2012 +0200

    app: use below new function for shapeburst blend and cage tool progress

 app/core/gimpdrawable-blend.c |    5 +++++
 app/tools/gimpcagetool.c      |   32 ++------------------------------
 2 files changed, 7 insertions(+), 30 deletions(-)
---
diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c
index d67efad..8c723ec 100644
--- a/app/core/gimpdrawable-blend.c
+++ b/app/core/gimpdrawable-blend.c
@@ -555,6 +555,8 @@ gradient_precalc_shapeburst (GimpImage    *image,
   gdouble      max;
   gfloat       max_iteration;
 
+  gimp_progress_set_text (progress, _("Calculating distance map"));
+
   /*  allocate the distance map  */
   dist_buffer = gegl_buffer_new (GIMP_GEGL_RECT (0, 0, PR->w, PR->h),
                                  babl_format ("Y float"));
@@ -607,6 +609,8 @@ gradient_precalc_shapeburst (GimpImage    *image,
                                     "operation", "gimp:shapeburst",
                                     NULL);
 
+  gimp_gegl_progress_connect (shapeburst, progress, NULL);
+
   gimp_apply_operation (temp_buffer, NULL, NULL,
                         shapeburst,
                         dist_buffer, NULL);
@@ -930,6 +934,7 @@ gradient_fill_region (GimpImage        *image,
       rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy));
       rbd.dist_buffer = gradient_precalc_shapeburst (image, drawable,
                                                      PR, rbd.dist, progress);
+      gimp_progress_set_text (progress, _("Blending"));
       break;
 
     default:
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index bd9c752..b64381c 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -43,6 +43,7 @@
 #include "core/gimpprogress.h"
 #include "core/gimpprojection.h"
 
+#include "gegl/gimp-gegl-utils.h"
 #include "gegl/gimpcageconfig.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -1140,37 +1141,12 @@ gimp_cage_tool_compute_coef (GimpCageTool *ct)
 }
 
 static void
-gimp_cage_tool_transform_progress (GObject          *object,
-                                   const GParamSpec *pspec,
-                                   GimpCageTool     *ct)
-{
-  GimpProgress *progress = GIMP_PROGRESS (ct);
-  gdouble       value;
-
-  g_object_get (object, "progress", &value, NULL);
-
-  if (value == 0.0)
-    {
-      gimp_progress_start (progress, _("Cage Transform"), FALSE);
-    }
-  else if (value == 1.0)
-    {
-      gimp_progress_end (progress);
-    }
-  else
-    {
-      gimp_progress_set_value (progress, value);
-    }
-}
-
-static void
 gimp_cage_tool_create_render_node (GimpCageTool *ct)
 {
   GimpCageOptions *options  = GIMP_CAGE_TOOL_GET_OPTIONS (ct);
   GeglNode        *coef, *cage, *render; /* Render nodes */
   GeglNode        *input, *output; /* Proxy nodes*/
   GeglNode        *node; /* wraper to be returned */
-  GObject         *transform;
 
   g_return_if_fail (ct->render_node == NULL);
   /* render_node is not supposed to be recreated */
@@ -1214,11 +1190,7 @@ gimp_cage_tool_create_render_node (GimpCageTool *ct)
   ct->cage_node = cage;
   ct->coef_node = coef;
 
-  g_object_get (cage, "gegl-operation", &transform, NULL);
-  g_signal_connect (transform, "notify::progress",
-                    G_CALLBACK (gimp_cage_tool_transform_progress),
-                    ct);
-  g_object_unref (transform);
+  gimp_gegl_progress_connect (cage, GIMP_PROGRESS (ct), _("Cage Transform"));
 }
 
 static void



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