Gimp.ProcedureConfig.prototype.begin_run

function begin_run(image: Gimp.Image, run_mode: Gimp.RunMode, args: Gimp.ValueArray): void {
    // Gjs wrapper for gimp_procedure_config_begin_run()
}
  

Populates config with values for a [class@Procedure]'s run(), depending on run_mode.

If run_mode is Gimp.RunMode.interactive or Gimp.RunMode.with_last_vals, the saved values from the procedure's last run() are loaded and set on config. If image is not null, the last used values for this image are tried first, and if no image-specific values are found the globally saved last used values are used. If no saved last used values are found, the procedure's default argument values are used.

If run_mode is Gimp.RunMode.noninteractive, the contents of args are set on config using [method@ProcedureConfig.set_values].

After setting config's properties like described above, arguments and auxiliary arguments are automatically synced from image parasites of the same name if they were set to Gimp.ArgumentSync.parasite with [class@Procedure.set_argument_sync]:

String properties are set to the value of the image parasite if run_mode is Gimp.RunMode.interactive or Gimp.RunMode.with_last_vals, or if the corresponding argument is an auxiliary argument. As a special case, a property named "gimp-comment" will default to [func@get_default_comment] if there is no "gimp-comment" parasite.

After calling this function, the args passed to run() should be left alone and config be treated as the procedure's arguments.

It is possible to get config's resulting values back into args by calling [method@ProcedureConfig.get_values], as long as modified args are written back to config using [method@ProcedureConfig.set_values] before the call to [method@ProcedureConfig.end_run].

This function should be used at the beginning of a procedure's run() and be paired with a call to [method@ProcedureConfig.end_run] at the end of run().

Since 3.0

image

a Gimp.Image or null

run_mode

the Gimp.RunMode passed to a [class@Procedure]'s run()

args

the Gimp.ValueArray passed to a [class@Procedure]'s run()