Gegl.MetadataStore¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
Name of image creator |
||
r/w/en |
Miscellaneous comment |
||
r/w/en |
Copyright notice |
||
r/w/en |
Description of image (possibly long) |
||
r/w/en |
Legal disclaimer |
||
r/en |
Name of currently active file module or |
||
r/w/en |
Units for image resolution |
||
r/w/en |
X Resolution |
||
r/w/en |
X Resolution |
||
r/w/en |
Software used to create the image |
||
r/w/en |
Device used to create the image |
||
r/w/en |
Image creation time |
||
r/w/en |
Short title or caption |
||
r/w/en |
Warning of nature of content |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
|
|
If a signal handler is connected to |
|
|
|
If a signal handler is connected to |
|
|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gegl.MetadataStore(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- declare(pspec)¶
- Parameters:
pspec (
GObject.ParamSpec) – AGObject.ParamSpec
Declare a metadata value using a
GObject.ParamSpec.
- get_description()¶
-
Get description of image.
- get_file_module_name()¶
-
Return the name registered by the current file module.
- get_resolution_unit()¶
- Returns:
- Return type:
Get the units used for resolution.
- get_resolution_x()¶
- Returns:
X resolution
- Return type:
Get the X resolution or density in dots per unit.
- get_resolution_y()¶
- Returns:
Y resolution
- Return type:
Get the Y resolution or density in dots per unit.
- get_software()¶
-
Get software used to create the image.
- get_source()¶
-
Get device used to create the image.
- get_string(name)¶
-
A slightly more efficient version of
Gegl.MetadataStore.get_value() for string values avoiding a duplication. Otherwise it behaves the sameGegl.MetadataStore.get_value().
- get_timestamp()¶
- Returns:
GLib.DateTimeorNoneif not set. Free withGLib.DateTime.unref() when done.- Return type:
Get time of original image creation.
- get_value(name, value)¶
- Parameters:
name (
str) – Metadata namevalue (
GObject.Value) – An initialisedGObject.Value.
- Returns:
An initialised
GObject.Value.- Return type:
value:
GObject.Value
Retrieve the metadata value. value must be initialised with a compatible type. If the value is unset or has not been previously declared value is unchanged and an error message is logged.
- has_value(name)¶
- Parameters:
name (
str) – Metadata name- Returns:
Trueif metadata is declared and contains a valid value.- Return type:
Test whether the
Gegl.MetadataStorecontains a value for the specified name.
- notify(pspec, shadow)¶
- Parameters:
pspec (
GObject.ParamSpec) – TheGObject.ParamSpecused to declare the variable.shadow (
bool) – The metadata variable shadows a property.
Gegl.MetadataStore.notify() is called by subclasses when the value of a metadata variable changes. It emits the::changedsignal with the variable name as the detail parameter. Set shadow =Trueif variable is shadowed by a property so that a notify signal is emitted with the property name as the detail parameter.
- register(local_name, name, transform)¶
- Parameters:
local_name (
str) – Metadata name known to file modulename (
str) – Metadata nametransform (
GObject.ValueTransform) – AGObject.ValueTransformfunction orNone
- set_comment(comment)¶
- Parameters:
comment (
str) – Comment string
Set the miscellaneous comment; conversion from GIF comment.
- set_description(description)¶
- Parameters:
description (
str) – Description string
Set description of image.
- set_disclaimer(disclaimer)¶
- Parameters:
disclaimer (
str) – Disclaimer string
Set the legal disclaimer.
- set_resolution_unit(unit)¶
- Parameters:
unit (
Gegl.ResolutionUnit) – Units as aGegl.ResolutionUnit
Set the units used for the resolution (density) values.
- set_resolution_x(resolution_x)¶
- Parameters:
resolution_x (
float) – X resolution or density
Set the X resolution or density in dots per unit.
- set_resolution_y(resolution_y)¶
- Parameters:
resolution_y (
float) – Y resolution or density
Set the Y resolution or density in dots per unit.
- set_software(software)¶
- Parameters:
software (
str) – Software string
Set software used to create the image.
- set_string(name, string)¶
-
A slightly more efficient version of
Gegl.MetadataStore.set_value() for string values avoiding a duplication. Otherwise it behaves the sameGegl.MetadataStore.set_value().
- set_timestamp(timestamp)¶
- Parameters:
timestamp (
GLib.DateTime) – AGLib.DateTime
Set time of original image creation.
- set_value(name, value)¶
- Parameters:
name (
str) – Metadata namevalue (
GObject.Value) – (nullable): A validGObject.ValueorNone
Set the specified metadata value. If value is
Nonethe default value from the associatedGObject.ParamSpecis used. This operation will fail if the value has not been previously declared. Achanged::namesignal is emitted when the value is set. If the value is shadowed by a property anotify::namesignal is also emitted.
- set_warning(warning)¶
- Parameters:
warning (
str) – Warning string
Set the warning of nature of content.
- typeof_value(name)¶
- Parameters:
name (
str) – Metadata name- Returns:
Declared
GObject.GTypeof metadata value orGObject.TYPE_INVALID.- Return type:
Get the declared type of the value in the
Gegl.MetadataStore.
- do__declare(pspec, shadow) virtual¶
- Parameters:
pspec (
GObject.ParamSpec) –shadow (
bool) –
The _declare virtual method creates a metadata variable in the underlying data store. It implements
Gegl.MetadataStore.declare(). AGObject.ParamSpecis used to describe the variable. If the metadata shadows an object property, shadow should beTrue, otherwiseFalse. It is acceptable for a subclass to provide additional variables which are implicitly declared, that is, they need not be declared usingGegl.MetadataStore.declare(), however the pspec method must still retrieve aGObject.ParamSpecdescribing such variables. This method MUST be provided by the subclass.
- do__get_value(name) virtual¶
- Parameters:
name (
str) –- Return type:
Return a pointer to a
GObject.Valuewith the value of the metadata variable orNoneif not declared or the variable does not contain a valid value. ImplementsGegl.MetadataStore.get_value(). This method MUST be provided by the subclass.
- do_has_value(name) virtual¶
- Parameters:
name (
str) – Metadata name- Returns:
Trueif metadata is declared and contains a valid value.- Return type:
Test whether the
Gegl.MetadataStorecontains a value for the specified name.
- do_register_hook(file_module_name, flags) virtual¶
-
This method is called after a file loader or saver registers a
Gegl.MetadataMapand before any further processing takes place. It is intended to allow an application to create further application-specific mappings usingGegl.MetadataStore.register().Gegl.MetadataStoreprovides a default method which emits the::mappedsignal.
- do_set_value(name, value) virtual¶
- Parameters:
name (
str) – Metadata namevalue (
GObject.Value) – (nullable): A validGObject.ValueorNone
Set the specified metadata value. If value is
Nonethe default value from the associatedGObject.ParamSpecis used. This operation will fail if the value has not been previously declared. Achanged::namesignal is emitted when the value is set. If the value is shadowed by a property anotify::namesignal is also emitted.
Signal Details¶
- Gegl.MetadataStore.signals.changed(metadata_store, pspec)¶
- Signal Name:
changed- Flags:
- Parameters:
metadata_store (
Gegl.MetadataStore) – The object which received the signalpspec (
GObject.ParamSpec) – AGObject.ParamSpecdeclaring the metadata value
::changedis emitted when a metadata value is changed. This is analogous to theGObject::notifysignal.
- Gegl.MetadataStore.signals.generate_value(metadata_store, pspec, value)¶
- Signal Name:
generate-value- Flags:
- Parameters:
metadata_store (
Gegl.MetadataStore) – The object which received the signalpspec (
GObject.ParamSpec) – AGObject.ParamSpecdeclaring the metadata valuevalue (
GObject.Value) – An initialisedGObject.Value.
- Returns:
Trueif a value is generated successfully.- value:
An initialised
GObject.Value.
- Return type:
(
bool, value:GObject.Value)
If a signal handler is connected to
::generate-valuea signal is emitted when the file module accesses a value using gegl_metadata_get_value(). The signal handler must generate a value of the type specified in the pspec argument. The signal handler’s return value indicates the success of the operation.If no handler is connected the mapped metadata value is accessed normally,
- Gegl.MetadataStore.signals.mapped(metadata_store, file_module, exclude_unmapped)¶
- Signal Name:
mapped- Flags:
- Parameters:
metadata_store (
Gegl.MetadataStore) – The object which received the signalfile_module (
str) – The file module nameexclude_unmapped (
bool) –Trueif the file module cannot handle unmapped values
::mappedis emitted after a file module registers a mapping and before other processing takes place. An application may respond to the signal by registering additional mappings or overriding existing values, for example it might override the TIFF ImageDescription tag to format multiple metadata values into the description.
- Gegl.MetadataStore.signals.parse_value(metadata_store, pspec, value)¶
- Signal Name:
parse-value- Flags:
- Parameters:
metadata_store (
Gegl.MetadataStore) – The object which received the signalpspec (
GObject.ParamSpec) – AGObject.ParamSpecdeclaring the metadata valuevalue (
GObject.Value) – AGObject.Valuecontaining the value to parse.
- Returns:
Trueif parsing is successful.- value:
A
GObject.Valuecontaining the value to parse.
- Return type:
(
bool, value:GObject.Value)
If a signal handler is connected to
::parse-valuea signal is emitted when the file module accesses a value using gegl_metadata_set_value(). The signal handler should parse the value supplied in theGObject.Valueand may set any number of metadata values usingGegl.MetadataStore.set_value().If no handler is connected the mapped metadata value is set normally,
- Gegl.MetadataStore.signals.unmapped(metadata_store, file_module, local_name)¶
- Signal Name:
unmapped- Flags:
- Parameters:
metadata_store (
Gegl.MetadataStore) – The object which received the signalfile_module (
str) – The file module namelocal_name (
str) – The unmapped metadata name as used by the file module
::unmappedis emitted when a file module tries to look up an unmapped metadata name. When the handler returns a second attempt is made to look up the metadata.
Property Details¶
- Gegl.MetadataStore.props.artist¶
- Name:
artist- Type:
- Default Value:
- Flags:
Name of image creator.
- Gegl.MetadataStore.props.comment¶
- Name:
comment- Type:
- Default Value:
- Flags:
Miscellaneous comment; conversion from GIF comment.
- Gegl.MetadataStore.props.copyright¶
- Name:
copyright- Type:
- Default Value:
- Flags:
Copyright notice.
- Gegl.MetadataStore.props.description¶
- Name:
description- Type:
- Default Value:
- Flags:
Description of image (possibly long).
- Gegl.MetadataStore.props.disclaimer¶
- Name:
disclaimer- Type:
- Default Value:
- Flags:
Legal disclaimer.
- Gegl.MetadataStore.props.file_module_name¶
- Name:
file-module-name- Type:
- Default Value:
- Flags:
Current file loader/saver module name. Valid only while a
Gegl.Metadatamapping is registered. This property is mainly provided for use in signal handlers.
- Gegl.MetadataStore.props.resolution_unit¶
- Name:
resolution-unit- Type:
- Default Value:
- Flags:
A
Gegl.ResolutionUnitspecifying units for the image resolution (density).
- Gegl.MetadataStore.props.resolution_x¶
- Name:
resolution-x- Type:
- Default Value:
300.0- Flags:
X resolution or density in dots per unit.
- Gegl.MetadataStore.props.resolution_y¶
- Name:
resolution-y- Type:
- Default Value:
300.0- Flags:
Y resolution or density in dots per unit.
- Gegl.MetadataStore.props.software¶
- Name:
software- Type:
- Default Value:
- Flags:
Software used to create the image.
- Gegl.MetadataStore.props.source¶
- Name:
source- Type:
- Default Value:
- Flags:
Device used to create the image.
- Gegl.MetadataStore.props.timestamp¶
- Name:
timestamp- Type:
- Default Value:
- Flags:
Time of original image creation.
- Gegl.MetadataStore.props.title¶
- Name:
title- Type:
- Default Value:
- Flags:
Short (one line) title or caption for image.