Top | ![]() |
![]() |
![]() |
![]() |
char * | name | Read / Write / Construct Only |
GimpPlugIn * | plug-in | Read / Write / Construct Only |
GimpPDBProcType | procedure-type | Read / Write / Construct Only |
GObject ╰── GimpProcedure ├── GimpFileProcedure ├── GimpImageProcedure ╰── GimpThumbnailProcedure
GimpValueArray * (*GimpRunFunc) (GimpProcedure *procedure
,const GimpValueArray *args
,gpointer run_data
);
The run function is run during the lifetime of the GIMP session, each time a plug-in procedure is called.
procedure |
the GimpProcedure that runs. |
|
args |
the |
|
run_data |
the run_data given in |
[closure] |
Since: 3.0
GimpProcedure * gimp_procedure_new (GimpPlugIn *plug_in
,const gchar *name
,GimpPDBProcType proc_type
,GimpRunFunc run_func
,gpointer run_data
,GDestroyNotify run_data_destroy
);
Creates a new procedure named name
which will call run_func
when
invoked.
The name
parameter is mandatory and should be unique, or it will
overwrite an already existing procedure (overwrite procedures only
if you know what you're doing).
proc_type
should be GIMP_PDB_PROC_TYPE_PLUGIN
for "normal" plug-ins.
Using GIMP_PDB_PROC_TYPE_EXTENSION
means that the plug-in will add
temporary procedures. Therefore, the GIMP core will wait until the
GIMP_PDB_PROC_TYPE_EXTENSION
procedure has called
gimp_procedure_extension_ready()
, which means that the procedure
has done its initialization, installed its temporary procedures and
is ready to run.
Not calling gimp_procedure_extension_ready()
from a
GIMP_PDB_PROC_TYPE_EXTENSION
procedure will cause the GIMP core to
lock up.
Additionally, a GIMP_PDB_PROC_TYPE_EXTENSION
procedure with no
arguments added is an "automatic" extension that will be
automatically started on each GIMP startup.
GIMP_PDB_PROC_TYPE_TEMPORARY
must be used for temporary procedures
that are created during a plug-ins lifetime. They must be added to
the GimpPlugIn using gimp_plug_in_add_temp_procedure()
.
run_func
is called via gimp_procedure_run()
.
For GIMP_PDB_PROC_TYPE_PLUGIN
and GIMP_PDB_PROC_TYPE_EXTENSION
procedures the call of run_func
is basically the lifetime of the
plug-in.
plug_in |
a GimpPlugIn. |
|
name |
the new procedure's name. |
|
proc_type |
the new procedure's GimpPDBProcType. |
|
run_func |
the run function for the new procedure. |
|
run_data |
user data passed to |
|
run_data_destroy |
free function for |
[nullable] |
Since: 3.0
GimpPlugIn *
gimp_procedure_get_plug_in (GimpProcedure *procedure
);
Since: 3.0
const gchar *
gimp_procedure_get_name (GimpProcedure *procedure
);
Since: 3.0
GimpPDBProcType
gimp_procedure_get_proc_type (GimpProcedure *procedure
);
Since: 3.0
void gimp_procedure_set_image_types (GimpProcedure *procedure
,const gchar *image_types
);
This is a comma separated list of image types, or actually drawable types, that this procedure can deal with. Wildcards are possible here, so you could say "RGB*" instead of "RGB, RGBA" or "*" for all image types.
Supported types are "RGB", "GRAY", "INDEXED" and their variants with alpha.
Since: 3.0
const gchar *
gimp_procedure_get_image_types (GimpProcedure *procedure
);
This function retrieves the list of image types the procedure can
operate on. See gimp_procedure_set_image_types()
.
Since: 3.0
void gimp_procedure_set_menu_label (GimpProcedure *procedure
,const gchar *menu_label
);
Sets the label to use for the procedure
's menu entry, The
location(s) where to register in the menu hierarchy is chosen using
gimp_procedure_add_menu_path()
.
For translations of menu labels to work properly, menu_label
should only be marked for translation but passed to this function
untranslated, for example using N_("Label"). GIMP will look up the
translation in the textdomain registered for the plug-in.
Since: 3.0
const gchar *
gimp_procedure_get_menu_label (GimpProcedure *procedure
);
Since: 3.0
void gimp_procedure_add_menu_path (GimpProcedure *procedure
,const gchar *menu_path
);
Adds a menu path to the procedure. Only procedures which have a menu label can add a menu path.
Menu paths are untranslated paths to menus and submenus with the syntax:
<Prefix>/Path/To/Submenu
for instance:
<Image>/Layer/Transform
See also: gimp_plug_in_add_menu_branch()
.
Since: 3.0
GList *
gimp_procedure_get_menu_paths (GimpProcedure *procedure
);
the procedure
's
menu paths as added with gimp_procedure_add_menu_path()
.
[transfer none][element-type gchar*]
Since: 3.0
void gimp_procedure_set_icon_name (GimpProcedure *procedure
,const gchar *icon_name
);
Sets the icon for procedure
to the icon referenced by icon_name
.
Since: 3.0
void gimp_procedure_set_icon_file (GimpProcedure *procedure
,GFile *file
);
Sets the icon for procedure
to the contents of an image file.
Since: 3.0
void gimp_procedure_set_icon_pixbuf (GimpProcedure *procedure
,GdkPixbuf *pixbuf
);
Sets the icon for procedure
to pixbuf
.
Since: 3.0
GimpIconType
gimp_procedure_get_icon_type (GimpProcedure *procedure
);
Gets the type of data set as procedure
's icon. Depending on the
result, you can call the relevant specific function, such as
gimp_procedure_get_icon_name()
.
Since: 3.0
const gchar *
gimp_procedure_get_icon_name (GimpProcedure *procedure
);
Gets the name of the icon if one was set for procedure
.
Since: 3.0
GFile *
gimp_procedure_get_icon_file (GimpProcedure *procedure
);
Gets the file of the icon if one was set for procedure
.
Since: 3.0
GdkPixbuf *
gimp_procedure_get_icon_pixbuf (GimpProcedure *procedure
);
Gets the GdkPixbuf of the icon if an icon was set this way for
procedure
.
Since: 3.0
void gimp_procedure_set_documentation (GimpProcedure *procedure
,const gchar *blurb
,const gchar *help
,const gchar *help_id
);
blurb
is used as the procedure
's tooltip when represented in the UI,
for example as a menu entry.
For translations of tooltips to work properly, blurb
should only
be marked for translation but passed to this function untranslated,
for example using N_("Blurb"). GIMP will look up the translation in
the textdomain registered for the plug-in.
help
is a free-form text that's meant as documentation for
developers of scripts and plug-ins.
Sets various documentation strings on procedure
.
procedure |
||
blurb |
The |
|
help |
The |
|
help_id |
The |
Since: 3.0
const gchar *
gimp_procedure_get_blurb (GimpProcedure *procedure
);
Since: 3.0
const gchar *
gimp_procedure_get_help (GimpProcedure *procedure
);
Since: 3.0
const gchar *
gimp_procedure_get_help_id (GimpProcedure *procedure
);
Since: 3.0
void gimp_procedure_set_attribution (GimpProcedure *procedure
,const gchar *authors
,const gchar *copyright
,const gchar *date
);
Sets various attribution strings on procedure
.
procedure |
||
authors |
The |
|
copyright |
The |
|
date |
The |
Since: 3.0
const gchar *
gimp_procedure_get_authors (GimpProcedure *procedure
);
Since: 3.0
const gchar *
gimp_procedure_get_copyright (GimpProcedure *procedure
);
Since: 3.0
const gchar *
gimp_procedure_get_date (GimpProcedure *procedure
);
Since: 3.0
GParamSpec * gimp_procedure_add_argument (GimpProcedure *procedure
,GParamSpec *pspec
);
Add a new argument to procedure
according to pspec
specifications.
The arguments will be ordered according to the call order to
gimp_procedure_add_argument()
and
gimp_procedure_add_argument_from_property()
.
Since: 3.0
GParamSpec * gimp_procedure_add_aux_argument (GimpProcedure *procedure
,GParamSpec *pspec
);
Add a new auxiliary argument to procedure
according to pspec
specifications.
Auxiliary arguments are not passed to the procedure
in run()
and
are not known to the PDB. They are however members of the
GimpProcedureConfig created by gimp_procedure_create_config()
and
can be used to persistently store whatever last used values the
procedure
wants to remember across invocations
Since: 3.0
GParamSpec * gimp_procedure_add_return_value (GimpProcedure *procedure
,GParamSpec *pspec
);
Add a new return value to procedure
according to pspec
specifications.
The returned values will be ordered according to the call order to
gimp_procedure_add_return_value()
and
gimp_procedure_add_return_value_from_property()
.
Since: 3.0
GParamSpec * gimp_procedure_find_argument (GimpProcedure *procedure
,const gchar *name
);
Searches the procedure
's arguments for a GParamSpec called name
.
Since: 3.0
GParamSpec * gimp_procedure_find_aux_argument (GimpProcedure *procedure
,const gchar *name
);
Searches the procedure
's auxiliary arguments for a GParamSpec
called name
.
The procedure
's auxiliary argument with
name
if it exists, or NULL
otherwise.
[transfer none]
Since: 3.0
GParamSpec * gimp_procedure_find_return_value (GimpProcedure *procedure
,const gchar *name
);
Searches the procedure
's return values for a GParamSpec called
name
.
Since: 3.0
GParamSpec ** gimp_procedure_get_arguments (GimpProcedure *procedure
,gint *n_arguments
);
An array
of GParamSpec
in the order added with
gimp_procedure_add_argument()
.
[transfer none][array length=n_arguments]
Since: 3.0
GParamSpec ** gimp_procedure_get_aux_arguments (GimpProcedure *procedure
,gint *n_arguments
);
An array
of GParamSpec
in the order added with
gimp_procedure_add_aux_argument()
.
[transfer none][array length=n_arguments]
Since: 3.0
GParamSpec ** gimp_procedure_get_return_values (GimpProcedure *procedure
,gint *n_return_values
);
An array
of GParamSpec
in the order added with
gimp_procedure_add_return_value()
.
[transfer none][array length=n_return_values]
Since: 3.0
GimpValueArray *
gimp_procedure_new_arguments (GimpProcedure *procedure
);
GimpValueArray * gimp_procedure_new_return_values (GimpProcedure *procedure
,GimpPDBStatusType status
,GError *error
);
Format the expected return values from procedures, using the return
values set with gimp_procedure_add_return_value()
.
procedure |
the GimpProcedure. |
|
status |
the success status of the procedure run. |
|
error |
an optional GError. This parameter should be set if
|
[in][nullable][transfer full] |
Since: 3.0
GimpValueArray * gimp_procedure_run (GimpProcedure *procedure
,GimpValueArray *args
);
Runs the procedure, calling the run_func given in gimp_procedure_new()
.
Since: 3.0
void
gimp_procedure_extension_ready (GimpProcedure *procedure
);
Notify the main GIMP application that the extension has been properly initialized and is ready to run.
This function must be called from every procedure's GimpRunFunc that was created as GIMP_PDB_PROC_TYPE_EXTENSION.
Subsequently, extensions can process temporary procedure run
requests using either gimp_plug_in_extension_enable()
or
gimp_plug_in_extension_process()
.
See also: gimp_procedure_new()
.
Since: 3.0
GimpProcedureConfig *
gimp_procedure_create_config (GimpProcedure *procedure
);
Create a GimpConfig with properties that match procedure
's arguments.
Since: 3.0
struct GimpProcedureClass { GObjectClass parent_class; void (* install) (GimpProcedure *procedure); void (* uninstall) (GimpProcedure *procedure); GimpValueArray * (* run) (GimpProcedure *procedure, const GimpValueArray *args); GimpProcedureConfig * (* create_config) (GimpProcedure *procedure, GParamSpec **args, gint n_args); /* Padding for future expansion */ };
called to install the procedure with the main GIMP application. This is an implementation detail and must never be called by any plug-in code. |
||
called to uninstall the procedure from the main GIMP application. This is an implementation detail and must never be called by any plug-in code. |
||
called when the procedure is executed via |
||
called when a GimpConfig object is created using
|
Since: 3.0
“name”
property “name” char *
The procedure's name.
Owner: GimpProcedure
Flags: Read / Write / Construct Only
Default value: NULL
“plug-in”
property“plug-in” GimpPlugIn *
The GimpPlugIn of this plug-in process.
Owner: GimpProcedure
Flags: Read / Write / Construct Only