GimpConfig-iface

GimpConfig-iface — High-level API for libgimpconfig.

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── GimpConfigInterface

Prerequisites

GimpConfigInterface requires GObject.

Description

High-level API for libgimpconfig.

Functions

gimp_config_serialize ()

gboolean
gimp_config_serialize (GimpConfig *config,
                       GimpConfigWriter *writer,
                       gpointer data);

Serialize the GimpConfig object.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

writer

the GimpConfigWriter to use.

 

data

client data

 

Returns

TRUE if serialization succeeded, FALSE otherwise.

Since: 2.8


gimp_config_serialize_to_file ()

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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

filename

the name of the file to write the configuration to.

 

header

optional file header (must be ASCII only)

 

footer

optional file footer (must be ASCII only)

 

data

user data passed to the serialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if serialization succeeded, FALSE otherwise.

Since: 2.4


gimp_config_serialize_to_gfile ()

gboolean
gimp_config_serialize_to_gfile (GimpConfig *config,
                                GFile *file,
                                const gchar *header,
                                const gchar *footer,
                                gpointer data,
                                GError **error);

Serializes the object properties of config to the file specified by file . If a file with that name already exists, it is overwritten. Basically this function opens file for you and calls the serialize function of the config 's GimpConfigInterface.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

file

the GFile to write the configuration to.

 

header

optional file header (must be ASCII only)

 

footer

optional file footer (must be ASCII only)

 

data

user data passed to the serialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if serialization succeeded, FALSE otherwise.

Since: 2.10


gimp_config_serialize_to_stream ()

gboolean
gimp_config_serialize_to_stream (GimpConfig *config,
                                 GOutputStream *output,
                                 const gchar *header,
                                 const gchar *footer,
                                 gpointer data,
                                 GError **error);

Serializes the object properties of config to the stream specified by output .

Parameters

config

a GObject that implements the GimpConfigInterface.

 

output

the GOutputStream to write the configuration to.

 

header

optional file header (must be ASCII only)

 

footer

optional file footer (must be ASCII only)

 

data

user data passed to the serialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if serialization succeeded, FALSE otherwise.

Since: 2.10


gimp_config_serialize_to_fd ()

gboolean
gimp_config_serialize_to_fd (GimpConfig *config,
                             gint fd,
                             gpointer data);

Serializes the object properties of config to the given file descriptor.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

fd

a file descriptor, opened for writing

 

data

user data passed to the serialize implementation.

 

Returns

TRUE if serialization succeeded, FALSE otherwise.

Since: 2.4


gimp_config_serialize_to_string ()

gchar *
gimp_config_serialize_to_string (GimpConfig *config,
                                 gpointer data);

Serializes the object properties of config to a string.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

data

user data passed to the serialize implementation.

 

Returns

a newly allocated NUL-terminated string.

Since: 2.4


gimp_config_deserialize ()

gboolean
gimp_config_deserialize (GimpConfig *config,
                         GScanner *scanner,
                         gint nest_level,
                         gpointer data);

Deserialize the GimpConfig object.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

scanner

the GScanner to use.

 

nest_level

the nest level.

 

data

client data.

 

Returns

TRUE if deserialization succeeded, FALSE otherwise.

Since: 2.8


gimp_config_deserialize_file ()

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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

filename

the name of the file to read configuration from.

 

data

user data passed to the deserialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if deserialization succeeded, FALSE otherwise.

Since: 2.4


gimp_config_deserialize_gfile ()

gboolean
gimp_config_deserialize_gfile (GimpConfig *config,
                               GFile *file,
                               gpointer data,
                               GError **error);

Opens the file specified by file , 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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

file

the GFile to read configuration from.

 

data

user data passed to the deserialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if deserialization succeeded, FALSE otherwise.

Since: 2.10


gimp_config_deserialize_stream ()

gboolean
gimp_config_deserialize_stream (GimpConfig *config,
                                GInputStream *input,
                                gpointer data,
                                GError **error);

Reads configuration data from input and configures config accordingly. Basically this function creates a properly configured GScanner for you and calls the deserialize function of the config 's GimpConfigInterface.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

input

the GInputStream to read configuration from.

 

data

user data passed to the deserialize implementation.

 

error

return location for a possible error

 

Returns

TRUE if deserialization succeeded, FALSE otherwise.

Since: 2.10


gimp_config_deserialize_string ()

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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

text

string to deserialize (in UTF-8 encoding)

 

text_len

length of text in bytes or -1

 

data

client data

 

error

return location for a possible error

 

Returns

TRUE if deserialization succeeded, FALSE otherwise.

Since: 2.4


gimp_config_deserialize_return ()

gboolean
gimp_config_deserialize_return (GScanner *scanner,
                                GTokenType expected_token,
                                gint nest_level);

Parameters

scanner

a GScanner

 

expected_token

the expected token

 

nest_level

the nest level

 

Since: 2.4


gimp_config_duplicate ()

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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

Returns

the duplicated GimpConfig object

Since: 2.4


gimp_config_is_equal_to ()

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.

Parameters

a

a GObject that implements the GimpConfigInterface.

 

b

another GObject of the same type as a .

 

Returns

TRUE if the two objects are equal.

Since: 2.4


gimp_config_reset ()

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.

Parameters

config

a GObject that implements the GimpConfigInterface.

 

Since: 2.4


gimp_config_copy ()

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.

Parameters

src

a GObject that implements the GimpConfigInterface.

 

dest

another GObject of the same type as a .

 

flags

a mask of GParamFlags

 

Returns

TRUE if dest was modified, FALSE otherwise

Since: 2.6

Types and Values

GimpConfig

typedef struct _GimpConfig GimpConfig;

struct GimpConfigInterface

struct GimpConfigInterface;