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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-02-21 07:20:54 +08:00
|
|
|
#include "config.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <signal.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/param.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1999-02-07 18:45:56 +08:00
|
|
|
#include <sys/types.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#ifdef HAVE_DIRENT_H
|
1999-02-07 18:45:56 +08:00
|
|
|
#include <dirent.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <unistd.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-02-07 09:16:18 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <process.h> /* For _getpid() */
|
|
|
|
#endif
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
#include "libgimp/gimplimits.h"
|
|
|
|
#include "libgimp/gimpfeatures.h"
|
|
|
|
#include "libgimp/gimpenv.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/core-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-04-07 23:58:26 +08:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
|
2001-04-07 23:58:26 +08:00
|
|
|
#include "pdb/internal_procs.h"
|
|
|
|
|
|
|
|
#include "tools/curves.h"
|
|
|
|
#include "tools/hue_saturation.h"
|
|
|
|
#include "tools/levels.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gui/color-notebook.h"
|
2001-04-28 23:11:29 +08:00
|
|
|
#include "gui/file-open-dialog.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gui/gui.h"
|
|
|
|
#include "gui/splash.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "app_procs.h"
|
|
|
|
#include "batch.h"
|
|
|
|
#include "color_transfer.h"
|
|
|
|
#include "colormaps.h"
|
1999-06-19 02:29:27 +08:00
|
|
|
#include "context_manager.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "gdisplay_ops.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
1998-10-30 18:21:33 +08:00
|
|
|
#include "gimpparasite.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "global_edit.h"
|
|
|
|
#include "plug_in.h"
|
1999-01-19 08:03:00 +08:00
|
|
|
#include "module_db.h"
|
2001-04-16 04:12:16 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "temp_buf.h"
|
|
|
|
#include "tile_swap.h"
|
|
|
|
#include "undo.h"
|
1999-03-17 04:14:07 +08:00
|
|
|
#include "unitrc.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "xcf.h"
|
1998-05-28 17:03:57 +08:00
|
|
|
#include "errors.h"
|
1998-07-08 18:29:09 +08:00
|
|
|
#include "docindex.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-25 04:27:04 +08:00
|
|
|
#ifdef DISPLAY_FILTERS
|
|
|
|
#include "gdisplay_color.h"
|
|
|
|
#endif /* DISPLAY_FILTERS */
|
|
|
|
|
1999-04-09 14:00:11 +08:00
|
|
|
#include "gimpparasite.h"
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-04-27 23:31:50 +08:00
|
|
|
static void app_init (void);
|
2001-04-16 04:12:16 +08:00
|
|
|
static void toast_old_temp_files (void);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2000-04-06 06:59:42 +08:00
|
|
|
static gboolean is_app_exit_finish_done = FALSE;
|
1999-12-18 00:37:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
2000-05-08 01:47:24 +08:00
|
|
|
gimp_init (gint gimp_argc,
|
|
|
|
gchar **gimp_argv)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* Initialize the application */
|
|
|
|
app_init ();
|
|
|
|
|
|
|
|
/* Parse the rest of the command line arguments as images to load */
|
|
|
|
if (gimp_argc > 0)
|
|
|
|
while (gimp_argc--)
|
|
|
|
{
|
|
|
|
if (*gimp_argv)
|
2001-04-28 23:11:29 +08:00
|
|
|
file_open_with_display (*gimp_argv, *gimp_argv);
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_argv++;
|
|
|
|
}
|
|
|
|
|
|
|
|
batch_init ();
|
1998-05-12 17:53:24 +08:00
|
|
|
|
2001-05-01 21:16:59 +08:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
|
|
|
gui_post_init ();
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-01-20 08:12:21 +08:00
|
|
|
void
|
2001-03-30 19:16:05 +08:00
|
|
|
app_init_update_status (const gchar *text1,
|
|
|
|
const gchar *text2,
|
|
|
|
gdouble percentage)
|
1998-01-20 08:12:21 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface && ! no_splash)
|
1998-01-20 08:12:21 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
splash_update (text1, text2, percentage);
|
1998-01-20 08:12:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* #define RESET_BAR() app_init_update_status("", "", 0) */
|
|
|
|
#define RESET_BAR()
|
|
|
|
|
2001-04-27 23:31:50 +08:00
|
|
|
static void
|
1998-05-12 17:53:24 +08:00
|
|
|
app_init (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-02-14 22:57:14 +08:00
|
|
|
const gchar *gtkrc;
|
|
|
|
gchar *filename;
|
|
|
|
gchar *path;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-11-04 06:59:50 +08:00
|
|
|
/* parse the systemwide gtkrc */
|
2001-02-14 22:57:14 +08:00
|
|
|
gtkrc = gimp_gtkrc ();
|
1998-04-30 13:30:28 +08:00
|
|
|
|
2000-08-15 23:42:14 +08:00
|
|
|
if (be_verbose)
|
2001-02-14 22:57:14 +08:00
|
|
|
g_print (_("parsing \"%s\"\n"), gtkrc);
|
1998-04-30 13:30:28 +08:00
|
|
|
|
2001-02-14 22:57:14 +08:00
|
|
|
gtk_rc_parse (gtkrc);
|
1998-04-30 13:30:28 +08:00
|
|
|
|
2000-11-04 06:59:50 +08:00
|
|
|
/* parse the user gtkrc */
|
|
|
|
filename = gimp_personal_rc_file ("gtkrc");
|
|
|
|
|
|
|
|
if (be_verbose)
|
|
|
|
g_print (_("parsing \"%s\"\n"), filename);
|
|
|
|
|
|
|
|
gtk_rc_parse (filename);
|
|
|
|
|
2000-11-08 07:12:03 +08:00
|
|
|
g_free (filename);
|
|
|
|
|
2000-05-01 02:17:55 +08:00
|
|
|
if (parse_buffers_init ())
|
|
|
|
{
|
|
|
|
parse_unitrc (); /* this needs to be done before gimprc loading */
|
|
|
|
parse_gimprc (); /* parse the local GIMP configuration file */
|
|
|
|
}
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
|
|
|
get_standard_colormaps ();
|
1999-05-01 05:11:27 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_splash)
|
|
|
|
splash_create ();
|
|
|
|
}
|
1998-07-02 07:06:49 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* Initialize the context system before loading any data */
|
|
|
|
context_manager_init ();
|
|
|
|
|
1999-06-19 02:29:27 +08:00
|
|
|
/* Initialize the procedural database
|
1997-11-25 06:05:25 +08:00
|
|
|
* We need to do this first because any of the init
|
|
|
|
* procedures might install or query it as needed.
|
|
|
|
*/
|
|
|
|
procedural_db_init ();
|
1998-01-20 08:12:21 +08:00
|
|
|
RESET_BAR();
|
1997-11-25 06:05:25 +08:00
|
|
|
internal_procs_init ();
|
|
|
|
|
2000-12-25 04:27:04 +08:00
|
|
|
#ifdef DISPLAY_FILTERS
|
1999-10-05 03:26:07 +08:00
|
|
|
color_display_init ();
|
2000-12-25 04:27:04 +08:00
|
|
|
#endif /* DISPLAY_FILTERS */
|
1999-07-29 07:00:08 +08:00
|
|
|
|
1998-02-18 04:14:29 +08:00
|
|
|
RESET_BAR();
|
1998-07-12 06:23:23 +08:00
|
|
|
if (always_restore_session)
|
|
|
|
restore_session = TRUE;
|
1998-02-18 04:14:29 +08:00
|
|
|
|
1998-12-06 05:48:37 +08:00
|
|
|
/* make sure the monitor resolution is valid */
|
1999-05-23 01:56:35 +08:00
|
|
|
if (monitor_xres < GIMP_MIN_RESOLUTION ||
|
|
|
|
monitor_yres < GIMP_MIN_RESOLUTION)
|
1999-05-01 05:11:27 +08:00
|
|
|
{
|
1999-05-23 01:56:35 +08:00
|
|
|
gdisplay_xserver_resolution (&monitor_xres, &monitor_yres);
|
1999-05-01 05:11:27 +08:00
|
|
|
using_xserver_resolution = TRUE;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1998-02-18 04:14:29 +08:00
|
|
|
/* Now we are ready to draw the splash-screen-image to the start-up window */
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface && ! no_splash_image)
|
1998-02-18 04:14:29 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
splash_logo_load ();
|
1998-02-18 04:14:29 +08:00
|
|
|
}
|
|
|
|
|
1998-01-20 08:12:21 +08:00
|
|
|
RESET_BAR();
|
1997-11-25 06:05:25 +08:00
|
|
|
xcf_init (); /* initialize the xcf file format routines */
|
1998-03-27 02:24:42 +08:00
|
|
|
|
2001-02-14 09:42:12 +08:00
|
|
|
/* initialize the global parasite table */
|
1999-04-09 14:00:11 +08:00
|
|
|
app_init_update_status (_("Looking for data files"), _("Parasites"), 0.00);
|
2001-02-14 09:42:12 +08:00
|
|
|
gimp_init_parasites ();
|
|
|
|
|
|
|
|
/* initialize the list of gimp brushes */
|
1999-04-09 14:00:11 +08:00
|
|
|
app_init_update_status (NULL, _("Brushes"), 0.20);
|
2001-02-14 09:42:12 +08:00
|
|
|
gimp_data_factory_data_init (global_brush_factory, no_data);
|
|
|
|
|
|
|
|
/* initialize the list of gimp patterns */
|
1999-04-09 14:00:11 +08:00
|
|
|
app_init_update_status (NULL, _("Patterns"), 0.40);
|
2001-02-14 09:42:12 +08:00
|
|
|
gimp_data_factory_data_init (global_pattern_factory, no_data);
|
|
|
|
|
|
|
|
/* initialize the list of gimp palettes */
|
1999-04-09 14:00:11 +08:00
|
|
|
app_init_update_status (NULL, _("Palettes"), 0.60);
|
2001-02-14 09:42:12 +08:00
|
|
|
gimp_data_factory_data_init (global_palette_factory, no_data);
|
|
|
|
|
|
|
|
/* initialize the list of gimp gradients */
|
1999-04-09 14:00:11 +08:00
|
|
|
app_init_update_status (NULL, _("Gradients"), 0.80);
|
2001-02-14 09:42:12 +08:00
|
|
|
gimp_data_factory_data_init (global_gradient_factory, no_data);
|
|
|
|
|
1998-04-15 03:24:23 +08:00
|
|
|
app_init_update_status (NULL, NULL, 1.00);
|
1998-03-27 02:24:42 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
plug_in_init (); /* initialize the plug in structures */
|
|
|
|
module_db_init (); /* load any modules we need */
|
2001-03-30 21:31:41 +08:00
|
|
|
|
1998-01-20 08:12:21 +08:00
|
|
|
RESET_BAR();
|
1999-11-20 20:12:41 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Add the swap file */
|
|
|
|
if (swap_path == NULL)
|
1999-03-07 20:56:03 +08:00
|
|
|
swap_path = g_get_tmp_dir ();
|
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
toast_old_temp_files ();
|
1999-03-07 20:56:03 +08:00
|
|
|
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimpswap.%lu",
|
|
|
|
swap_path, (unsigned long) getpid ());
|
1997-11-25 06:05:25 +08:00
|
|
|
tile_swap_add (path, NULL, NULL);
|
|
|
|
g_free (path);
|
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_splash)
|
|
|
|
splash_destroy ();
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
gui_init ();
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
/* FIXME: This needs to go in preferences */
|
1998-06-20 07:45:54 +08:00
|
|
|
message_handler = MESSAGE_BOX;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
color_transfer_init ();
|
|
|
|
paint_funcs_setup ();
|
1998-01-20 08:12:21 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
1998-08-13 23:25:41 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
gui_restore ();
|
1998-08-13 23:25:41 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-03-30 19:16:05 +08:00
|
|
|
void
|
|
|
|
app_exit (gboolean kill_it)
|
1998-02-05 13:41:05 +08:00
|
|
|
{
|
2001-03-30 19:16:05 +08:00
|
|
|
/* If it's the user's perogative, and there are dirty images */
|
|
|
|
if (!kill_it && gdisplays_dirty () && !no_interface)
|
|
|
|
really_quit_dialog ();
|
|
|
|
else
|
|
|
|
app_exit_finish ();
|
1998-02-05 13:41:05 +08:00
|
|
|
}
|
|
|
|
|
1998-02-04 06:54:35 +08:00
|
|
|
void
|
1998-05-12 17:53:24 +08:00
|
|
|
app_exit_finish (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-02-05 13:41:05 +08:00
|
|
|
if (app_exit_finish_done ())
|
|
|
|
return;
|
2001-03-30 19:16:05 +08:00
|
|
|
|
1998-02-05 13:41:05 +08:00
|
|
|
is_app_exit_finish_done = TRUE;
|
1998-02-04 06:54:35 +08:00
|
|
|
|
1998-06-20 07:45:54 +08:00
|
|
|
message_handler = CONSOLE;
|
1998-05-30 15:32:37 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
|
|
|
gui_shutdown ();
|
|
|
|
}
|
1999-09-03 01:27:28 +08:00
|
|
|
|
1999-04-15 03:51:49 +08:00
|
|
|
module_db_free ();
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_delete ();
|
|
|
|
global_edit_free ();
|
|
|
|
named_buffers_free ();
|
|
|
|
swapping_free ();
|
1999-10-27 02:27:27 +08:00
|
|
|
context_manager_free ();
|
1997-11-25 06:05:25 +08:00
|
|
|
hue_saturation_free ();
|
|
|
|
curves_free ();
|
|
|
|
levels_free ();
|
|
|
|
paint_funcs_free ();
|
|
|
|
plug_in_kill ();
|
1998-07-08 06:42:35 +08:00
|
|
|
procedural_db_free ();
|
1997-11-25 06:05:25 +08:00
|
|
|
tile_swap_exit ();
|
1999-03-17 04:14:07 +08:00
|
|
|
save_unitrc ();
|
1999-04-09 14:00:11 +08:00
|
|
|
gimp_parasiterc_save ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-04-16 04:12:16 +08:00
|
|
|
gui_exit ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-06-23 01:30:40 +08:00
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
/* There used to be gtk_main_quit() here, but there's a chance
|
|
|
|
* that gtk_main() was never called before we reach this point. --Sven
|
|
|
|
*/
|
|
|
|
gtk_exit (0);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-03-30 19:16:05 +08:00
|
|
|
gboolean
|
|
|
|
app_exit_finish_done (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-03-30 19:16:05 +08:00
|
|
|
return is_app_exit_finish_done;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
static void
|
|
|
|
toast_old_temp_files (void)
|
|
|
|
{
|
2001-03-30 19:16:05 +08:00
|
|
|
DIR *dir;
|
1999-02-07 18:45:56 +08:00
|
|
|
struct dirent *entry;
|
2001-03-30 19:16:05 +08:00
|
|
|
GString *filename = g_string_new ("");
|
1998-07-21 08:15:24 +08:00
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
dir = opendir (swap_path);
|
1999-12-18 00:37:50 +08:00
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
if (!dir)
|
|
|
|
return;
|
1999-12-18 00:37:50 +08:00
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
while ((entry = readdir (dir)) != NULL)
|
|
|
|
if (!strncmp (entry->d_name, "gimpswap.", 9))
|
|
|
|
{
|
|
|
|
/* don't try to kill swap files of running processes
|
|
|
|
* yes, I know they might not all be gimp processes, and when you
|
|
|
|
* unlink, it's refcounted, but lets not confuse the user by
|
|
|
|
* "where did my disk space go?" cause the filename is gone
|
|
|
|
* if the kill succeeds, and there running process isn't gimp
|
|
|
|
* we'll probably get it the next time around
|
|
|
|
*/
|
|
|
|
|
1999-12-18 00:37:50 +08:00
|
|
|
gint pid = atoi (entry->d_name + 9);
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifndef G_OS_WIN32
|
1999-02-07 18:45:56 +08:00
|
|
|
if (kill (pid, 0))
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1999-02-07 18:45:56 +08:00
|
|
|
{
|
1999-12-18 00:37:50 +08:00
|
|
|
/* On Windows, you can't remove open files anyhow,
|
|
|
|
* so no harm trying.
|
|
|
|
*/
|
1999-02-21 07:20:54 +08:00
|
|
|
g_string_sprintf (filename, "%s" G_DIR_SEPARATOR_S "%s",
|
|
|
|
swap_path, entry->d_name);
|
1999-02-07 18:45:56 +08:00
|
|
|
unlink (filename->str);
|
|
|
|
}
|
|
|
|
}
|
1998-07-21 08:15:24 +08:00
|
|
|
|
1999-02-07 18:45:56 +08:00
|
|
|
closedir (dir);
|
|
|
|
|
|
|
|
g_string_free (filename, TRUE);
|
|
|
|
}
|