GimpPDB

GimpPDB — Functions for querying and changing procedural database (PDB) entries.

Functions

Object Hierarchy

    GObject
    ╰── GimpPDB

Description

Functions for querying and changing procedural database (PDB) entries.

Functions

gimp_pdb_procedure_exists ()

gboolean
gimp_pdb_procedure_exists (GimpPDB *pdb,
                           const gchar *procedure_name);

This function checks if a procedure exists in the procedural database.

Return: TRUE if the procedure exists, FALSE otherwise.

Parameters

pdb

A GimpPDB instance.

 

procedure_name

A procedure name

 

Since: 3.0


gimp_pdb_lookup_procedure ()

GimpProcedure *
gimp_pdb_lookup_procedure (GimpPDB *pdb,
                           const gchar *procedure_name);

This function returns the GimpProcedure which is registered with procedure_name if it exists, or returns NULL otherwise.

The returned GimpProcedure is owned by pdb and must not be modified.

Return: (nullable) (transfer none): A GimpProcedure, or NULL.

Parameters

pdb

A GimpPDB instance.

 

procedure_name

A procedure name

 

Since: 3.0


gimp_pdb_run_procedure ()

GimpValueArray *
gimp_pdb_run_procedure (GimpPDB *pdb,
                        const gchar *procedure_name,
                        GType first_type,
                        ...);

Runs the procedure named procedure_name with arguments given as list of (GType, value) pairs, terminated by G_TYPE_NONE.

[skip]

Parameters

pdb

the GimpPDB object.

 

procedure_name

the procedure registered name.

 

first_type

the GType of the first argument, or G_TYPE_NONE.

 

...

the call arguments.

 

Returns

the return values for the procedure call.

[transfer full]

Since: 3.0


gimp_pdb_run_procedure_valist ()

GimpValueArray *
gimp_pdb_run_procedure_valist (GimpPDB *pdb,
                               const gchar *procedure_name,
                               GType first_type,
                               va_list args);

Runs the procedure named procedure_name with args given in the order as passed to gimp_pdb_run_procedure().

[skip]

Parameters

pdb

the GimpPDB object.

 

procedure_name

the procedure registered name.

 

first_type

the GType of the first argument, or G_TYPE_NONE.

 

args

the call arguments.

 

Returns

the return values for the procedure call.

[transfer full]

Since: 3.0


gimp_pdb_run_procedure_array ()

GimpValueArray *
gimp_pdb_run_procedure_array (GimpPDB *pdb,
                              const gchar *procedure_name,
                              const GimpValueArray *arguments);

Runs the procedure named procedure_name with arguments .

Parameters

pdb

the GimpPDB object.

 

procedure_name

the procedure registered name.

 

arguments

the call arguments.

 

Returns

the return values for the procedure call.

[transfer full]

Since: 3.0


gimp_pdb_run_procedure_argv ()

GimpValueArray *
gimp_pdb_run_procedure_argv (GimpPDB *pdb,
                             const gchar *procedure_name,
                             const GValue *arguments,
                             gint n_arguments);

Runs the procedure named procedure_name with arguments .

[rename-to gimp_pdb_run_procedure]

Parameters

pdb

the GimpPDB object.

 

procedure_name

the registered name to call.

 

arguments

the call arguments or NULL.

[array length=n_arguments][nullable]

n_arguments

the number of arguments.

 

Returns

the return values for the procedure call.

[transfer full]

Since: 3.0


gimp_pdb_temp_procedure_name ()

gchar *
gimp_pdb_temp_procedure_name (GimpPDB *pdb);

Generates a unique temporary PDB name.

This function generates a temporary PDB entry name that is guaranteed to be unique.

Parameters

pdb

the GimpPDB object.

 

Returns

A unique temporary name for a temporary PDB entry. The returned value must be freed with g_free().

[transfer full]

Since: 3.0


gimp_pdb_dump_to_file ()

gboolean
gimp_pdb_dump_to_file (GimpPDB *pdb,
                       GFile *file);

Dumps the current contents of the procedural database

This procedure dumps the contents of the procedural database to the specified file . The file will contain all of the information provided for each registered procedure.

Parameters

pdb

A GimpPDB.

 

file

The dump file.

 

Returns

TRUE on success.

Since: 3.0


gimp_pdb_query_procedures ()

gchar **
gimp_pdb_query_procedures (GimpPDB *pdb,
                           const gchar *name,
                           const gchar *blurb,
                           const gchar *help,
                           const gchar *help_id,
                           const gchar *authors,
                           const gchar *copyright,
                           const gchar *date,
                           const gchar *proc_type,
                           gint *num_matches);

Queries the procedural database for its contents using regular expression matching.

This function queries the contents of the procedural database. It is supplied with eight arguments matching procedures on

{ name, blurb, help, help-id, authors, copyright, date, procedure type}.

This is accomplished using regular expression matching. For instance, to find all procedures with "jpeg" listed in the blurb, all seven arguments can be supplied as ".*", except for the second, which can be supplied as ".*jpeg.*". There are two return arguments for this procedure. The first is the number of procedures matching the query. The second is a concatenated list of procedure names corresponding to those matching the query. If no matching entries are found, then the returned string is NULL and the number of entries is 0.

Parameters

pdb

A GimpPDB.

 

name

The regex for procedure name.

 

blurb

The regex for procedure blurb.

 

help

The regex for procedure help.

 

help_id

The regex for procedure help-id.

 

authors

The regex for procedure authors.

 

copyright

The regex for procedure copyright.

 

date

The regex for procedure date.

 

proc_type

The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-in', 'GIMP Extension', 'Temporary Procedure' }.

 

num_matches

The number of matching procedures.

[out]

Returns

The list of procedure names. Free with g_strfreev().

[array length=num_matches][transfer full]

Since: 3.0


gimp_pdb_get_last_error ()

const gchar *
gimp_pdb_get_last_error (GimpPDB *pdb);

Retrieves the error message from the last procedure call.

If a procedure call fails, then it might pass an error message with the return values. Plug-ins that are using the libgimp C wrappers don't access the procedure return values directly. Thus GimpPDB stores the error message and makes it available with this function. The next procedure call unsets the error message again.

The returned string is owned by pdb and must not be freed or modified.

Parameters

pdb

a GimpPDB.

 

Returns

the error message

Since: 3.0


gimp_pdb_get_last_status ()

GimpPDBStatusType
gimp_pdb_get_last_status (GimpPDB *pdb);

Retrieves the status from the last procedure call.

Parameters

pdb

a GimpPDB.

 

Returns

the GimpPDBStatusType.

Since: 3.0


gimp_pdb_get_data ()

gboolean
gimp_pdb_get_data (const gchar *identifier,
                   gpointer data);

Returns data associated with the specified identifier.

This procedure returns any data which may have been associated with the specified identifier. The data is copied into the given memory location.

Parameters

identifier

The identifier associated with data.

 

data

A byte array containing data.

 

Returns

TRUE on success, FALSE if no data has been associated with the identifier


gimp_pdb_get_data_size ()

gint
gimp_pdb_get_data_size (const gchar *identifier);

Returns size of data associated with the specified identifier.

This procedure returns the size of any data which may have been associated with the specified identifier. If no data has been associated with the identifier, an error is returned.

Parameters

identifier

The identifier associated with data.

 

Returns

The number of bytes in the data.


gimp_pdb_set_data ()

gboolean
gimp_pdb_set_data (const gchar *identifier,
                   gconstpointer data,
                   guint32 bytes);

Associates the specified identifier with the supplied data.

This procedure associates the supplied data with the provided identifier. The data may be subsequently retrieved by a call to 'procedural-db-get-data'.

Parameters

identifier

The identifier associated with data.

 

data

A byte array containing data.

 

bytes

The number of bytes in the data

 

Returns

TRUE on success.