gimp/app/errors.c
Michael Natterer a4c1e8a557 new ui for the "Layer Offset" dialog.
1999-07-22  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.

	* app/channels_dialog.c
	* app/layers_dialog.c: major code cleanup: Folded some callbacks
	into common ones, "widget" instead of "w", indentation, ...

	* app/commands.c
	* app/interface.[ch]
	* app/global_edit.c: the query boxes must be shown by the caller
	now. There's no need to split up the string for the message box
	manually as the Gtk 1.2 label widget handles newlines corectly.
	Added the "edge_lock" toggle to the "Shrink Selection" dialog.
	Nicer spacings for the query and message boxes.

	* app/ink.c: tried to grab the pointer in the blob preview but
	failed. Left the code there as a reminder (commented out).

	* app/menus.c: reordered <Image>/Select.

	I was bored and grep-ed the sources for ancient or deprecated stuff:

	* app/about_dialog.[ch]
	* app/actionarea.[ch]
	* app/app_procs.c
	* app/brush_edit.c
	* app/brush_select.c
	* app/color_select.c
	* app/convert.c
	* app/devices.c
	* app/gdisplay.c
	* app/gdisplay_ops.c
	* app/histogram_tool.[ch]
	* app/info_window.c
	* app/install.c
	* app/ops_buttons.c
	* app/palette.c
	* app/palette_select.c
	* app/paths_dialog.c
	* app/pattern_select.c
	* app/resize.c
	* app/scale_toolc.c
	* app/text_tool.c:
	s/container_border_width/container_set_border_width/g,
	s/sprintf/g_snprintf/g, replaced some constant string lengths with
	strlen(x).

	* app/bezier_select.c
	* app/blend.c
	* app/boundary.c
	* app/errors.[ch]
	* app/free_select.c
	* app/gimpbrushlist.c
	* app/gimprc.c
	* app/iscissors.c
	* app/main.c
	* app/patterns.[ch]
	* app/text_tool.c: namespace fanaticism: prefixed all gimp error
	functions with "gimp_" and formated the messages more uniformly.

	* app/gradient.c
	* app/gradient_select.c: same stuff as above for the ui
	code. There are still some sub-dialogs which need cleanup.

	Did some cleanup in most of these files: prototypes, removed tons
	of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-22 16:21:10 +00:00

107 lines
2.4 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
#include <sys/types.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include "appenv.h"
#include "app_procs.h"
#include "interface.h"
#include "errorconsole.h"
#include "errors.h"
#include "libgimp/gimpintl.h"
extern gchar *prog_name;
void
gimp_message_func (gchar *str)
{
if (console_messages == FALSE)
switch (message_handler)
{
case MESSAGE_BOX:
message_box (str, NULL, NULL);
break;
case ERROR_CONSOLE:
error_console_add (str);
break;
default:
fprintf (stderr, "%s: %s\n", prog_name, str);
break;
}
else
fprintf (stderr, "%s: %s\n", prog_name, str);
}
void
gimp_fatal_error (gchar *fmt, ...)
{
va_list args;
va_start (args, fmt);
#ifndef NATIVE_WIN32
printf (_("%s: fatal error: %s\n"), prog_name, g_strdup_vprintf (fmt, args));
#else
g_error (_("%s: fatal error: %s\n"), prog_name, g_strdup_vprintf (fmt, args));
#endif
va_end (args);
#ifndef NATIVE_WIN32
g_on_error_query (prog_name);
#else
/* g_on_error_query unreliable on Win32 */
abort ();
#endif
app_exit (1);
}
void
gimp_terminate (gchar *fmt, ...)
{
va_list args;
va_start (args, fmt);
printf ("%s terminated: ", prog_name);
vprintf (fmt, args);
printf ("\n");
va_end (args);
#ifndef NATIVE_WIN32
if (use_debug_handler)
g_on_error_query (prog_name);
#endif
gdk_exit (1);
}