more sanity checks in gimpdrawable.c and a few i18n issues

--Sven
This commit is contained in:
Sven Neumann 2000-01-31 13:07:39 +00:00
parent 4ad56fb075
commit 4006d434df
10 changed files with 94 additions and 167 deletions

View File

@ -1,3 +1,15 @@
Tue Feb 1 11:57:47 CET 2000 Sven Neumann <sven@gimp.org>
* app/gimpdrawable.c: check that the passed pointer is indeed a
drawable in a few more places
* plug-ins/common/header.c
* plug-ins/common/url.c
* plug-ins/script-fu/regex.c: i18n
* po-plug-ins/POTFILES.in: only list files that really do contain
translatable messages
2000-02-01 Michael Natterer <mitch@gimp.org>
* libgimp/gimpwidgets.[ch]: merged the table attach helper

View File

@ -277,9 +277,13 @@ gimp_drawable_type (GimpDrawable *drawable)
GimpImageType
gimp_drawable_type_with_alpha (GimpDrawable *drawable)
{
GimpImageType type = gimp_drawable_type (drawable);
GimpImageType type;
gboolean has_alpha;
gboolean has_alpha = gimp_drawable_has_alpha (drawable);
g_assert (GIMP_IS_DRAWABLE (drawable));
type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
if (has_alpha)
return type;
@ -302,12 +306,16 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
}
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
}
@ -436,6 +444,8 @@ Parasite *
gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return parasite_list_find (drawable->parasites, name);
}
@ -451,7 +461,10 @@ gchar **
gimp_drawable_parasite_list (GimpDrawable *drawable,
gint *count)
{
gchar **list, **cur;
gchar **list;
gchar **cur;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
*count = parasite_list_length (drawable->parasites);
cur = list = (gchar **) g_malloc (sizeof (gchar *) * *count);
@ -465,6 +478,8 @@ void
gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
if (parasite_is_undoable (parasite))
@ -504,6 +519,8 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
{
Parasite *p;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!(p = parasite_list_find (drawable->parasites, parasite)))
return;
@ -519,6 +536,8 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
Tattoo
gimp_drawable_get_tattoo (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return drawable->tattoo;
}

View File

@ -277,9 +277,13 @@ gimp_drawable_type (GimpDrawable *drawable)
GimpImageType
gimp_drawable_type_with_alpha (GimpDrawable *drawable)
{
GimpImageType type = gimp_drawable_type (drawable);
GimpImageType type;
gboolean has_alpha;
gboolean has_alpha = gimp_drawable_has_alpha (drawable);
g_assert (GIMP_IS_DRAWABLE (drawable));
type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
if (has_alpha)
return type;
@ -302,12 +306,16 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
}
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
}
@ -436,6 +444,8 @@ Parasite *
gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return parasite_list_find (drawable->parasites, name);
}
@ -451,7 +461,10 @@ gchar **
gimp_drawable_parasite_list (GimpDrawable *drawable,
gint *count)
{
gchar **list, **cur;
gchar **list;
gchar **cur;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
*count = parasite_list_length (drawable->parasites);
cur = list = (gchar **) g_malloc (sizeof (gchar *) * *count);
@ -465,6 +478,8 @@ void
gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
if (parasite_is_undoable (parasite))
@ -504,6 +519,8 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
{
Parasite *p;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!(p = parasite_list_find (drawable->parasites, parasite)))
return;
@ -519,6 +536,8 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
Tattoo
gimp_drawable_get_tattoo (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return drawable->tattoo;
}

View File

@ -67,8 +67,6 @@ query (void)
};
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
INIT_I18N();
gimp_install_procedure ("file_header_save",
"saves files as C unsigned character array",
"FIXME: write help",

View File

@ -27,7 +27,6 @@
#endif
#include "config.h"
#include "libgimp/gimp.h"
#include "libgimp/stdplugins-intl.h"
/* Author: Josh MacDonald. */
@ -67,8 +66,6 @@ query (void)
static gint nload_return_vals = (sizeof (load_return_vals) /
sizeof (load_return_vals[0]));
INIT_I18N();
gimp_install_procedure ("file_url_load",
"loads files given a URL",
"You need to have GNU Wget installed.",

View File

@ -51,18 +51,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <wctype.h>
#endif
/* This is for other GNU distributions with internationalized messages. */
#if HAVE_LIBINTL_H || defined (_LIBC)
# include <libintl.h>
#else
# define gettext(msgid) (msgid)
#endif
#ifndef gettext_noop
/* This define is so xgettext can find the internationalizable
strings. */
#define gettext_noop(String) String
#endif
#include "libgimp/stdplugins-intl.h"
/* The `emacs' switch turns on certain matching commands
that make sense only in Emacs. */
@ -973,23 +962,23 @@ re_set_syntax (syntax)
static const char *re_error_msgid[] =
{
gettext_noop ("Success"), /* REG_NOERROR */
gettext_noop ("No match"), /* REG_NOMATCH */
gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
gettext_noop ("Invalid range end"), /* REG_ERANGE */
gettext_noop ("Memory exhausted"), /* REG_ESPACE */
gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
gettext_noop ("Premature end of regular expression"), /* REG_EEND */
gettext_noop ("Regular expression too big"), /* REG_ESIZE */
gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
N_("Success"), /* REG_NOERROR */
N_("No match"), /* REG_NOMATCH */
N_("Invalid regular expression"), /* REG_BADPAT */
N_("Invalid collation character"), /* REG_ECOLLATE */
N_("Invalid character class name"), /* REG_ECTYPE */
N_("Trailing backslash"), /* REG_EESCAPE */
N_("Invalid back reference"), /* REG_ESUBREG */
N_("Unmatched [ or [^"), /* REG_EBRACK */
N_("Unmatched ( or \\("), /* REG_EPAREN */
N_("Unmatched \\{"), /* REG_EBRACE */
N_("Invalid content of \\{\\}"), /* REG_BADBR */
N_("Invalid range end"), /* REG_ERANGE */
N_("Memory exhausted"), /* REG_ESPACE */
N_("Invalid preceding regular expression"), /* REG_BADRPT */
N_("Premature end of regular expression"), /* REG_EEND */
N_("Regular expression too big"), /* REG_ESIZE */
N_("Unmatched ) or \\)"), /* REG_ERPAREN */
};
/* Avoiding alloca during matching, to placate r_alloc. */
@ -5439,7 +5428,7 @@ re_comp (s)
if (!s)
{
if (!re_comp_buf.buffer)
return gettext ("No previous regular expression");
return gettext (_("No previous regular expression"));
return 0;
}

View File

@ -51,18 +51,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <wctype.h>
#endif
/* This is for other GNU distributions with internationalized messages. */
#if HAVE_LIBINTL_H || defined (_LIBC)
# include <libintl.h>
#else
# define gettext(msgid) (msgid)
#endif
#ifndef gettext_noop
/* This define is so xgettext can find the internationalizable
strings. */
#define gettext_noop(String) String
#endif
#include "libgimp/stdplugins-intl.h"
/* The `emacs' switch turns on certain matching commands
that make sense only in Emacs. */
@ -973,23 +962,23 @@ re_set_syntax (syntax)
static const char *re_error_msgid[] =
{
gettext_noop ("Success"), /* REG_NOERROR */
gettext_noop ("No match"), /* REG_NOMATCH */
gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
gettext_noop ("Invalid range end"), /* REG_ERANGE */
gettext_noop ("Memory exhausted"), /* REG_ESPACE */
gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
gettext_noop ("Premature end of regular expression"), /* REG_EEND */
gettext_noop ("Regular expression too big"), /* REG_ESIZE */
gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
N_("Success"), /* REG_NOERROR */
N_("No match"), /* REG_NOMATCH */
N_("Invalid regular expression"), /* REG_BADPAT */
N_("Invalid collation character"), /* REG_ECOLLATE */
N_("Invalid character class name"), /* REG_ECTYPE */
N_("Trailing backslash"), /* REG_EESCAPE */
N_("Invalid back reference"), /* REG_ESUBREG */
N_("Unmatched [ or [^"), /* REG_EBRACK */
N_("Unmatched ( or \\("), /* REG_EPAREN */
N_("Unmatched \\{"), /* REG_EBRACE */
N_("Invalid content of \\{\\}"), /* REG_BADBR */
N_("Invalid range end"), /* REG_ERANGE */
N_("Memory exhausted"), /* REG_ESPACE */
N_("Invalid preceding regular expression"), /* REG_BADRPT */
N_("Premature end of regular expression"), /* REG_EEND */
N_("Regular expression too big"), /* REG_ESIZE */
N_("Unmatched ) or \\)"), /* REG_ERPAREN */
};
/* Avoiding alloca during matching, to placate r_alloc. */
@ -5439,7 +5428,7 @@ re_comp (s)
if (!s)
{
if (!re_comp_buf.buffer)
return gettext ("No previous regular expression");
return gettext (_("No previous regular expression"));
return 0;
}

View File

@ -27,7 +27,6 @@
#endif
#include "config.h"
#include "libgimp/gimp.h"
#include "libgimp/stdplugins-intl.h"
/* Author: Josh MacDonald. */
@ -67,8 +66,6 @@ query (void)
static gint nload_return_vals = (sizeof (load_return_vals) /
sizeof (load_return_vals[0]));
INIT_I18N();
gimp_install_procedure ("file_url_load",
"loads files given a URL",
"You need to have GNU Wget installed.",

View File

@ -27,7 +27,6 @@
#endif
#include "config.h"
#include "libgimp/gimp.h"
#include "libgimp/stdplugins-intl.h"
/* Author: Josh MacDonald. */
@ -67,8 +66,6 @@ query (void)
static gint nload_return_vals = (sizeof (load_return_vals) /
sizeof (load_return_vals[0]));
INIT_I18N();
gimp_install_procedure ("file_url_load",
"loads files given a URL",
"You need to have GNU Wget installed.",

View File

@ -5,23 +5,11 @@
plug-ins/AlienMap/AlienMap.c
plug-ins/AlienMap2/AlienMap2.c
plug-ins/FractalExplorer/Dialogs.c
plug-ins/FractalExplorer/Events.c
plug-ins/FractalExplorer/FractalExplorer.c
plug-ins/FractalExplorer/Globals.c
plug-ins/Lighting/lighting_apply.c
plug-ins/Lighting/lighting_image.c
plug-ins/Lighting/lighting_main.c
plug-ins/Lighting/lighting_preview.c
plug-ins/Lighting/lighting_shade.c
plug-ins/Lighting/lighting_ui.c
plug-ins/MapObject/arcball.c
plug-ins/MapObject/mapobject_apply.c
plug-ins/MapObject/mapobject_image.c
plug-ins/MapObject/mapobject_main.c
plug-ins/MapObject/mapobject_preview.c
plug-ins/MapObject/mapobject_shade.c
plug-ins/MapObject/mapobject_ui.c
plug-ins/bmp/bmp.c
plug-ins/bmp/bmpread.c
plug-ins/bmp/bmpwrite.c
plug-ins/borderaverage/borderaverage.c
@ -77,7 +65,6 @@ plug-ins/common/grid.c
plug-ins/common/gtm.c
plug-ins/common/guillotine.c
plug-ins/common/gz.c
plug-ins/common/header.c
plug-ins/common/hot.c
plug-ins/common/hrz.c
plug-ins/common/illusion.c
@ -134,7 +121,6 @@ plug-ins/common/tile.c
plug-ins/common/tileit.c
plug-ins/common/tiler.c
plug-ins/common/unsharp.c
plug-ins/common/url.c
plug-ins/common/video.c
plug-ins/common/vinvert.c
plug-ins/common/vpropagate.c
@ -152,40 +138,24 @@ plug-ins/common/zealouscrop.c
plug-ins/dbbrowser/dbbrowser.c
plug-ins/dbbrowser/dbbrowser_utils.c
plug-ins/faxg3/faxg3.c
plug-ins/faxg3/g3.c
plug-ins/faxg3/run_tbl.c
plug-ins/fits/fits.c
plug-ins/fits/fitsrw.c
plug-ins/flame/cmap.c
plug-ins/flame/flame.c
plug-ins/flame/libifs.c
plug-ins/flame/megawidget.c
plug-ins/flame/rect.c
plug-ins/fp/fp.c
plug-ins/fp/fp_gdk.c
plug-ins/fp/fp_gtk.c
plug-ins/fp/fp_misc.c
plug-ins/gap/gap_arr_dialog.c
plug-ins/gap/gap_dbbrowser_utils.c
plug-ins/gap/gap_decode_mpeg_main.c
plug-ins/gap/gap_decode_xanim.c
plug-ins/gap/gap_exchange_image.c
plug-ins/gap/gap_filter_codegen.c
plug-ins/gap/gap_filter_foreach.c
plug-ins/gap/gap_filter_iterators.c
plug-ins/gap/gap_filter_main.c
plug-ins/gap/gap_filter_pdb.c
plug-ins/gap/gap_frontends_main.c
plug-ins/gap/gap_layer_copy.c
plug-ins/gap/gap_lib.c
plug-ins/gap/gap_main.c
plug-ins/gap/gap_match.c
plug-ins/gap/gap_mod_layer.c
plug-ins/gap/gap_mov_dialog.c
plug-ins/gap/gap_mov_exec.c
plug-ins/gap/gap_mpege.c
plug-ins/gap/gap_navigator_dialog.c
plug-ins/gap/gap_pdb_calls.c
plug-ins/gap/gap_range_ops.c
plug-ins/gap/gap_resi_dialog.c
plug-ins/gap/gap_split.c
@ -197,12 +167,7 @@ plug-ins/gdyntext/gdyntext.c
plug-ins/gdyntext/gdyntext_ui.c
plug-ins/gdyntext/message_window.c
plug-ins/gfig/gfig.c
plug-ins/gflare/asupsample.c
plug-ins/gflare/gflare.c
plug-ins/gflare/gtkmultioptionmenu.c
plug-ins/gfli/fli.c
plug-ins/gfli/gfli.c
plug-ins/gimpressionist/about.c
plug-ins/gimpressionist/brush.c
plug-ins/gimpressionist/color.c
plug-ins/gimpressionist/general.c
@ -212,22 +177,14 @@ plug-ins/gimpressionist/orientation.c
plug-ins/gimpressionist/orientmap.c
plug-ins/gimpressionist/paper.c
plug-ins/gimpressionist/placement.c
plug-ins/gimpressionist/plasma.c
plug-ins/gimpressionist/ppmtool.c
plug-ins/gimpressionist/presets.c
plug-ins/gimpressionist/preview.c
plug-ins/gimpressionist/repaint.c
plug-ins/gimpressionist/size.c
plug-ins/gimpressionist/sizemap.c
plug-ins/helpbrowser/helpbrowser.c
plug-ins/helpbrowser/queue.c
plug-ins/ifscompose/ifscompose.c
plug-ins/ifscompose/ifscompose_storage.c
plug-ins/ifscompose/ifscompose_utils.c
plug-ins/imagemap/imap_about.c
plug-ins/imagemap/imap_browse.c
plug-ins/imagemap/imap_cern_lex.c
plug-ins/imagemap/imap_cern_parse.c
plug-ins/imagemap/imap_circle.c
plug-ins/imagemap/imap_cmd_clear.c
plug-ins/imagemap/imap_cmd_copy.c
@ -244,7 +201,6 @@ plug-ins/imagemap/imap_cmd_move.c
plug-ins/imagemap/imap_cmd_move_down.c
plug-ins/imagemap/imap_cmd_move_sash.c
plug-ins/imagemap/imap_cmd_move_selected.c
plug-ins/imagemap/imap_cmd_move_to_front.c
plug-ins/imagemap/imap_cmd_move_up.c
plug-ins/imagemap/imap_cmd_object_down.c
plug-ins/imagemap/imap_cmd_object_move.c
@ -253,90 +209,44 @@ plug-ins/imagemap/imap_cmd_paste.c
plug-ins/imagemap/imap_cmd_select.c
plug-ins/imagemap/imap_cmd_select_all.c
plug-ins/imagemap/imap_cmd_select_next.c
plug-ins/imagemap/imap_cmd_select_prev.c
plug-ins/imagemap/imap_cmd_select_region.c
plug-ins/imagemap/imap_cmd_send_to_back.c
plug-ins/imagemap/imap_cmd_unselect.c
plug-ins/imagemap/imap_cmd_unselect_all.c
plug-ins/imagemap/imap_command.c
plug-ins/imagemap/imap_csim_lex.c
plug-ins/imagemap/imap_csim_parse.c
plug-ins/imagemap/imap_default_dialog.c
plug-ins/imagemap/imap_edit_area_info.c
plug-ins/imagemap/imap_file.c
plug-ins/imagemap/imap_grid.c
plug-ins/imagemap/imap_main.c
plug-ins/imagemap/imap_menu.c
plug-ins/imagemap/imap_menu_funcs.c
plug-ins/imagemap/imap_misc.c
plug-ins/imagemap/imap_mru.c
plug-ins/imagemap/imap_ncsa_lex.c
plug-ins/imagemap/imap_ncsa_parse.c
plug-ins/imagemap/imap_object.c
plug-ins/imagemap/imap_object_popup.c
plug-ins/imagemap/imap_polygon.c
plug-ins/imagemap/imap_popup.c
plug-ins/imagemap/imap_preferences.c
plug-ins/imagemap/imap_preview.c
plug-ins/imagemap/imap_rectangle.c
plug-ins/imagemap/imap_selection.c
plug-ins/imagemap/imap_settings.c
plug-ins/imagemap/imap_source.c
plug-ins/imagemap/imap_statusbar.c
plug-ins/imagemap/imap_string.c
plug-ins/imagemap/imap_table.c
plug-ins/imagemap/imap_taglist.c
plug-ins/imagemap/imap_toolbar.c
plug-ins/imagemap/imap_tools.c
plug-ins/maze/algorithms.c
plug-ins/maze/handy.c
plug-ins/maze/maze.c
plug-ins/maze/maze_face.c
plug-ins/mosaic/mosaic.c
plug-ins/pagecurl/pagecurl.c
plug-ins/perl/Gimp.c
plug-ins/print/print-escp2.c
plug-ins/print/print-pcl.c
plug-ins/print/print-ps.c
plug-ins/print/print-util.c
plug-ins/print/print.c
plug-ins/pygimp/gimpmodule.c
plug-ins/rcm/rcm.c
plug-ins/rcm/rcm_callback.c
plug-ins/rcm/rcm_dialog.c
plug-ins/rcm/rcm_gdk.c
plug-ins/rcm/rcm_misc.c
plug-ins/script-fu/interp_md5.c
plug-ins/script-fu/interp_regex.c
plug-ins/script-fu/interp_slib.c
plug-ins/script-fu/interp_sliba.c
plug-ins/script-fu/interp_trace.c
plug-ins/script-fu/regex.c
plug-ins/script-fu/script-fu-console.c
plug-ins/script-fu/script-fu-constants.c
plug-ins/script-fu/script-fu-scripts.c
plug-ins/script-fu/script-fu-server.c
plug-ins/script-fu/script-fu.c
plug-ins/sel2path/curve.c
plug-ins/sel2path/edge.c
plug-ins/sel2path/fit.c
plug-ins/sel2path/math.c
plug-ins/sel2path/pxl-outline.c
plug-ins/sel2path/sel2path.c
plug-ins/sel2path/sel2path_adv_dialog.c
plug-ins/sel2path/spline.c
plug-ins/sel2path/vector.c
plug-ins/sgi/sgi.c
plug-ins/sgi/sgilib.c
plug-ins/sinus/sinus.c
plug-ins/struc/struc.c
plug-ins/twain/tw_dump.c
plug-ins/twain/tw_func.c
plug-ins/twain/tw_sess.c
plug-ins/twain/tw_util.c
plug-ins/twain/twain.c
plug-ins/webbrowser/webbrowser.c
plug-ins/winsnap/winsnap.c
plug-ins/xjt/xjpeg.c
plug-ins/xjt/xjt.c
plug-ins/xjt/xpdb_calls.c