Commit a111d239 authored by Manish Singh's avatar Manish Singh
Browse files

version number bump; add check for standalone gtkxmhtml from Sesse

* configure.in: version number bump; add check for standalone
gtkxmhtml from Sesse

* app/gimppreviewcache.c: applied gimp-yasuhiro-19991122-1, prevents
div by zero error

* plug-ins/script-fu/script-fu-scripts.c: INIT_I18N_UI before
gtk_init, reported by yasuhiro

* plug-ins/common/mapcolor.c
* plug-ins/common/sunras.c
* plug-ins/fits/fits.c: applied gimpkirchgessner-991121-[0-2],
i18n and sundry bug fixes

-Yosh
parent 643e1b1a
Wed Nov 24 15:26:21 PST 1999 Manish Singh <yosh@gimp.org>
* configure.in: version number bump; add check for standalone
gtkxmhtml from Sesse
* app/gimppreviewcache.c: applied gimp-yasuhiro-19991122-1, prevents
div by zero error
* plug-ins/script-fu/script-fu-scripts.c: INIT_I18N_UI before
gtk_init, reported by yasuhiro
* plug-ins/common/mapcolor.c
* plug-ins/common/sunras.c
* plug-ins/fits/fits.c: applied gimpkirchgessner-991121-[0-2],
i18n and sundry bug fixes
1999-11-24 Tuomas Kuosmanen <tigert@gimp.org>
* plug-ins/perl/examples/perlotine: Fixed some changed stuff,
......
......@@ -236,9 +236,15 @@ gimp_preview_cache_get(GSList **plist,
pc = g_new0(PreviewCache,1);
pc->preview = temp_buf_new(width,height,pn.pc->preview->bytes,0,0,NULL);
/* preview from nearest bigger one */
x_ratio = (gdouble)pwidth/(gdouble)width;
y_ratio = (gdouble)pheight/(gdouble)height;
if (width)
x_ratio = (gdouble)pwidth/(gdouble)width;
else
x_ratio = 0.0;
if (height)
y_ratio = (gdouble)pheight/(gdouble)height;
else
y_ratio = 0.0;
src_data = temp_buf_data(pn.pc->preview);
dest_data = temp_buf_data(pc->preview);
......
......@@ -61,6 +61,7 @@ static ProcRecord image_active_drawable_proc;
static ProcRecord image_base_type_proc;
static ProcRecord image_get_cmap_proc;
static ProcRecord image_set_cmap_proc;
static ProcRecord image_undo_is_enabled_proc;
static ProcRecord image_undo_enable_proc;
static ProcRecord image_undo_disable_proc;
static ProcRecord image_undo_freeze_proc;
......@@ -121,6 +122,7 @@ register_gimage_procs (void)
procedural_db_register (&image_base_type_proc);
procedural_db_register (&image_get_cmap_proc);
procedural_db_register (&image_set_cmap_proc);
procedural_db_register (&image_undo_is_enabled_proc);
procedural_db_register (&image_undo_enable_proc);
procedural_db_register (&image_undo_disable_proc);
procedural_db_register (&image_undo_freeze_proc);
......@@ -1910,6 +1912,63 @@ static ProcRecord image_set_cmap_proc =
{ { image_set_cmap_invoker } }
};
static Argument *
image_undo_is_enabled_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gboolean enabled;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
if (success)
enabled = gimp_image_undo_is_enabled (gimage);
return_args = procedural_db_return_args (&image_undo_is_enabled_proc, success);
if (success)
return_args[1].value.pdb_int = enabled;
return return_args;
}
static ProcArg image_undo_is_enabled_inargs[] =
{
{
PDB_IMAGE,
"image",
"The image"
}
};
static ProcArg image_undo_is_enabled_outargs[] =
{
{
PDB_INT32,
"enabled",
"True if undo is enabled for this image"
}
};
static ProcRecord image_undo_is_enabled_proc =
{
"gimp_image_undo_is_enabled",
"Check if the image's undo stack is enabled.",
"This procedure checks if the image's undo stack is currently enabled or disabled. This is useful when several plugins or scripts call each other and want to check if their caller has already used 'gimp_image_undo_disable' or 'gimp_image_undo_freeze'.",
"Raphael Quinet",
"Raphael Quinet",
"1999",
PDB_INTERNAL,
1,
image_undo_is_enabled_inargs,
1,
image_undo_is_enabled_outargs,
{ { image_undo_is_enabled_invoker } }
};
static Argument *
image_undo_enable_invoker (Argument *args)
{
......
......@@ -236,9 +236,15 @@ gimp_preview_cache_get(GSList **plist,
pc = g_new0(PreviewCache,1);
pc->preview = temp_buf_new(width,height,pn.pc->preview->bytes,0,0,NULL);
/* preview from nearest bigger one */
x_ratio = (gdouble)pwidth/(gdouble)width;
y_ratio = (gdouble)pheight/(gdouble)height;
if (width)
x_ratio = (gdouble)pwidth/(gdouble)width;
else
x_ratio = 0.0;
if (height)
y_ratio = (gdouble)pheight/(gdouble)height;
else
y_ratio = 0.0;
src_data = temp_buf_data(pn.pc->preview);
dest_data = temp_buf_data(pc->preview);
......
......@@ -59,7 +59,7 @@ void register_tools_procs (void);
void register_undo_procs (void);
void register_unit_procs (void);
/* 309 procedures registered total */
/* 310 procedures registered total */
void
internal_procs_init (void)
......@@ -73,87 +73,87 @@ internal_procs_init (void)
app_init_update_status (NULL, _("Channel"), 0.045);
register_channel_procs ();
app_init_update_status (NULL, _("Channel Ops"), 0.091);
app_init_update_status (NULL, _("Channel Ops"), 0.09);
register_channel_ops_procs ();
app_init_update_status (NULL, _("Color"), 0.097);
register_color_procs ();
app_init_update_status (NULL, _("Convert"), 0.136);
app_init_update_status (NULL, _("Convert"), 0.135);
register_convert_procs ();
app_init_update_status (NULL, _("Drawable procedures"), 0.146);
app_init_update_status (NULL, _("Drawable procedures"), 0.145);
register_drawable_procs ();
app_init_update_status (NULL, _("Edit procedures"), 0.217);
app_init_update_status (NULL, _("Edit procedures"), 0.216);
register_edit_procs ();
app_init_update_status (NULL, _("File Operations"), 0.236);
app_init_update_status (NULL, _("File Operations"), 0.235);
register_fileops_procs ();
app_init_update_status (NULL, _("Floating selections"), 0.256);
app_init_update_status (NULL, _("Floating selections"), 0.255);
register_floating_sel_procs ();
app_init_update_status (NULL, _("GDisplay procedures"), 0.275);
app_init_update_status (NULL, _("GDisplay procedures"), 0.274);
register_gdisplay_procs ();
app_init_update_status (NULL, _("Image"), 0.285);
app_init_update_status (NULL, _("Image"), 0.284);
register_gimage_procs ();
app_init_update_status (NULL, _("Image mask"), 0.466);
app_init_update_status (NULL, _("Image mask"), 0.468);
register_gimage_mask_procs ();
app_init_update_status (NULL, _("Gimprc procedures"), 0.521);
app_init_update_status (NULL, _("Gimprc procedures"), 0.523);
register_gimprc_procs ();
app_init_update_status (NULL, _("Gradients"), 0.531);
app_init_update_status (NULL, _("Gradients"), 0.532);
register_gradient_procs ();
app_init_update_status (NULL, _("Gradient UI"), 0.547);
app_init_update_status (NULL, _("Gradient UI"), 0.548);
register_gradient_select_procs ();
app_init_update_status (NULL, _("Guide procedures"), 0.56);
app_init_update_status (NULL, _("Guide procedures"), 0.561);
register_guides_procs ();
app_init_update_status (NULL, _("Interface"), 0.579);
app_init_update_status (NULL, _("Interface"), 0.581);
register_interface_procs ();
app_init_update_status (NULL, _("Layer"), 0.589);
app_init_update_status (NULL, _("Layer"), 0.59);
register_layer_procs ();
app_init_update_status (NULL, _("Miscellaneous"), 0.686);
app_init_update_status (NULL, _("Miscellaneous"), 0.687);
register_misc_procs ();
app_init_update_status (NULL, _("Palette"), 0.693);
app_init_update_status (NULL, _("Palette"), 0.694);
register_palette_procs ();
app_init_update_status (NULL, _("Parasite procedures"), 0.715);
app_init_update_status (NULL, _("Parasite procedures"), 0.716);
register_parasite_procs ();
app_init_update_status (NULL, _("Paths"), 0.757);
app_init_update_status (NULL, _("Paths"), 0.758);
register_paths_procs ();
app_init_update_status (NULL, _("Pattern UI"), 0.79);
register_pattern_select_procs ();
app_init_update_status (NULL, _("Patterns"), 0.799);
app_init_update_status (NULL, _("Patterns"), 0.8);
register_patterns_procs ();
app_init_update_status (NULL, _("Plug-in"), 0.812);
app_init_update_status (NULL, _("Plug-in"), 0.813);
register_plug_in_procs ();
app_init_update_status (NULL, _("Procedural database"), 0.825);
app_init_update_status (NULL, _("Procedural database"), 0.826);
register_procedural_db_procs ();
app_init_update_status (NULL, _("Text procedures"), 0.851);
app_init_update_status (NULL, _("Text procedures"), 0.852);
register_text_tool_procs ();
app_init_update_status (NULL, _("Tool procedures"), 0.864);
app_init_update_status (NULL, _("Tool procedures"), 0.865);
register_tools_procs ();
app_init_update_status (NULL, _("Undo"), 0.958);
register_undo_procs ();
app_init_update_status (NULL, _("Units"), 0.964);
app_init_update_status (NULL, _("Units"), 0.965);
register_unit_procs ();
}
......@@ -4,7 +4,7 @@ AC_INIT(gimprc.in)
dnl Initialize automake stuff
GIMP_MAJOR_VERSION=1
GIMP_MINOR_VERSION=1
GIMP_MICRO_VERSION=11
GIMP_MICRO_VERSION=12
GIMP_INTERFACE_AGE=0
GIMP_BINARY_AGE=0
GIMP_VERSION=$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION.$GIMP_MICRO_VERSION
......@@ -512,6 +512,12 @@ dnl This is for the help browser
AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
if test "$GNOME_CONFIG" = "no"; then
HELPBROWSER=
dnl Test for standalone GtkXMHTML widget
AC_CHECK_LIB(gtkxmhtml, gtk_xmhtml_new,
GTKXMHTML_CFLAGS=$GLIB_CFLAGS
GTKXMHTML_LIBS="$GLIB_LIBS -lgtkxmhtml"
HELPBROWSER=helpbrowser,
AC_MSG_WARN(*** Help browser plug-in will not be built (GtkXMHTML library not found) ***))
else
GTKXMHTML_CFLAGS=`$GNOME_CONFIG --cflags gnomeui`
GTKXMHTML_LIBS=`$GNOME_CONFIG --libs gtkxmhtml`
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
* mapcolor plugin
* Copyright (C) 1998 Peter Kirchgessner
* (email: pkirchg@aol.com, WWW: http://members.aol.com/pkirchg)
* email: peter@kirchgessner.net, WWW: http://www.kirchgessner.net)
*
* 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
......@@ -22,10 +22,12 @@
/* Event history:
* V 1.00, PK, 26-Oct-98: Creation.
* V 1.01, PK, 21-Nov-99: Fix problem with working on layered images
* Internationalization
*/
#define VERSIO 1.00
static char dversio[] = "v1.00 26-Oct-98";
static char ident[] = "@(#) GIMP mapcolor plug-in v1.00 26-Oct-98";
#define VERSIO 1.01
static char dversio[] = "v1.01 21-Nov-99";
static char ident[] = "@(#) GIMP mapcolor plug-in v1.01 21-Nov-99";
#include "config.h"
#include <stdio.h>
......@@ -131,6 +133,8 @@ query (void)
};
static int nmap_args = sizeof (map_args) / sizeof (map_args[0]);
INIT_I18N ();
gimp_install_procedure ("plug_in_color_adjust",
_("Adjust current foreground/background color in the\
drawable to black/white"),
......@@ -176,13 +180,13 @@ run (char *name,
guchar *c = (guchar *)ident;
int j;
INIT_I18N_UI();
l_run_mode = run_mode = param[0].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
INIT_I18N_UI();
values[0].type = PARAM_STATUS;
values[0].data.d_status = status;
......@@ -268,7 +272,7 @@ run (char *name,
}
if (run_mode != RUN_NONINTERACTIVE)
gimp_progress_init ("Mapping colors");
gimp_progress_init (_("Mapping colors"));
color_mapping (drawable);
......@@ -319,7 +323,7 @@ dialog ()
gtk_widget_set_default_colormap(gtk_preview_get_cmap());
dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dlg), "Map colors");
gtk_window_set_title (GTK_WINDOW (dlg), _("Map colors"));
gtk_window_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
(GtkSignalFunc) mapcolor_close_callback,
......@@ -478,7 +482,7 @@ color_mapping (GDrawable *drawable)
{
int processed, total;
gint x, y, xmin, xmax, ymin, ymax;
gint x, y, xmin, xmax, ymin, ymax, bpp = (gint)drawable->bpp;
unsigned char *src, *dest;
GPixelRgn src_rgn, dest_rgn;
gpointer pr;
......@@ -521,8 +525,9 @@ color_mapping (GDrawable *drawable)
dest[0] = redmap[src[0]];
dest[1] = greenmap[src[1]];
dest[2] = bluemap[src[2]];
src += drawable->bpp;
dest += drawable->bpp;
if (bpp > 3) dest[3] = src[3];
src += bpp;
dest += bpp;
processed++;
}
}
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
* SUN raster reading and writing code Copyright (C) 1996 Peter Kirchgessner
* (email: pkirchg@aol.com, WWW: http://members.aol.com/pkirchg)
* (email: peter@kirchgessner.net, WWW: http://www.kirchgessner.net)
*
* 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
......@@ -22,7 +22,7 @@
/* This program was written using pages 625-629 of the book
* "Encyclopedia of Graphics File Formats", Murray/van Ryper,
* O'Reilly & Associates Inc.
* Bug reports or suggestions should be e-mailed to Pkirchg@aol.com
* Bug reports or suggestions should be e-mailed to peter@kirchgessner.net
*/
/* Event history:
......@@ -33,8 +33,9 @@
* V 1.93, PK, 05-Oct-97: Parse rc file
* V 1.94, PK, 12-Oct-97: No progress bars for non-interactive mode
* V 1.95, nn, 20-Dec-97: Initialize some variable
* V 1.96, PK, 21-Nov-99: Internationalization
*/
static char ident[] = "@(#) GIMP SunRaster file-plugin v1.95 20-Dec-97";
static char ident[] = "@(#) GIMP SunRaster file-plugin v1.96 21-Nov-99";
#include "config.h"
......@@ -48,6 +49,7 @@ static char ident[] = "@(#) GIMP SunRaster file-plugin v1.95 20-Dec-97";
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
#include "libgimp/stdplugins-intl.h"
typedef int WRITE_FUN(void*,size_t,size_t,FILE*);
......@@ -214,9 +216,11 @@ query (void)
};
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
INIT_I18N();
gimp_install_procedure ("file_sunras_load",
"load file of the SunRaster file format",
"load file of the SunRaster file format",
_("load file of the SunRaster file format"),
_("load file of the SunRaster file format"),
"Peter Kirchgessner",
"Peter Kirchgessner",
"1996",
......@@ -227,9 +231,9 @@ query (void)
load_args, load_return_vals);
gimp_install_procedure ("file_sunras_save",
"save file in the SunRaster file format",
"SUNRAS saving handles all image types except \
those with alpha channels.",
_("save file in the SunRaster file format"),
_("SUNRAS saving handles all image types except \
those with alpha channels."),
"Peter Kirchgessner",
"Peter Kirchgessner",
"1996",
......@@ -274,6 +278,8 @@ run (char *name,
if (strcmp (name, "file_sunras_load") == 0)
{
INIT_I18N_UI();
image_ID = load_image (param[1].data.d_string);
*nreturn_vals = 2;
......@@ -284,6 +290,8 @@ run (char *name,
}
else if (strcmp (name, "file_sunras_save") == 0)
{
INIT_I18N_UI();
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
......@@ -371,7 +379,7 @@ load_image (char *filename)
ifp = fopen (filename, "rb");
if (!ifp)
{
show_message ("can't open file for reading");
show_message (_("cant open file for reading"));
return (-1);
}
......@@ -380,14 +388,14 @@ load_image (char *filename)
read_sun_header (ifp, &sunhdr);
if (sunhdr.l_ras_magic != RAS_MAGIC)
{
show_message("can't open file as SUN-raster-file");
show_message(_("cant open file as SUN-raster-file"));
fclose (ifp);
return (-1);
}
if ((sunhdr.l_ras_type < 0) || (sunhdr.l_ras_type > 5))
{
show_message ("the type of this SUN-rasterfile\nis not supported");
show_message (_("the type of this SUN-rasterfile is not supported"));
fclose (ifp);
return (-1);
}
......@@ -422,15 +430,15 @@ load_image (char *filename)
}
else if (sunhdr.l_ras_maplength > 0)
{
show_message ("type of colourmap not supported");
show_message (_("type of colourmap not supported"));
fseek (ifp, (sizeof (L_SUNFILEHEADER)/sizeof (L_CARD32))
*4 + sunhdr.l_ras_maplength, SEEK_SET);
}
if (l_run_mode != RUN_NONINTERACTIVE)
{
temp = g_malloc (strlen (filename) + 11);
sprintf (temp, "Loading %s:", filename);
temp = g_malloc (strlen (filename) + 64);
sprintf (temp, _("Loading %s:"), filename);
gimp_progress_init (temp);
g_free (temp);
}
......@@ -464,7 +472,7 @@ load_image (char *filename)
if (image_ID == -1)
{
show_message ("this image depth is not supported");
show_message (_("this image depth is not supported"));
return (-1);
}
......@@ -488,7 +496,7 @@ save_image (char *filename,
/* Make sure we're not saving an image with an alpha channel */
if (gimp_drawable_has_alpha (drawable_ID))
{
show_message ("SUNRAS save cannot handle images with alpha channels");
show_message (_("SUNRAS save cannot handle images with alpha channels"));
return FALSE;
}
......@@ -499,7 +507,7 @@ save_image (char *filename,
case RGB_IMAGE:
break;
default:
show_message ("cannot operate on unknown image types");
show_message (_("cant operate on unknown image types"));
return (FALSE);
break;
}
......@@ -508,14 +516,14 @@ save_image (char *filename,
ofp = fopen (filename, "wb");
if (!ofp)
{
show_message ("cant open file for writing");
show_message (_("cant open file for writing"));
return (FALSE);
}
if (l_run_mode != RUN_NONINTERACTIVE)
{
temp = g_malloc (strlen (filename) + 11);
sprintf (temp, "Saving %s:", filename);
temp = g_malloc (strlen (filename) + 64);
sprintf (temp, _("Saving %s:"), filename);
gimp_progress_init (temp);
g_free (temp);
}
......@@ -921,7 +929,7 @@ create_new_image (char *filename,
image_ID = gimp_image_new (width, height, type);
gimp_image_set_filename (image_ID, filename);
*layer_ID = gimp_layer_new (image_ID, "Background", width, height,
*layer_ID = gimp_layer_new (image_ID, _("Background"), width, height,
gdtype, 100, NORMAL_MODE);
gimp_image_add_layer (image_ID, *layer_ID, 0);
......@@ -1029,7 +1037,7 @@ load_sun_d1 (char *filename,
g_free (data);
if (err)
show_message ("EOF encountered on reading");
show_message (_("EOF encountered on reading"));
gimp_drawable_flush (drawable);
......@@ -1121,7 +1129,7 @@ load_sun_d8 (char *filename,
g_free (data);
if (err)
show_message ("EOF encountered on reading");
show_message (_("EOF encountered on reading"));
gimp_drawable_flush (drawable);
......@@ -1203,7 +1211,7 @@ load_sun_d24 (char *filename,
g_free (data);
if (err)
show_message ("EOF encountered on reading");
show_message (_("EOF encountered on reading"));
gimp_drawable_flush (drawable);
......@@ -1299,7 +1307,7 @@ load_sun_d32 (char *filename,
g_free (data);
if (err)
show_message ("EOF encountered on reading");
show_message (_("EOF encountered on reading"));
gimp_drawable_flush (drawable);
......@@ -1455,7 +1463,7 @@ save_index (FILE *ofp,
if (ferror (ofp))
{
show_message ("write error occured");
show_message (_("write error occured"));
return (FALSE);
}
return (TRUE);
......@@ -1564,7 +1572,7 @@ save_rgb (FILE *ofp,
if (ferror (ofp))
{
show_message ("write error occured");
show_message (_("write error occured"));
return (FALSE);
}
return (TRUE);
......@@ -1603,14 +1611,14 @@ save_dialog (void)
gint use_std = (psvals.rle == FALSE);
dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dlg), "Save as SUNRAS");
gtk_window_set_title (GTK_WINDOW (dlg), _("Save as SUNRAS"));
gtk_window_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
(GtkSignalFunc) save_close_callback,
NULL);
/* Action area */
button = gtk_button_new_with_label ("OK");
button = gtk_button_new_with_label (_("OK"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) save_ok_callback,
......@@ -1620,7 +1628,7 @@ save_dialog (void)
gtk_widget_grab_default (button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Cancel");
button = gtk_button_new_with_label (_("Cancel"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
......@@ -1630,7 +1638,7 @@ save_dialog (void)
gtk_widget_show (button);
/* file save type */
frame = gtk_frame_new ("Data Formatting");
frame = gtk_frame_new (_("Data Formatting"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, FALSE, TRUE