Commit 5e9ac3a6 authored by W. Michael Petullo's avatar W. Michael Petullo

Backport from 4.0 series: replace use of deprecated G_TYPE_INSTANCE_GET_PRIVATE

parent a8251468
......@@ -23,8 +23,6 @@
#include <libdmapsharing/daap-connection.h>
#include <libdmapsharing/dmap-structure.h>
#define DAAP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DAAP_TYPE_CONNECTION, DAAPConnectionPrivate))
static DMAPContentCode
_get_protocol_version_cc (DMAPConnection * connection)
{
......
......@@ -23,13 +23,6 @@
#include <libdmapsharing/dacp-connection.h>
#include <libdmapsharing/dmap-structure.h>
#define DACP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DACP_TYPE_CONNECTION, DACPConnectionPrivate))
/* FIXME:
struct DACPConnectionPrivate {
};
*/
static DMAPContentCode
get_protocol_version_cc (DMAPConnection * connection)
{
......@@ -65,10 +58,6 @@ dacp_connection_class_init (DACPConnectionClass * klass)
parent_class->get_protocol_version_cc = get_protocol_version_cc;
parent_class->get_query_metadata = get_query_metadata;
parent_class->handle_mlcl = handle_mlcl;
/* FIXME:
* g_type_class_add_private (klass, sizeof (DACPConnectionPrivate));
*/
}
DACPConnection *
......@@ -91,9 +80,6 @@ dacp_connection_new (const char *name,
static void
dacp_connection_init (DACPConnection * connection)
{
/* FIXME:
* connection->priv = DACP_CONNECTION_GET_PRIVATE (connection);
*/
}
G_DEFINE_TYPE (DACPConnection, dacp_connection, DMAP_TYPE_CONNECTION);
......@@ -100,8 +100,6 @@ typedef struct
DMAPConnection *connection;
} DACPRemoteInfo;
#define DACP_SHARE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DACP_TYPE_SHARE, DACPSharePrivate))
enum
{
PROP_0,
......@@ -123,7 +121,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DACPShare, dacp_share, DAAP_TYPE_SHARE);
G_DEFINE_TYPE_WITH_PRIVATE (DACPShare, dacp_share, DAAP_TYPE_SHARE);
static void
dacp_share_class_init (DACPShareClass * klass)
......@@ -251,14 +249,12 @@ dacp_share_class_init (DACPShareClass * klass)
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DACPSharePrivate));
}
static void
dacp_share_init (DACPShare * share)
{
share->priv = DACP_SHARE_GET_PRIVATE (share);
share->priv = dacp_share_get_instance_private(share);
share->priv->current_revision = 2;
......
......@@ -54,9 +54,6 @@ static void dmap_connection_state_done (DMAPConnection * connection,
static gboolean emit_progress_idle (DMAPConnection * connection);
G_DEFINE_TYPE (DMAPConnection, dmap_connection, G_TYPE_OBJECT);
#define DMAP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_CONNECTION, DMAPConnectionPrivate))
struct DMAPConnectionPrivate
{
char *name;
......@@ -97,6 +94,8 @@ struct DMAPConnectionPrivate
char *last_error_message;
};
G_DEFINE_TYPE_WITH_PRIVATE (DMAPConnection, dmap_connection, G_TYPE_OBJECT);
enum
{
PROP_0,
......@@ -158,8 +157,6 @@ dmap_connection_class_init (DMAPConnectionClass * klass)
object_class->set_property = dmap_connection_set_property;
object_class->get_property = dmap_connection_get_property;
g_type_class_add_private (klass, sizeof (DMAPConnectionPrivate));
g_object_class_install_property (object_class,
PROP_DB,
g_param_spec_pointer ("db",
......@@ -301,7 +298,7 @@ dmap_connection_class_init (DMAPConnectionClass * klass)
static void
dmap_connection_init (DMAPConnection * connection)
{
connection->priv = DMAP_CONNECTION_GET_PRIVATE (connection);
connection->priv = dmap_connection_get_instance_private(connection);
}
static void
......
......@@ -63,10 +63,6 @@ struct DMAPGstInputStreamPrivate
gboolean buffer_closed; /* May close before decoding complete */
};
#define DMAP_GST_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_GST_INPUT_STREAM, \
DMAPGstInputStreamPrivate))
static goffset
dmap_gst_input_stream_tell (GSeekable * seekable)
{
......@@ -437,8 +433,6 @@ dmap_gst_input_stream_class_init (DMAPGstInputStreamClass * klass)
{
GInputStreamClass *istream_class;
g_type_class_add_private (klass, sizeof (DMAPGstInputStreamPrivate));
istream_class = G_INPUT_STREAM_CLASS (klass);
istream_class->read_fn = dmap_gst_input_stream_read;
istream_class->skip = dmap_gst_input_stream_skip;
......@@ -454,8 +448,6 @@ dmap_gst_input_stream_class_init (DMAPGstInputStreamClass * klass)
static void
dmap_gst_input_stream_init (DMAPGstInputStream * stream)
{
stream->priv = DMAP_GST_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv->buffer = g_queue_new ();
stream->priv->read_request = 0;
stream->priv->write_request = 0;
......@@ -472,4 +464,5 @@ dmap_gst_input_stream_init (DMAPGstInputStream * stream)
G_DEFINE_TYPE_WITH_CODE (DMAPGstInputStream, dmap_gst_input_stream,
G_TYPE_INPUT_STREAM,
G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE,
dmap_gst_input_stream_seekable_iface_init));
dmap_gst_input_stream_seekable_iface_init)
G_ADD_PRIVATE (DMAPGstInputStream));
......@@ -208,8 +208,8 @@ dmap_gst_mp3_input_stream_kill_pipeline (DMAPGstInputStream * stream)
gst_object_unref (GST_OBJECT (mp3_stream->priv->pipeline));
}
G_DEFINE_TYPE (DMAPGstMP3InputStream, dmap_gst_mp3_input_stream,
DMAP_TYPE_GST_INPUT_STREAM);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPGstMP3InputStream, dmap_gst_mp3_input_stream,
DMAP_TYPE_GST_INPUT_STREAM);
static void
dmap_gst_mp3_input_stream_class_init (DMAPGstMP3InputStreamClass * klass)
......@@ -217,15 +217,12 @@ dmap_gst_mp3_input_stream_class_init (DMAPGstMP3InputStreamClass * klass)
DMAPGstInputStreamClass *parent_class =
DMAP_GST_INPUT_STREAM_CLASS (klass);
g_type_class_add_private (klass,
sizeof (DMAPGstMP3InputStreamPrivate));
parent_class->kill_pipeline = dmap_gst_mp3_input_stream_kill_pipeline;
}
static void
dmap_gst_mp3_input_stream_init (DMAPGstMP3InputStream * stream)
{
stream->priv = DMAP_GST_MP3_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv = dmap_gst_mp3_input_stream_get_instance_private (stream);
}
......@@ -42,9 +42,6 @@ G_BEGIN_DECLS
#define DMAP_GST_MP3_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
DMAP_TYPE_GST_MP3_INPUT_STREAM, \
DMAPGstMP3InputStreamClass))
#define DMAP_GST_MP3_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_GST_MP3_INPUT_STREAM, \
DMAPGstMP3InputStreamPrivate))
typedef struct DMAPGstMP3InputStreamPrivate DMAPGstMP3InputStreamPrivate;
typedef struct
......
......@@ -219,8 +219,8 @@ dmap_gst_qt_input_stream_kill_pipeline (DMAPGstInputStream * stream)
gst_object_unref (GST_OBJECT (qt_stream->priv->pipeline));
}
G_DEFINE_TYPE (DMAPGstQtInputStream, dmap_gst_qt_input_stream,
DMAP_TYPE_GST_INPUT_STREAM);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPGstQtInputStream, dmap_gst_qt_input_stream,
DMAP_TYPE_GST_INPUT_STREAM);
static void
dmap_gst_qt_input_stream_class_init (DMAPGstQtInputStreamClass * klass)
......@@ -228,15 +228,12 @@ dmap_gst_qt_input_stream_class_init (DMAPGstQtInputStreamClass * klass)
DMAPGstInputStreamClass *parent_class =
DMAP_GST_INPUT_STREAM_CLASS (klass);
g_type_class_add_private (klass,
sizeof (DMAPGstQtInputStreamPrivate));
parent_class->kill_pipeline = dmap_gst_qt_input_stream_kill_pipeline;
}
static void
dmap_gst_qt_input_stream_init (DMAPGstQtInputStream * stream)
{
stream->priv = DMAP_GST_QT_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv = dmap_gst_qt_input_stream_get_instance_private (stream);
}
......@@ -42,9 +42,6 @@ G_BEGIN_DECLS
#define DMAP_GST_QT_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
DMAP_TYPE_GST_QT_INPUT_STREAM, \
DMAPGstQtInputStreamClass))
#define DMAP_GST_QT_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_GST_QT_INPUT_STREAM, \
DMAPGstQtInputStreamPrivate))
typedef struct DMAPGstQtInputStreamPrivate DMAPGstQtInputStreamPrivate;
typedef struct
......
......@@ -224,25 +224,20 @@ dmap_gst_wav_input_stream_kill_pipeline (DMAPGstInputStream * stream)
gst_object_unref (GST_OBJECT (wav_stream->priv->pipeline));
}
G_DEFINE_TYPE (DMAPGstWAVInputStream, dmap_gst_wav_input_stream,
DMAP_TYPE_GST_INPUT_STREAM)
G_DEFINE_TYPE_WITH_PRIVATE (DMAPGstWAVInputStream, dmap_gst_wav_input_stream,
DMAP_TYPE_GST_INPUT_STREAM)
static void
dmap_gst_wav_input_stream_class_init (DMAPGstWAVInputStreamClass
* klass)
static void
dmap_gst_wav_input_stream_class_init (DMAPGstWAVInputStreamClass * klass)
{
DMAPGstInputStreamClass *parent_class =
DMAP_GST_INPUT_STREAM_CLASS (klass);
g_type_class_add_private (klass,
sizeof (DMAPGstWAVInputStreamPrivate));
parent_class->kill_pipeline = dmap_gst_wav_input_stream_kill_pipeline;
}
static void
dmap_gst_wav_input_stream_init (DMAPGstWAVInputStream * stream)
{
stream->priv = DMAP_GST_WAV_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv = dmap_gst_wav_input_stream_get_instance_private(stream);
}
......@@ -42,9 +42,6 @@ G_BEGIN_DECLS
#define DMAP_GST_WAV_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
DMAP_TYPE_GST_WAV_INPUT_STREAM, \
DMAPGstWAVInputStreamClass))
#define DMAP_GST_WAV_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_GST_WAV_INPUT_STREAM, \
DMAPGstWAVInputStreamPrivate))
typedef struct DMAPGstWAVInputStreamPrivate DMAPGstWAVInputStreamPrivate;
typedef struct
......
......@@ -102,11 +102,9 @@ static void browse_cb (AvahiServiceBrowser * service_browser,
DMAPMdnsBrowser * browser);
static void free_service (DMAPMdnsBrowserService * service);
#define DMAP_MDNS_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_MDNS_BROWSER, DMAPMdnsBrowserPrivate))
static guint dmap_mdns_browser_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
GQuark
dmap_mdns_browser_error_quark (void)
......@@ -130,8 +128,6 @@ dmap_mdns_browser_class_init (DMAPMdnsBrowserClass * klass)
object_class->dispose = dmap_mdns_browser_dispose;
object_class->finalize = dmap_mdns_browser_finalize;
g_type_class_add_private (klass, sizeof (DMAPMdnsBrowserPrivate));
dmap_mdns_browser_signals[SERVICE_ADDED] =
g_signal_new ("service-added",
G_TYPE_FROM_CLASS (object_class),
......@@ -153,7 +149,7 @@ dmap_mdns_browser_class_init (DMAPMdnsBrowserClass * klass)
static void
dmap_mdns_browser_init (DMAPMdnsBrowser * browser)
{
browser->priv = DMAP_MDNS_BROWSER_GET_PRIVATE (browser);
browser->priv = dmap_mdns_browser_get_instance_private(browser);
avahi_client_init (browser);
}
......
......@@ -56,18 +56,16 @@ enum
LAST_SIGNAL
};
#define DMAP_MDNS_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_MDNS_BROWSER, DMAPMdnsBrowserPrivate))
static guint dmap_mdns_browser_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
static void
dmap_mdns_browser_init (DMAPMdnsBrowser * browser)
{
g_assert (NULL != browser);
browser->priv = DMAP_MDNS_BROWSER_GET_PRIVATE (browser);
browser->priv = dmap_mdns_browser_get_instance_private(browser);
}
static void
......@@ -472,8 +470,6 @@ dmap_mdns_browser_class_init (DMAPMdnsBrowserClass * klass)
object_class->dispose = dmap_mdns_browser_dispose;
object_class->finalize = dmap_mdns_browser_finalize;
g_type_class_add_private (klass, sizeof (DMAPMdnsBrowserPrivate));
// Signal makeup
dmap_mdns_browser_signals[SERVICE_ADDED] =
g_signal_new ("service-added",
......
......@@ -79,11 +79,9 @@ static void dmap_mdns_browser_finalize (GObject * object);
static void free_service (DMAPMdnsBrowserService * service);
#define DMAP_MDNS_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_MDNS_BROWSER, DMAPMdnsBrowserPrivate))
static guint signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPMdnsBrowser, dmap_mdns_browser, G_TYPE_OBJECT);
GQuark
dmap_mdns_browser_error_quark (void)
......@@ -454,14 +452,12 @@ dmap_mdns_browser_class_init (DMAPMdnsBrowserClass * klass)
service_removed), NULL, NULL,
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1,
G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DMAPMdnsBrowserPrivate));
}
static void
dmap_mdns_browser_init (DMAPMdnsBrowser * browser)
{
browser->priv = DMAP_MDNS_BROWSER_GET_PRIVATE (browser);
browser->priv = dmap_mdns_browser_get_instance_private(browser);
memset (browser->priv, 0, sizeof (DMAPMdnsBrowserPrivate));
set_local_address (browser);
......
......@@ -42,8 +42,6 @@ static void dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass * klass);
static void dmap_mdns_publisher_init (DMAPMdnsPublisher * publisher);
static void dmap_mdns_publisher_finalize (GObject * object);
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_MDNS_PUBLISHER, DMAPMdnsPublisherPrivate))
struct DMAPMdnsPublisherService
{
char *name;
......@@ -74,7 +72,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT);
static gpointer publisher_object = NULL;
......@@ -418,14 +416,12 @@ dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass * klass)
name_collision), NULL, NULL,
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1,
G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DMAPMdnsPublisherPrivate));
}
static void
dmap_mdns_publisher_init (DMAPMdnsPublisher * publisher)
{
publisher->priv = DMAP_MDNS_PUBLISHER_GET_PRIVATE (publisher);
publisher->priv = dmap_mdns_publisher_get_instance_private(publisher);
publisher->priv->client = dmap_mdns_avahi_get_client ();
publisher->priv->entry_group = NULL;
......
......@@ -26,8 +26,6 @@
#include "dmap-mdns-publisher.h"
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_MDNS_PUBLISHER, DMAPMdnsPublisherPrivate))
struct DMAPMdnsPublisherPrivate
{
DNSServiceRef sdref;
......@@ -42,7 +40,7 @@ enum {
static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
static gpointer publisher_object = NULL;
......@@ -241,14 +239,12 @@ dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass *klass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DMAPMdnsPublisherPrivate));
}
static void
dmap_mdns_publisher_init (DMAPMdnsPublisher *publisher)
{
publisher->priv = DMAP_MDNS_PUBLISHER_GET_PRIVATE (publisher);
publisher->priv = dmap_mdns_publisher_get_instance_private(publisher);
}
DMAPMdnsPublisher *
......
......@@ -114,16 +114,14 @@ struct share_bitwise_t
static void dmap_share_init (DMAPShare * share);
static void dmap_share_class_init (DMAPShareClass * klass);
G_DEFINE_ABSTRACT_TYPE (DMAPShare, dmap_share, G_TYPE_OBJECT)
#define DMAP_SHARE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_SHARE, DMAPSharePrivate));
static gboolean
_dmap_share_soup_auth_callback (SoupAuthDomain * auth_domain,
SoupMessage * msg,
const char *username,
gpointer password,
DMAPShare * share)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (DMAPShare, dmap_share, G_TYPE_OBJECT)
static gboolean
_dmap_share_soup_auth_callback (SoupAuthDomain * auth_domain,
SoupMessage * msg,
const char *username,
gpointer password,
DMAPShare * share)
{
gboolean allowed;
const char *path;
......@@ -687,8 +685,6 @@ dmap_share_class_init (DMAPShareClass * klass)
"Set TXT-Records used for MDNS publishing",
G_TYPE_STRV,
G_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (DMAPSharePrivate));
}
static void
......@@ -708,7 +704,7 @@ name_collision_adapter (DMAPMdnsPublisher * publisher,
static void
dmap_share_init (DMAPShare * share)
{
share->priv = DMAP_SHARE_GET_PRIVATE (share);
share->priv = dmap_share_get_instance_private(share);
share->priv->revision_number = 5;
share->priv->auth_method = DMAP_SHARE_AUTH_METHOD_NONE;
......
......@@ -23,13 +23,6 @@
#include <libdmapsharing/dpap-connection.h>
#include <libdmapsharing/dmap-structure.h>
#define DPAP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DPAP_TYPE_CONNECTION, DPAPConnectionPrivate))
/* FIXME:
struct DPAPConnectionPrivate {
};
*/
static DMAPContentCode
get_protocol_version_cc (DMAPConnection * connection)
{
......@@ -153,10 +146,6 @@ dpap_connection_class_init (DPAPConnectionClass * klass)
parent_class->get_protocol_version_cc = get_protocol_version_cc;
parent_class->get_query_metadata = get_query_metadata;
parent_class->handle_mlcl = handle_mlcl;
/* FIXME:
* g_type_class_add_private (klass, sizeof (DPAPConnectionPrivate));
*/
}
DPAPConnection *
......@@ -179,9 +168,6 @@ dpap_connection_new (const char *name,
static void
dpap_connection_init (DPAPConnection * connection)
{
/* FIXME:
* connection->priv = DPAP_CONNECTION_GET_PRIVATE (connection);
*/
}
G_DEFINE_TYPE (DPAPConnection, dpap_connection, DMAP_TYPE_CONNECTION);
......@@ -89,14 +89,12 @@ struct DPAPSharePrivate
*/
static GMappedFile *mapped_file = NULL;
#define DPAP_SHARE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DPAP_TYPE_SHARE, DPAPSharePrivate))
enum
{
PROP_0,
};
G_DEFINE_TYPE (DPAPShare, dpap_share, DMAP_TYPE_SHARE);
G_DEFINE_TYPE_WITH_PRIVATE (DPAPShare, dpap_share, DMAP_TYPE_SHARE);
static void
dpap_share_class_init (DPAPShareClass * klass)
......@@ -117,15 +115,13 @@ dpap_share_class_init (DPAPShareClass * klass)
parent_class->databases_browse_xxx = databases_browse_xxx;
parent_class->databases_items_xxx = databases_items_xxx;
parent_class->server_info = dpap_share_server_info;
g_type_class_add_private (klass, sizeof (DPAPSharePrivate));
}
static void
dpap_share_init (DPAPShare * share)
{
share->priv = DPAP_SHARE_GET_PRIVATE (share);
/* FIXME: do I need to manually call parent _init? */
share->priv = dpap_share_get_instance_private(share);
}
static void
......
......@@ -230,10 +230,33 @@ GInputStream *test_daap_record_read (DAAPRecord *record, GError **error)
return stream;
}
static void
test_daap_record_daap_iface_init (gpointer iface, gpointer data)
{
DAAPRecordIface *daap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (daap_record) == DAAP_TYPE_RECORD);
daap_record->read = test_daap_record_read;
}
static void
test_daap_record_dmap_iface_init (gpointer iface, gpointer data)
{
DMAPRecordIface *dmap_record = iface;
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 (DAAP_TYPE_RECORD, test_daap_record_daap_iface_init)
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD, test_daap_record_dmap_iface_init)
G_ADD_PRIVATE (TestDAAPRecord))
static void
test_daap_record_init (TestDAAPRecord *record)
{
record->priv = TEST_DAAP_RECORD_GET_PRIVATE (record);
record->priv = test_daap_record_get_instance_private (record);
}
static void test_daap_record_finalize (GObject *object);
......@@ -243,8 +266,6 @@ test_daap_record_class_init (TestDAAPRecordClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (TestDAAPRecordPrivate));
gobject_class->set_property = test_daap_record_set_property;
gobject_class->get_property = test_daap_record_get_property;
gobject_class->finalize = test_daap_record_finalize;
......@@ -276,28 +297,6 @@ test_daap_record_class_init (TestDAAPRecordClass *klass)
G_PARAM_READWRITE));
}
static void
test_daap_record_daap_iface_init (gpointer iface, gpointer data)
{
DAAPRecordIface *daap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (daap_record) == DAAP_TYPE_RECORD);
daap_record->read = test_daap_record_read;
}
static void
test_daap_record_dmap_iface_init (gpointer iface, gpointer data)
{
DMAPRecordIface *dmap_record = iface;
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 (DAAP_TYPE_RECORD, test_daap_record_daap_iface_init)
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD, test_daap_record_dmap_iface_init))
static void
test_daap_record_finalize (GObject *object)
{
......
......@@ -157,12 +157,33 @@ GInputStream *test_dpap_record_read (DPAPRecord *record, GError **error)
return stream;
}
static void
test_dpap_record_dpap_iface_init (gpointer iface, gpointer data)
{
DPAPRecordIface *dpap_record = iface;
g_assert (G_TYPE_FROM_INTERFACE (dpap_record) == DPAP_TYPE_RECORD);
dpap_record->read = test_dpap_record_read;
}
static void
test_dpap_record_dmap_iface_init (gpointer iface, gpointer data)
{
DMAPRecordIface *dmap_record = iface;
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 (DPAP_TYPE_RECORD, test_dpap_record_dpap_iface_init)
G_IMPLEMENT_INTERFACE (DMAP_TYPE_RECORD, test_dpap_record_dmap_iface_init)
G_ADD_PRIVATE (TestDPAPRecord))
static void
test_dpap_record_init (TestDPAPRecord *record)
{
record->priv = TEST_DPAP_RECORD_GET_PRIVATE (record);
record->priv = test_dpap_record_get_instance_private (record);
}
static void test_dpap_record_finalize (GObject *object);
......@@ -172,8 +193,6 @@ test_dpap_record_class_init (TestDPAPRecordClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);