From f297aca19c08e3f1de9ddc2a413686b85ccf2a85 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Thu, 8 Jul 2021 22:18:28 +0200 Subject: Feature: Turns out it's useful to derive from that Not all features are just providing objectIDs. CLOCKSYNC or FFQ for example are more complex --- libgupnp-av/gupnp-feature.c | 8 -------- libgupnp-av/gupnp-feature.h | 11 +++++++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libgupnp-av/gupnp-feature.c b/libgupnp-av/gupnp-feature.c index f904ce5..ee12015 100644 --- a/libgupnp-av/gupnp-feature.c +++ b/libgupnp-av/gupnp-feature.c @@ -18,10 +18,6 @@ #include "gupnp-feature.h" -struct _GUPnPFeatureClass { - GObjectClass parent_class; -}; - struct _GUPnPFeaturePrivate { char *name; char *version; @@ -29,10 +25,6 @@ struct _GUPnPFeaturePrivate { }; typedef struct _GUPnPFeaturePrivate GUPnPFeaturePrivate; -struct _GUPnPFeature { - GObject parent; -}; - G_DEFINE_TYPE_WITH_PRIVATE (GUPnPFeature, gupnp_feature, G_TYPE_OBJECT) diff --git a/libgupnp-av/gupnp-feature.h b/libgupnp-av/gupnp-feature.h index 3126384..ffd486d 100644 --- a/libgupnp-av/gupnp-feature.h +++ b/libgupnp-av/gupnp-feature.h @@ -14,11 +14,18 @@ G_BEGIN_DECLS -typedef struct _GUPnPFeature GUPnPFeature; -G_DECLARE_FINAL_TYPE (GUPnPFeature, gupnp_feature, GUPNP, FEATURE, GObject) +G_DECLARE_DERIVABLE_TYPE(GUPnPFeature, + gupnp_feature, + GUPNP, + FEATURE, + GObject) #define GUPNP_TYPE_FEATURE (gupnp_feature_get_type ()) +struct _GUPnPFeatureClass { + GObjectClass parent_class; +}; + const char * gupnp_feature_get_name (GUPnPFeature *feature); -- cgit v1.2.1