[gimp] app: another small cleanup in GimpImageMap
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: another small cleanup in GimpImageMap
- Date: Fri, 17 May 2013 21:41:26 +0000 (UTC)
commit 26ad350983a5ee0878a2c54cdef59d66aacbf93e
Author: Michael Natterer <mitch gimp org>
Date: Fri May 17 23:39:42 2013 +0200
app: another small cleanup in GimpImageMap
Factor out drawable updating to a utility function, and some misc
cleanup.
app/core/gimpimagemap.c | 49 ++++++++++++++++++++++------------------------
1 files changed, 23 insertions(+), 26 deletions(-)
---
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index be9f882..6c164c9 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -38,15 +38,12 @@
#include "core-types.h"
#include "gegl/gimpapplicator.h"
-#include "gegl/gimp-gegl-utils.h"
-#include "gimpdrawable.h"
+#include "gimpchannel.h"
#include "gimpdrawable-filter.h"
-#include "gimpfilter.h"
#include "gimpimage.h"
#include "gimpimagemap.h"
#include "gimpmarshal.h"
-#include "gimpchannel.h"
#include "gimpprogress.h"
@@ -75,11 +72,12 @@ struct _GimpImageMap
};
-static void gimp_image_map_dispose (GObject *object);
-static void gimp_image_map_finalize (GObject *object);
+static void gimp_image_map_dispose (GObject *object);
+static void gimp_image_map_finalize (GObject *object);
-static gboolean gimp_image_map_add_filter (GimpImageMap *image_map);
-static gboolean gimp_image_map_remove_filter (GimpImageMap *image_map);
+static gboolean gimp_image_map_add_filter (GimpImageMap *image_map);
+static gboolean gimp_image_map_remove_filter (GimpImageMap *image_map);
+static void gimp_image_map_update_drawable (GimpImageMap *image_map);
@@ -87,7 +85,7 @@ G_DEFINE_TYPE (GimpImageMap, gimp_image_map, GIMP_TYPE_OBJECT)
#define parent_class gimp_image_map_parent_class
-static guint image_map_signals[LAST_SIGNAL] = { 0 };
+static guint image_map_signals[LAST_SIGNAL] = { 0, };
static void
@@ -245,7 +243,7 @@ gimp_image_map_apply (GimpImageMap *image_map)
"operation", "gegl:translate",
NULL);
- input = gegl_node_get_input_proxy (filter_node, "input");
+ input = gegl_node_get_input_proxy (filter_node, "input");
if (gegl_node_has_pad (image_map->operation, "input") &&
gegl_node_has_pad (image_map->operation, "output"))
@@ -299,8 +297,6 @@ gimp_image_map_apply (GimpImageMap *image_map)
GIMP_REPLACE_MODE);
}
- gimp_image_map_add_filter (image_map);
-
gegl_node_set (image_map->translate,
"x", (gdouble) -image_map->filter_area.x,
"y", (gdouble) -image_map->filter_area.y,
@@ -342,13 +338,8 @@ gimp_image_map_apply (GimpImageMap *image_map)
-offset_x, -offset_y);
}
- gimp_drawable_update (image_map->drawable,
- image_map->filter_area.x,
- image_map->filter_area.y,
- image_map->filter_area.width,
- image_map->filter_area.height);
-
- g_signal_emit (image_map, image_map_signals[FLUSH], 0);
+ gimp_image_map_add_filter (image_map);
+ gimp_image_map_update_drawable (image_map);
}
void
@@ -375,13 +366,7 @@ gimp_image_map_abort (GimpImageMap *image_map)
if (gimp_image_map_remove_filter (image_map))
{
- gimp_drawable_update (image_map->drawable,
- image_map->filter_area.x,
- image_map->filter_area.y,
- image_map->filter_area.width,
- image_map->filter_area.height);
-
- g_signal_emit (image_map, image_map_signals[FLUSH], 0);
+ gimp_image_map_update_drawable (image_map);
}
}
@@ -422,3 +407,15 @@ gimp_image_map_remove_filter (GimpImageMap *image_map)
return FALSE;
}
+
+static void
+gimp_image_map_update_drawable (GimpImageMap *image_map)
+{
+ gimp_drawable_update (image_map->drawable,
+ image_map->filter_area.x,
+ image_map->filter_area.y,
+ image_map->filter_area.width,
+ image_map->filter_area.height);
+
+ g_signal_emit (image_map, image_map_signals[FLUSH], 0);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]