gimp/app/main.c

473 lines
12 KiB
C
Raw Normal View History

1997-11-25 06:05:25 +08:00
/* 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.
1997-11-25 06:05:25 +08:00
*/
#include "config.h"
1997-11-25 06:05:25 +08:00
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
2000-02-11 09:04:23 +08:00
#ifdef HAVE_SYS_WAIT_H
1997-11-25 06:05:25 +08:00
#include <sys/wait.h>
#endif
2000-02-11 09:04:23 +08:00
#ifdef HAVE_UNISTD_H
1997-11-25 06:05:25 +08:00
#include <unistd.h>
#endif
1997-11-25 06:05:25 +08:00
#ifndef WAIT_ANY
#define WAIT_ANY -1
#endif /* WAIT_ANY */
2000-02-11 09:04:23 +08:00
#include <glib.h>
1998-07-15 10:28:31 +08:00
#include "libgimp/gimpfeatures.h"
#include "libgimp/gimpenv.h"
1998-07-15 10:28:31 +08:00
#ifndef G_OS_WIN32
#include "libgimp/gimpsignal.h"
#endif
1997-11-25 06:05:25 +08:00
#include "appenv.h"
#include "app_procs.h"
#include "errors.h"
2000-04-08 02:55:21 +08:00
#include "user_install.h"
1997-11-25 06:05:25 +08:00
#include "libgimp/gimpintl.h"
#ifdef G_OS_WIN32
#include <windows.h>
#else
static void on_signal (gint);
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
#endif
static void init (void);
static void on_error (const gchar *domain,
GLogLevelFlags flags,
const gchar *msg,
gpointer user_data);
1997-11-25 06:05:25 +08:00
/* GLOBAL data */
gboolean no_interface = FALSE;
gboolean no_data = FALSE;
gboolean no_splash = FALSE;
gboolean no_splash_image = FALSE;
gboolean be_verbose = FALSE;
gboolean use_shm = FALSE;
gboolean use_debug_handler = FALSE;
gboolean console_messages = FALSE;
gboolean restore_session = FALSE;
2000-04-25 02:32:42 +08:00
gboolean double_speed = FALSE;
GimpSet *image_context = NULL;
MessageHandlerType message_handler = CONSOLE;
gchar *prog_name = NULL; /* The path name we are invoked with */
gchar *alternate_gimprc = NULL;
gchar *alternate_system_gimprc = NULL;
gchar **batch_cmds = NULL;
1997-11-25 06:05:25 +08:00
1997-11-25 06:05:25 +08:00
/* LOCAL data */
static gint gimp_argc = 0;
static gchar **gimp_argv = NULL;
1997-11-25 06:05:25 +08:00
/*
* argv processing:
* Arguments are either switches, their associated
* values, or image files. As switches and their
* associated values are processed, those slots in
* the argv[] array are NULLed. We do this because
* unparsed args are treated as images to load on
* startup.
*
1997-11-25 06:05:25 +08:00
*
* The GTK switches are processed first (X switches are
* processed here, not by any X routines). Then the
* general GIMP switches are processed. Any args
* left are assumed to be image files the GIMP should
* display.
*
* The exception is the batch switch. When this is
* encountered, all remaining args are treated as batch
* commands.
*/
1998-02-05 13:41:05 +08:00
int
main (int argc,
char **argv)
1997-11-25 06:05:25 +08:00
{
gboolean show_version = FALSE;
gboolean show_help = FALSE;
gint i, j;
#ifdef HAVE_PUTENV
gchar *display_env;
#endif
1997-11-25 06:05:25 +08:00
g_atexit (g_mem_profile);
1997-11-25 06:05:25 +08:00
/* Initialize variables */
1997-11-25 06:05:25 +08:00
prog_name = argv[0];
/* Initialize i18n support */
INIT_LOCALE ("gimp");
#ifdef ENABLE_NLS
bindtextdomain ("gimp-libgimp", LOCALEDIR);
#endif
gtk_init (&argc, &argv);
setlocale (LC_NUMERIC, "C"); /* gtk seems to zap this during init.. */
#ifdef HAVE_PUTENV
display_env = g_strconcat ("DISPLAY=", gdk_get_display (), NULL);
putenv (display_env);
#endif
#if defined (HAVE_SHM_H) || defined (G_OS_WIN32)
1997-11-25 06:05:25 +08:00
use_shm = TRUE;
#endif
batch_cmds = g_new (char *, argc);
1997-11-25 06:05:25 +08:00
batch_cmds[0] = NULL;
for (i = 1; i < argc; i++)
{
if ((strcmp (argv[i], "--no-interface") == 0) ||
(strcmp (argv[i], "-n") == 0))
{
no_interface = TRUE;
argv[i] = NULL;
1997-11-25 06:05:25 +08:00
}
else if ((strcmp (argv[i], "--batch") == 0) ||
(strcmp (argv[i], "-b") == 0))
{
argv[i] = NULL;
for (j = 0, i++ ; i < argc; j++, i++)
{
1997-11-25 06:05:25 +08:00
batch_cmds[j] = argv[i];
argv[i] = NULL;
}
1997-11-25 06:05:25 +08:00
batch_cmds[j] = NULL;
if (batch_cmds[0] == NULL) /* We need at least one batch command */
show_help = TRUE;
1997-11-25 06:05:25 +08:00
}
else if (strcmp (argv[i], "--system-gimprc") == 0)
{
argv[i] = NULL;
if (argc <= ++i)
{
show_help = TRUE;
}
else
{
alternate_system_gimprc = argv[i];
argv[i] = NULL;
}
}
1998-07-11 10:00:19 +08:00
else if ((strcmp (argv[i], "--gimprc") == 0) ||
(strcmp (argv[i], "-g") == 0))
{
if (argc <= ++i)
{
show_help = TRUE;
}
else
{
alternate_gimprc = argv[i];
argv[i] = NULL;
1998-07-11 10:00:19 +08:00
}
}
1997-11-25 06:05:25 +08:00
else if ((strcmp (argv[i], "--help") == 0) ||
(strcmp (argv[i], "-h") == 0))
{
show_help = TRUE;
argv[i] = NULL;
1997-11-25 06:05:25 +08:00
}
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
show_version = TRUE;
argv[i] = NULL;
1997-11-25 06:05:25 +08:00
}
else if (strcmp (argv[i], "--no-data") == 0)
{
no_data = TRUE;
argv[i] = NULL;
1997-11-25 06:05:25 +08:00
}
else if (strcmp (argv[i], "--no-splash") == 0)
{
no_splash = TRUE;
argv[i] = NULL;
}
else if (strcmp (argv[i], "--no-splash-image") == 0)
{
no_splash_image = TRUE;
argv[i] = NULL;
}
else if (strcmp (argv[i], "--verbose") == 0)
{
be_verbose = TRUE;
argv[i] = NULL;
}
1997-11-25 06:05:25 +08:00
else if (strcmp (argv[i], "--no-shm") == 0)
{
use_shm = FALSE;
argv[i] = NULL;
1997-11-25 06:05:25 +08:00
}
else if (strcmp (argv[i], "--debug-handlers") == 0)
{
use_debug_handler = TRUE;
argv[i] = NULL;
}
else if (strcmp (argv[i], "--console-messages") == 0)
{
console_messages = TRUE;
argv[i] = NULL;
}
else if ((strcmp (argv[i], "--restore-session") == 0) ||
(strcmp (argv[i], "-r") == 0))
{
restore_session = TRUE;
argv[i] = NULL;
}
2000-04-25 02:32:42 +08:00
else if (strcmp (argv[i], "--wilber-on-lsd") == 0)
{
double_speed = TRUE;
argv[i] = NULL;
}
/*
* ANYTHING ELSE starting with a '-' is an error.
*/
1997-11-25 06:05:25 +08:00
else if (argv[i][0] == '-')
{
show_help = TRUE;
}
}
#ifdef G_OS_WIN32
/* Common windoze apps don't have a console at all. So does Gimp
* - if appropiate. This allows to compile as console application
* with all it's benfits (like inheriting the console) but hide
* it, if the user doesn't want it.
*/
if (!show_help && !show_version && !be_verbose && !console_messages)
FreeConsole ();
#endif
1997-11-25 06:05:25 +08:00
if (show_version)
g_print ( "%s %s\n", _("GIMP version"), GIMP_VERSION);
1997-11-25 06:05:25 +08:00
if (show_help)
{
g_print (_("Usage: %s [option ...] [files ...]\n"), argv[0]);
g_print (_("Valid options are:\n"));
g_print (_(" -h --help Output this help.\n"));
g_print (_(" -v --version Output version info.\n"));
g_print (_(" -b --batch <commands> Run in batch mode.\n"));
g_print (_(" -g --gimprc <gimprc> Use an alternate gimprc file.\n"));
g_print (_(" -n --no-interface Run without a user interface.\n"));
g_print (_(" -r --restore-session Try to restore saved session.\n"));
g_print (_(" --no-data Do not load patterns, gradients, palettes, brushes.\n"));
g_print (_(" --verbose Show startup messages.\n"));
g_print (_(" --no-splash Do not show the startup window.\n"));
g_print (_(" --no-splash-image Do not add an image to the startup window.\n"));
g_print (_(" --no-shm Do not use shared memory between GIMP and its plugins.\n"));
g_print (_(" --no-xshm Do not use the X Shared Memory extension.\n"));
g_print (_(" --console-messages Display warnings to console instead of a dialog box.\n"));
g_print (_(" --debug-handlers Enable debugging signal handlers.\n"));
g_print (_(" --display <display> Use the designated X display.\n"));
g_print (_(" --system-gimprc <gimprc> Use an alternate system gimprc file.\n"));
1997-11-25 06:05:25 +08:00
}
if (show_version || show_help)
{
#ifdef G_OS_WIN32
/* Give them time to read the message if it was printed in a
* separate console window. I would really love to have
* some way of asking for confirmation to close the console
* window.
*/
HANDLE console;
DWORD mode;
console = GetStdHandle (STD_OUTPUT_HANDLE);
if (GetConsoleMode (console, &mode) != 0)
{
g_print (_("(This console window will close in ten seconds)\n"));
Sleep(10000);
}
#endif
exit (0);
}
1997-11-25 06:05:25 +08:00
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-23 00:21:10 +08:00
g_set_message_handler ((GPrintFunc) gimp_message_func);
#ifndef G_OS_WIN32
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
/* No use catching these on Win32, the user won't get any
* stack trace from glib anyhow. It's better to let Windows inform
* about the program error, and offer debugging (if the use
* has installed MSVC or some other compiler that knows how to
* install itself as a handler for program errors).
*/
1997-11-25 06:05:25 +08:00
/* Handle some signals */
gimp_signal_private (SIGHUP, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGINT, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGQUIT, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGABRT, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGBUS, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGSEGV, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGPIPE, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGTERM, on_signal, SA_RESETHAND | SA_NODEFER);
gimp_signal_private (SIGFPE, on_signal, SA_RESETHAND | SA_NODEFER);
#ifndef __EMX__ /* OS/2 may not support SA_NOCLDSTOP -GRO */
/* Disable child exit notification. This doesn't just block */
/* receipt of SIGCHLD, it in fact completely disables the */
/* generation of the signal by the OS. This behavior is */
/* mandated by POSIX.1. */
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
gimp_signal_private (SIGCHLD, NULL, SA_NOCLDSTOP);
#endif
#endif
1997-11-25 06:05:25 +08:00
g_log_set_handler (NULL, G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
on_error, NULL);
1997-11-25 06:05:25 +08:00
/* Keep the command line arguments--for use in gimp_init */
gimp_argc = argc - 1;
gimp_argv = argv + 1;
/* Check the user_installation */
user_install_verify (init);
1997-11-25 06:05:25 +08:00
/* Main application loop */
1998-02-05 13:41:05 +08:00
if (!app_exit_finish_done ())
gtk_main ();
1998-02-05 13:41:05 +08:00
return 0;
1997-11-25 06:05:25 +08:00
}
#ifdef G_OS_WIN32
/* In case we build this as a windowed application */
#ifdef __GNUC__
# ifndef _stdcall
# define _stdcall __attribute__((stdcall))
# endif
#endif
int _stdcall
WinMain (struct HINSTANCE__ *hInstance,
struct HINSTANCE__ *hPrevInstance,
char *lpszCmdLine,
int nCmdShow)
{
return main (__argc, __argv);
}
#endif
1997-11-25 06:05:25 +08:00
static void
init (void)
1997-11-25 06:05:25 +08:00
{
/* Continue initializing */
gimp_init (gimp_argc, gimp_argv);
}
static void
on_error (const gchar *domain,
GLogLevelFlags flags,
const gchar *msg,
gpointer user_data)
{
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
gimp_fatal_error ("%s", msg);
}
#ifndef G_OS_WIN32
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
/* gimp core signal handler for fatal signals */
static void
on_signal (gint sig_num)
1997-11-25 06:05:25 +08:00
{
gimprc.in replaced "color-cube" by "min-colors". 2000-04-30 Michael Natterer <mitch@gimp.org> * gimprc.in * app/gimprc.[ch]: replaced "color-cube" by "min-colors". * app/app_procs.c: read unitrc/gimprc before displaying the splash. * app/colormaps.c: set min_colors and install_cmap before initializing GdkRGB. * app/gimprc.[ch] * app/gimpunit.c: don't call the splash's progress_update function. * app/plug_in.c: pass min_colors instead of color_cube to plugins. * app/preferences_dialog.c: widget for min_colors. * libgimp/gimp.[ch]: s/color_cube/min_colors/ but left gimp_color_cube() there for source level compatibility. * libgimp/gimpprotocol.[ch]: changed the GPConfig message accordinly and increased the gimp protocol version number because the change breaks binary compatibility. Also actually pass the use_xshm variable over the wire (was only in the GPConfig struct before). Was it the right thing to do to increase the version number?? * libgimp/gimpui.c (gimp_ui_init): use the same code as the app for initializing GdkRGB. Never explicitly activate Gdk's SHM usage (only switch it off). * app/main.c * libgimp/gimp.c: reverted the handling of all signals except SIGCHLD back to plain old signal() because those signals are fatal anyway and sigaction() as used by gimp_signal_*() made debugging (stacktrace) impossible. * plug-ins/AlienMap/AlienMap.c * plug-ins/AlienMap2/AlienMap2.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/bmp/bmp.c * plug-ins/borderaverage/borderaverage.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/faxg3/faxg3.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp.c * plug-ins/fp/fp_gtk.c * plug-ins/gdyntext/Makefile.am * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/helpbrowser/helpbrowser.c * plug-ins/ifscompose/ifscompose.c * plug-ins/imagemap/Makefile.am * plug-ins/imagemap/imap_main.c * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/Makefile.am * plug-ins/sel2path/sel2path.c * plug-ins/sgi/sgi.c * plug-ins/sinus/sinus.c * plug-ins/struc/struc.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c * plug-ins/xjt/xjt.c: use gimp_ui_init(). * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c: only switch Gdk SHM usage off, never on. Don't use gimp_ui_init() here because of libgck.
2000-05-01 02:17:55 +08:00
static gboolean caught_fatal_sig = FALSE;
1997-11-25 06:05:25 +08:00
if (caught_fatal_sig)
kill (getpid (), sig_num);
2000-02-11 09:04:23 +08:00
caught_fatal_sig = TRUE;
1997-11-25 06:05:25 +08:00
switch (sig_num)
{
1997-11-25 06:05:25 +08:00
case SIGHUP:
gimp_terminate ("sighup caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGINT:
gimp_terminate ("sigint caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGQUIT:
gimp_terminate ("sigquit caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGABRT:
gimp_terminate ("sigabrt caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGBUS:
gimp_fatal_error ("sigbus caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGSEGV:
gimp_fatal_error ("sigsegv caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGPIPE:
gimp_terminate ("sigpipe caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGTERM:
gimp_terminate ("sigterm caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SIGFPE:
gimp_fatal_error ("sigfpe caught");
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
default:
gimp_fatal_error ("unknown signal");
1997-11-25 06:05:25 +08:00
break;
}
}
#endif /* !G_OS_WIN32 */