gimp r27556 - in trunk: . app/core
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27556 - in trunk: . app/core
- Date: Tue, 4 Nov 2008 23:22:45 +0000 (UTC)
Author: mitch
Date: Tue Nov 4 23:22:45 2008
New Revision: 27556
URL: http://svn.gnome.org/viewvc/gimp?rev=27556&view=rev
Log:
2008-11-05 Michael Natterer <mitch gimp org>
* app/core/gimpprojectable.[ch]: add signal "structure-changed"
and API to emit it.
* app/core/gimpimage.c: emit it when the image emits
"mode-changed" and "size-changed".
* app/core/gimpprojection.c: connect to the new signal instead of
"mode-changed" and "size-changed" to get rid of one more image
dependency.
Modified:
trunk/ChangeLog
trunk/app/core/gimpimage.c
trunk/app/core/gimpprojectable.c
trunk/app/core/gimpprojectable.h
trunk/app/core/gimpprojection.c
Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c (original)
+++ trunk/app/core/gimpimage.c Tue Nov 4 23:22:45 2008
@@ -156,6 +156,8 @@
static void gimp_image_size_changed (GimpViewable *viewable);
static gchar * gimp_image_get_description (GimpViewable *viewable,
gchar **tooltip);
+
+static void gimp_image_real_mode_changed (GimpImage *image);
static void gimp_image_real_size_changed_detailed
(GimpImage *image,
gint previous_origin_x,
@@ -491,7 +493,7 @@
viewable_class->get_new_preview = gimp_image_get_new_preview;
viewable_class->get_description = gimp_image_get_description;
- klass->mode_changed = NULL;
+ klass->mode_changed = gimp_image_real_mode_changed;
klass->alpha_changed = NULL;
klass->floating_selection_changed = NULL;
klass->active_layer_changed = NULL;
@@ -1067,6 +1069,8 @@
}
gimp_viewable_size_changed (GIMP_VIEWABLE (gimp_image_get_mask (image)));
+
+ gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
}
static gchar *
@@ -1093,6 +1097,12 @@
}
static void
+gimp_image_real_mode_changed (GimpImage *image)
+{
+ gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
+}
+
+static void
gimp_image_real_size_changed_detailed (GimpImage *image,
gint previous_origin_x,
gint previous_origin_y,
Modified: trunk/app/core/gimpprojectable.c
==============================================================================
--- trunk/app/core/gimpprojectable.c (original)
+++ trunk/app/core/gimpprojectable.c Tue Nov 4 23:22:45 2008
@@ -34,6 +34,7 @@
{
UPDATE,
FLUSH,
+ STRUCTURE_CHANGED,
LAST_SIGNAL
};
@@ -102,6 +103,15 @@
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
+ projectable_signals[STRUCTURE_CHANGED] =
+ g_signal_new ("structure-changed",
+ G_TYPE_FROM_CLASS (iface),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GimpProjectableInterface, structure_changed),
+ NULL, NULL,
+ gimp_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
initialized = TRUE;
}
}
@@ -132,6 +142,14 @@
preview_invalidated);
}
+void
+gimp_projectable_structure_changed (GimpProjectable *projectable)
+{
+ g_return_if_fail (GIMP_IS_PROJECTABLE (projectable));
+
+ g_signal_emit (projectable, projectable_signals[STRUCTURE_CHANGED], 0);
+}
+
GimpImage *
gimp_projectable_get_image (GimpProjectable *projectable)
{
Modified: trunk/app/core/gimpprojectable.h
==============================================================================
--- trunk/app/core/gimpprojectable.h (original)
+++ trunk/app/core/gimpprojectable.h Tue Nov 4 23:22:45 2008
@@ -43,6 +43,7 @@
gint height);
void (* flush) (GimpProjectable *projectable,
gboolean invalidate_preview);
+ void (* structure_changed) (GimpProjectable *projectable);
/* virtual functions */
GimpImage * (* get_image) (GimpProjectable *projectable);
@@ -60,6 +61,7 @@
gint height);
void gimp_projectable_flush (GimpProjectable *projectable,
gboolean preview_invalidated);
+void gimp_projectable_structure_changed (GimpProjectable *projectable);
GimpImage * gimp_projectable_get_image (GimpProjectable *projectable);
GeglNode * gimp_projectable_get_graph (GimpProjectable *projectable);
Modified: trunk/app/core/gimpprojection.c
==============================================================================
--- trunk/app/core/gimpprojection.c (original)
+++ trunk/app/core/gimpprojection.c Tue Nov 4 23:22:45 2008
@@ -110,7 +110,7 @@
static void gimp_projection_projectable_flush (GimpProjectable *projectable,
gboolean invalidate_preview,
GimpProjection *proj);
-static void gimp_projection_image_changed (GimpImage *image,
+static void gimp_projection_projectable_changed (GimpProjectable *projectable,
GimpProjection *proj);
@@ -345,7 +345,6 @@
gimp_projection_new (GimpProjectable *projectable)
{
GimpProjection *proj;
- GimpImage *image;
g_return_val_if_fail (GIMP_IS_PROJECTABLE (projectable), NULL);
@@ -359,14 +358,8 @@
g_signal_connect_object (projectable, "flush",
G_CALLBACK (gimp_projection_projectable_flush),
proj, 0);
-
- image = gimp_projectable_get_image (projectable);
-
- g_signal_connect_object (image, "size-changed",
- G_CALLBACK (gimp_projection_image_changed),
- proj, 0);
- g_signal_connect_object (image, "mode-changed",
- G_CALLBACK (gimp_projection_image_changed),
+ g_signal_connect_object (projectable, "structure-changed",
+ G_CALLBACK (gimp_projection_projectable_changed),
proj, 0);
return proj;
@@ -789,8 +782,8 @@
}
static void
-gimp_projection_image_changed (GimpImage *image,
- GimpProjection *proj)
+gimp_projection_projectable_changed (GimpProjectable *projectable,
+ GimpProjection *proj)
{
gint width, height;
@@ -800,7 +793,7 @@
proj->pyramid = NULL;
}
- gimp_viewable_get_size (GIMP_VIEWABLE (image), &width, &height);
+ gimp_viewable_get_size (GIMP_VIEWABLE (projectable), &width, &height);
gimp_projection_add_update_area (proj, 0, 0, width, height);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]