1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
4
* Config file serialization and deserialization interface
5
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
#ifndef __GIMP_CONFIG_H__
23
#define __GIMP_CONFIG_H__
26
#define GIMP_TYPE_CONFIG (gimp_config_interface_get_type ())
27
#define GIMP_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CONFIG))
28
#define GIMP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CONFIG, GimpConfig))
29
#define GIMP_CONFIG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG, GimpConfigInterface))
32
typedef struct _GimpConfigInterface GimpConfigInterface;
34
struct _GimpConfigInterface
36
GTypeInterface base_iface;
38
gboolean (* serialize) (GimpConfig *config,
39
GimpConfigWriter *writer,
41
gboolean (* deserialize) (GimpConfig *config,
45
gboolean (* serialize_property) (GimpConfig *config,
49
GimpConfigWriter *writer);
50
gboolean (* deserialize_property) (GimpConfig *config,
55
GTokenType *expected);
56
GimpConfig * (* duplicate) (GimpConfig *config);
57
gboolean (* equal) (GimpConfig *a,
59
void (* reset) (GimpConfig *config);
62
typedef void (* GimpConfigForeachFunc) (const gchar *key,
67
GType gimp_config_interface_get_type (void) G_GNUC_CONST;
69
gboolean gimp_config_serialize_to_file (GimpConfig *config,
70
const gchar *filename,
75
gboolean gimp_config_serialize_to_fd (GimpConfig *config,
78
gchar * gimp_config_serialize_to_string (GimpConfig *config,
80
gboolean gimp_config_deserialize_file (GimpConfig *config,
81
const gchar *filename,
84
gboolean gimp_config_deserialize_string (GimpConfig *config,
89
gboolean gimp_config_deserialize_return (GScanner *scanner,
90
GTokenType expected_token,
93
gpointer gimp_config_duplicate (GimpConfig *config);
94
gboolean gimp_config_is_equal_to (GimpConfig *a,
96
void gimp_config_reset (GimpConfig *config);
98
void gimp_config_add_unknown_token (GimpConfig *config,
101
const gchar * gimp_config_lookup_unknown_token (GimpConfig *config,
103
void gimp_config_foreach_unknown_token (GimpConfig *config,
104
GimpConfigForeachFunc func,
108
#endif /* __GIMP_CONFIG_H__ */