Commit 4d34871f authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Vala-related clean up: DMAPRecord, DMAPDb & DMAPRecordFactory


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent e5fae437
......@@ -31,13 +31,13 @@ typedef struct FilterData {
static gint dmap_db_init_count = 0;
static void
dmap_db_init (DMAPDbInterface *iface)
dmap_db_init (DMAPDbIface *iface)
{
dmap_db_init_count++;
}
static void
dmap_db_finalize (DMAPDbInterface *iface)
dmap_db_finalize (DMAPDbIface *iface)
{
dmap_db_init_count--;
}
......@@ -49,7 +49,7 @@ dmap_db_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof(DMAPDbInterface),
sizeof(DMAPDbIface),
(GBaseInitFunc) dmap_db_init,
(GBaseFinalizeFunc) dmap_db_finalize
};
......
......@@ -28,11 +28,11 @@
G_BEGIN_DECLS
/**
* TYPE_DMAP_DB:
* DMAP_TYPE_DB:
*
* The type for #DMAPDb.
*/
#define TYPE_DMAP_DB (dmap_db_get_type ())
#define DMAP_TYPE_DB (dmap_db_get_type ())
/**
* DMAP_DB:
* @o: Object which is subject to casting.
......@@ -42,15 +42,15 @@ G_BEGIN_DECLS
* certain runtime checks to identify invalid casts.
*/
#define DMAP_DB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
TYPE_DMAP_DB, DMAPDb))
DMAP_TYPE_DB, DMAPDb))
/**
* IS_DMAP_DB:
* @o: Instance to check for being a %TYPE_DMAP_DB.
* @o: Instance to check for being a %DMAP_TYPE_DB.
*
* Checks whether a valid #GTypeInstance pointer is of type %TYPE_DMAP_DB.
* Checks whether a valid #GTypeInstance pointer is of type %DMAP_TYPE_DB.
*/
#define IS_DMAP_DB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
TYPE_DMAP_DB))
DMAP_TYPE_DB))
/**
* DMAP_DB_GET_INTERFACE:
* @o: a #DMAPDb instance.
......@@ -60,12 +60,12 @@ G_BEGIN_DECLS
* Returns: pointer to object interface structure.
*/
#define DMAP_DB_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), \
TYPE_DMAP_DB, DMAPDbInterface))
DMAP_TYPE_DB, DMAPDbIface))
typedef struct _DMAPDb DMAPDb;
typedef struct _DMAPDbInterface DMAPDbInterface;
typedef struct _DMAPDbIface DMAPDbIface;
struct _DMAPDbInterface {
struct _DMAPDbIface {
GTypeInterface parent;
guint (*add) (DMAPDb *db, DMAPRecord *record);
......
......@@ -23,13 +23,13 @@
static gint dmap_record_factory_init_count = 0;
static void
dmap_record_factory_init (DMAPRecordFactoryInterface *iface)
dmap_record_factory_init (DMAPRecordFactoryIface *iface)
{
dmap_record_factory_init_count++;
}
static void
dmap_record_factory_finalize (DMAPRecordFactoryInterface *iface)
dmap_record_factory_finalize (DMAPRecordFactoryIface *iface)
{
dmap_record_factory_init_count--;
}
......@@ -41,7 +41,7 @@ dmap_record_factory_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof(DMAPRecordFactoryInterface),
sizeof(DMAPRecordFactoryIface),
(GBaseInitFunc) dmap_record_factory_init,
(GBaseFinalizeFunc) dmap_record_factory_finalize
};
......
......@@ -28,11 +28,11 @@
G_BEGIN_DECLS
/**
* TYPE_DMAP_RECORD_FACTORY:
* DMAP_TYPE_RECORD_FACTORY:
*
* The type for #DMAPRecordFactory.
*/
#define TYPE_DMAP_RECORD_FACTORY (dmap_record_factory_get_type ())
#define DMAP_TYPE_RECORD_FACTORY (dmap_record_factory_get_type ())
/**
* DMAP_RECORD_FACTORY:
* @o: Object which is subject to casting.
......@@ -42,16 +42,16 @@ G_BEGIN_DECLS
* certain runtime checks to identify invalid casts.
*/
#define DMAP_RECORD_FACTORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
TYPE_DMAP_RECORD_FACTORY, DMAPRecordFactory))
DMAP_TYPE_RECORD_FACTORY, DMAPRecordFactory))
/**
* IS_DMAP_RECORD_FACTORY:
* @o: Instance to check for being a %TYPE_DMAP_RECORD_FACTORY.
* @o: Instance to check for being a %DMAP_TYPE_RECORD_FACTORY.
*
* Checks whether a valid #GTypeInstance pointer is of type
* %TYPE_DMAP_RECORD_FACTORY.
* %DMAP_TYPE_RECORD_FACTORY.
*/
#define IS_DMAP_RECORD_FACTORY(o)(G_TYPE_CHECK_INSTANCE_TYPE ((o), \
TYPE_DMAP_RECORD_FACTORY))
DMAP_TYPE_RECORD_FACTORY))
/**
* DMAP_RECORD_FACTORY_GET_INTERFACE:
* @o: a #DMAPRecordFactory instance.
......@@ -62,13 +62,13 @@ G_BEGIN_DECLS
*/
#define DMAP_RECORD_FACTORY_GET_INTERFACE(o) \
(G_TYPE_INSTANCE_GET_INTERFACE ((o), \
TYPE_DMAP_RECORD_FACTORY, \
DMAPRecordFactoryInterface))
DMAP_TYPE_RECORD_FACTORY, \
DMAPRecordFactoryIface))
typedef struct _DMAPRecordFactory DMAPRecordFactory;
typedef struct _DMAPRecordFactoryInterface DMAPRecordFactoryInterface;
typedef struct _DMAPRecordFactoryIface DMAPRecordFactoryIface;
struct _DMAPRecordFactoryInterface {
struct _DMAPRecordFactoryIface {
GTypeInterface parent;
DMAPRecord *(*create) (DMAPRecordFactory *factory, gpointer user_data);
......
......@@ -23,13 +23,13 @@
static gint dmap_record_init_count = 0;
static void
dmap_record_init (DMAPRecordInterface *iface)
dmap_record_init (DMAPRecordIface *iface)
{
dmap_record_init_count++;
}
static void
dmap_record_finalize (DMAPRecordInterface *iface)
dmap_record_finalize (DMAPRecordIface *iface)
{
dmap_record_init_count--;
}
......@@ -41,7 +41,7 @@ dmap_record_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof(DMAPRecordInterface),
sizeof(DMAPRecordIface),
(GBaseInitFunc) dmap_record_init,
(GBaseFinalizeFunc) dmap_record_finalize
};
......
......@@ -26,11 +26,11 @@
G_BEGIN_DECLS
/**
* TYPE_DMAP_RECORD:
* DMAP_TYPE_RECORD:
*
* The type for #DMAPRecord.
*/
#define TYPE_DMAP_RECORD (dmap_record_get_type ())
#define DMAP_TYPE_RECORD (dmap_record_get_type ())
/**
* DMAP_RECORD:
* @o: Object which is subject to casting.
......@@ -40,15 +40,15 @@ G_BEGIN_DECLS
* certain runtime checks to identify invalid casts.
*/
#define DMAP_RECORD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
TYPE_DMAP_RECORD, DMAPRecord))
DMAP_TYPE_RECORD, DMAPRecord))
/**
* IS_DMAP_RECORD:
* @o: Instance to check for being a %TYPE_DMAP_RECORD.
* @o: Instance to check for being a %DMAP_TYPE_RECORD.
*
* Checks whether a valid #GTypeInstance pointer is of type %TYPE_DMAP_RECORD.
* Checks whether a valid #GTypeInstance pointer is of type %DMAP_TYPE_RECORD.
*/
#define IS_DMAP_RECORD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
TYPE_DMAP_RECORD))
DMAP_TYPE_RECORD))
/**
* DAAP_RECORD_GET_INTERFACE:
* @o: a #DAAPRecord instance.
......@@ -58,12 +58,12 @@ G_BEGIN_DECLS
* Returns: pointer to object class structure.
*/
#define DMAP_RECORD_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), \
TYPE_DMAP_RECORD, DMAPRecordInterface))
DMAP_TYPE_RECORD, DMAPRecordIface))
typedef struct _DMAPRecord DMAPRecord;
typedef struct _DMAPRecordInterface DMAPRecordInterface;
typedef struct _DMAPRecordIface DMAPRecordIface;
struct _DMAPRecordInterface {
struct _DMAPRecordIface {
GTypeInterface parent;
GByteArray * (*to_blob) (DMAPRecord *record);
......
......@@ -40,15 +40,15 @@ test_daap_record_factory_class_init (TestDAAPRecordFactoryClass *klass)
static void
test_daap_record_factory_interface_init (gpointer iface, gpointer data)
{
DMAPRecordFactoryInterface *factory = iface;
DMAPRecordFactoryIface *factory = iface;
g_assert (G_TYPE_FROM_INTERFACE (factory) == TYPE_DMAP_RECORD_FACTORY);
g_assert (G_TYPE_FROM_INTERFACE (factory) == DMAP_TYPE_RECORD_FACTORY);
factory->create = test_daap_record_factory_create;
}
G_DEFINE_TYPE_WITH_CODE (TestDAAPRecordFactory, test_daap_record_factory, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TYPE_DMAP_RECORD_FACTORY,
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD_FACTORY,
test_daap_record_factory_interface_init))
TestDAAPRecordFactory *
......
......@@ -269,14 +269,14 @@ test_daap_record_daap_iface_init (gpointer iface, gpointer data)
static void
test_daap_record_dmap_iface_init (gpointer iface, gpointer data)
{
DMAPRecordInterface *dmap_record = iface;
DMAPRecordIface *dmap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (dmap_record) == TYPE_DMAP_RECORD);
g_assert (G_TYPE_FROM_INTERFACE (dmap_record) == DMAP_TYPE_RECORD);
}
G_DEFINE_TYPE_WITH_CODE (TestDAAPRecord, test_daap_record, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TYPE_DAAP_RECORD, test_daap_record_daap_iface_init)
G_IMPLEMENT_INTERFACE (TYPE_DMAP_RECORD, test_daap_record_dmap_iface_init))
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD, test_daap_record_dmap_iface_init))
static void
test_daap_record_finalize (GObject *object)
......
......@@ -81,9 +81,9 @@ test_dmap_db_class_init (TestDMAPDbClass *klass)
static void
test_dmap_db_interface_init (gpointer iface, gpointer data)
{
DMAPDbInterface *dmap_db = iface;
DMAPDbIface *dmap_db = iface;
g_assert (G_TYPE_FROM_INTERFACE (dmap_db) == TYPE_DMAP_DB);
g_assert (G_TYPE_FROM_INTERFACE (dmap_db) == DMAP_TYPE_DB);
dmap_db->add = test_dmap_db_add;
dmap_db->lookup_by_id = test_dmap_db_lookup_by_id;
......@@ -92,7 +92,7 @@ test_dmap_db_interface_init (gpointer iface, gpointer data)
}
G_DEFINE_TYPE_WITH_CODE (TestDMAPDb, test_dmap_db, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TYPE_DMAP_DB,
G_IMPLEMENT_INTERFACE (DMAP_TYPE_DB,
test_dmap_db_interface_init))
TestDMAPDb *
......
......@@ -40,15 +40,15 @@ test_dpap_record_factory_class_init (TestDPAPRecordFactoryClass *klass)
static void
test_dpap_record_factory_interface_init (gpointer iface, gpointer data)
{
DMAPRecordFactoryInterface *factory = iface;
DMAPRecordFactoryIface *factory = iface;
g_assert (G_TYPE_FROM_INTERFACE (factory) == TYPE_DMAP_RECORD_FACTORY);
g_assert (G_TYPE_FROM_INTERFACE (factory) == DMAP_TYPE_RECORD_FACTORY);
factory->create = test_dpap_record_factory_create;
}
G_DEFINE_TYPE_WITH_CODE (TestDPAPRecordFactory, test_dpap_record_factory, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TYPE_DMAP_RECORD_FACTORY,
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD_FACTORY,
test_dpap_record_factory_interface_init))
TestDPAPRecordFactory *
......
......@@ -203,9 +203,9 @@ test_dpap_record_class_init (TestDPAPRecordClass *klass)
static void
test_dpap_record_dpap_iface_init (gpointer iface, gpointer data)
{
DPAPRecordInterface *dpap_record = iface;
DPAPRecordIface *dpap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (dpap_record) == TYPE_DPAP_RECORD);
g_assert (G_TYPE_FROM_INTERFACE (dpap_record) == DPAP_TYPE_RECORD);
dpap_record->read = test_dpap_record_read;
}
......@@ -213,14 +213,14 @@ test_dpap_record_dpap_iface_init (gpointer iface, gpointer data)
static void
test_dpap_record_dmap_iface_init (gpointer iface, gpointer data)
{
DMAPRecordInterface *dmap_record = iface;
DMAPRecordIface *dmap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (dmap_record) == TYPE_DMAP_RECORD);
g_assert (G_TYPE_FROM_INTERFACE (dmap_record) == DMAP_TYPE_RECORD);
}
G_DEFINE_TYPE_WITH_CODE (TestDPAPRecord, test_dpap_record, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TYPE_DPAP_RECORD, test_dpap_record_dpap_iface_init)
G_IMPLEMENT_INTERFACE (TYPE_DMAP_RECORD, test_dpap_record_dmap_iface_init))
G_IMPLEMENT_INTERFACE (DPAP_TYPE_RECORD, test_dpap_record_dpap_iface_init)
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD, test_dpap_record_dmap_iface_init))
static void
test_dpap_record_finalize (GObject *object)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment