Gimp.Config

Fields

None

Methods

copy (dest, flags)

deserialize (scanner, nest_level, data)

deserialize_file (file, data)

deserialize_parasite (parasite, data)

deserialize_properties (scanner, nest_level)

deserialize_property (scanner, nest_level)

deserialize_stream (input, data)

deserialize_string (text, data)

duplicate ()

is_equal_to (b)

reset ()

serialize (writer, data)

serialize_changed_properties (writer)

serialize_properties (writer)

serialize_property (param_spec, writer)

serialize_property_by_name (prop_name, writer)

serialize_to_fd (fd, data)

serialize_to_file (file, header, footer, data)

serialize_to_parasite (parasite_name, parasite_flags, data)

serialize_to_stream (output, header, footer, data)

serialize_to_string (data)

Details

class Gimp.Config
copy(dest, flags)
Parameters:
Returns:

True if dest was modified, False otherwise

Return type:

bool

Compares all read- and write-able properties from self and dest that have all flags set. Differing values are then copied from self to dest. If flags is 0, all differing read/write properties.

Properties marked as “construct-only” are not touched.

New in version 2.6.

deserialize(scanner, nest_level, data)
Parameters:
Returns:

Whether serialization succeeded.

Return type:

bool

Deserialize the Gimp.Config object.

New in version 2.8.

deserialize_file(file, data)
Parameters:
  • file (Gio.File) – the file to read configuration from.

  • data (object or None) – user data passed to the deserialize implementation.

Raises:

GLib.Error

Returns:

Whether deserialization succeeded.

Return type:

bool

Opens the file specified by file, reads configuration data from it and configures self accordingly. Basically this function creates a properly configured [struct`GLib`.Scanner] for you and calls the deserialize function of the self's [iface`ConfigInterface`].

New in version 2.10.

deserialize_parasite(parasite, data)
Parameters:
  • parasite (Gimp.Parasite) – parasite containing a serialized config string

  • data (object or None) – client data

Raises:

GLib.Error

Returns:

True if deserialization succeeded, False otherwise.

Return type:

bool

Configures self from parasite. Basically this function creates a properly configured GLib.Scanner for you and calls the deserialize function of the self's Gimp.ConfigInterface.

New in version 3.0.

deserialize_properties(scanner, nest_level)
Parameters:
Returns:

True on success, False otherwise.

Return type:

bool

This function uses the scanner to configure the properties of self.

New in version 2.4.

deserialize_property(scanner, nest_level)
Parameters:
Returns:

GLib.TokenType.RIGHT_PAREN on success, otherwise the expected GLib.TokenType or GLib.TokenType.NONE if the expected token was found but couldn’t be parsed.

Return type:

GLib.TokenType

This function deserializes a single property of self. You shouldn’t need to call this function directly. If possible, use Gimp.Config.deserialize_properties() instead.

New in version 2.4.

deserialize_stream(input, data)
Parameters:
  • input (Gio.InputStream) – the input stream to read configuration from.

  • data (object or None) – user data passed to the deserialize implementation.

Raises:

GLib.Error

Returns:

Whether deserialization succeeded.

Return type:

bool

Reads configuration data from input and configures self accordingly. Basically this function creates a properly configured GLib.Scanner for you and calls the deserialize function of the self's Gimp.ConfigInterface.

New in version 2.10.

deserialize_string(text, data)
Parameters:
  • text ([str]) – string to deserialize (in UTF-8 encoding)

  • data (object or None) – client data

Raises:

GLib.Error

Returns:

True if deserialization succeeded, False otherwise.

Return type:

bool

Configures self from text. Basically this function creates a properly configured GLib.Scanner for you and calls the deserialize function of the self's Gimp.ConfigInterface.

New in version 2.4.

duplicate()
Returns:

the duplicated Gimp.Config object

Return type:

object or None

Creates a copy of the passed object by copying all object properties. The default implementation of the Gimp.ConfigInterface only works for objects that are completely defined by their properties.

New in version 2.4.

is_equal_to(b)
Parameters:

b (Gimp.Config) – another GObject.Object of the same type as self.

Returns:

True if the two objects are equal.

Return type:

bool

Compares the two objects. The default implementation of the Gimp.ConfigInterface compares the object properties and thus only works for objects that are completely defined by their properties.

New in version 2.4.

reset()

Resets the object to its default state. The default implementation of the Gimp.ConfigInterface only works for objects that are completely defined by their properties.

New in version 2.4.

serialize(writer, data)
Parameters:
Returns:

Whether serialization succeeded.

Return type:

bool

Serialize the Gimp.Config object.

New in version 2.8.

serialize_changed_properties(writer)
Parameters:

writer (Gimp.ConfigWriter) – a Gimp.ConfigWriter.

Returns:

True if serialization succeeded, False otherwise

Return type:

bool

This function writes all object properties that have been changed from their default values to the writer.

New in version 2.4.

serialize_properties(writer)
Parameters:

writer (Gimp.ConfigWriter) – a Gimp.ConfigWriter.

Returns:

True if serialization succeeded, False otherwise

Return type:

bool

This function writes all object properties to the writer.

New in version 2.4.

serialize_property(param_spec, writer)
Parameters:
Returns:

True if serialization succeeded, False otherwise

Return type:

bool

This function serializes a single object property to the writer.

New in version 2.4.

serialize_property_by_name(prop_name, writer)
Parameters:
Returns:

True if serialization succeeded, False otherwise

Return type:

bool

This function serializes a single object property to the writer.

New in version 2.6.

serialize_to_fd(fd, data)
Parameters:
  • fd (int) – a file descriptor, opened for writing

  • data (object or None) – user data passed to the serialize implementation.

Returns:

True if serialization succeeded, False otherwise.

Return type:

bool

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

New in version 2.4.

serialize_to_file(file, header, footer, data)
Parameters:
  • file (Gio.File) – the file to write the configuration to.

  • header (str or None) – optional file header (must be ASCII only)

  • footer (str or None) – optional file footer (must be ASCII only)

  • data (object or None) – user data passed to the serialize implementation.

Raises:

GLib.Error

Returns:

True if serialization succeeded, False otherwise.

Return type:

bool

Serializes the object properties of self 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 self's [iface`ConfigInterface`].

New in version 2.10.

serialize_to_parasite(parasite_name, parasite_flags, data)
Parameters:
  • parasite_name (str) – the new parasite’s name

  • parasite_flags (int) – the new parasite’s flags

  • data (object or None) – user data passed to the serialize implementation.

Returns:

the newly allocated parasite.

Return type:

Gimp.Parasite

Serializes the object properties of self to a [struct`Parasite`].

New in version 3.0.

serialize_to_stream(output, header, footer, data)
Parameters:
  • output (Gio.OutputStream) – the Gio.OutputStream to write the configuration to.

  • header (str or None) – optional file header (must be ASCII only)

  • footer (str or None) – optional file footer (must be ASCII only)

  • data (object or None) – user data passed to the serialize implementation.

Raises:

GLib.Error

Returns:

Whether serialization succeeded.

Return type:

bool

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

New in version 2.10.

serialize_to_string(data)
Parameters:

data (object or None) – user data passed to the serialize implementation.

Returns:

a newly allocated NUL-terminated string.

Return type:

str

Serializes the object properties of self to a string.

New in version 2.4.