Commit 876a96e4 authored by Martin Nordholts's avatar Martin Nordholts

New helper function that creates a new GimpProcedure that can be used to

* app/pdb/gimpprocedure.[ch] (gimp_procedure_create_override): New
helper function that creates a new GimpProcedure that can be used
to override an existing procedure.

svn path=/trunk/; revision=27950
parent 86e50ceb
2009-01-25 Martin Nordholts <martinn@svn.gnome.org>
* app/pdb/gimpprocedure.[ch] (gimp_procedure_create_override): New
helper function that creates a new GimpProcedure that can be used
to override an existing procedure.
2009-01-25 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimpimage.[ch] (gimp_image_get_type_string): New method
......
......@@ -529,6 +529,38 @@ gimp_procedure_add_return_value (GimpProcedure *procedure,
procedure->num_values++;
}
/**
* gimp_procedure_create_override:
* @procedure:
* @new_marshal_func:
*
* Creates a new GimpProcedure that can be used to override the
* existing @procedure.
*
* Returns: The new #GimpProcedure.
**/
GimpProcedure *
gimp_procedure_create_override (GimpProcedure *procedure,
GimpMarshalFunc new_marshal_func)
{
GimpProcedure *new_procedure = NULL;
const gchar *name = NULL;
int i = 0;
new_procedure = gimp_procedure_new (new_marshal_func);
name = gimp_object_get_name (GIMP_OBJECT (procedure));
gimp_object_set_static_name (GIMP_OBJECT (new_procedure), name);
for (i = 0; i < procedure->num_args; i++)
gimp_procedure_add_argument (new_procedure, procedure->args[i]);
for (i = 0; i < procedure->num_values; i++)
gimp_procedure_add_return_value (new_procedure, procedure->values[i]);
return new_procedure;
}
/* private functions */
......
......@@ -123,6 +123,9 @@ GValueArray * gimp_procedure_get_return_values (GimpProcedure *procedure,
gboolean success,
const GError *error);
GimpProcedure * gimp_procedure_create_override (GimpProcedure *procedure,
GimpMarshalFunc new_marshal_func);
GValueArray * gimp_procedure_execute (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment