diff --git a/app/config/gimpconfig-dump.c b/app/config/gimpconfig-dump.c
index 29927f5b32..ac9c334168 100644
--- a/app/config/gimpconfig-dump.c
+++ b/app/config/gimpconfig-dump.c
@@ -506,15 +506,13 @@ dump_describe_param (GParamSpec *param_spec)
}
else if (GIMP_IS_PARAM_SPEC_UNIT (param_spec))
{
- GimpParamSpecUnit *uspec = GIMP_PARAM_SPEC_UNIT (param_spec);
-
- if (uspec->allow_pixel && uspec->allow_percent)
+ if (gimp_param_spec_unit_pixel_allowed (param_spec) && gimp_param_spec_unit_percent_allowed (param_spec))
values = "The unit can be one inches, millimeters, points or picas plus "
"those in your user units database. Pixel And Percent units are allowed too.";
- else if (uspec->allow_pixel)
+ else if (gimp_param_spec_unit_pixel_allowed (param_spec))
values = "The unit can be one inches, millimeters, points or picas plus "
"those in your user units database. Pixel unit is allowed too.";
- else if (uspec->allow_percent)
+ else if (gimp_param_spec_unit_percent_allowed (param_spec))
values = "The unit can be one inches, millimeters, points or picas plus "
"those in your user units database. Percent unit is allowed too.";
else
diff --git a/app/core/gimpparamspecs-desc.c b/app/core/gimpparamspecs-desc.c
index 0898d6776e..c23e211254 100644
--- a/app/core/gimpparamspecs-desc.c
+++ b/app/core/gimpparamspecs-desc.c
@@ -48,15 +48,14 @@ gimp_param_spec_boolean_desc (GParamSpec *pspec)
static gchar *
gimp_param_spec_unit_desc (GParamSpec *pspec)
{
- GimpParamSpecUnit *uspec = GIMP_PARAM_SPEC_UNIT (pspec);
- GObject *default_value;
+ GObject *default_value;
default_value = gimp_param_spec_object_get_default (pspec);
return g_strdup_printf ("(default %s%s%s)",
gimp_unit_get_abbreviation (GIMP_UNIT (default_value)),
- uspec->allow_pixel ? ", pixel allowed": "",
- uspec->allow_percent ? ", percent allowed": "");
+ gimp_param_spec_unit_pixel_allowed (pspec) ? ", pixel allowed": "",
+ gimp_param_spec_unit_percent_allowed (pspec) ? ", percent allowed": "");
}
static gchar *
diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c
index 5d11a80c33..26a5a474e4 100644
--- a/app/pdb/gimpprocedure.c
+++ b/app/pdb/gimpprocedure.c
@@ -954,9 +954,9 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
}
else if (GIMP_IS_PARAM_SPEC_UNIT (pspec) &&
((GIMP_UNIT (old_value) == gimp_unit_pixel () &&
- ! GIMP_PARAM_SPEC_UNIT (pspec)->allow_pixel) ||
+ ! gimp_param_spec_unit_pixel_allowed (pspec)) ||
(GIMP_UNIT (old_value) == gimp_unit_percent () &&
- ! GIMP_PARAM_SPEC_UNIT (pspec)->allow_percent)))
+ ! gimp_param_spec_unit_percent_allowed (pspec))))
{
if (return_vals)
{
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index e6359497e8..5057bae39b 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -736,6 +736,8 @@ EXPORTS
gimp_param_spec_path
gimp_param_spec_pattern
gimp_param_spec_resource
+ gimp_param_spec_resource_defaults_to_context
+ gimp_param_spec_resource_none_allowed
gimp_param_spec_selection
gimp_param_spec_text_layer
gimp_param_text_layer_get_type
diff --git a/libgimp/gimpgpparams-body.c b/libgimp/gimpgpparams-body.c
index 185e4f5863..2098169093 100644
--- a/libgimp/gimpgpparams-body.c
+++ b/libgimp/gimpgpparams-body.c
@@ -429,15 +429,14 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec,
}
else if (pspec_type == GIMP_TYPE_PARAM_UNIT)
{
- GimpParamSpecUnit *uspec = GIMP_PARAM_SPEC_UNIT (pspec);
- GObject *default_value;
+ GObject *default_value;
default_value = gimp_param_spec_object_get_default (pspec);
param_def->param_def_type = GP_PARAM_DEF_TYPE_UNIT;
- param_def->meta.m_unit.allow_pixels = uspec->allow_pixel;
- param_def->meta.m_unit.allow_percent = uspec->allow_percent;
+ param_def->meta.m_unit.allow_pixels = gimp_param_spec_unit_pixel_allowed (pspec);
+ param_def->meta.m_unit.allow_percent = gimp_param_spec_unit_percent_allowed (pspec);
param_def->meta.m_unit.default_val = gimp_unit_get_id (GIMP_UNIT (default_value));
}
#ifndef LIBGIMP_COMPILATION
@@ -654,30 +653,30 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec,
}
else if (GIMP_IS_PARAM_SPEC_RESOURCE (pspec))
{
- GimpParamSpecResource *rspec = GIMP_PARAM_SPEC_RESOURCE (pspec);
- GObject *default_value = NULL;
+ GObject *default_value = NULL;
+ gboolean default_to_context;
param_def->param_def_type = GP_PARAM_DEF_TYPE_RESOURCE;
if (gimp_param_spec_object_has_default (pspec))
default_value = gimp_param_spec_object_get_default (pspec);
- param_def->meta.m_resource.none_ok = rspec->none_ok;
- param_def->meta.m_resource.default_to_context = rspec->default_to_context;
- if (default_value != NULL && ! rspec->default_to_context)
+ param_def->meta.m_resource.none_ok = gimp_param_spec_resource_none_allowed (pspec);
+ default_to_context = gimp_param_spec_resource_defaults_to_context (pspec);
+ param_def->meta.m_resource.default_to_context = default_to_context;
+ if (default_value != NULL && ! default_to_context)
param_def->meta.m_resource.default_resource_id = get_resource_id (default_value);
else
param_def->meta.m_resource.default_resource_id = 0;
}
else if (pspec_type == GIMP_TYPE_PARAM_FILE)
{
- GimpParamSpecFile *fspec = GIMP_PARAM_SPEC_FILE (pspec);
GimpParamSpecObject *ospec = GIMP_PARAM_SPEC_OBJECT (pspec);
param_def->param_def_type = GP_PARAM_DEF_TYPE_FILE;
- param_def->meta.m_file.action = (gint32) fspec->action;
- param_def->meta.m_file.none_ok = fspec->none_ok;
+ param_def->meta.m_file.action = (gint32) gimp_param_spec_file_get_action (pspec);
+ param_def->meta.m_file.none_ok = gimp_param_spec_file_none_allowed (pspec);
param_def->meta.m_file.default_uri =
ospec->_default_value ? g_file_get_uri (G_FILE (ospec->_default_value)) : NULL;
}
diff --git a/libgimp/gimpparamspecs-body.c b/libgimp/gimpparamspecs-body.c
index d4dd5bb018..4986522c80 100644
--- a/libgimp/gimpparamspecs-body.c
+++ b/libgimp/gimpparamspecs-body.c
@@ -1069,6 +1069,18 @@ gimp_param_spec_display (const gchar *name,
* GIMP_TYPE_PARAM_RESOURCE
*/
+#define GIMP_PARAM_SPEC_RESOURCE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_RESOURCE, GimpParamSpecResource))
+
+typedef struct _GimpParamSpecResource GimpParamSpecResource;
+
+struct _GimpParamSpecResource
+{
+ GimpParamSpecObject parent_instance;
+
+ gboolean none_ok;
+ gboolean default_to_context;
+};
+
static void gimp_param_resource_class_init (GimpParamSpecObjectClass *klass);
static void gimp_param_resource_init (GParamSpec *pspec);
static GParamSpec * gimp_param_resource_duplicate (GParamSpec *pspec);
@@ -1118,7 +1130,8 @@ gimp_param_resource_init (GParamSpec *pspec)
{
GimpParamSpecResource *rspec = GIMP_PARAM_SPEC_RESOURCE (pspec);
- rspec->none_ok = FALSE;
+ rspec->none_ok = FALSE;
+ rspec->default_to_context = FALSE;
}
static GParamSpec *
@@ -1293,6 +1306,22 @@ gimp_param_spec_resource (const gchar *name,
return G_PARAM_SPEC (rspec);
}
+gboolean
+gimp_param_spec_resource_none_allowed (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_RESOURCE (pspec), FALSE);
+
+ return GIMP_PARAM_SPEC_RESOURCE (pspec)->none_ok;
+}
+
+gboolean
+gimp_param_spec_resource_defaults_to_context (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_RESOURCE (pspec), FALSE);
+
+ return GIMP_PARAM_SPEC_RESOURCE (pspec)->default_to_context;
+}
+
/*
* GIMP_TYPE_PARAM_BRUSH
diff --git a/libgimp/gimpparamspecs-desc.c b/libgimp/gimpparamspecs-desc.c
index 8e4cdacf42..556d301130 100644
--- a/libgimp/gimpparamspecs-desc.c
+++ b/libgimp/gimpparamspecs-desc.c
@@ -44,15 +44,14 @@ gimp_param_spec_boolean_desc (GParamSpec *pspec)
static gchar *
gimp_param_spec_unit_desc (GParamSpec *pspec)
{
- GimpParamSpecUnit *uspec = GIMP_PARAM_SPEC_UNIT (pspec);
- GObject *default_value;
+ GObject *default_value;
default_value = gimp_param_spec_object_get_default (pspec);
return g_strdup_printf ("(default %s%s%s)",
gimp_unit_get_abbreviation (GIMP_UNIT (default_value)),
- uspec->allow_pixel ? ", pixel allowed": "",
- uspec->allow_percent ? ", percent allowed": "");
+ gimp_param_spec_unit_pixel_allowed (pspec) ? ", pixel allowed": "",
+ gimp_param_spec_unit_percent_allowed (pspec) ? ", percent allowed": "");
}
static gchar *
diff --git a/libgimp/gimpparamspecs.h b/libgimp/gimpparamspecs.h
index 707c07daeb..e3fb23bb22 100644
--- a/libgimp/gimpparamspecs.h
+++ b/libgimp/gimpparamspecs.h
@@ -305,29 +305,21 @@ GParamSpec * gimp_param_spec_display (const gchar *name,
#define GIMP_VALUE_HOLDS_RESOURCE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_RESOURCE))
#define GIMP_TYPE_PARAM_RESOURCE (gimp_param_resource_get_type ())
-#define GIMP_PARAM_SPEC_RESOURCE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_RESOURCE, GimpParamSpecResource))
#define GIMP_IS_PARAM_SPEC_RESOURCE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_RESOURCE))
-typedef struct _GimpParamSpecResource GimpParamSpecResource;
+GType gimp_param_resource_get_type (void) G_GNUC_CONST;
-struct _GimpParamSpecResource
-{
- GimpParamSpecObject parent_instance;
+GParamSpec * gimp_param_spec_resource (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType resource_type,
+ gboolean none_ok,
+ GimpResource *default_value,
+ gboolean default_to_context,
+ GParamFlags flags);
- gboolean none_ok;
- gboolean default_to_context;
-};
-
-GType gimp_param_resource_get_type (void) G_GNUC_CONST;
-
-GParamSpec * gimp_param_spec_resource (const gchar *name,
- const gchar *nick,
- const gchar *blurb,
- GType resource_type,
- gboolean none_ok,
- GimpResource *default_value,
- gboolean default_to_context,
- GParamFlags flags);
+gboolean gimp_param_spec_resource_none_allowed (GParamSpec *pspec);
+gboolean gimp_param_spec_resource_defaults_to_context (GParamSpec *pspec);
/*
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index ad22b90904..aeca228699 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -844,11 +844,9 @@ gimp_procedure_dialog_get_widget (GimpProcedureDialog *dialog,
}
else if (GIMP_IS_PARAM_SPEC_FILE (pspec))
{
- GimpParamSpecFile *fspec = GIMP_PARAM_SPEC_FILE (pspec);
-
widget = gimp_prop_file_chooser_button_new (G_OBJECT (priv->config),
property, NULL,
- (GtkFileChooserAction) fspec->action);
+ (GtkFileChooserAction) gimp_param_spec_file_get_action (pspec));
}
else if (G_IS_PARAM_SPEC_OBJECT (pspec) && pspec->value_type == G_TYPE_FILE)
{
diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def
index b3af9507fe..3a93b6c728 100644
--- a/libgimpbase/gimpbase.def
+++ b/libgimpbase/gimpbase.def
@@ -144,6 +144,8 @@ EXPORTS
gimp_param_spec_double_array
gimp_param_spec_export_options
gimp_param_spec_file
+ gimp_param_spec_file_get_action
+ gimp_param_spec_file_none_allowed
gimp_param_spec_int32_array
gimp_param_spec_memsize
gimp_param_spec_object_duplicate
@@ -152,6 +154,8 @@ EXPORTS
gimp_param_spec_object_set_default
gimp_param_spec_parasite
gimp_param_spec_unit
+ gimp_param_spec_unit_percent_allowed
+ gimp_param_spec_unit_pixel_allowed
gimp_param_spec_value_array
gimp_param_unit_get_type
gimp_param_value_array_get_type
diff --git a/libgimpbase/gimpparamspecs.c b/libgimpbase/gimpparamspecs.c
index 582235f670..a26d725c9f 100644
--- a/libgimpbase/gimpparamspecs.c
+++ b/libgimpbase/gimpparamspecs.c
@@ -220,6 +220,19 @@ gimp_param_spec_object_duplicate (GParamSpec *pspec)
* GIMP_TYPE_PARAM_FILE
*/
+#define GIMP_PARAM_SPEC_FILE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FILE, GimpParamSpecFile))
+
+typedef struct _GimpParamSpecFile GimpParamSpecFile;
+
+struct _GimpParamSpecFile
+{
+ GimpParamSpecObject parent_instance;
+
+ /*< private >*/
+ GimpFileChooserAction action;
+ gboolean none_ok;
+};
+
static void gimp_param_file_class_init (GimpParamSpecObjectClass *klass);
static void gimp_param_file_init (GimpParamSpecFile *fspec);
@@ -425,6 +438,37 @@ gimp_param_spec_file (const gchar *name,
return G_PARAM_SPEC (fspec);
}
+/**
+ * gimp_param_spec_file_get_action:
+ * @pspec: a #GParamSpec to hold a #GFile value.
+ *
+ * Returns: the file action tied to @pspec.
+ *
+ * Since: 3.0
+ **/
+GimpFileChooserAction
+gimp_param_spec_file_get_action (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_FILE (pspec), GIMP_FILE_CHOOSER_ACTION_ANY);
+
+ return GIMP_PARAM_SPEC_FILE (pspec)->action;
+}
+
+/**
+ * gimp_param_spec_file_none_allowed:
+ * @pspec: a #GParamSpec to hold a #GFile value.
+ *
+ * Returns: %TRUE if a %NULL value is allowed.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gimp_param_spec_file_none_allowed (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_FILE (pspec), FALSE);
+
+ return GIMP_PARAM_SPEC_FILE (pspec)->none_ok;
+}
/*
* GIMP_TYPE_ARRAY
diff --git a/libgimpbase/gimpparamspecs.h b/libgimpbase/gimpparamspecs.h
index 0543936685..9921fd3e61 100644
--- a/libgimpbase/gimpparamspecs.h
+++ b/libgimpbase/gimpparamspecs.h
@@ -159,29 +159,22 @@ GParamSpec * gimp_param_spec_object_duplicate (GParamSpec *pspec);
#define GIMP_VALUE_HOLDS_FILE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FILE))
#define GIMP_TYPE_PARAM_FILE (gimp_param_file_get_type ())
-#define GIMP_PARAM_SPEC_FILE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FILE, GimpParamSpecFile))
#define GIMP_IS_PARAM_SPEC_FILE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_FILE))
-typedef struct _GimpParamSpecFile GimpParamSpecFile;
-struct _GimpParamSpecFile
-{
- GimpParamSpecObject parent_instance;
+GType gimp_param_file_get_type (void) G_GNUC_CONST;
- /*< private >*/
- GimpFileChooserAction action;
- gboolean none_ok;
-};
+GParamSpec * gimp_param_spec_file (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GimpFileChooserAction action,
+ gboolean none_ok,
+ GFile *default_value,
+ GParamFlags flags);
-GType gimp_param_file_get_type (void) G_GNUC_CONST;
+GimpFileChooserAction gimp_param_spec_file_get_action (GParamSpec *pspec);
+gboolean gimp_param_spec_file_none_allowed (GParamSpec *pspec);
-GParamSpec * gimp_param_spec_file (const gchar *name,
- const gchar *nick,
- const gchar *blurb,
- GimpFileChooserAction action,
- gboolean none_ok,
- GFile *default_value,
- GParamFlags flags);
/*
diff --git a/libgimpbase/gimpunit.c b/libgimpbase/gimpunit.c
index 21669e09bf..71adc37aa8 100644
--- a/libgimpbase/gimpunit.c
+++ b/libgimpbase/gimpunit.c
@@ -930,6 +930,18 @@ gimp_units_to_points (gdouble value,
* GIMP_TYPE_PARAM_UNIT
*/
+#define GIMP_PARAM_SPEC_UNIT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_UNIT, GimpParamSpecUnit))
+
+typedef struct _GimpParamSpecUnit GimpParamSpecUnit;
+
+struct _GimpParamSpecUnit
+{
+ GimpParamSpecObject parent_instance;
+
+ gboolean allow_pixel;
+ gboolean allow_percent;
+};
+
static void gimp_param_unit_class_init (GimpParamSpecObjectClass *klass);
static void gimp_param_unit_init (GParamSpec *pspec);
static GParamSpec * gimp_param_unit_duplicate (GParamSpec *pspec);
@@ -1074,6 +1086,38 @@ gimp_param_spec_unit (const gchar *name,
return G_PARAM_SPEC (uspec);
}
+/**
+ * gimp_param_spec_unit_pixel_allowed:
+ * @pspec: a #GParamSpec to hold an #GimpUnit value.
+ *
+ * Returns: %TRUE if the [func@Gimp.Unit.pixel] unit is allowed.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gimp_param_spec_unit_pixel_allowed (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_UNIT (pspec), FALSE);
+
+ return GIMP_PARAM_SPEC_UNIT (pspec)->allow_pixel;
+}
+
+/**
+ * gimp_param_spec_unit_percent_allowed:
+ * @pspec: a #GParamSpec to hold an #GimpUnit value.
+ *
+ * Returns: %TRUE if the [func@Gimp.Unit.percent] unit is allowed.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gimp_param_spec_unit_percent_allowed (GParamSpec *pspec)
+{
+ g_return_val_if_fail (GIMP_IS_PARAM_SPEC_UNIT (pspec), FALSE);
+
+ return GIMP_PARAM_SPEC_UNIT (pspec)->allow_percent;
+}
+
static gint
print (gchar *buf,
gint len,
diff --git a/libgimpbase/gimpunit.h b/libgimpbase/gimpunit.h
index 640f5cf66d..96b33d6df3 100644
--- a/libgimpbase/gimpunit.h
+++ b/libgimpbase/gimpunit.h
@@ -87,29 +87,21 @@ gdouble gimp_units_to_points (gdouble value,
#define GIMP_VALUE_HOLDS_UNIT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_UNIT))
#define GIMP_TYPE_PARAM_UNIT (gimp_param_unit_get_type ())
-#define GIMP_PARAM_SPEC_UNIT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_UNIT, GimpParamSpecUnit))
#define GIMP_IS_PARAM_SPEC_UNIT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_UNIT))
-typedef struct _GimpParamSpecUnit GimpParamSpecUnit;
-struct _GimpParamSpecUnit
-{
- GimpParamSpecObject parent_instance;
+GType gimp_param_unit_get_type (void) G_GNUC_CONST;
- gboolean allow_pixel;
- gboolean allow_percent;
-};
-
-GType gimp_param_unit_get_type (void) G_GNUC_CONST;
-
-GParamSpec * gimp_param_spec_unit (const gchar *name,
- const gchar *nick,
- const gchar *blurb,
- gboolean allow_pixel,
- gboolean allow_percent,
- GimpUnit *default_value,
- GParamFlags flags);
+GParamSpec * gimp_param_spec_unit (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gboolean allow_pixel,
+ gboolean allow_percent,
+ GimpUnit *default_value,
+ GParamFlags flags);
+gboolean gimp_param_spec_unit_pixel_allowed (GParamSpec *pspec);
+gboolean gimp_param_spec_unit_percent_allowed (GParamSpec *pspec);
G_END_DECLS
diff --git a/libgimpcolor/gimpcolor.c b/libgimpcolor/gimpcolor.c
index a76b94137c..78209b7bf9 100644
--- a/libgimpcolor/gimpcolor.c
+++ b/libgimpcolor/gimpcolor.c
@@ -329,16 +329,9 @@ gimp_color_is_out_of_gamut (GeglColor *color,
* GIMP_TYPE_PARAM_COLOR
*/
-static void gimp_param_color_class_init (GimpParamSpecObjectClass *klass);
-static void gimp_param_color_init (GParamSpec *pspec);
-static GParamSpec * gimp_param_color_duplicate (GParamSpec *pspec);
-static gboolean gimp_param_color_validate (GParamSpec *pspec,
- GValue *value);
-static void gimp_param_color_set_default (GParamSpec *pspec,
- GValue *value);
-static gint gimp_param_color_cmp (GParamSpec *param_spec,
- const GValue *value1,
- const GValue *value2);
+#define GIMP_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_COLOR, GimpParamSpecColor))
+
+typedef struct _GimpParamSpecColor GimpParamSpecColor;
struct _GimpParamSpecColor
{
@@ -362,6 +355,17 @@ struct _GimpParamSpecColor
gboolean validate;
};
+static void gimp_param_color_class_init (GimpParamSpecObjectClass *klass);
+static void gimp_param_color_init (GParamSpec *pspec);
+static GParamSpec * gimp_param_color_duplicate (GParamSpec *pspec);
+static gboolean gimp_param_color_validate (GParamSpec *pspec,
+ GValue *value);
+static void gimp_param_color_set_default (GParamSpec *pspec,
+ GValue *value);
+static gint gimp_param_color_cmp (GParamSpec *param_spec,
+ const GValue *value1,
+ const GValue *value2);
+
GType
gimp_param_color_get_type (void)
{
@@ -507,8 +511,7 @@ gimp_param_color_cmp (GParamSpec *param_spec,
*
* Creates a new #GParamSpec instance specifying a #GeglColor property.
* Note that the @default_color is duplicated, so reusing object will
- * not change the default color of the returned
- * [struct@Gimp.ParamSpecColor].
+ * not change the default color of the returned %GimpParamSpecColor.
*
* Returns: (transfer full): a newly created parameter specification
*/
diff --git a/libgimpcolor/gimpcolor.h b/libgimpcolor/gimpcolor.h
index 5cb2e4d832..c046a1bcbd 100644
--- a/libgimpcolor/gimpcolor.h
+++ b/libgimpcolor/gimpcolor.h
@@ -70,8 +70,9 @@ gboolean gimp_color_is_out_of_gamut (GeglColor *color,
* GIMP_TYPE_PARAM_COLOR
*/
+#define GIMP_VALUE_HOLDS_COLOR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GEGL_TYPE_COLOR))
+
#define GIMP_TYPE_PARAM_COLOR (gimp_param_color_get_type ())
-#define GIMP_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_COLOR, GimpParamSpecColor))
#define GIMP_IS_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_COLOR))
GType gimp_param_color_get_type (void) G_GNUC_CONST;
diff --git a/libgimpcolor/gimpcolortypes.h b/libgimpcolor/gimpcolortypes.h
index 14c43ac467..3825050035 100644
--- a/libgimpcolor/gimpcolortypes.h
+++ b/libgimpcolor/gimpcolortypes.h
@@ -33,8 +33,6 @@ typedef struct _GimpColorManaged GimpColorManaged; /* dummy typedef */
typedef struct _GimpColorProfile GimpColorProfile;
typedef struct _GimpColorTransform GimpColorTransform;
-typedef struct _GimpParamSpecColor GimpParamSpecColor;
-
G_END_DECLS