Commit a1fd8411 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/core/Makefile.am new file which contains struct GimpDrawablePrivate.

2009-02-04  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/gimpdrawable-private.h: new file which contains struct
	GimpDrawablePrivate. Move some stuff from GimpDrawable here.

	* app/core/gimpdrawable.[ch]
	* app/core/gimpdrawable-shadow.c: changed accordingly.

	* app/text/gimptextlayer-xcf.c
	* app/xcf/xcf-load.c: include the private struct for these ugly
	corner cases.


svn path=/trunk/; revision=27982
parent b853a9bc
2009-02-04 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/gimpdrawable-private.h: new file which contains struct
GimpDrawablePrivate. Move some stuff from GimpDrawable here.
* app/core/gimpdrawable.[ch]
* app/core/gimpdrawable-shadow.c: changed accordingly.
* app/text/gimptextlayer-xcf.c
* app/xcf/xcf-load.c: include the private struct for these ugly
corner cases.
2009-02-02 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-title.c: reverted last change. It's
......
......@@ -148,6 +148,8 @@ libappcore_a_sources = \
gimpdrawable-posterize.h \
gimpdrawable-preview.c \
gimpdrawable-preview.h \
gimpdrawable-private.c \
gimpdrawable-private.h \
gimpdrawable-process.c \
gimpdrawable-process.h \
gimpdrawable-shadow.c \
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_DRAWABLE_PRIVATE_H__
#define __GIMP_DRAWABLE_PRIVATE_H__
struct _GimpDrawablePrivate
{
TileManager *tiles; /* tiles for drawable data */
TileManager *shadow; /* shadow buffer tiles */
GeglNode *source_node;
GeglNode *tile_source_node;
GeglNode *fs_opacity_node;
GeglNode *fs_offset_node;
GeglNode *fs_mode_node;
GeglNode *mode_node;
};
#endif /* __GIMP_DRAWABLE_PRIVATE_H__ */
......@@ -25,6 +25,7 @@
#include "base/tile-manager.h"
#include "gimpdrawable.h"
#include "gimpdrawable-private.h"
#include "gimpdrawable-shadow.h"
......@@ -37,25 +38,25 @@ gimp_drawable_get_shadow_tiles (GimpDrawable *drawable)
item = GIMP_ITEM (drawable);
if (drawable->shadow)
if (drawable->private->shadow)
{
if ((gimp_item_get_width (item) != tile_manager_width (drawable->shadow)) ||
(gimp_item_get_height (item) != tile_manager_height (drawable->shadow)) ||
(drawable->bytes != tile_manager_bpp (drawable->shadow)))
if ((gimp_item_get_width (item) != tile_manager_width (drawable->private->shadow)) ||
(gimp_item_get_height (item) != tile_manager_height (drawable->private->shadow)) ||
(drawable->bytes != tile_manager_bpp (drawable->private->shadow)))
{
gimp_drawable_free_shadow_tiles (drawable);
}
else
{
return drawable->shadow;
return drawable->private->shadow;
}
}
drawable->shadow = tile_manager_new (gimp_item_get_width (item),
gimp_item_get_height (item),
drawable->bytes);
drawable->private->shadow = tile_manager_new (gimp_item_get_width (item),
gimp_item_get_height (item),
drawable->bytes);
return drawable->shadow;
return drawable->private->shadow;
}
void
......@@ -63,10 +64,10 @@ gimp_drawable_free_shadow_tiles (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (drawable->shadow)
if (drawable->private->shadow)
{
tile_manager_unref (drawable->shadow);
drawable->shadow = NULL;
tile_manager_unref (drawable->private->shadow);
drawable->private->shadow = NULL;
}
}
......@@ -80,7 +81,7 @@ gimp_drawable_merge_shadow_tiles (GimpDrawable *drawable,
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (drawable->shadow != NULL);
g_return_if_fail (drawable->private->shadow != NULL);
/* A useful optimization here is to limit the update to the
* extents of the selection mask, as it cannot extend beyond
......@@ -88,7 +89,7 @@ gimp_drawable_merge_shadow_tiles (GimpDrawable *drawable,
*/
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
{
TileManager *tiles = tile_manager_ref (drawable->shadow);
TileManager *tiles = tile_manager_ref (drawable->private->shadow);
PixelRegion shadowPR;
pixel_region_init (&shadowPR, tiles, x, y, width, height, FALSE);
......
This diff is collapsed.
......@@ -30,23 +30,13 @@
#define GIMP_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DRAWABLE, GimpDrawableClass))
typedef struct _GimpDrawableClass GimpDrawableClass;
typedef struct _GimpDrawablePrivate GimpDrawablePrivate;
typedef struct _GimpDrawableClass GimpDrawableClass;
struct _GimpDrawable
{
GimpItem parent_instance;
TileManager *tiles; /* tiles for drawable data */
TileManager *shadow; /* shadow buffer tiles */
GeglNode *source_node;
GeglNode *tile_source_node;
GeglNode *fs_opacity_node;
GeglNode *fs_offset_node;
GeglNode *fs_mode_node;
GeglNode *mode_node;
gint bytes; /* bytes per pixel */
GimpImageType type; /* type of drawable */
gboolean has_alpha; /* drawable has alpha */
......@@ -54,6 +44,8 @@ struct _GimpDrawable
/* Preview variables */
GSList *preview_cache; /* preview caches of the channel */
gboolean preview_valid; /* is the preview valid? */
GimpDrawablePrivate *private;
};
struct _GimpDrawableClass
......
......@@ -25,6 +25,7 @@
#include "text-types.h"
#include "core/gimp.h"
#include "core/gimpdrawable-private.h" /* eek */
#include "core/gimpimage.h"
#include "core/gimpparasitelist.h"
......@@ -190,7 +191,7 @@ gimp_text_layer_from_layer (GimpLayer *layer,
gimp_object_set_name (GIMP_OBJECT (text_layer),
gimp_object_get_name (GIMP_OBJECT (layer)));
item->ID = gimp_item_get_ID (GIMP_ITEM (layer));
item->ID = gimp_item_get_ID (GIMP_ITEM (layer));
/* Set image before tatoo so that the explicitly set tatoo overrides
* the one implicitly set when setting the image
......@@ -215,8 +216,8 @@ gimp_text_layer_from_layer (GimpLayer *layer,
gimp_item_set_visible (item, gimp_item_get_visible (GIMP_ITEM (layer)), FALSE);
gimp_item_set_linked (item, gimp_item_get_linked (GIMP_ITEM (layer)), FALSE);
drawable->tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer));
GIMP_DRAWABLE (layer)->tiles = NULL;
drawable->private->tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer));
GIMP_DRAWABLE (layer)->private->tiles = NULL;
drawable->bytes = gimp_drawable_bytes (GIMP_DRAWABLE (layer));
drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
......
......@@ -35,7 +35,7 @@
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-private.h" /* eek */
#include "core/gimpgrid.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
......@@ -801,10 +801,10 @@ xcf_load_channel_props (XcfInfo *info,
gimp_item_get_height (GIMP_ITEM (*channel)));
g_object_ref_sink (mask);
tile_manager_unref (GIMP_DRAWABLE (mask)->tiles);
GIMP_DRAWABLE (mask)->tiles =
GIMP_DRAWABLE (*channel)->tiles;
GIMP_DRAWABLE (*channel)->tiles = NULL;
tile_manager_unref (GIMP_DRAWABLE (mask)->private->tiles);
GIMP_DRAWABLE (mask)->private->tiles =
GIMP_DRAWABLE (*channel)->private->tiles;
GIMP_DRAWABLE (*channel)->private->tiles = NULL;
g_object_unref (*channel);
*channel = mask;
(*channel)->boundary_known = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment