2001-07-05 03:31:35 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
2002-03-29 11:50:29 +08:00
|
|
|
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
|
2001-07-05 03:31:35 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2001-07-23 06:18:01 +08:00
|
|
|
#include <string.h> /* strlen */
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
#include <glib-object.h>
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2001-07-06 00:21:36 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "core-types.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2002-11-30 21:08:44 +08:00
|
|
|
#include "config/gimpconfig.h"
|
|
|
|
#include "config/gimpconfig-params.h"
|
2002-12-30 02:58:24 +08:00
|
|
|
#include "config/gimpconfig-path.h"
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimprc.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "pdb/procedural_db.h"
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
#include "plug-in/plug-ins.h"
|
|
|
|
|
2003-09-18 21:51:10 +08:00
|
|
|
#include "paint/gimp-paint.h"
|
2002-02-26 10:00:02 +08:00
|
|
|
|
2003-09-16 01:26:28 +08:00
|
|
|
#include "text/gimp-fonts.h"
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2001-10-19 01:27:36 +08:00
|
|
|
#include "xcf/xcf.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimp.h"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimp-documents.h"
|
2002-06-12 21:48:47 +08:00
|
|
|
#include "gimp-gradients.h"
|
2003-09-16 01:26:28 +08:00
|
|
|
#include "gimp-modules.h"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimp-parasites.h"
|
2003-04-04 01:50:56 +08:00
|
|
|
#include "gimp-templates.h"
|
2003-09-16 01:26:28 +08:00
|
|
|
#include "gimp-units.h"
|
2003-11-25 20:53:29 +08:00
|
|
|
#include "gimp-utils.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimpbrush.h"
|
|
|
|
#include "gimpbrushgenerated.h"
|
|
|
|
#include "gimpbrushpipe.h"
|
|
|
|
#include "gimpbuffer.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "gimpcontext.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimpdatafactory.h"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimpdocumentlist.h"
|
2002-11-12 11:34:11 +08:00
|
|
|
#include "gimpenvirontable.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimpgradient.h"
|
|
|
|
#include "gimpimage.h"
|
2001-08-10 22:41:39 +08:00
|
|
|
#include "gimpimagefile.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimplist.h"
|
2002-12-05 23:49:59 +08:00
|
|
|
#include "gimpmarshal.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimppalette.h"
|
|
|
|
#include "gimppattern.h"
|
2002-05-15 06:48:24 +08:00
|
|
|
#include "gimpparasitelist.h"
|
2003-04-04 01:50:56 +08:00
|
|
|
#include "gimptemplate.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimptoolinfo.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
enum
|
|
|
|
{
|
2003-10-02 19:26:26 +08:00
|
|
|
INITIALIZE,
|
|
|
|
RESTORE,
|
2002-12-05 23:49:59 +08:00
|
|
|
EXIT,
|
2004-02-19 20:49:15 +08:00
|
|
|
BUFFER_CHANGED,
|
2002-12-05 23:49:59 +08:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void gimp_class_init (GimpClass *klass);
|
|
|
|
static void gimp_init (Gimp *gimp);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void gimp_dispose (GObject *object);
|
|
|
|
static void gimp_finalize (GObject *object);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
static gint64 gimp_get_memsize (GimpObject *object,
|
|
|
|
gint64 *gui_size);
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void gimp_real_initialize (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback);
|
|
|
|
static void gimp_real_restore (Gimp *gimp,
|
2003-11-13 22:14:20 +08:00
|
|
|
GimpInitStatusFunc status_callback);
|
2003-10-02 19:26:26 +08:00
|
|
|
static gboolean gimp_real_exit (Gimp *gimp,
|
2003-12-01 00:05:56 +08:00
|
|
|
gboolean force);
|
2002-12-05 23:49:59 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void gimp_global_config_notify (GObject *global_config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *edit_config);
|
|
|
|
static void gimp_edit_config_notify (GObject *edit_config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *global_config);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
static GimpObjectClass *parent_class = NULL;
|
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
static guint gimp_signals[LAST_SIGNAL] = { 0, };
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
GType
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp_get_type (void)
|
|
|
|
{
|
2001-08-11 22:39:19 +08:00
|
|
|
static GType object_type = 0;
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
if (! object_type)
|
|
|
|
{
|
2001-08-11 22:39:19 +08:00
|
|
|
static const GTypeInfo object_info =
|
2001-07-05 03:31:35 +08:00
|
|
|
{
|
|
|
|
sizeof (GimpClass),
|
2001-08-11 22:39:19 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (Gimp),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_init,
|
2001-07-05 03:31:35 +08:00
|
|
|
};
|
|
|
|
|
2001-08-11 22:39:19 +08:00
|
|
|
object_type = g_type_register_static (GIMP_TYPE_OBJECT,
|
2003-08-25 18:49:33 +08:00
|
|
|
"Gimp",
|
2001-08-11 22:39:19 +08:00
|
|
|
&object_info, 0);
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return object_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_class_init (GimpClass *klass)
|
|
|
|
{
|
2004-06-18 00:32:30 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
gimp_signals[INITIALIZE] =
|
|
|
|
g_signal_new ("initialize",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass, initialize),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__POINTER,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
|
|
|
|
|
|
|
gimp_signals[RESTORE] =
|
|
|
|
g_signal_new ("restore",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass, restore),
|
|
|
|
NULL, NULL,
|
2003-11-13 22:14:20 +08:00
|
|
|
gimp_marshal_VOID__POINTER,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_signals[EXIT] =
|
|
|
|
g_signal_new ("exit",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass, exit),
|
2004-06-18 00:32:30 +08:00
|
|
|
gimp_boolean_handled_accum, NULL,
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_marshal_BOOLEAN__BOOLEAN,
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
|
|
|
G_TYPE_BOOLEAN);
|
|
|
|
|
2004-02-19 20:49:15 +08:00
|
|
|
gimp_signals[BUFFER_CHANGED] =
|
|
|
|
g_signal_new ("buffer-changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass, buffer_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2002-01-31 00:14:26 +08:00
|
|
|
object_class->dispose = gimp_dispose;
|
|
|
|
object_class->finalize = gimp_finalize;
|
|
|
|
|
|
|
|
gimp_object_class->get_memsize = gimp_get_memsize;
|
2002-12-05 23:49:59 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
klass->initialize = gimp_real_initialize;
|
|
|
|
klass->restore = gimp_real_restore;
|
2002-12-05 23:49:59 +08:00
|
|
|
klass->exit = gimp_real_exit;
|
2004-02-19 20:49:15 +08:00
|
|
|
klass->buffer_changed = NULL;
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_init (Gimp *gimp)
|
|
|
|
{
|
2003-11-13 22:14:20 +08:00
|
|
|
gimp->config = NULL;
|
|
|
|
gimp->session_name = NULL;
|
2003-09-11 06:06:45 +08:00
|
|
|
|
|
|
|
gimp->be_verbose = FALSE;
|
|
|
|
gimp->no_data = FALSE;
|
|
|
|
gimp->no_interface = FALSE;
|
|
|
|
gimp->use_shm = FALSE;
|
|
|
|
gimp->message_handler = GIMP_CONSOLE;
|
|
|
|
gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
|
2003-12-06 01:08:35 +08:00
|
|
|
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
|
2003-09-11 06:06:45 +08:00
|
|
|
|
2004-07-12 19:41:19 +08:00
|
|
|
gimp_gui_init (gimp);
|
2003-09-11 06:06:45 +08:00
|
|
|
|
|
|
|
gimp->busy = 0;
|
|
|
|
gimp->busy_idle_id = 0;
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
gimp_units_init (gimp);
|
|
|
|
|
2003-09-11 06:06:45 +08:00
|
|
|
gimp->parasites = gimp_parasite_list_new ();
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2001-10-19 01:27:36 +08:00
|
|
|
gimp_modules_init (gimp);
|
2003-08-25 18:49:33 +08:00
|
|
|
|
|
|
|
gimp->environ_table = gimp_environ_table_new ();
|
2003-02-11 09:21:21 +08:00
|
|
|
|
|
|
|
gimp->plug_in_debug = NULL;
|
2001-10-19 01:27:36 +08:00
|
|
|
|
2004-05-24 18:49:34 +08:00
|
|
|
gimp->images = gimp_list_new_weak (GIMP_TYPE_IMAGE, FALSE);
|
2002-02-01 02:02:38 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->images), "images");
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
gimp->next_image_ID = 1;
|
|
|
|
gimp->next_guide_ID = 1;
|
|
|
|
gimp->image_table = g_hash_table_new (g_direct_hash, NULL);
|
|
|
|
|
2002-02-26 01:58:50 +08:00
|
|
|
gimp->next_item_ID = 1;
|
|
|
|
gimp->item_table = g_hash_table_new (g_direct_hash, NULL);
|
2001-07-11 20:39:49 +08:00
|
|
|
|
2004-05-24 18:49:34 +08:00
|
|
|
gimp->displays = gimp_list_new_weak (GIMP_TYPE_OBJECT, FALSE);
|
2002-05-09 01:48:24 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->displays), "displays");
|
|
|
|
|
|
|
|
gimp->next_display_ID = 1;
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
gimp->global_buffer = NULL;
|
2004-05-24 18:49:34 +08:00
|
|
|
gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER, TRUE);
|
2002-02-01 02:02:38 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->named_buffers), "named buffers");
|
|
|
|
|
2003-09-16 01:26:28 +08:00
|
|
|
gimp->fonts = NULL;
|
2001-07-11 20:39:49 +08:00
|
|
|
gimp->brush_factory = NULL;
|
|
|
|
gimp->pattern_factory = NULL;
|
|
|
|
gimp->gradient_factory = NULL;
|
|
|
|
gimp->palette_factory = NULL;
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
procedural_db_init (gimp);
|
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
gimp->load_procs = NULL;
|
|
|
|
gimp->save_procs = NULL;
|
|
|
|
|
2001-10-19 01:27:36 +08:00
|
|
|
xcf_init (gimp);
|
|
|
|
|
2004-05-24 18:49:34 +08:00
|
|
|
gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO, FALSE);
|
2002-02-01 02:02:38 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->tool_info_list), "tool infos");
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
gimp->standard_tool_info = NULL;
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2003-01-25 01:38:24 +08:00
|
|
|
gimp->documents = gimp_document_list_new (gimp);
|
2001-08-10 22:41:39 +08:00
|
|
|
|
2004-05-24 18:49:34 +08:00
|
|
|
gimp->templates = gimp_list_new (GIMP_TYPE_TEMPLATE, TRUE);
|
2004-07-12 19:41:19 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->tool_info_list), "templates");
|
2004-05-24 18:49:34 +08:00
|
|
|
|
2003-04-04 01:50:56 +08:00
|
|
|
gimp->image_new_last_template = NULL;
|
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
|
|
|
gimp->have_current_cut_buffer = FALSE;
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2004-01-11 07:55:28 +08:00
|
|
|
gimp->context_list = NULL;
|
|
|
|
gimp->default_context = NULL;
|
|
|
|
gimp->user_context = NULL;
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_dispose (GObject *object)
|
|
|
|
{
|
2003-11-17 08:47:37 +08:00
|
|
|
Gimp *gimp = GIMP (object);
|
2001-08-12 05:10:44 +08:00
|
|
|
|
2003-11-17 09:18:33 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: gimp_dispose\n");
|
|
|
|
|
2001-08-12 05:10:44 +08:00
|
|
|
if (gimp->brush_factory)
|
|
|
|
gimp_data_factory_data_free (gimp->brush_factory);
|
|
|
|
|
|
|
|
if (gimp->pattern_factory)
|
|
|
|
gimp_data_factory_data_free (gimp->pattern_factory);
|
|
|
|
|
|
|
|
if (gimp->gradient_factory)
|
|
|
|
gimp_data_factory_data_free (gimp->gradient_factory);
|
|
|
|
|
|
|
|
if (gimp->palette_factory)
|
|
|
|
gimp_data_factory_data_free (gimp->palette_factory);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_finalize (GObject *object)
|
2001-07-05 03:31:35 +08:00
|
|
|
{
|
2003-11-13 22:14:20 +08:00
|
|
|
Gimp *gimp = GIMP (object);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-11-17 08:47:37 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: gimp_finalize\n");
|
|
|
|
|
2002-06-12 21:48:47 +08:00
|
|
|
gimp_set_user_context (gimp, NULL);
|
|
|
|
gimp_set_default_context (gimp, NULL);
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2003-04-04 01:50:56 +08:00
|
|
|
if (gimp->image_new_last_template)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->image_new_last_template);
|
|
|
|
gimp->image_new_last_template = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->templates)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->templates);
|
|
|
|
gimp->templates = NULL;
|
|
|
|
}
|
|
|
|
|
2001-08-11 22:39:19 +08:00
|
|
|
if (gimp->documents)
|
2002-05-15 01:31:58 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->documents);
|
2002-05-15 01:31:58 +08:00
|
|
|
gimp->documents = NULL;
|
|
|
|
}
|
2001-08-10 22:41:39 +08:00
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
gimp_tool_info_set_standard (gimp, NULL);
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if (gimp->tool_info_list)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->tool_info_list);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->tool_info_list = NULL;
|
|
|
|
}
|
|
|
|
|
2001-10-19 01:27:36 +08:00
|
|
|
xcf_exit (gimp);
|
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
procedural_db_free (gimp);
|
|
|
|
|
|
|
|
if (gimp->load_procs)
|
|
|
|
{
|
|
|
|
g_slist_free (gimp->load_procs);
|
|
|
|
gimp->load_procs = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->save_procs)
|
|
|
|
{
|
|
|
|
g_slist_free (gimp->save_procs);
|
|
|
|
gimp->save_procs = NULL;
|
|
|
|
}
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
if (gimp->brush_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->brush_factory);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->brush_factory = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->pattern_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->pattern_factory);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->pattern_factory = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->gradient_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->gradient_factory);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->gradient_factory = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->palette_factory)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->palette_factory);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->palette_factory = NULL;
|
|
|
|
}
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
if (gimp->fonts)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->fonts);
|
|
|
|
gimp->fonts = NULL;
|
|
|
|
}
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if (gimp->named_buffers)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->named_buffers);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->named_buffers = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->global_buffer)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->global_buffer);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->global_buffer = NULL;
|
|
|
|
}
|
|
|
|
|
2002-05-09 01:48:24 +08:00
|
|
|
if (gimp->displays)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->displays);
|
|
|
|
gimp->displays = NULL;
|
|
|
|
}
|
|
|
|
|
2002-02-26 01:58:50 +08:00
|
|
|
if (gimp->item_table)
|
2001-07-11 20:39:49 +08:00
|
|
|
{
|
2002-02-26 01:58:50 +08:00
|
|
|
g_hash_table_destroy (gimp->item_table);
|
|
|
|
gimp->item_table = NULL;
|
2001-07-11 20:39:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->image_table)
|
|
|
|
{
|
|
|
|
g_hash_table_destroy (gimp->image_table);
|
|
|
|
gimp->image_table = NULL;
|
|
|
|
}
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if (gimp->images)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gimp->images);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->images = NULL;
|
|
|
|
}
|
|
|
|
|
2002-11-12 11:34:11 +08:00
|
|
|
if (gimp->environ_table)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->environ_table);
|
|
|
|
gimp->environ_table = NULL;
|
|
|
|
}
|
|
|
|
|
2002-10-23 22:55:07 +08:00
|
|
|
if (gimp->module_db)
|
2001-10-19 01:27:36 +08:00
|
|
|
gimp_modules_exit (gimp);
|
|
|
|
|
2003-09-18 21:51:10 +08:00
|
|
|
gimp_paint_exit (gimp);
|
2002-02-26 10:00:02 +08:00
|
|
|
|
2001-08-11 22:39:19 +08:00
|
|
|
if (gimp->parasites)
|
2002-05-15 06:48:24 +08:00
|
|
|
{
|
2002-11-30 21:08:44 +08:00
|
|
|
g_object_unref (gimp->parasites);
|
2002-05-15 06:48:24 +08:00
|
|
|
gimp->parasites = NULL;
|
|
|
|
}
|
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
|
|
|
|
2002-11-30 21:08:44 +08:00
|
|
|
if (gimp->edit_config)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->edit_config);
|
|
|
|
gimp->edit_config = NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
if (gimp->session_name)
|
|
|
|
{
|
|
|
|
g_free (gimp->session_name);
|
|
|
|
gimp->session_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-08-11 22:39:19 +08:00
|
|
|
if (gimp->user_units)
|
|
|
|
gimp_units_exit (gimp);
|
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
|
|
|
|
2001-08-12 05:10:44 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
static gint64
|
2003-08-25 18:49:33 +08:00
|
|
|
gimp_get_memsize (GimpObject *object,
|
2003-11-17 01:51:36 +08:00
|
|
|
gint64 *gui_size)
|
2002-01-31 00:14:26 +08:00
|
|
|
{
|
2004-02-19 20:49:15 +08:00
|
|
|
Gimp *gimp = GIMP (object);
|
2003-11-17 01:51:36 +08:00
|
|
|
gint64 memsize = 0;
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_list_get_memsize (gimp->user_units, 0 /* FIXME */);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->parasites),
|
|
|
|
gui_size);
|
2002-10-23 22:55:07 +08:00
|
|
|
|
|
|
|
memsize += gimp_g_object_get_memsize (G_OBJECT (gimp->module_db));
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_hash_table_get_memsize (gimp->image_table);
|
|
|
|
memsize += gimp_g_hash_table_get_memsize (gimp->item_table);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->displays), gui_size);
|
2002-05-09 01:48:24 +08:00
|
|
|
|
2002-02-01 02:02:38 +08:00
|
|
|
if (gimp->global_buffer)
|
2003-08-25 18:49:33 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->global_buffer),
|
|
|
|
gui_size);
|
|
|
|
|
|
|
|
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->named_buffers),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->fonts),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->brush_factory),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->pattern_factory),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->gradient_factory),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->palette_factory),
|
|
|
|
gui_size));
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_hash_table_get_memsize (gimp->procedural_ht);
|
2003-12-05 21:02:18 +08:00
|
|
|
memsize += gimp_g_hash_table_get_memsize (gimp->procedural_compat_ht);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_list_get_memsize (gimp->procedural_db_data_list,
|
|
|
|
0 /* FIXME */);
|
2002-09-11 04:23:00 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_slist_get_memsize (gimp->load_procs, 0 /* FIXME */);
|
|
|
|
memsize += gimp_g_slist_get_memsize (gimp->save_procs, 0 /* FIXME */);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->tool_info_list),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->standard_tool_info),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->documents),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->templates),
|
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->image_new_last_template),
|
|
|
|
gui_size));
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-11-25 20:53:29 +08:00
|
|
|
memsize += gimp_g_list_get_memsize (gimp->context_list, 0);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2004-02-23 08:19:54 +08:00
|
|
|
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->default_context),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size) +
|
|
|
|
gimp_object_get_memsize (GIMP_OBJECT (gimp->user_context),
|
|
|
|
gui_size));
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
|
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
}
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
static void
|
|
|
|
gimp_real_initialize (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback)
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
gchar *path;
|
|
|
|
|
|
|
|
static const GimpDataFactoryLoaderEntry brush_loader_entries[] =
|
|
|
|
{
|
|
|
|
{ gimp_brush_load, GIMP_BRUSH_FILE_EXTENSION },
|
|
|
|
{ gimp_brush_load, GIMP_BRUSH_PIXMAP_FILE_EXTENSION },
|
|
|
|
{ gimp_brush_generated_load, GIMP_BRUSH_GENERATED_FILE_EXTENSION },
|
|
|
|
{ gimp_brush_pipe_load, GIMP_BRUSH_PIPE_FILE_EXTENSION }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpDataFactoryLoaderEntry pattern_loader_entries[] =
|
|
|
|
{
|
2004-06-03 19:34:51 +08:00
|
|
|
{ gimp_pattern_load, GIMP_PATTERN_FILE_EXTENSION },
|
|
|
|
{ gimp_pattern_load_pixbuf, NULL }
|
2003-10-02 19:26:26 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpDataFactoryLoaderEntry gradient_loader_entries[] =
|
|
|
|
{
|
2004-06-03 19:34:51 +08:00
|
|
|
{ gimp_gradient_load, GIMP_GRADIENT_FILE_EXTENSION },
|
|
|
|
{ gimp_gradient_load, NULL /* legacy loader */ }
|
2003-10-02 19:26:26 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static const GimpDataFactoryLoaderEntry palette_loader_entries[] =
|
|
|
|
{
|
2004-06-03 19:34:51 +08:00
|
|
|
{ gimp_palette_load, GIMP_PALETTE_FILE_EXTENSION },
|
|
|
|
{ gimp_palette_load, NULL /* legacy loader */ }
|
2003-10-02 19:26:26 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("INIT: gimp_real_initialize\n");
|
|
|
|
|
|
|
|
gimp_fonts_init (gimp);
|
|
|
|
|
|
|
|
gimp->brush_factory =
|
|
|
|
gimp_data_factory_new (gimp,
|
|
|
|
GIMP_TYPE_BRUSH,
|
2004-01-29 05:53:50 +08:00
|
|
|
"brush-path", "brush-path-writable",
|
2003-10-02 19:26:26 +08:00
|
|
|
brush_loader_entries,
|
|
|
|
G_N_ELEMENTS (brush_loader_entries),
|
|
|
|
gimp_brush_new,
|
|
|
|
gimp_brush_get_standard);
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->brush_factory), "brush factory");
|
|
|
|
|
|
|
|
gimp->pattern_factory =
|
|
|
|
gimp_data_factory_new (gimp,
|
|
|
|
GIMP_TYPE_PATTERN,
|
2004-01-29 05:53:50 +08:00
|
|
|
"pattern-path", "pattern-path-writable",
|
2003-10-02 19:26:26 +08:00
|
|
|
pattern_loader_entries,
|
|
|
|
G_N_ELEMENTS (pattern_loader_entries),
|
2004-03-17 22:14:18 +08:00
|
|
|
NULL,
|
2003-10-02 19:26:26 +08:00
|
|
|
gimp_pattern_get_standard);
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->pattern_factory), "pattern factory");
|
|
|
|
|
|
|
|
gimp->gradient_factory =
|
|
|
|
gimp_data_factory_new (gimp,
|
|
|
|
GIMP_TYPE_GRADIENT,
|
2004-01-29 05:53:50 +08:00
|
|
|
"gradient-path", "gradient-path-writable",
|
2003-10-02 19:26:26 +08:00
|
|
|
gradient_loader_entries,
|
|
|
|
G_N_ELEMENTS (gradient_loader_entries),
|
|
|
|
gimp_gradient_new,
|
|
|
|
gimp_gradient_get_standard);
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->gradient_factory), "gradient factory");
|
|
|
|
|
|
|
|
gimp->palette_factory =
|
|
|
|
gimp_data_factory_new (gimp,
|
|
|
|
GIMP_TYPE_PALETTE,
|
2004-01-29 05:53:50 +08:00
|
|
|
"palette-path", "palette-path-writable",
|
2003-10-02 19:26:26 +08:00
|
|
|
palette_loader_entries,
|
|
|
|
G_N_ELEMENTS (palette_loader_entries),
|
|
|
|
gimp_palette_new,
|
|
|
|
gimp_palette_get_standard);
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (gimp->palette_factory), "palette factory");
|
|
|
|
|
|
|
|
gimp_paint_init (gimp);
|
|
|
|
|
|
|
|
/* Set the last values used to default values. */
|
2003-10-14 23:20:59 +08:00
|
|
|
gimp->image_new_last_template =
|
|
|
|
gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
|
2003-10-02 19:26:26 +08:00
|
|
|
|
|
|
|
gimp->have_current_cut_buffer = FALSE;
|
|
|
|
|
|
|
|
/* the default context contains the user's saved preferences
|
|
|
|
*
|
|
|
|
* TODO: load from disk
|
|
|
|
*/
|
|
|
|
context = gimp_context_new (gimp, "Default", NULL);
|
|
|
|
gimp_set_default_context (gimp, context);
|
|
|
|
g_object_unref (context);
|
|
|
|
|
|
|
|
/* the initial user_context is a straight copy of the default context
|
|
|
|
*/
|
|
|
|
context = gimp_context_new (gimp, "User", context);
|
|
|
|
gimp_set_user_context (gimp, context);
|
|
|
|
g_object_unref (context);
|
|
|
|
|
|
|
|
/* add the builtin FG -> BG etc. gradients */
|
|
|
|
gimp_gradients_init (gimp);
|
|
|
|
|
|
|
|
/* register all internal procedures */
|
|
|
|
(* status_callback) (_("Procedural Database"), NULL, -1);
|
2003-12-05 21:02:18 +08:00
|
|
|
procedural_db_init_procs (gimp, status_callback);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
|
|
|
(* status_callback) (_("Plug-In Environment"), "", -1);
|
|
|
|
|
|
|
|
path = gimp_config_path_expand (gimp->config->environ_path, TRUE, NULL);
|
|
|
|
gimp_environ_table_load (gimp->environ_table, path);
|
|
|
|
g_free (path);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_real_restore (Gimp *gimp,
|
2003-11-13 22:14:20 +08:00
|
|
|
GimpInitStatusFunc status_callback)
|
2003-10-02 19:26:26 +08:00
|
|
|
{
|
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("INIT: gimp_real_restore\n");
|
|
|
|
|
2004-07-01 00:55:43 +08:00
|
|
|
plug_ins_init (gimp, gimp_get_user_context (gimp), status_callback);
|
2003-10-02 19:26:26 +08:00
|
|
|
}
|
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
static gboolean
|
|
|
|
gimp_real_exit (Gimp *gimp,
|
2003-12-01 00:05:56 +08:00
|
|
|
gboolean force)
|
2002-12-05 23:49:59 +08:00
|
|
|
{
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: gimp_real_exit\n");
|
|
|
|
|
|
|
|
plug_ins_exit (gimp);
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_modules_unload (gimp);
|
2003-10-22 02:14:58 +08:00
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_data_factory_data_save (gimp->brush_factory);
|
|
|
|
gimp_data_factory_data_save (gimp->pattern_factory);
|
|
|
|
gimp_data_factory_data_save (gimp->gradient_factory);
|
|
|
|
gimp_data_factory_data_save (gimp->palette_factory);
|
2003-10-22 02:14:58 +08:00
|
|
|
|
2003-09-02 02:20:56 +08:00
|
|
|
gimp_fonts_reset (gimp);
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_documents_save (gimp);
|
2003-04-04 01:50:56 +08:00
|
|
|
gimp_templates_save (gimp);
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_parasiterc_save (gimp);
|
|
|
|
gimp_unitrc_save (gimp);
|
|
|
|
|
|
|
|
return FALSE; /* continue exiting */
|
|
|
|
}
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
Gimp *
|
2003-10-02 19:26:26 +08:00
|
|
|
gimp_new (const gchar *name,
|
2003-11-13 22:14:20 +08:00
|
|
|
const gchar *session_name,
|
2003-10-02 19:26:26 +08:00
|
|
|
gboolean be_verbose,
|
2001-12-01 08:14:14 +08:00
|
|
|
gboolean no_data,
|
2003-11-05 08:33:20 +08:00
|
|
|
gboolean no_fonts,
|
2001-12-01 08:14:14 +08:00
|
|
|
gboolean no_interface,
|
2002-12-01 20:16:03 +08:00
|
|
|
gboolean use_shm,
|
2003-09-09 18:54:20 +08:00
|
|
|
gboolean console_messages,
|
2003-12-06 01:08:35 +08:00
|
|
|
GimpStackTraceMode stack_trace_mode,
|
|
|
|
GimpPDBCompatMode pdb_compat_mode)
|
2001-07-05 03:31:35 +08:00
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
gimp = g_object_new (GIMP_TYPE_GIMP,
|
|
|
|
"name", name,
|
|
|
|
NULL);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
gimp->session_name = g_strdup (session_name);
|
2003-09-09 18:54:20 +08:00
|
|
|
gimp->be_verbose = be_verbose ? TRUE : FALSE;
|
|
|
|
gimp->no_data = no_data ? TRUE : FALSE;
|
2003-11-05 08:33:20 +08:00
|
|
|
gimp->no_fonts = no_fonts ? TRUE : FALSE;
|
2003-09-09 18:54:20 +08:00
|
|
|
gimp->no_interface = no_interface ? TRUE : FALSE;
|
|
|
|
gimp->use_shm = use_shm ? TRUE : FALSE;
|
|
|
|
gimp->console_messages = console_messages ? TRUE : FALSE;
|
2001-12-01 08:14:14 +08:00
|
|
|
gimp->stack_trace_mode = stack_trace_mode;
|
2003-12-06 01:08:35 +08:00
|
|
|
gimp->pdb_compat_mode = pdb_compat_mode;
|
2001-10-19 01:27:36 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
return gimp;
|
|
|
|
}
|
|
|
|
|
2002-11-30 21:08:44 +08:00
|
|
|
static void
|
|
|
|
gimp_global_config_notify (GObject *global_config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *edit_config)
|
|
|
|
{
|
|
|
|
GValue global_value = { 0, };
|
|
|
|
GValue edit_value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&global_value, param_spec->value_type);
|
|
|
|
g_value_init (&edit_value, param_spec->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (global_config, param_spec->name, &global_value);
|
|
|
|
g_object_get_property (edit_config, param_spec->name, &edit_value);
|
|
|
|
|
|
|
|
if (g_param_values_cmp (param_spec, &global_value, &edit_value))
|
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (edit_config,
|
|
|
|
gimp_edit_config_notify,
|
|
|
|
global_config);
|
|
|
|
|
|
|
|
g_object_set_property (edit_config, param_spec->name, &global_value);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (edit_config,
|
|
|
|
gimp_edit_config_notify,
|
|
|
|
global_config);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&global_value);
|
|
|
|
g_value_unset (&edit_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_edit_config_notify (GObject *edit_config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *global_config)
|
|
|
|
{
|
|
|
|
GValue edit_value = { 0, };
|
|
|
|
GValue global_value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&edit_value, param_spec->value_type);
|
|
|
|
g_value_init (&global_value, param_spec->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (edit_config, param_spec->name, &edit_value);
|
|
|
|
g_object_get_property (global_config, param_spec->name, &global_value);
|
|
|
|
|
|
|
|
if (g_param_values_cmp (param_spec, &edit_value, &global_value))
|
|
|
|
{
|
|
|
|
if (param_spec->flags & GIMP_PARAM_RESTART)
|
|
|
|
{
|
2003-02-03 22:37:59 +08:00
|
|
|
#ifdef GIMP_CONFIG_DEBUG
|
2002-11-30 21:08:44 +08:00
|
|
|
g_print ("NOT Applying edit_config change of '%s' to global_config "
|
|
|
|
"because it needs restart\n",
|
|
|
|
param_spec->name);
|
2003-02-03 22:37:59 +08:00
|
|
|
#endif
|
2002-11-30 21:08:44 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-02-03 22:37:59 +08:00
|
|
|
#ifdef GIMP_CONFIG_DEBUG
|
2002-11-30 21:08:44 +08:00
|
|
|
g_print ("Applying edit_config change of '%s' to global_config\n",
|
|
|
|
param_spec->name);
|
2003-02-03 22:37:59 +08:00
|
|
|
#endif
|
2002-11-30 21:08:44 +08:00
|
|
|
g_signal_handlers_block_by_func (global_config,
|
|
|
|
gimp_global_config_notify,
|
|
|
|
edit_config);
|
|
|
|
|
|
|
|
g_object_set_property (global_config, param_spec->name, &edit_value);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (global_config,
|
|
|
|
gimp_global_config_notify,
|
|
|
|
edit_config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&edit_value);
|
|
|
|
g_value_unset (&global_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-10-02 19:26:26 +08:00
|
|
|
gimp_load_config (Gimp *gimp,
|
|
|
|
const gchar *alternate_system_gimprc,
|
2003-11-17 08:17:01 +08:00
|
|
|
const gchar *alternate_gimprc)
|
2002-11-30 21:08:44 +08:00
|
|
|
{
|
2003-10-02 19:26:26 +08:00
|
|
|
GimpRc *gimprc;
|
|
|
|
|
2002-11-30 21:08:44 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (gimp->config == NULL);
|
|
|
|
g_return_if_fail (gimp->edit_config == NULL);
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("INIT: gimp_load_config\n");
|
|
|
|
|
|
|
|
/* this needs to be done before gimprc loading because gimprc can
|
|
|
|
* use user defined units
|
|
|
|
*/
|
|
|
|
gimp_unitrc_load (gimp);
|
|
|
|
|
|
|
|
gimprc = gimp_rc_new (alternate_system_gimprc,
|
|
|
|
alternate_gimprc,
|
|
|
|
gimp->be_verbose);
|
|
|
|
|
|
|
|
gimp->config = GIMP_CORE_CONFIG (gimprc);
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2003-10-14 23:20:59 +08:00
|
|
|
gimp->edit_config = gimp_config_duplicate (GIMP_CONFIG (gimp->config));
|
2002-11-30 21:08:44 +08:00
|
|
|
|
|
|
|
g_signal_connect_object (gimp->config, "notify",
|
|
|
|
G_CALLBACK (gimp_global_config_notify),
|
|
|
|
gimp->edit_config, 0);
|
|
|
|
g_signal_connect_object (gimp->edit_config, "notify",
|
|
|
|
G_CALLBACK (gimp_edit_config_notify),
|
|
|
|
gimp->config, 0);
|
|
|
|
}
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
void
|
2001-10-20 00:41:09 +08:00
|
|
|
gimp_initialize (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback)
|
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
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2001-10-20 00:41:09 +08:00
|
|
|
g_return_if_fail (status_callback != NULL);
|
2002-11-30 21:08:44 +08:00
|
|
|
g_return_if_fail (GIMP_IS_CORE_CONFIG (gimp->config));
|
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 (gimp->be_verbose)
|
|
|
|
g_print ("INIT: gimp_initialize\n");
|
2003-09-16 01:26:28 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
g_signal_emit (gimp, gimp_signals[INITIALIZE], 0, status_callback);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-20 00:41:09 +08:00
|
|
|
gimp_restore (Gimp *gimp,
|
2003-11-13 22:14:20 +08:00
|
|
|
GimpInitStatusFunc status_callback)
|
2001-07-05 03:31:35 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2001-10-20 00:41:09 +08:00
|
|
|
g_return_if_fail (status_callback != NULL);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("INIT: gimp_restore\n");
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
/* initialize the global parasite table */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (_("Looking for data files"), _("Parasites"), 0.0);
|
2001-07-05 06:59:25 +08:00
|
|
|
gimp_parasiterc_load (gimp);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
/* initialize the list of gimp brushes */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Brushes"), 0.1);
|
|
|
|
gimp_data_factory_data_init (gimp->brush_factory, gimp->no_data);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
/* initialize the list of gimp patterns */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Patterns"), 0.2);
|
|
|
|
gimp_data_factory_data_init (gimp->pattern_factory, gimp->no_data);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
/* initialize the list of gimp palettes */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Palettes"), 0.3);
|
|
|
|
gimp_data_factory_data_init (gimp->palette_factory, gimp->no_data);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
/* initialize the list of gimp gradients */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Gradients"), 0.4);
|
|
|
|
gimp_data_factory_data_init (gimp->gradient_factory, gimp->no_data);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2003-03-26 06:53:10 +08:00
|
|
|
/* initialize the list of gimp fonts */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Fonts"), 0.5);
|
2003-09-16 01:26:28 +08:00
|
|
|
gimp_fonts_load (gimp);
|
2003-03-26 06:53:10 +08:00
|
|
|
|
2001-11-01 05:18:57 +08:00
|
|
|
/* initialize the document history */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Documents"), 0.6);
|
2002-05-15 19:05:32 +08:00
|
|
|
gimp_documents_load (gimp);
|
2001-08-11 15:47:35 +08:00
|
|
|
|
2003-04-04 01:50:56 +08:00
|
|
|
/* initialize the template list */
|
2003-10-02 19:26:26 +08:00
|
|
|
(* status_callback) (NULL, _("Templates"), 0.7);
|
2003-04-04 01:50:56 +08:00
|
|
|
gimp_templates_load (gimp);
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
/* initialize the module list */
|
|
|
|
(* status_callback) (NULL, _("Modules"), 0.8);
|
2001-10-19 01:27:36 +08:00
|
|
|
gimp_modules_load (gimp);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
g_signal_emit (gimp, gimp_signals[RESTORE], 0, status_callback);
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
2001-07-05 06:59:25 +08:00
|
|
|
|
2003-12-01 00:05:56 +08:00
|
|
|
/**
|
|
|
|
* gimp_exit:
|
|
|
|
* @gimp: a #Gimp object
|
|
|
|
* @force: whether to force the application to quit
|
|
|
|
*
|
|
|
|
* Exit this GIMP session. Unless @force is %TRUE, the user is queried
|
|
|
|
* whether unsaved images should be saved and can cancel the operation.
|
|
|
|
**/
|
2001-07-05 06:59:25 +08:00
|
|
|
void
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_exit (Gimp *gimp,
|
2003-12-01 00:05:56 +08:00
|
|
|
gboolean force)
|
2001-07-05 06:59:25 +08:00
|
|
|
{
|
2002-12-05 23:49:59 +08:00
|
|
|
gboolean handled;
|
|
|
|
|
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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: gimp_exit\n");
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (gimp, gimp_signals[EXIT], 0,
|
2003-12-01 00:05:56 +08:00
|
|
|
force ? TRUE : FALSE,
|
2002-12-05 23:49:59 +08:00
|
|
|
&handled);
|
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-02-19 20:49:15 +08:00
|
|
|
void
|
|
|
|
gimp_set_global_buffer (Gimp *gimp,
|
|
|
|
GimpBuffer *buffer)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (buffer == NULL || GIMP_IS_BUFFER (buffer));
|
|
|
|
|
|
|
|
if (buffer == gimp->global_buffer)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (gimp->global_buffer)
|
|
|
|
g_object_unref (gimp->global_buffer);
|
|
|
|
|
|
|
|
gimp->global_buffer = buffer;
|
|
|
|
|
|
|
|
if (gimp->global_buffer)
|
|
|
|
g_object_ref (gimp->global_buffer);
|
|
|
|
|
|
|
|
gimp->have_current_cut_buffer = (buffer != NULL);
|
|
|
|
|
|
|
|
g_signal_emit (gimp, gimp_signals[BUFFER_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
GimpImage *
|
|
|
|
gimp_create_image (Gimp *gimp,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
2001-07-06 00:21:36 +08:00
|
|
|
GimpImageBaseType type,
|
|
|
|
gboolean attach_comment)
|
2001-07-05 23:34:26 +08:00
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2001-07-08 02:16:18 +08:00
|
|
|
gimage = gimp_image_new (gimp, width, height, type);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2001-07-06 00:21:36 +08:00
|
|
|
gimp_container_add (gimp->images, GIMP_OBJECT (gimage));
|
|
|
|
|
2003-10-15 23:30:11 +08:00
|
|
|
if (attach_comment)
|
2001-07-06 00:21:36 +08:00
|
|
|
{
|
2003-10-15 23:30:11 +08:00
|
|
|
const gchar *comment = gimp->config->default_image->comment;
|
|
|
|
|
|
|
|
if (comment)
|
|
|
|
{
|
|
|
|
GimpParasite *parasite = gimp_parasite_new ("gimp-comment",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (comment) + 1,
|
|
|
|
comment);
|
|
|
|
gimp_image_parasite_attach (gimage, parasite);
|
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
}
|
2001-07-06 00:21:36 +08:00
|
|
|
}
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
return gimage;
|
|
|
|
}
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
void
|
|
|
|
gimp_set_default_context (Gimp *gimp,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
if (gimp->default_context)
|
2003-04-06 02:40:16 +08:00
|
|
|
g_object_unref (gimp->default_context);
|
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
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp->default_context = context;
|
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 (gimp->default_context)
|
2003-04-06 02:40:16 +08:00
|
|
|
g_object_ref (gimp->default_context);
|
2001-07-07 20:17:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpContext *
|
|
|
|
gimp_get_default_context (Gimp *gimp)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
return gimp->default_context;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_set_user_context (Gimp *gimp,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
if (gimp->user_context)
|
2003-04-06 02:40:16 +08:00
|
|
|
g_object_unref (gimp->user_context);
|
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
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp->user_context = context;
|
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 (gimp->user_context)
|
2003-04-06 02:40:16 +08:00
|
|
|
g_object_ref (gimp->user_context);
|
2001-07-07 20:17:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpContext *
|
|
|
|
gimp_get_user_context (Gimp *gimp)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
return gimp->user_context;
|
|
|
|
}
|