gimp r27560 - in trunk: . app/core app/file



Author: mitch
Date: Wed Nov  5 20:48:59 2008
New Revision: 27560
URL: http://svn.gnome.org/viewvc/gimp?rev=27560&view=rev

Log:
2008-11-05  Michael Natterer  <mitch gimp org>

	* app/core/gimpdrawablestack.[ch]: add new function
	gimp_drawable_stack_invalidate_previews() which does just what it
	says.

	* app/core/gimpimage.[ch]: merge invalidate_layer_previews() and
	invalidate_channels_previews() into a single invalidate_previews()
	and replace all calls to the old functions by calls to
	gimp_drawable_stack_invalidate_previews().

	* app/file/file-open.c: changed accordingly.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpdrawablestack.c
   trunk/app/core/gimpdrawablestack.h
   trunk/app/core/gimpimage.c
   trunk/app/core/gimpimage.h
   trunk/app/file/file-open.c

Modified: trunk/app/core/gimpdrawablestack.c
==============================================================================
--- trunk/app/core/gimpdrawablestack.c	(original)
+++ trunk/app/core/gimpdrawablestack.c	Wed Nov  5 20:48:59 2008
@@ -281,6 +281,16 @@
   return stack->graph;
 }
 
+void
+gimp_drawable_stack_invalidate_previews (GimpDrawableStack *stack)
+{
+  g_return_if_fail (GIMP_IS_DRAWABLE_STACK (stack));
+
+  gimp_container_foreach (GIMP_CONTAINER (stack),
+                          (GFunc) gimp_viewable_invalidate_preview,
+                          NULL);
+}
+
 
 /*  private functions  */
 

Modified: trunk/app/core/gimpdrawablestack.h
==============================================================================
--- trunk/app/core/gimpdrawablestack.h	(original)
+++ trunk/app/core/gimpdrawablestack.h	Wed Nov  5 20:48:59 2008
@@ -53,10 +53,12 @@
 };
 
 
-GType           gimp_drawable_stack_get_type  (void) G_GNUC_CONST;
-GimpContainer * gimp_drawable_stack_new       (GType              drawable_type);
+GType           gimp_drawable_stack_get_type            (void) G_GNUC_CONST;
+GimpContainer * gimp_drawable_stack_new                 (GType              drawable_type);
 
-GeglNode      * gimp_drawable_stack_get_graph (GimpDrawableStack *stack);
+GeglNode      * gimp_drawable_stack_get_graph           (GimpDrawableStack *stack);
+
+void            gimp_drawable_stack_invalidate_previews (GimpDrawableStack *stack);
 
 
 #endif  /*  __GIMP_DRAWABLE_STACK_H__  */

Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c	(original)
+++ trunk/app/core/gimpimage.c	Wed Nov  5 20:48:59 2008
@@ -736,11 +736,11 @@
                     image);
 
   g_signal_connect_object (config, "notify::transparency-type",
-                           G_CALLBACK (gimp_image_invalidate_layer_previews),
-                           image, G_CONNECT_SWAPPED);
+                           G_CALLBACK (gimp_drawable_stack_invalidate_previews),
+                           image->layers, G_CONNECT_SWAPPED);
   g_signal_connect_object (config, "notify::transparency-size",
-                           G_CALLBACK (gimp_image_invalidate_layer_previews),
-                           image, G_CONNECT_SWAPPED);
+                           G_CALLBACK (gimp_drawable_stack_invalidate_previews),
+                           image->layers, G_CONNECT_SWAPPED);
   g_signal_connect_object (config, "notify::layer-previews",
                            G_CALLBACK (gimp_viewable_size_changed),
                            image, G_CONNECT_SWAPPED);
@@ -1136,7 +1136,7 @@
                          gimp_image_get_width  (image),
                          gimp_image_get_height (image));
 
-      gimp_image_invalidate_layer_previews (image);
+      gimp_drawable_stack_invalidate_previews (GIMP_DRAWABLE_STACK (image->layers));
     }
 }
 
@@ -3799,21 +3799,10 @@
 }
 
 void
-gimp_image_invalidate_layer_previews (GimpImage *image)
-{
-  g_return_if_fail (GIMP_IS_IMAGE (image));
-
-  gimp_container_foreach (image->layers,
-                          (GFunc) gimp_viewable_invalidate_preview,
-                          NULL);
-}
-
-void
-gimp_image_invalidate_channel_previews (GimpImage *image)
+gimp_image_invalidate_previews (GimpImage *image)
 {
   g_return_if_fail (GIMP_IS_IMAGE (image));
 
-  gimp_container_foreach (image->channels,
-                          (GFunc) gimp_viewable_invalidate_preview,
-                          NULL);
+  gimp_drawable_stack_invalidate_previews (GIMP_DRAWABLE_STACK (image->layers));
+  gimp_drawable_stack_invalidate_previews (GIMP_DRAWABLE_STACK (image->channels));
 }

Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h	(original)
+++ trunk/app/core/gimpimage.h	Wed Nov  5 20:48:59 2008
@@ -551,8 +551,7 @@
                                                   gboolean            sample_merged,
                                                   gboolean            selected_only);
 
-void        gimp_image_invalidate_layer_previews (GimpImage          *image);
-void      gimp_image_invalidate_channel_previews (GimpImage          *image);
+void            gimp_image_invalidate_previews   (GimpImage          *image);
 
 
 #endif /* __GIMP_IMAGE_H__ */

Modified: trunk/app/file/file-open.c
==============================================================================
--- trunk/app/file/file-open.c	(original)
+++ trunk/app/file/file-open.c	Wed Nov  5 20:48:59 2008
@@ -552,8 +552,7 @@
   gimp_image_flush (image);
 
   /* same for drawable previews */
-  gimp_image_invalidate_layer_previews (image);
-  gimp_image_invalidate_channel_previews (image);
+  gimp_image_invalidate_previews (image);
 }
 
 /* Converts items from one image to another */



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