Commit 30aabbc2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

plug-ins/FractalExplorer/Dialogs.c

2003-11-15  Michael Natterer  <mitch@gimp.org>

	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/FractalExplorer/FractalExplorer.c
	* plug-ins/bmp/bmpread.c
	* plug-ins/bmp/bmpwrite.c
	* plug-ins/common/CEL.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/animoptimize.c
	* plug-ins/common/bz2.c
	* plug-ins/common/convmatrix.c
	* plug-ins/common/curve_bend.c
	* plug-ins/common/dicom.c
	* plug-ins/common/gauss_iir.c
	* plug-ins/common/gauss_rle.c
	* plug-ins/common/gbr.c
	* plug-ins/common/gif.c
	* plug-ins/common/gifload.c
	* plug-ins/common/gih.c
	* plug-ins/common/grid.c
	* plug-ins/common/gtm.c
	* plug-ins/common/gz.c
	* plug-ins/common/hrz.c
	* plug-ins/common/jpeg.c
	* plug-ins/common/mail.c
	* plug-ins/common/mapcolor.c
	* plug-ins/common/pat.c
	* plug-ins/common/pcx.c
	* plug-ins/common/pix.c
	* plug-ins/common/png.c
	* plug-ins/common/pnm.c
	* plug-ins/common/ps.c
	* plug-ins/common/psd.c
	* plug-ins/common/psd_save.c
	* plug-ins/common/psp.c
	* plug-ins/common/sel_gauss.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/common/sunras.c
	* plug-ins/common/svg.c
	* plug-ins/common/tga.c
	* plug-ins/common/tiff.c
	* plug-ins/common/wmf.c
	* plug-ins/common/xbm.c
	* plug-ins/common/xwd.c
	* plug-ins/faxg3/faxg3.c
	* plug-ins/fits/fits.c
	* plug-ins/flame/flame.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gfli/gfli.c
	* plug-ins/gimpressionist/brush.c
	* plug-ins/gimpressionist/ppmtool.c
	* plug-ins/helpbrowser/domain.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/sgi/sgi.c
	* plug-ins/twain/twain.c
	* plug-ins/winsnap/winsnap.c
	* plug-ins/xjt/xjt.c: removed explicit newlines from messages.
	Made file open/save messages the same all over the place. Reduced
	number of translatable strings by adding some more "standard"
	messages. Removed plug-in names from messages. Added some random
	mnemonics. Unmarked some strings for translation and added some
	that were forgotten. General message cleanup. Removed trailing
	whitespace.
parent 020163d5
2003-11-15 Michael Natterer <mitch@gimp.org>
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/bmp/bmpread.c
* plug-ins/bmp/bmpwrite.c
* plug-ins/common/CEL.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/animoptimize.c
* plug-ins/common/bz2.c
* plug-ins/common/convmatrix.c
* plug-ins/common/curve_bend.c
* plug-ins/common/dicom.c
* plug-ins/common/gauss_iir.c
* plug-ins/common/gauss_rle.c
* plug-ins/common/gbr.c
* plug-ins/common/gif.c
* plug-ins/common/gifload.c
* plug-ins/common/gih.c
* plug-ins/common/grid.c
* plug-ins/common/gtm.c
* plug-ins/common/gz.c
* plug-ins/common/hrz.c
* plug-ins/common/jpeg.c
* plug-ins/common/mail.c
* plug-ins/common/mapcolor.c
* plug-ins/common/pat.c
* plug-ins/common/pcx.c
* plug-ins/common/pix.c
* plug-ins/common/png.c
* plug-ins/common/pnm.c
* plug-ins/common/ps.c
* plug-ins/common/psd.c
* plug-ins/common/psd_save.c
* plug-ins/common/psp.c
* plug-ins/common/sel_gauss.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/sunras.c
* plug-ins/common/svg.c
* plug-ins/common/tga.c
* plug-ins/common/tiff.c
* plug-ins/common/wmf.c
* plug-ins/common/xbm.c
* plug-ins/common/xwd.c
* plug-ins/faxg3/faxg3.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/gimpressionist/brush.c
* plug-ins/gimpressionist/ppmtool.c
* plug-ins/helpbrowser/domain.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/sgi/sgi.c
* plug-ins/twain/twain.c
* plug-ins/winsnap/winsnap.c
* plug-ins/xjt/xjt.c: removed explicit newlines from messages.
Made file open/save messages the same all over the place. Reduced
number of translatable strings by adding some more "standard"
messages. Removed plug-in names from messages. Added some random
mnemonics. Unmarked some strings for translation and added some
that were forgotten. General message cleanup. Removed trailing
whitespace.
2003-11-15 Sven Neumann <sven@gimp.org>
 
* app/gui/preferences-dialog.c: readded a toggle for
......@@ -1799,7 +1799,7 @@ save_callback (void)
if (!fp)
{
g_message (_("Can't open '%s' for writing:\n%s"),
g_message (_("Could not open '%s' for writing: %s"),
savename, g_strerror (errno));
return;
}
......@@ -1814,7 +1814,7 @@ save_callback (void)
save_options (fp);
if (ferror (fp))
g_message (_("Failed to write '%s':\n%s"),
g_message (_("Could not write '%s': %s"),
savename, g_strerror (ferror (fp)));
fclose (fp);
......@@ -1838,7 +1838,7 @@ file_selection_ok (GtkWidget *w,
if (g_file_test (filenamebuf, G_FILE_TEST_IS_DIR))
{
/* Can't save to directory */
g_message (_("Save: Can't save to a folder."));
g_message (_("Cannot save to a folder."));
return;
}
......@@ -2104,19 +2104,20 @@ explorer_load (void)
if (!fp)
{
g_message (_("Can't open '%s':\n%s"), filename, g_strerror (errno));
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
return;
}
get_line (load_buf, MAX_LOAD_LINE, fp, 1);
if (strncmp (FRACTAL_HEADER, load_buf, strlen (load_buf)))
{
g_message (_("'%s'\nis not a FractalExplorer file"), filename);
g_message (_("'%s' is not a FractalExplorer file"), filename);
return;
}
if (load_options (current_obj,fp))
{
g_message (_("'%s' is corrupt.\nLine %d Option section incorrect"),
g_message (_("'%s' is corrupt. Line %d Option section incorrect"),
filename, line_no);
return;
}
......
......@@ -760,7 +760,7 @@ delete_fractal_callback (GtkWidget *widget,
sel_obj = (fractalexplorerOBJ *)
g_object_get_data (G_OBJECT (sellist->data), "fractalexplorer");
str = g_strdup_printf (_("Are you sure you want to delete\n"
str = g_strdup_printf (_("Are you sure you want to delete "
"\"%s\" from the list and from disk?"),
sel_obj->draw_name);
......
/* bmpread.c reads any bitmap I could get for testing */
/* Alexander.Schulz@stud.uni-karlsruhe.de */
/*
/*
* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
......@@ -37,28 +37,28 @@
#include "libgimp/stdplugins-intl.h"
static gint32
static gint32
ToL (guchar *puffer)
{
return (puffer[0] | puffer[1]<<8 | puffer[2]<<16 | puffer[3]<<24);
}
static gint16
static gint16
ToS (guchar *puffer)
{
return (puffer[0] | puffer[1]<<8);
}
static gboolean
ReadColorMap (FILE *fd,
guchar buffer[256][3],
gint number,
gint size,
ReadColorMap (FILE *fd,
guchar buffer[256][3],
gint number,
gint size,
gint *grey)
{
gint i;
guchar rgb[4];
*grey=(number>2);
for (i = 0; i < number ; i++)
{
......@@ -67,7 +67,7 @@ ReadColorMap (FILE *fd,
g_message (_("Bad colormap"));
return FALSE;
}
/* Bitmap save the colors in another order! But change only once! */
buffer[i][0] = rgb[2];
......@@ -78,7 +78,7 @@ ReadColorMap (FILE *fd,
return TRUE;
}
gint32
gint32
ReadBMP (const gchar *name)
{
FILE *fd;
......@@ -94,7 +94,7 @@ ReadBMP (const gchar *name)
if (!fd)
{
g_message (_("Can't open '%s':\n%s"),
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
return -1;
}
......@@ -113,7 +113,7 @@ ReadBMP (const gchar *name)
g_message (_("'%s' is not a valid BMP file"), filename);
return -1;
}
while (!strncmp(magick,"BA",2))
{
if (!ReadOK(fd, buffer, 12))
......@@ -140,22 +140,22 @@ ReadBMP (const gchar *name)
Bitmap_File_Head.zzHotX = ToS (&buffer[0x04]);
Bitmap_File_Head.zzHotY = ToS (&buffer[0x06]);
Bitmap_File_Head.bfOffs = ToL (&buffer[0x08]);
if (!ReadOK(fd, buffer, 4))
{
g_message (_("'%s' is not a valid BMP file"), filename);
return -1;
}
Bitmap_File_Head.biSize = ToL (&buffer[0x00]);
/* What kind of bitmap is it? */
/* What kind of bitmap is it? */
if (Bitmap_File_Head.biSize == 12) /* OS/2 1.x ? */
{
if (!ReadOK (fd, buffer, 8))
{
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
......@@ -173,7 +173,7 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
{
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
Bitmap_Head.biWidth =ToL (&buffer[0x00]); /* 12 */
......@@ -193,7 +193,7 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
{
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
Bitmap_Head.biWidth =ToL (&buffer[0x00]); /* 12 */
......@@ -211,15 +211,15 @@ ReadBMP (const gchar *name)
}
else
{
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
/* Valid bitpdepthis 1, 4, 8, 16, 24, 32 */
/* 16 is awful, we should probably shoot whoever invented it */
/* There should be some colors used! */
ColormapSize = (Bitmap_File_Head.bfOffs - Bitmap_File_Head.biSize - 14) / Maps;
if ((Bitmap_Head.biClrUsed == 0) && (Bitmap_Head.biBitCnt <= 8))
......@@ -229,17 +229,17 @@ ReadBMP (const gchar *name)
/* Sanity checks */
if (Bitmap_Head.biHeight == 0 || Bitmap_Head.biWidth == 0) {
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
if (Bitmap_Head.biPlanes != 1) {
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
if (ColormapSize > 256 || Bitmap_Head.biClrUsed > 256) {
g_message (_("Error reading BMP file header\nfrom '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"), filename);
return -1;
}
......@@ -254,12 +254,12 @@ ReadBMP (const gchar *name)
Bitmap_File_Head.bfSize,Bitmap_Head.biClrUsed,Bitmap_Head.biBitCnt,Bitmap_Head.biWidth,
Bitmap_Head.biHeight, Bitmap_Head.biCompr, rowbytes);
#endif
/* Get the Colormap */
if (!ReadColorMap (fd, ColorMap, ColormapSize, Maps, &Grey))
return -1;
#ifdef DEBUG
printf("Colormap read\n");
#endif
......@@ -267,16 +267,16 @@ ReadBMP (const gchar *name)
fseek(fd, Bitmap_File_Head.bfOffs, SEEK_SET);
/* Get the Image and return the ID or -1 on error*/
image_ID = ReadImage (fd,
Bitmap_Head.biWidth,
Bitmap_Head.biHeight,
ColorMap,
Bitmap_Head.biClrUsed,
Bitmap_Head.biBitCnt,
Bitmap_Head.biCompr,
rowbytes,
image_ID = ReadImage (fd,
Bitmap_Head.biWidth,
Bitmap_Head.biHeight,
ColorMap,
Bitmap_Head.biClrUsed,
Bitmap_Head.biBitCnt,
Bitmap_Head.biCompr,
rowbytes,
Grey);
if (Bitmap_Head.biXPels > 0 && Bitmap_Head.biYPels > 0)
{
/* Fixed up from scott@asofyet's changes last year, njl195 */
......@@ -297,15 +297,15 @@ ReadBMP (const gchar *name)
return (image_ID);
}
Image
ReadImage (FILE *fd,
gint width,
gint height,
guchar cmap[256][3],
gint ncols,
gint bpp,
gint compression,
gint rowbytes,
Image
ReadImage (FILE *fd,
gint width,
gint height,
guchar cmap[256][3],
gint ncols,
gint bpp,
gint compression,
gint rowbytes,
gint grey)
{
guchar v,wieviel;
......@@ -319,9 +319,9 @@ ReadImage (FILE *fd,
gushort rgb;
long rowstride, channels;
gint i, j, cur_progress, max_progress, unused;
/* Make a new image in the gimp */
if (bpp >= 16)
{
image = gimp_image_new (width, height, GIMP_RGB);
......@@ -346,21 +346,21 @@ ReadImage (FILE *fd,
GIMP_INDEXED_IMAGE, 100, GIMP_NORMAL_MODE);
channels = 1;
}
gimp_image_set_filename(image, filename);
gimp_image_add_layer(image,layer,0);
drawable = gimp_drawable_get(layer);
dest = g_malloc(drawable->width*drawable->height*channels);
buffer= g_malloc(rowbytes);
rowstride = drawable->width * channels;
ypos = height - 1; /* Bitmaps begin in the lower left corner */
cur_progress = 0;
max_progress = height;
switch (bpp) {
case 32:
{
......@@ -459,7 +459,7 @@ ReadImage (FILE *fd,
while (ypos >= 0 && xpos <= width)
{
unused = ReadOK (fd, buffer, 2);
if ((guchar) buffer[0] != 0)
if ((guchar) buffer[0] != 0)
/* Count + Color - record */
{
for (j = 0; ((guchar) j < (guchar) buffer[0]) && (xpos < width);)
......
......@@ -122,7 +122,7 @@ WriteBMP (const gchar *filename,
0, 0, drawable->width, drawable->height, FALSE, FALSE);
if (gimp_drawable_has_alpha(drawable_ID))
{
g_message (_("Cannot operate on unknown image types or alpha images"));
g_message (_("Cannot save images with alpha channel."));
return GIMP_PDB_EXECUTION_ERROR;
}
......@@ -168,7 +168,7 @@ WriteBMP (const gchar *filename,
}
break;
default:
fprintf (stderr, "%s: This should not happen\n", prog_name);
g_message (_("Cannot operate on unknown image types."));
return GIMP_PDB_EXECUTION_ERROR;
}
......@@ -184,7 +184,7 @@ WriteBMP (const gchar *filename,
outfile = fopen (filename, "wb");
if (!outfile)
{
g_message (_("Can't open '%s' for writing:\n%s"),
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
return GIMP_PDB_EXECUTION_ERROR;
}
......
......@@ -108,8 +108,8 @@ query (void)
"May 1998",
"<Load>/CEL",
NULL,
GIMP_PLUGIN,
G_N_ELEMENTS (load_args),
GIMP_PLUGIN,
G_N_ELEMENTS (load_args),
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
......@@ -250,7 +250,8 @@ load_image (const gchar *file,
if (fp == NULL)
{
g_message (_("Can't open '%s':\n%s"), file, g_strerror (errno));
g_message (_("Could not open '%s' for reading: %s"),
file, g_strerror (errno));
return -1;
}
......@@ -316,7 +317,7 @@ load_image (const gchar *file,
case 16:
fread (buffer, (width+1)/2, 1, fp);
for (j = 0, k = 0; j < width*2; j+= 4, ++k)
{
{
if (buffer[k] / 16 == 0)
{
line[j]= 16;
......@@ -361,7 +362,7 @@ load_image (const gchar *file,
g_message (_("Unsupported number of colors (%d)"), colours);
return -1;
}
gimp_pixel_rgn_set_rect (&pixel_rgn, line, 0, i, drawable->width, 1);
gimp_progress_update ((float) i / (float) height);
}
......@@ -494,7 +495,7 @@ save_image (const gchar *file,
if (fp == NULL)
{
g_message (_("Can't open '%s' for writing:\n%s"),
g_message (_("Could not open '%s' for writing: %s"),
file, g_strerror (errno));
return FALSE;
}
......@@ -556,7 +557,7 @@ save_image (const gchar *file,
else
{
for (j = 0, k = 0; j < drawable->width*2; j+= 4, ++k)
{
{
buffer[k] = 0;
if (line[j+1] > 127)
{
......
......@@ -2129,7 +2129,7 @@ CML_execute_save_to_file (GtkWidget *widget,
if ((err != 0) && (file == NULL))
{
g_message (_("Can't open '%s' for writing:\n%s"),
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
return;
}
......@@ -2182,7 +2182,7 @@ CML_execute_save_to_file (GtkWidget *widget,
fprintf (file, "Random seed : %d\n", VALS.seed);
fclose(file);
g_message (_("Parameters were Saved to\n'%s'"), filename);
g_message (_("Parameters were Saved to '%s'"), filename);
strncpy (VALS.last_file_name, filename,
sizeof (VALS.last_file_name) - 1);
......@@ -2339,7 +2339,8 @@ CML_load_parameter_file (const gchar *filename,
if (!file)
{
g_message (_("Can't open '%s':\n%s"), filename, g_strerror (errno));
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
return FALSE;
}
else
......@@ -2367,9 +2368,10 @@ CML_load_parameter_file (const gchar *filename,
if (interactive_mode)
{
if (version < PARAM_FILE_FORMAT_VERSION)
g_message (_("Warning: '%s'\nis an old format file."), filename);
g_message (_("Warning: '%s' is an old format file."), filename);
if (PARAM_FILE_FORMAT_VERSION < version)
g_message (_("Warning: '%s'\nis a parameter file for newer CML_explorer than me."), filename);
g_message (_("Warning: '%s' is a parameter file for newer "
"CML_explorer than me."), filename);
}
for (channel_id = 0; flag && (channel_id < 3); channel_id++)
{
......
......@@ -255,14 +255,14 @@ run (const gchar *name,
*return_vals = values;
run_mode = param[0].data.d_int32;
INIT_I18N ();
if (run_mode == GIMP_RUN_NONINTERACTIVE && n_params != 3)
{
status = GIMP_PDB_CALLING_ERROR;
}
/* Check the procedure name we were called with, to decide
what needs to be done. */
if (strcmp(name,"plug_in_animationoptimize")==0)
......@@ -275,7 +275,7 @@ run (const gchar *name,
opmode = OPFOREGROUND;
else
g_error("GAH!!!");
if (status == GIMP_PDB_SUCCESS)
{
image_id = param[1].data.d_image;
......@@ -285,7 +285,7 @@ run (const gchar *name,
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush();
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
......@@ -377,7 +377,7 @@ compose_row(int frame_num,
/* render... */
srcptr = line_buf;
for (i=rawx; i<rawwidth+rawx; i++)
{
if (i>=0 && i<dest_width)
......@@ -392,10 +392,10 @@ compose_row(int frame_num,
dest[i*pixelstep + pixelstep - 1] = 255;
}
}
srcptr += rawbpp;
}
}
......@@ -422,7 +422,7 @@ do_optimizations(GimpRunMode run_mode)
gchar* oldlayer_name;
gchar* newlayer_name;
gboolean can_combine;
gint32 bbox_top, bbox_bottom, bbox_left, bbox_right;
......@@ -452,7 +452,7 @@ do_optimizations(GimpRunMode run_mode)
pixelstep = (imagetype == GIMP_RGB) ? 4 : 2;
/* gimp_tile_cache_ntiles(total_frames * (width / gimp_tile_width() + 1) );*/
drawabletype_alpha = (imagetype == GIMP_RGB) ? GIMP_RGBA_IMAGE :
((imagetype == GIMP_INDEXED) ? GIMP_INDEXEDA_IMAGE : GIMP_GRAYA_IMAGE);
......@@ -462,6 +462,7 @@ do_optimizations(GimpRunMode run_mode)
this_frame = g_malloc (frame_sizebytes);
last_frame = g_malloc (frame_sizebytes);
opti_frame = g_malloc (frame_sizebytes);
if (opmode == OPBACKGROUND ||
opmode == OPFOREGROUND)
back_frame = g_malloc (frame_sizebytes);
......@@ -478,9 +479,6 @@ do_optimizations(GimpRunMode run_mode)
gimp_image_set_cmap (new_image_id, palette, ncolours);
}
if ((this_frame == NULL) || (last_frame == NULL) || (opti_frame == NULL))
g_error(_("Not enough memory to allocate buffers for optimization.\n"));
#if 1
if (opmode == OPBACKGROUND ||
opmode == OPFOREGROUND)
......@@ -495,7 +493,7 @@ do_optimizations(GimpRunMode run_mode)
guint **count;
guint *num_colours;