[gupnp-dlna/wip/new-api: 7/48] Make GUPnPDLNARestriction a boxed type.



commit 77b10103e5749c5a7b2f64e316b4cbeac74f6f04
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Wed Nov 28 12:02:58 2012 +0100

    Make GUPnPDLNARestriction a boxed type.

 libgupnp-dlna/gupnp-dlna-restriction.c |    5 +++++
 libgupnp-dlna/gupnp-dlna-restriction.h |   11 +++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp-dlna/gupnp-dlna-restriction.c b/libgupnp-dlna/gupnp-dlna-restriction.c
index 5b8531c..7742562 100644
--- a/libgupnp-dlna/gupnp-dlna-restriction.c
+++ b/libgupnp-dlna/gupnp-dlna-restriction.c
@@ -30,6 +30,11 @@ struct _GUPnPDLNARestriction {
         GHashTable *entries; /* <gchar *, GUPnPDLNANativeValueList *> */
 };
 
+G_DEFINE_BOXED_TYPE (GUPnPDLNARestriction,
+                     gupnp_dlna_restriction,
+                     gupnp_dlna_restriction_copy,
+                     gupnp_dlna_restriction_free)
+
 GUPnPDLNARestriction *
 gupnp_dlna_restriction_new (const gchar *mime)
 {
diff --git a/libgupnp-dlna/gupnp-dlna-restriction.h b/libgupnp-dlna/gupnp-dlna-restriction.h
index 3660f46..1fccb08 100644
--- a/libgupnp-dlna/gupnp-dlna-restriction.h
+++ b/libgupnp-dlna/gupnp-dlna-restriction.h
@@ -23,6 +23,7 @@
 #define __GUPNP_DLNA_RESTRICTION_H__
 
 #include <glib.h>
+#include <glib-object.h>
 
 G_BEGIN_DECLS
 
@@ -31,6 +32,16 @@ typedef struct _GUPnPDLNARestriction GUPnPDLNARestriction;
 #define GUPNP_DLNA_RESTRICTION(x) \
         ((GUPnPDLNARestriction *) x)
 
+/**
+ * GUPNP_TYPE_DLNA_RESTRICTION:
+ *
+ * The #GType for #GUPnPDLNARestriction.
+ */
+#define GUPNP_TYPE_DLNA_RESTRICTION (gupnp_dlna_restriction_get_type ())
+
+GType
+gupnp_dlna_restriction_get_type (void) G_GNUC_CONST;
+
 GUPnPDLNARestriction *
 gupnp_dlna_restriction_copy (GUPnPDLNARestriction *restriction);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]