2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU 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
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-07-05 03:31:35 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-07-05 03:31:35 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-07-05 03:31:35 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2001-07-23 06:18:01 +08:00
|
|
|
#include <string.h> /* strlen */
|
|
|
|
|
2013-10-15 07:58:39 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2001-07-06 00:21:36 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-07-06 00:21:36 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "core-types.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimprc.h"
|
|
|
|
|
2006-08-06 02:27:56 +08:00
|
|
|
#include "pdb/gimppdb.h"
|
|
|
|
#include "pdb/gimp-pdb-compat.h"
|
2008-04-04 19:36:54 +08:00
|
|
|
#include "pdb/internal-procs.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
#include "plug-in/gimppluginmanager.h"
|
2007-04-18 23:06:05 +08:00
|
|
|
#include "plug-in/gimppluginmanager-restore.h"
|
2003-10-02 19:26:26 +08:00
|
|
|
|
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"
|
2005-09-04 18:44:04 +08:00
|
|
|
#include "gimp-contexts.h"
|
2016-09-12 08:48:39 +08:00
|
|
|
#include "gimp-data-factories.h"
|
2015-12-30 18:53:52 +08:00
|
|
|
#include "gimp-filter-history.h"
|
2014-08-12 19:57:57 +08:00
|
|
|
#include "gimp-memsize.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"
|
2008-12-05 05:58:45 +08:00
|
|
|
#include "gimpbrush.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimpbuffer.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "gimpcontext.h"
|
2009-10-11 06:08:24 +08:00
|
|
|
#include "gimpdynamics.h"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimpdocumentlist.h"
|
2008-12-05 05:58:45 +08:00
|
|
|
#include "gimpgradient.h"
|
2011-05-05 04:14:13 +08:00
|
|
|
#include "gimpidtable.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
#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"
|
2015-12-21 06:48:40 +08:00
|
|
|
#include "gimpmybrush.h"
|
2008-12-05 05:58:45 +08:00
|
|
|
#include "gimppalette.h"
|
|
|
|
#include "gimpparasitelist.h"
|
|
|
|
#include "gimppattern.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,
|
2016-09-17 23:39:54 +08:00
|
|
|
CLIPBOARD_CHANGED,
|
2015-12-30 18:53:52 +08:00
|
|
|
FILTER_HISTORY_CHANGED,
|
2008-10-17 20:03:08 +08:00
|
|
|
IMAGE_OPENED,
|
2002-12-05 23:49:59 +08:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2014-07-15 06:09:15 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_VERBOSE
|
|
|
|
};
|
2002-12-05 23:49:59 +08:00
|
|
|
|
2014-07-15 06:09:15 +08:00
|
|
|
|
|
|
|
static void gimp_constructed (GObject *object);
|
|
|
|
static void gimp_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2007-04-18 23:06:05 +08:00
|
|
|
static void gimp_dispose (GObject *object);
|
|
|
|
static void gimp_finalize (GObject *object);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2007-04-18 23:06:05 +08:00
|
|
|
static gint64 gimp_get_memsize (GimpObject *object,
|
|
|
|
gint64 *gui_size);
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2007-04-18 23:06:05 +08:00
|
|
|
static void gimp_real_initialize (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback);
|
|
|
|
static void gimp_real_restore (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback);
|
|
|
|
static gboolean gimp_real_exit (Gimp *gimp,
|
|
|
|
gboolean force);
|
2002-12-05 23:49:59 +08:00
|
|
|
|
2007-04-18 23:06:05 +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
|
|
|
|
|
|
|
|
2006-05-15 17:46:31 +08:00
|
|
|
G_DEFINE_TYPE (Gimp, gimp, GIMP_TYPE_OBJECT)
|
2005-12-11 03:24:36 +08:00
|
|
|
|
|
|
|
#define parent_class gimp_parent_class
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2002-12-05 23:49:59 +08:00
|
|
|
static guint gimp_signals[LAST_SIGNAL] = { 0, };
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
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),
|
2007-02-17 19:45:59 +08:00
|
|
|
g_signal_accumulator_true_handled, NULL,
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_marshal_BOOLEAN__BOOLEAN,
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
|
|
|
G_TYPE_BOOLEAN);
|
|
|
|
|
2016-09-17 23:39:54 +08:00
|
|
|
gimp_signals[CLIPBOARD_CHANGED] =
|
|
|
|
g_signal_new ("clipboard-changed",
|
2004-02-19 20:49:15 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
2016-09-17 23:39:54 +08:00
|
|
|
G_STRUCT_OFFSET (GimpClass, clipboard_changed),
|
2004-02-19 20:49:15 +08:00
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2015-12-30 18:53:52 +08:00
|
|
|
gimp_signals[FILTER_HISTORY_CHANGED] =
|
|
|
|
g_signal_new ("filter-history-changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass,
|
|
|
|
filter_history_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-10-17 20:03:08 +08:00
|
|
|
gimp_signals[IMAGE_OPENED] =
|
|
|
|
g_signal_new ("image-opened",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GimpClass, image_opened),
|
|
|
|
NULL, NULL,
|
2014-07-07 06:46:25 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1, G_TYPE_FILE);
|
2008-10-17 20:03:08 +08:00
|
|
|
|
2014-07-15 06:09:15 +08:00
|
|
|
object_class->constructed = gimp_constructed;
|
|
|
|
object_class->set_property = gimp_set_property;
|
|
|
|
object_class->get_property = gimp_get_property;
|
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;
|
2016-09-17 23:39:54 +08:00
|
|
|
klass->clipboard_changed = NULL;
|
2014-07-15 06:09:15 +08:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_VERBOSE,
|
|
|
|
g_param_spec_boolean ("verbose", NULL, NULL,
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_init (Gimp *gimp)
|
|
|
|
{
|
2003-09-11 06:06:45 +08:00
|
|
|
gimp->be_verbose = FALSE;
|
|
|
|
gimp->no_data = FALSE;
|
|
|
|
gimp->no_interface = FALSE;
|
2009-09-09 01:26:57 +08:00
|
|
|
gimp->show_gui = TRUE;
|
2003-09-11 06:06:45 +08:00
|
|
|
gimp->use_shm = FALSE;
|
2013-06-20 02:42:56 +08:00
|
|
|
gimp->use_cpu_accel = TRUE;
|
2003-09-11 06:06:45 +08:00
|
|
|
gimp->message_handler = GIMP_CONSOLE;
|
2014-09-14 07:08:25 +08:00
|
|
|
gimp->show_playground = FALSE;
|
2003-09-11 06:06:45 +08:00
|
|
|
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
|
|
|
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->parasites = gimp_parasite_list_new ();
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2016-09-13 05:51:29 +08:00
|
|
|
gimp_units_init (gimp);
|
|
|
|
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->images = gimp_list_new_weak (GIMP_TYPE_IMAGE, FALSE);
|
2006-04-07 18:51:22 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (gimp->images), "images");
|
2002-02-01 02:02:38 +08:00
|
|
|
|
2005-03-05 08:10:40 +08:00
|
|
|
gimp->next_guide_ID = 1;
|
2005-03-05 00:34:59 +08:00
|
|
|
gimp->next_sample_point_ID = 1;
|
2011-05-05 04:14:13 +08:00
|
|
|
gimp->image_table = gimp_id_table_new ();
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->item_table = gimp_id_table_new ();
|
2001-07-11 20:39:49 +08:00
|
|
|
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->displays = g_object_new (GIMP_TYPE_LIST,
|
|
|
|
"children-type", GIMP_TYPE_OBJECT,
|
|
|
|
"policy", GIMP_CONTAINER_POLICY_WEAK,
|
|
|
|
"append", TRUE,
|
|
|
|
NULL);
|
2006-04-07 18:51:22 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (gimp->displays), "displays");
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->next_display_ID = 1;
|
2002-05-09 01:48:24 +08:00
|
|
|
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER, TRUE);
|
2006-04-07 18:51:22 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (gimp->named_buffers),
|
|
|
|
"named buffers");
|
2002-02-01 02:02:38 +08:00
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
gimp_fonts_init (gimp);
|
|
|
|
|
|
|
|
gimp_data_factories_init (gimp);
|
|
|
|
|
2016-05-01 22:05:44 +08:00
|
|
|
gimp->tool_info_list = g_object_new (GIMP_TYPE_LIST,
|
|
|
|
"children-type", GIMP_TYPE_TOOL_INFO,
|
|
|
|
"append", TRUE,
|
|
|
|
NULL);
|
2006-04-07 18:51:22 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (gimp->tool_info_list),
|
|
|
|
"tool infos");
|
2002-02-01 02:02:38 +08:00
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
gimp->documents = gimp_document_list_new (gimp);
|
|
|
|
|
2014-07-15 06:22:43 +08:00
|
|
|
gimp->templates = gimp_list_new (GIMP_TYPE_TEMPLATE, TRUE);
|
2006-04-07 18:51:22 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (gimp->templates), "templates");
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
2014-07-15 06:09:15 +08:00
|
|
|
static void
|
|
|
|
gimp_constructed (GObject *object)
|
|
|
|
{
|
|
|
|
Gimp *gimp = GIMP (object);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->constructed (object);
|
|
|
|
|
|
|
|
gimp_modules_init (gimp);
|
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
gimp_paint_init (gimp);
|
|
|
|
|
2014-07-15 06:09:15 +08:00
|
|
|
gimp->plug_in_manager = gimp_plug_in_manager_new (gimp);
|
|
|
|
gimp->pdb = gimp_pdb_new (gimp);
|
|
|
|
|
|
|
|
xcf_init (gimp);
|
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
/* create user and default context */
|
|
|
|
gimp_contexts_init (gimp);
|
2014-07-15 06:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
Gimp *gimp = GIMP (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_VERBOSE:
|
|
|
|
gimp->be_verbose = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
Gimp *gimp = GIMP (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_VERBOSE:
|
|
|
|
g_value_set_boolean (value, gimp->be_verbose);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2008-12-15 03:04:05 +08:00
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print ("EXIT: %s\n", G_STRFUNC);
|
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
gimp_data_factories_clear (gimp);
|
2010-04-03 23:25:31 +08:00
|
|
|
|
2015-12-30 18:53:52 +08:00
|
|
|
gimp_filter_history_clear (gimp);
|
|
|
|
|
2016-09-13 18:44:10 +08:00
|
|
|
if (gimp->edit_config)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->edit_config);
|
|
|
|
gimp->edit_config = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->config)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->config);
|
|
|
|
gimp->config = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_contexts_exit (gimp);
|
|
|
|
|
|
|
|
if (gimp->image_new_last_template)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->image_new_last_template);
|
|
|
|
gimp->image_new_last_template = NULL;
|
|
|
|
}
|
|
|
|
|
2008-12-15 03:04:05 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_finalize (GObject *object)
|
|
|
|
{
|
2014-10-07 02:35:24 +08:00
|
|
|
Gimp *gimp = GIMP (object);
|
|
|
|
GList *standards = NULL;
|
2008-12-15 03:04:05 +08:00
|
|
|
|
2003-11-17 08:47:37 +08:00
|
|
|
if (gimp->be_verbose)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("EXIT: %s\n", G_STRFUNC);
|
2003-11-17 08:47:37 +08:00
|
|
|
|
2014-10-07 02:35:24 +08:00
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_brush_get_standard (gimp->user_context));
|
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_dynamics_get_standard (gimp->user_context));
|
2015-12-21 06:48:40 +08:00
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_mybrush_get_standard (gimp->user_context));
|
2014-10-07 02:35:24 +08:00
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_pattern_get_standard (gimp->user_context));
|
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_gradient_get_standard (gimp->user_context));
|
|
|
|
standards = g_list_prepend (standards,
|
|
|
|
gimp_palette_get_standard (gimp->user_context));
|
|
|
|
|
2003-04-04 01:50:56 +08:00
|
|
|
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)
|
|
|
|
{
|
2010-06-24 18:57:00 +08:00
|
|
|
gimp_container_foreach (gimp->tool_info_list,
|
|
|
|
(GFunc) g_object_run_dispose, NULL);
|
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);
|
|
|
|
|
2006-08-06 02:27:56 +08:00
|
|
|
if (gimp->pdb)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->pdb);
|
|
|
|
gimp->pdb = NULL;
|
|
|
|
}
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
gimp_data_factories_exit (gimp);
|
2008-12-20 22:46:54 +08:00
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
gimp_fonts_exit (gimp);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-09-17 23:39:54 +08:00
|
|
|
if (gimp->clipboard_buffer)
|
2001-07-05 03:31:35 +08:00
|
|
|
{
|
2016-09-17 23:39:54 +08:00
|
|
|
g_object_unref (gimp->clipboard_buffer);
|
|
|
|
gimp->clipboard_buffer = NULL;
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
|
|
|
|
2016-09-20 02:13:39 +08:00
|
|
|
if (gimp->clipboard_image)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->clipboard_image);
|
|
|
|
gimp->clipboard_image = 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
|
|
|
{
|
2011-05-05 04:14:13 +08:00
|
|
|
g_object_unref (gimp->item_table);
|
2002-02-26 01:58:50 +08:00
|
|
|
gimp->item_table = NULL;
|
2001-07-11 20:39:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->image_table)
|
|
|
|
{
|
2011-05-05 04:14:13 +08:00
|
|
|
g_object_unref (gimp->image_table);
|
2001-07-11 20:39:49 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
if (gimp->plug_in_manager)
|
2002-11-12 11:34:11 +08:00
|
|
|
{
|
2006-04-29 06:26:51 +08:00
|
|
|
g_object_unref (gimp->plug_in_manager);
|
|
|
|
gimp->plug_in_manager = NULL;
|
2005-02-21 10:56:29 +08:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2012-12-15 07:34:15 +08:00
|
|
|
if (gimp->default_folder)
|
|
|
|
{
|
2014-07-10 02:12:05 +08:00
|
|
|
g_object_unref (gimp->default_folder);
|
2012-12-15 07:34:15 +08:00
|
|
|
gimp->default_folder = NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
if (gimp->session_name)
|
|
|
|
{
|
|
|
|
g_free (gimp->session_name);
|
|
|
|
gimp->session_name = NULL;
|
|
|
|
}
|
|
|
|
|
2007-07-17 19:15:15 +08:00
|
|
|
if (gimp->context_list)
|
|
|
|
{
|
2014-10-07 02:35:24 +08:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_warning ("%s: list of contexts not empty upon exit (%d contexts left)\n",
|
|
|
|
G_STRFUNC, g_list_length (gimp->context_list));
|
|
|
|
|
|
|
|
for (list = gimp->context_list; list; list = g_list_next (list))
|
|
|
|
g_printerr ("stale context: %s\n", gimp_object_get_name (list->data));
|
|
|
|
|
2007-07-17 19:15:15 +08:00
|
|
|
g_list_free (gimp->context_list);
|
|
|
|
gimp->context_list = NULL;
|
|
|
|
}
|
|
|
|
|
2014-10-07 02:35:24 +08:00
|
|
|
g_list_foreach (standards, (GFunc) g_object_unref, NULL);
|
|
|
|
g_list_free (standards);
|
|
|
|
|
2005-01-13 21:08:00 +08:00
|
|
|
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
|
|
|
|
2006-04-15 23:15:33 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->paint_info_list),
|
|
|
|
gui_size);
|
|
|
|
|
2002-10-23 22:55:07 +08:00
|
|
|
memsize += gimp_g_object_get_memsize (G_OBJECT (gimp->module_db));
|
2007-11-17 02:19:30 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->plug_in_manager),
|
|
|
|
gui_size);
|
2006-02-21 19:05:43 +08:00
|
|
|
|
2015-12-30 18:53:52 +08:00
|
|
|
memsize += gimp_g_list_get_memsize_foreach (gimp->filter_history,
|
|
|
|
(GimpMemsizeFunc)
|
|
|
|
gimp_object_get_memsize,
|
|
|
|
gui_size);
|
|
|
|
|
2011-05-05 04:14:13 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->image_table), 0);
|
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->item_table), 0);
|
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
|
|
|
|
2016-09-20 02:13:39 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->clipboard_image),
|
|
|
|
gui_size);
|
2016-09-17 23:39:54 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->clipboard_buffer),
|
2007-11-17 02:19:30 +08:00
|
|
|
gui_size);
|
2016-09-20 02:13:39 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->named_buffers),
|
|
|
|
gui_size);
|
2007-11-17 02:19:30 +08:00
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
memsize += gimp_data_factories_get_memsize (gimp, gui_size);
|
2008-12-20 22:46:54 +08:00
|
|
|
|
2006-04-26 17:13:47 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->pdb), gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2007-11-17 02:19:30 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->tool_info_list),
|
|
|
|
gui_size);
|
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->standard_tool_info),
|
|
|
|
gui_size);
|
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->documents),
|
|
|
|
gui_size);
|
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->templates),
|
|
|
|
gui_size);
|
|
|
|
memsize += 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
|
|
|
|
2007-11-17 02:19:30 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->default_context),
|
|
|
|
gui_size);
|
|
|
|
memsize += 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)
|
|
|
|
{
|
|
|
|
if (gimp->be_verbose)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("INIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2005-11-05 21:00:04 +08:00
|
|
|
status_callback (_("Initialization"), NULL, 0.0);
|
|
|
|
|
2016-09-13 15:47:27 +08:00
|
|
|
gimp_fonts_set_config (gimp);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
/* add data objects that need the user context */
|
|
|
|
gimp_data_factories_add_builtin (gimp);
|
2006-05-17 17:49:20 +08:00
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
/* register all internal procedures */
|
2006-05-16 19:43:55 +08:00
|
|
|
status_callback (NULL, _("Internal Procedures"), 0.2);
|
2006-08-06 02:27:56 +08:00
|
|
|
internal_procs_init (gimp->pdb);
|
|
|
|
gimp_pdb_compat_procs_register (gimp->pdb, gimp->pdb_compat_mode);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
gimp_plug_in_manager_initialize (gimp->plug_in_manager, status_callback);
|
2005-11-05 21:00:04 +08:00
|
|
|
|
|
|
|
status_callback (NULL, "", 1.0);
|
2003-10-02 19:26:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("INIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
gimp_plug_in_manager_restore (gimp->plug_in_manager,
|
|
|
|
gimp_get_user_context (gimp), status_callback);
|
2008-09-25 16:56:58 +08:00
|
|
|
|
|
|
|
gimp->restored = TRUE;
|
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)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("EXIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
gimp_plug_in_manager_exit (gimp->plug_in_manager);
|
2002-12-05 23:49:59 +08:00
|
|
|
gimp_modules_unload (gimp);
|
2003-10-22 02:14:58 +08:00
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
gimp_data_factories_save (gimp);
|
2010-04-03 23:25:31 +08:00
|
|
|
|
2003-09-02 02:20:56 +08:00
|
|
|
gimp_fonts_reset (gimp);
|
2005-11-01 04:57:03 +08:00
|
|
|
|
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,
|
2014-07-10 02:12:05 +08:00
|
|
|
GFile *default_folder,
|
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,
|
2013-06-20 02:42:56 +08:00
|
|
|
gboolean use_cpu_accel,
|
2003-09-09 18:54:20 +08:00
|
|
|
gboolean console_messages,
|
2014-09-14 07:08:25 +08:00
|
|
|
gboolean show_playground,
|
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,
|
2014-07-15 06:09:15 +08:00
|
|
|
"name", name,
|
|
|
|
"verbose", be_verbose ? TRUE : FALSE,
|
2003-11-13 22:14:20 +08:00
|
|
|
NULL);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2014-07-10 02:12:05 +08:00
|
|
|
if (default_folder)
|
|
|
|
gimp->default_folder = g_object_ref (default_folder);
|
|
|
|
|
2003-11-13 22:14:20 +08:00
|
|
|
gimp->session_name = g_strdup (session_name);
|
2003-09-09 18:54:20 +08:00
|
|
|
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;
|
2013-06-20 02:42:56 +08:00
|
|
|
gimp->use_cpu_accel = use_cpu_accel ? TRUE : FALSE;
|
2003-09-09 18:54:20 +08:00
|
|
|
gimp->console_messages = console_messages ? TRUE : FALSE;
|
2014-09-14 07:08:25 +08:00
|
|
|
gimp->show_playground = show_playground ? 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;
|
|
|
|
}
|
|
|
|
|
2009-09-09 01:26:57 +08:00
|
|
|
/**
|
|
|
|
* gimp_set_show_gui:
|
|
|
|
* @gimp:
|
|
|
|
* @show:
|
|
|
|
*
|
|
|
|
* Test cases that tests the UI typically don't want any windows to be
|
|
|
|
* presented during the test run. Allow them to set this.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_set_show_gui (Gimp *gimp,
|
|
|
|
gboolean show_gui)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
gimp->show_gui = show_gui;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_get_show_gui:
|
|
|
|
* @gimp:
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the GUI should be shown, %FALSE otherwise.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_get_show_gui (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
|
|
|
|
return gimp->show_gui;
|
|
|
|
}
|
|
|
|
|
2002-11-30 21:08:44 +08:00
|
|
|
static void
|
|
|
|
gimp_global_config_notify (GObject *global_config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *edit_config)
|
|
|
|
{
|
2016-03-26 22:59:26 +08:00
|
|
|
GValue global_value = G_VALUE_INIT;
|
|
|
|
GValue edit_value = G_VALUE_INIT;
|
2002-11-30 21:08:44 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2016-03-26 22:59:26 +08:00
|
|
|
GValue edit_value = G_VALUE_INIT;
|
|
|
|
GValue global_value = G_VALUE_INIT;
|
2002-11-30 21:08:44 +08:00
|
|
|
|
|
|
|
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))
|
|
|
|
{
|
2005-02-05 22:52:58 +08:00
|
|
|
if (param_spec->flags & GIMP_CONFIG_PARAM_RESTART)
|
2002-11-30 21:08:44 +08:00
|
|
|
{
|
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
|
2014-07-28 21:03:06 +08:00
|
|
|
gimp_load_config (Gimp *gimp,
|
|
|
|
GFile *alternate_system_gimprc,
|
|
|
|
GFile *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));
|
2014-07-28 21:03:06 +08:00
|
|
|
g_return_if_fail (alternate_system_gimprc == NULL ||
|
|
|
|
G_IS_FILE (alternate_system_gimprc));
|
|
|
|
g_return_if_fail (alternate_gimprc == NULL ||
|
|
|
|
G_IS_FILE (alternate_gimprc));
|
2002-11-30 21:08:44 +08:00
|
|
|
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)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("INIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
|
|
|
/* this needs to be done before gimprc loading because gimprc can
|
|
|
|
* use user defined units
|
|
|
|
*/
|
|
|
|
gimp_unitrc_load (gimp);
|
|
|
|
|
2016-09-14 07:27:42 +08:00
|
|
|
gimprc = gimp_rc_new (G_OBJECT (gimp),
|
|
|
|
alternate_system_gimprc,
|
2003-10-02 19:26:26 +08:00
|
|
|
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)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("INIT: %s\n", G_STRFUNC);
|
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)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("INIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
/* initialize the global parasite table */
|
2005-11-05 20:18:56 +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
|
|
|
|
2016-09-12 08:48:39 +08:00
|
|
|
/* initialize the lists of gimp brushes, dynamics, patterns etc. */
|
|
|
|
gimp_data_factories_load (gimp, status_callback);
|
2010-04-03 23:25:31 +08:00
|
|
|
|
2016-09-15 20:48:51 +08:00
|
|
|
/* initialize the list of fonts */
|
|
|
|
if (! gimp->no_fonts)
|
2016-09-16 00:47:55 +08:00
|
|
|
{
|
|
|
|
status_callback (NULL, _("Fonts (this may take a while)"), 0.7);
|
|
|
|
gimp_fonts_load (gimp, status_callback);
|
|
|
|
}
|
2016-09-15 20:48:51 +08:00
|
|
|
|
2003-04-04 01:50:56 +08:00
|
|
|
/* initialize the template list */
|
2016-09-12 08:48:39 +08:00
|
|
|
status_callback (NULL, _("Templates"), 0.8);
|
2003-04-04 01:50:56 +08:00
|
|
|
gimp_templates_load (gimp);
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
/* initialize the module list */
|
2016-09-12 08:48:39 +08:00
|
|
|
status_callback (NULL, _("Modules"), 0.9);
|
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);
|
2015-02-27 05:17:45 +08:00
|
|
|
|
|
|
|
/* when done, make sure everything is clean, to clean out dirty
|
2016-09-16 00:47:55 +08:00
|
|
|
* states from data objects which reference each other and got
|
2015-02-27 05:17:45 +08:00
|
|
|
* dirtied by loading the referenced object
|
|
|
|
*/
|
2016-09-12 08:48:39 +08:00
|
|
|
gimp_data_factories_data_clean (gimp);
|
2001-07-05 03:31:35 +08:00
|
|
|
}
|
2001-07-05 06:59:25 +08:00
|
|
|
|
2008-09-25 16:56:58 +08:00
|
|
|
/**
|
|
|
|
* gimp_is_restored:
|
|
|
|
* @gimp: a #Gimp object
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if GIMP is completely started, %FALSE otherwise.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_is_restored (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
|
|
|
|
return gimp->restored;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2016-04-16 20:52:41 +08:00
|
|
|
gboolean handled;
|
|
|
|
GList *image_iter;
|
2002-12-05 23:49:59 +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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2003-10-02 19:26:26 +08:00
|
|
|
if (gimp->be_verbose)
|
2008-02-19 21:38:24 +08:00
|
|
|
g_print ("EXIT: %s\n", G_STRFUNC);
|
2003-10-02 19:26:26 +08:00
|
|
|
|
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);
|
2016-04-16 20:52:41 +08:00
|
|
|
|
2016-04-16 21:20:43 +08:00
|
|
|
if (handled)
|
|
|
|
return;
|
|
|
|
|
2016-04-16 20:52:41 +08:00
|
|
|
/* Get rid of images without display. We do this *after* handling the
|
|
|
|
* usual exit callbacks, because the things that are torn down there
|
|
|
|
* might have references to these images (for instance GimpActions
|
|
|
|
* in the UI manager).
|
|
|
|
*/
|
|
|
|
while ((image_iter = gimp_get_image_iter (gimp)))
|
|
|
|
{
|
|
|
|
GimpImage *image = image_iter->data;
|
|
|
|
|
|
|
|
g_object_unref (image);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2008-11-03 05:34:14 +08:00
|
|
|
GList *
|
|
|
|
gimp_get_image_iter (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2016-05-01 21:22:44 +08:00
|
|
|
return GIMP_LIST (gimp->images)->queue->head;
|
2008-11-03 05:34:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
|
|
|
gimp_get_display_iter (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2016-05-01 21:22:44 +08:00
|
|
|
return GIMP_LIST (gimp->displays)->queue->head;
|
2008-11-03 05:34:14 +08:00
|
|
|
}
|
|
|
|
|
2009-10-04 08:01:53 +08:00
|
|
|
GList *
|
2009-10-26 03:31:55 +08:00
|
|
|
gimp_get_image_windows (Gimp *gimp)
|
2009-10-04 08:01:53 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2009-10-26 03:31:55 +08:00
|
|
|
return g_list_copy (gimp->image_windows);
|
2009-10-04 08:01:53 +08:00
|
|
|
}
|
|
|
|
|
2011-10-30 01:37:58 +08:00
|
|
|
GList *
|
|
|
|
gimp_get_paint_info_iter (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2016-05-01 21:22:44 +08:00
|
|
|
return GIMP_LIST (gimp->paint_info_list)->queue->head;
|
2011-10-30 01:37:58 +08:00
|
|
|
}
|
|
|
|
|
2008-11-03 05:34:14 +08:00
|
|
|
GList *
|
|
|
|
gimp_get_tool_info_iter (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2016-05-01 21:22:44 +08:00
|
|
|
return GIMP_LIST (gimp->tool_info_list)->queue->head;
|
2008-11-03 05:34:14 +08:00
|
|
|
}
|
|
|
|
|
2016-09-21 06:11:15 +08:00
|
|
|
GimpObject *
|
|
|
|
gimp_get_clipboard_object (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->clipboard_image)
|
|
|
|
return GIMP_OBJECT (gimp->clipboard_image);
|
|
|
|
|
|
|
|
return GIMP_OBJECT (gimp->clipboard_buffer);
|
|
|
|
}
|
|
|
|
|
2016-09-20 02:13:39 +08:00
|
|
|
void
|
|
|
|
gimp_set_clipboard_image (Gimp *gimp,
|
|
|
|
GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
/* ref first, it could be the same as gimp->clipboard_image, but
|
|
|
|
* don't bail if equal because always we want the signal emission
|
|
|
|
*/
|
|
|
|
if (image)
|
|
|
|
g_object_ref (image);
|
|
|
|
|
|
|
|
if (gimp->clipboard_buffer)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->clipboard_buffer);
|
|
|
|
gimp->clipboard_buffer = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gimp->clipboard_image)
|
|
|
|
g_object_unref (gimp->clipboard_image);
|
|
|
|
|
|
|
|
gimp->clipboard_image = image;
|
|
|
|
|
|
|
|
g_signal_emit (gimp, gimp_signals[CLIPBOARD_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpImage *
|
|
|
|
gimp_get_clipboard_image (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
return gimp->clipboard_image;
|
|
|
|
}
|
|
|
|
|
2004-02-19 20:49:15 +08:00
|
|
|
void
|
2016-09-17 23:39:54 +08:00
|
|
|
gimp_set_clipboard_buffer (Gimp *gimp,
|
|
|
|
GimpBuffer *buffer)
|
2004-02-19 20:49:15 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (buffer == NULL || GIMP_IS_BUFFER (buffer));
|
|
|
|
|
2016-09-20 02:13:39 +08:00
|
|
|
/* see above */
|
|
|
|
if (buffer)
|
|
|
|
g_object_ref (buffer);
|
|
|
|
|
|
|
|
if (gimp->clipboard_image)
|
|
|
|
{
|
|
|
|
g_object_unref (gimp->clipboard_image);
|
|
|
|
gimp->clipboard_image = NULL;
|
|
|
|
}
|
2004-02-19 20:49:15 +08:00
|
|
|
|
2016-09-17 23:39:54 +08:00
|
|
|
if (gimp->clipboard_buffer)
|
|
|
|
g_object_unref (gimp->clipboard_buffer);
|
2004-02-19 20:49:15 +08:00
|
|
|
|
2016-09-17 23:39:54 +08:00
|
|
|
gimp->clipboard_buffer = buffer;
|
2004-02-19 20:49:15 +08:00
|
|
|
|
2016-09-17 23:39:54 +08:00
|
|
|
g_signal_emit (gimp, gimp_signals[CLIPBOARD_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpBuffer *
|
|
|
|
gimp_get_clipboard_buffer (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
return gimp->clipboard_buffer;
|
2004-02-19 20:49:15 +08:00
|
|
|
}
|
|
|
|
|
2001-07-05 23:34:26 +08:00
|
|
|
GimpImage *
|
|
|
|
gimp_create_image (Gimp *gimp,
|
2004-08-11 22:00:08 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpImageBaseType type,
|
2012-04-22 23:31:32 +08:00
|
|
|
GimpPrecision precision,
|
2004-08-11 22:00:08 +08:00
|
|
|
gboolean attach_comment)
|
2001-07-05 23:34:26 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2001-07-05 23:34:26 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2012-04-22 23:31:32 +08:00
|
|
|
image = gimp_image_new (gimp, width, height, type, precision);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2003-10-15 23:30:11 +08:00
|
|
|
if (attach_comment)
|
2001-07-06 00:21:36 +08:00
|
|
|
{
|
2011-03-02 17:16:43 +08:00
|
|
|
const gchar *comment;
|
|
|
|
|
|
|
|
comment = gimp_template_get_comment (gimp->config->default_image);
|
2003-10-15 23:30:11 +08:00
|
|
|
|
|
|
|
if (comment)
|
|
|
|
{
|
|
|
|
GimpParasite *parasite = gimp_parasite_new ("gimp-comment",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (comment) + 1,
|
|
|
|
comment);
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_parasite_attach (image, parasite);
|
2003-10-15 23:30:11 +08:00
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
}
|
2001-07-06 00:21:36 +08:00
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
return image;
|
2001-07-05 23:34:26 +08:00
|
|
|
}
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
void
|
|
|
|
gimp_set_default_context (Gimp *gimp,
|
2004-08-11 22:00:08 +08:00
|
|
|
GimpContext *context)
|
2001-07-07 20:17:23 +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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2005-09-04 18:44:04 +08:00
|
|
|
g_return_if_fail (context == NULL || GIMP_IS_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
|
|
|
|
2005-09-04 18:44:04 +08:00
|
|
|
if (context != gimp->default_context)
|
|
|
|
{
|
|
|
|
if (gimp->default_context)
|
|
|
|
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
|
|
|
|
2005-09-04 18:44:04 +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
|
|
|
|
2005-09-04 18:44:04 +08:00
|
|
|
if (gimp->default_context)
|
|
|
|
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,
|
2004-08-11 22:00:08 +08:00
|
|
|
GimpContext *context)
|
2001-07-07 20:17:23 +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
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2005-09-04 18:44:04 +08:00
|
|
|
g_return_if_fail (context == NULL || GIMP_IS_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
|
|
|
|
2005-09-04 18:44:04 +08:00
|
|
|
if (context != gimp->user_context)
|
|
|
|
{
|
|
|
|
if (gimp->user_context)
|
|
|
|
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
|
|
|
|
2005-09-04 18:44:04 +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
|
|
|
|
2005-09-04 18:44:04 +08:00
|
|
|
if (gimp->user_context)
|
|
|
|
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;
|
|
|
|
}
|
2006-08-09 05:06:36 +08:00
|
|
|
|
2006-09-08 21:42:00 +08:00
|
|
|
GimpToolInfo *
|
|
|
|
gimp_get_tool_info (Gimp *gimp,
|
|
|
|
const gchar *tool_id)
|
|
|
|
{
|
|
|
|
gpointer info;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (tool_id != NULL, NULL);
|
|
|
|
|
|
|
|
info = gimp_container_get_child_by_name (gimp->tool_info_list, tool_id);
|
|
|
|
|
|
|
|
return (GimpToolInfo *) info;
|
|
|
|
}
|
|
|
|
|
2007-05-22 00:32:52 +08:00
|
|
|
/**
|
|
|
|
* gimp_message:
|
|
|
|
* @gimp: a pointer to the %Gimp object
|
|
|
|
* @handler: either a %GimpProgress or a %GtkWidget pointer
|
|
|
|
* @severity: severity of the message
|
|
|
|
* @format: printf-like format string
|
|
|
|
* @...: arguments to use with @format
|
|
|
|
*
|
|
|
|
* Present a message to the user. How exactly the message is displayed
|
|
|
|
* depends on the @severity, the @handler object and user preferences.
|
|
|
|
**/
|
2006-08-09 05:06:36 +08:00
|
|
|
void
|
2006-10-09 16:17:22 +08:00
|
|
|
gimp_message (Gimp *gimp,
|
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *format,
|
2006-08-09 05:06:36 +08:00
|
|
|
...)
|
|
|
|
{
|
2006-09-28 18:47:44 +08:00
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start (args, format);
|
|
|
|
|
2006-10-09 16:17:22 +08:00
|
|
|
gimp_message_valist (gimp, handler, severity, format, args);
|
2006-09-28 18:47:44 +08:00
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
2007-05-22 00:32:52 +08:00
|
|
|
/**
|
|
|
|
* gimp_message_valist:
|
|
|
|
* @gimp: a pointer to the %Gimp object
|
|
|
|
* @handler: either a %GimpProgress or a %GtkWidget pointer
|
|
|
|
* @severity: severity of the message
|
|
|
|
* @format: printf-like format string
|
|
|
|
* @args: arguments to use with @format
|
|
|
|
*
|
|
|
|
* See documentation for gimp_message().
|
|
|
|
**/
|
2006-09-28 18:47:44 +08:00
|
|
|
void
|
2006-10-09 16:17:22 +08:00
|
|
|
gimp_message_valist (Gimp *gimp,
|
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *format,
|
|
|
|
va_list args)
|
2006-09-28 18:47:44 +08:00
|
|
|
{
|
|
|
|
gchar *message;
|
2006-08-09 05:06:36 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2006-10-09 16:17:22 +08:00
|
|
|
g_return_if_fail (handler == NULL || G_IS_OBJECT (handler));
|
|
|
|
g_return_if_fail (format != NULL);
|
2006-08-09 05:06:36 +08:00
|
|
|
|
|
|
|
message = g_strdup_vprintf (format, args);
|
|
|
|
|
2006-10-09 16:17:22 +08:00
|
|
|
gimp_show_message (gimp, handler, severity, NULL, message);
|
2006-09-19 22:26:48 +08:00
|
|
|
|
|
|
|
g_free (message);
|
2006-08-09 05:06:36 +08:00
|
|
|
}
|
2008-01-22 19:28:48 +08:00
|
|
|
|
2008-11-04 20:33:09 +08:00
|
|
|
void
|
|
|
|
gimp_message_literal (Gimp *gimp,
|
2013-09-15 00:59:20 +08:00
|
|
|
GObject *handler,
|
|
|
|
GimpMessageSeverity severity,
|
|
|
|
const gchar *message)
|
2008-11-04 20:33:09 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (handler == NULL || G_IS_OBJECT (handler));
|
|
|
|
g_return_if_fail (message != NULL);
|
|
|
|
|
|
|
|
gimp_show_message (gimp, handler, severity, NULL, message);
|
|
|
|
}
|
|
|
|
|
2015-12-30 18:53:52 +08:00
|
|
|
void
|
|
|
|
gimp_filter_history_changed (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
g_signal_emit (gimp, gimp_signals[FILTER_HISTORY_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
2008-10-17 20:03:08 +08:00
|
|
|
void
|
2014-07-07 06:46:25 +08:00
|
|
|
gimp_image_opened (Gimp *gimp,
|
|
|
|
GFile *file)
|
2008-10-17 20:03:08 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2014-07-07 06:46:25 +08:00
|
|
|
g_return_if_fail (G_IS_FILE (file));
|
2008-10-17 20:03:08 +08:00
|
|
|
|
2014-07-07 06:46:25 +08:00
|
|
|
g_signal_emit (gimp, gimp_signals[IMAGE_OPENED], 0, file);
|
2008-10-17 20:03:08 +08:00
|
|
|
}
|
|
|
|
|
2014-07-11 04:32:09 +08:00
|
|
|
GFile *
|
|
|
|
gimp_get_temp_file (Gimp *gimp,
|
|
|
|
const gchar *extension)
|
2012-04-24 03:13:57 +08:00
|
|
|
{
|
|
|
|
static gint id = 0;
|
|
|
|
static gint pid;
|
|
|
|
gchar *basename;
|
2014-07-29 22:32:08 +08:00
|
|
|
GFile *dir;
|
2014-07-11 04:32:09 +08:00
|
|
|
GFile *file;
|
2012-04-24 03:13:57 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (id == 0)
|
|
|
|
pid = gimp_get_pid ();
|
|
|
|
|
|
|
|
if (extension)
|
|
|
|
basename = g_strdup_printf ("gimp-temp-%d%d.%s", pid, id++, extension);
|
|
|
|
else
|
|
|
|
basename = g_strdup_printf ("gimp-temp-%d%d", pid, id++);
|
|
|
|
|
2016-10-01 04:07:00 +08:00
|
|
|
dir = gimp_file_new_for_config_path (GIMP_GEGL_CONFIG (gimp->config)->temp_path,
|
|
|
|
NULL);
|
2014-07-29 22:32:08 +08:00
|
|
|
file = g_file_get_child (dir, basename);
|
|
|
|
g_free (basename);
|
|
|
|
g_object_unref (dir);
|
2014-07-11 04:32:09 +08:00
|
|
|
|
|
|
|
return file;
|
2012-04-24 03:13:57 +08:00
|
|
|
}
|