Gimp.Procedure¶
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The procedure’s name |
||
r/w/co |
The |
||
r/w/co |
The procedure’s type |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gimp.Procedure(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Procedures are registered functions which can be run across GIMP ecosystem. They can be created by plug-ins and can then run by the core application when called from menus (or through other interaction depending on specific procedure subclasses).
A plug-in can also run procedures created by the core, but also the ones created by other plug-ins (see [classPDB]).
- classmethod new(plug_in, name, proc_type, run_func, *run_data)¶
- Parameters:
plug_in (
Gimp.PlugIn
) – aGimp.PlugIn
.name (
str
) – the new procedure’s name.proc_type (
Gimp.PDBProcType
) – the new procedure’sGimp.PDBProcType
.run_func (
Gimp.RunFunc
) – the run function for the new procedure.
- Returns:
a new
Gimp.Procedure
.- Return type:
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 [enum`Gimp`.PDBProcType.PLUGIN] for “normal” plug-ins.
Using [enum`Gimp`.PDBProcType.PERSISTENT] means that the plug-in will add temporary procedures. Therefore, the GIMP core will wait until the
Gimp.PDBProcType.PERSISTENT
procedure has called [method`Procedure`.persistent_ready], which means that the procedure has done its initialization, installed its temporary procedures and is ready to run.*Not calling [method`Procedure`.persistent_ready] from a
Gimp.PDBProcType.PERSISTENT
procedure will cause the GIMP core to lock up.*Additionally, a
Gimp.PDBProcType.PERSISTENT
procedure with no arguments added is an “automatic” extension that will be automatically started on each GIMP startup.[enum`Gimp`.PDBProcType.TEMPORARY] must be used for temporary procedures that are created during a plug-ins lifetime. They must be added to the
Gimp.PlugIn
using [method`PlugIn`.add_temp_procedure].run_func is called via [method`Procedure`.run].
For
Gimp.PDBProcType.PLUGIN
andGimp.PDBProcType.PERSISTENT
procedures the call of run_func is basically the lifetime of the plug-in.New in version 3.0.
- add_boolean_argument(name, nick, blurb, value, flags)¶
- Parameters:
Add a new boolean argument to self.
New in version 3.0.
- add_boolean_aux_argument(name, nick, blurb, value, flags)¶
- Parameters:
Add a new boolean auxiliary argument to self.
New in version 3.0.
- add_boolean_return_value(name, nick, blurb, value, flags)¶
- Parameters:
Add a new boolean return value to self.
New in version 3.0.
- add_brush_argument(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Brush
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s brush as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Brush
argument to self.New in version 3.0.
- add_brush_aux_argument(name, nick, blurb, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Brush
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s brush as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Brush
auxiliary argument to self.New in version 3.0.
- add_brush_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Brush
return value to self.New in version 3.0.
- add_bytes_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
GLib.Bytes
argument to self.New in version 3.0.
- add_bytes_aux_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
GLib.Bytes
auxiliary argument to self.New in version 3.0.
- add_bytes_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
GLib.Bytes
return value to self.New in version 3.0.
- add_channel_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channel
argument to self.New in version 3.0.
- add_channel_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channel
auxiliary argument to self.New in version 3.0.
- add_channel_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channel
return value to self.New in version 3.0.
- add_choice_argument(name, nick, blurb, choice, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.choice (
Gimp.Choice
) – theGimp.Choice
value (
str
) – the default value forGimp.Choice
.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Choice
argument to self.New in version 3.0.
- add_choice_aux_argument(name, nick, blurb, choice, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.choice (
Gimp.Choice
) – theGimp.Choice
value (
str
) – the default value forGimp.Choice
.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Choice
auxiliary argument to self.New in version 3.0.
- add_choice_return_value(name, nick, blurb, choice, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.choice (
Gimp.Choice
) – theGimp.Choice
value (
str
) – the default value forGimp.Choice
.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Choice
return value to self.New in version 3.0.
- add_color_argument(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
Gegl.Color
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
argument to self.New in version 3.0.
- add_color_aux_argument(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
Gegl.Color
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
auxiliary argument to self.New in version 3.0.
- add_color_from_string_argument(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
str
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
argument to self from a string representation.New in version 3.0.
- add_color_from_string_aux_argument(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
str
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
auxiliary argument to self from a string representation.New in version 3.0.
- add_color_from_string_return_value(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
str
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
return value to self from a string representation.New in version 3.0.
- add_color_return_value(name, nick, blurb, has_alpha, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.has_alpha (
bool
) – whether the argument has transparency.value (
Gegl.Color
) – the defaultGegl.Color
value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gegl.Color
return value to self.New in version 3.0.
- add_core_object_array_argument(name, nick, blurb, object_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.blurb (
str
orNone
) – a more detailed help description. object_type the type of object stored in the arrayobject_type (
GObject.GType
) –flags (
GObject.ParamFlags
) – argument flags.
Add a new object array argument to self.
New in version 3.0.
- add_core_object_array_aux_argument(name, nick, blurb, object_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.blurb (
str
orNone
) – a more detailed help description. object_type the type of object stored in the arrayobject_type (
GObject.GType
) –flags (
GObject.ParamFlags
) – argument flags.
Add a new object array auxiliary argument to self.
New in version 3.0.
- add_core_object_array_return_value(name, nick, blurb, object_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.blurb (
str
orNone
) – a more detailed help description. object_type the type of object stored in the arrayobject_type (
GObject.GType
) –flags (
GObject.ParamFlags
) – argument flags.
Add a new object array return value to self.
New in version 3.0.
- add_display_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Display
argument to self.New in version 3.0.
- add_display_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Display
auxiliary argument to self.New in version 3.0.
- add_display_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Display
return value to self.New in version 3.0.
- add_double_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new floating-point in double precision argument to self.
New in version 3.0.
- add_double_array_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new double array argument to self.
New in version 3.0.
- add_double_array_aux_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new double array auxiliary argument to self.
New in version 3.0.
- add_double_array_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new double array return value to self.
New in version 3.0.
- add_double_aux_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new floating-point in double precision auxiliary argument to self.
New in version 3.0.
- add_double_return_value(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new floating-point in double precision return value to self.
New in version 3.0.
- add_drawable_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Drawable
argument to self.New in version 3.0.
- add_drawable_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Drawable
auxiliary argument to self.New in version 3.0.
- add_drawable_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Drawable
return value to self.New in version 3.0.
- add_enum_argument(name, nick, blurb, enum_type, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.enum_type (
GObject.GType
) – theGObject.GType
for this argumentvalue (
int
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new enum argument to self.
New in version 3.0.
- add_enum_aux_argument(name, nick, blurb, enum_type, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.enum_type (
GObject.GType
) – theGObject.GType
for this argumentvalue (
int
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new enum auxiliary argument to self.
New in version 3.0.
- add_enum_return_value(name, nick, blurb, enum_type, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.enum_type (
GObject.GType
) – theGObject.GType
for this argumentvalue (
int
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new enum return value to self.
New in version 3.0.
- add_file_argument(name, nick, blurb, action, none_ok, default_file, flags)¶
- Parameters:
name (
str
) – The name of the argument to be created.nick (
str
) – The label used in #GimpProcedureDialog.action (
Gimp.FileChooserAction
) – The type of file to expect.default_file (
Gio.File
orNone
) – File to use if none is assigned.flags (
GObject.ParamFlags
) – Argument flags.
Add a new
Gio.File
argument to self.New in version 3.0.
- add_file_aux_argument(name, nick, blurb, action, none_ok, default_file, flags)¶
- Parameters:
name (
str
) – The name of the argument to be created.nick (
str
) – The label used in #GimpProcedureDialog.action (
Gimp.FileChooserAction
) – The type of file to expect.default_file (
Gio.File
orNone
) – File to use if none is assigned.flags (
GObject.ParamFlags
) – Argument flags.
Add a new
Gio.File
auxiliary argument to self.New in version 3.0.
- add_file_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gio.File
return value to self.New in version 3.0.
- add_font_argument(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_to_context (
bool
) – Use the context’s font as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Font
argument to self.New in version 3.0.
- add_font_aux_argument(name, nick, blurb, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_to_context (
bool
) – Use the context’s font as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Font
auxiliary argument to self.New in version 3.0.
- add_font_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Font
return value to self.New in version 3.0.
- add_gradient_argument(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Gradient
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s gradient as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Gradient
argument to self.New in version 3.0.
- add_gradient_aux_argument(name, nick, blurb, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Gradient
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s gradient as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Gradient
auxiliary argument to self.New in version 3.0.
- add_gradient_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Gradient
return value to self.New in version 3.0.
- add_group_layer_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new [class`GroupLayer`] argument to self.
New in version 3.0.
- add_group_layer_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new [class`GroupLayer`] auxiliary argument to self.
New in version 3.0.
- add_group_layer_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new [class`GroupLayer`] return value to self.
New in version 3.0.
- add_image_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Image
argument to self.New in version 3.0.
- add_image_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Image
auxiliary argument to self.New in version 3.0.
- add_image_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Image
return value to self.New in version 3.0.
- add_int32_array_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new integer array argument to self.
New in version 3.0.
- add_int32_array_aux_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new integer array auxiliary argument to self.
New in version 3.0.
- add_int32_array_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new integer array return value to self.
New in version 3.0.
- add_int_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new integer argument to self.
New in version 3.0.
- add_int_aux_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new integer auxiliary argument to self.
New in version 3.0.
- add_int_return_value(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new integer return value to self.
New in version 3.0.
- add_item_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Item
argument to self.New in version 3.0.
- add_item_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Item
auxiliary argument to self.New in version 3.0.
- add_item_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Item
return value to self.New in version 3.0.
- add_layer_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layer
argument to self.New in version 3.0.
- add_layer_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layer
auxiliary argument to self.New in version 3.0.
- add_layer_mask_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMask
argument to self.New in version 3.0.
- add_layer_mask_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMask
auxiliary argument to self.New in version 3.0.
- add_layer_mask_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMask
return value to self.New in version 3.0.
- add_layer_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layer
return value to self.New in version 3.0.
- Parameters:
menu_path (
str
) – The self's additional 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 known menus and submenus with the syntax
<Prefix>/Path/To/Submenu
, for example<Image>/Layer/Transform
. GIMP will localize these. Nevertheless you should localize unknown parts of the path. For instance, say you want to create procedure to create customized layers and add aCreate
submenu which you want to localize from your plug-in with gettext. You could call:``C path = g_build_path (“/”, “<Image>/Layer”, _(“Create”), NULL); gimp_procedure_add_menu_path (procedure, path); g_free (path); ``
See also:
Gimp.PlugIn.add_menu_branch
().GIMP menus also have a concept of named section. For instance, say you are creating a plug-in which you want to show next to the “Export”, “Export As” plug-ins in the File menu. You would add it to the menu path “File/[Export]”. If you actually wanted to create a submenu called “[Export]” (with square brackets), double the brackets: “File/[[Export]]”
See also: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/menus/image-menu.ui.in.in
This function will place your procedure to the bottom of the selected path or section. Order is not assured relatively to other plug-ins.
New in version 3.0.
- add_palette_argument(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Palette
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s palette as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Palette
argument to self.New in version 3.0.
- add_palette_aux_argument(name, nick, blurb, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Palette
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s palette as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Palette
auxiliary argument to self.New in version 3.0.
- add_palette_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Palette
return value to self.New in version 3.0.
- add_param_argument(name, nick, blurb, param_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.param_type (
GObject.GType
) – the #GPParamType for this argumentflags (
GObject.ParamFlags
) – argument flags.
Add a new param argument to self.
New in version 3.0.
- add_param_aux_argument(name, nick, blurb, param_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.param_type (
GObject.GType
) – the #GPParamType for this argumentflags (
GObject.ParamFlags
) – argument flags.
Add a new param auxiliary argument to self.
New in version 3.0.
- add_param_return_value(name, nick, blurb, param_type, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.param_type (
GObject.GType
) – the #GPParamType for this argumentflags (
GObject.ParamFlags
) – argument flags.
Add a new param return value to self.
New in version 3.0.
- add_parasite_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Parasite
argument to self.New in version 3.0.
- add_parasite_aux_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Parasite
auxiliary argument to self.New in version 3.0.
- add_parasite_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Parasite
return value to self.New in version 3.0.
- add_path_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Path
argument to self.New in version 3.0.
- add_path_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Path
auxiliary argument to self.New in version 3.0.
- add_path_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Path
return value to self.New in version 3.0.
- add_pattern_argument(name, nick, blurb, none_ok, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Pattern
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s pattern as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Pattern
argument to self.New in version 3.0.
- add_pattern_aux_argument(name, nick, blurb, default_value, default_to_context, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Pattern
orNone
) – default valuedefault_to_context (
bool
) – Use the context’s pattern as default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Pattern
auxiliary argument to self.New in version 3.0.
- add_pattern_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Pattern
return value to self.New in version 3.0.
- add_resource_argument(name, nick, blurb, none_ok, default_value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Resource
orNone
) – default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Resource
argument to self.New in version 3.0.
- add_resource_aux_argument(name, nick, blurb, default_value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.default_value (
Gimp.Resource
orNone
) – default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Resource
auxiliary argument to self.New in version 3.0.
- add_resource_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Resource
return value to self.New in version 3.0.
- add_selection_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selection
argument to self.New in version 3.0.
- add_selection_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selection
auxiliary argument to self.New in version 3.0.
- add_selection_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selection
return value to self.New in version 3.0.
- add_string_argument(name, nick, blurb, value, flags)¶
- Parameters:
Add a new string argument to self.
New in version 3.0.
- add_string_array_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new string array argument to self.
New in version 3.0.
- add_string_array_aux_argument(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new string array auxiliary argument to self.
New in version 3.0.
- add_string_array_return_value(name, nick, blurb, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.flags (
GObject.ParamFlags
) – argument flags.
Add a new string array return value to self.
New in version 3.0.
- add_string_aux_argument(name, nick, blurb, value, flags)¶
- Parameters:
Add a new string auxiliary argument to self.
New in version 3.0.
- add_string_return_value(name, nick, blurb, value, flags)¶
- Parameters:
Add a new string return value to self.
New in version 3.0.
- add_text_layer_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.TextLayer
argument to self.New in version 3.0.
- add_text_layer_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.TextLayer
auxiliary argument to self.New in version 3.0.
- add_text_layer_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.TextLayer
return value to self.New in version 3.0.
- add_uint_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new unsigned integer argument to self.
New in version 3.0.
- add_uint_aux_argument(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new unsigned integer auxiliary argument to self.
New in version 3.0.
- add_uint_return_value(name, nick, blurb, min, max, value, flags)¶
- Parameters:
Add a new unsigned integer return value to self.
New in version 3.0.
- add_unit_argument(name, nick, blurb, show_pixels, show_percent, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.show_pixels (
bool
) – whether to allow pixels as a valid optionshow_percent (
bool
) – whether to allow percent as a valid optionvalue (
Gimp.Unit
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Unit
argument to self.New in version 3.0.
- add_unit_aux_argument(name, nick, blurb, show_pixels, show_percent, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.show_pixels (
bool
) – whether to allow pixels as a valid optionshow_percent (
bool
) – whether to allow percent as a valid optionvalue (
Gimp.Unit
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Unit
auxiliary argument to self.New in version 3.0.
- add_unit_return_value(name, nick, blurb, show_pixels, show_percent, value, flags)¶
- Parameters:
name (
str
) – the name of the argument to be created.nick (
str
) – the label used in #GimpProcedureDialog.show_pixels (
bool
) – whether to allow pixels as a valid optionshow_percent (
bool
) – whether to allow percent as a valid optionvalue (
Gimp.Unit
) – the default value.flags (
GObject.ParamFlags
) – argument flags.
Add a new
Gimp.Unit
return value to self.New in version 3.0.
- create_config()¶
- Returns:
The new
Gimp.Config
.- Return type:
Create a
Gimp.Config
with properties that match self's arguments, to be used in [method`Procedure`.run_config] method.New in version 3.0.
- find_argument(name)¶
- Parameters:
name (
str
) – An argument name- Returns:
The self's argument with name if it exists, or
None
otherwise.- Return type:
Searches the self's arguments for a
GObject.ParamSpec
called name.New in version 3.0.
- find_aux_argument(name)¶
- Parameters:
name (
str
) – An auxiliary argument name- Returns:
The self's auxiliary argument with name if it exists, or
None
otherwise.- Return type:
Searches the self's auxiliary arguments for a
GObject.ParamSpec
called name.New in version 3.0.
- find_return_value(name)¶
- Parameters:
name (
str
) – A return value name- Returns:
The self's return values with name if it exists, or
None
otherwise.- Return type:
Searches the self's return values for a
GObject.ParamSpec
called name.New in version 3.0.
- get_argument_sync(arg_name)¶
- Parameters:
arg_name (
str
) – the name of one of self's arguments or auxiliary arguments- Returns:
The
Gimp.ArgumentSync
value set withGimp.Procedure.set_argument_sync
():- Return type:
New in version 3.0.
- get_arguments()¶
- Returns:
An array of GParamSpec in the order they were added in.
- Return type:
New in version 3.0.
- get_authors()¶
- Returns:
The procedure’s authors given in [method`Procedure`.set_attribution].
- Return type:
New in version 3.0.
- get_aux_arguments()¶
- Returns:
An array of GParamSpec in the order they were added in.
- Return type:
New in version 3.0.
- get_blurb()¶
- Returns:
The procedure’s blurb given in [method`Procedure`.set_documentation].
- Return type:
New in version 3.0.
- get_copyright()¶
- Returns:
The procedure’s copyright given in [method`Procedure`.set_attribution].
- Return type:
New in version 3.0.
- get_date()¶
- Returns:
The procedure’s date given in [method`Procedure`.set_attribution].
- Return type:
New in version 3.0.
- get_help()¶
- Returns:
The procedure’s help text given in [method`Procedure`.set_documentation].
- Return type:
New in version 3.0.
- get_help_id()¶
- Returns:
The procedure’s help ID given in [method`Procedure`.set_documentation].
- Return type:
New in version 3.0.
- get_icon_file()¶
-
Gets the file of the icon if one was set for self.
New in version 3.0.
- get_icon_name()¶
-
Gets the name of the icon if one was set for self.
New in version 3.0.
- get_icon_pixbuf()¶
- Returns:
the icon pixbuf or
None
if no icon name was set.- Return type:
Gets the
GdkPixbuf.Pixbuf
of the icon if an icon was set this way for self.New in version 3.0.
- get_icon_type()¶
- Returns:
the
Gimp.IconType
of self's icon.- Return type:
Gets the type of data set as self's icon. Depending on the result, you can call the relevant specific function, such as [method`Procedure`.get_icon_name].
New in version 3.0.
- get_image_types()¶
- Returns:
The image types.
- Return type:
This function retrieves the list of image types the procedure can operate on. See
Gimp.Procedure.set_image_types
().New in version 3.0.
- Returns:
The procedure’s menu label given in
Gimp.Procedure.set_menu_label
().- Return type:
New in version 3.0.
- Returns:
the self's menu paths as added with
Gimp.Procedure.add_menu_path
().- Return type:
[
str
]
New in version 3.0.
- get_name()¶
- Returns:
The procedure’s name given in [ctor`Procedure`.new].
- Return type:
New in version 3.0.
- get_plug_in()¶
- Returns:
The
Gimp.PlugIn
given in [ctor`Procedure`.new].- Return type:
New in version 3.0.
- get_proc_type()¶
- Returns:
The procedure’s type given in [ctor`Procedure`.new].
- Return type:
New in version 3.0.
- get_return_values()¶
- Returns:
An array of GParamSpec in the order they were added in.
- Return type:
New in version 3.0.
- get_sensitivity_mask()¶
- Returns:
The procedure’s sensitivity mask given in [method`Procedure`.set_sensitivity_mask].
- Return type:
New in version 3.0.
- is_internal()¶
- Returns:
Whether self is an internal procedure or not.
- Return type:
Provide the information if self is an internal procedure. Only a procedure looked up in the [class`Gimp`.PDB] can be internal. Procedures created by a plug-in in particular are never internal.
New in version 3.0.
- new_return_values(status, error)¶
- Parameters:
status (
Gimp.PDBStatusType
) – the success status of the procedure run.error (
GLib.Error
orNone
) – an optionalGLib.Error
. This parameter should be set if status is eitherGimp.PDBStatusType.EXECUTION_ERROR
orGimp.PDBStatusType.CALLING_ERROR
.
- Returns:
the expected
Gimp.ValueArray
as could be returned by a [callback`RunFunc`].- Return type:
Format the expected return values from procedures.
New in version 3.0.
- persistent_ready()¶
Notify the main GIMP application that the persistent procedure has been properly initialized and is ready to run.
This function _must_ be called from every procedure’s [callback`RunFunc`] that was created as [enum`Gimp`.PDBProcType.PERSISTENT].
Subsequently, extensions can process temporary procedure run requests using either [method`PlugIn`.persistent_enable] or [method`PlugIn`.persistent_process].
See also: [ctor`Procedure`.new].
New in version 3.0.
- run(config)¶
- Parameters:
config (
Gimp.ProcedureConfig
orNone
) – the self's arguments.- Returns:
The self's return values.
- Return type:
Runs self, calling the run_func given in [ctor`Procedure`.new].
Create config at default values with [method`Gimp`.Procedure.create_config] then set any argument you wish to change from defaults with [method`GObject`.Object.set].
If config is
None
, the default arguments of self will be used.New in version 3.0.
- set_argument_sync(arg_name, sync)¶
- Parameters:
arg_name (
str
) – the name of one of self's arguments or auxiliary arguments.sync (
Gimp.ArgumentSync
) – how to sync the argument or auxiliary argument.
When the procedure’s run() function exits, a
Gimp.Procedure
's arguments or auxiliary arguments can be automatically synced with aGimp.Parasite
of theGimp.Image
the procedure is running on.In order to enable this, set sync to
Gimp.ArgumentSync.PARASITE
.Currently, it is possible to sync a string argument of type
GObject.ParamSpecString
with an image parasite of the same name, for example the “gimp-comment” parasite in file save procedures.New in version 3.0.
- set_attribution(authors, copyright, date)¶
- Parameters:
Sets various attribution strings on self.
New in version 3.0.
- set_documentation(blurb, help, help_id)¶
- Parameters:
Sets various documentation strings on self:
blurb is used for instance as the self's tooltip when represented in the UI such as a menu entry.
help is a free-form text that’s meant as additional documentation for developers of scripts and plug-ins. If the blurb and the argument names and descriptions are enough for a quite self-explanatory procedure, you may set help to
None
, rather than setting an uninformative help (avoid setting the same text as blurb or redundant information).
Plug-ins are responsible for their own translations. You are expected to send localized strings of blurb and help to GIMP if your plug-in is internationalized.
New in version 3.0.
- set_icon_file(file)¶
-
Sets the icon for self to the contents of an image file.
New in version 3.0.
- set_icon_name(icon_name)¶
-
Sets the icon for self to the icon referenced by icon_name.
New in version 3.0.
- set_icon_pixbuf(pixbuf)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
orNone
) – aGdkPixbuf.Pixbuf
.
Sets the icon for self to pixbuf.
New in version 3.0.
- set_image_types(image_types)¶
- Parameters:
image_types (
str
) – The image types this procedure can operate on.
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.
New in version 3.0.
- Parameters:
menu_label (
str
) – The self's menu label.
Sets the label to use for the self's menu entry, The location(s) where to register in the menu hierarchy is chosen using
Gimp.Procedure.add_menu_path
().Plug-ins are responsible for their own translations. You are expected to send localized strings to GIMP if your plug-in is internationalized.
New in version 3.0.
- set_sensitivity_mask(sensitivity_mask)¶
- Parameters:
sensitivity_mask (
int
) – A binary mask of [flags`Gimp`.ProcedureSensitivityMask].
Sets the cases when self is supposed to be sensitive or not.
Note that it will be used by the core to determine whether to show a procedure as sensitive (hence forbid running it otherwise), yet it will not forbid thid-party plug-ins for instance to run manually your registered procedure. Therefore you should still handle non-supported cases appropriately by returning with
Gimp.PDBStatusType.EXECUTION_ERROR
and a suitable error message.Similarly third-party plug-ins should verify they are allowed to call a procedure with [method`Procedure`.get_sensitivity_mask] when running with dynamic contents.
Note that by default, a procedure works on an image with one or more drawables selected. Hence not setting the mask, setting it with 0 or setting it with
GIMP_PROCEDURE_SENSITIVE_DRAWABLE | GIMP_PROCEDURE_SENSITIVE_DRAWABLES
are equivalent.New in version 3.0.
- do_install() virtual¶
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.
- do_run(args) virtual¶
- Parameters:
args (
Gimp.ValueArray
) –- Return type:
called when the procedure is executed via
Gimp.Procedure.run
(). the default implementation simply calls the procedure’sGimp.RunFunc
,Gimp.Procedure
subclasses are free to modify the passed args and call their own, subclass-specific run functions.
- do_set_sensitivity(sensitivity_mask) virtual¶
- do_uninstall() virtual¶
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.
Property Details¶
- Gimp.Procedure.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
The procedure’s name
- Gimp.Procedure.props.plug_in¶
- Name:
plug-in
- Type:
- Default Value:
- Flags:
The
Gimp.PlugIn
of this plug-in process
- Gimp.Procedure.props.procedure_type¶
- Name:
procedure-type
- Type:
- Default Value:
- Flags:
The procedure’s type