mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
app/config/Makefile.am moved code from gimpconfig.[ch] to these new files.
2003-07-24 Sven Neumann <sven@gimp.org> * app/config/Makefile.am * app/config/gimpconfig-error.[ch]: moved code from gimpconfig.[ch] to these new files. * app/config/gimpconfig-utils.[ch]: moved gimp_config_string_indent() here from gimpconfig.[ch]. * app/config/gimpconfig.[ch] * app/config/gimpconfigwriter.c * app/config/gimprc.c * app/config/gimpscanner.c * app/core/gimp-documents.c * app/core/gimp-parasites.c * app/core/gimp-templates.c * app/widgets/gimpdevices.c: changed accordingly.
This commit is contained in:
parent
8ea47faa35
commit
d75a2f79ba
23 changed files with 247 additions and 118 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2003-07-24 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/config/Makefile.am
|
||||||
|
* app/config/gimpconfig-error.[ch]: moved code from gimpconfig.[ch]
|
||||||
|
to these new files.
|
||||||
|
|
||||||
|
* app/config/gimpconfig-utils.[ch]: moved gimp_config_string_indent()
|
||||||
|
here from gimpconfig.[ch].
|
||||||
|
|
||||||
|
* app/config/gimpconfig.[ch]
|
||||||
|
* app/config/gimpconfigwriter.c
|
||||||
|
* app/config/gimprc.c
|
||||||
|
* app/config/gimpscanner.c
|
||||||
|
* app/core/gimp-documents.c
|
||||||
|
* app/core/gimp-parasites.c
|
||||||
|
* app/core/gimp-templates.c
|
||||||
|
* app/widgets/gimpdevices.c: changed accordingly.
|
||||||
|
|
||||||
2003-07-24 Michael Natterer <mitch@gimp.org>
|
2003-07-24 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/text/gimptext-vectors.c: added control points.
|
* app/text/gimptext-vectors.c: added control points.
|
||||||
|
|
|
@ -8,6 +8,8 @@ libappconfig_a_SOURCES = \
|
||||||
gimpconfig.h \
|
gimpconfig.h \
|
||||||
gimpconfig-deserialize.c \
|
gimpconfig-deserialize.c \
|
||||||
gimpconfig-deserialize.h \
|
gimpconfig-deserialize.h \
|
||||||
|
gimpconfig-error.c \
|
||||||
|
gimpconfig-error.h \
|
||||||
gimpconfig-params.c \
|
gimpconfig-params.c \
|
||||||
gimpconfig-params.h \
|
gimpconfig-params.h \
|
||||||
gimpconfig-path.c \
|
gimpconfig-path.c \
|
||||||
|
|
37
app/config/gimpconfig-error.c
Normal file
37
app/config/gimpconfig-error.c
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* Config file serialization and deserialization interface
|
||||||
|
* Copyright (C) 2001-2002 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.h>
|
||||||
|
|
||||||
|
#include "gimpconfig-error.h"
|
||||||
|
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
gimp_config_error_quark (void)
|
||||||
|
{
|
||||||
|
static GQuark q = 0;
|
||||||
|
if (q == 0)
|
||||||
|
q = g_quark_from_static_string ("gimp-config-error-quark");
|
||||||
|
|
||||||
|
return q;
|
||||||
|
}
|
38
app/config/gimpconfig-error.h
Normal file
38
app/config/gimpconfig-error.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_CONFIG_ERROR_H__
|
||||||
|
#define __GIMP_CONFIG_ERROR_H__
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_CONFIG_ERROR_OPEN, /* open failed */
|
||||||
|
GIMP_CONFIG_ERROR_OPEN_ENOENT, /* file does not exist */
|
||||||
|
GIMP_CONFIG_ERROR_WRITE, /* write failed */
|
||||||
|
GIMP_CONFIG_ERROR_PARSE /* parser error */
|
||||||
|
} GimpConfigError;
|
||||||
|
|
||||||
|
#define GIMP_CONFIG_ERROR (gimp_config_error_quark ())
|
||||||
|
|
||||||
|
GQuark gimp_config_error_quark (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GIMP_CONFIG_ERROR_H__ */
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Utitility functions for GimpConfig.
|
* Utitility functions for GimpConfig.
|
||||||
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
* @a: a #GObject
|
* @a: a #GObject
|
||||||
* @b: another #GObject of the same type as @a
|
* @b: another #GObject of the same type as @a
|
||||||
* @flags: a mask of GParamFlags
|
* @flags: a mask of GParamFlags
|
||||||
*
|
*
|
||||||
* Compares all properties of @a and @b that have all @flags set. If
|
* Compares all properties of @a and @b that have all @flags set. If
|
||||||
* @flags is 0, all properties are compared.
|
* @flags is 0, all properties are compared.
|
||||||
*
|
*
|
||||||
* Return value: a GList of differing GParamSpecs.
|
* Return value: a GList of differing GParamSpecs.
|
||||||
**/
|
**/
|
||||||
GList *
|
GList *
|
||||||
|
@ -109,7 +109,7 @@ gimp_config_connect_notify (GObject *src,
|
||||||
* gimp_config_connect:
|
* gimp_config_connect:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Connects @dest with @src so that all property changes of @src are
|
* Connects @dest with @src so that all property changes of @src are
|
||||||
* applied to @dest using a "notify" handler.
|
* applied to @dest using a "notify" handler.
|
||||||
**/
|
**/
|
||||||
|
@ -130,7 +130,7 @@ gimp_config_connect (GObject *src,
|
||||||
* gimp_config_disconnect:
|
* gimp_config_disconnect:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Removes a connection between @dest and @src that was previously set
|
* Removes a connection between @dest and @src that was previously set
|
||||||
* up using gimp_config_connect().
|
* up using gimp_config_connect().
|
||||||
**/
|
**/
|
||||||
|
@ -150,7 +150,7 @@ gimp_config_disconnect (GObject *src,
|
||||||
* gimp_config_copy_properties:
|
* gimp_config_copy_properties:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Retrieves all read and writeable property settings from @src and
|
* Retrieves all read and writeable property settings from @src and
|
||||||
* applies the values to @dest.
|
* applies the values to @dest.
|
||||||
**/
|
**/
|
||||||
|
@ -234,7 +234,7 @@ gimp_config_copy_properties (GObject *src,
|
||||||
/**
|
/**
|
||||||
* gimp_config_reset_properties:
|
* gimp_config_reset_properties:
|
||||||
* @object: a #GObject
|
* @object: a #GObject
|
||||||
*
|
*
|
||||||
* Resets all writable properties of @object to the default values as
|
* Resets all writable properties of @object to the default values as
|
||||||
* defined in their #GParamSpec.
|
* defined in their #GParamSpec.
|
||||||
**/
|
**/
|
||||||
|
@ -248,7 +248,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_return_if_fail (G_IS_OBJECT (object));
|
g_return_if_fail (G_IS_OBJECT (object));
|
||||||
|
|
||||||
klass = G_OBJECT_GET_CLASS (object);
|
klass = G_OBJECT_GET_CLASS (object);
|
||||||
|
|
||||||
property_specs = g_object_class_list_properties (klass, &n_property_specs);
|
property_specs = g_object_class_list_properties (klass, &n_property_specs);
|
||||||
|
@ -261,7 +261,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
for (i = 0; i < n_property_specs; i++)
|
for (i = 0; i < n_property_specs; i++)
|
||||||
{
|
{
|
||||||
GParamSpec *prop_spec;
|
GParamSpec *prop_spec;
|
||||||
|
|
||||||
prop_spec = property_specs[i];
|
prop_spec = property_specs[i];
|
||||||
|
|
||||||
if (prop_spec->flags & G_PARAM_WRITABLE)
|
if (prop_spec->flags & G_PARAM_WRITABLE)
|
||||||
|
@ -308,7 +308,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
* gimp_config_string_append_escaped:
|
* gimp_config_string_append_escaped:
|
||||||
* @string: pointer to a #GString
|
* @string: pointer to a #GString
|
||||||
* @val: a string to append or %NULL
|
* @val: a string to append or %NULL
|
||||||
*
|
*
|
||||||
* Escapes and quotes @val and appends it to @string. The escape
|
* Escapes and quotes @val and appends it to @string. The escape
|
||||||
* algorithm is different from the one used by g_strescape() since it
|
* algorithm is different from the one used by g_strescape() since it
|
||||||
* leaves non-ASCII characters intact and thus preserves UTF-8
|
* leaves non-ASCII characters intact and thus preserves UTF-8
|
||||||
|
@ -356,7 +356,7 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
case '"':
|
case '"':
|
||||||
buf[1] = *p;
|
buf[1] = *p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
len = 4;
|
len = 4;
|
||||||
buf[1] = '0' + (((*p) >> 6) & 07);
|
buf[1] = '0' + (((*p) >> 6) & 07);
|
||||||
|
@ -366,7 +366,7 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
}
|
}
|
||||||
|
|
||||||
g_string_append_len (string, buf, len);
|
g_string_append_len (string, buf, len);
|
||||||
|
|
||||||
val = p + 1;
|
val = p + 1;
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
|
@ -385,6 +385,19 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_config_string_indent (GString *string,
|
||||||
|
gint indent_level)
|
||||||
|
{
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
g_return_if_fail (string != NULL);
|
||||||
|
g_return_if_fail (indent_level >= 0);
|
||||||
|
|
||||||
|
for (i = 0; i < indent_level; i++)
|
||||||
|
g_string_append_len (string, " ", 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GimpConfig path utilities
|
* GimpConfig path utilities
|
||||||
|
@ -399,7 +412,7 @@ gimp_config_build_data_path (const gchar *name)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
gimp_config_build_plug_in_path (const gchar *name)
|
gimp_config_build_plug_in_path (const gchar *name)
|
||||||
{
|
{
|
||||||
return g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, name,
|
return g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, name,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Utitility functions for GimpConfig.
|
* Utitility functions for GimpConfig.
|
||||||
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -36,6 +36,8 @@ void gimp_config_reset_properties (GObject *object);
|
||||||
|
|
||||||
void gimp_config_string_append_escaped (GString *string,
|
void gimp_config_string_append_escaped (GString *string,
|
||||||
const gchar *val);
|
const gchar *val);
|
||||||
|
void gimp_config_string_indent (GString *string,
|
||||||
|
gint indent_level);
|
||||||
|
|
||||||
gchar * gimp_config_build_data_path (const gchar *name);
|
gchar * gimp_config_build_data_path (const gchar *name);
|
||||||
gchar * gimp_config_build_plug_in_path (const gchar *name);
|
gchar * gimp_config_build_plug_in_path (const gchar *name);
|
||||||
|
|
|
@ -392,28 +392,6 @@ gimp_config_deserialize_return (GScanner *scanner,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GQuark
|
|
||||||
gimp_config_error_quark (void)
|
|
||||||
{
|
|
||||||
static GQuark q = 0;
|
|
||||||
if (q == 0)
|
|
||||||
q = g_quark_from_static_string ("gimp-config-error-quark");
|
|
||||||
|
|
||||||
return q;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_config_string_indent (GString *string,
|
|
||||||
gint indent_level)
|
|
||||||
{
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
g_return_if_fail (string != NULL);
|
|
||||||
g_return_if_fail (indent_level >= 0);
|
|
||||||
|
|
||||||
for (i = 0; i < indent_level; i++)
|
|
||||||
g_string_append_len (string, " ", 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_config_duplicate:
|
* gimp_config_duplicate:
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Config file serialization and deserialization interface
|
* Config file serialization and deserialization interface
|
||||||
* Copyright (C) 2001-2002 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -22,14 +22,6 @@
|
||||||
#ifndef __GIMP_CONFIG_H__
|
#ifndef __GIMP_CONFIG_H__
|
||||||
#define __GIMP_CONFIG_H__
|
#define __GIMP_CONFIG_H__
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GIMP_CONFIG_ERROR_OPEN, /* open failed */
|
|
||||||
GIMP_CONFIG_ERROR_OPEN_ENOENT, /* file does not exist */
|
|
||||||
GIMP_CONFIG_ERROR_WRITE, /* write failed */
|
|
||||||
GIMP_CONFIG_ERROR_PARSE /* parser error */
|
|
||||||
} GimpConfigError;
|
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
|
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
|
||||||
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
|
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
|
||||||
|
@ -110,12 +102,4 @@ void gimp_config_foreach_unknown_token (GObject *object,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_CONFIG_ERROR (gimp_config_error_quark ())
|
|
||||||
|
|
||||||
GQuark gimp_config_error_quark (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
void gimp_config_string_indent (GString *string,
|
|
||||||
gint indent_level);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CONFIG_H__ */
|
#endif /* __GIMP_CONFIG_H__ */
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include "config-types.h"
|
#include "config-types.h"
|
||||||
|
|
||||||
#include "gimpconfig.h"
|
#include "gimpconfig-error.h"
|
||||||
#include "gimpconfig-serialize.h"
|
#include "gimpconfig-serialize.h"
|
||||||
#include "gimpconfig-utils.h"
|
#include "gimpconfig-utils.h"
|
||||||
#include "gimpconfigwriter.h"
|
#include "gimpconfigwriter.h"
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include "gimpconfig.h"
|
#include "gimpconfig.h"
|
||||||
#include "gimpconfig-deserialize.h"
|
#include "gimpconfig-deserialize.h"
|
||||||
|
#include "gimpconfig-error.h"
|
||||||
#include "gimpconfig-params.h"
|
#include "gimpconfig-params.h"
|
||||||
#include "gimpconfig-path.h"
|
#include "gimpconfig-path.h"
|
||||||
#include "gimpconfig-serialize.h"
|
#include "gimpconfig-serialize.h"
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
#include "config-types.h"
|
#include "config-types.h"
|
||||||
|
|
||||||
#include "gimpconfig.h"
|
#include "gimpconfig-error.h"
|
||||||
#include "gimpscanner.h"
|
#include "gimpscanner.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
#include "config/gimpconfig.h"
|
#include "config/gimpconfig.h"
|
||||||
|
#include "config/gimpconfig-error.h"
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
|
|
|
@ -23,12 +23,13 @@
|
||||||
|
|
||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
|
#include "config/gimpconfig.h"
|
||||||
|
#include "config/gimpconfig-error.h"
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimp-parasites.h"
|
#include "gimp-parasites.h"
|
||||||
#include "gimpparasitelist.h"
|
#include "gimpparasitelist.h"
|
||||||
|
|
||||||
#include "config/gimpconfig.h"
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_parasite_attach (Gimp *gimp,
|
gimp_parasite_attach (Gimp *gimp,
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
#include "config/gimpconfig.h"
|
#include "config/gimpconfig.h"
|
||||||
|
#include "config/gimpconfig-error.h"
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimp-templates.h"
|
#include "gimp-templates.h"
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "config/gimpconfig.h"
|
#include "config/gimpconfig.h"
|
||||||
|
#include "config/gimpconfig-error.h"
|
||||||
|
|
||||||
#include "gimpdeviceinfo.h"
|
#include "gimpdeviceinfo.h"
|
||||||
#include "gimpdevices.h"
|
#include "gimpdevices.h"
|
||||||
|
|
37
libgimpconfig/gimpconfig-error.c
Normal file
37
libgimpconfig/gimpconfig-error.c
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* Config file serialization and deserialization interface
|
||||||
|
* Copyright (C) 2001-2002 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.h>
|
||||||
|
|
||||||
|
#include "gimpconfig-error.h"
|
||||||
|
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
gimp_config_error_quark (void)
|
||||||
|
{
|
||||||
|
static GQuark q = 0;
|
||||||
|
if (q == 0)
|
||||||
|
q = g_quark_from_static_string ("gimp-config-error-quark");
|
||||||
|
|
||||||
|
return q;
|
||||||
|
}
|
38
libgimpconfig/gimpconfig-error.h
Normal file
38
libgimpconfig/gimpconfig-error.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/* The GIMP -- an image manipulation program
|
||||||
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_CONFIG_ERROR_H__
|
||||||
|
#define __GIMP_CONFIG_ERROR_H__
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_CONFIG_ERROR_OPEN, /* open failed */
|
||||||
|
GIMP_CONFIG_ERROR_OPEN_ENOENT, /* file does not exist */
|
||||||
|
GIMP_CONFIG_ERROR_WRITE, /* write failed */
|
||||||
|
GIMP_CONFIG_ERROR_PARSE /* parser error */
|
||||||
|
} GimpConfigError;
|
||||||
|
|
||||||
|
#define GIMP_CONFIG_ERROR (gimp_config_error_quark ())
|
||||||
|
|
||||||
|
GQuark gimp_config_error_quark (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GIMP_CONFIG_ERROR_H__ */
|
|
@ -392,28 +392,6 @@ gimp_config_deserialize_return (GScanner *scanner,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GQuark
|
|
||||||
gimp_config_error_quark (void)
|
|
||||||
{
|
|
||||||
static GQuark q = 0;
|
|
||||||
if (q == 0)
|
|
||||||
q = g_quark_from_static_string ("gimp-config-error-quark");
|
|
||||||
|
|
||||||
return q;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_config_string_indent (GString *string,
|
|
||||||
gint indent_level)
|
|
||||||
{
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
g_return_if_fail (string != NULL);
|
|
||||||
g_return_if_fail (indent_level >= 0);
|
|
||||||
|
|
||||||
for (i = 0; i < indent_level; i++)
|
|
||||||
g_string_append_len (string, " ", 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_config_duplicate:
|
* gimp_config_duplicate:
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Config file serialization and deserialization interface
|
* Config file serialization and deserialization interface
|
||||||
* Copyright (C) 2001-2002 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -22,14 +22,6 @@
|
||||||
#ifndef __GIMP_CONFIG_H__
|
#ifndef __GIMP_CONFIG_H__
|
||||||
#define __GIMP_CONFIG_H__
|
#define __GIMP_CONFIG_H__
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GIMP_CONFIG_ERROR_OPEN, /* open failed */
|
|
||||||
GIMP_CONFIG_ERROR_OPEN_ENOENT, /* file does not exist */
|
|
||||||
GIMP_CONFIG_ERROR_WRITE, /* write failed */
|
|
||||||
GIMP_CONFIG_ERROR_PARSE /* parser error */
|
|
||||||
} GimpConfigError;
|
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
|
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
|
||||||
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
|
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
|
||||||
|
@ -110,12 +102,4 @@ void gimp_config_foreach_unknown_token (GObject *object,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_CONFIG_ERROR (gimp_config_error_quark ())
|
|
||||||
|
|
||||||
GQuark gimp_config_error_quark (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
void gimp_config_string_indent (GString *string,
|
|
||||||
gint indent_level);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CONFIG_H__ */
|
#endif /* __GIMP_CONFIG_H__ */
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Utitility functions for GimpConfig.
|
* Utitility functions for GimpConfig.
|
||||||
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
* @a: a #GObject
|
* @a: a #GObject
|
||||||
* @b: another #GObject of the same type as @a
|
* @b: another #GObject of the same type as @a
|
||||||
* @flags: a mask of GParamFlags
|
* @flags: a mask of GParamFlags
|
||||||
*
|
*
|
||||||
* Compares all properties of @a and @b that have all @flags set. If
|
* Compares all properties of @a and @b that have all @flags set. If
|
||||||
* @flags is 0, all properties are compared.
|
* @flags is 0, all properties are compared.
|
||||||
*
|
*
|
||||||
* Return value: a GList of differing GParamSpecs.
|
* Return value: a GList of differing GParamSpecs.
|
||||||
**/
|
**/
|
||||||
GList *
|
GList *
|
||||||
|
@ -109,7 +109,7 @@ gimp_config_connect_notify (GObject *src,
|
||||||
* gimp_config_connect:
|
* gimp_config_connect:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Connects @dest with @src so that all property changes of @src are
|
* Connects @dest with @src so that all property changes of @src are
|
||||||
* applied to @dest using a "notify" handler.
|
* applied to @dest using a "notify" handler.
|
||||||
**/
|
**/
|
||||||
|
@ -130,7 +130,7 @@ gimp_config_connect (GObject *src,
|
||||||
* gimp_config_disconnect:
|
* gimp_config_disconnect:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Removes a connection between @dest and @src that was previously set
|
* Removes a connection between @dest and @src that was previously set
|
||||||
* up using gimp_config_connect().
|
* up using gimp_config_connect().
|
||||||
**/
|
**/
|
||||||
|
@ -150,7 +150,7 @@ gimp_config_disconnect (GObject *src,
|
||||||
* gimp_config_copy_properties:
|
* gimp_config_copy_properties:
|
||||||
* @src: a #GObject
|
* @src: a #GObject
|
||||||
* @dest: another #GObject of the same type as @src
|
* @dest: another #GObject of the same type as @src
|
||||||
*
|
*
|
||||||
* Retrieves all read and writeable property settings from @src and
|
* Retrieves all read and writeable property settings from @src and
|
||||||
* applies the values to @dest.
|
* applies the values to @dest.
|
||||||
**/
|
**/
|
||||||
|
@ -234,7 +234,7 @@ gimp_config_copy_properties (GObject *src,
|
||||||
/**
|
/**
|
||||||
* gimp_config_reset_properties:
|
* gimp_config_reset_properties:
|
||||||
* @object: a #GObject
|
* @object: a #GObject
|
||||||
*
|
*
|
||||||
* Resets all writable properties of @object to the default values as
|
* Resets all writable properties of @object to the default values as
|
||||||
* defined in their #GParamSpec.
|
* defined in their #GParamSpec.
|
||||||
**/
|
**/
|
||||||
|
@ -248,7 +248,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_return_if_fail (G_IS_OBJECT (object));
|
g_return_if_fail (G_IS_OBJECT (object));
|
||||||
|
|
||||||
klass = G_OBJECT_GET_CLASS (object);
|
klass = G_OBJECT_GET_CLASS (object);
|
||||||
|
|
||||||
property_specs = g_object_class_list_properties (klass, &n_property_specs);
|
property_specs = g_object_class_list_properties (klass, &n_property_specs);
|
||||||
|
@ -261,7 +261,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
for (i = 0; i < n_property_specs; i++)
|
for (i = 0; i < n_property_specs; i++)
|
||||||
{
|
{
|
||||||
GParamSpec *prop_spec;
|
GParamSpec *prop_spec;
|
||||||
|
|
||||||
prop_spec = property_specs[i];
|
prop_spec = property_specs[i];
|
||||||
|
|
||||||
if (prop_spec->flags & G_PARAM_WRITABLE)
|
if (prop_spec->flags & G_PARAM_WRITABLE)
|
||||||
|
@ -308,7 +308,7 @@ gimp_config_reset_properties (GObject *object)
|
||||||
* gimp_config_string_append_escaped:
|
* gimp_config_string_append_escaped:
|
||||||
* @string: pointer to a #GString
|
* @string: pointer to a #GString
|
||||||
* @val: a string to append or %NULL
|
* @val: a string to append or %NULL
|
||||||
*
|
*
|
||||||
* Escapes and quotes @val and appends it to @string. The escape
|
* Escapes and quotes @val and appends it to @string. The escape
|
||||||
* algorithm is different from the one used by g_strescape() since it
|
* algorithm is different from the one used by g_strescape() since it
|
||||||
* leaves non-ASCII characters intact and thus preserves UTF-8
|
* leaves non-ASCII characters intact and thus preserves UTF-8
|
||||||
|
@ -356,7 +356,7 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
case '"':
|
case '"':
|
||||||
buf[1] = *p;
|
buf[1] = *p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
len = 4;
|
len = 4;
|
||||||
buf[1] = '0' + (((*p) >> 6) & 07);
|
buf[1] = '0' + (((*p) >> 6) & 07);
|
||||||
|
@ -366,7 +366,7 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
}
|
}
|
||||||
|
|
||||||
g_string_append_len (string, buf, len);
|
g_string_append_len (string, buf, len);
|
||||||
|
|
||||||
val = p + 1;
|
val = p + 1;
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
|
@ -385,6 +385,19 @@ gimp_config_string_append_escaped (GString *string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_config_string_indent (GString *string,
|
||||||
|
gint indent_level)
|
||||||
|
{
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
g_return_if_fail (string != NULL);
|
||||||
|
g_return_if_fail (indent_level >= 0);
|
||||||
|
|
||||||
|
for (i = 0; i < indent_level; i++)
|
||||||
|
g_string_append_len (string, " ", 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GimpConfig path utilities
|
* GimpConfig path utilities
|
||||||
|
@ -399,7 +412,7 @@ gimp_config_build_data_path (const gchar *name)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
gimp_config_build_plug_in_path (const gchar *name)
|
gimp_config_build_plug_in_path (const gchar *name)
|
||||||
{
|
{
|
||||||
return g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, name,
|
return g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, name,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* Utitility functions for GimpConfig.
|
* Utitility functions for GimpConfig.
|
||||||
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -36,6 +36,8 @@ void gimp_config_reset_properties (GObject *object);
|
||||||
|
|
||||||
void gimp_config_string_append_escaped (GString *string,
|
void gimp_config_string_append_escaped (GString *string,
|
||||||
const gchar *val);
|
const gchar *val);
|
||||||
|
void gimp_config_string_indent (GString *string,
|
||||||
|
gint indent_level);
|
||||||
|
|
||||||
gchar * gimp_config_build_data_path (const gchar *name);
|
gchar * gimp_config_build_data_path (const gchar *name);
|
||||||
gchar * gimp_config_build_plug_in_path (const gchar *name);
|
gchar * gimp_config_build_plug_in_path (const gchar *name);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include "config-types.h"
|
#include "config-types.h"
|
||||||
|
|
||||||
#include "gimpconfig.h"
|
#include "gimpconfig-error.h"
|
||||||
#include "gimpconfig-serialize.h"
|
#include "gimpconfig-serialize.h"
|
||||||
#include "gimpconfig-utils.h"
|
#include "gimpconfig-utils.h"
|
||||||
#include "gimpconfigwriter.h"
|
#include "gimpconfigwriter.h"
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
#include "config-types.h"
|
#include "config-types.h"
|
||||||
|
|
||||||
#include "gimpconfig.h"
|
#include "gimpconfig-error.h"
|
||||||
#include "gimpscanner.h"
|
#include "gimpscanner.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue