Commit 44f36305 authored by Michael Natterer's avatar Michael Natterer 😴

libgimpconfig: support more types in gimp_config_param_spec_duplicate()

It now supports all GParamSpecs possible on the wire protocol, except
the ones that are implemented in app/ and libgimp/ (image, drawable,
...) and are not visible to libgimpconfig
parent 6fad2576
Pipeline #115065 passed with stages
in 13 minutes and 59 seconds
......@@ -27,6 +27,7 @@
#include <gegl.h>
#include <gegl-paramspecs.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
......@@ -183,6 +184,17 @@ gimp_config_param_spec_duplicate (GParamSpec *pspec)
gspec->ui_step_small,
gspec->ui_step_big);
}
else if (GIMP_IS_PARAM_SPEC_UNIT (pspec))
{
GimpParamSpecUnit *spec = GIMP_PARAM_SPEC_UNIT (pspec);
GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec);
copy = gimp_param_spec_unit (name, nick, blurb,
ispec->minimum == GIMP_UNIT_PIXEL,
spec->allow_percent,
ispec->default_value,
flags);
}
else
{
copy = g_param_spec_int (name, nick, blurb,
......@@ -256,6 +268,58 @@ gimp_config_param_spec_duplicate (GParamSpec *pspec)
&gimp_color,
flags);
}
else if (G_IS_PARAM_SPEC_PARAM (pspec))
{
copy = g_param_spec_param (name, nick, blurb,
G_PARAM_SPEC_VALUE_TYPE (pspec),
flags);
}
else if (GIMP_IS_PARAM_SPEC_PARASITE (pspec))
{
copy = gimp_param_spec_parasite (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_ARRAY (pspec))
{
if (GIMP_IS_PARAM_SPEC_UINT8_ARRAY (pspec))
{
copy = gimp_param_spec_uint8_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_INT16_ARRAY (pspec))
{
copy = gimp_param_spec_int16_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_INT32_ARRAY (pspec))
{
copy = gimp_param_spec_int32_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_FLOAT_ARRAY (pspec))
{
copy = gimp_param_spec_float_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_STRING_ARRAY (pspec))
{
copy = gimp_param_spec_string_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_RGB_ARRAY (pspec))
{
copy = gimp_param_spec_rgb_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_OBJECT_ARRAY (pspec))
{
GimpParamSpecObjectArray *spec = GIMP_PARAM_SPEC_OBJECT_ARRAY (pspec);
copy = gimp_param_spec_object_array (name, nick, blurb,
spec->object_type,
flags);
}
}
if (copy)
{
......
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