diff --git a/app/core/gimpbezierdesc.c b/app/core/gimpbezierdesc.c index 6047544a67dcc162c649848a594cd82f3536c1ee..65acd9f24f7dfe1171c4e14c56a7d2b6e907810f 100644 --- a/app/core/gimpbezierdesc.c +++ b/app/core/gimpbezierdesc.c @@ -29,18 +29,7 @@ #include "gimpboundary.h" -GType -gimp_bezier_desc_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpBezierDesc", - (GBoxedCopyFunc) gimp_bezier_desc_copy, - (GBoxedFreeFunc) gimp_bezier_desc_free); - - return type; -} +G_DEFINE_BOXED_TYPE (GimpBezierDesc, gimp_bezier_desc, gimp_bezier_desc_copy, gimp_bezier_desc_free) GimpBezierDesc * gimp_bezier_desc_new (cairo_path_data_t *data, diff --git a/app/core/gimpdashpattern.c b/app/core/gimpdashpattern.c index e9fb9fc9a27806c2e2234908b1722cd5a4570c13..4ed756b97ad60dc331f62d5a0dea97efb1bca321 100644 --- a/app/core/gimpdashpattern.c +++ b/app/core/gimpdashpattern.c @@ -30,18 +30,8 @@ #include "gimpdashpattern.h" -GType -gimp_dash_pattern_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpDashPattern", - (GBoxedCopyFunc) gimp_dash_pattern_copy, - (GBoxedFreeFunc) gimp_dash_pattern_free); - - return type; -} +typedef GArray GimpDashPattern; +G_DEFINE_BOXED_TYPE (GimpDashPattern, gimp_dash_pattern, gimp_dash_pattern_copy, gimp_dash_pattern_free) GArray * gimp_dash_pattern_new_from_preset (GimpDashPreset preset) diff --git a/app/vectors/gimpanchor.c b/app/vectors/gimpanchor.c index f5085cdb6026bef278b440b0f2d25a102fd68b76..fa348ae798c85a22634953366df14608e774b1c2 100644 --- a/app/vectors/gimpanchor.c +++ b/app/vectors/gimpanchor.c @@ -27,18 +27,7 @@ #include "gimpanchor.h" -GType -gimp_anchor_get_type (void) -{ - static GType anchor_type = 0; - - if (!anchor_type) - anchor_type = g_boxed_type_register_static ("GimpAnchor", - (GBoxedCopyFunc) gimp_anchor_copy, - (GBoxedFreeFunc) gimp_anchor_free); - - return anchor_type; -} +G_DEFINE_BOXED_TYPE (GimpAnchor, gimp_anchor, gimp_anchor_copy, gimp_anchor_free) GimpAnchor * gimp_anchor_new (GimpAnchorType type, diff --git a/libgimpbase/gimpparamspecs.c b/libgimpbase/gimpparamspecs.c index 1b3e46b1fb62479fdd885a7c94dbe83d430859d6..c0c4d5220c607fc977b71bb665ce8be39fbe8b20 100644 --- a/libgimpbase/gimpparamspecs.c +++ b/libgimpbase/gimpparamspecs.c @@ -69,18 +69,7 @@ gimp_array_free (GimpArray *array) } } -GType -gimp_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpArray", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} +G_DEFINE_BOXED_TYPE (GimpArray, gimp_array, gimp_array_copy, gimp_array_free) /* @@ -263,19 +252,8 @@ gimp_value_take_array (GValue *value, * GIMP_TYPE_UINT8_ARRAY */ -GType -gimp_uint8_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpUInt8Array", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} - +typedef GimpArray GimpUint8Array; +G_DEFINE_BOXED_TYPE (GimpUint8Array, gimp_uint8_array, gimp_array_copy, gimp_array_free) /* * GIMP_TYPE_PARAM_UINT8_ARRAY @@ -401,18 +379,8 @@ gimp_value_take_uint8_array (GValue *value, * GIMP_TYPE_INT16_ARRAY */ -GType -gimp_int16_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpInt16Array", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} +typedef GimpArray GimpInt16Array; +G_DEFINE_BOXED_TYPE (GimpInt16Array, gimp_int16_array, gimp_array_copy, gimp_array_free) /* @@ -542,19 +510,8 @@ gimp_value_take_int16_array (GValue *value, * GIMP_TYPE_INT32_ARRAY */ -GType -gimp_int32_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpInt32Array", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} - +typedef GimpArray GimpInt32Array; +G_DEFINE_BOXED_TYPE (GimpInt32Array, gimp_int32_array, gimp_array_copy, gimp_array_free) /* * GIMP_TYPE_PARAM_INT32_ARRAY @@ -683,19 +640,8 @@ gimp_value_take_int32_array (GValue *value, * GIMP_TYPE_FLOAT_ARRAY */ -GType -gimp_float_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpFloatArray", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} - +typedef GimpArray GimpFloatArray; +G_DEFINE_BOXED_TYPE (GimpFloatArray, gimp_float_array, gimp_array_copy, gimp_array_free) /* * GIMP_TYPE_PARAM_FLOAT_ARRAY @@ -911,19 +857,7 @@ gimp_string_array_free (GimpStringArray *array) } } -GType -gimp_string_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpStringArray", - (GBoxedCopyFunc) gimp_string_array_copy, - (GBoxedFreeFunc) gimp_string_array_free); - - return type; -} - +G_DEFINE_BOXED_TYPE (GimpStringArray, gimp_string_array, gimp_string_array_copy, gimp_string_array_free) /* * GIMP_TYPE_PARAM_STRING_ARRAY @@ -1146,18 +1080,8 @@ gimp_value_take_string_array (GValue *value, * GIMP_TYPE_RGB_ARRAY */ -GType -gimp_rgb_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpRGBArray", - (GBoxedCopyFunc) gimp_array_copy, - (GBoxedFreeFunc) gimp_array_free); - - return type; -} +typedef GimpArray GimpRGBArray; +G_DEFINE_BOXED_TYPE (GimpRGBArray, gimp_rgb_array, gimp_array_copy, gimp_array_free) /* @@ -1380,18 +1304,7 @@ gimp_object_array_free (GimpObjectArray *array) } } -GType -gimp_object_array_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpObjectArray", - (GBoxedCopyFunc) gimp_object_array_copy, - (GBoxedFreeFunc) gimp_object_array_free); - - return type; -} +G_DEFINE_BOXED_TYPE (GimpObjectArray, gimp_object_array, gimp_object_array_copy, gimp_object_array_free) /* diff --git a/libgimpbase/gimpparasite.c b/libgimpbase/gimpparasite.c index bf9f219cee69ebd1d5a056455bb2038e79f3a12c..ddfd352f123593bdfc8c013596c374572af75337 100644 --- a/libgimpbase/gimpparasite.c +++ b/libgimpbase/gimpparasite.c @@ -55,19 +55,7 @@ * GIMP_TYPE_PARASITE */ -GType -gimp_parasite_get_type (void) -{ - static GType type = 0; - - if (! type) - type = g_boxed_type_register_static ("GimpParasite", - (GBoxedCopyFunc) gimp_parasite_copy, - (GBoxedFreeFunc) gimp_parasite_free); - - return type; -} - +G_DEFINE_BOXED_TYPE (GimpParasite, gimp_parasite, gimp_parasite_copy, gimp_parasite_free) /* * GIMP_TYPE_PARAM_PARASITE diff --git a/libgimpcolor/gimpcmyk.c b/libgimpcolor/gimpcmyk.c index 28b08eb6ca030aa5b5a2db490dfccad4e8adfb71..def52dddd0e256270ad4fcfb0fca540d45f51b6c 100644 --- a/libgimpcolor/gimpcmyk.c +++ b/libgimpcolor/gimpcmyk.c @@ -43,18 +43,7 @@ static GimpCMYK * gimp_cmyk_copy (const GimpCMYK *cmyk); -GType -gimp_cmyk_get_type (void) -{ - static GType cmyk_type = 0; - - if (!cmyk_type) - cmyk_type = g_boxed_type_register_static ("GimpCMYK", - (GBoxedCopyFunc) gimp_cmyk_copy, - (GBoxedFreeFunc) g_free); - - return cmyk_type; -} +G_DEFINE_BOXED_TYPE (GimpCMYK, gimp_cmyk, gimp_cmyk_copy, g_free) static GimpCMYK * gimp_cmyk_copy (const GimpCMYK *cmyk) diff --git a/libgimpcolor/gimphsl.c b/libgimpcolor/gimphsl.c index 050a40d3b504a2801333ad73e8aa66696e2f241a..84575edeb3fd83c0840d7e4c3930fa173adfc997 100644 --- a/libgimpcolor/gimphsl.c +++ b/libgimpcolor/gimphsl.c @@ -32,18 +32,7 @@ static GimpHSL * gimp_hsl_copy (const GimpHSL *hsl); -GType -gimp_hsl_get_type (void) -{ - static GType hsl_type = 0; - - if (!hsl_type) - hsl_type = g_boxed_type_register_static ("GimpHSL", - (GBoxedCopyFunc) gimp_hsl_copy, - (GBoxedFreeFunc) g_free); - - return hsl_type; -} +G_DEFINE_BOXED_TYPE (GimpHSL, gimp_hsl, gimp_hsl_copy, g_free) static GimpHSL * gimp_hsl_copy (const GimpHSL *hsl) diff --git a/libgimpcolor/gimphsv.c b/libgimpcolor/gimphsv.c index 56bfbd7ed18e2f74a35bc7b2cce37ed7747eccc3..6cb430067fc8dbe6a9f65e6b2524b63e43d72a6c 100644 --- a/libgimpcolor/gimphsv.c +++ b/libgimpcolor/gimphsv.c @@ -41,18 +41,7 @@ static GimpHSV * gimp_hsv_copy (const GimpHSV *hsv); -GType -gimp_hsv_get_type (void) -{ - static GType hsv_type = 0; - - if (!hsv_type) - hsv_type = g_boxed_type_register_static ("GimpHSV", - (GBoxedCopyFunc) gimp_hsv_copy, - (GBoxedFreeFunc) g_free); - - return hsv_type; -} +G_DEFINE_BOXED_TYPE (GimpHSV, gimp_hsv, gimp_hsv_copy, g_free) static GimpHSV * gimp_hsv_copy (const GimpHSV *hsv) diff --git a/libgimpcolor/gimprgb.c b/libgimpcolor/gimprgb.c index 64c4767a1a31b7b7932312734de197a0eb899767..695d5e8b20595d528405a2c52f897aed1eaca3a8 100644 --- a/libgimpcolor/gimprgb.c +++ b/libgimpcolor/gimprgb.c @@ -43,18 +43,7 @@ static GimpRGB * gimp_rgb_copy (const GimpRGB *rgb); -GType -gimp_rgb_get_type (void) -{ - static GType rgb_type = 0; - - if (!rgb_type) - rgb_type = g_boxed_type_register_static ("GimpRGB", - (GBoxedCopyFunc) gimp_rgb_copy, - (GBoxedFreeFunc) g_free); - - return rgb_type; -} +G_DEFINE_BOXED_TYPE (GimpRGB, gimp_rgb, gimp_rgb_copy, g_free) void gimp_value_get_rgb (const GValue *value, diff --git a/libgimpmath/gimpmatrix.c b/libgimpmath/gimpmatrix.c index 8ede5b26f646fcce16d76879367092418c554020..836978ab1c11a6f58674efef222d1171eef11e97 100644 --- a/libgimpmath/gimpmatrix.c +++ b/libgimpmath/gimpmatrix.c @@ -49,27 +49,7 @@ static GimpMatrix2 * matrix2_copy (const GimpMatrix2 *matrix); -/** - * gimp_matrix2_get_type: - * - * Reveals the object type - * - * Returns: the #GType for Matrix2 objects - * - * Since: 2.4 - **/ -GType -gimp_matrix2_get_type (void) -{ - static GType matrix_type = 0; - - if (!matrix_type) - matrix_type = g_boxed_type_register_static ("GimpMatrix2", - (GBoxedCopyFunc) matrix2_copy, - (GBoxedFreeFunc) g_free); - - return matrix_type; -} +G_DEFINE_BOXED_TYPE (GimpMatrix2, gimp_matrix2, matrix2_copy, g_free) /* @@ -267,27 +247,7 @@ gimp_matrix2_mult (const GimpMatrix2 *matrix1, static GimpMatrix3 * matrix3_copy (const GimpMatrix3 *matrix); -/** - * gimp_matrix3_get_type: - * - * Reveals the object type - * - * Returns: the #GType for Matrix3 objects - * - * Since: 2.8 - **/ -GType -gimp_matrix3_get_type (void) -{ - static GType matrix_type = 0; - - if (!matrix_type) - matrix_type = g_boxed_type_register_static ("GimpMatrix3", - (GBoxedCopyFunc) matrix3_copy, - (GBoxedFreeFunc) g_free); - - return matrix_type; -} +G_DEFINE_BOXED_TYPE (GimpMatrix3, gimp_matrix3, matrix3_copy, g_free) /*