1997-11-24 22:05:25 +00: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 05:44:11 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1999-02-20 23:20:54 +00:00
|
|
|
#include "config.h"
|
1999-09-27 17:58:10 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2001-12-02 14:59:30 +00:00
|
|
|
#include <stdlib.h>
|
2002-02-18 14:34:50 +00:00
|
|
|
|
1999-02-20 23:20:54 +00:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
1997-11-24 22:05:25 +00:00
|
|
|
#include <sys/param.h>
|
1999-02-20 23:20:54 +00:00
|
|
|
#endif
|
2002-02-18 14:34:50 +00:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-02-07 01:16:18 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-05-21 20:30:16 +00:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-24 22:36:18 +00:00
|
|
|
|
2001-05-13 11:35:20 +00:00
|
|
|
#include "tools/tools-types.h"
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2001-05-20 18:37:07 +00:00
|
|
|
#include "base/base.h"
|
2001-04-07 15:58:26 +00:00
|
|
|
|
2001-07-04 19:31:35 +00:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
#include "core/gimpdatafactory.h"
|
2001-07-11 12:39:49 +00:00
|
|
|
#include "core/gimpunit.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
|
2001-12-01 00:14:14 +00:00
|
|
|
#include "plug-in/plug-in.h"
|
|
|
|
|
2001-11-10 19:35:21 +00:00
|
|
|
#include "file/file-open.h"
|
|
|
|
|
2001-10-13 12:52:30 +00:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-09-25 23:23:09 +00:00
|
|
|
|
2001-07-07 12:17:23 +00:00
|
|
|
#include "tools/tool_manager.h"
|
2001-04-07 15:58:26 +00:00
|
|
|
|
2001-04-17 21:43:29 +00:00
|
|
|
#include "gui/gui.h"
|
|
|
|
#include "gui/splash.h"
|
2001-11-10 19:35:21 +00:00
|
|
|
#include "gui/user-install-dialog.h"
|
2001-04-17 21:43:29 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "app_procs.h"
|
|
|
|
#include "batch.h"
|
|
|
|
#include "gimprc.h"
|
|
|
|
#include "undo.h"
|
|
|
|
|
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-14 23:23:52 +00:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 15:22:01 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
/* local prototypes */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
static void app_init_update_status (const gchar *text1,
|
|
|
|
const gchar *text2,
|
|
|
|
gdouble percentage);
|
|
|
|
static void app_exit_finish (void);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-12-17 16:37:50 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
/* global variables */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
Gimp *the_gimp = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
/* public functions */
|
1998-01-20 00:12:21 +00:00
|
|
|
|
2001-07-04 19:31:35 +00:00
|
|
|
void
|
|
|
|
app_init (gint gimp_argc,
|
|
|
|
gchar **gimp_argv)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
const gchar *gimp_dir;
|
|
|
|
|
|
|
|
/* Create an instance of the "Gimp" object which is the root of the
|
|
|
|
* core object system
|
|
|
|
*/
|
2001-12-01 00:14:14 +00:00
|
|
|
the_gimp = gimp_new (be_verbose,
|
|
|
|
no_data,
|
|
|
|
no_interface,
|
|
|
|
stack_trace_mode);
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
|
2001-12-01 21:02:34 +00:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (the_gimp), prog_name);
|
|
|
|
|
2001-07-25 15:22:55 +00:00
|
|
|
/* Check if the user's gimp_directory exists
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
*/
|
|
|
|
gimp_dir = gimp_directory ();
|
1998-04-30 05:30:28 +00:00
|
|
|
|
2002-02-18 14:34:50 +00:00
|
|
|
if (!g_file_test (gimp_dir, G_FILE_TEST_IS_DIR))
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
{
|
|
|
|
/* not properly installed */
|
|
|
|
|
|
|
|
if (no_interface)
|
|
|
|
{
|
|
|
|
g_print (_("The GIMP is not properly installed for the current user\n"));
|
|
|
|
g_print (_("User installation was skipped because the '--nointerface' flag was encountered\n"));
|
|
|
|
g_print (_("To perform user installation, run the GIMP without the '--nointerface' flag\n"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
user_install_dialog_create (the_gimp);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
}
|
|
|
|
}
|
1998-04-30 05:30:28 +00:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
/* The user_install dialog may have parsed unitrc and gimprc, so
|
|
|
|
* check gimprc_init()'s return value
|
|
|
|
*/
|
|
|
|
if (gimprc_init (the_gimp))
|
2000-04-30 18:17:55 +00:00
|
|
|
{
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
/* this needs to be done before gimprc loading */
|
|
|
|
gimp_unitrc_load (the_gimp);
|
|
|
|
|
|
|
|
/* parse the local GIMP configuration file */
|
2001-12-01 00:14:14 +00:00
|
|
|
gimprc_parse (the_gimp, alternate_system_gimprc, alternate_gimprc);
|
2000-04-30 18:17:55 +00:00
|
|
|
}
|
|
|
|
|
2001-11-22 23:46:13 +00:00
|
|
|
/* initialize lowlevel stuff */
|
|
|
|
base_init ();
|
|
|
|
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
2001-11-17 16:32:34 +00:00
|
|
|
gui_themes_init (the_gimp);
|
2001-08-05 20:34:10 +00:00
|
|
|
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_splash)
|
2001-10-22 12:13:44 +00:00
|
|
|
splash_create (! no_splash_image);
|
2001-04-15 20:12:16 +00:00
|
|
|
}
|
1998-07-01 23:06:49 +00:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
/* Create all members of the global Gimp instance which need an already
|
|
|
|
* parsed gimprc, e.g. the data factories
|
2001-07-04 19:31:35 +00:00
|
|
|
*/
|
2001-10-19 16:41:09 +00:00
|
|
|
gimp_initialize (the_gimp, app_init_update_status);
|
2001-07-04 19:31:35 +00:00
|
|
|
|
2001-11-17 16:32:34 +00:00
|
|
|
if (! no_interface)
|
1998-02-17 20:14:29 +00:00
|
|
|
{
|
2001-11-17 16:32:34 +00:00
|
|
|
tool_manager_init (the_gimp);
|
1998-02-17 20:14:29 +00:00
|
|
|
}
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
/* Load all data files
|
|
|
|
*/
|
2001-10-19 16:41:09 +00:00
|
|
|
gimp_restore (the_gimp, app_init_update_status, no_data);
|
1998-03-26 18:24:42 +00:00
|
|
|
|
2001-10-23 16:23:32 +00:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
|
|
|
gui_init (the_gimp);
|
|
|
|
}
|
|
|
|
|
2001-10-19 16:41:09 +00:00
|
|
|
/* Initialize the plug-in structures
|
|
|
|
*/
|
|
|
|
plug_in_init (the_gimp, app_init_update_status);
|
2001-03-30 13:31:41 +00:00
|
|
|
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_interface)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_splash)
|
|
|
|
splash_destroy ();
|
2001-02-12 03:27:28 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
gui_restore (the_gimp, restore_session);
|
1998-08-13 15:25:41 +00:00
|
|
|
}
|
2001-07-04 19:31:35 +00:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
/* Parse the rest of the command line arguments as images to load
|
|
|
|
*/
|
2001-07-04 19:31:35 +00:00
|
|
|
if (gimp_argc > 0)
|
2001-10-29 11:47:11 +00:00
|
|
|
{
|
2002-02-26 16:30:14 +00:00
|
|
|
gchar *current_dir;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
current_dir = g_get_current_dir ();
|
2001-10-29 11:47:11 +00:00
|
|
|
|
|
|
|
for (i = 0; i < gimp_argc; i++)
|
|
|
|
{
|
|
|
|
if (gimp_argv[i])
|
|
|
|
{
|
2002-02-26 16:30:14 +00:00
|
|
|
gchar *absolute_filename;
|
|
|
|
|
|
|
|
if (g_file_test (gimp_argv[i], G_FILE_TEST_IS_REGULAR) &&
|
|
|
|
! g_path_is_absolute (gimp_argv[i]))
|
|
|
|
{
|
|
|
|
absolute_filename = g_build_filename (current_dir,
|
|
|
|
gimp_argv[i],
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_print ("completing relative path: \"%s\" -> \"%s\"\n",
|
|
|
|
gimp_argv[i], absolute_filename);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
absolute_filename = g_strdup (gimp_argv[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
file_open_with_display (the_gimp, absolute_filename);
|
|
|
|
|
|
|
|
g_free (absolute_filename);
|
2001-10-29 11:47:11 +00:00
|
|
|
}
|
|
|
|
}
|
2002-02-26 16:30:14 +00:00
|
|
|
|
|
|
|
g_free (current_dir);
|
2001-10-29 11:47:11 +00:00
|
|
|
}
|
2001-07-04 19:31:35 +00:00
|
|
|
|
2001-12-01 00:14:14 +00:00
|
|
|
batch_init (the_gimp, batch_cmds);
|
2001-07-04 19:31:35 +00:00
|
|
|
|
|
|
|
if (! no_interface)
|
|
|
|
{
|
2001-07-07 12:17:23 +00:00
|
|
|
gui_post_init (the_gimp);
|
2001-07-04 19:31:35 +00:00
|
|
|
}
|
2001-10-25 13:30:01 +00:00
|
|
|
|
2001-11-17 16:32:34 +00:00
|
|
|
gimp_main_loop (the_gimp);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 11:16:05 +00:00
|
|
|
void
|
|
|
|
app_exit (gboolean kill_it)
|
1998-02-05 05:41:05 +00:00
|
|
|
{
|
2001-03-30 11:16:05 +00:00
|
|
|
/* If it's the user's perogative, and there are dirty images */
|
2001-07-05 15:34:26 +00:00
|
|
|
if (! kill_it && gdisplays_dirty () && ! no_interface)
|
2001-10-25 13:30:01 +00:00
|
|
|
gui_really_quit_dialog (G_CALLBACK (app_exit_finish));
|
2001-03-30 11:16:05 +00:00
|
|
|
else
|
|
|
|
app_exit_finish ();
|
1998-02-05 05:41:05 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 11:16:05 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
/* private functions */
|
1998-02-03 22:54:35 +00:00
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
static void
|
|
|
|
app_init_update_status (const gchar *text1,
|
|
|
|
const gchar *text2,
|
|
|
|
gdouble percentage)
|
|
|
|
{
|
|
|
|
if (! no_interface && ! no_splash)
|
|
|
|
{
|
|
|
|
splash_update (text1, text2, percentage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
app_exit_finish (void)
|
|
|
|
{
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_interface)
|
|
|
|
{
|
2001-07-07 12:17:23 +00:00
|
|
|
gui_shutdown (the_gimp);
|
2001-04-15 20:12:16 +00:00
|
|
|
}
|
1999-09-02 17:27:28 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
plug_in_kill ();
|
|
|
|
|
2001-04-15 20:12:16 +00:00
|
|
|
if (! no_interface)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-11-17 16:32:34 +00:00
|
|
|
tool_manager_exit (the_gimp);
|
|
|
|
|
2001-07-07 12:17:23 +00:00
|
|
|
gui_exit (the_gimp);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
1998-06-22 17:30:40 +00:00
|
|
|
|
2001-07-04 22:59:25 +00:00
|
|
|
gimp_shutdown (the_gimp);
|
|
|
|
|
2001-07-25 01:03:43 +00:00
|
|
|
g_object_unref (G_OBJECT (the_gimp));
|
2001-07-04 19:31:35 +00:00
|
|
|
the_gimp = NULL;
|
|
|
|
|
2001-05-20 18:37:07 +00:00
|
|
|
base_exit ();
|
|
|
|
|
2001-11-17 16:32:34 +00:00
|
|
|
/* There used to be foo_main_quit() here, but there's a chance
|
|
|
|
* that foo_main() was never called before we reach this point. --Sven
|
2000-03-25 18:49:05 +00:00
|
|
|
*/
|
2001-11-17 16:32:34 +00:00
|
|
|
exit (0);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|