make GstPropsEntry a boxed type

Original commit message from CVS:
make GstPropsEntry a boxed type
This commit is contained in:
David I. Lehn 2003-01-03 23:34:43 +00:00
parent 4ec698fa6c
commit 0d3e4d08af
2 changed files with 15 additions and 5 deletions

View file

@ -27,6 +27,7 @@
#include "gstprops.h"
GType _gst_props_type;
GType _gst_props_entry_type;
#define GST_PROPS_ENTRY_IS_VARIABLE(a) (((GstPropsEntry*)(a))->propstype > GST_PROPS_VAR_TYPE)
@ -133,6 +134,10 @@ _gst_props_initialize (void)
g_value_register_transform_func (_gst_props_type,
G_TYPE_STRING,
transform_func);
_gst_props_entry_type = g_boxed_type_register_static ("GstPropsEntry",
(GBoxedCopyFunc) gst_props_entry_copy,
(GBoxedFreeFunc) gst_props_entry_destroy);
}
static void
@ -304,7 +309,7 @@ gst_props_alloc_entry (void)
return entry;
}
static void
void
gst_props_entry_destroy (GstPropsEntry *entry)
{
switch (entry->propstype) {
@ -794,7 +799,7 @@ gst_props_destroy (GstProps *props)
/*
* copy entries
*/
static GstPropsEntry*
GstPropsEntry*
gst_props_entry_copy (GstPropsEntry *entry)
{
GstPropsEntry *newentry;

View file

@ -79,6 +79,9 @@ typedef enum {
#define GST_PROPS_INT_ANY GST_PROPS_INT_RANGE(G_MININT,G_MAXINT)
typedef struct _GstPropsEntry GstPropsEntry;
extern GType _gst_props_entry_type;
#define GST_TYPE_PROPS_ENTRY (_gst_props_entry_type)
struct _GstProps {
gint refcount;
@ -94,9 +97,9 @@ GstProps* gst_props_new (const gchar *firstname, ...);
GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
GstProps* gst_props_empty_new (void);
void gst_props_unref (GstProps *props);
void gst_props_ref (GstProps *props);
void gst_props_destroy (GstProps *props);
void gst_props_unref (GstProps *props);
void gst_props_ref (GstProps *props);
void gst_props_destroy (GstProps *props);
void gst_props_debug (GstProps *props);
@ -123,6 +126,8 @@ void gst_props_add_entry (GstProps *props, GstPropsEntry *entry);
/* working with props entries */
GstPropsEntry* gst_props_entry_new (const gchar *name, ...);
void gst_props_entry_destroy (GstPropsEntry *entry);
GstPropsEntry* gst_props_entry_copy (GstPropsEntry *entry);
GstPropsType gst_props_entry_get_type (const GstPropsEntry *entry);
const gchar* gst_props_entry_get_name (const GstPropsEntry *entry);
gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry);