![]() |
![]() |
![]() |
GIMP Config Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations |
GimpConfig; GimpConfigInterface; gboolean gimp_config_serialize_to_file (GimpConfig *config, const gchar *filename, const gchar *header, const gchar *footer, gpointer data, GError **error); gboolean gimp_config_serialize_to_fd (GimpConfig *config, gint fd, gpointer data); gchar * gimp_config_serialize_to_string (GimpConfig *config, gpointer data); gboolean gimp_config_deserialize_file (GimpConfig *config, const gchar *filename, gpointer data, GError **error); gboolean gimp_config_deserialize_string (GimpConfig *config, const gchar *text, gint text_len, gpointer data, GError **error); gboolean gimp_config_deserialize_return (GScanner *scanner, GTokenType expected_token, gint nest_level); gpointer gimp_config_duplicate (GimpConfig *config); gboolean gimp_config_is_equal_to (GimpConfig *a, GimpConfig *b); void gimp_config_reset (GimpConfig *config); gboolean gimp_config_copy (GimpConfig *src, GimpConfig *dest, GParamFlags flags);
gboolean gimp_config_serialize_to_file (GimpConfig *config, const gchar *filename, const gchar *header, const gchar *footer, gpointer data, GError **error);
Serializes the object properties of config
to the file specified
by filename
. If a file with that name already exists, it is
overwritten. Basically this function opens filename
for you and
calls the serialize function of the config
's GimpConfigInterface.
|
a GObject that implements the GimpConfigInterface. |
|
the name of the file to write the configuration to. |
|
optional file header (must be ASCII only) |
|
optional file footer (must be ASCII only) |
|
user data passed to the serialize implementation. |
|
|
Returns : |
TRUE if serialization succeeded, FALSE otherwise.
|
Since GIMP 2.4
gboolean gimp_config_serialize_to_fd (GimpConfig *config, gint fd, gpointer data);
Serializes the object properties of config
to the given file
descriptor.
|
a GObject that implements the GimpConfigInterface. |
|
a file descriptor, opened for writing |
|
user data passed to the serialize implementation. |
Returns : |
TRUE if serialization succeeded, FALSE otherwise.
|
Since GIMP 2.4
gchar * gimp_config_serialize_to_string (GimpConfig *config, gpointer data);
Serializes the object properties of config
to a string.
|
a GObject that implements the GimpConfigInterface. |
|
user data passed to the serialize implementation. |
Returns : |
a newly allocated NUL -terminated string.
|
Since GIMP 2.4
gboolean gimp_config_deserialize_file (GimpConfig *config, const gchar *filename, gpointer data, GError **error);
Opens the file specified by filename
, reads configuration data
from it and configures config
accordingly. Basically this function
creates a properly configured GScanner for you and calls the
deserialize function of the config
's GimpConfigInterface.
|
a GObject that implements the GimpConfigInterface. |
|
the name of the file to read configuration from. |
|
user data passed to the deserialize implementation. |
|
|
Returns : |
TRUE if deserialization succeeded, FALSE otherwise.
|
Since GIMP 2.4
gboolean gimp_config_deserialize_string (GimpConfig *config, const gchar *text, gint text_len, gpointer data, GError **error);
Configures config
from text
. Basically this function creates a
properly configured GScanner for you and calls the deserialize
function of the config
's GimpConfigInterface.
|
a GObject that implements the GimpConfigInterface. |
|
string to deserialize (in UTF-8 encoding) |
|
length of text in bytes or -1
|
|
|
|
|
Returns : |
TRUE if deserialization succeeded, FALSE otherwise.
|
Since GIMP 2.4
gboolean gimp_config_deserialize_return (GScanner *scanner, GTokenType expected_token, gint nest_level);
|
|
|
|
|
|
Returns : |
Since GIMP 2.4
gpointer gimp_config_duplicate (GimpConfig *config);
Creates a copy of the passed object by copying all object properties. The default implementation of the GimpConfigInterface only works for objects that are completely defined by their properties.
|
a GObject that implements the GimpConfigInterface. |
Returns : |
the duplicated GimpConfig object |
Since GIMP 2.4
gboolean gimp_config_is_equal_to (GimpConfig *a, GimpConfig *b);
Compares the two objects. The default implementation of the GimpConfigInterface compares the object properties and thus only works for objects that are completely defined by their properties.
|
a GObject that implements the GimpConfigInterface. |
|
another GObject of the same type as a .
|
Returns : |
TRUE if the two objects are equal.
|
Since GIMP 2.4
void gimp_config_reset (GimpConfig *config);
Resets the object to its default state. The default implementation of the GimpConfigInterface only works for objects that are completely defined by their properties.
|
a GObject that implements the GimpConfigInterface. |
Since GIMP 2.4
gboolean gimp_config_copy (GimpConfig *src, GimpConfig *dest, GParamFlags flags);
Compares all read- and write-able properties from src
and dest
that have all flags
set. Differing values are then copied from
src
to dest
. If flags
is 0, all differing read/write properties.
Properties marked as "construct-only" are not touched.
|
a GObject that implements the GimpConfigInterface. |
|
another GObject of the same type as a .
|
|
a mask of GParamFlags |
Returns : |
TRUE if dest was modified, FALSE otherwise
|
Since GIMP 2.6