libgimp, libgimpbase: don't uselessly expose param spec structs when…

… they are the same as the parent struct.
This commit is contained in:
Jehan 2024-11-01 23:26:34 +01:00
parent 8075474fda
commit 519f0bf817
6 changed files with 25 additions and 161 deletions

View File

@ -258,7 +258,7 @@ gimp_param_drawable_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_drawable_class_init,
NULL, NULL,
sizeof (GimpParamSpecDrawable),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_drawable_init
};
@ -338,7 +338,7 @@ gimp_param_layer_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_layer_class_init,
NULL, NULL,
sizeof (GimpParamSpecLayer),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_layer_init
};
@ -418,7 +418,7 @@ gimp_param_text_layer_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_text_layer_class_init,
NULL, NULL,
sizeof (GimpParamSpecTextLayer),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_text_layer_init
};
@ -498,7 +498,7 @@ gimp_param_group_layer_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_group_layer_class_init,
NULL, NULL,
sizeof (GimpParamSpecGroupLayer),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_group_layer_init
};
@ -578,7 +578,7 @@ gimp_param_channel_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_channel_class_init,
NULL, NULL,
sizeof (GimpParamSpecChannel),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_channel_init
};
@ -658,7 +658,7 @@ gimp_param_layer_mask_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_layer_mask_class_init,
NULL, NULL,
sizeof (GimpParamSpecLayerMask),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_layer_mask_init
};
@ -738,7 +738,7 @@ gimp_param_selection_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_selection_class_init,
NULL, NULL,
sizeof (GimpParamSpecSelection),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_selection_init
};
@ -818,7 +818,7 @@ gimp_param_path_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_path_class_init,
NULL, NULL,
sizeof (GimpParamSpecPath),
sizeof (GimpParamSpecItem),
0,
(GInstanceInitFunc) gimp_param_path_init
};
@ -1234,7 +1234,7 @@ gimp_param_brush_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_brush_class_init,
NULL, NULL,
sizeof (GimpParamSpecBrush),
sizeof (GimpParamSpecResource),
0,
(GInstanceInitFunc) gimp_param_brush_init
};
@ -1309,7 +1309,7 @@ gimp_param_pattern_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_pattern_class_init,
NULL, NULL,
sizeof (GimpParamSpecPattern),
sizeof (GimpParamSpecResource),
0,
(GInstanceInitFunc) gimp_param_pattern_init
};
@ -1384,7 +1384,7 @@ gimp_param_gradient_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_gradient_class_init,
NULL, NULL,
sizeof (GimpParamSpecGradient),
sizeof (GimpParamSpecResource),
0,
(GInstanceInitFunc) gimp_param_gradient_init
};
@ -1459,7 +1459,7 @@ gimp_param_palette_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_palette_class_init,
NULL, NULL,
sizeof (GimpParamSpecPalette),
sizeof (GimpParamSpecResource),
0,
(GInstanceInitFunc) gimp_param_palette_init
};
@ -1534,7 +1534,7 @@ gimp_param_font_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_font_class_init,
NULL, NULL,
sizeof (GimpParamSpecFont),
sizeof (GimpParamSpecResource),
0,
(GInstanceInitFunc) gimp_param_font_init
};

View File

@ -96,16 +96,8 @@ GParamSpec * gimp_param_spec_item (const gchar *name,
GIMP_TYPE_DRAWABLE))
#define GIMP_TYPE_PARAM_DRAWABLE (gimp_param_drawable_get_type ())
#define GIMP_PARAM_SPEC_DRAWABLE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_DRAWABLE, GimpParamSpecDrawable))
#define GIMP_IS_PARAM_SPEC_DRAWABLE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_DRAWABLE))
typedef struct _GimpParamSpecDrawable GimpParamSpecDrawable;
struct _GimpParamSpecDrawable
{
GimpParamSpecItem parent_instance;
};
GType gimp_param_drawable_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_drawable (const gchar *name,
@ -123,16 +115,8 @@ GParamSpec * gimp_param_spec_drawable (const gchar *name,
GIMP_TYPE_LAYER))
#define GIMP_TYPE_PARAM_LAYER (gimp_param_layer_get_type ())
#define GIMP_PARAM_SPEC_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_LAYER, GimpParamSpecLayer))
#define GIMP_IS_PARAM_SPEC_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_LAYER))
typedef struct _GimpParamSpecLayer GimpParamSpecLayer;
struct _GimpParamSpecLayer
{
GimpParamSpecDrawable parent_instance;
};
GType gimp_param_layer_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_layer (const gchar *name,
@ -150,16 +134,8 @@ GParamSpec * gimp_param_spec_layer (const gchar *name,
GIMP_TYPE_TEXT_LAYER))
#define GIMP_TYPE_PARAM_TEXT_LAYER (gimp_param_text_layer_get_type ())
#define GIMP_PARAM_SPEC_TEXT_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_TEXT_LAYER, GimpParamSpecTextLayer))
#define GIMP_IS_PARAM_SPEC_TEXT_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_TEXT_LAYER))
typedef struct _GimpParamSpecTextLayer GimpParamSpecTextLayer;
struct _GimpParamSpecTextLayer
{
GimpParamSpecLayer parent_instance;
};
GType gimp_param_text_layer_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_text_layer (const gchar *name,
@ -177,16 +153,8 @@ GParamSpec * gimp_param_spec_text_layer (const gchar *name,
GIMP_TYPE_GROUP_LAYER))
#define GIMP_TYPE_PARAM_GROUP_LAYER (gimp_param_group_layer_get_type ())
#define GIMP_PARAM_SPEC_GROUP_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_GROUP_LAYER, GimpParamSpecGroupLayer))
#define GIMP_IS_PARAM_SPEC_GROUP_LAYER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_GROUP_LAYER))
typedef struct _GimpParamSpecGroupLayer GimpParamSpecGroupLayer;
struct _GimpParamSpecGroupLayer
{
GimpParamSpecLayer parent_instance;
};
GType gimp_param_group_layer_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_group_layer (const gchar *name,
@ -204,16 +172,8 @@ GParamSpec * gimp_param_spec_group_layer (const gchar *name,
GIMP_TYPE_CHANNEL))
#define GIMP_TYPE_PARAM_CHANNEL (gimp_param_channel_get_type ())
#define GIMP_PARAM_SPEC_CHANNEL(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_CHANNEL, GimpParamSpecChannel))
#define GIMP_IS_PARAM_SPEC_CHANNEL(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_CHANNEL))
typedef struct _GimpParamSpecChannel GimpParamSpecChannel;
struct _GimpParamSpecChannel
{
GimpParamSpecDrawable parent_instance;
};
GType gimp_param_channel_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_channel (const gchar *name,
@ -231,16 +191,8 @@ GParamSpec * gimp_param_spec_channel (const gchar *name,
GIMP_TYPE_LAYER_MASK))
#define GIMP_TYPE_PARAM_LAYER_MASK (gimp_param_layer_mask_get_type ())
#define GIMP_PARAM_SPEC_LAYER_MASK(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_LAYER_MASK, GimpParamSpecLayerMask))
#define GIMP_IS_PARAM_SPEC_LAYER_MASK(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_LAYER_MASK))
typedef struct _GimpParamSpecLayerMask GimpParamSpecLayerMask;
struct _GimpParamSpecLayerMask
{
GimpParamSpecChannel parent_instance;
};
GType gimp_param_layer_mask_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_layer_mask (const gchar *name,
@ -258,16 +210,8 @@ GParamSpec * gimp_param_spec_layer_mask (const gchar *name,
GIMP_TYPE_SELECTION))
#define GIMP_TYPE_PARAM_SELECTION (gimp_param_selection_get_type ())
#define GIMP_PARAM_SPEC_SELECTION(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_SELECTION, GimpParamSpecSelection))
#define GIMP_IS_PARAM_SPEC_SELECTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_SELECTION))
typedef struct _GimpParamSpecSelection GimpParamSpecSelection;
struct _GimpParamSpecSelection
{
GimpParamSpecChannel parent_instance;
};
GType gimp_param_selection_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_selection (const gchar *name,
@ -285,16 +229,8 @@ GParamSpec * gimp_param_spec_selection (const gchar *name,
GIMP_TYPE_PATH))
#define GIMP_TYPE_PARAM_PATH (gimp_param_path_get_type ())
#define GIMP_PARAM_SPEC_PATH(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_PATH, GimpParamSpecPath))
#define GIMP_IS_PARAM_SPEC_PATH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PATH))
typedef struct _GimpParamSpecPath GimpParamSpecPath;
struct _GimpParamSpecPath
{
GimpParamSpecItem parent_instance;
};
GType gimp_param_path_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_path (const gchar *name,
@ -373,16 +309,8 @@ GParamSpec * gimp_param_spec_resource (const gchar *name,
GIMP_TYPE_BRUSH))
#define GIMP_TYPE_PARAM_BRUSH (gimp_param_brush_get_type ())
#define GIMP_PARAM_SPEC_BRUSH(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_BRUSH, GimpParamSpecBrush))
#define GIMP_IS_PARAM_SPEC_BRUSH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_BRUSH))
typedef struct _GimpParamSpecBrush GimpParamSpecBrush;
struct _GimpParamSpecBrush
{
GimpParamSpecResource parent_instance;
};
GType gimp_param_brush_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_brush (const gchar *name,
@ -402,16 +330,8 @@ GParamSpec * gimp_param_spec_brush (const gchar *name,
GIMP_TYPE_PATTERN))
#define GIMP_TYPE_PARAM_PATTERN (gimp_param_pattern_get_type ())
#define GIMP_PARAM_SPEC_PATTERN(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_PATTERN, GimpParamSpecPattern))
#define GIMP_IS_PARAM_SPEC_PATTERN(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PATTERN))
typedef struct _GimpParamSpecPattern GimpParamSpecPattern;
struct _GimpParamSpecPattern
{
GimpParamSpecResource parent_instance;
};
GType gimp_param_pattern_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_pattern (const gchar *name,
@ -431,16 +351,8 @@ GParamSpec * gimp_param_spec_pattern (const gchar *name,
GIMP_TYPE_GRADIENT))
#define GIMP_TYPE_PARAM_GRADIENT (gimp_param_gradient_get_type ())
#define GIMP_PARAM_SPEC_GRADIENT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_GRADIENT, GimpParamSpecGradient))
#define GIMP_IS_PARAM_SPEC_GRADIENT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_GRADIENT))
typedef struct _GimpParamSpecGradient GimpParamSpecGradient;
struct _GimpParamSpecGradient
{
GimpParamSpecResource parent_instance;
};
GType gimp_param_gradient_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_gradient (const gchar *name,
@ -460,16 +372,8 @@ GParamSpec * gimp_param_spec_gradient (const gchar *name,
GIMP_TYPE_PALETTE))
#define GIMP_TYPE_PARAM_PALETTE (gimp_param_palette_get_type ())
#define GIMP_PARAM_SPEC_PALETTE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_PALETTE, GimpParamSpecPalette))
#define GIMP_IS_PARAM_SPEC_PALETTE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PALETTE))
typedef struct _GimpParamSpecPalette GimpParamSpecPalette;
struct _GimpParamSpecPalette
{
GimpParamSpecResource parent_instance;
};
GType gimp_param_palette_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_palette (const gchar *name,
@ -489,16 +393,8 @@ GParamSpec * gimp_param_spec_palette (const gchar *name,
GIMP_TYPE_FONT))
#define GIMP_TYPE_PARAM_FONT (gimp_param_font_get_type ())
#define GIMP_PARAM_SPEC_FONT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FONT, GimpParamSpecFont))
#define GIMP_IS_PARAM_SPEC_FONT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_FONT))
typedef struct _GimpParamSpecFont GimpParamSpecFont;
struct _GimpParamSpecFont
{
GimpParamSpecResource parent_instance;
};
GType gimp_param_font_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_font (const gchar *name,

View File

@ -294,7 +294,7 @@ gimp_param_array_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecArray),
sizeof (GParamSpecBoxed),
0,
(GInstanceInitFunc) gimp_param_array_init
};
@ -382,12 +382,12 @@ gimp_param_spec_array (const gchar *name,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecArray *array_spec;
GParamSpec *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
return array_spec;
}
static const guint8 *
@ -515,7 +515,7 @@ gimp_param_int32_array_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_int32_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecInt32Array),
sizeof (GParamSpecBoxed),
0,
(GInstanceInitFunc) gimp_param_int32_array_init
};
@ -560,12 +560,12 @@ gimp_param_spec_int32_array (const gchar *name,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecArray *array_spec;
GParamSpec *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_INT32_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
return array_spec;
}
/**
@ -750,7 +750,7 @@ gimp_param_float_array_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_float_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecFloatArray),
sizeof (GParamSpecBoxed),
0,
(GInstanceInitFunc) gimp_param_float_array_init
};
@ -795,12 +795,12 @@ gimp_param_spec_float_array (const gchar *name,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecArray *array_spec;
GParamSpec *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_FLOAT_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
return array_spec;
}
/**

View File

@ -189,16 +189,8 @@ GType gimp_array_get_type (void) G_GNUC_CONST;
*/
#define GIMP_TYPE_PARAM_ARRAY (gimp_param_array_get_type ())
#define GIMP_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_ARRAY, GimpParamSpecArray))
#define GIMP_IS_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_ARRAY))
typedef struct _GimpParamSpecArray GimpParamSpecArray;
struct _GimpParamSpecArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_array (const gchar *name,
@ -229,16 +221,8 @@ void gimp_int32_array_set_values (GimpArray *array,
*/
#define GIMP_TYPE_PARAM_INT32_ARRAY (gimp_param_int32_array_get_type ())
#define GIMP_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY, GimpParamSpecInt32Array))
#define GIMP_IS_PARAM_SPEC_INT32_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT32_ARRAY))
typedef struct _GimpParamSpecInt32Array GimpParamSpecInt32Array;
struct _GimpParamSpecInt32Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int32_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int32_array (const gchar *name,
@ -283,16 +267,8 @@ void gimp_float_array_set_values (GimpArray *array,
*/
#define GIMP_TYPE_PARAM_FLOAT_ARRAY (gimp_param_float_array_get_type ())
#define GIMP_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY, GimpParamSpecFloatArray))
#define GIMP_IS_PARAM_SPEC_FLOAT_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_FLOAT_ARRAY))
typedef struct _GimpParamSpecFloatArray GimpParamSpecFloatArray;
struct _GimpParamSpecFloatArray
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_float_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_float_array (const gchar *name,

View File

@ -60,12 +60,6 @@ G_DEFINE_BOXED_TYPE (GimpParasite, gimp_parasite, gimp_parasite_copy, gimp_paras
* GIMP_TYPE_PARAM_PARASITE
*/
#define GIMP_PARAM_SPEC_PARASITE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_PARASITE, GimpParamSpecParasite))
struct _GimpParamSpecParasite
{
GParamSpecBoxed parent_instance;
};
static void gimp_param_parasite_class_init (GParamSpecClass *class);
static void gimp_param_parasite_init (GParamSpec *pspec);
@ -88,7 +82,7 @@ gimp_param_parasite_get_type (void)
NULL, NULL,
(GClassInitFunc) gimp_param_parasite_class_init,
NULL, NULL,
sizeof (GimpParamSpecParasite),
sizeof (GParamSpecBoxed),
0,
(GInstanceInitFunc) gimp_param_parasite_init
};
@ -177,12 +171,12 @@ gimp_param_spec_parasite (const gchar *name,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecParasite *parasite_spec;
GParamSpec *parasite_spec;
parasite_spec = g_param_spec_internal (GIMP_TYPE_PARAM_PARASITE,
name, nick, blurb, flags);
return G_PARAM_SPEC (parasite_spec);
return parasite_spec;
}

View File

@ -48,8 +48,6 @@ GType gimp_parasite_get_type (void) G_GNUC_CONST;
#define GIMP_TYPE_PARAM_PARASITE (gimp_param_parasite_get_type ())
#define GIMP_IS_PARAM_SPEC_PARASITE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PARASITE))
typedef struct _GimpParamSpecParasite GimpParamSpecParasite;
GType gimp_param_parasite_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_parasite (const gchar *name,