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.PERSISTENTprocedure 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.PERSISTENTprocedure will cause the GIMP core to lock up.*Additionally, a
Gimp.PDBProcType.PERSISTENTprocedure 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.PlugInusing [method`PlugIn`.add_temp_procedure].run_func is called via [method`Procedure`.run].
For
Gimp.PDBProcType.PLUGINandGimp.PDBProcType.PERSISTENTprocedures 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.BrushorNone) – default valuedefault_to_context (
bool) – Use the context’s brush as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Brushargument 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.BrushorNone) – default valuedefault_to_context (
bool) – Use the context’s brush as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Brushauxiliary 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.Brushreturn 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.Bytesargument 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.Bytesauxiliary 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.Bytesreturn value to self.New in version 3.0.
- add_channel_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channelargument to self.New in version 3.0.
- add_channel_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channelauxiliary argument to self.New in version 3.0.
- add_channel_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Channelreturn 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.Choicevalue (
str) – the default value forGimp.Choice.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Choiceargument 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.Choicevalue (
str) – the default value forGimp.Choice.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Choiceauxiliary 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.Choicevalue (
str) – the default value forGimp.Choice.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Choicereturn 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorargument 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorauxiliary 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorargument 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorauxiliary 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorreturn 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.Colorvalue.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gegl.Colorreturn 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 (
strorNone) – 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 (
strorNone) – 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 (
strorNone) – 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.Displayargument to self.New in version 3.0.
- add_display_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Displayauxiliary argument to self.New in version 3.0.
- add_display_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Displayreturn 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.Drawableargument to self.New in version 3.0.
- add_drawable_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Drawableauxiliary argument to self.New in version 3.0.
- add_drawable_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Drawablereturn 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.GTypefor 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.GTypefor 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.GTypefor 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.FileorNone) – File to use if none is assigned.flags (
GObject.ParamFlags) – Argument flags.
Add a new
Gio.Fileargument 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.FileorNone) – File to use if none is assigned.flags (
GObject.ParamFlags) – Argument flags.
Add a new
Gio.Fileauxiliary 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.Filereturn 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.Fontargument 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.Fontauxiliary 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.Fontreturn 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.GradientorNone) – default valuedefault_to_context (
bool) – Use the context’s gradient as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Gradientargument 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.GradientorNone) – default valuedefault_to_context (
bool) – Use the context’s gradient as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Gradientauxiliary 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.Gradientreturn 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.Imageargument to self.New in version 3.0.
- add_image_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Imageauxiliary argument to self.New in version 3.0.
- add_image_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Imagereturn 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.Itemargument to self.New in version 3.0.
- add_item_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Itemauxiliary argument to self.New in version 3.0.
- add_item_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Itemreturn value to self.New in version 3.0.
- add_layer_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layerargument to self.New in version 3.0.
- add_layer_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layerauxiliary argument to self.New in version 3.0.
- add_layer_mask_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMaskargument to self.New in version 3.0.
- add_layer_mask_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMaskauxiliary argument to self.New in version 3.0.
- add_layer_mask_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.LayerMaskreturn value to self.New in version 3.0.
- add_layer_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Layerreturn 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 aCreatesubmenu 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.PaletteorNone) – default valuedefault_to_context (
bool) – Use the context’s palette as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Paletteargument 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.PaletteorNone) – default valuedefault_to_context (
bool) – Use the context’s palette as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Paletteauxiliary 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.Palettereturn 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.Parasiteargument 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.Parasiteauxiliary 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.Parasitereturn value to self.New in version 3.0.
- add_path_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Pathargument to self.New in version 3.0.
- add_path_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Pathauxiliary argument to self.New in version 3.0.
- add_path_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Pathreturn 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.PatternorNone) – default valuedefault_to_context (
bool) – Use the context’s pattern as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Patternargument 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.PatternorNone) – default valuedefault_to_context (
bool) – Use the context’s pattern as default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Patternauxiliary 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.Patternreturn 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.ResourceorNone) – default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Resourceargument 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.ResourceorNone) – default value.flags (
GObject.ParamFlags) – argument flags.
Add a new
Gimp.Resourceauxiliary 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.Resourcereturn value to self.New in version 3.0.
- add_selection_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selectionargument to self.New in version 3.0.
- add_selection_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selectionauxiliary argument to self.New in version 3.0.
- add_selection_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.Selectionreturn 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.TextLayerargument to self.New in version 3.0.
- add_text_layer_aux_argument(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.TextLayerauxiliary argument to self.New in version 3.0.
- add_text_layer_return_value(name, nick, blurb, none_ok, flags)¶
- Parameters:
Add a new
Gimp.TextLayerreturn 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.Unitargument 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.Unitauxiliary 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.Unitreturn value to self.New in version 3.0.
- create_config()¶
- Returns:
The new
Gimp.Config.- Return type:
Create a
Gimp.Configwith 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
Noneotherwise.- Return type:
Searches the self's arguments for a
GObject.ParamSpeccalled 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
Noneotherwise.- Return type:
Searches the self's auxiliary arguments for a
GObject.ParamSpeccalled 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
Noneotherwise.- Return type:
Searches the self's return values for a
GObject.ParamSpeccalled 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.ArgumentSyncvalue 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
Noneif no icon name was set.- Return type:
Gets the
GdkPixbuf.Pixbufof the icon if an icon was set this way for self.New in version 3.0.
- get_icon_type()¶
- Returns:
the
Gimp.IconTypeof 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.PlugIngiven 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.ErrororNone) – an optionalGLib.Error. This parameter should be set if status is eitherGimp.PDBStatusType.EXECUTION_ERRORorGimp.PDBStatusType.CALLING_ERROR.
- Returns:
the expected
Gimp.ValueArrayas 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.ProcedureConfigorNone) – 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.Parasiteof theGimp.Imagethe 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.ParamSpecStringwith 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.PixbuforNone) – 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_ERRORand 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_DRAWABLESare 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.Proceduresubclasses 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.PlugInof this plug-in process
- Gimp.Procedure.props.procedure_type¶
- Name:
procedure-type- Type:
- Default Value:
- Flags:
The procedure’s type