2001-12-11 04:43:51 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* GimpCoreConfig class
|
|
|
|
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
2001-12-17 00:33:18 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config-types.h"
|
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
#include "gimpconfig-params.h"
|
|
|
|
#include "gimpconfig-types.h"
|
2001-12-18 20:39:45 +08:00
|
|
|
#include "gimpconfig-utils.h"
|
2001-12-11 04:43:51 +08:00
|
|
|
|
2002-12-20 22:36:08 +08:00
|
|
|
#include "gimprc-blurbs.h"
|
2001-12-11 04:43:51 +08:00
|
|
|
#include "gimpcoreconfig.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2003-01-26 04:29:42 +08:00
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
|
|
|
|
static void gimp_core_config_class_init (GimpCoreConfigClass *klass);
|
2002-02-08 20:35:38 +08:00
|
|
|
static void gimp_core_config_finalize (GObject *object);
|
2001-12-11 04:43:51 +08:00
|
|
|
static void gimp_core_config_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_core_config_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
2003-01-23 08:40:34 +08:00
|
|
|
|
|
|
|
#define DEFAULT_BRUSH "Circle (11)"
|
|
|
|
#define DEFAULT_PATTERN "Pine"
|
|
|
|
#define DEFAULT_PALETTE "Default"
|
|
|
|
#define DEFAULT_GRADIENT "FG to BG (RGB)"
|
|
|
|
#define DEFAULT_COMMENT "Created with The GIMP"
|
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2002-02-12 10:31:45 +08:00
|
|
|
PROP_INTERPOLATION_TYPE,
|
2001-12-11 04:43:51 +08:00
|
|
|
PROP_PLUG_IN_PATH,
|
2002-02-08 20:35:38 +08:00
|
|
|
PROP_TOOL_PLUG_IN_PATH,
|
2001-12-11 04:43:51 +08:00
|
|
|
PROP_MODULE_PATH,
|
2002-11-12 11:34:11 +08:00
|
|
|
PROP_ENVIRON_PATH,
|
2001-12-11 04:43:51 +08:00
|
|
|
PROP_BRUSH_PATH,
|
|
|
|
PROP_PATTERN_PATH,
|
|
|
|
PROP_PALETTE_PATH,
|
2001-12-11 23:58:07 +08:00
|
|
|
PROP_GRADIENT_PATH,
|
|
|
|
PROP_DEFAULT_BRUSH,
|
|
|
|
PROP_DEFAULT_PATTERN,
|
|
|
|
PROP_DEFAULT_PALETTE,
|
|
|
|
PROP_DEFAULT_GRADIENT,
|
|
|
|
PROP_DEFAULT_COMMENT,
|
2001-12-13 09:55:37 +08:00
|
|
|
PROP_DEFAULT_IMAGE_TYPE,
|
|
|
|
PROP_DEFAULT_IMAGE_WIDTH,
|
2001-12-17 00:33:18 +08:00
|
|
|
PROP_DEFAULT_IMAGE_HEIGHT,
|
|
|
|
PROP_DEFAULT_UNIT,
|
|
|
|
PROP_DEFAULT_XRESOLUTION,
|
|
|
|
PROP_DEFAULT_YRESOLUTION,
|
|
|
|
PROP_DEFAULT_RESOLUTION_UNIT,
|
|
|
|
PROP_UNDO_LEVELS,
|
2003-02-13 01:11:34 +08:00
|
|
|
PROP_UNDO_SIZE,
|
2001-12-17 00:33:18 +08:00
|
|
|
PROP_PLUGINRC_PATH,
|
2001-12-17 02:31:30 +08:00
|
|
|
PROP_MODULE_LOAD_INHIBIT,
|
2003-03-07 00:47:34 +08:00
|
|
|
PROP_LAYER_PREVIEWS,
|
|
|
|
PROP_LAYER_PREVIEW_SIZE,
|
2002-04-30 03:41:45 +08:00
|
|
|
PROP_THUMBNAIL_SIZE,
|
2001-12-18 20:39:45 +08:00
|
|
|
PROP_GAMMA_CORRECTION,
|
|
|
|
PROP_INSTALL_COLORMAP,
|
2002-02-08 20:35:38 +08:00
|
|
|
PROP_MIN_COLORS
|
2001-12-11 04:43:51 +08:00
|
|
|
};
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
static GObjectClass *parent_class = NULL;
|
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
|
|
|
|
GType
|
|
|
|
gimp_core_config_get_type (void)
|
|
|
|
{
|
|
|
|
static GType config_type = 0;
|
|
|
|
|
|
|
|
if (! config_type)
|
|
|
|
{
|
|
|
|
static const GTypeInfo config_info =
|
|
|
|
{
|
|
|
|
sizeof (GimpCoreConfigClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gimp_core_config_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpCoreConfig),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
NULL /* instance_init */
|
|
|
|
};
|
|
|
|
|
|
|
|
config_type = g_type_register_static (GIMP_TYPE_BASE_CONFIG,
|
|
|
|
"GimpCoreConfig",
|
|
|
|
&config_info, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return config_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_core_config_class_init (GimpCoreConfigClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class;
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
object_class->finalize = gimp_core_config_finalize;
|
2001-12-11 04:43:51 +08:00
|
|
|
object_class->set_property = gimp_core_config_set_property;
|
|
|
|
object_class->get_property = gimp_core_config_get_property;
|
|
|
|
|
2002-02-12 10:31:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_INTERPOLATION_TYPE,
|
|
|
|
"interpolation-type",
|
2002-11-28 23:19:19 +08:00
|
|
|
INTERPOLATION_TYPE_BLURB,
|
2002-02-12 10:31:45 +08:00
|
|
|
GIMP_TYPE_INTERPOLATION_TYPE,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_INTERPOLATION_LINEAR,
|
|
|
|
0);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"plug-in-path", PLUG_IN_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_plug_in_path ("plug-ins"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2002-02-08 10:27:49 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TOOL_PLUG_IN_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"tool-plug-in-path", TOOL_PLUG_IN_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_plug_in_path ("tool-plug-ins"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_MODULE_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"module-path", MODULE_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_plug_in_path ("modules"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2002-11-12 11:34:11 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ENVIRON_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"environ-path", ENVIRON_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_plug_in_path ("environ"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"brush-path", BRUSH_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_data_path ("brushes"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"pattern-path", PATTERN_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_data_path ("patterns"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PALETTE_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"palette-path", PALETTE_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_data_path ("palettes"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"gradient-path", GRADIENT_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_DIR_LIST,
|
2002-11-21 03:09:40 +08:00
|
|
|
gimp_config_build_data_path ("gradients"),
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 23:58:07 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_BRUSH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-brush", DEFAULT_BRUSH_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_BRUSH,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-11 23:58:07 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PATTERN,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-pattern", DEFAULT_PATTERN_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_PATTERN,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2002-11-28 23:19:19 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PALETTE,
|
|
|
|
"default-palette", DEFAULT_PALETTE_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_PALETTE,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-11 23:58:07 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_GRADIENT,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-gradient", DEFAULT_GRADIENT_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_GRADIENT,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-11 23:58:07 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_COMMENT,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-comment", DEFAULT_COMMENT_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_COMMENT,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-11 23:58:07 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DEFAULT_IMAGE_TYPE,
|
|
|
|
"default-image-type",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_IMAGE_TYPE_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_IMAGE_BASE_TYPE, GIMP_RGB,
|
|
|
|
0);
|
2001-12-13 09:55:37 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_IMAGE_WIDTH,
|
|
|
|
"default-image-width",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_IMAGE_WIDTH_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
1, 0x8000, 256,
|
|
|
|
0);
|
2001-12-13 09:55:37 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_IMAGE_HEIGHT,
|
|
|
|
"default-image-height",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_IMAGE_HEIGHT_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
1, 0x8000, 256,
|
|
|
|
0);
|
2001-12-17 00:33:18 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_DEFAULT_UNIT,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-unit", DEFAULT_UNIT_BLURB,
|
2003-01-31 17:22:42 +08:00
|
|
|
FALSE, GIMP_UNIT_INCH,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-17 00:33:18 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DEFAULT_XRESOLUTION,
|
|
|
|
"default-xresolution",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_XRESOLUTION_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION,
|
|
|
|
72.0,
|
|
|
|
0);
|
2001-12-17 00:33:18 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DEFAULT_YRESOLUTION,
|
|
|
|
"default-yresolution",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_YRESOLUTION_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION,
|
|
|
|
72.0,
|
|
|
|
0);
|
2001-12-17 00:33:18 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_DEFAULT_RESOLUTION_UNIT,
|
|
|
|
"default-resolution-unit",
|
2002-11-28 23:19:19 +08:00
|
|
|
DEFAULT_RESOLUTION_UNIT_BLURB,
|
2003-01-31 17:22:42 +08:00
|
|
|
FALSE, GIMP_UNIT_INCH,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2001-12-17 00:33:18 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_UNDO_LEVELS,
|
2002-11-28 23:19:19 +08:00
|
|
|
"undo-levels", UNDO_LEVELS_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
0, G_MAXINT, 5,
|
|
|
|
GIMP_PARAM_CONFIRM);
|
2003-02-13 01:11:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_UNDO_SIZE,
|
|
|
|
"undo-size", UNDO_SIZE_BLURB,
|
|
|
|
0, G_MAXULONG, 1 << 20,
|
|
|
|
GIMP_PARAM_CONFIRM);
|
2002-11-28 23:19:19 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
|
|
|
|
PROP_PLUGINRC_PATH,
|
|
|
|
"pluginrc-path", PLUGINRC_PATH_BLURB,
|
2003-01-11 09:31:22 +08:00
|
|
|
GIMP_PARAM_PATH_FILE,
|
2002-12-30 02:58:24 +08:00
|
|
|
"${gimp_dir}" G_DIR_SEPARATOR_S "pluginrc",
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-17 02:31:30 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_MODULE_LOAD_INHIBIT,
|
|
|
|
"module-load-inhibit",
|
2002-11-28 23:19:19 +08:00
|
|
|
MODULE_LOAD_INHIBIT_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
NULL,
|
|
|
|
0);
|
2003-03-07 00:47:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_LAYER_PREVIEWS,
|
|
|
|
"layer-previews", LAYER_PREVIEWS_BLURB,
|
|
|
|
TRUE,
|
|
|
|
0);
|
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_LAYER_PREVIEW_SIZE,
|
|
|
|
"layer-preview-size", LAYER_PREVIEW_SIZE_BLURB,
|
2002-04-30 03:41:45 +08:00
|
|
|
GIMP_TYPE_PREVIEW_SIZE,
|
2003-03-13 19:37:51 +08:00
|
|
|
GIMP_PREVIEW_SIZE_MEDIUM,
|
2002-11-21 03:09:40 +08:00
|
|
|
0);
|
2002-04-30 03:41:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_THUMBNAIL_SIZE,
|
2002-11-28 23:19:19 +08:00
|
|
|
"thumbnail-size", THUMBNAIL_SIZE_BLURB,
|
2002-04-30 03:41:45 +08:00
|
|
|
GIMP_TYPE_THUMBNAIL_SIZE,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_THUMBNAIL_SIZE_NORMAL,
|
|
|
|
0);
|
2001-12-18 20:39:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_GAMMA_CORRECTION,
|
|
|
|
"gamma-correction",
|
2002-11-28 23:19:19 +08:00
|
|
|
GAMMA_CORRECTION_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
0.0, 100.0, 1.0,
|
|
|
|
0);
|
2001-12-18 20:39:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INSTALL_COLORMAP,
|
2002-11-28 23:19:19 +08:00
|
|
|
"install-colormap", INSTALL_COLORMAP_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-18 20:39:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MIN_COLORS,
|
2002-11-28 23:19:19 +08:00
|
|
|
"min-colors", MIN_COLORS_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
27, 256, 144,
|
|
|
|
GIMP_PARAM_RESTART);
|
2001-12-11 04:43:51 +08:00
|
|
|
}
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
static void
|
|
|
|
gimp_core_config_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GimpCoreConfig *core_config;
|
|
|
|
|
|
|
|
core_config = GIMP_CORE_CONFIG (object);
|
|
|
|
|
|
|
|
g_free (core_config->plug_in_path);
|
|
|
|
g_free (core_config->tool_plug_in_path);
|
|
|
|
g_free (core_config->module_path);
|
2002-11-12 11:34:11 +08:00
|
|
|
g_free (core_config->environ_path);
|
2002-02-08 20:35:38 +08:00
|
|
|
g_free (core_config->brush_path);
|
|
|
|
g_free (core_config->pattern_path);
|
|
|
|
g_free (core_config->palette_path);
|
|
|
|
g_free (core_config->gradient_path);
|
|
|
|
g_free (core_config->default_brush);
|
|
|
|
g_free (core_config->default_pattern);
|
|
|
|
g_free (core_config->default_palette);
|
|
|
|
g_free (core_config->default_gradient);
|
|
|
|
g_free (core_config->default_comment);
|
|
|
|
g_free (core_config->plug_in_rc_path);
|
|
|
|
g_free (core_config->module_load_inhibit);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
static void
|
|
|
|
gimp_core_config_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpCoreConfig *core_config;
|
|
|
|
|
|
|
|
core_config = GIMP_CORE_CONFIG (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2002-02-12 10:31:45 +08:00
|
|
|
case PROP_INTERPOLATION_TYPE:
|
|
|
|
core_config->interpolation_type = g_value_get_enum (value);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_PLUG_IN_PATH:
|
|
|
|
g_free (core_config->plug_in_path);
|
|
|
|
core_config->plug_in_path = g_value_dup_string (value);
|
|
|
|
break;
|
2002-02-08 10:27:49 +08:00
|
|
|
case PROP_TOOL_PLUG_IN_PATH:
|
|
|
|
g_free (core_config->tool_plug_in_path);
|
|
|
|
core_config->tool_plug_in_path = g_value_dup_string (value);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_MODULE_PATH:
|
|
|
|
g_free (core_config->module_path);
|
|
|
|
core_config->module_path = g_value_dup_string (value);
|
|
|
|
break;
|
2002-11-12 11:34:11 +08:00
|
|
|
case PROP_ENVIRON_PATH:
|
|
|
|
g_free (core_config->environ_path);
|
|
|
|
core_config->environ_path = g_value_dup_string (value);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_BRUSH_PATH:
|
|
|
|
g_free (core_config->brush_path);
|
|
|
|
core_config->brush_path = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_PATTERN_PATH:
|
|
|
|
g_free (core_config->pattern_path);
|
|
|
|
core_config->pattern_path = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_PALETTE_PATH:
|
|
|
|
g_free (core_config->palette_path);
|
|
|
|
core_config->palette_path = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_GRADIENT_PATH:
|
|
|
|
g_free (core_config->gradient_path);
|
|
|
|
core_config->gradient_path = g_value_dup_string (value);
|
|
|
|
break;
|
2001-12-11 23:58:07 +08:00
|
|
|
case PROP_DEFAULT_BRUSH:
|
|
|
|
g_free (core_config->default_brush);
|
|
|
|
core_config->default_brush = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_PATTERN:
|
|
|
|
g_free (core_config->default_pattern);
|
|
|
|
core_config->default_pattern = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_PALETTE:
|
|
|
|
g_free (core_config->default_palette);
|
|
|
|
core_config->default_palette = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_GRADIENT:
|
|
|
|
g_free (core_config->default_gradient);
|
|
|
|
core_config->default_gradient = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_COMMENT:
|
|
|
|
g_free (core_config->default_comment);
|
|
|
|
core_config->default_comment = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_IMAGE_TYPE:
|
|
|
|
core_config->default_image_type = g_value_get_enum (value);
|
|
|
|
break;
|
2001-12-13 09:55:37 +08:00
|
|
|
case PROP_DEFAULT_IMAGE_WIDTH:
|
|
|
|
core_config->default_image_width = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_IMAGE_HEIGHT:
|
|
|
|
core_config->default_image_height = g_value_get_int (value);
|
|
|
|
break;
|
2001-12-17 00:33:18 +08:00
|
|
|
case PROP_DEFAULT_UNIT:
|
|
|
|
core_config->default_unit = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_XRESOLUTION:
|
|
|
|
core_config->default_xresolution = g_value_get_double (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_YRESOLUTION:
|
|
|
|
core_config->default_yresolution = g_value_get_double (value);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_RESOLUTION_UNIT:
|
|
|
|
core_config->default_resolution_unit = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
case PROP_UNDO_LEVELS:
|
|
|
|
core_config->levels_of_undo = g_value_get_int (value);
|
|
|
|
break;
|
2003-02-13 01:11:34 +08:00
|
|
|
case PROP_UNDO_SIZE:
|
|
|
|
core_config->undo_size = g_value_get_ulong (value);
|
|
|
|
break;
|
2001-12-17 00:33:18 +08:00
|
|
|
case PROP_PLUGINRC_PATH:
|
|
|
|
g_free (core_config->plug_in_rc_path);
|
|
|
|
core_config->plug_in_rc_path = g_value_dup_string (value);
|
|
|
|
break;
|
2001-12-17 02:31:30 +08:00
|
|
|
case PROP_MODULE_LOAD_INHIBIT:
|
|
|
|
g_free (core_config->module_load_inhibit);
|
|
|
|
core_config->module_load_inhibit = g_value_dup_string (value);
|
|
|
|
break;
|
2003-03-07 00:47:34 +08:00
|
|
|
case PROP_LAYER_PREVIEWS:
|
|
|
|
core_config->layer_previews = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_LAYER_PREVIEW_SIZE:
|
|
|
|
core_config->layer_preview_size = g_value_get_enum (value);
|
2001-12-18 20:39:45 +08:00
|
|
|
break;
|
2002-04-30 03:41:45 +08:00
|
|
|
case PROP_THUMBNAIL_SIZE:
|
|
|
|
core_config->thumbnail_size = g_value_get_enum (value);
|
2001-12-17 02:31:30 +08:00
|
|
|
break;
|
2001-12-18 20:39:45 +08:00
|
|
|
case PROP_GAMMA_CORRECTION:
|
|
|
|
core_config->gamma_val = g_value_get_double (value);
|
|
|
|
break;
|
|
|
|
case PROP_INSTALL_COLORMAP:
|
|
|
|
core_config->install_cmap = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_MIN_COLORS:
|
|
|
|
core_config->min_colors = g_value_get_int (value);
|
|
|
|
break;
|
2001-12-17 02:31:30 +08:00
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_core_config_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpCoreConfig *core_config;
|
|
|
|
|
|
|
|
core_config = GIMP_CORE_CONFIG (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2002-02-12 10:31:45 +08:00
|
|
|
case PROP_INTERPOLATION_TYPE:
|
|
|
|
g_value_set_enum (value, core_config->interpolation_type);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_PLUG_IN_PATH:
|
|
|
|
g_value_set_string (value, core_config->plug_in_path);
|
|
|
|
break;
|
2002-02-08 10:27:49 +08:00
|
|
|
case PROP_TOOL_PLUG_IN_PATH:
|
|
|
|
g_value_set_string (value, core_config->tool_plug_in_path);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_MODULE_PATH:
|
|
|
|
g_value_set_string (value, core_config->module_path);
|
|
|
|
break;
|
2002-11-12 11:34:11 +08:00
|
|
|
case PROP_ENVIRON_PATH:
|
|
|
|
g_value_set_string (value, core_config->environ_path);
|
|
|
|
break;
|
2001-12-11 04:43:51 +08:00
|
|
|
case PROP_BRUSH_PATH:
|
|
|
|
g_value_set_string (value, core_config->brush_path);
|
|
|
|
break;
|
|
|
|
case PROP_PATTERN_PATH:
|
|
|
|
g_value_set_string (value, core_config->pattern_path);
|
|
|
|
break;
|
|
|
|
case PROP_PALETTE_PATH:
|
|
|
|
g_value_set_string (value, core_config->palette_path);
|
|
|
|
break;
|
|
|
|
case PROP_GRADIENT_PATH:
|
|
|
|
g_value_set_string (value, core_config->gradient_path);
|
|
|
|
break;
|
2001-12-11 23:58:07 +08:00
|
|
|
case PROP_DEFAULT_BRUSH:
|
|
|
|
g_value_set_string (value, core_config->default_brush);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_PATTERN:
|
|
|
|
g_value_set_string (value, core_config->default_pattern);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_PALETTE:
|
|
|
|
g_value_set_string (value, core_config->default_palette);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_GRADIENT:
|
|
|
|
g_value_set_string (value, core_config->default_gradient);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_COMMENT:
|
|
|
|
g_value_set_string (value, core_config->default_comment);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_IMAGE_TYPE:
|
|
|
|
g_value_set_enum (value, core_config->default_image_type);
|
|
|
|
break;
|
2001-12-13 09:55:37 +08:00
|
|
|
case PROP_DEFAULT_IMAGE_WIDTH:
|
|
|
|
g_value_set_int (value, core_config->default_image_width);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_IMAGE_HEIGHT:
|
|
|
|
g_value_set_int (value, core_config->default_image_height);
|
|
|
|
break;
|
2001-12-17 00:33:18 +08:00
|
|
|
case PROP_DEFAULT_UNIT:
|
|
|
|
g_value_set_int (value, core_config->default_unit);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_XRESOLUTION:
|
|
|
|
g_value_set_double (value, core_config->default_xresolution);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_YRESOLUTION:
|
|
|
|
g_value_set_double (value, core_config->default_yresolution);
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT_RESOLUTION_UNIT:
|
|
|
|
g_value_set_int (value, core_config->default_resolution_unit);
|
|
|
|
break;
|
|
|
|
case PROP_UNDO_LEVELS:
|
|
|
|
g_value_set_int (value, core_config->levels_of_undo);
|
|
|
|
break;
|
2003-02-13 01:11:34 +08:00
|
|
|
case PROP_UNDO_SIZE:
|
|
|
|
g_value_set_ulong (value, core_config->undo_size);
|
|
|
|
break;
|
2001-12-17 00:33:18 +08:00
|
|
|
case PROP_PLUGINRC_PATH:
|
|
|
|
g_value_set_string (value, core_config->plug_in_rc_path);
|
|
|
|
break;
|
2001-12-17 02:31:30 +08:00
|
|
|
case PROP_MODULE_LOAD_INHIBIT:
|
|
|
|
g_value_set_string (value, core_config->module_load_inhibit);
|
|
|
|
break;
|
2003-03-07 00:47:34 +08:00
|
|
|
case PROP_LAYER_PREVIEWS:
|
|
|
|
g_value_set_boolean (value, core_config->layer_previews);
|
|
|
|
break;
|
|
|
|
case PROP_LAYER_PREVIEW_SIZE:
|
|
|
|
g_value_set_enum (value, core_config->layer_preview_size);
|
2001-12-18 20:39:45 +08:00
|
|
|
break;
|
2002-04-30 03:41:45 +08:00
|
|
|
case PROP_THUMBNAIL_SIZE:
|
|
|
|
g_value_set_enum (value, core_config->thumbnail_size);
|
2001-12-17 02:31:30 +08:00
|
|
|
break;
|
2001-12-18 20:39:45 +08:00
|
|
|
case PROP_GAMMA_CORRECTION:
|
|
|
|
g_value_set_double (value, core_config->gamma_val);
|
|
|
|
break;
|
|
|
|
case PROP_INSTALL_COLORMAP:
|
|
|
|
g_value_set_boolean (value, core_config->install_cmap);
|
|
|
|
break;
|
|
|
|
case PROP_MIN_COLORS:
|
|
|
|
g_value_set_int (value, core_config->min_colors);
|
|
|
|
break;
|
2001-12-17 02:31:30 +08:00
|
|
|
|
2001-12-11 04:43:51 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|