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:
Sven Neumann 2003-07-24 14:14:23 +00:00 committed by Sven Neumann
parent 8ea47faa35
commit d75a2f79ba
23 changed files with 247 additions and 118 deletions

View File

@ -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>
* app/text/gimptext-vectors.c: added control points.

View File

@ -8,6 +8,8 @@ libappconfig_a_SOURCES = \
gimpconfig.h \
gimpconfig-deserialize.c \
gimpconfig-deserialize.h \
gimpconfig-error.c \
gimpconfig-error.h \
gimpconfig-params.c \
gimpconfig-params.h \
gimpconfig-path.c \

View 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;
}

View 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__ */

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -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

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -36,6 +36,8 @@ void gimp_config_reset_properties (GObject *object);
void gimp_config_string_append_escaped (GString *string,
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_plug_in_path (const gchar *name);

View File

@ -392,28 +392,6 @@ gimp_config_deserialize_return (GScanner *scanner,
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:

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -22,14 +22,6 @@
#ifndef __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_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);
#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__ */

View File

@ -39,7 +39,7 @@
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-error.h"
#include "gimpconfig-serialize.h"
#include "gimpconfig-utils.h"
#include "gimpconfigwriter.h"

View File

@ -39,6 +39,7 @@
#include "gimpconfig.h"
#include "gimpconfig-deserialize.h"
#include "gimpconfig-error.h"
#include "gimpconfig-params.h"
#include "gimpconfig-path.h"
#include "gimpconfig-serialize.h"

View File

@ -43,7 +43,7 @@
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-error.h"
#include "gimpscanner.h"
#include "gimp-intl.h"

View File

@ -25,6 +25,7 @@
#include "core-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-error.h"
#include "config/gimpcoreconfig.h"
#include "gimp.h"

View File

@ -23,12 +23,13 @@
#include "core-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-error.h"
#include "gimp.h"
#include "gimp-parasites.h"
#include "gimpparasitelist.h"
#include "config/gimpconfig.h"
void
gimp_parasite_attach (Gimp *gimp,

View File

@ -25,6 +25,7 @@
#include "core-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-error.h"
#include "gimp.h"
#include "gimp-templates.h"

View File

@ -33,6 +33,7 @@
#include "core/gimptoolinfo.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-error.h"
#include "gimpdeviceinfo.h"
#include "gimpdevices.h"

View 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;
}

View 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__ */

View File

@ -392,28 +392,6 @@ gimp_config_deserialize_return (GScanner *scanner,
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:

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -22,14 +22,6 @@
#ifndef __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_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);
#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__ */

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -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

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* 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
* it under the terms of the GNU General Public License as published by
@ -36,6 +36,8 @@ void gimp_config_reset_properties (GObject *object);
void gimp_config_string_append_escaped (GString *string,
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_plug_in_path (const gchar *name);

View File

@ -39,7 +39,7 @@
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-error.h"
#include "gimpconfig-serialize.h"
#include "gimpconfig-utils.h"
#include "gimpconfigwriter.h"

View File

@ -43,7 +43,7 @@
#include "config-types.h"
#include "gimpconfig.h"
#include "gimpconfig-error.h"
#include "gimpscanner.h"
#include "gimp-intl.h"