app/config/gimpbaseconfig.h use gint64 for all memsize properties.

2003-11-16  Sven Neumann  <sven@gimp.org>

	* app/config/gimpbaseconfig.h
	* app/config/gimpcoreconfig.h: use gint64 for all memsize properties.

	* app/base/tile-manager.[ch] (tile_manager_get_memsize): since
	tiles can be swapped out, a tilemanager can be larger than gsize
	(on 32bit platforms). Use a gint64 to avoid an overflow.

	* app/core/gimp.c
	* app/core/gimpbrush.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpbuffer.c
	* app/core/gimpchannel.c
	* app/core/gimpcontainer.c
	* app/core/gimpcontext.c
	* app/core/gimpdata.c
	* app/core/gimpdatafactory.c
	* app/core/gimpdrawable.c
	* app/core/gimpgradient.c
	* app/core/gimpimage-undo-push.c
	* app/core/gimpimage-undo.[ch]
	* app/core/gimpimage.c
	* app/core/gimpitem.c
	* app/core/gimpitemundo.[ch]
	* app/core/gimplayer.c
	* app/core/gimplist.c
	* app/core/gimpobject.[ch]
	* app/core/gimppalette.c
	* app/core/gimpparasitelist.c
	* app/core/gimppattern.c
	* app/core/gimpundo.[ch]
	* app/core/gimpundostack.c
	* app/core/gimpviewable.c
	* app/text/gimptext.c
	* app/text/gimptextlayer.c
	* app/vectors/gimpstroke.c
	* app/vectors/gimpvectors.c: use gint64 for gimp_object_get_memsize()
	and all its implementations.

	* app/display/gimpdisplayshell-title.c
	* app/gui/info-window.c: changed accordingly.
This commit is contained in:
Sven Neumann 2003-11-16 17:51:36 +00:00 committed by Sven Neumann
parent 2ae924c382
commit fd30d5c976
46 changed files with 361 additions and 373 deletions

View File

@ -1,3 +1,46 @@
2003-11-16 Sven Neumann <sven@gimp.org>
* app/config/gimpbaseconfig.h
* app/config/gimpcoreconfig.h: use gint64 for all memsize properties.
* app/base/tile-manager.[ch] (tile_manager_get_memsize): since
tiles can be swapped out, a tilemanager can be larger than gsize
(on 32bit platforms). Use a gint64 to avoid an overflow.
* app/core/gimp.c
* app/core/gimpbrush.c
* app/core/gimpbrushpipe.c
* app/core/gimpbuffer.c
* app/core/gimpchannel.c
* app/core/gimpcontainer.c
* app/core/gimpcontext.c
* app/core/gimpdata.c
* app/core/gimpdatafactory.c
* app/core/gimpdrawable.c
* app/core/gimpgradient.c
* app/core/gimpimage-undo-push.c
* app/core/gimpimage-undo.[ch]
* app/core/gimpimage.c
* app/core/gimpitem.c
* app/core/gimpitemundo.[ch]
* app/core/gimplayer.c
* app/core/gimplist.c
* app/core/gimpobject.[ch]
* app/core/gimppalette.c
* app/core/gimpparasitelist.c
* app/core/gimppattern.c
* app/core/gimpundo.[ch]
* app/core/gimpundostack.c
* app/core/gimpviewable.c
* app/text/gimptext.c
* app/text/gimptextlayer.c
* app/vectors/gimpstroke.c
* app/vectors/gimpvectors.c: use gint64 for gimp_object_get_memsize()
and all its implementations.
* app/display/gimpdisplayshell-title.c
* app/gui/info-window.c: changed accordingly.
2003-11-16 Manish Singh <yosh@gimp.org>
* libgimpwidgets/Makefile.am: added libgimpbase variable definition

View File

@ -205,12 +205,12 @@ tile_manager_get (TileManager *tm,
(*tile_ptr)->write_count
); */
if (wantread)
if (wantread)
{
TILE_MUTEX_LOCK (*tile_ptr);
if (wantwrite)
if (wantwrite)
{
if ((*tile_ptr)->share_count > 1)
if ((*tile_ptr)->share_count > 1)
{
/* Copy-on-write required */
Tile *newtile = g_new (Tile, 1);
@ -234,7 +234,7 @@ tile_manager_get (TileManager *tm,
}
}
if ((*tile_ptr)->data != NULL)
if ((*tile_ptr)->data != NULL)
{
memcpy (newtile->data, (*tile_ptr)->data, tile_size (newtile));
}
@ -338,7 +338,7 @@ tile_manager_invalidate_tiles (TileManager *tm,
void
tile_invalidate_tile (Tile **tile_ptr,
TileManager *tm,
TileManager *tm,
gint xpixel,
gint ypixel)
{
@ -350,7 +350,7 @@ tile_invalidate_tile (Tile **tile_ptr,
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
if (tile_num < 0)
return;
tile_invalidate (tile_ptr, tm, tile_num);
}
@ -370,7 +370,7 @@ tile_invalidate (Tile **tile_ptr,
if (!tile->valid)
goto leave;
if (tile->share_count > 1)
if (tile->share_count > 1)
{
/* This tile is shared. Replace it with a new, invalid tile. */
Tile *newtile = g_new (Tile, 1);
@ -388,7 +388,7 @@ tile_invalidate (Tile **tile_ptr,
tile_cache_flush (tile);
tile->valid = FALSE;
if (tile->data)
if (tile->data)
{
g_free (tile->data);
tile->data = NULL;
@ -545,7 +545,7 @@ tile_manager_get_tile_num (TileManager *tm,
return tile_num;
}
void
void
tile_manager_set_user_data (TileManager *tm,
gpointer user_data)
{
@ -562,15 +562,15 @@ tile_manager_get_user_data (const TileManager *tm)
return tm->user_data;
}
gint
tile_manager_width (const TileManager *tm)
gint
tile_manager_width (const TileManager *tm)
{
g_return_val_if_fail (tm != NULL, 0);
return tm->width;
}
gint
gint
tile_manager_height (const TileManager *tm)
{
g_return_val_if_fail (tm != NULL, 0);
@ -578,10 +578,10 @@ tile_manager_height (const TileManager *tm)
return tm->height;
}
gint
gint
tile_manager_bpp (const TileManager *tm)
{
g_return_val_if_fail (tm != NULL, 0);
g_return_val_if_fail (tm != NULL, 0);
return tm->bpp;
}
@ -608,10 +608,10 @@ tile_manager_set_offsets (TileManager *tm,
tm->y = y;
}
gsize
gint64
tile_manager_get_memsize (const TileManager *tm)
{
gsize memsize = 0;
gint64 memsize = 0;
g_return_val_if_fail (tm != NULL, 0);
@ -634,12 +634,12 @@ tile_manager_get_tile_coordinates (TileManager *tm,
g_return_if_fail (tm != NULL);
g_return_if_fail (x != NULL && y != NULL);
for (tl = tile->tlink; tl; tl = tl->next)
for (tl = tile->tlink; tl; tl = tl->next)
{
if (tl->tm == tm) break;
}
if (tl == NULL)
if (tl == NULL)
{
g_warning ("tile_manager_get_tile_coordinates: tile not attached to manager");
return;
@ -649,7 +649,7 @@ tile_manager_get_tile_coordinates (TileManager *tm,
*y = TILE_HEIGHT * (tl->tile_num / tm->ntile_cols);
}
void
tile_manager_map_over_tile (TileManager *tm,
Tile *tile,
@ -661,12 +661,12 @@ tile_manager_map_over_tile (TileManager *tm,
g_return_if_fail (tile != NULL);
g_return_if_fail (srctile != NULL);
for (tl = tile->tlink; tl; tl = tl->next)
for (tl = tile->tlink; tl; tl = tl->next)
{
if (tl->tm == tm) break;
}
if (tl == NULL)
if (tl == NULL)
{
g_warning ("tile_manager_map_over_tile: tile not attached to manager");
return;
@ -675,7 +675,7 @@ tile_manager_map_over_tile (TileManager *tm,
tile_manager_map (tm, tl->tile_num, srctile);
}
PixelDataHandle *
PixelDataHandle *
request_pixel_data (TileManager *tm,
gint x1,
gint y1,
@ -698,26 +698,26 @@ request_pixel_data (TileManager *tm,
pdh->y2 = y2;
pdh->public.width = w = (x2-x1)+1;
pdh->public.height = h = (y2-y1)+1;
tile_num_1 = tile_manager_get_tile_num (tm, x1, y1);
tile_num_2 = tile_manager_get_tile_num (tm, x2, y2);
if (tile_num_1 == tile_num_2)
if (tile_num_1 == tile_num_2)
{
pdh->tile = tile_manager_get (tm, tile_num_1, wantread, wantwrite);
pdh->public.data = tile_data_pointer (pdh->tile, x1 % TILE_WIDTH, y1 % TILE_HEIGHT);
pdh->public.stride = tile_bpp (pdh->tile) * tile_ewidth (pdh->tile);
pdh->local_buffer = FALSE;
}
else
else
{
pdh->public.data = g_new (guchar, w * h * tm->bpp);
pdh->public.stride = tm->bpp * w;
pdh->local_buffer = TRUE;
pdh->tile = NULL;
if (wantread)
read_pixel_data (tm, x1, y1, x2, y2,
if (wantread)
read_pixel_data (tm, x1, y1, x2, y2,
pdh->public.data, pdh->public.stride);
}
return (PixelDataHandle *) pdh;
@ -728,14 +728,14 @@ release_pixel_data (PixelDataHandle *xpdh)
{
PixelDataHandlePrivate *pdh = (PixelDataHandlePrivate *)(xpdh);
if (pdh->local_buffer)
if (pdh->local_buffer)
{
if (pdh->writeable)
if (pdh->writeable)
write_pixel_data (pdh->tm, pdh->x1, pdh->y1, pdh->x2, pdh->y2,
pdh->public.data, pdh->public.stride);
g_free (pdh->public.data);
}
else
else
{
tile_release (pdh->tile, pdh->writeable);
}
@ -757,33 +757,33 @@ read_pixel_data (TileManager *tm,
Tile *t;
guchar *s, *d;
for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
{
t = tile_manager_get_tile (tm, x, y, TRUE, FALSE);
s = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT);
d = buffer + stride * (y - y1) + tm->bpp * (x - x1);
rows = tile_eheight (t) - y % TILE_HEIGHT;
if (rows > (y2 - y + 1))
if (rows > (y2 - y + 1))
rows = y2 - y + 1;
cols = tile_ewidth (t) - x % TILE_WIDTH;
if (cols > (x2 - x + 1))
cols = x2 - x + 1;
srcstride = tile_ewidth (t) * tile_bpp (t);
while (rows --)
while (rows --)
{
memcpy (d, s, cols * tm->bpp);
s += srcstride;
d += stride;
}
tile_release (t, FALSE);
}
}
void
write_pixel_data (TileManager *tm,
gint x1,
@ -799,29 +799,29 @@ write_pixel_data (TileManager *tm,
Tile *t;
guchar *s, *d;
for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
{
t = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
s = buffer + stride * (y - y1) + tm->bpp * (x - x1);
d = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT);
rows = tile_eheight (t) - y % TILE_HEIGHT;
if (rows > (y2 - y + 1))
if (rows > (y2 - y + 1))
rows = y2 - y + 1;
cols = tile_ewidth (t) - x % TILE_WIDTH;
if (cols > (x2 - x + 1))
cols = x2 - x + 1;
dststride = tile_ewidth (t) * tile_bpp (t);
while (rows --)
while (rows --)
{
memcpy (d, s, cols * tm->bpp);
s += stride;
d += dststride;
}
tile_release (t, TRUE);
}
}
@ -831,20 +831,20 @@ read_pixel_data_1 (TileManager *tm,
gint x,
gint y,
guchar *buffer)
{
{
if (x >= 0 && y >= 0 && x < tm->width && y < tm->height)
{
gint num = tile_manager_get_tile_num (tm, x, y);
if (num != tm->cached_num) /* must fetch a new tile */
{
{
if (tm->cached_tile)
tile_release (tm->cached_tile, FALSE);
tm->cached_num = num;
tm->cached_tile = tile_manager_get (tm, num, TRUE, FALSE);
}
if (tm->cached_tile)
{
guchar *data = tile_data_pointer (tm->cached_tile,
@ -861,7 +861,7 @@ read_pixel_data_1 (TileManager *tm,
buffer[i] = data[i];
}
break;
}
}
}
}
}
@ -879,4 +879,4 @@ write_pixel_data_1 (TileManager *tm,
d = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT);
memcpy (d, buffer, tm->bpp);
tile_release (t, TRUE);
}
}

View File

@ -19,7 +19,7 @@
#ifndef __TILE_MANAGER_H__
#define __TILE_MANAGER_H__
struct _PixelDataHandle
struct _PixelDataHandle
{
guchar *data;
gint width;
@ -56,7 +56,7 @@ void tile_manager_unref (TileManager *tm);
void tile_manager_set_validate_proc (TileManager *tm,
TileValidateProc proc);
/* Get a specified tile from a tile manager.
/* Get a specified tile from a tile manager.
*/
Tile * tile_manager_get_tile (TileManager *tm,
gint xpixel,
@ -98,7 +98,7 @@ void tile_invalidate (Tile **tile_ptr,
TileManager *tm,
gint tile_num);
void tile_invalidate_tile (Tile **tile_ptr,
TileManager *tm,
TileManager *tm,
gint xpixel,
gint ypixel);
@ -123,7 +123,7 @@ void tile_manager_set_offsets (TileManager *tm,
gint x,
gint y);
gsize tile_manager_get_memsize (const TileManager *tm);
gint64 tile_manager_get_memsize (const TileManager *tm);
void tile_manager_get_tile_coordinates (TileManager *tm,
Tile *tile,

View File

@ -42,7 +42,7 @@ struct _GimpBaseConfig
gchar *swap_path;
gboolean stingy_memory_use;
guint num_processors;
gulong tile_cache_size;
guint64 tile_cache_size;
};
struct _GimpBaseConfigClass

View File

@ -57,7 +57,7 @@ struct _GimpCoreConfig
GimpTemplate *default_image;
GimpGrid *default_grid;
gint levels_of_undo;
gulong undo_size;
guint64 undo_size;
gchar *plug_in_rc_path;
gboolean layer_previews;
GimpPreviewSize layer_preview_size;

View File

@ -88,8 +88,8 @@ static void gimp_init (Gimp *gimp);
static void gimp_dispose (GObject *object);
static void gimp_finalize (GObject *object);
static gsize gimp_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_real_initialize (Gimp *gimp,
GimpInitStatusFunc status_callback);
@ -484,12 +484,12 @@ gimp_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
Gimp *gimp;
gsize memsize = 0;
Gimp *gimp;
gint64 memsize = 0;
gimp = GIMP (object);

View File

@ -71,8 +71,8 @@ static void gimp_brush_init (GimpBrush *brush);
static void gimp_brush_finalize (GObject *object);
static gsize gimp_brush_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_brush_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_brush_get_popup_size (GimpViewable *viewable,
gint width,
@ -202,12 +202,12 @@ gimp_brush_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_brush_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpBrush *brush;
gsize memsize = 0;
gint64 memsize = 0;
brush = GIMP_BRUSH (object);

View File

@ -71,8 +71,8 @@ static void gimp_brush_init (GimpBrush *brush);
static void gimp_brush_finalize (GObject *object);
static gsize gimp_brush_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_brush_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_brush_get_popup_size (GimpViewable *viewable,
gint width,
@ -202,12 +202,12 @@ gimp_brush_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_brush_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpBrush *brush;
gsize memsize = 0;
gint64 memsize = 0;
brush = GIMP_BRUSH (object);

View File

@ -60,8 +60,8 @@ static void gimp_brush_pipe_init (GimpBrushPipe *pipe);
static void gimp_brush_pipe_finalize (GObject *object);
static gsize gimp_brush_pipe_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_brush_pipe_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_brush_pipe_get_popup_size (GimpViewable *viewable,
gint width,
@ -196,12 +196,12 @@ gimp_brush_pipe_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_brush_pipe_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpBrushPipe *pipe;
gsize memsize = 0;
gint64 memsize = 0;
gint i;
pipe = GIMP_BRUSH_PIPE (object);

View File

@ -60,8 +60,8 @@ static void gimp_brush_pipe_init (GimpBrushPipe *pipe);
static void gimp_brush_pipe_finalize (GObject *object);
static gsize gimp_brush_pipe_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_brush_pipe_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_brush_pipe_get_popup_size (GimpViewable *viewable,
gint width,
@ -196,12 +196,12 @@ gimp_brush_pipe_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_brush_pipe_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpBrushPipe *pipe;
gsize memsize = 0;
gint64 memsize = 0;
gint i;
pipe = GIMP_BRUSH_PIPE (object);

View File

@ -38,8 +38,8 @@ static void gimp_buffer_init (GimpBuffer *buffer);
static void gimp_buffer_finalize (GObject *object);
static gsize gimp_buffer_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_buffer_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_buffer_get_preview_size (GimpViewable *viewable,
gint size,
@ -136,12 +136,12 @@ gimp_buffer_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_buffer_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpBuffer *buffer;
gsize memsize = 0;
gint64 memsize = 0;
buffer = GIMP_BUFFER (object);

View File

@ -57,8 +57,8 @@ static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_finalize (GObject *object);
static gsize gimp_channel_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_channel_get_memsize (GimpObject *object,
gint64 *gui_size);
static GimpItem * gimp_channel_duplicate (GimpItem *item,
GType new_type,
@ -306,13 +306,11 @@ gimp_channel_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_channel_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpChannel *channel;
channel = GIMP_CHANNEL (object);
GimpChannel *channel = GIMP_CHANNEL (object);
*gui_size += channel->num_segs_in * sizeof (BoundSeg);
*gui_size += channel->num_segs_out * sizeof (BoundSeg);
@ -463,9 +461,7 @@ gimp_channel_scale (GimpItem *item,
gint new_offset_y,
GimpInterpolationType interpolation_type)
{
GimpChannel *channel;
channel = GIMP_CHANNEL (item);
GimpChannel *channel = GIMP_CHANNEL (item);
gimp_image_undo_push_channel_mod (gimp_item_get_image (item),
_("Scale Channel"),
@ -492,9 +488,7 @@ gimp_channel_resize (GimpItem *item,
gint offset_x,
gint offset_y)
{
GimpChannel *channel;
channel = GIMP_CHANNEL (item);
GimpChannel *channel = GIMP_CHANNEL (item);
gimp_image_undo_push_channel_mod (gimp_item_get_image (item),
_("Resize Channel"),

View File

@ -98,8 +98,8 @@ static void gimp_container_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static gsize gimp_container_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_container_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_container_serialize (GimpConfig *config,
GimpConfigWriter *writer,
@ -337,13 +337,13 @@ gimp_container_get_property (GObject *object,
}
}
static gsize
static gint64
gimp_container_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpContainer *container;
GList *list;
gsize memsize = 0;
gint64 memsize = 0;
container = GIMP_CONTAINER (object);

View File

@ -87,8 +87,8 @@ static void gimp_context_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gsize gimp_context_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_context_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_context_serialize (GimpConfig *config,
GimpConfigWriter *writer,
@ -1044,12 +1044,12 @@ gimp_context_get_property (GObject *object,
}
}
static gsize
static gint64
gimp_context_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpContext *context = GIMP_CONTEXT (object);
gsize memsize = 0;
gint64 memsize = 0;
if (context->tool_name)
memsize += strlen (context->tool_name) + 1;

View File

@ -63,8 +63,8 @@ static void gimp_data_init (GimpData *data);
static void gimp_data_finalize (GObject *object);
static void gimp_data_name_changed (GimpObject *object);
static gsize gimp_data_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_data_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_data_real_dirty (GimpData *data);
@ -167,12 +167,12 @@ gimp_data_name_changed (GimpObject *object)
gimp_data_dirty (GIMP_DATA (object));
}
static gsize
static gint64
gimp_data_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpData *data;
gsize memsize = 0;
gint64 memsize = 0;
data = GIMP_DATA (object);

View File

@ -47,8 +47,8 @@ static void gimp_data_factory_init (GimpDataFactory *factory);
static void gimp_data_factory_finalize (GObject *object);
static gsize gimp_data_factory_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_data_factory_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_data_factory_load_data (const GimpDatafileData *file_data,
gpointer user_data);
@ -135,12 +135,12 @@ gimp_data_factory_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_data_factory_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpDataFactory *factory;
gsize memsize = 0;
gint64 memsize = 0;
factory = GIMP_DATA_FACTORY (object);

View File

@ -60,8 +60,8 @@ static void gimp_drawable_init (GimpDrawable *drawable)
static void gimp_drawable_finalize (GObject *object);
static gsize gimp_drawable_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_drawable_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_invalidate_preview (GimpViewable *viewable);
@ -225,12 +225,12 @@ gimp_drawable_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_drawable_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpDrawable *drawable;
gsize memsize = 0;
gint64 memsize = 0;
drawable = GIMP_DRAWABLE (object);

View File

@ -47,8 +47,8 @@ static void gimp_gradient_init (GimpGradient *gradient);
static void gimp_gradient_finalize (GObject *object);
static gsize gimp_gradient_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_gradient_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_gradient_get_preview_size (GimpViewable *viewable,
gint size,
@ -167,13 +167,13 @@ gimp_gradient_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_gradient_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpGradient *gradient;
GimpGradientSegment *segment;
gsize memsize = 0;
gint64 memsize = 0;
gradient = GIMP_GRADIENT (object);

View File

@ -93,7 +93,7 @@ gimp_image_undo_push_image (GimpImage *gimage,
{
GimpUndo *new;
GimpItem *item;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
@ -160,7 +160,7 @@ gimp_image_undo_push_image_mod (GimpImage *gimage,
{
GimpUndo *new;
GimpItem *item;
gsize size;
gint64 size;
gint dwidth, dheight;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
@ -911,7 +911,7 @@ gimp_image_undo_push_mask (GimpImage *gimage,
TileManager *undo_tiles;
gint x1, y1, x2, y2;
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_CHANNEL (mask), FALSE);
@ -1089,7 +1089,7 @@ gimp_image_undo_push_item_rename (GimpImage *gimage,
GimpItem *item)
{
GimpUndo *new;
gsize size;
gint64 size;
const gchar *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
@ -1444,7 +1444,7 @@ undo_push_layer (GimpImage *gimage,
GimpLayer *prev_layer)
{
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
@ -1497,7 +1497,8 @@ undo_pop_layer (GimpUndo *undo,
{
/* remove layer */
g_print ("undo_pop_layer: taking ownership, size += %u\n",
g_print ("undo_pop_layer: taking ownership, size += "
"%" G_GINT64_FORMAT "\n",
gimp_object_get_memsize (GIMP_OBJECT (layer), NULL));
undo->size += gimp_object_get_memsize (GIMP_OBJECT (layer), NULL);
@ -1553,7 +1554,8 @@ undo_pop_layer (GimpUndo *undo,
{
/* restore layer */
g_print ("undo_pop_layer: dropping ownership, size -= %u\n",
g_print ("undo_pop_layer: dropping ownership, size -= "
"%" G_GINT64_FORMAT "\n",
gimp_object_get_memsize (GIMP_OBJECT (layer), NULL));
undo->size -= gimp_object_get_memsize (GIMP_OBJECT (layer), NULL);
@ -1622,7 +1624,7 @@ gimp_image_undo_push_layer_mod (GimpImage *gimage,
{
GimpUndo *new;
TileManager *tiles;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
@ -1790,7 +1792,7 @@ undo_push_layer_mask (GimpImage *gimage,
GimpLayerMask *mask)
{
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
@ -2134,7 +2136,7 @@ undo_push_channel (GimpImage *gimage,
GimpChannel *prev_channel)
{
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
@ -2257,7 +2259,7 @@ gimp_image_undo_push_channel_mod (GimpImage *gimage,
{
TileManager *tiles;
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
@ -2551,7 +2553,7 @@ undo_push_vectors (GimpImage *gimage,
GimpVectors *prev_vectors)
{
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
@ -2678,7 +2680,7 @@ gimp_image_undo_push_vectors_mod (GimpImage *gimage,
GimpVectors *vectors)
{
GimpUndo *new;
gsize size;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);

View File

@ -185,7 +185,7 @@ gimp_image_undo_group_end (GimpImage *gimage)
GimpUndo *
gimp_image_undo_push (GimpImage *gimage,
gsize size,
gint64 size,
gsize struct_size,
GimpUndoType type,
const gchar *name,
@ -202,7 +202,7 @@ gimp_image_undo_push (GimpImage *gimage,
GimpUndo *
gimp_image_undo_push_item (GimpImage *gimage,
GimpItem *item,
gsize size,
gint64 size,
gsize struct_size,
GimpUndoType type,
const gchar *name,
@ -334,7 +334,7 @@ gimp_image_undo_free_space (GimpImage *gimage)
GimpContainer *container;
gint min_undo_levels;
gint max_undo_levels;
gulong undo_size;
gint64 undo_size;
container = gimage->undo_stack->undos;

View File

@ -31,7 +31,7 @@ gboolean gimp_image_undo_group_start (GimpImage *gimage,
gboolean gimp_image_undo_group_end (GimpImage *gimage);
GimpUndo * gimp_image_undo_push (GimpImage *gimage,
gsize size,
gint64 size,
gsize struct_size,
GimpUndoType type,
const gchar *name,
@ -40,7 +40,7 @@ GimpUndo * gimp_image_undo_push (GimpImage *gimage,
GimpUndoFreeFunc free_func);
GimpUndo * gimp_image_undo_push_item (GimpImage *gimage,
GimpItem *item,
gsize size,
gint64 size,
gsize struct_size,
GimpUndoType type,
const gchar *name,

View File

@ -107,8 +107,8 @@ static void gimp_image_dispose (GObject *object);
static void gimp_image_finalize (GObject *object);
static void gimp_image_name_changed (GimpObject *object);
static gsize gimp_image_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_image_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_image_invalidate_preview (GimpViewable *viewable);
static void gimp_image_size_changed (GimpViewable *viewable);
@ -687,12 +687,12 @@ gimp_image_name_changed (GimpObject *object)
}
}
static gsize
static gint64
gimp_image_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpImage *gimage;
gsize memsize = 0;
gint64 memsize = 0;
gimage = GIMP_IMAGE (object);

View File

@ -65,8 +65,8 @@ static void gimp_item_init (GimpItem *item);
static void gimp_item_finalize (GObject *object);
static void gimp_item_name_changed (GimpObject *object);
static gsize gimp_item_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_item_get_memsize (GimpObject *object,
gint64 *gui_size);
static GimpItem * gimp_item_real_duplicate (GimpItem *item,
GType new_type,
@ -253,12 +253,12 @@ gimp_item_name_changed (GimpObject *object)
gimp_list_uniquefy_name (list, object, FALSE);
}
static gsize
static gint64
gimp_item_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpItem *item;
gsize memsize = 0;
gint64 memsize = 0;
item = GIMP_ITEM (object);

View File

@ -108,7 +108,7 @@ gimp_item_undo_new (GimpImage *gimage,
GimpUndoType undo_type,
const gchar *name,
gpointer data,
gsize size,
gint64 size,
gboolean dirties_image,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func)

View File

@ -53,7 +53,7 @@ GimpUndo * gimp_item_undo_new (GimpImage *gimage,
GimpUndoType undo_type,
const gchar *name,
gpointer data,
gsize size,
gint64 size,
gboolean dirties_image,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func);

View File

@ -65,8 +65,8 @@ static void gimp_layer_init (GimpLayer *layer);
static void gimp_layer_dispose (GObject *object);
static void gimp_layer_finalize (GObject *object);
static gsize gimp_layer_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_layer_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_layer_invalidate_preview (GimpViewable *viewable);
@ -304,12 +304,12 @@ gimp_layer_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_layer_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpLayer *layer;
gsize memsize = 0;
gint64 memsize = 0;
layer = GIMP_LAYER (object);

View File

@ -36,8 +36,8 @@ static void gimp_list_init (GimpList *list);
static void gimp_list_dispose (GObject *object);
static gsize gimp_list_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_list_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_list_add (GimpContainer *container,
GimpObject *object);
@ -128,9 +128,7 @@ gimp_list_init (GimpList *list)
static void
gimp_list_dispose (GObject *object)
{
GimpList *list;
list = GIMP_LIST (object);
GimpList *list = GIMP_LIST (object);
while (list->list)
gimp_container_remove (GIMP_CONTAINER (list), list->list->data);
@ -138,12 +136,12 @@ gimp_list_dispose (GObject *object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static gsize
static gint64
gimp_list_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpList *gimp_list;
gsize memsize = 0;
gint64 memsize = 0;
gimp_list = GIMP_LIST (object);
@ -167,9 +165,7 @@ static void
gimp_list_add (GimpContainer *container,
GimpObject *object)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
list->list = g_list_prepend (list->list, object);
}
@ -178,9 +174,7 @@ static void
gimp_list_remove (GimpContainer *container,
GimpObject *object)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
list->list = g_list_remove (list->list, object);
}
@ -205,9 +199,7 @@ gimp_list_reorder (GimpContainer *container,
static void
gimp_list_clear (GimpContainer *container)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
while (list->list)
gimp_container_remove (container, list->list->data);
@ -217,9 +209,7 @@ static gboolean
gimp_list_have (const GimpContainer *container,
const GimpObject *object)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
return g_list_find (list->list, object) ? TRUE : FALSE;
}
@ -229,9 +219,7 @@ gimp_list_foreach (const GimpContainer *container,
GFunc func,
gpointer user_data)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
g_list_foreach (list->list, func, user_data);
}
@ -278,9 +266,7 @@ static gint
gimp_list_get_child_index (const GimpContainer *container,
const GimpObject *object)
{
GimpList *list;
list = GIMP_LIST (container);
GimpList *list = GIMP_LIST (container);
return g_list_index (list->list, (gpointer) object);
}

View File

@ -57,8 +57,8 @@ static void gimp_object_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gsize gimp_object_real_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_object_real_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_object_name_normalize (GimpObject *object);
@ -377,12 +377,12 @@ gimp_object_name_normalize (GimpObject *object)
gboolean gimp_debug_memsize = FALSE;
#endif
gsize
gint64
gimp_object_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
gsize my_size = 0;
gsize my_gui_size = 0;
gint64 my_size = 0;
gint64 my_gui_size = 0;
g_return_val_if_fail (GIMP_IS_OBJECT (object), 0);
@ -393,11 +393,11 @@ gimp_object_get_memsize (GimpObject *object,
static GList *aggregation_tree = NULL;
static gchar indent_buf[256];
gsize memsize;
gsize gui_memsize = 0;
gint i;
gint my_indent_level;
gchar *object_size;
gint64 memsize;
gint64 gui_memsize = 0;
gint i;
gint my_indent_level;
gchar *object_size;
indent_level++;
@ -413,13 +413,14 @@ gimp_object_get_memsize (GimpObject *object,
indent_buf[i] = '\0';
/* FIXME: are we going to ever have > 4 GB objects?? */
object_size = g_strdup_printf ("%s%s \"%s\": %u (%u)\n",
object_size = g_strdup_printf ("%s%s \"%s\": "
"%" G_GINT64_FORMAT
"(%" G_GINT64_FORMAT ")\n",
indent_buf,
g_type_name (G_TYPE_FROM_INSTANCE (object)),
object->name,
(guint) memsize,
(guint) gui_memsize);
memsize,
gui_memsize);
aggregation_tree = g_list_prepend (aggregation_tree, object_size);
@ -445,11 +446,11 @@ gimp_object_get_memsize (GimpObject *object,
return my_size;
}
gsize
gint64
gimp_g_object_get_memsize (GObject *object)
{
GTypeQuery type_query;
gsize memsize = 0;
GTypeQuery type_query;
gint64 memsize = 0;
g_return_val_if_fail (G_IS_OBJECT (object), 0);
@ -460,11 +461,11 @@ gimp_g_object_get_memsize (GObject *object)
return memsize;
}
static gsize
static gint64
gimp_object_real_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
gsize memsize = 0;
gint64 memsize = 0;
if (object->name)
memsize += strlen (object->name) + 1;

View File

@ -45,12 +45,12 @@ struct _GimpObjectClass
GObjectClass parent_class;
/* signals */
void (* disconnect) (GimpObject *object);
void (* name_changed) (GimpObject *object);
void (* disconnect) (GimpObject *object);
void (* name_changed) (GimpObject *object);
/* virtual functions */
gsize (* get_memsize) (GimpObject *object,
gsize *gui_size);
gint64 (* get_memsize) (GimpObject *object,
gint64 *gui_size);
};
@ -66,9 +66,9 @@ void gimp_object_name_free (GimpObject *object);
gint gimp_object_name_collate (GimpObject *object1,
GimpObject *object2);
gsize gimp_object_get_memsize (GimpObject *object,
gsize *gui_size);
gsize gimp_g_object_get_memsize (GObject *object);
gint64 gimp_object_get_memsize (GimpObject *object,
gint64 *gui_size);
gint64 gimp_g_object_get_memsize (GObject *object);
#endif /* __GIMP_OBJECT_H__ */

View File

@ -47,8 +47,8 @@ static void gimp_palette_init (GimpPalette *palette);
static void gimp_palette_finalize (GObject *object);
static gsize gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_palette_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_palette_get_preview_size (GimpViewable *viewable,
gint size,
@ -151,11 +151,7 @@ gimp_palette_init (GimpPalette *palette)
static void
gimp_palette_finalize (GObject *object)
{
GimpPalette *palette;
g_return_if_fail (GIMP_IS_PALETTE (object));
palette = GIMP_PALETTE (object);
GimpPalette *palette = GIMP_PALETTE (object);
if (palette->colors)
{
@ -167,21 +163,19 @@ gimp_palette_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpPalette *palette;
GList *list;
gsize memsize = 0;
gint64 memsize = 0;
palette = GIMP_PALETTE (object);
for (list = palette->colors; list; list = g_list_next (list))
{
GimpPaletteEntry *entry;
entry = (GimpPaletteEntry *) list->data;
GimpPaletteEntry *entry = (GimpPaletteEntry *) list->data;
memsize += sizeof (GList) + sizeof (GimpPaletteEntry);
@ -315,9 +309,7 @@ static gchar *
gimp_palette_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpPalette *palette;
palette = GIMP_PALETTE (viewable);
GimpPalette *palette = GIMP_PALETTE (viewable);
if (tooltip)
*tooltip = NULL;

View File

@ -47,8 +47,8 @@ static void gimp_palette_init (GimpPalette *palette);
static void gimp_palette_finalize (GObject *object);
static gsize gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_palette_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_palette_get_preview_size (GimpViewable *viewable,
gint size,
@ -151,11 +151,7 @@ gimp_palette_init (GimpPalette *palette)
static void
gimp_palette_finalize (GObject *object)
{
GimpPalette *palette;
g_return_if_fail (GIMP_IS_PALETTE (object));
palette = GIMP_PALETTE (object);
GimpPalette *palette = GIMP_PALETTE (object);
if (palette->colors)
{
@ -167,21 +163,19 @@ gimp_palette_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpPalette *palette;
GList *list;
gsize memsize = 0;
gint64 memsize = 0;
palette = GIMP_PALETTE (object);
for (list = palette->colors; list; list = g_list_next (list))
{
GimpPaletteEntry *entry;
entry = (GimpPaletteEntry *) list->data;
GimpPaletteEntry *entry = (GimpPaletteEntry *) list->data;
memsize += sizeof (GList) + sizeof (GimpPaletteEntry);
@ -315,9 +309,7 @@ static gchar *
gimp_palette_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpPalette *palette;
palette = GIMP_PALETTE (viewable);
GimpPalette *palette = GIMP_PALETTE (viewable);
if (tooltip)
*tooltip = NULL;

View File

@ -47,8 +47,8 @@ static void gimp_palette_init (GimpPalette *palette);
static void gimp_palette_finalize (GObject *object);
static gsize gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_palette_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_palette_get_preview_size (GimpViewable *viewable,
gint size,
@ -151,11 +151,7 @@ gimp_palette_init (GimpPalette *palette)
static void
gimp_palette_finalize (GObject *object)
{
GimpPalette *palette;
g_return_if_fail (GIMP_IS_PALETTE (object));
palette = GIMP_PALETTE (object);
GimpPalette *palette = GIMP_PALETTE (object);
if (palette->colors)
{
@ -167,21 +163,19 @@ gimp_palette_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_palette_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpPalette *palette;
GList *list;
gsize memsize = 0;
gint64 memsize = 0;
palette = GIMP_PALETTE (object);
for (list = palette->colors; list; list = g_list_next (list))
{
GimpPaletteEntry *entry;
entry = (GimpPaletteEntry *) list->data;
GimpPaletteEntry *entry = (GimpPaletteEntry *) list->data;
memsize += sizeof (GList) + sizeof (GimpPaletteEntry);
@ -315,9 +309,7 @@ static gchar *
gimp_palette_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpPalette *palette;
palette = GIMP_PALETTE (viewable);
GimpPalette *palette = GIMP_PALETTE (viewable);
if (tooltip)
*tooltip = NULL;

View File

@ -51,8 +51,8 @@ enum
static void gimp_parasite_list_class_init (GimpParasiteListClass *klass);
static void gimp_parasite_list_init (GimpParasiteList *list);
static void gimp_parasite_list_finalize (GObject *object);
static gsize gimp_parasite_list_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_parasite_list_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_parasite_list_config_iface_init (gpointer iface,
gpointer iface_data);
@ -197,22 +197,22 @@ gimp_parasite_list_get_memsize_foreach (gpointer key,
gpointer m)
{
GimpParasite *parasite;
gsize *memsize;
gint64 *memsize;
parasite = (GimpParasite *) p;
memsize = (gsize *) m;
memsize = (gint64 *) m;
*memsize += (sizeof (GimpParasite) +
strlen (parasite->name) + 1 +
parasite->size);
}
static gsize
static gint64
gimp_parasite_list_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpParasiteList *list;
gsize memsize = 0;
gint64 memsize = 0;
list = GIMP_PARASITE_LIST (object);

View File

@ -61,8 +61,8 @@ static void gimp_pattern_init (GimpPattern *pattern);
static void gimp_pattern_finalize (GObject *object);
static gsize gimp_pattern_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_pattern_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_pattern_get_popup_size (GimpViewable *viewable,
gint width,
@ -147,9 +147,7 @@ gimp_pattern_init (GimpPattern *pattern)
static void
gimp_pattern_finalize (GObject *object)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (object);
GimpPattern *pattern = GIMP_PATTERN (object);
if (pattern->mask)
{
@ -160,12 +158,12 @@ gimp_pattern_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_pattern_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpPattern *pattern;
gsize memsize = 0;
gint64 memsize = 0;
pattern = GIMP_PATTERN (object);
@ -184,9 +182,7 @@ gimp_pattern_get_popup_size (GimpViewable *viewable,
gint *popup_width,
gint *popup_height)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (viewable);
GimpPattern *pattern = GIMP_PATTERN (viewable);
if (pattern->mask->width > width || pattern->mask->height > height)
{
@ -228,9 +224,7 @@ static gchar *
gimp_pattern_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (viewable);
GimpPattern *pattern = GIMP_PATTERN (viewable);
if (tooltip)
*tooltip = NULL;

View File

@ -61,8 +61,8 @@ static void gimp_pattern_init (GimpPattern *pattern);
static void gimp_pattern_finalize (GObject *object);
static gsize gimp_pattern_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_pattern_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_pattern_get_popup_size (GimpViewable *viewable,
gint width,
@ -147,9 +147,7 @@ gimp_pattern_init (GimpPattern *pattern)
static void
gimp_pattern_finalize (GObject *object)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (object);
GimpPattern *pattern = GIMP_PATTERN (object);
if (pattern->mask)
{
@ -160,12 +158,12 @@ gimp_pattern_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_pattern_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpPattern *pattern;
gsize memsize = 0;
gint64 memsize = 0;
pattern = GIMP_PATTERN (object);
@ -184,9 +182,7 @@ gimp_pattern_get_popup_size (GimpViewable *viewable,
gint *popup_width,
gint *popup_height)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (viewable);
GimpPattern *pattern = GIMP_PATTERN (viewable);
if (pattern->mask->width > width || pattern->mask->height > height)
{
@ -228,9 +224,7 @@ static gchar *
gimp_pattern_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpPattern *pattern;
pattern = GIMP_PATTERN (viewable);
GimpPattern *pattern = GIMP_PATTERN (viewable);
if (tooltip)
*tooltip = NULL;

View File

@ -43,8 +43,8 @@ static void gimp_undo_init (GimpUndo *undo);
static void gimp_undo_finalize (GObject *object);
static gsize gimp_undo_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_undo_get_popup_size (GimpViewable *viewable,
gint width,
@ -178,12 +178,12 @@ gimp_undo_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_undo_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpUndo *undo;
gsize memsize = 0;
gint64 memsize = 0;
undo = GIMP_UNDO (object);
@ -278,7 +278,7 @@ gimp_undo_new (GimpImage *gimage,
GimpUndoType undo_type,
const gchar *name,
gpointer data,
gsize size,
gint64 size,
gboolean dirties_image,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func)

View File

@ -55,12 +55,12 @@ struct _GimpUndo
GimpUndoType undo_type; /* undo type */
gpointer data; /* data to implement the undo */
gsize size; /* size of undo item */
gint64 size; /* size of undo item */
gboolean dirties_image; /* TRUE if undo mutates image */
GimpUndoPopFunc pop_func; /* function pointer to undo pop proc */
GimpUndoFreeFunc free_func; /* function pointer to free undo data */
TempBuf *preview;
guint preview_idle_id;
};
@ -83,7 +83,7 @@ GimpUndo * gimp_undo_new (GimpImage *gimage,
GimpUndoType undo_type,
const gchar *name,
gpointer data,
gsize size,
gint64 size,
gboolean dirties_image,
GimpUndoPopFunc pop_func,
GimpUndoFreeFunc free_func);

View File

@ -33,8 +33,8 @@ static void gimp_undo_stack_init (GimpUndoStack *stack);
static void gimp_undo_stack_finalize (GObject *object);
static gsize gimp_undo_stack_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_undo_stack_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_undo_stack_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
@ -118,12 +118,12 @@ gimp_undo_stack_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_undo_stack_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpUndoStack *stack;
gsize memsize = 0;
gint64 memsize = 0;
stack = GIMP_UNDO_STACK (object);

View File

@ -65,8 +65,8 @@ static void gimp_viewable_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static gsize gimp_viewable_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_viewable_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_viewable_real_invalidate_preview (GimpViewable *viewable);
@ -248,9 +248,9 @@ gimp_viewable_get_property (GObject *object,
}
}
static gsize
static gint64
gimp_viewable_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
TempBuf *temp_buf;
GdkPixbuf *pixbuf;

View File

@ -532,15 +532,14 @@ info_window_update (GimpDisplay *gdisp)
/* size in memory */
{
gulong memsize;
gchar *memsize_str;
GimpObject *object = GIMP_OBJECT (gimage);
gchar *str;
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage), NULL);
memsize_str = gimp_memsize_to_string (memsize);
str = gimp_memsize_to_string (gimp_object_get_memsize (object, NULL));
g_snprintf (iwd->memsize_str, MAX_BUF, "%s", memsize_str);
g_snprintf (iwd->memsize_str, MAX_BUF, "%s", str);
g_free (memsize_str);
g_free (str);
}
type = gimp_image_base_type (gimage);

View File

@ -267,15 +267,15 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
case 'm': /* memory used by image */
{
gulong memsize;
gchar *memsize_str;
GimpObject *object = GIMP_OBJECT (gimage);
gchar *str;
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage), NULL);
memsize_str = gimp_memsize_to_string (memsize);
str = gimp_memsize_to_string (gimp_object_get_memsize (object,
NULL));
i += print (title, title_len, i, "%s", memsize_str);
i += print (title, title_len, i, "%s", str);
g_free (memsize_str);
g_free (str);
}
break;

View File

@ -532,15 +532,14 @@ info_window_update (GimpDisplay *gdisp)
/* size in memory */
{
gulong memsize;
gchar *memsize_str;
GimpObject *object = GIMP_OBJECT (gimage);
gchar *str;
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage), NULL);
memsize_str = gimp_memsize_to_string (memsize);
str = gimp_memsize_to_string (gimp_object_get_memsize (object, NULL));
g_snprintf (iwd->memsize_str, MAX_BUF, "%s", memsize_str);
g_snprintf (iwd->memsize_str, MAX_BUF, "%s", str);
g_free (memsize_str);
g_free (str);
}
type = gimp_image_base_type (gimage);

View File

@ -73,19 +73,19 @@ enum
PROP_BORDER
};
static void gimp_text_class_init (GimpTextClass *klass);
static void gimp_text_finalize (GObject *object);
static void gimp_text_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_text_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static gsize gimp_text_get_memsize (GimpObject *object,
gsize *gui_size);
static gchar * gimp_text_get_default_language (void);
static void gimp_text_class_init (GimpTextClass *klass);
static void gimp_text_finalize (GObject *object);
static void gimp_text_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_text_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static gint64 gimp_text_get_memsize (GimpObject *object,
gint64 *gui_size);
static gchar * gimp_text_get_default_language (void);
static GimpObjectClass *parent_class = NULL;
@ -479,12 +479,12 @@ gimp_text_set_property (GObject *object,
}
}
static gsize
static gint64
gimp_text_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpText *text;
gsize memsize = 0;
gint64 memsize = 0;
text = GIMP_TEXT (object);

View File

@ -58,8 +58,8 @@ static void gimp_text_layer_init (GimpTextLayer *layer);
static void gimp_text_layer_dispose (GObject *object);
static void gimp_text_layer_finalize (GObject *object);
static gsize gimp_text_layer_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_text_layer_get_memsize (GimpObject *object,
gint64 *gui_size);
static TempBuf * gimp_text_layer_get_preview (GimpViewable *viewable,
gint width,
gint height);
@ -181,12 +181,12 @@ gimp_text_layer_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_text_layer_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpTextLayer *text_layer;
gsize memsize = 0;
gint64 memsize = 0;
text_layer = GIMP_TEXT_LAYER (object);

View File

@ -47,10 +47,10 @@ static void gimp_stroke_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_stroke_finalize (GObject *object);
static void gimp_stroke_finalize (GObject *object);
static gsize gimp_stroke_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_stroke_get_memsize (GimpObject *object,
gint64 *gui_size);
static gdouble gimp_stroke_real_nearest_point_get (const GimpStroke *stroke,
const GimpCoords *coord,
@ -362,12 +362,12 @@ gimp_stroke_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_stroke_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpStroke *stroke;
gsize memsize = 0;
gint64 memsize = 0;
stroke = GIMP_STROKE (object);

View File

@ -59,8 +59,8 @@ static void gimp_vectors_init (GimpVectors *vectors);
static void gimp_vectors_finalize (GObject *object);
static gsize gimp_vectors_get_memsize (GimpObject *object,
gsize *gui_size);
static gint64 gimp_vectors_get_memsize (GimpObject *object,
gint64 *gui_size);
static GimpItem * gimp_vectors_duplicate (GimpItem *item,
GType new_type,
@ -265,13 +265,13 @@ gimp_vectors_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
static gint64
gimp_vectors_get_memsize (GimpObject *object,
gsize *gui_size)
gint64 *gui_size)
{
GimpVectors *vectors;
GList *list;
gsize memsize = 0;
gint64 memsize = 0;
vectors = GIMP_VECTORS (object);