diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c index ce1f6d2e22..eee85fb8bc 100644 --- a/app/core/gimpgrouplayer.c +++ b/app/core/gimpgrouplayer.c @@ -74,7 +74,8 @@ struct _GimpGroupLayerPrivate gboolean reallocate_projection; }; -#define GET_PRIVATE(item) ((GimpGroupLayerPrivate *) gimp_group_layer_get_instance_private ((GimpGroupLayer *) (item))) +#define GET_PRIVATE(item) \ + ((GimpGroupLayerPrivate *) gimp_group_layer_get_instance_private ((GimpGroupLayer *) (item))) static void gimp_projectable_iface_init (GimpProjectableInterface *iface); diff --git a/app/core/gimpgrouplayer.h b/app/core/gimpgrouplayer.h index 7783156f13..c04d73ddff 100644 --- a/app/core/gimpgrouplayer.h +++ b/app/core/gimpgrouplayer.h @@ -23,21 +23,13 @@ #include "gimplayer.h" -#define GIMP_TYPE_GROUP_LAYER (gimp_group_layer_get_type ()) -#define GIMP_GROUP_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_GROUP_LAYER, GimpGroupLayer)) -#define GIMP_GROUP_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_GROUP_LAYER, GimpGroupLayerClass)) -#define GIMP_IS_GROUP_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_GROUP_LAYER)) -#define GIMP_IS_GROUP_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_GROUP_LAYER)) -#define GIMP_GROUP_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_GROUP_LAYER, GimpGroupLayerClass)) +#define GIMP_TYPE_GROUP_LAYER (gimp_group_layer_get_type ()) +G_DECLARE_DERIVABLE_TYPE (GimpGroupLayer, + gimp_group_layer, + GIMP, GROUP_LAYER, + GimpLayer) -typedef struct _GimpGroupLayerClass GimpGroupLayerClass; - -struct _GimpGroupLayer -{ - GimpLayer parent_instance; -}; - struct _GimpGroupLayerClass { GimpLayerClass parent_class; diff --git a/app/core/gimplayer.h b/app/core/gimplayer.h index 6748ebc879..f02d6038bf 100644 --- a/app/core/gimplayer.h +++ b/app/core/gimplayer.h @@ -246,3 +246,5 @@ gboolean gimp_layer_is_alpha_locked (GimpLayer *layer, void gimp_layer_update_effective_mode (GimpLayer *layer); void gimp_layer_update_excludes_backdrop (GimpLayer *layer); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GimpLayer, g_object_unref);