libgimp, plug-ins: fix gimp_procedure_add_*_argument() where * is a resource type.

The correspondant param specs' fourth arg was a `none_ok` boolean, not a
type. Carry over this argument to the gimp_procedure_add_*() function.
This commit is contained in:
Jehan 2024-07-05 22:19:34 +02:00
parent 26645ab404
commit 6d36d143e8
5 changed files with 45 additions and 31 deletions

View file

@ -980,7 +980,7 @@ gimp_param_resource_validate (GParamSpec *pspec,
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecResource specifying a * Creates a new #GimpParamSpecResource specifying a
@ -1060,7 +1060,7 @@ gimp_param_brush_init (GParamSpec *pspec)
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecBrush specifying a * Creates a new #GimpParamSpecBrush specifying a
@ -1140,7 +1140,7 @@ gimp_param_pattern_init (GParamSpec *pspec)
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecPattern specifying a * Creates a new #GimpParamSpecPattern specifying a
@ -1220,7 +1220,7 @@ gimp_param_gradient_init (GParamSpec *pspec)
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecGradient specifying a * Creates a new #GimpParamSpecGradient specifying a
@ -1300,7 +1300,7 @@ gimp_param_palette_init (GParamSpec *pspec)
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecPalette specifying a * Creates a new #GimpParamSpecPalette specifying a
@ -1380,7 +1380,7 @@ gimp_param_font_init (GParamSpec *pspec)
* @name: Canonical name of the property specified. * @name: Canonical name of the property specified.
* @nick: Nick name of the property specified. * @nick: Nick name of the property specified.
* @blurb: Description of the property specified. * @blurb: Description of the property specified.
* @none_ok: Whether no is a valid value. * @none_ok: Whether %NULL is a valid value.
* @flags: Flags for the property specified. * @flags: Flags for the property specified.
* *
* Creates a new #GimpParamSpecFont specifying a * Creates a new #GimpParamSpecFont specifying a

View file

@ -2358,6 +2358,7 @@ gimp_procedure_add_file_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpResource argument to @procedure. * Add a new #GimpResource argument to @procedure.
@ -2370,12 +2371,12 @@ gimp_procedure_add_resource_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_resource (name, nick, blurb, gimp_param_spec_resource (name, nick, blurb,
GIMP_TYPE_RESOURCE, none_ok, flags));
flags));
} }
/** /**
@ -2400,8 +2401,7 @@ gimp_procedure_add_resource_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_resource (name, nick, blurb, gimp_param_spec_resource (name, nick, blurb,
GIMP_TYPE_RESOURCE, TRUE, flags));
flags));
} }
/** /**
@ -2426,8 +2426,7 @@ gimp_procedure_add_resource_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_resource (name, nick, blurb, gimp_param_spec_resource (name, nick, blurb,
GIMP_TYPE_RESOURCE, TRUE, flags));
flags));
} }
/** /**
@ -2436,6 +2435,7 @@ gimp_procedure_add_resource_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpBrush argument to @procedure. * Add a new #GimpBrush argument to @procedure.
@ -2448,11 +2448,12 @@ gimp_procedure_add_brush_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_brush (name, nick, blurb, gimp_param_spec_brush (name, nick, blurb,
GIMP_TYPE_BRUSH, flags)); none_ok, flags));
} }
/** /**
@ -2477,7 +2478,7 @@ gimp_procedure_add_brush_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_brush (name, nick, blurb, gimp_param_spec_brush (name, nick, blurb,
GIMP_TYPE_BRUSH, flags)); TRUE, flags));
} }
/** /**
@ -2502,7 +2503,7 @@ gimp_procedure_add_brush_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_brush (name, nick, blurb, gimp_param_spec_brush (name, nick, blurb,
GIMP_TYPE_BRUSH, flags)); TRUE, flags));
} }
/** /**
@ -2511,6 +2512,7 @@ gimp_procedure_add_brush_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpFont argument to @procedure. * Add a new #GimpFont argument to @procedure.
@ -2523,11 +2525,12 @@ gimp_procedure_add_font_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_font (name, nick, blurb, gimp_param_spec_font (name, nick, blurb,
GIMP_TYPE_FONT, flags)); none_ok, flags));
} }
/** /**
@ -2552,7 +2555,7 @@ gimp_procedure_add_font_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_font (name, nick, blurb, gimp_param_spec_font (name, nick, blurb,
GIMP_TYPE_FONT, flags)); TRUE, flags));
} }
/** /**
@ -2577,7 +2580,7 @@ gimp_procedure_add_font_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_font (name, nick, blurb, gimp_param_spec_font (name, nick, blurb,
GIMP_TYPE_FONT, flags)); TRUE, flags));
} }
/** /**
@ -2586,6 +2589,7 @@ gimp_procedure_add_font_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpGradient argument to @procedure. * Add a new #GimpGradient argument to @procedure.
@ -2598,11 +2602,12 @@ gimp_procedure_add_gradient_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_gradient (name, nick, blurb, gimp_param_spec_gradient (name, nick, blurb,
GIMP_TYPE_GRADIENT, flags)); none_ok, flags));
} }
/** /**
@ -2627,7 +2632,7 @@ gimp_procedure_add_gradient_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_gradient (name, nick, blurb, gimp_param_spec_gradient (name, nick, blurb,
GIMP_TYPE_GRADIENT, flags)); TRUE, flags));
} }
/** /**
@ -2652,7 +2657,7 @@ gimp_procedure_add_gradient_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_gradient (name, nick, blurb, gimp_param_spec_gradient (name, nick, blurb,
GIMP_TYPE_GRADIENT, flags)); TRUE, flags));
} }
/** /**
@ -2661,6 +2666,7 @@ gimp_procedure_add_gradient_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpPalette argument to @procedure. * Add a new #GimpPalette argument to @procedure.
@ -2673,11 +2679,12 @@ gimp_procedure_add_palette_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_palette (name, nick, blurb, gimp_param_spec_palette (name, nick, blurb,
GIMP_TYPE_PALETTE, flags)); none_ok, flags));
} }
/** /**
@ -2702,7 +2709,7 @@ gimp_procedure_add_palette_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_palette (name, nick, blurb, gimp_param_spec_palette (name, nick, blurb,
GIMP_TYPE_PALETTE, flags)); TRUE, flags));
} }
/** /**
@ -2727,7 +2734,7 @@ gimp_procedure_add_palette_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_palette (name, nick, blurb, gimp_param_spec_palette (name, nick, blurb,
GIMP_TYPE_PALETTE, flags)); TRUE, flags));
} }
/** /**
@ -2736,6 +2743,7 @@ gimp_procedure_add_palette_return_value (GimpProcedure *procedure,
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
* @blurb: a more detailed help description. * @blurb: a more detailed help description.
* @none_ok: whether %NULL is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpPattern argument to @procedure. * Add a new #GimpPattern argument to @procedure.
@ -2748,11 +2756,12 @@ gimp_procedure_add_pattern_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags) GParamFlags flags)
{ {
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_pattern (name, nick, blurb, gimp_param_spec_pattern (name, nick, blurb,
GIMP_TYPE_PATTERN, flags)); none_ok, flags));
} }
/** /**
@ -2777,7 +2786,7 @@ gimp_procedure_add_pattern_aux_argument (GimpProcedure *procedure,
{ {
gimp_procedure_add_aux_argument (procedure, gimp_procedure_add_aux_argument (procedure,
gimp_param_spec_pattern (name, nick, blurb, gimp_param_spec_pattern (name, nick, blurb,
GIMP_TYPE_PATTERN, flags)); TRUE, flags));
} }
/** /**
@ -2802,5 +2811,5 @@ gimp_procedure_add_pattern_return_value (GimpProcedure *procedure,
{ {
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_pattern (name, nick, blurb, gimp_param_spec_pattern (name, nick, blurb,
GIMP_TYPE_PATTERN, flags)); TRUE, flags));
} }

View file

@ -964,6 +964,7 @@ void gimp_procedure_add_resource_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_resource_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_resource_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
@ -980,6 +981,7 @@ void gimp_procedure_add_brush_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_brush_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_brush_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
@ -996,6 +998,7 @@ void gimp_procedure_add_font_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_font_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_font_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
@ -1012,6 +1015,7 @@ void gimp_procedure_add_gradient_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_gradient_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_gradient_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
@ -1028,6 +1032,7 @@ void gimp_procedure_add_palette_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_palette_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_palette_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
@ -1044,6 +1049,7 @@ void gimp_procedure_add_pattern_argument (GimpProcedure *procedure
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_pattern_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_pattern_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,

View file

@ -114,9 +114,8 @@ create_callback_PDB_procedure_params (GimpProcedure *procedure,
GType resource_type) GType resource_type)
{ {
gimp_procedure_add_resource_argument (procedure, "resource", gimp_procedure_add_resource_argument (procedure, "resource",
"Resource", "Resource", "The resource",
"The resource", TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
/* Create args for the extra, superfluous args that core is passing.*/ /* Create args for the extra, superfluous args that core is passing.*/
if (g_type_is_a (resource_type, GIMP_TYPE_FONT)) if (g_type_is_a (resource_type, GIMP_TYPE_FONT))

View file

@ -217,7 +217,7 @@ film_create_procedure (GimpPlugIn *plug_in,
gimp_procedure_add_font_argument (procedure, "number-font", gimp_procedure_add_font_argument (procedure, "number-font",
_("Number _font"), _("Number _font"),
_("Font for drawing numbers"), _("Font for drawing numbers"),
G_PARAM_READWRITE); FALSE, G_PARAM_READWRITE);
gimp_procedure_add_color_argument (procedure, "number-color", gimp_procedure_add_color_argument (procedure, "number-color",
_("_Number color"), _("_Number color"),