diff --git a/ChangeLog b/ChangeLog index e33731202f..e6c14d3aee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +Thu Feb 17 03:30:40 PST 2000 Manish Singh + + * 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 * plug-ins/gap/gap_decode_mpeg_main.c diff --git a/app/brush_select_cmds.c b/app/brush_select_cmds.c index 568b734a8b..c3a4a6b7a9 100644 --- a/app/brush_select_cmds.c +++ b/app/brush_select_cmds.c @@ -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 diff --git a/app/brushes_cmds.c b/app/brushes_cmds.c index 371912fe96..3c2d4f7127 100644 --- a/app/brushes_cmds.c +++ b/app/brushes_cmds.c @@ -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 diff --git a/app/channel_cmds.c b/app/channel_cmds.c index 2c7df7377b..5bbe65b4e7 100644 --- a/app/channel_cmds.c +++ b/app/channel_cmds.c @@ -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 diff --git a/app/channel_ops_cmds.c b/app/channel_ops_cmds.c index c2e21dc559..ef25af2b91 100644 --- a/app/channel_ops_cmds.c +++ b/app/channel_ops_cmds.c @@ -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 diff --git a/app/color_cmds.c b/app/color_cmds.c index e7bb92590e..e4d22bb56b 100644 --- a/app/color_cmds.c +++ b/app/color_cmds.c @@ -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 diff --git a/app/convert_cmds.c b/app/convert_cmds.c index 15a907f080..e8e8c30498 100644 --- a/app/convert_cmds.c +++ b/app/convert_cmds.c @@ -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 diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index e47f8e68ae..9facfcbee4 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -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"); diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 78ddb9a6fd..bcc9764971 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -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 *); diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index ef620ab3dc..723c3cfeb9 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -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; diff --git a/app/drawable.c b/app/drawable.c index 99b00c12cb..83fc9e2781 100644 --- a/app/drawable.c +++ b/app/drawable.c @@ -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); } diff --git a/app/drawable_cmds.c b/app/drawable_cmds.c index 6ff9d146f4..5e9d92a83f 100644 --- a/app/drawable_cmds.c +++ b/app/drawable_cmds.c @@ -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; } diff --git a/app/edit_cmds.c b/app/edit_cmds.c index 5e2ea9ba63..a9a2757fe3 100644 --- a/app/edit_cmds.c +++ b/app/edit_cmds.c @@ -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 diff --git a/app/fileops_cmds.c b/app/fileops_cmds.c index e5c7f345ec..a5c7831c45 100644 --- a/app/fileops_cmds.c +++ b/app/fileops_cmds.c @@ -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 diff --git a/app/floating_sel_cmds.c b/app/floating_sel_cmds.c index 19115a8a5d..1fb8bfa6a1 100644 --- a/app/floating_sel_cmds.c +++ b/app/floating_sel_cmds.c @@ -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 diff --git a/app/gdisplay_cmds.c b/app/gdisplay_cmds.c index 3c697f8675..217dd695ac 100644 --- a/app/gdisplay_cmds.c +++ b/app/gdisplay_cmds.c @@ -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 diff --git a/app/gimage_cmds.c b/app/gimage_cmds.c index 7a1f522a65..3e1b7182c3 100644 --- a/app/gimage_cmds.c +++ b/app/gimage_cmds.c @@ -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 diff --git a/app/gimage_mask_cmds.c b/app/gimage_mask_cmds.c index 44cd3f9c8c..01b7d29485 100644 --- a/app/gimage_mask_cmds.c +++ b/app/gimage_mask_cmds.c @@ -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 diff --git a/app/gimpdrawable.c b/app/gimpdrawable.c index e47f8e68ae..9facfcbee4 100644 --- a/app/gimpdrawable.c +++ b/app/gimpdrawable.c @@ -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"); diff --git a/app/gimpdrawable.h b/app/gimpdrawable.h index 78ddb9a6fd..bcc9764971 100644 --- a/app/gimpdrawable.h +++ b/app/gimpdrawable.h @@ -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 *); diff --git a/app/gimphelp_cmds.c b/app/gimphelp_cmds.c index 05cc2050f5..83525880f0 100644 --- a/app/gimphelp_cmds.c +++ b/app/gimphelp_cmds.c @@ -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 diff --git a/app/gimplayer.c b/app/gimplayer.c index ef620ab3dc..723c3cfeb9 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -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; diff --git a/app/gimprc_cmds.c b/app/gimprc_cmds.c index 418ce5aeeb..3b4474fe4f 100644 --- a/app/gimprc_cmds.c +++ b/app/gimprc_cmds.c @@ -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 diff --git a/app/gradient_cmds.c b/app/gradient_cmds.c index 794ad915de..690be4319e 100644 --- a/app/gradient_cmds.c +++ b/app/gradient_cmds.c @@ -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 diff --git a/app/gradient_select_cmds.c b/app/gradient_select_cmds.c index ec67876604..6cde1e968b 100644 --- a/app/gradient_select_cmds.c +++ b/app/gradient_select_cmds.c @@ -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 diff --git a/app/guides_cmds.c b/app/guides_cmds.c index ef8b566206..296111b83e 100644 --- a/app/guides_cmds.c +++ b/app/guides_cmds.c @@ -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 diff --git a/app/interface_cmds.c b/app/interface_cmds.c index a036c3538b..4ce0466ced 100644 --- a/app/interface_cmds.c +++ b/app/interface_cmds.c @@ -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 diff --git a/app/internal_procs.c b/app/internal_procs.c index 89da2dfa70..7e4bfc840e 100644 --- a/app/internal_procs.c +++ b/app/internal_procs.c @@ -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 diff --git a/app/internal_procs.h b/app/internal_procs.h index 9eee03bca6..33b85694c7 100644 --- a/app/internal_procs.h +++ b/app/internal_procs.h @@ -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 diff --git a/app/layer.c b/app/layer.c index ef620ab3dc..723c3cfeb9 100644 --- a/app/layer.c +++ b/app/layer.c @@ -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; diff --git a/app/layer_cmds.c b/app/layer_cmds.c index 152a57e6c2..6b4e2dc706 100644 --- a/app/layer_cmds.c +++ b/app/layer_cmds.c @@ -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 diff --git a/app/misc_cmds.c b/app/misc_cmds.c index 323af5e53d..468cbfa38d 100644 --- a/app/misc_cmds.c +++ b/app/misc_cmds.c @@ -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 diff --git a/app/palette_cmds.c b/app/palette_cmds.c index 8c61d35a82..2344167306 100644 --- a/app/palette_cmds.c +++ b/app/palette_cmds.c @@ -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 diff --git a/app/parasite_cmds.c b/app/parasite_cmds.c index 349ed3e5a1..464791bf1e 100644 --- a/app/parasite_cmds.c +++ b/app/parasite_cmds.c @@ -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 (¶site_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) { diff --git a/app/paths_cmds.c b/app/paths_cmds.c index b82454ae7a..30171be254 100644 --- a/app/paths_cmds.c +++ b/app/paths_cmds.c @@ -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 diff --git a/app/pattern_select_cmds.c b/app/pattern_select_cmds.c index 68face25cd..0fc927522f 100644 --- a/app/pattern_select_cmds.c +++ b/app/pattern_select_cmds.c @@ -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 diff --git a/app/patterns_cmds.c b/app/patterns_cmds.c index e70a65f5ee..8c031d0255 100644 --- a/app/patterns_cmds.c +++ b/app/patterns_cmds.c @@ -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 diff --git a/app/plug_in_cmds.c b/app/plug_in_cmds.c index d4e4877af2..33ac573b59 100644 --- a/app/plug_in_cmds.c +++ b/app/plug_in_cmds.c @@ -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 diff --git a/app/procedural_db_cmds.c b/app/procedural_db_cmds.c index 20823dc599..d20c20205d 100644 --- a/app/procedural_db_cmds.c +++ b/app/procedural_db_cmds.c @@ -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 diff --git a/app/text_tool_cmds.c b/app/text_tool_cmds.c index 907b4c7142..66965e241f 100644 --- a/app/text_tool_cmds.c +++ b/app/text_tool_cmds.c @@ -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 diff --git a/app/tools_cmds.c b/app/tools_cmds.c index 1a51e3a4a1..5ef49a4444 100644 --- a/app/tools_cmds.c +++ b/app/tools_cmds.c @@ -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 diff --git a/app/undo_cmds.c b/app/undo_cmds.c index 6c3d07bc07..858604a8b5 100644 --- a/app/undo_cmds.c +++ b/app/undo_cmds.c @@ -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 diff --git a/app/unit_cmds.c b/app/unit_cmds.c index 8b64552689..ea56df8a6b 100644 --- a/app/unit_cmds.c +++ b/app/unit_cmds.c @@ -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 diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index a6e2926de1..b5d75715c2 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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 diff --git a/tools/pdbgen/enumcode.pl b/tools/pdbgen/enumcode.pl index b161bda3b6..ad4f0cab38 100755 --- a/tools/pdbgen/enumcode.pl +++ b/tools/pdbgen/enumcode.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # The GIMP -- an image manipulation program -# Copyright (C) 1999 Manish Singh +# Copyright (C) 1999-2000 Manish Singh # 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 diff --git a/tools/pdbgen/enumgen.pl b/tools/pdbgen/enumgen.pl index 9e3436de17..b749403521 100755 --- a/tools/pdbgen/enumgen.pl +++ b/tools/pdbgen/enumgen.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # The GIMP -- an image manipulation program -# Copyright (C) 1999 Manish Singh +# Copyright (C) 1999-2000 Manish Singh # 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 +:# Copyright (C) 1999-2000 Manish Singh : :# 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 diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 2a31e7677c..f13d268937 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1999 Manish Singh +# Copyright (C) 1999-2000 Manish Singh # 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 diff --git a/tools/pdbgen/lib.pl b/tools/pdbgen/lib.pl index ab881bb64c..1fd9d5e2c0 100644 --- a/tools/pdbgen/lib.pl +++ b/tools/pdbgen/lib.pl @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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}) { diff --git a/tools/pdbgen/pdb.pl b/tools/pdbgen/pdb.pl index 24478f3baa..a35520678f 100644 --- a/tools/pdbgen/pdb.pl +++ b/tools/pdbgen/pdb.pl @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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 diff --git a/tools/pdbgen/pdb/convert.pdb b/tools/pdbgen/pdb/convert.pdb index 278e631f11..7142deca90 100644 --- a/tools/pdbgen/pdb/convert.pdb +++ b/tools/pdbgen/pdb/convert.pdb @@ -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)', diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index fd864ce833..97d7b6f8b4 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -17,16 +17,14 @@ # "Perlized" from C source by Manish Singh -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, diff --git a/tools/pdbgen/pdb/parasite.pdb b/tools/pdbgen/pdb/parasite.pdb index 7f3a42d33d..ca189790df 100644 --- a/tools/pdbgen/pdb/parasite.pdb +++ b/tools/pdbgen/pdb/parasite.pdb @@ -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 {{ diff --git a/tools/pdbgen/pdbgen.pl b/tools/pdbgen/pdbgen.pl index 9c66d9a180..4c9ec89eb0 100755 --- a/tools/pdbgen/pdbgen.pl +++ b/tools/pdbgen/pdbgen.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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 diff --git a/tools/pdbgen/stddefs.pdb b/tools/pdbgen/stddefs.pdb index 0e86cc35b9..f9e93a9efd 100644 --- a/tools/pdbgen/stddefs.pdb +++ b/tools/pdbgen/stddefs.pdb @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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 diff --git a/tools/pdbgen/util.pl b/tools/pdbgen/util.pl index 542f2acb01..31c2f2a2d2 100644 --- a/tools/pdbgen/util.pl +++ b/tools/pdbgen/util.pl @@ -1,5 +1,5 @@ # The GIMP -- an image manipulation program -# Copyright (C) 1998-1999 Manish Singh +# Copyright (C) 1998-2000 Manish Singh # 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