2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-12-17 05:34:05 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* GimpGuiConfig 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>
|
|
|
|
|
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-12-17 05:34:05 +08:00
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config-types.h"
|
|
|
|
|
2002-12-20 22:36:08 +08:00
|
|
|
#include "gimprc-blurbs.h"
|
2001-12-17 05:34:05 +08:00
|
|
|
#include "gimpguiconfig.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2003-01-26 04:29:42 +08:00
|
|
|
|
2001-12-17 05:34:05 +08:00
|
|
|
|
2008-06-13 04:14:44 +08:00
|
|
|
#define DEFAULT_HELP_BROWSER GIMP_HELP_BROWSER_GIMP
|
|
|
|
#define DEFAULT_THEME "Default"
|
|
|
|
|
|
|
|
#define DEFAULT_USER_MANUAL_ONLINE_URI \
|
|
|
|
"http://docs.gimp.org/" GIMP_APP_VERSION_STRING
|
2003-09-23 04:04:39 +08:00
|
|
|
|
|
|
|
#ifdef G_OS_WIN32
|
2008-06-13 04:14:44 +08:00
|
|
|
# define DEFAULT_WEB_BROWSER "not used on Windows"
|
2007-11-21 20:02:12 +08:00
|
|
|
#elif HAVE_CARBON
|
2008-06-13 04:14:44 +08:00
|
|
|
# define DEFAULT_WEB_BROWSER "open %s"
|
2003-09-23 04:04:39 +08:00
|
|
|
#else
|
2008-06-13 04:14:44 +08:00
|
|
|
# define DEFAULT_WEB_BROWSER "firefox %s"
|
2003-09-23 04:04:39 +08:00
|
|
|
#endif
|
2003-01-23 08:40:34 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
|
2001-12-17 05:34:05 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_DEFAULT_THRESHOLD,
|
2004-10-30 23:02:39 +08:00
|
|
|
PROP_MOVE_TOOL_CHANGES_ACTIVE,
|
2001-12-18 20:39:45 +08:00
|
|
|
PROP_TRUST_DIRTY_FLAG,
|
2001-12-17 09:01:34 +08:00
|
|
|
PROP_SAVE_DEVICE_STATUS,
|
|
|
|
PROP_SAVE_SESSION_INFO,
|
|
|
|
PROP_RESTORE_SESSION,
|
2005-04-12 05:17:59 +08:00
|
|
|
PROP_SAVE_TOOL_OPTIONS,
|
2006-03-11 00:40:09 +08:00
|
|
|
PROP_SHOW_TOOLTIPS,
|
2001-12-17 09:01:34 +08:00
|
|
|
PROP_TEAROFF_MENUS,
|
2003-04-01 15:47:04 +08:00
|
|
|
PROP_CAN_CHANGE_ACCELS,
|
2003-04-08 18:02:42 +08:00
|
|
|
PROP_SAVE_ACCELS,
|
|
|
|
PROP_RESTORE_ACCELS,
|
2004-07-28 06:17:30 +08:00
|
|
|
PROP_MENU_MNEMONICS,
|
2002-11-22 01:17:03 +08:00
|
|
|
PROP_LAST_OPENED_SIZE,
|
2001-12-17 09:01:34 +08:00
|
|
|
PROP_MAX_NEW_IMAGE_SIZE,
|
2004-06-01 04:30:52 +08:00
|
|
|
PROP_TOOLBOX_COLOR_AREA,
|
|
|
|
PROP_TOOLBOX_FOO_AREA,
|
|
|
|
PROP_TOOLBOX_IMAGE_AREA,
|
2008-08-28 22:30:47 +08:00
|
|
|
PROP_TOOLBOX_WILBER,
|
2001-12-17 09:01:34 +08:00
|
|
|
PROP_THEME_PATH,
|
2001-12-19 01:45:29 +08:00
|
|
|
PROP_THEME,
|
2002-05-06 03:17:41 +08:00
|
|
|
PROP_USE_HELP,
|
2004-10-05 00:21:52 +08:00
|
|
|
PROP_SHOW_HELP_BUTTON,
|
2004-03-17 21:59:42 +08:00
|
|
|
PROP_HELP_LOCALES,
|
2003-09-23 04:04:39 +08:00
|
|
|
PROP_HELP_BROWSER,
|
2003-11-21 04:36:55 +08:00
|
|
|
PROP_WEB_BROWSER,
|
2008-06-13 04:14:44 +08:00
|
|
|
PROP_USER_MANUAL_ONLINE,
|
|
|
|
PROP_USER_MANUAL_ONLINE_URI,
|
2004-01-17 07:18:23 +08:00
|
|
|
PROP_TOOLBOX_WINDOW_HINT,
|
2004-06-13 10:08:54 +08:00
|
|
|
PROP_DOCK_WINDOW_HINT,
|
2005-05-12 06:18:47 +08:00
|
|
|
PROP_TRANSIENT_DOCKS,
|
2008-05-27 01:47:28 +08:00
|
|
|
PROP_CURSOR_FORMAT
|
2001-12-17 05:34:05 +08:00
|
|
|
};
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
static void gimp_gui_config_finalize (GObject *object);
|
|
|
|
static void gimp_gui_config_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_gui_config_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
|
2006-05-15 17:46:31 +08:00
|
|
|
G_DEFINE_TYPE (GimpGuiConfig, gimp_gui_config, GIMP_TYPE_DISPLAY_CONFIG)
|
2001-12-17 05:34:05 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
#define parent_class gimp_gui_config_parent_class
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_gui_config_class_init (GimpGuiConfigClass *klass)
|
|
|
|
{
|
2005-12-11 03:24:36 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2005-04-08 01:10:05 +08:00
|
|
|
gchar *path;
|
2001-12-17 05:34:05 +08:00
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
object_class->finalize = gimp_gui_config_finalize;
|
2001-12-17 05:34:05 +08:00
|
|
|
object_class->set_property = gimp_gui_config_set_property;
|
|
|
|
object_class->get_property = gimp_gui_config_get_property;
|
|
|
|
|
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_THRESHOLD,
|
2002-11-28 23:19:19 +08:00
|
|
|
"default-threshold", DEFAULT_THRESHOLD_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
0, 255, 15,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-10-30 23:02:39 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MOVE_TOOL_CHANGES_ACTIVE,
|
|
|
|
"move-tool-changes-active",
|
|
|
|
MOVE_TOOL_CHANGES_ACTIVE_BLURB,
|
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-18 20:39:45 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TRUST_DIRTY_FLAG,
|
|
|
|
"trust-dirty-flag",
|
2002-11-28 23:19:19 +08:00
|
|
|
TRUST_DIRTY_FLAG_BLURB,
|
2008-08-15 04:12:54 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_DEVICE_STATUS,
|
|
|
|
"save-device-status",
|
2002-11-28 23:19:19 +08:00
|
|
|
SAVE_DEVICE_STATUS_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_SESSION_INFO,
|
|
|
|
"save-session-info",
|
2002-11-28 23:19:19 +08:00
|
|
|
SAVE_SESSION_INFO_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESTORE_SESSION,
|
2002-11-28 23:19:19 +08:00
|
|
|
"restore-session", RESTORE_SESSION_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2005-04-12 05:17:59 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_TOOL_OPTIONS,
|
|
|
|
"save-tool-options",
|
|
|
|
SAVE_TOOL_OPTIONS_BLURB,
|
2005-05-07 17:28:12 +08:00
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2006-03-11 00:40:09 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TOOLTIPS,
|
|
|
|
"show-tooltips", SHOW_TOOLTIPS_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
TRUE,
|
2007-11-09 19:17:00 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TEAROFF_MENUS,
|
2002-11-28 23:19:19 +08:00
|
|
|
"tearoff-menus", TEAROFF_MENUS_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2003-04-01 15:47:04 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CAN_CHANGE_ACCELS,
|
|
|
|
"can-change-accels", CAN_CHANGE_ACCELS_BLURB,
|
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2003-04-08 18:02:42 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_ACCELS,
|
|
|
|
"save-accels", SAVE_ACCELS_BLURB,
|
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2003-04-08 18:02:42 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESTORE_ACCELS,
|
|
|
|
"restore-accels", RESTORE_ACCELS_BLURB,
|
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-07-28 06:17:30 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MENU_MNEMONICS,
|
|
|
|
"menu-mnemonics", MENU_MNEMONICS_BLURB,
|
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2002-11-22 01:17:03 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LAST_OPENED_SIZE,
|
2002-11-28 23:19:19 +08:00
|
|
|
"last-opened-size", LAST_OPENED_SIZE_BLURB,
|
2003-09-23 22:05:03 +08:00
|
|
|
0, 1024, 10,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_MAX_NEW_IMAGE_SIZE,
|
2002-11-28 23:19:19 +08:00
|
|
|
"max-new-image-size",
|
|
|
|
MAX_NEW_IMAGE_SIZE_BLURB,
|
2007-02-28 05:13:49 +08:00
|
|
|
0, GIMP_MAX_MEMSIZE, 1 << 27, /* 128MB */
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_COLOR_AREA,
|
|
|
|
"toolbox-color-area",
|
|
|
|
TOOLBOX_COLOR_AREA_BLURB,
|
2007-05-17 07:56:51 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_FOO_AREA,
|
|
|
|
"toolbox-foo-area",
|
|
|
|
TOOLBOX_FOO_AREA_BLURB,
|
2006-02-18 18:46:31 +08:00
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_IMAGE_AREA,
|
|
|
|
"toolbox-image-area",
|
|
|
|
TOOLBOX_IMAGE_AREA_BLURB,
|
2004-10-31 23:41:17 +08:00
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2008-08-28 22:30:47 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_WILBER,
|
|
|
|
"toolbox-wilber",
|
|
|
|
TOOLBOX_WILBER_BLURB,
|
|
|
|
TRUE,
|
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2005-04-08 01:10:05 +08:00
|
|
|
path = gimp_config_build_data_path ("themes");
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
|
2002-11-28 23:19:19 +08:00
|
|
|
"theme-path", THEME_PATH_BLURB,
|
2006-04-12 20:49:29 +08:00
|
|
|
GIMP_CONFIG_PATH_DIR_LIST, path,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2005-04-08 01:10:05 +08:00
|
|
|
g_free (path);
|
2001-12-17 09:01:34 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_THEME,
|
2002-11-28 23:19:19 +08:00
|
|
|
"theme", THEME_BLURB,
|
2003-01-23 08:40:34 +08:00
|
|
|
DEFAULT_THEME,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-19 01:45:29 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP,
|
2002-11-28 23:19:19 +08:00
|
|
|
"use-help", USE_HELP_BLURB,
|
2002-11-21 03:09:40 +08:00
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-10-05 00:21:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_HELP_BUTTON,
|
|
|
|
"show-help-button", SHOW_HELP_BUTTON_BLURB,
|
|
|
|
TRUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-03-17 21:59:42 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_HELP_LOCALES,
|
|
|
|
"help-locales", HELP_LOCALES_BLURB,
|
2004-03-30 01:54:13 +08:00
|
|
|
"",
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2002-05-06 03:17:41 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HELP_BROWSER,
|
2002-11-28 23:19:19 +08:00
|
|
|
"help-browser", HELP_BROWSER_BLURB,
|
2002-05-06 03:17:41 +08:00
|
|
|
GIMP_TYPE_HELP_BROWSER_TYPE,
|
2008-06-13 04:14:44 +08:00
|
|
|
DEFAULT_HELP_BROWSER,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2003-09-23 04:04:39 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_WEB_BROWSER,
|
|
|
|
"web-browser", WEB_BROWSER_BLURB,
|
2005-01-26 07:44:05 +08:00
|
|
|
GIMP_CONFIG_PATH_FILE,
|
2003-09-23 04:04:39 +08:00
|
|
|
DEFAULT_WEB_BROWSER,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2008-06-13 04:14:44 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USER_MANUAL_ONLINE,
|
|
|
|
"user-manual-online",
|
|
|
|
USER_MANUAL_ONLINE_BLURB,
|
|
|
|
FALSE,
|
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
|
|
|
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_USER_MANUAL_ONLINE_URI,
|
|
|
|
"user-manual-online-uri",
|
|
|
|
USER_MANUAL_ONLINE_URI_BLURB,
|
|
|
|
DEFAULT_USER_MANUAL_ONLINE_URI,
|
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-01-17 07:18:23 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TOOLBOX_WINDOW_HINT,
|
|
|
|
"toolbox-window-hint",
|
|
|
|
TOOLBOX_WINDOW_HINT_BLURB,
|
|
|
|
GIMP_TYPE_WINDOW_HINT,
|
2008-03-20 22:44:44 +08:00
|
|
|
GIMP_WINDOW_HINT_UTILITY,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2004-01-17 07:18:23 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DOCK_WINDOW_HINT,
|
|
|
|
"dock-window-hint",
|
|
|
|
DOCK_WINDOW_HINT_BLURB,
|
|
|
|
GIMP_TYPE_WINDOW_HINT,
|
2008-03-20 22:44:44 +08:00
|
|
|
GIMP_WINDOW_HINT_UTILITY,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS |
|
2005-05-12 07:12:36 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2005-05-12 06:18:47 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TRANSIENT_DOCKS,
|
|
|
|
"transient-docks", TRANSIENT_DOCKS_BLURB,
|
|
|
|
FALSE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-06-13 10:08:54 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CURSOR_FORMAT,
|
|
|
|
"cursor-format", CURSOR_FORMAT_BLURB,
|
|
|
|
GIMP_TYPE_CURSOR_FORMAT,
|
|
|
|
GIMP_CURSOR_FORMAT_PIXBUF,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-12-17 05:34:05 +08:00
|
|
|
}
|
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
static void
|
|
|
|
gimp_gui_config_init (GimpGuiConfig *config)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
static void
|
|
|
|
gimp_gui_config_finalize (GObject *object)
|
|
|
|
{
|
2003-11-17 05:57:46 +08:00
|
|
|
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (object);
|
2003-09-23 04:04:39 +08:00
|
|
|
|
2002-02-08 20:35:38 +08:00
|
|
|
g_free (gui_config->theme_path);
|
|
|
|
g_free (gui_config->theme);
|
2004-03-17 21:59:42 +08:00
|
|
|
g_free (gui_config->help_locales);
|
2003-09-23 04:04:39 +08:00
|
|
|
g_free (gui_config->web_browser);
|
2008-06-13 04:14:44 +08:00
|
|
|
g_free (gui_config->user_manual_online_uri);
|
2002-02-08 20:35:38 +08:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2001-12-17 05:34:05 +08:00
|
|
|
static void
|
|
|
|
gimp_gui_config_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2003-11-17 05:57:46 +08:00
|
|
|
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (object);
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_DEFAULT_THRESHOLD:
|
|
|
|
gui_config->default_threshold = g_value_get_int (value);
|
|
|
|
break;
|
2004-10-30 23:02:39 +08:00
|
|
|
case PROP_MOVE_TOOL_CHANGES_ACTIVE:
|
|
|
|
gui_config->move_tool_changes_active = g_value_get_boolean (value);
|
|
|
|
break;
|
2001-12-18 20:39:45 +08:00
|
|
|
case PROP_TRUST_DIRTY_FLAG:
|
|
|
|
gui_config->trust_dirty_flag = g_value_get_boolean (value);
|
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_SAVE_DEVICE_STATUS:
|
|
|
|
gui_config->save_device_status = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_SAVE_SESSION_INFO:
|
|
|
|
gui_config->save_session_info = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_RESTORE_SESSION:
|
|
|
|
gui_config->restore_session = g_value_get_boolean (value);
|
|
|
|
break;
|
2005-04-12 05:17:59 +08:00
|
|
|
case PROP_SAVE_TOOL_OPTIONS:
|
|
|
|
gui_config->save_tool_options = g_value_get_boolean (value);
|
|
|
|
break;
|
2006-03-11 00:40:09 +08:00
|
|
|
case PROP_SHOW_TOOLTIPS:
|
|
|
|
gui_config->show_tooltips = g_value_get_boolean (value);
|
2001-12-18 20:39:45 +08:00
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_TEAROFF_MENUS:
|
|
|
|
gui_config->tearoff_menus = g_value_get_boolean (value);
|
|
|
|
break;
|
2003-04-01 15:47:04 +08:00
|
|
|
case PROP_CAN_CHANGE_ACCELS:
|
|
|
|
gui_config->can_change_accels = g_value_get_boolean (value);
|
|
|
|
break;
|
2003-04-08 18:02:42 +08:00
|
|
|
case PROP_SAVE_ACCELS:
|
|
|
|
gui_config->save_accels = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_RESTORE_ACCELS:
|
|
|
|
gui_config->restore_accels = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-07-28 06:17:30 +08:00
|
|
|
case PROP_MENU_MNEMONICS:
|
|
|
|
gui_config->menu_mnemonics = g_value_get_boolean (value);
|
|
|
|
break;
|
2002-11-22 01:17:03 +08:00
|
|
|
case PROP_LAST_OPENED_SIZE:
|
|
|
|
gui_config->last_opened_size = g_value_get_int (value);
|
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_MAX_NEW_IMAGE_SIZE:
|
2003-11-14 21:41:16 +08:00
|
|
|
gui_config->max_new_image_size = g_value_get_uint64 (value);
|
2001-12-17 09:01:34 +08:00
|
|
|
break;
|
2004-06-01 04:30:52 +08:00
|
|
|
case PROP_TOOLBOX_COLOR_AREA:
|
|
|
|
gui_config->toolbox_color_area = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_TOOLBOX_FOO_AREA:
|
|
|
|
gui_config->toolbox_foo_area = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_TOOLBOX_IMAGE_AREA:
|
|
|
|
gui_config->toolbox_image_area = g_value_get_boolean (value);
|
|
|
|
break;
|
2008-08-28 22:30:47 +08:00
|
|
|
case PROP_TOOLBOX_WILBER:
|
|
|
|
gui_config->toolbox_wilber = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_THEME_PATH:
|
2001-12-17 09:01:34 +08:00
|
|
|
g_free (gui_config->theme_path);
|
|
|
|
gui_config->theme_path = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_THEME:
|
|
|
|
g_free (gui_config->theme);
|
|
|
|
gui_config->theme = g_value_dup_string (value);
|
|
|
|
break;
|
2001-12-19 01:45:29 +08:00
|
|
|
case PROP_USE_HELP:
|
|
|
|
gui_config->use_help = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-10-05 00:21:52 +08:00
|
|
|
case PROP_SHOW_HELP_BUTTON:
|
|
|
|
gui_config->show_help_button = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-03-17 21:59:42 +08:00
|
|
|
case PROP_HELP_LOCALES:
|
|
|
|
g_free (gui_config->help_locales);
|
|
|
|
gui_config->help_locales = g_value_dup_string (value);
|
|
|
|
break;
|
2002-05-06 03:17:41 +08:00
|
|
|
case PROP_HELP_BROWSER:
|
|
|
|
gui_config->help_browser = g_value_get_enum (value);
|
|
|
|
break;
|
2003-09-23 04:04:39 +08:00
|
|
|
case PROP_WEB_BROWSER:
|
|
|
|
g_free (gui_config->web_browser);
|
|
|
|
gui_config->web_browser = g_value_dup_string (value);
|
|
|
|
break;
|
2008-06-13 04:14:44 +08:00
|
|
|
case PROP_USER_MANUAL_ONLINE:
|
|
|
|
gui_config->user_manual_online = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_USER_MANUAL_ONLINE_URI:
|
|
|
|
g_free (gui_config->user_manual_online_uri);
|
|
|
|
gui_config->user_manual_online_uri = g_value_dup_string (value);
|
|
|
|
break;
|
2004-01-17 07:18:23 +08:00
|
|
|
case PROP_TOOLBOX_WINDOW_HINT:
|
|
|
|
gui_config->toolbox_window_hint = g_value_get_enum (value);
|
2003-11-21 04:36:55 +08:00
|
|
|
break;
|
2004-01-17 07:18:23 +08:00
|
|
|
case PROP_DOCK_WINDOW_HINT:
|
|
|
|
gui_config->dock_window_hint = g_value_get_enum (value);
|
2003-11-21 04:36:55 +08:00
|
|
|
break;
|
2005-05-12 06:18:47 +08:00
|
|
|
case PROP_TRANSIENT_DOCKS:
|
|
|
|
gui_config->transient_docks = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-06-13 10:08:54 +08:00
|
|
|
case PROP_CURSOR_FORMAT:
|
|
|
|
gui_config->cursor_format = g_value_get_enum (value);
|
|
|
|
break;
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_gui_config_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2003-11-17 05:57:46 +08:00
|
|
|
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (object);
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_DEFAULT_THRESHOLD:
|
|
|
|
g_value_set_int (value, gui_config->default_threshold);
|
|
|
|
break;
|
2004-10-30 23:02:39 +08:00
|
|
|
case PROP_MOVE_TOOL_CHANGES_ACTIVE:
|
|
|
|
g_value_set_boolean (value, gui_config->move_tool_changes_active);
|
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_TRUST_DIRTY_FLAG:
|
|
|
|
g_value_set_boolean (value, gui_config->trust_dirty_flag);
|
|
|
|
break;
|
|
|
|
case PROP_SAVE_DEVICE_STATUS:
|
|
|
|
g_value_set_boolean (value, gui_config->save_device_status);
|
|
|
|
break;
|
|
|
|
case PROP_SAVE_SESSION_INFO:
|
|
|
|
g_value_set_boolean (value, gui_config->save_session_info);
|
|
|
|
break;
|
|
|
|
case PROP_RESTORE_SESSION:
|
|
|
|
g_value_set_boolean (value, gui_config->restore_session);
|
|
|
|
break;
|
2005-04-12 05:17:59 +08:00
|
|
|
case PROP_SAVE_TOOL_OPTIONS:
|
|
|
|
g_value_set_boolean (value, gui_config->save_tool_options);
|
|
|
|
break;
|
2006-03-11 00:40:09 +08:00
|
|
|
case PROP_SHOW_TOOLTIPS:
|
|
|
|
g_value_set_boolean (value, gui_config->show_tooltips);
|
2001-12-18 20:39:45 +08:00
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_TEAROFF_MENUS:
|
|
|
|
g_value_set_boolean (value, gui_config->tearoff_menus);
|
|
|
|
break;
|
2003-04-01 15:47:04 +08:00
|
|
|
case PROP_CAN_CHANGE_ACCELS:
|
|
|
|
g_value_set_boolean (value, gui_config->can_change_accels);
|
|
|
|
break;
|
2003-04-08 18:02:42 +08:00
|
|
|
case PROP_SAVE_ACCELS:
|
|
|
|
g_value_set_boolean (value, gui_config->save_accels);
|
|
|
|
break;
|
|
|
|
case PROP_RESTORE_ACCELS:
|
|
|
|
g_value_set_boolean (value, gui_config->restore_accels);
|
|
|
|
break;
|
2004-07-28 06:17:30 +08:00
|
|
|
case PROP_MENU_MNEMONICS:
|
|
|
|
g_value_set_boolean (value, gui_config->menu_mnemonics);
|
|
|
|
break;
|
2002-11-22 01:17:03 +08:00
|
|
|
case PROP_LAST_OPENED_SIZE:
|
|
|
|
g_value_set_int (value, gui_config->last_opened_size);
|
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_MAX_NEW_IMAGE_SIZE:
|
2003-11-14 21:41:16 +08:00
|
|
|
g_value_set_uint64 (value, gui_config->max_new_image_size);
|
2001-12-17 09:01:34 +08:00
|
|
|
break;
|
2004-06-01 04:30:52 +08:00
|
|
|
case PROP_TOOLBOX_COLOR_AREA:
|
|
|
|
g_value_set_boolean (value, gui_config->toolbox_color_area);
|
|
|
|
break;
|
|
|
|
case PROP_TOOLBOX_FOO_AREA:
|
|
|
|
g_value_set_boolean (value, gui_config->toolbox_foo_area);
|
|
|
|
break;
|
|
|
|
case PROP_TOOLBOX_IMAGE_AREA:
|
|
|
|
g_value_set_boolean (value, gui_config->toolbox_image_area);
|
|
|
|
break;
|
2008-08-28 22:30:47 +08:00
|
|
|
case PROP_TOOLBOX_WILBER:
|
|
|
|
g_value_set_boolean (value, gui_config->toolbox_wilber);
|
|
|
|
break;
|
2001-12-17 09:01:34 +08:00
|
|
|
case PROP_THEME_PATH:
|
|
|
|
g_value_set_string (value, gui_config->theme_path);
|
|
|
|
break;
|
|
|
|
case PROP_THEME:
|
|
|
|
g_value_set_string (value, gui_config->theme);
|
|
|
|
break;
|
2001-12-19 01:45:29 +08:00
|
|
|
case PROP_USE_HELP:
|
|
|
|
g_value_set_boolean (value, gui_config->use_help);
|
|
|
|
break;
|
2004-10-05 00:21:52 +08:00
|
|
|
case PROP_SHOW_HELP_BUTTON:
|
|
|
|
g_value_set_boolean (value, gui_config->show_help_button);
|
|
|
|
break;
|
2004-03-17 21:59:42 +08:00
|
|
|
case PROP_HELP_LOCALES:
|
|
|
|
g_value_set_string (value, gui_config->help_locales);
|
|
|
|
break;
|
2002-05-06 03:17:41 +08:00
|
|
|
case PROP_HELP_BROWSER:
|
|
|
|
g_value_set_enum (value, gui_config->help_browser);
|
|
|
|
break;
|
2003-09-23 04:04:39 +08:00
|
|
|
case PROP_WEB_BROWSER:
|
|
|
|
g_value_set_string (value, gui_config->web_browser);
|
|
|
|
break;
|
2008-06-13 04:14:44 +08:00
|
|
|
case PROP_USER_MANUAL_ONLINE:
|
|
|
|
g_value_set_boolean (value, gui_config->user_manual_online);
|
|
|
|
break;
|
|
|
|
case PROP_USER_MANUAL_ONLINE_URI:
|
|
|
|
g_value_set_string (value, gui_config->user_manual_online_uri);
|
|
|
|
break;
|
2004-01-17 07:18:23 +08:00
|
|
|
case PROP_TOOLBOX_WINDOW_HINT:
|
|
|
|
g_value_set_enum (value, gui_config->toolbox_window_hint);
|
2003-11-21 04:36:55 +08:00
|
|
|
break;
|
2004-01-17 07:18:23 +08:00
|
|
|
case PROP_DOCK_WINDOW_HINT:
|
|
|
|
g_value_set_enum (value, gui_config->dock_window_hint);
|
2003-11-21 04:36:55 +08:00
|
|
|
break;
|
2005-05-12 06:18:47 +08:00
|
|
|
case PROP_TRANSIENT_DOCKS:
|
|
|
|
g_value_set_boolean (value, gui_config->transient_docks);
|
|
|
|
break;
|
2004-06-13 10:08:54 +08:00
|
|
|
case PROP_CURSOR_FORMAT:
|
|
|
|
g_value_set_enum (value, gui_config->cursor_format);
|
|
|
|
break;
|
2001-12-17 05:34:05 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|