added 2000 to the copyrights

* tools/pdbgen/*.pl: added 2000 to the copyrights

* tools/pdbgen/lib.pl: it's foo_pdb.[ch] now

* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/parasite.pdb: reenabled sanity checks for the
drawable IDs and the parasite names

* app/drawable.c
* app/gimpdrawable.c: added a bunch of g_return_if_fail's, instead
of the silent check and return in many functions. This should also
be done in gimpimage.c and the like too.

* app/gimpdrawable.h
* app/layer.c: cosmetic code fix

-Yosh
This commit is contained in:
Manish Singh 2000-02-17 11:44:27 +00:00
parent 76e79ec311
commit 45842e262a
55 changed files with 458 additions and 294 deletions

View file

@ -1,3 +1,21 @@
Thu Feb 17 03:30:40 PST 2000 Manish Singh <yosh@gimp.org>
* tools/pdbgen/*.pl: added 2000 to the copyrights
* tools/pdbgen/lib.pl: it's foo_pdb.[ch] now
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/parasite.pdb: reenabled sanity checks for the
drawable IDs and the parasite names
* app/drawable.c
* app/gimpdrawable.c: added a bunch of g_return_if_fail's, instead
of the silent check and return in many functions. This should also
be done in gimpimage.c and the like too.
* app/gimpdrawable.h
* app/layer.c: cosmetic code fix
Thu Feb 17 11:02:27 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/gap/gap_decode_mpeg_main.c

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -105,14 +105,12 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
PixelRegion shadowPR;
int x1, y1, x2, y2;
if (! drawable)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
if (! gimage->shadow)
return;
gimage = gimp_drawable_gimage (drawable);
g_return_if_fail (gimage != NULL);
g_return_if_fail (gimage->shadow != NULL);
/* A useful optimization here is to limit the update to the
* extents of the selection mask, as it cannot extend beyond
@ -137,9 +135,11 @@ gimp_drawable_fill (GimpDrawable *drawable,
guchar c[MAX_CHANNELS];
guchar i;
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
g_assert (gimage);
g_return_if_fail (gimage != NULL);
switch (gimp_drawable_type (drawable))
{
@ -186,14 +186,14 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
gint *x2,
gint *y2)
{
GImage *gimage;
GimpImage *gimage;
gint off_x, off_y;
if (! drawable)
return FALSE;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (! (gimage = gimp_drawable_gimage (drawable)))
return FALSE;
gimage = gimp_drawable_gimage (drawable);
g_return_val_if_fail (gimage != NULL, FALSE);
if (gimage_mask_bounds (gimage, x1, y1, x2, y2))
{
@ -215,10 +215,10 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
void
gimp_drawable_invalidate_preview (GimpDrawable *drawable)
{
GImage *gimage;
GimpImage *gimage;
if (! drawable)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->preview_valid = FALSE;
#if 0
@ -238,8 +238,9 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
GimpImage *
gimp_drawable_gimage (GimpDrawable *drawable)
{
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->gimage;
}
@ -247,7 +248,8 @@ void
gimp_drawable_set_gimage (GimpDrawable *drawable,
GimpImage *gimage)
{
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (gimage == NULL)
drawable->tattoo = 0;
@ -260,19 +262,19 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
gboolean
gimp_drawable_has_alpha (GimpDrawable *drawable)
{
if (drawable)
return drawable->has_alpha;
else
return FALSE;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
}
GimpImageType
gimp_drawable_type (GimpDrawable *drawable)
{
if (drawable)
return drawable->type;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->type;
}
GimpImageType
@ -281,7 +283,8 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
GimpImageType type;
gboolean has_alpha;
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
@ -307,6 +310,7 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
@ -315,6 +319,7 @@ gimp_drawable_visible (GimpDrawable *drawable)
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
@ -331,6 +336,7 @@ gimp_drawable_set_name (GimpDrawable *drawable,
gchar *ext;
gchar numberbuf[20];
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (name != NULL);
@ -416,28 +422,34 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
guchar *src;
guchar *dest;
if (!drawable ||
(!gimp_drawable_gimage (drawable) && gimp_drawable_is_indexed (drawable))
|| x < 0 || y < 0 ||
x >= drawable->width || y >= drawable->height)
{
return NULL;
}
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_drawable_gimage (drawable), NULL);
g_return_val_if_fail (!gimp_drawable_is_indexed (drawable), NULL);
g_return_val_if_fail (x >= 0 || x < drawable->width ||
y >= 0 || y < drawable->height, NULL);
dest = g_new (guchar, 5);
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, FALSE);
src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
gimp_image_get_color (gimp_drawable_gimage (drawable),
gimp_drawable_type (drawable), dest, src);
if(TYPE_HAS_ALPHA(gimp_drawable_type (drawable)))
if (TYPE_HAS_ALPHA (gimp_drawable_type (drawable)))
dest[3] = src[gimp_drawable_bytes (drawable) - 1];
else
dest[3] = 255;
if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0];
else
dest[4] = 0;
tile_release (tile, FALSE);
return dest;
}
@ -445,6 +457,7 @@ Parasite *
gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return parasite_list_find (drawable->parasites, name);
@ -465,10 +478,11 @@ gimp_drawable_parasite_list (GimpDrawable *drawable,
gchar **list;
gchar **cur;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
*count = parasite_list_length (drawable->parasites);
cur = list = (gchar **) g_malloc (sizeof (gchar *) * *count);
cur = list = g_new (gchar *, *count);
parasite_list_foreach (drawable->parasites, (GHFunc) list_func, &cur);
@ -479,6 +493,7 @@ void
gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
/* only set the dirty bit manually if we can be saved and the new
@ -490,10 +505,10 @@ gimp_drawable_parasite_attach (GimpDrawable *drawable,
undo_push_drawable_parasite (drawable->gimage, drawable, parasite);
}
else if (parasite_is_persistent(parasite) &&
!parasite_compare( parasite,
else if (parasite_is_persistent (parasite) &&
!parasite_compare (parasite,
gimp_drawable_parasite_find
(drawable, parasite_name (parasite))))
(drawable, parasite_name (parasite))))
undo_push_cantundo (drawable->gimage, _("parasite attach to drawable"));
parasite_list_add (drawable->parasites, parasite);
@ -520,6 +535,7 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
{
Parasite *p;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!(p = parasite_list_find (drawable->parasites, parasite)))
@ -537,14 +553,16 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
Tattoo
gimp_drawable_get_tattoo (const GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, 0);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return drawable->tattoo;
}
void
gimp_drawable_set_tattoo(GimpDrawable *drawable, Tattoo val)
gimp_drawable_set_tattoo (GimpDrawable *drawable, Tattoo val)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->tattoo = val;
@ -553,6 +571,9 @@ gimp_drawable_set_tattoo(GimpDrawable *drawable, Tattoo val)
gboolean
gimp_drawable_is_rgb (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == RGBA_GIMAGE ||
gimp_drawable_type (drawable) == RGB_GIMAGE)
return TRUE;
@ -563,6 +584,9 @@ gimp_drawable_is_rgb (GimpDrawable *drawable)
gboolean
gimp_drawable_is_gray (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
gimp_drawable_type (drawable) == GRAY_GIMAGE)
return TRUE;
@ -573,6 +597,9 @@ gimp_drawable_is_gray (GimpDrawable *drawable)
gboolean
gimp_drawable_is_indexed (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
gimp_drawable_type (drawable) == INDEXED_GIMAGE)
return TRUE;
@ -583,10 +610,10 @@ gimp_drawable_is_indexed (GimpDrawable *drawable)
TileManager *
gimp_drawable_data (GimpDrawable *drawable)
{
if (drawable)
return drawable->tiles;
else
return NULL;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->tiles;
}
TileManager *
@ -594,41 +621,41 @@ gimp_drawable_shadow (GimpDrawable *drawable)
{
GImage *gimage;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (! (gimage = gimp_drawable_gimage (drawable)))
return NULL;
if (drawable)
return gimage_shadow (gimage, drawable->width, drawable->height,
drawable->bytes);
else
return NULL;
return gimage_shadow (gimage, drawable->width, drawable->height,
drawable->bytes);
}
int
gimp_drawable_bytes (GimpDrawable *drawable)
{
if (drawable)
return drawable->bytes;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->bytes;
}
gint
gimp_drawable_width (GimpDrawable *drawable)
{
if (drawable)
return drawable->width;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->width;
}
gint
gimp_drawable_height (GimpDrawable *drawable)
{
if (drawable)
return drawable->height;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->height;
}
void
@ -636,29 +663,33 @@ gimp_drawable_offsets (GimpDrawable *drawable,
gint *off_x,
gint *off_y)
{
if (drawable)
{
*off_x = drawable->offset_x;
*off_y = drawable->offset_y;
}
else
*off_x = *off_y = 0;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
*off_x = drawable->offset_x;
*off_y = drawable->offset_y;
}
guchar *
gimp_drawable_cmap (GimpDrawable *drawable)
{
GImage *gimage;
GimpImage *gimage;
if ((gimage = gimp_drawable_gimage (drawable)))
return gimage->cmap;
else
return NULL;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
gimage = gimp_drawable_gimage (drawable);
g_return_val_if_fail (gimage != NULL, NULL);
return gimage->cmap;
}
void
gimp_drawable_deallocate (GimpDrawable *drawable)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (drawable->tiles)
tile_manager_destroy (drawable->tiles);
}
@ -674,20 +705,22 @@ gimp_drawable_init (GimpDrawable *drawable)
drawable->offset_x = 0;
drawable->offset_y = 0;
drawable->bytes = 0;
drawable->ID = global_drawable_ID++;
drawable->tattoo = 0;
drawable->gimage = NULL;
drawable->type = -1;
drawable->has_alpha = FALSE;
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
drawable->parasites = parasite_list_new ();
drawable->tattoo = 0;
drawable->ID = global_drawable_ID++;
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
if (gimp_drawable_table == NULL)
gimp_drawable_table = g_hash_table_new (g_direct_hash, NULL);
g_hash_table_insert (gimp_drawable_table, (gpointer) drawable->ID,
g_hash_table_insert (gimp_drawable_table,
(gpointer) drawable->ID,
(gpointer) drawable);
}
@ -730,6 +763,9 @@ gimp_drawable_configure (GimpDrawable *drawable,
gint bpp;
gboolean alpha;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!name)
name = _("unnamed");

View file

@ -50,9 +50,9 @@ gint gimp_drawable_clean (GimpDrawable *);
gboolean gimp_drawable_has_alpha (GimpDrawable *);
GimpImageType gimp_drawable_type (GimpDrawable *);
GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *);
gboolean gimp_drawable_is_rgb (GimpDrawable *);
gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_is_indexed (GimpDrawable *);
gboolean gimp_drawable_is_rgb (GimpDrawable *);
gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_is_indexed (GimpDrawable *);
TileManager * gimp_drawable_data (GimpDrawable *);
TileManager * gimp_drawable_shadow (GimpDrawable *);
gint gimp_drawable_bytes (GimpDrawable *);

View file

@ -67,7 +67,7 @@ static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type ()
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
@ -118,7 +118,7 @@ gimp_layer_init (GimpLayer *layer)
}
GtkType
gimp_layer_mask_get_type ()
gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;

View file

@ -25,12 +25,10 @@
gint
drawable_ID (GimpDrawable *drawable)
{
if (drawable)
return drawable->ID;
else
g_warning ("drawable_ID called on a NULL pointer");
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return 0;
return drawable->ID;
}
void
@ -39,6 +37,9 @@ drawable_fill (GimpDrawable *drawable,
{
guchar r, g, b, a;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
a = 255;
switch (fill_type)
@ -85,11 +86,11 @@ drawable_update (GimpDrawable *drawable,
GimpImage *gimage;
gint offset_x, offset_y;
if (! drawable)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
gimage = gimp_drawable_gimage (drawable);
g_return_if_fail (gimage != NULL);
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
x += offset_x;
@ -109,13 +110,13 @@ drawable_apply_image (GimpDrawable *drawable,
TileManager *tiles,
gint sparse)
{
if (drawable)
{
if (! tiles)
undo_push_image (drawable->gimage, drawable,
x1, y1, x2, y2);
else
undo_push_image_mod (drawable->gimage, drawable,
x1, y1, x2, y2, tiles, sparse);
}
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (! tiles)
undo_push_image (drawable->gimage, drawable,
x1, y1, x2, y2);
else
undo_push_image_mod (drawable->gimage, drawable,
x1, y1, x2, y2, tiles, sparse);
}

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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
@ -180,6 +180,7 @@ static ProcRecord drawable_fill_proc =
static Argument *
drawable_update_invoker (Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 x;
gint32 y;
@ -187,6 +188,8 @@ drawable_update_invoker (Argument *args)
gint32 height;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
x = args[1].value.pdb_int;
@ -196,9 +199,10 @@ drawable_update_invoker (Argument *args)
height = args[4].value.pdb_int;
drawable_update (drawable, x, y, width, height);
if (success)
drawable_update (drawable, x, y, width, height);
return procedural_db_return_args (&drawable_update_proc, TRUE);
return procedural_db_return_args (&drawable_update_proc, success);
}
static ProcArg drawable_update_inargs[] =
@ -249,25 +253,32 @@ static ProcRecord drawable_update_proc =
static Argument *
drawable_mask_bounds_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gboolean non_empty;
gboolean non_empty = FALSE;
gint32 x1;
gint32 y1;
gint32 x2;
gint32 y2;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
non_empty = drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
if (success)
non_empty = drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
return_args = procedural_db_return_args (&drawable_mask_bounds_proc, TRUE);
return_args = procedural_db_return_args (&drawable_mask_bounds_proc, success);
return_args[1].value.pdb_int = non_empty;
return_args[2].value.pdb_int = x1;
return_args[3].value.pdb_int = y1;
return_args[4].value.pdb_int = x2;
return_args[5].value.pdb_int = y2;
if (success)
{
return_args[1].value.pdb_int = non_empty;
return_args[2].value.pdb_int = x1;
return_args[3].value.pdb_int = y1;
return_args[4].value.pdb_int = x2;
return_args[5].value.pdb_int = y2;
}
return return_args;
}
@ -439,13 +450,18 @@ static ProcRecord drawable_type_proc =
static Argument *
drawable_has_alpha_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_has_alpha_proc, TRUE);
return_args[1].value.pdb_int = drawable_has_alpha (drawable);
return_args = procedural_db_return_args (&drawable_has_alpha_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_has_alpha (drawable);
return return_args;
}
@ -487,13 +503,18 @@ static ProcRecord drawable_has_alpha_proc =
static Argument *
drawable_type_with_alpha_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_type_with_alpha_proc, TRUE);
return_args[1].value.pdb_int = drawable_type_with_alpha (drawable);
return_args = procedural_db_return_args (&drawable_type_with_alpha_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_type_with_alpha (drawable);
return return_args;
}
@ -535,13 +556,18 @@ static ProcRecord drawable_type_with_alpha_proc =
static Argument *
drawable_is_rgb_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_rgb_proc, TRUE);
return_args[1].value.pdb_int = drawable_color (drawable);
return_args = procedural_db_return_args (&drawable_is_rgb_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_color (drawable);
return return_args;
}
@ -583,13 +609,18 @@ static ProcRecord drawable_is_rgb_proc =
static Argument *
drawable_is_gray_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_gray_proc, TRUE);
return_args[1].value.pdb_int = drawable_gray (drawable);
return_args = procedural_db_return_args (&drawable_is_gray_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_gray (drawable);
return return_args;
}
@ -631,13 +662,18 @@ static ProcRecord drawable_is_gray_proc =
static Argument *
drawable_is_indexed_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_indexed_proc, TRUE);
return_args[1].value.pdb_int = drawable_indexed (drawable);
return_args = procedural_db_return_args (&drawable_is_indexed_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_indexed (drawable);
return return_args;
}
@ -679,13 +715,18 @@ static ProcRecord drawable_is_indexed_proc =
static Argument *
drawable_bytes_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_bytes_proc, TRUE);
return_args[1].value.pdb_int = drawable_bytes (drawable);
return_args = procedural_db_return_args (&drawable_bytes_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_bytes (drawable);
return return_args;
}
@ -727,13 +768,18 @@ static ProcRecord drawable_bytes_proc =
static Argument *
drawable_width_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_width_proc, TRUE);
return_args[1].value.pdb_int = drawable_width (drawable);
return_args = procedural_db_return_args (&drawable_width_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_width (drawable);
return return_args;
}
@ -775,13 +821,18 @@ static ProcRecord drawable_width_proc =
static Argument *
drawable_height_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_height_proc, TRUE);
return_args[1].value.pdb_int = drawable_height (drawable);
return_args = procedural_db_return_args (&drawable_height_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_height (drawable);
return return_args;
}
@ -823,19 +874,26 @@ static ProcRecord drawable_height_proc =
static Argument *
drawable_offsets_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gint32 offset_x;
gint32 offset_y;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
drawable_offsets (drawable, &offset_x, &offset_y);
if (success)
drawable_offsets (drawable, &offset_x, &offset_y);
return_args = procedural_db_return_args (&drawable_offsets_proc, TRUE);
return_args = procedural_db_return_args (&drawable_offsets_proc, success);
return_args[1].value.pdb_int = offset_x;
return_args[2].value.pdb_int = offset_y;
if (success)
{
return_args[1].value.pdb_int = offset_x;
return_args[2].value.pdb_int = offset_y;
}
return return_args;
}
@ -882,13 +940,18 @@ static ProcRecord drawable_offsets_proc =
static Argument *
drawable_is_layer_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_layer_proc, TRUE);
return_args[1].value.pdb_int = drawable_layer (drawable) ? TRUE : FALSE;
return_args = procedural_db_return_args (&drawable_is_layer_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_layer (drawable) ? TRUE : FALSE;
return return_args;
}
@ -930,13 +993,18 @@ static ProcRecord drawable_is_layer_proc =
static Argument *
drawable_is_layer_mask_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_layer_mask_proc, TRUE);
return_args[1].value.pdb_int = drawable_layer_mask (drawable) ? TRUE : FALSE;
return_args = procedural_db_return_args (&drawable_is_layer_mask_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_layer_mask (drawable) ? TRUE : FALSE;
return return_args;
}
@ -978,13 +1046,18 @@ static ProcRecord drawable_is_layer_mask_proc =
static Argument *
drawable_is_channel_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
drawable = gimp_drawable_get_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
return_args = procedural_db_return_args (&drawable_is_channel_proc, TRUE);
return_args[1].value.pdb_int = drawable_channel (drawable) ? TRUE : FALSE;
return_args = procedural_db_return_args (&drawable_is_channel_proc, success);
if (success)
return_args[1].value.pdb_int = drawable_channel (drawable) ? TRUE : FALSE;
return return_args;
}

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -105,14 +105,12 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
PixelRegion shadowPR;
int x1, y1, x2, y2;
if (! drawable)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
if (! gimage->shadow)
return;
gimage = gimp_drawable_gimage (drawable);
g_return_if_fail (gimage != NULL);
g_return_if_fail (gimage->shadow != NULL);
/* A useful optimization here is to limit the update to the
* extents of the selection mask, as it cannot extend beyond
@ -137,9 +135,11 @@ gimp_drawable_fill (GimpDrawable *drawable,
guchar c[MAX_CHANNELS];
guchar i;
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
g_assert (gimage);
g_return_if_fail (gimage != NULL);
switch (gimp_drawable_type (drawable))
{
@ -186,14 +186,14 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
gint *x2,
gint *y2)
{
GImage *gimage;
GimpImage *gimage;
gint off_x, off_y;
if (! drawable)
return FALSE;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (! (gimage = gimp_drawable_gimage (drawable)))
return FALSE;
gimage = gimp_drawable_gimage (drawable);
g_return_val_if_fail (gimage != NULL, FALSE);
if (gimage_mask_bounds (gimage, x1, y1, x2, y2))
{
@ -215,10 +215,10 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
void
gimp_drawable_invalidate_preview (GimpDrawable *drawable)
{
GImage *gimage;
GimpImage *gimage;
if (! drawable)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->preview_valid = FALSE;
#if 0
@ -238,8 +238,9 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
GimpImage *
gimp_drawable_gimage (GimpDrawable *drawable)
{
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->gimage;
}
@ -247,7 +248,8 @@ void
gimp_drawable_set_gimage (GimpDrawable *drawable,
GimpImage *gimage)
{
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (gimage == NULL)
drawable->tattoo = 0;
@ -260,19 +262,19 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
gboolean
gimp_drawable_has_alpha (GimpDrawable *drawable)
{
if (drawable)
return drawable->has_alpha;
else
return FALSE;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
}
GimpImageType
gimp_drawable_type (GimpDrawable *drawable)
{
if (drawable)
return drawable->type;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->type;
}
GimpImageType
@ -281,7 +283,8 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
GimpImageType type;
gboolean has_alpha;
g_assert (GIMP_IS_DRAWABLE (drawable));
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
@ -307,6 +310,7 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
@ -315,6 +319,7 @@ gimp_drawable_visible (GimpDrawable *drawable)
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
@ -331,6 +336,7 @@ gimp_drawable_set_name (GimpDrawable *drawable,
gchar *ext;
gchar numberbuf[20];
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (name != NULL);
@ -416,28 +422,34 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
guchar *src;
guchar *dest;
if (!drawable ||
(!gimp_drawable_gimage (drawable) && gimp_drawable_is_indexed (drawable))
|| x < 0 || y < 0 ||
x >= drawable->width || y >= drawable->height)
{
return NULL;
}
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_drawable_gimage (drawable), NULL);
g_return_val_if_fail (!gimp_drawable_is_indexed (drawable), NULL);
g_return_val_if_fail (x >= 0 || x < drawable->width ||
y >= 0 || y < drawable->height, NULL);
dest = g_new (guchar, 5);
tile = tile_manager_get_tile (gimp_drawable_data (drawable), x, y,
TRUE, FALSE);
src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
gimp_image_get_color (gimp_drawable_gimage (drawable),
gimp_drawable_type (drawable), dest, src);
if(TYPE_HAS_ALPHA(gimp_drawable_type (drawable)))
if (TYPE_HAS_ALPHA (gimp_drawable_type (drawable)))
dest[3] = src[gimp_drawable_bytes (drawable) - 1];
else
dest[3] = 255;
if (gimp_drawable_is_indexed (drawable))
dest[4] = src[0];
else
dest[4] = 0;
tile_release (tile, FALSE);
return dest;
}
@ -445,6 +457,7 @@ Parasite *
gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return parasite_list_find (drawable->parasites, name);
@ -465,10 +478,11 @@ gimp_drawable_parasite_list (GimpDrawable *drawable,
gchar **list;
gchar **cur;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
*count = parasite_list_length (drawable->parasites);
cur = list = (gchar **) g_malloc (sizeof (gchar *) * *count);
cur = list = g_new (gchar *, *count);
parasite_list_foreach (drawable->parasites, (GHFunc) list_func, &cur);
@ -479,6 +493,7 @@ void
gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
/* only set the dirty bit manually if we can be saved and the new
@ -490,10 +505,10 @@ gimp_drawable_parasite_attach (GimpDrawable *drawable,
undo_push_drawable_parasite (drawable->gimage, drawable, parasite);
}
else if (parasite_is_persistent(parasite) &&
!parasite_compare( parasite,
else if (parasite_is_persistent (parasite) &&
!parasite_compare (parasite,
gimp_drawable_parasite_find
(drawable, parasite_name (parasite))))
(drawable, parasite_name (parasite))))
undo_push_cantundo (drawable->gimage, _("parasite attach to drawable"));
parasite_list_add (drawable->parasites, parasite);
@ -520,6 +535,7 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
{
Parasite *p;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!(p = parasite_list_find (drawable->parasites, parasite)))
@ -537,14 +553,16 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
Tattoo
gimp_drawable_get_tattoo (const GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, 0);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return drawable->tattoo;
}
void
gimp_drawable_set_tattoo(GimpDrawable *drawable, Tattoo val)
gimp_drawable_set_tattoo (GimpDrawable *drawable, Tattoo val)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->tattoo = val;
@ -553,6 +571,9 @@ gimp_drawable_set_tattoo(GimpDrawable *drawable, Tattoo val)
gboolean
gimp_drawable_is_rgb (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == RGBA_GIMAGE ||
gimp_drawable_type (drawable) == RGB_GIMAGE)
return TRUE;
@ -563,6 +584,9 @@ gimp_drawable_is_rgb (GimpDrawable *drawable)
gboolean
gimp_drawable_is_gray (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
gimp_drawable_type (drawable) == GRAY_GIMAGE)
return TRUE;
@ -573,6 +597,9 @@ gimp_drawable_is_gray (GimpDrawable *drawable)
gboolean
gimp_drawable_is_indexed (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
gimp_drawable_type (drawable) == INDEXED_GIMAGE)
return TRUE;
@ -583,10 +610,10 @@ gimp_drawable_is_indexed (GimpDrawable *drawable)
TileManager *
gimp_drawable_data (GimpDrawable *drawable)
{
if (drawable)
return drawable->tiles;
else
return NULL;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->tiles;
}
TileManager *
@ -594,41 +621,41 @@ gimp_drawable_shadow (GimpDrawable *drawable)
{
GImage *gimage;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (! (gimage = gimp_drawable_gimage (drawable)))
return NULL;
if (drawable)
return gimage_shadow (gimage, drawable->width, drawable->height,
drawable->bytes);
else
return NULL;
return gimage_shadow (gimage, drawable->width, drawable->height,
drawable->bytes);
}
int
gimp_drawable_bytes (GimpDrawable *drawable)
{
if (drawable)
return drawable->bytes;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->bytes;
}
gint
gimp_drawable_width (GimpDrawable *drawable)
{
if (drawable)
return drawable->width;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->width;
}
gint
gimp_drawable_height (GimpDrawable *drawable)
{
if (drawable)
return drawable->height;
else
return -1;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->height;
}
void
@ -636,29 +663,33 @@ gimp_drawable_offsets (GimpDrawable *drawable,
gint *off_x,
gint *off_y)
{
if (drawable)
{
*off_x = drawable->offset_x;
*off_y = drawable->offset_y;
}
else
*off_x = *off_y = 0;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
*off_x = drawable->offset_x;
*off_y = drawable->offset_y;
}
guchar *
gimp_drawable_cmap (GimpDrawable *drawable)
{
GImage *gimage;
GimpImage *gimage;
if ((gimage = gimp_drawable_gimage (drawable)))
return gimage->cmap;
else
return NULL;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
gimage = gimp_drawable_gimage (drawable);
g_return_val_if_fail (gimage != NULL, NULL);
return gimage->cmap;
}
void
gimp_drawable_deallocate (GimpDrawable *drawable)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (drawable->tiles)
tile_manager_destroy (drawable->tiles);
}
@ -674,20 +705,22 @@ gimp_drawable_init (GimpDrawable *drawable)
drawable->offset_x = 0;
drawable->offset_y = 0;
drawable->bytes = 0;
drawable->ID = global_drawable_ID++;
drawable->tattoo = 0;
drawable->gimage = NULL;
drawable->type = -1;
drawable->has_alpha = FALSE;
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
drawable->parasites = parasite_list_new ();
drawable->tattoo = 0;
drawable->ID = global_drawable_ID++;
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
if (gimp_drawable_table == NULL)
gimp_drawable_table = g_hash_table_new (g_direct_hash, NULL);
g_hash_table_insert (gimp_drawable_table, (gpointer) drawable->ID,
g_hash_table_insert (gimp_drawable_table,
(gpointer) drawable->ID,
(gpointer) drawable);
}
@ -730,6 +763,9 @@ gimp_drawable_configure (GimpDrawable *drawable,
gint bpp;
gboolean alpha;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!name)
name = _("unnamed");

View file

@ -50,9 +50,9 @@ gint gimp_drawable_clean (GimpDrawable *);
gboolean gimp_drawable_has_alpha (GimpDrawable *);
GimpImageType gimp_drawable_type (GimpDrawable *);
GimpImageType gimp_drawable_type_with_alpha (GimpDrawable *);
gboolean gimp_drawable_is_rgb (GimpDrawable *);
gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_is_indexed (GimpDrawable *);
gboolean gimp_drawable_is_rgb (GimpDrawable *);
gboolean gimp_drawable_is_gray (GimpDrawable *);
gboolean gimp_drawable_is_indexed (GimpDrawable *);
TileManager * gimp_drawable_data (GimpDrawable *);
TileManager * gimp_drawable_shadow (GimpDrawable *);
gint gimp_drawable_bytes (GimpDrawable *);

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -67,7 +67,7 @@ static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type ()
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
@ -118,7 +118,7 @@ gimp_layer_init (GimpLayer *layer)
}
GtkType
gimp_layer_mask_get_type ()
gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -67,7 +67,7 @@ static GimpDrawableClass *layer_parent_class = NULL;
static GimpChannelClass *layer_mask_parent_class = NULL;
GtkType
gimp_layer_get_type ()
gimp_layer_get_type (void)
{
static GtkType layer_type = 0;
@ -118,7 +118,7 @@ gimp_layer_init (GimpLayer *layer)
}
GtkType
gimp_layer_mask_get_type ()
gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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
@ -71,6 +71,8 @@ parasite_new_invoker (Argument *args)
Parasite *parasite = NULL;
name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL)
success = FALSE;
flags = args[1].value.pdb_int;
@ -154,9 +156,14 @@ parasite_find_invoker (Argument *args)
Parasite *parasite = NULL;
name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL)
success = FALSE;
parasite = parasite_copy (gimp_parasite_find (name));
success = parasite != NULL;
if (success)
{
parasite = parasite_copy (gimp_parasite_find (name));
success = parasite != NULL;
}
return_args = procedural_db_return_args (&parasite_find_proc, success);
@ -343,6 +350,8 @@ drawable_parasite_find_invoker (Argument *args)
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL)
success = FALSE;
if (success)
{
@ -579,6 +588,8 @@ image_parasite_find_invoker (Argument *args)
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL)
success = FALSE;
if (success)
{

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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
@ -646,7 +646,7 @@ CODE
my $gpl = <<'GPL';
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
* Copyright (C) 1995-2000 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

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# The GIMP -- an image manipulation program
# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1999-2000 Manish Singh <yosh@gimp.org>
# 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

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# The GIMP -- an image manipulation program
# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1999-2000 Manish Singh <yosh@gimp.org>
# 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
@ -35,7 +35,7 @@ require 'util.pl';
my $header = <<'HEADER';
:# The GIMP -- an image manipulation program
:# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
:# Copyright (C) 1999-2000 Manish Singh <yosh@gimp.org>
:
:# 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

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1999-2000 Manish Singh <yosh@gimp.org>
# 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

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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
@ -380,7 +380,7 @@ CODE
my $lgpl = <<'LGPL';
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -405,11 +405,10 @@ LGPL
# We generate two files, a .h file with prototypes for all the functions
# we make, and a .c file for the actual implementation
while (my($group, $out) = each %out) {
my $hfile = "$destdir/gimp${group}.h$FILE_EXT";
my $cfile = "$destdir/gimp${group}.c$FILE_EXT";
my $hfile = "$destdir/gimp${group}pdb.h$FILE_EXT";
my $cfile = "$destdir/gimp${group}pdb.c$FILE_EXT";
$hfile =~ s/_//g;
$cfile =~ s/_//g;
foreach ($hfile $cfile) { s/_//g; s/pdb\./_pdb./ }
my $extra = {};
if (exists $main::grp{$group}->{extra}->{lib}) {

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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

View file

@ -88,7 +88,8 @@ HELP
{ name => 'alpha_dither', type => 'boolean',
desc => 'dither transparency to fake partial opacity' },
{ name => 'remove_unused', type => 'boolean',
desc => 'remove unused or duplicate colour entries from final palette, ignored if (palette_type == MAKE_PALETTE)' },
desc => 'remove unused or duplicate colour entries from final
palette, ignored if (palette_type == MAKE_PALETTE)' },
{ name => 'palette', type => 'string',
desc => 'The name of the custom palette to use, ignored unless
(palette_type == CUSTOM_PALETTE)',

View file

@ -17,16 +17,14 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub drawable_arg {{
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The drawable',
no_success => 1
}}
sub drawable_coord_args {
sub drawable_coord_args () {
@inargs = ( &drawable_arg );
delete $inargs[0]->{no_success};
foreach (qw(x y)) {
push @inargs, { name => "${_}_coord", type => '0 <= int32',
@ -34,7 +32,7 @@ sub drawable_coord_args {
}
}
sub pixel_arg {{
sub pixel_arg () {{
name => 'pixel',
type => 'int8array',
desc => 'The pixel value',
@ -104,7 +102,6 @@ HELP
{ name => 'undo', type => 'boolean',
desc => 'Push merge to undo stack?' }
);
delete $inargs[0]->{no_success};
%invoke = ( code => 'drawable_merge_shadow (drawable, undo);' );
}
@ -130,7 +127,6 @@ HELP
{ name => 'fill_type', type => 'enum GimpFillType',
desc => 'The type of fill: %%desc%%' }
);
delete $inargs[0]->{no_success};
%invoke = ( code => 'drawable_fill (drawable, (GimpFillType) fill_type);' );
}
@ -180,7 +176,7 @@ HELP
@inargs = ( &drawable_arg );
@outargs = (
{ name => 'non_empty', type => 'boolean',
{ name => 'non_empty', type => 'boolean', init => 1,
desc => 'TRUE if there is a selection' },
);
@ -214,8 +210,6 @@ sub drawable_image {
$outargs[0]->{desc} = "The drawable's image";
$outargs[0]->{init} = 1;
delete $inargs[0]->{no_success};
%invoke = (
code => 'success = (gimage = drawable_gimage (drawable)) != NULL;'
);
@ -226,8 +220,6 @@ sub drawable_type {
&drawable_prop_proc("the drawable's type", 'type', 'enum GimpImageType',
'type', "The drawable's type: { %%desc%% }");
delete $inargs[0]->{no_success};
}
sub drawable_has_alpha {
@ -382,8 +374,8 @@ HELP
&std_pdb_misc;
$date = '1997';
&drawable_coord_args();
push @inargs, &pixel_arg();
&drawable_coord_args;
push @inargs, &pixel_arg;
%invoke = (
vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ],
@ -425,7 +417,6 @@ HELP
&drawable_arg,
&std_image_arg
);
delete $inargs[0]->{no_success};
%invoke = ( code => 'gimp_drawable_set_gimage (drawable, gimage);' );
}
@ -461,7 +452,6 @@ HELP
desc => 'The thumbnail height',
alias => 'req_height' }
);
delete $inargs[0]->{no_success};
@outargs = (
&dim_args,

View file

@ -26,7 +26,6 @@ sub name_arg {{
name => 'name',
type => 'string',
desc => "The name of the parasite to $_[0]",
no_success => 1
}}
sub parasite_outarg {{

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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

View file

@ -1,5 +1,5 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1998-1999 Manish Singh <yosh@gimp.org>
# Copyright (C) 1998-2000 Manish Singh <yosh@gimp.org>
# 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