app/config/Makefile.am removed ... ... and readded under this name.

2002-11-28  Sven Neumann  <sven@gimp.org>

	* app/config/Makefile.am
	* app/config/gimpconfig-params-blurbs.h: removed ...
	* app/config/gimpconfig-blurbs.h: ... and readded under this name.
	Defined all missing blurb definitions to NULL.

	* app/config/gimpconfig-params.h: added a blurb parameter to all
	GIMP_CONFIG_INSTALL_PROP_* macros.

	* app/config/gimpbaseconfig.c
	* app/config/gimpcoreconfig.c
	* app/config/gimpdisplayconfig.c
	* app/config/gimpguiconfig.c: register blurbs with the GimpRc
	properties.

	* app/config/gimpconfig-serialize.c: do proper line-breaking for
	comments.

	* app/core/gimpcontext.c
	* app/widgets/gimpdeviceinfo.c: register NULL blurbs here.
This commit is contained in:
Sven Neumann 2002-11-28 15:19:19 +00:00 committed by Sven Neumann
parent ca06598e7f
commit b92d38ce68
14 changed files with 339 additions and 170 deletions

View File

@ -1,3 +1,25 @@
2002-11-28 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am
* app/config/gimpconfig-params-blurbs.h: removed ...
* app/config/gimpconfig-blurbs.h: ... and readded under this name.
Defined all missing blurb definitions to NULL.
* app/config/gimpconfig-params.h: added a blurb parameter to all
GIMP_CONFIG_INSTALL_PROP_* macros.
* app/config/gimpbaseconfig.c
* app/config/gimpcoreconfig.c
* app/config/gimpdisplayconfig.c
* app/config/gimpguiconfig.c: register blurbs with the GimpRc
properties.
* app/config/gimpconfig-serialize.c: do proper line-breaking for
comments.
* app/core/gimpcontext.c
* app/widgets/gimpdeviceinfo.c: register NULL blurbs here.
2002-11-28 Michael Natterer <mitch@gimp.org>
* app/config/Makefile.am

View File

@ -6,11 +6,11 @@ libappconfig_a_SOURCES = \
config-types.h \
gimpconfig.c \
gimpconfig.h \
gimpconfig-blurbs.h \
gimpconfig-deserialize.c \
gimpconfig-deserialize.h \
gimpconfig-params.c \
gimpconfig-params.h \
gimpconfig-params-blurbs.h \
gimpconfig-serialize.c \
gimpconfig-serialize.h \
gimpconfig-substitute.c \

View File

@ -27,6 +27,7 @@
#include "config-types.h"
#include "gimpconfig-blurbs.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
@ -100,24 +101,24 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
object_class->get_property = gimp_base_config_get_property;
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TEMP_PATH,
"temp-path",
"temp-path", TEMP_PATH_BLURB,
g_build_filename (gimp_directory (),
"tmp", NULL),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_SWAP_PATH,
"swap-path",
"swap-path", SWAP_PATH_BLURB,
g_strdup (gimp_directory ()),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_STINGY_MEMORY_USE,
"stingy-memory-use",
"stingy-memory-use", STINGY_MEMORY_USE_BLURB,
FALSE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_UINT (object_class, PROP_NUM_PROCESSORS,
"num-processors",
"num-processors", NUM_PROCESSORS_BLURB,
1, 30, 1,
0);
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
"tile-cache-size",
"tile-cache-size", TILE_CACHE_SIZE_BLURB,
0, G_MAXULONG, 1 << 25,
GIMP_PARAM_CONFIRM);
}

View File

@ -1,3 +1,7 @@
#ifndef __GIMP_CONFIG_BLURBS_H__
#define __GIMP_CONFIG_BLURBS_H__
#define TEMP_PATH_BLURB \
"Set the temporary storage directory. Files will appear here " \
"during the course of running the gimp. Most files will disappear " \
@ -16,32 +20,30 @@
"be desirable to put your swap file in \"/tmp\"."
#define BRUSH_PATH_BLURB \
"Set the brush search path. This is a colon-separated list of " \
"directories to be searched for brushes."
"Set the brush search path."
#define PATTERN_PATH_BLURB \
"Set the pattern search path. This is a colon-separated list of " \
"directories to be searched for patterns."
"Set the pattern search path."
#define PLUG_IN_PATH_BLURB \
"Set the plug-in search path. This is a colon-separated list of " \
"directories which will be scanned at startup to register new plugins."
"Set the plug-in search path."
#define PALETTE_PATH_BLURB \
"Set the palette search path. This is a colon-separated list of " \
"directories to be searched for palettes."
"Set the palette search path."
#define GRADIENT_PATH_BLURB \
"Set the gradient search path. This is a colon-separated list of " \
"directories to be searched for gradients."
"Set the gradient search path."
#define MODULE_PATH_BLURB \
"Set the module search path. This is a colon-separated list of " \
"directories which will be scanned at startup for modules to be loaded."
"Set the module search path."
#define DEFAULT_BRUSH_BLURB \
"Specify a default brush. This doesn't actually do anything any more, " \
"since the default brush is set as part of the saved device status."
"Specify a default brush. The brush is searched for in the " \
"specified brush path."
#define DEFAULT_GRADIENT_BLURB \
"Specify a default gradient. The gradient is searched for in the " \
"specified gradient path."
#define DEFAULT_PATTERN_BLURB \
"Specify a default pattern. The pattern is searched for in the " \
@ -51,39 +53,26 @@
"Specify a default palette. The palette is searched for in the " \
"specified palette path."
#define DEGAULT_GRADIENT_BLURB \
"Specify a default gradient. The gradient is searched for in the " \
"specified gradient path."
#define GAMMA_CORRECTION_BLURB \
"Set the gamma correction value for the display. 1.0 corresponds to no " \
"Set the gamma correction value for the display. 1.0 corresponds to no " \
"gamma correction. For most displays, gamma correction should be set " \
"to between 2.0 and 2.6 Run the utility \"gamma_correct\" to determine " \
"appropriate values for your display. XXX is this valid info? One " \
"important item to keep in mind: Many images that you might get from " \
"outside sources will in all likelihood already be gamma-corrected. In " \
"these cases, the image will look washed-out if the gimp has " \
"gamma-correction turned on. If you are going to work with images of " \
"this sort, turn gamma correction off by setting the value to 1.0."
"to between 2.0 and 2.6. One important thing to keep in mind: Many images "\
"that you might get from outside sources will in all likelihood already "\
"be gamma-corrected. In these cases, the image will look washed-out if "\
"the gimp has gamma-correction turned on. If you are going to work with "\
"images of this sort, turn gamma correction off by setting the value to 1.0."
#define INSTALL_COLORMAP_BLURB \
"Install a private colormap by default - not actually used anymore since " \
"the introduction of GdkRgb."
"Install a private colormap; might be useful on pseudocolor visuals."
#define TILE_CACHE_SIZE_BLURB \
"The tile cache is used to make sure the gimp doesn't thrash " \
"tiles between memory and disk. Setting this value higher will " \
"cause the gimp to use less swap space, but will also cause " \
"the gimp to use more memory. Conversely, a smaller cache size " \
"causes the gimp to use more swap space and less memory. " \
"Note: the gimp will still run even if `tile-cache-size' is " \
"set to 0. The actual size can contain a suffix of 'm', 'M', " \
"'k', 'K', 'b' or 'B', which makes the gimp interpret the " \
"size as being specified in megabytes, kilobytes and bytes " \
"respectively. If no suffix is specified the size defaults to " \
"being specified in kilobytes."
"causes the gimp to use more swap space and less memory."
#define MARCHING_ANTS_SPEED \
#define MARCHING_ANTS_SPEED_BLURB \
"Speed of marching ants in the selection outline. This value is in " \
"milliseconds (less time indicates faster marching)."
@ -94,12 +83,10 @@
"Set the number of operations kept on the undo stack."
#define TRANSPARENCY_TYPE_BLURB \
"Set the manner in which transparency is displayed in images. " \
"Transparency type can be one of 0 - Light Checks, 1 - Mid-Tone Checks, " \
"2 - Dark Checks, 3 - White Only, 4 - Gray Only, or 5 - Black Only."
"Set the manner in which transparency is displayed in images."
#define TRANSPARENCY_SIZE_BLURB \
"Check size can be one of 0 - Small, 1 - Medium, or 2 - Large"
"Sets the size of the checkerboard used to display transparency."
#define PERFECT_MOUSE_BLURB \
"If set to true, the X server is queried for the mouse's current " \
@ -138,26 +125,21 @@
"However, they require overhead that you may want to do without."
#define PREVIEW_SIZE_BLURB \
"Set the layer preview size."
"Set the default preview size."
#define SHOW_RULERS_BLURB \
"Set the ruler visibility. The default behavior is for rulers to be on. " \
"This can also be toggled with the View->Toggle Rulers command or " \
"shift+control+r."
"Set the ruler visibility. This can also be toggled with the "\
"View->Toggle Rulers command or Shift+Control+R."
#define SHOW_STATUSBAR_BLURB \
"Controlling statusbar visibility. The default behavior is to show the " \
"statusbar. This can also be toggled with the View->Toggle Statusbar " \
"command or shift+control+s."
"Controlling statusbar visibility. This can also be toggled with "\
"the View->Toggle Statusbar command or Shift+Control+S."
#define INTERPOLATION_MODE_BLURB \
"Set the level of interpolation. If set, this option enables cubic " \
"interpolation when scaling or transforming. By default, GIMP uses " \
"linear interpolation, which is faster, but has poorer quality."
#define INTERPOLATION_TYPE_BLURB \
"Set the level of interpolation used for scaling and other transformations."
#define CONFIRM_ON_CLOSE_BLURB \
"Ask for confirmation before closing an image without saving. This is " \
"the default."
"Ask for confirmation before closing an image without saving."
#define SAVE_SESSION_INFO_BLURB \
"Remember the positions and sizes of the main dialogs and asks your " \
@ -177,18 +159,21 @@
#define SHOW_TOOL_TIPS_BLURB \
"Set to display tooltips."
#define DEFAULT_IMAGE_SIZE_BLURB \
"Set the default image size in the File/New dialog."
#define DEFAULT_IMAGE_WIDTH_BLURB \
"Set the default image width in the File/New dialog."
#define DEFAULT_IMAGE_HEIGHT_BLURB \
"Set the default image height in the File/New dialog."
#define DEFAULT_IMAGE_TYPE_BLURB \
"Set the default image type in the File/New dialog."
#define DEFAULT_UNIT_BLURB \
"Set the default units for new images and for the File/New dialog. " \
"Set the default unit for new images and for the File/New dialog. " \
"This units will be used for coordinate display when not in dot-for-dot " \
"mode. The default units can be one of inches , millimeters, points or " \
"mode. The default unit can be one of inches , millimeters, points or " \
"picas or the identifier of one of the units defined in your user units " \
"database. The default is inches."
"database."
#define DEFAULT_XRESOLUTION_BLURB \
"Set the default horizontal resolution for new images and for the " \
@ -198,7 +183,7 @@
"Set the default vertical resolution for new images and for the " \
"File/New dialog. This value is always in dpi (dots per inch)."
#define DEFAULT_RESOLUTION_UNIT \
#define DEFAULT_RESOLUTION_UNIT_BLURB \
"Set the units for the display of the default resolution in the " \
"File/New dialog. The default resolution units can be one of inches, " \
"millimeters, points or picas or the identifier of one of the units " \
@ -231,10 +216,8 @@
"%z zoom factor as a percentage\n" \
"%s source scale factor\n" \
"%d destination scale factor\n" \
"%Dx expands to x if the image is dirty, the empty string " \
"otherwise. The x can be any character, eg %D*.\n" \
"%Cx expands to x if the image is clean, the empty string " \
"otherwise. The x can be any character, eg %Co.\n" \
"%Dx expands to x if the image is dirty, the empty string otherwise\n" \
"%Cx expands to x if the image is clean, the empty string otherwise\n" \
"%m memory used by the image\n" \
"%l the number of layers\n" \
"%L the name of the active layer/channel\n" \
@ -243,11 +226,34 @@
"%h image height in pixels\n" \
"%H image height in real-world units\n" \
"%u unit symbol\n" \
"%U unit abbreviation\n" \
"The default title format string is \"%f-%p.%i (%t)\"."
"%U unit abbreviation\n"
#define IMAGE_STATUS_FORMAT_BLURB \
"Set the text to appear in image window status bars. See image-title-format " \
"for the list of possible % sequences.\n" \
"\n" \
"The default status format string is \"%f-%p.%i (%t)\"."
"Set the text to appear in image window status bars. See image-title-format " \
"for the list of possible % sequences."
#define TOOL_PLUG_IN_PATH_BLURB NULL
#define ENVIRON_PATH_BLURB NULL
#define PLUGINRC_PATH_BLURB NULL
#define MONITOR_RES_FROM_GDK_BLURB NULL
#define THEME_PATH_BLURB NULL
#define DEFAULT_COMMENT_BLURB NULL
#define DEFAULT_DOT_FOR_DOT_BLURB NULL
#define MODULE_LOAD_INHIBIT_BLURB NULL
#define INFO_WINDOW_PER_DISPLAY_BLURB NULL
#define TRUST_DIRTY_FLAG_BLURB NULL
#define RESTORE_SESSION_BLURB NULL
#define TEAROFF_MENUS_BLURB NULL
#define THEME_BLURB NULL
#define USE_HELP_BLURB NULL
#define THUMBNAIL_SIZE_BLURB NULL
#define MIN_COLORS_BLURB NULL
#define CURSOR_MODE_BLURB NULL
#define NAVIGATION_PREVIEW_SIZE_BLURB NULL
#define CANVAS_PADDING_MODE_BLURB NULL
#define CANVAS_PADDING_COLOR_BLURB NULL
#define HELP_BROWSER_BLURB NULL
#define MAX_NEW_IMAGE_SIZE_BLURB NULL
#endif /* __GIMP_CONFIG_BLURBS_H__ */

View File

@ -46,7 +46,7 @@ main (int argc,
rc = g_object_new (GIMP_TYPE_RC, NULL);
g_print ("# Dump of the GIMP default configuration\n");
g_print ("# Dump of the GIMP default configuration\n\n");
gimp_config_serialize_properties (rc, 1, 0);

View File

@ -86,59 +86,70 @@ GParamSpec * gimp_param_spec_unit (const gchar *name,
/* some convenience macros to install object properties */
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_boolean (name, NULL, NULL,\
g_param_spec_boolean (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_COLOR(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_COLOR(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_color (name, NULL, NULL,\
gimp_param_spec_color (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_DOUBLE(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_DOUBLE(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_double (name, NULL, NULL,\
g_param_spec_double (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id, name, enum_type, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id,\
name, blurb, enum_type, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_enum (name, NULL, NULL,\
g_param_spec_enum (name, NULL, blurb,\
enum_type, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_int (name, NULL, NULL,\
g_param_spec_int (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_memsize (name, NULL, NULL,\
gimp_param_spec_memsize (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_OBJECT(class, id, name, object_type, flags)\
#define GIMP_CONFIG_INSTALL_PROP_OBJECT(class, id,\
name, blurb, object_type, flags)\
g_object_class_install_property (class, id,\
g_param_spec_object (name, NULL, NULL,\
g_param_spec_object (name, NULL, blurb,\
object_type,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_path (name, NULL, NULL,\
gimp_param_spec_path (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_string (name, NULL, NULL,\
g_param_spec_string (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_uint (name, NULL, NULL,\
g_param_spec_uint (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_UNIT(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_UNIT(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_unit (name, NULL, NULL,\
gimp_param_spec_unit (name, NULL, blurb,\
FALSE, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))

View File

@ -47,6 +47,8 @@ static gboolean gimp_config_serialize_property (GObject *object,
GParamSpec *param_spec,
GString *str,
gboolean escaped);
static void gimp_config_serialize_comment (GString *str,
const gchar *comment);
static void serialize_unknown_token (const gchar *key,
const gchar *value,
gpointer data);
@ -98,7 +100,7 @@ gimp_config_serialize_properties (GObject *object,
g_string_assign (str, "");
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
g_string_append_printf (str, "# %s\n", blurb);
gimp_config_serialize_comment (str, blurb);
gimp_config_string_indent (str, indent_level);
@ -106,7 +108,7 @@ gimp_config_serialize_properties (GObject *object,
if (gimp_config_serialize_property (object, prop_spec, str, TRUE))
{
g_string_append (str, ")");
g_string_append (str, ")\n");
property_written = TRUE;
if (write (fd, str->str, str->len) == -1)
@ -179,6 +181,9 @@ gimp_config_serialize_changed_properties (GObject *new,
else
g_string_assign (str, "");
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
gimp_config_serialize_comment (str, blurb);
gimp_config_string_indent (str, indent_level);
g_string_append_printf (str, "(%s ", prop_spec->name);
@ -437,6 +442,41 @@ gimp_config_serialize_property (GObject *object,
return retval;
}
static void
gimp_config_serialize_comment (GString *str,
const gchar *comment)
{
const gchar *s;
gint i, len, space;
len = strlen (comment);
while (len > 0)
{
for (s = comment, i = 0, space = 0;
*s != '\n' && (i <= 76 || space == 0) && i < len;
s++, i++)
{
if (g_ascii_isspace (*s))
space = i;
}
if (i > 76 && space && *s != '\n')
i = space;
g_string_append_len (str, "# ", 2);
g_string_append_len (str, comment, i);
g_string_append_c (str, '\n');
i++;
comment += i;
len -= i;
}
g_string_append_printf (str, "#\n");
}
static void
serialize_unknown_token (const gchar *key,
const gchar *value,

View File

@ -27,6 +27,7 @@
#include "config-types.h"
#include "gimpconfig-blurbs.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
#include "gimpconfig-utils.h"
@ -125,124 +126,134 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_INTERPOLATION_TYPE,
"interpolation-type",
INTERPOLATION_TYPE_BLURB,
GIMP_TYPE_INTERPOLATION_TYPE,
GIMP_INTERPOLATION_LINEAR,
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
"plug-in-path",
"plug-in-path", PLUG_IN_PATH_BLURB,
gimp_config_build_plug_in_path ("plug-ins"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TOOL_PLUG_IN_PATH,
"tool-plug-in-path",
"tool-plug-in-path", TOOL_PLUG_IN_PATH_BLURB,
gimp_config_build_plug_in_path ("tool-plug-ins"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_MODULE_PATH,
"module-path",
"module-path", MODULE_PATH_BLURB,
gimp_config_build_plug_in_path ("modules"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ENVIRON_PATH,
"environ-path",
"environ-path", ENVIRON_PATH_BLURB,
gimp_config_build_plug_in_path ("environ"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH,
"brush-path",
"brush-path", BRUSH_PATH_BLURB,
gimp_config_build_data_path ("brushes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH,
"pattern-path",
"pattern-path", PATTERN_PATH_BLURB,
gimp_config_build_data_path ("patterns"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PALETTE_PATH,
"palette-path",
"palette-path", PALETTE_PATH_BLURB,
gimp_config_build_data_path ("palettes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH,
"gradient-path",
"gradient-path", GRADIENT_PATH_BLURB,
gimp_config_build_data_path ("gradients"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_BRUSH,
"default-brush",
"default-brush", DEFAULT_BRUSH_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PATTERN,
"default-pattern",
"default-pattern", DEFAULT_PATTERN_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PATTERN,
"default-palette",
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PALETTE,
"default-palette", DEFAULT_PALETTE_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_GRADIENT,
"default-gradient",
"default-gradient", DEFAULT_GRADIENT_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_COMMENT,
"default-comment",
"default-comment", DEFAULT_COMMENT_BLURB,
"Created with The GIMP",
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DEFAULT_IMAGE_TYPE,
"default-image-type",
DEFAULT_IMAGE_TYPE_BLURB,
GIMP_TYPE_IMAGE_BASE_TYPE, GIMP_RGB,
0);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_IMAGE_WIDTH,
"default-image-width",
DEFAULT_IMAGE_WIDTH_BLURB,
1, 0x8000, 256,
0);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_IMAGE_HEIGHT,
"default-image-height",
DEFAULT_IMAGE_HEIGHT_BLURB,
1, 0x8000, 256,
0);
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_DEFAULT_UNIT,
"default-unit",
"default-unit", DEFAULT_UNIT_BLURB,
GIMP_UNIT_INCH,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DEFAULT_XRESOLUTION,
"default-xresolution",
DEFAULT_XRESOLUTION_BLURB,
GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION,
72.0,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DEFAULT_YRESOLUTION,
"default-yresolution",
DEFAULT_YRESOLUTION_BLURB,
GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION,
72.0,
0);
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_DEFAULT_RESOLUTION_UNIT,
"default-resolution-unit",
DEFAULT_RESOLUTION_UNIT_BLURB,
GIMP_UNIT_INCH,
0);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_UNDO_LEVELS,
"undo-levels",
"undo-levels", UNDO_LEVELS_BLURB,
0, G_MAXINT, 5,
GIMP_PARAM_CONFIRM);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUGINRC_PATH,
"pluginrc-path",
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_PLUGINRC_PATH,
"pluginrc-path", PLUGINRC_PATH_BLURB,
g_build_filename (gimp_directory (),
"pluginrc", NULL),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_MODULE_LOAD_INHIBIT,
"module-load-inhibit",
MODULE_LOAD_INHIBIT_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PREVIEW_SIZE,
"preview-size",
"preview-size", PREVIEW_SIZE_BLURB,
GIMP_TYPE_PREVIEW_SIZE,
GIMP_PREVIEW_SIZE_SMALL,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_THUMBNAIL_SIZE,
"thumbnail-size",
"thumbnail-size", THUMBNAIL_SIZE_BLURB,
GIMP_TYPE_THUMBNAIL_SIZE,
GIMP_THUMBNAIL_SIZE_NORMAL,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_GAMMA_CORRECTION,
"gamma-correction",
GAMMA_CORRECTION_BLURB,
0.0, 100.0, 1.0,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INSTALL_COLORMAP,
"install-colormap",
"install-colormap", INSTALL_COLORMAP_BLURB,
FALSE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MIN_COLORS,
"min-colors",
"min-colors", MIN_COLORS_BLURB,
27, 256, 144,
GIMP_PARAM_RESTART);
}

View File

@ -28,6 +28,7 @@
#include "config-types.h"
#include "gimpconfig-blurbs.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
#include "gimpconfig-utils.h"
@ -123,81 +124,93 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MARCHING_ANTS_SPEED,
"marching-ants-speed",
MARCHING_ANTS_SPEED_BLURB,
50, G_MAXINT, 300,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_COLORMAP_CYCLING,
"colormap-cycling",
"colormap-cycling", COLORMAP_CYCLING_BLURB,
FALSE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESIZE_WINDOWS_ON_ZOOM,
"resize-windows-on-zoom",
RESIZE_WINDOWS_ON_ZOOM_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESIZE_WINDOWS_ON_RESIZE,
"resize-windows-on-resize",
RESIZE_WINDOWS_ON_RESIZE_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_DOT_FOR_DOT,
"default-dot-for-dot",
DEFAULT_DOT_FOR_DOT_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PERFECT_MOUSE,
"perfect-mouse",
"perfect-mouse", PERFECT_MOUSE_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CURSOR_MODE,
"cursor-mode",
"cursor-mode", CURSOR_MODE_BLURB,
GIMP_TYPE_CURSOR_MODE,
GIMP_CURSOR_MODE_TOOL_ICON,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CURSOR_UPDATING,
"cursor-updating",
"cursor-updating", CURSOR_UPDATING_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
"image-title-format",
IMAGE_TITLE_FORMAT_BLURB,
DEFAULT_IMAGE_TITLE_FORMAT,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_STATUS_FORMAT,
"image-status-format",
IMAGE_STATUS_FORMAT_BLURB,
DEFAULT_IMAGE_STATUS_FORMAT,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
"show-rulers",
"show-rulers", SHOW_RULERS_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
"show-statusbar",
"show-statusbar", SHOW_STATUSBAR_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CONFIRM_ON_CLOSE,
"confirm-on-close",
"confirm-on-close", CONFIRM_ON_CLOSE_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_MONITOR_XRESOLUTION,
"monitor-xresolution",
MONITOR_XRESOLUTION_BLURB,
GIMP_MIN_RESOLUTION, G_MAXDOUBLE, 72.0,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_MONITOR_YRESOLUTION,
"monitor-yresolution",
MONITOR_YRESOLUTION_BLURB,
GIMP_MIN_RESOLUTION, G_MAXDOUBLE, 72.0,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MONITOR_RES_FROM_GDK,
"monitor-resolution-from-windowing-system",
MONITOR_RES_FROM_GDK_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_NAV_PREVIEW_SIZE,
"navigation-preview-size",
NAVIGATION_PREVIEW_SIZE_BLURB,
GIMP_TYPE_PREVIEW_SIZE,
GIMP_PREVIEW_SIZE_MEDIUM,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CANVAS_PADDING_MODE,
"canvas-padding-mode",
CANVAS_PADDING_MODE_BLURB,
GIMP_TYPE_DISPLAY_PADDING_MODE,
GIMP_DISPLAY_PADDING_MODE_DEFAULT,
0);
GIMP_CONFIG_INSTALL_PROP_COLOR (object_class, PROP_CANVAS_PADDING_COLOR,
"canvas-padding-color",
CANVAS_PADDING_COLOR_BLURB,
&white,
0);
}

View File

@ -27,6 +27,7 @@
#include "config-types.h"
#include "gimpconfig-blurbs.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
#include "gimpconfig-utils.h"
@ -112,71 +113,76 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
object_class->get_property = gimp_gui_config_get_property;
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TRANSPARENCY_SIZE,
"transparency-size",
"transparency-size", TRANSPARENCY_SIZE_BLURB,
GIMP_TYPE_CHECK_SIZE, GIMP_MEDIUM_CHECKS,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TRANSPARENCY_TYPE,
"transparency-type",
"transparency-type", TRANSPARENCY_TYPE_BLURB,
GIMP_TYPE_CHECK_TYPE, GIMP_GRAY_CHECKS,
0);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_THRESHOLD,
"default-threshold",
"default-threshold", DEFAULT_THRESHOLD_BLURB,
0, 255, 15,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INFO_WINDOW_PER_DISPLAY,
"info-window-per-display",
INFO_WINDOW_PER_DISPLAY_BLURB,
FALSE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TRUST_DIRTY_FLAG,
"trust-dirty-flag",
TRUST_DIRTY_FLAG_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_DEVICE_STATUS,
"save-device-status",
SAVE_DEVICE_STATUS_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_SESSION_INFO,
"save-session-info",
SAVE_SESSION_INFO_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RESTORE_SESSION,
"restore-session",
"restore-session", RESTORE_SESSION_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TIPS,
"show-tips",
"show-tips", SHOW_TIPS_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TOOL_TIPS,
"show-tool-tips",
"show-tool-tips", SHOW_TOOL_TIPS_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TEAROFF_MENUS,
"tearoff-menus",
"tearoff-menus", TEAROFF_MENUS_BLURB,
TRUE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LAST_OPENED_SIZE,
"last-opened-size",
"last-opened-size", LAST_OPENED_SIZE_BLURB,
0, 1024, 4,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_MAX_NEW_IMAGE_SIZE,
"max-new-image-size",
0, G_MAXULONG, 1 << 25,
"max-new-image-size",
MAX_NEW_IMAGE_SIZE_BLURB,
0, G_MAXULONG, 1 << 25,
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
"theme-path",
"theme-path", THEME_PATH_BLURB,
gimp_config_build_data_path ("themes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_THEME,
"theme",
"theme", THEME_BLURB,
NULL,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP,
"use-help",
"use-help", USE_HELP_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HELP_BROWSER,
"help-browser",
"help-browser", HELP_BROWSER_BLURB,
GIMP_TYPE_HELP_BROWSER_TYPE,
GIMP_HELP_BROWSER_GIMP,
0);

View File

@ -597,22 +597,25 @@ gimp_context_class_init (GimpContextClass *klass)
G_PARAM_READWRITE));
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_TOOL,
gimp_context_prop_names[TOOL_CHANGED],
gimp_context_prop_names[TOOL_CHANGED], NULL,
GIMP_TYPE_TOOL_INFO,
0);
GIMP_CONFIG_INSTALL_PROP_COLOR (object_class, PROP_FOREGROUND,
gimp_context_prop_names[FOREGROUND_CHANGED],
NULL,
&black,
0);
GIMP_CONFIG_INSTALL_PROP_COLOR (object_class, PROP_BACKGROUND,
gimp_context_prop_names[BACKGROUND_CHANGED],
NULL,
&white,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_OPACITY,
gimp_context_prop_names[OPACITY_CHANGED],
NULL,
GIMP_OPACITY_TRANSPARENT,
GIMP_OPACITY_OPAQUE,
GIMP_OPACITY_OPAQUE,
@ -620,27 +623,32 @@ gimp_context_class_init (GimpContextClass *klass)
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PAINT_MODE,
gimp_context_prop_names[PAINT_MODE_CHANGED],
NULL,
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
0);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_BRUSH,
gimp_context_prop_names[BRUSH_CHANGED],
NULL,
GIMP_TYPE_BRUSH,
0);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_PATTERN,
gimp_context_prop_names[PATTERN_CHANGED],
NULL,
GIMP_TYPE_PATTERN,
0);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_GRADIENT,
gimp_context_prop_names[GRADIENT_CHANGED],
NULL,
GIMP_TYPE_GRADIENT,
0);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_PALETTE,
gimp_context_prop_names[PALETTE_CHANGED],
NULL,
GIMP_TYPE_PALETTE,
0);

View File

@ -128,7 +128,7 @@ gimp_device_info_class_init (GimpDeviceInfoClass *klass)
object_class->set_property = gimp_device_info_set_property;
object_class->get_property = gimp_device_info_get_property;
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MODE, "mode",
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MODE, "mode", NULL,
GDK_TYPE_INPUT_MODE,
GDK_MODE_DISABLED,
0);

View File

@ -86,59 +86,70 @@ GParamSpec * gimp_param_spec_unit (const gchar *name,
/* some convenience macros to install object properties */
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_boolean (name, NULL, NULL,\
g_param_spec_boolean (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_COLOR(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_COLOR(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_color (name, NULL, NULL,\
gimp_param_spec_color (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_DOUBLE(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_DOUBLE(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_double (name, NULL, NULL,\
g_param_spec_double (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id, name, enum_type, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id,\
name, blurb, enum_type, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_enum (name, NULL, NULL,\
g_param_spec_enum (name, NULL, blurb,\
enum_type, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_int (name, NULL, NULL,\
g_param_spec_int (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_memsize (name, NULL, NULL,\
gimp_param_spec_memsize (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_OBJECT(class, id, name, object_type, flags)\
#define GIMP_CONFIG_INSTALL_PROP_OBJECT(class, id,\
name, blurb, object_type, flags)\
g_object_class_install_property (class, id,\
g_param_spec_object (name, NULL, NULL,\
g_param_spec_object (name, NULL, blurb,\
object_type,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_path (name, NULL, NULL,\
gimp_param_spec_path (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_string (name, NULL, NULL,\
g_param_spec_string (name, NULL, blurb,\
default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id, name, min, max, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id,\
name, blurb, min, max, default, flags)\
g_object_class_install_property (class, id,\
g_param_spec_uint (name, NULL, NULL,\
g_param_spec_uint (name, NULL, blurb,\
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_UNIT(class, id, name, default, flags)\
#define GIMP_CONFIG_INSTALL_PROP_UNIT(class, id,\
name, blurb, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_unit (name, NULL, NULL,\
gimp_param_spec_unit (name, NULL, blurb,\
FALSE, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))

View File

@ -47,6 +47,8 @@ static gboolean gimp_config_serialize_property (GObject *object,
GParamSpec *param_spec,
GString *str,
gboolean escaped);
static void gimp_config_serialize_comment (GString *str,
const gchar *comment);
static void serialize_unknown_token (const gchar *key,
const gchar *value,
gpointer data);
@ -98,7 +100,7 @@ gimp_config_serialize_properties (GObject *object,
g_string_assign (str, "");
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
g_string_append_printf (str, "# %s\n", blurb);
gimp_config_serialize_comment (str, blurb);
gimp_config_string_indent (str, indent_level);
@ -106,7 +108,7 @@ gimp_config_serialize_properties (GObject *object,
if (gimp_config_serialize_property (object, prop_spec, str, TRUE))
{
g_string_append (str, ")");
g_string_append (str, ")\n");
property_written = TRUE;
if (write (fd, str->str, str->len) == -1)
@ -179,6 +181,9 @@ gimp_config_serialize_changed_properties (GObject *new,
else
g_string_assign (str, "");
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
gimp_config_serialize_comment (str, blurb);
gimp_config_string_indent (str, indent_level);
g_string_append_printf (str, "(%s ", prop_spec->name);
@ -437,6 +442,41 @@ gimp_config_serialize_property (GObject *object,
return retval;
}
static void
gimp_config_serialize_comment (GString *str,
const gchar *comment)
{
const gchar *s;
gint i, len, space;
len = strlen (comment);
while (len > 0)
{
for (s = comment, i = 0, space = 0;
*s != '\n' && (i <= 76 || space == 0) && i < len;
s++, i++)
{
if (g_ascii_isspace (*s))
space = i;
}
if (i > 76 && space && *s != '\n')
i = space;
g_string_append_len (str, "# ", 2);
g_string_append_len (str, comment, i);
g_string_append_c (str, '\n');
i++;
comment += i;
len -= i;
}
g_string_append_printf (str, "#\n");
}
static void
serialize_unknown_token (const gchar *key,
const gchar *value,