[gimp] app: move drawable->type to private
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: move drawable->type to private
- Date: Wed, 16 Mar 2011 01:03:02 +0000 (UTC)
commit 9f30550f9a629d12d79d73323ef2b57ca0cd76a4
Author: Michael Natterer <mitch gimp org>
Date: Wed Mar 16 02:01:24 2011 +0100
app: move drawable->type to private
app/core/gimpdrawable-private.h | 24 +++++++++++++-----------
app/core/gimpdrawable.c | 24 +++++++++++-------------
app/core/gimpdrawable.h | 4 +---
app/core/gimpgrouplayer.c | 3 ++-
app/text/gimptextlayer-xcf.c | 3 +--
app/xcf/xcf-load.c | 2 +-
6 files changed, 29 insertions(+), 31 deletions(-)
---
diff --git a/app/core/gimpdrawable-private.h b/app/core/gimpdrawable-private.h
index d715057..7a0edbb 100644
--- a/app/core/gimpdrawable-private.h
+++ b/app/core/gimpdrawable-private.h
@@ -20,21 +20,23 @@
struct _GimpDrawablePrivate
{
- TileManager *tiles; /* tiles for drawable data */
- TileManager *shadow; /* shadow buffer tiles */
+ GimpImageType type; /* type of drawable */
- GeglNode *source_node;
- GeglNode *tile_source_node;
+ TileManager *tiles; /* tiles for drawable data */
+ TileManager *shadow; /* shadow buffer tiles */
- GeglNode *fs_crop_node;
- GeglNode *fs_opacity_node;
- GeglNode *fs_offset_node;
- GeglNode *fs_mode_node;
+ GeglNode *source_node;
+ GeglNode *tile_source_node;
- GeglNode *mode_node;
+ GeglNode *fs_crop_node;
+ GeglNode *fs_opacity_node;
+ GeglNode *fs_offset_node;
+ GeglNode *fs_mode_node;
- GSList *preview_cache; /* preview caches of the channel */
- gboolean preview_valid; /* is the preview valid? */
+ GeglNode *mode_node;
+
+ GSList *preview_cache; /* preview caches of the channel */
+ gboolean preview_valid; /* is the preview valid? */
};
#endif /* __GIMP_DRAWABLE_PRIVATE_H__ */
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 935aa16..d948830 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -258,7 +258,7 @@ gimp_drawable_init (GimpDrawable *drawable)
GIMP_TYPE_DRAWABLE,
GimpDrawablePrivate);
- drawable->type = -1;
+ drawable->private->type = -1;
}
/* sorry for the evil casts */
@@ -417,7 +417,7 @@ gimp_drawable_duplicate (GimpItem *item,
gimp_item_get_offset (item, &offset_x, &offset_y);
- new_drawable->type = image_type;
+ new_drawable->private->type = image_type;
if (new_drawable->private->tiles)
tile_manager_unref (new_drawable->private->tiles);
@@ -425,7 +425,7 @@ gimp_drawable_duplicate (GimpItem *item,
new_drawable->private->tiles =
tile_manager_new (gimp_item_get_width (new_item),
gimp_item_get_height (new_item),
- GIMP_IMAGE_TYPE_BYTES (new_drawable->type));
+ gimp_drawable_bytes (new_drawable));
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
@@ -457,7 +457,7 @@ gimp_drawable_scale (GimpItem *item,
TileManager *new_tiles;
new_tiles = tile_manager_new (new_width, new_height,
- GIMP_IMAGE_TYPE_BYTES (drawable->type));
+ gimp_drawable_bytes (drawable));
GIMP_TIMER_START ();
@@ -560,7 +560,7 @@ gimp_drawable_resize (GimpItem *item,
©_height);
new_tiles = tile_manager_new (new_width, new_height,
- GIMP_IMAGE_TYPE_BYTES (drawable->type));
+ gimp_drawable_bytes (drawable));
/* Determine whether the new tiles need to be initially cleared */
if (copy_width != new_width ||
@@ -829,7 +829,7 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
tile_manager_unref (drawable->private->tiles);
drawable->private->tiles = tiles;
- drawable->type = type;
+ drawable->private->type = type;
gimp_item_set_offset (item, offset_x, offset_y);
gimp_item_set_size (item,
@@ -1197,11 +1197,9 @@ gimp_drawable_new (GType type,
offset_x, offset_y,
width, height));
- drawable->type = image_type;
-
- drawable->private->tiles =
- tile_manager_new (width, height,
- GIMP_IMAGE_TYPE_BYTES (drawable->type));
+ drawable->private->type = image_type;
+ drawable->private->tiles = tile_manager_new (width, height,
+ gimp_drawable_bytes (drawable));
return drawable;
}
@@ -1749,7 +1747,7 @@ gimp_drawable_type (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
- return drawable->type;
+ return drawable->private->type;
}
GimpImageType
@@ -1797,7 +1795,7 @@ gimp_drawable_bytes (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
- return GIMP_IMAGE_TYPE_BYTES (drawable->type);
+ return GIMP_IMAGE_TYPE_BYTES (drawable->private->type);
}
gint
diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h
index 4fe2375..5f3faec 100644
--- a/app/core/gimpdrawable.h
+++ b/app/core/gimpdrawable.h
@@ -35,9 +35,7 @@ typedef struct _GimpDrawableClass GimpDrawableClass;
struct _GimpDrawable
{
- GimpItem parent_instance;
-
- GimpImageType type; /* type of drawable */
+ GimpItem parent_instance;
GimpDrawablePrivate *private;
};
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index ba5c8de..ba6ac85 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -34,6 +34,7 @@
#include "gimpgrouplayer.h"
#include "gimpimage.h"
#include "gimpimage-undo-push.h"
+#include "gimpdrawable-private.h" /* eek */
#include "gimpdrawablestack.h"
#include "gimppickable.h"
#include "gimpprojectable.h"
@@ -809,7 +810,7 @@ gimp_group_layer_convert_type (GimpDrawable *drawable,
* type to the new values so the projection will create its tiles
* with the right depth
*/
- drawable->type = new_type;
+ drawable->private->type = new_type;
gimp_projectable_structure_changed (GIMP_PROJECTABLE (drawable));
diff --git a/app/text/gimptextlayer-xcf.c b/app/text/gimptextlayer-xcf.c
index 00291c5..15a3415 100644
--- a/app/text/gimptextlayer-xcf.c
+++ b/app/text/gimptextlayer-xcf.c
@@ -191,11 +191,10 @@ gimp_text_layer_from_layer (GimpLayer *layer,
drawable = GIMP_DRAWABLE (text_layer);
+ drawable->private->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
drawable->private->tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer));
GIMP_DRAWABLE (layer)->private->tiles = NULL;
- drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
-
gimp_layer_set_opacity (GIMP_LAYER (text_layer),
gimp_layer_get_opacity (layer), FALSE);
gimp_layer_set_mode (GIMP_LAYER (text_layer),
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index 3d27854..c647099 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -842,7 +842,7 @@ xcf_load_layer_props (XcfInfo *info,
gimp_object_set_name (GIMP_OBJECT (group),
gimp_object_get_name (*layer));
- GIMP_DRAWABLE (group)->type =
+ GIMP_DRAWABLE (group)->private->type =
gimp_drawable_type (GIMP_DRAWABLE (*layer));
g_object_ref_sink (*layer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]