gimp r27986 - in trunk: . app/core



Author: mitch
Date: Thu Feb  5 20:27:09 2009
New Revision: 27986
URL: http://svn.gnome.org/viewvc/gimp?rev=27986&view=rev

Log:
2009-02-05  Michael Natterer  <mitch gimp org>

	* app/core/gimpdrawable.h
	* app/core/gimpdrawable-preview.c: move the preview related
	members to the private struct.

	* app/core/gimpdrawable.c
	* app/core/gimpdrawable-private.h
	* app/core/gimpselection.c: changed accordingly.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpdrawable-preview.c
   trunk/app/core/gimpdrawable-private.h
   trunk/app/core/gimpdrawable.c
   trunk/app/core/gimpdrawable.h
   trunk/app/core/gimpselection.c

Modified: trunk/app/core/gimpdrawable-preview.c
==============================================================================
--- trunk/app/core/gimpdrawable-preview.c	(original)
+++ trunk/app/core/gimpdrawable-preview.c	Thu Feb  5 20:27:09 2009
@@ -37,6 +37,7 @@
 #include "gimpchannel.h"
 #include "gimpimage.h"
 #include "gimpdrawable-preview.h"
+#include "gimpdrawable-private.h"
 #include "gimplayer.h"
 #include "gimppreviewcache.h"
 
@@ -74,7 +75,7 @@
     return NULL;
 
   /* Ok prime the cache with a large preview if the cache is invalid */
-  if (! drawable->preview_valid                                 &&
+  if (! drawable->private->preview_valid                        &&
       width  <= PREVIEW_CACHE_PRIME_WIDTH                       &&
       height <= PREVIEW_CACHE_PRIME_HEIGHT                      &&
       image                                                     &&
@@ -171,8 +172,8 @@
 {
   TempBuf *ret_buf;
 
-  if (! drawable->preview_valid ||
-      ! (ret_buf = gimp_preview_cache_get (&drawable->preview_cache,
+  if (! drawable->private->preview_valid ||
+      ! (ret_buf = gimp_preview_cache_get (&drawable->private->preview_cache,
                                            width, height)))
     {
       GimpItem *item = GIMP_ITEM (drawable);
@@ -184,12 +185,12 @@
                                                width,
                                                height);
 
-      if (! drawable->preview_valid)
-        gimp_preview_cache_invalidate (&drawable->preview_cache);
+      if (! drawable->private->preview_valid)
+        gimp_preview_cache_invalidate (&drawable->private->preview_cache);
 
-      drawable->preview_valid = TRUE;
+      drawable->private->preview_valid = TRUE;
 
-      gimp_preview_cache_add (&drawable->preview_cache, ret_buf);
+      gimp_preview_cache_add (&drawable->private->preview_cache, ret_buf);
     }
 
   return ret_buf;

Modified: trunk/app/core/gimpdrawable-private.h
==============================================================================
--- trunk/app/core/gimpdrawable-private.h	(original)
+++ trunk/app/core/gimpdrawable-private.h	Thu Feb  5 20:27:09 2009
@@ -30,6 +30,9 @@
   GeglNode    *fs_mode_node;
 
   GeglNode    *mode_node;
+
+  GSList      *preview_cache; /* preview caches of the channel */
+  gboolean     preview_valid; /* is the preview valid?         */
 };
 
 #endif /* __GIMP_DRAWABLE_PRIVATE_H__ */

Modified: trunk/app/core/gimpdrawable.c
==============================================================================
--- trunk/app/core/gimpdrawable.c	(original)
+++ trunk/app/core/gimpdrawable.c	Thu Feb  5 20:27:09 2009
@@ -233,15 +233,13 @@
 static void
 gimp_drawable_init (GimpDrawable *drawable)
 {
-  drawable->private       = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
-                                                         GIMP_TYPE_DRAWABLE,
-                                                         GimpDrawablePrivate);
-
-  drawable->bytes         = 0;
-  drawable->type          = -1;
-  drawable->has_alpha     = FALSE;
-  drawable->preview_cache = NULL;
-  drawable->preview_valid = FALSE;
+  drawable->private   = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
+                                                     GIMP_TYPE_DRAWABLE,
+                                                     GimpDrawablePrivate);
+
+  drawable->bytes     = 0;
+  drawable->type      = -1;
+  drawable->has_alpha = FALSE;
 }
 
 /* sorry for the evil casts */
@@ -278,8 +276,8 @@
       drawable->private->source_node = NULL;
     }
 
-  if (drawable->preview_cache)
-    gimp_preview_cache_invalidate (&drawable->preview_cache);
+  if (drawable->private->preview_cache)
+    gimp_preview_cache_invalidate (&drawable->private->preview_cache);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -295,7 +293,7 @@
                                        FALSE);
   memsize += tile_manager_get_memsize (drawable->private->shadow, FALSE);
 
-  *gui_size += gimp_preview_cache_get_memsize (drawable->preview_cache);
+  *gui_size += gimp_preview_cache_get_memsize (drawable->private->preview_cache);
 
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
@@ -322,10 +320,10 @@
   if (GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview)
     GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable);
 
-  drawable->preview_valid = FALSE;
+  drawable->private->preview_valid = FALSE;
 
-  if (drawable->preview_cache)
-    gimp_preview_cache_invalidate (&drawable->preview_cache);
+  if (drawable->private->preview_cache)
+    gimp_preview_cache_invalidate (&drawable->private->preview_cache);
 }
 
 static void
@@ -1080,8 +1078,8 @@
   drawable->private->tiles = tile_manager_new (width, height, drawable->bytes);
 
   /*  preview variables  */
-  drawable->preview_cache = NULL;
-  drawable->preview_valid = FALSE;
+  drawable->private->preview_cache = NULL;
+  drawable->private->preview_valid = FALSE;
 
   gimp_drawable_update_tile_source_node (drawable);
 }

Modified: trunk/app/core/gimpdrawable.h
==============================================================================
--- trunk/app/core/gimpdrawable.h	(original)
+++ trunk/app/core/gimpdrawable.h	Thu Feb  5 20:27:09 2009
@@ -41,10 +41,6 @@
   GimpImageType  type;               /* type of drawable               */
   gboolean       has_alpha;          /* drawable has alpha             */
 
-  /*  Preview variables  */
-  GSList        *preview_cache;      /* preview caches of the channel  */
-  gboolean       preview_valid;      /* is the preview valid?          */
-
   GimpDrawablePrivate *private;
 };
 

Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c	(original)
+++ trunk/app/core/gimpselection.c	Thu Feb  5 20:27:09 2009
@@ -31,6 +31,7 @@
 
 #include "gimp.h"
 #include "gimpcontext.h"
+#include "gimpdrawable-private.h"
 #include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-undo.h"
@@ -311,7 +312,7 @@
                           gimp_item_get_height (GIMP_ITEM (layer)));
 
   /*  invalidate the preview  */
-  drawable->preview_valid = FALSE;
+  drawable->private->preview_valid = FALSE;
 }
 
 static gboolean



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