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 <stdio.h>
|
|
|
|
#include <string.h>
|
2001-12-02 22:59:30 +08:00
|
|
|
#include <stdlib.h>
|
2002-02-18 22:34:50 +08:00
|
|
|
|
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
|
2002-02-18 22:34:50 +08: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-11 03:16:16 +08:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-07-12 20:56:35 +08:00
|
|
|
#include <glib-object.h>
|
2001-02-07 09:16:18 +08:00
|
|
|
|
2001-05-22 04:30:16 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
#include "core/core-types.h"
|
2001-04-07 23:58:26 +08:00
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimprc.h"
|
|
|
|
|
2003-11-17 08:17:01 +08:00
|
|
|
#include "base/base.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2006-04-29 08:47:53 +08:00
|
|
|
#include "core/gimp-user-install.h"
|
2001-12-01 08:14:14 +08:00
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
#include "plug-in/gimppluginmanager.h"
|
|
|
|
|
2001-11-11 03:35:21 +08:00
|
|
|
#include "file/file-open.h"
|
2002-04-14 22:38:55 +08:00
|
|
|
#include "file/file-utils.h"
|
2001-11-11 03:35:21 +08:00
|
|
|
|
2004-07-12 22:32:31 +08:00
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs/user-install-dialog.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gui/gui.h"
|
2004-07-12 22:32:31 +08:00
|
|
|
#endif
|
2001-04-18 05:43:29 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "app_procs.h"
|
|
|
|
#include "batch.h"
|
2003-05-29 19:34:30 +08:00
|
|
|
#include "errors.h"
|
2003-11-16 06:53:28 +08:00
|
|
|
#include "units.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.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-15 07:23:52 +08:00
|
|
|
|
2004-07-13 05:32:29 +08:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2004-07-26 18:44:25 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
/* local prototypes */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void app_init_update_none (const gchar *text1,
|
|
|
|
const gchar *text2,
|
|
|
|
gdouble percentage);
|
|
|
|
static gboolean app_exit_after_callback (Gimp *gimp,
|
2003-11-30 22:44:13 +08:00
|
|
|
gboolean kill_it,
|
|
|
|
GMainLoop *loop);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-12-18 00:37:50 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
/* public functions */
|
1998-01-20 08:12:21 +08:00
|
|
|
|
2005-02-09 06:57:24 +08:00
|
|
|
void
|
|
|
|
app_libs_init (GOptionContext *context,
|
|
|
|
gboolean no_interface)
|
2003-05-29 19:34:30 +08:00
|
|
|
{
|
2005-02-13 23:08:08 +08:00
|
|
|
#ifdef ENABLE_MP
|
2005-04-26 01:13:10 +08:00
|
|
|
if (! g_thread_supported ())
|
|
|
|
g_thread_init (NULL);
|
2005-02-13 23:08:08 +08:00
|
|
|
#endif
|
|
|
|
|
2005-02-09 06:57:24 +08:00
|
|
|
if (no_interface)
|
2004-07-12 22:32:31 +08:00
|
|
|
{
|
|
|
|
g_type_init ();
|
|
|
|
}
|
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
|
|
|
else
|
|
|
|
{
|
2005-02-09 06:57:24 +08:00
|
|
|
gui_libs_init (context);
|
2004-07-12 22:32:31 +08:00
|
|
|
}
|
|
|
|
#endif
|
2003-05-29 19:34:30 +08:00
|
|
|
}
|
|
|
|
|
2004-03-30 19:32:21 +08:00
|
|
|
void
|
2004-07-12 22:32:31 +08:00
|
|
|
app_abort (gboolean no_interface,
|
|
|
|
const gchar *abort_message)
|
2004-03-30 19:32:21 +08:00
|
|
|
{
|
2004-07-12 22:32:31 +08:00
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
|
|
|
if (no_interface)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
g_print ("%s\n\n", abort_message);
|
|
|
|
}
|
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gui_abort (abort_message);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
app_exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
app_exit (gint status)
|
|
|
|
{
|
|
|
|
#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 (status);
|
2004-03-30 19:32:21 +08:00
|
|
|
}
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
void
|
2003-11-17 08:17:01 +08:00
|
|
|
app_run (const gchar *full_prog_name,
|
2005-02-03 07:23:33 +08:00
|
|
|
const gchar **filenames,
|
2003-11-17 08:17:01 +08:00
|
|
|
const gchar *alternate_system_gimprc,
|
|
|
|
const gchar *alternate_gimprc,
|
|
|
|
const gchar *session_name,
|
2004-10-06 17:56:15 +08:00
|
|
|
const gchar *batch_interpreter,
|
|
|
|
const gchar **batch_commands,
|
2003-11-17 08:17:01 +08:00
|
|
|
gboolean no_interface,
|
|
|
|
gboolean no_data,
|
|
|
|
gboolean no_fonts,
|
|
|
|
gboolean no_splash,
|
|
|
|
gboolean be_verbose,
|
|
|
|
gboolean use_shm,
|
|
|
|
gboolean use_cpu_accel,
|
|
|
|
gboolean console_messages,
|
2003-12-06 01:08:35 +08:00
|
|
|
GimpStackTraceMode stack_trace_mode,
|
|
|
|
GimpPDBCompatMode pdb_compat_mode)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-11-30 22:44:13 +08:00
|
|
|
GimpInitStatusFunc update_status_func = NULL;
|
|
|
|
Gimp *gimp;
|
|
|
|
GMainLoop *loop;
|
2004-03-16 00:00:21 +08:00
|
|
|
gboolean swap_is_ok;
|
2004-07-15 05:27:11 +08:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
const gchar *log_domains[] =
|
2004-07-15 17:29:01 +08:00
|
|
|
{
|
|
|
|
"Gimp",
|
|
|
|
"Gimp-Actions",
|
|
|
|
"Gimp-Base",
|
|
|
|
"Gimp-Composite",
|
|
|
|
"Gimp-Config",
|
|
|
|
"Gimp-Core",
|
2004-09-14 04:00:19 +08:00
|
|
|
"Gimp-Dialogs",
|
2004-07-15 17:29:01 +08:00
|
|
|
"Gimp-Display",
|
|
|
|
"Gimp-File",
|
|
|
|
"Gimp-GUI",
|
|
|
|
"Gimp-Menus",
|
|
|
|
"Gimp-PDB",
|
2005-04-13 08:16:24 +08:00
|
|
|
"Gimp-Paint",
|
2004-07-15 17:29:01 +08:00
|
|
|
"Gimp-Paint-Funcs",
|
|
|
|
"Gimp-Plug-In",
|
|
|
|
"Gimp-Text",
|
|
|
|
"Gimp-Tools",
|
|
|
|
"Gimp-Vectors",
|
|
|
|
"Gimp-Widgets",
|
|
|
|
"Gimp-XCF"
|
|
|
|
};
|
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-11 03:16:16 +08:00
|
|
|
|
|
|
|
/* Create an instance of the "Gimp" object which is the root of the
|
|
|
|
* core object system
|
|
|
|
*/
|
2003-11-30 22:44:13 +08:00
|
|
|
gimp = gimp_new (full_prog_name,
|
|
|
|
session_name,
|
|
|
|
be_verbose,
|
|
|
|
no_data,
|
|
|
|
no_fonts,
|
|
|
|
no_interface,
|
|
|
|
use_shm,
|
|
|
|
console_messages,
|
2003-12-06 01:08:35 +08:00
|
|
|
stack_trace_mode,
|
|
|
|
pdb_compat_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-11 03:16:16 +08:00
|
|
|
|
2004-07-15 05:27:11 +08:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (log_domains); i++)
|
2004-07-15 18:37:03 +08:00
|
|
|
g_log_set_handler (log_domains[i],
|
2004-07-15 05:27:11 +08:00
|
|
|
G_LOG_LEVEL_MESSAGE,
|
|
|
|
gimp_message_log_func, &gimp);
|
2003-05-29 19:34:30 +08:00
|
|
|
|
|
|
|
g_log_set_handler (NULL,
|
2006-04-12 20:49:29 +08:00
|
|
|
G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
|
|
|
|
gimp_error_log_func, &gimp);
|
2003-05-29 19:34:30 +08:00
|
|
|
|
2003-11-30 22:44:13 +08:00
|
|
|
units_init (gimp);
|
2003-11-16 06:53:28 +08:00
|
|
|
|
2001-07-25 23:22:55 +08: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-11 03:16:16 +08:00
|
|
|
*/
|
2003-10-02 19:26:26 +08:00
|
|
|
if (! g_file_test (gimp_directory (), 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-11 03:16:16 +08:00
|
|
|
{
|
2006-05-04 21:37:41 +08:00
|
|
|
GimpUserInstall *install = gimp_user_install_new (be_verbose);
|
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-11 03:16:16 +08:00
|
|
|
|
2006-04-29 08:47:53 +08:00
|
|
|
#ifdef GIMP_CONSOLE_COMPILATION
|
|
|
|
gimp_user_install_run (install, FALSE);
|
|
|
|
#else
|
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-11 03:16:16 +08:00
|
|
|
if (no_interface)
|
2006-05-04 21:37:41 +08:00
|
|
|
{
|
|
|
|
if (! gimp_user_install_run (install, FALSE))
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
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-11 03:16:16 +08:00
|
|
|
else
|
2006-05-04 21:37:41 +08:00
|
|
|
{
|
|
|
|
user_install_dialog_run (install);
|
|
|
|
}
|
2004-07-12 22:32:31 +08:00
|
|
|
#endif
|
2006-04-29 08:47:53 +08:00
|
|
|
|
|
|
|
gimp_user_install_free (install);
|
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-11 03:16:16 +08:00
|
|
|
}
|
1998-04-30 13:30:28 +08:00
|
|
|
|
2004-08-02 04:51:12 +08:00
|
|
|
#if defined G_OS_WIN32 && !defined GIMP_CONSOLE_COMPILATION
|
|
|
|
/* 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 benefits (like inheriting the console) but hide
|
|
|
|
* it, if the user doesn't want it.
|
|
|
|
*/
|
|
|
|
if (!no_interface && !be_verbose && !console_messages)
|
|
|
|
FreeConsole ();
|
|
|
|
#endif
|
|
|
|
|
2003-11-30 22:44:13 +08:00
|
|
|
gimp_load_config (gimp, alternate_system_gimprc, alternate_gimprc);
|
2003-11-17 08:17:01 +08:00
|
|
|
|
|
|
|
/* initialize lowlevel stuff */
|
2004-07-20 22:33:22 +08:00
|
|
|
swap_is_ok = base_init (GIMP_BASE_CONFIG (gimp->config),
|
|
|
|
be_verbose, use_cpu_accel);
|
2001-11-23 07:46:13 +08:00
|
|
|
|
2004-07-12 22:32:31 +08:00
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
2001-04-16 04:12:16 +08:00
|
|
|
if (! no_interface)
|
2004-03-15 08:17:21 +08:00
|
|
|
update_status_func = gui_init (gimp, no_splash);
|
2004-07-12 22:32:31 +08:00
|
|
|
#endif
|
2001-08-06 04:34:10 +08:00
|
|
|
|
2003-10-06 22:52:05 +08:00
|
|
|
if (! update_status_func)
|
|
|
|
update_status_func = app_init_update_none;
|
2003-10-02 19:26:26 +08: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-11 03:16:16 +08:00
|
|
|
/* Create all members of the global Gimp instance which need an already
|
|
|
|
* parsed gimprc, e.g. the data factories
|
2001-07-05 03:31:35 +08:00
|
|
|
*/
|
2003-11-30 22:44:13 +08:00
|
|
|
gimp_initialize (gimp, update_status_func);
|
2001-07-05 03:31:35 +08: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-11 03:16:16 +08:00
|
|
|
/* Load all data files
|
|
|
|
*/
|
2003-11-30 22:44:13 +08:00
|
|
|
gimp_restore (gimp, update_status_func);
|
2002-12-05 23:49:59 +08:00
|
|
|
|
2004-03-16 00:00:21 +08:00
|
|
|
/* display a warning when no test swap file could be generated */
|
|
|
|
if (! swap_is_ok)
|
2005-03-23 07:20:56 +08:00
|
|
|
g_message (_("Unable to open a test swap file.\n\n"
|
|
|
|
"To avoid data loss, please check the location "
|
|
|
|
"and permissions of the swap directory defined in "
|
|
|
|
"your Preferences (currently \"%s\")."),
|
2004-03-16 00:00:21 +08:00
|
|
|
GIMP_BASE_CONFIG (gimp->config)->swap_path);
|
|
|
|
|
2003-01-11 05:15:41 +08:00
|
|
|
/* enable autosave late so we don't autosave when the
|
|
|
|
* monitor resolution is set in gui_init()
|
|
|
|
*/
|
2003-11-30 22:44:13 +08:00
|
|
|
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
|
2003-01-11 05:15:41 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
/* Load the images given on the command-line.
|
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-11 03:16:16 +08:00
|
|
|
*/
|
2005-02-03 07:23:33 +08:00
|
|
|
if (filenames)
|
2001-10-29 19:47:11 +08:00
|
|
|
{
|
2005-02-03 07:23:33 +08:00
|
|
|
for (i = 0; filenames[i]; i++)
|
2001-10-29 19:47:11 +08:00
|
|
|
{
|
2005-02-03 07:23:33 +08:00
|
|
|
GError *error = NULL;
|
|
|
|
gchar *uri;
|
2002-02-27 00:30:14 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
/* first try if we got a file uri */
|
|
|
|
uri = g_filename_from_uri (filenames[i], NULL, NULL);
|
2003-06-23 21:42:31 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
if (uri)
|
|
|
|
{
|
|
|
|
g_free (uri);
|
|
|
|
uri = g_strdup (filenames[i]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-05-16 19:43:55 +08:00
|
|
|
uri =
|
|
|
|
file_utils_filename_to_uri (gimp->plug_in_manager->load_procs,
|
|
|
|
filenames[i], &error);
|
2005-02-03 07:23:33 +08:00
|
|
|
}
|
2002-04-19 22:09:53 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
if (! uri)
|
|
|
|
{
|
|
|
|
g_printerr ("conversion filename -> uri failed: %s\n",
|
|
|
|
error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2005-02-03 07:23:33 +08:00
|
|
|
GimpPDBStatusType status;
|
2003-03-05 19:25:59 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
image = file_open_with_display (gimp,
|
|
|
|
gimp_get_user_context (gimp),
|
|
|
|
NULL,
|
|
|
|
uri,
|
|
|
|
&status, &error);
|
2003-03-05 19:25:59 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (! image && status != GIMP_PDB_CANCEL)
|
2005-02-03 07:23:33 +08:00
|
|
|
{
|
|
|
|
gchar *filename = file_utils_uri_to_utf8_filename (uri);
|
2003-03-05 19:25:59 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
g_message (_("Opening '%s' failed: %s"),
|
|
|
|
filename, error->message);
|
|
|
|
g_clear_error (&error);
|
2002-02-27 00:30:14 +08:00
|
|
|
|
2005-02-03 07:23:33 +08:00
|
|
|
g_free (filename);
|
2002-04-17 04:25:27 +08:00
|
|
|
}
|
2005-02-03 07:23:33 +08:00
|
|
|
|
|
|
|
g_free (uri);
|
2001-10-29 19:47:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2004-07-12 22:32:31 +08:00
|
|
|
#ifndef GIMP_CONSOLE_COMPILATION
|
2004-07-12 20:56:35 +08:00
|
|
|
if (! no_interface)
|
|
|
|
gui_post_init (gimp);
|
2004-07-12 22:32:31 +08:00
|
|
|
#endif
|
2004-07-12 20:56:35 +08:00
|
|
|
|
2004-10-06 17:56:15 +08:00
|
|
|
batch_run (gimp, batch_interpreter, batch_commands);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2004-07-12 20:56:35 +08:00
|
|
|
loop = g_main_loop_new (NULL, FALSE);
|
2003-11-30 22:44:13 +08:00
|
|
|
|
|
|
|
g_signal_connect_after (gimp, "exit",
|
|
|
|
G_CALLBACK (app_exit_after_callback),
|
|
|
|
loop);
|
2003-02-03 21:21:31 +08:00
|
|
|
|
2004-07-12 20:56:35 +08:00
|
|
|
gimp_threads_leave (gimp);
|
|
|
|
g_main_loop_run (loop);
|
|
|
|
gimp_threads_enter (gimp);
|
2003-02-03 21:21:31 +08:00
|
|
|
|
2004-07-12 20:56:35 +08:00
|
|
|
g_main_loop_unref (loop);
|
2003-11-17 08:17:01 +08:00
|
|
|
|
2003-11-30 22:44:13 +08:00
|
|
|
g_object_unref (gimp);
|
2003-11-17 08:17:01 +08:00
|
|
|
base_exit ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-03-30 19:16:05 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
/* private functions */
|
1998-02-04 06:54:35 +08:00
|
|
|
|
2003-09-02 01:26:09 +08:00
|
|
|
static void
|
|
|
|
app_init_update_none (const gchar *text1,
|
|
|
|
const gchar *text2,
|
|
|
|
gdouble percentage)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
}
|
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
static gboolean
|
2003-11-30 22:44:13 +08:00
|
|
|
app_exit_after_callback (Gimp *gimp,
|
|
|
|
gboolean kill_it,
|
|
|
|
GMainLoop *loop)
|
2001-10-25 21:30:01 +08:00
|
|
|
{
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: app_exit_after_callback\n");
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-02-26 22:01:57 +08:00
|
|
|
/*
|
|
|
|
* In stable releases, we simply call exit() here. This speeds up
|
|
|
|
* the process of quitting GIMP and also works around the problem
|
|
|
|
* that plug-ins might still be running.
|
|
|
|
*
|
|
|
|
* In unstable releases, we shut down GIMP properly in an attempt
|
|
|
|
* to catch possible problems in our finalizers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef GIMP_UNSTABLE
|
2004-07-12 20:56:35 +08:00
|
|
|
g_main_loop_quit (loop);
|
2004-02-26 22:01:57 +08:00
|
|
|
#else
|
2004-11-23 05:29:41 +08:00
|
|
|
/* make sure that the swap file is removed before we quit */
|
|
|
|
base_exit ();
|
2004-02-26 22:01:57 +08:00
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
#endif
|
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|