Commit 45842e26 authored by Manish Singh's avatar Manish Singh

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
parent 76e79ec3
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
......
/* 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
......
/* 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
......
/* 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
......
/* 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
......
/* 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
......
/* 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
......
......@@ -105,14 +105,12 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
PixelRegion shadowPR;
int x1, y1, x2, y2;
if (! drawable)
return;
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
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");
......
......@@ -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 *);
......
......@@ -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;
......
......@@ -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);
}
/* 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);