[farsight2/master] Make the base class use G_DEFINE_*TYPE

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:20:11 PST 2008


---
 gst-libs/gst/farsight/fs-participant.c        |   29 +---------------------
 gst-libs/gst/farsight/fs-plugin.c             |   29 +----------------------
 gst-libs/gst/farsight/fs-session.c            |   29 +---------------------
 gst-libs/gst/farsight/fs-stream-transmitter.c |   31 +++---------------------
 gst-libs/gst/farsight/fs-stream.c             |   29 +---------------------
 gst-libs/gst/farsight/fs-transmitter.c        |   28 +---------------------
 6 files changed, 13 insertions(+), 162 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-participant.c b/gst-libs/gst/farsight/fs-participant.c
index f9fa673..c2afe83 100644
--- a/gst-libs/gst/farsight/fs-participant.c
+++ b/gst-libs/gst/farsight/fs-participant.c
@@ -60,12 +60,12 @@ struct _FsParticipantPrivate
   gchar *cname;
 };
 
+G_DEFINE_ABSTRACT_TYPE(FsParticipant, fs_participant, G_TYPE_OBJECT);
+
 #define FS_PARTICIPANT_GET_PRIVATE(o)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_PARTICIPANT, \
    FsParticipantPrivate))
 
-static void fs_participant_class_init (FsParticipantClass *klass);
-static void fs_participant_init (FsParticipant *self);
 static void fs_participant_dispose (GObject *object);
 static void fs_participant_finalize (GObject *object);
 
@@ -81,31 +81,6 @@ static void fs_participant_set_property (GObject *object,
 static GObjectClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL] = { 0 };
 
-GType
-fs_participant_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsParticipantClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_participant_class_init,
-      NULL,
-      NULL,
-      sizeof (FsParticipant),
-      0,
-      (GInstanceInitFunc) fs_participant_init
-    };
-
-    type = g_type_register_static (G_TYPE_OBJECT,
-        "FsParticipant", &info, 0);
-  }
-
-  return type;
-}
-
 static void
 fs_participant_class_init (FsParticipantClass *klass)
 {
diff --git a/gst-libs/gst/farsight/fs-plugin.c b/gst-libs/gst/farsight/fs-plugin.c
index 50ff7f2..3caeda6 100644
--- a/gst-libs/gst/farsight/fs-plugin.c
+++ b/gst-libs/gst/farsight/fs-plugin.c
@@ -62,38 +62,11 @@ struct _FsPluginPrivate
   gboolean disposed;
 };
 
+G_DEFINE_TYPE(FsPlugin, fs_plugin, G_TYPE_TYPE_MODULE);
 
-static void fs_plugin_class_init (FsPluginClass * klass);
-static void fs_plugin_init (FsPlugin * plugin);
 static void fs_plugin_dispose (GObject * object);
 static void fs_plugin_finalize (GObject * object);
 
-
-GType
-fs_plugin_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsPluginClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_plugin_class_init,
-      NULL,
-      NULL,
-      sizeof (FsPlugin),
-      0,
-      (GInstanceInitFunc) fs_plugin_init
-    };
-
-    type = g_type_register_static (G_TYPE_TYPE_MODULE,
-        "FsPlugin", &info, 0);
-  }
-
-  return type;
-}
-
 static void
 fs_plugin_search_path_init ()
 {
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index d7fd216..89c1a58 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -78,11 +78,11 @@ struct _FsSessionPrivate
   gboolean disposed;
 };
 
+G_DEFINE_ABSTRACT_TYPE(FsSession, fs_session, G_TYPE_OBJECT);
+
 #define FS_SESSION_GET_PRIVATE(o)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_SESSION, FsSessionPrivate))
 
-static void fs_session_class_init (FsSessionClass *klass);
-static void fs_session_init (FsSession *self);
 static void fs_session_dispose (GObject *object);
 static void fs_session_finalize (GObject *object);
 
@@ -98,31 +98,6 @@ static void fs_session_set_property (GObject *object,
 static GObjectClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL] = { 0 };
 
-GType
-fs_session_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsSessionClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_session_class_init,
-      NULL,
-      NULL,
-      sizeof (FsSession),
-      0,
-      (GInstanceInitFunc) fs_session_init
-    };
-
-    type = g_type_register_static (G_TYPE_OBJECT,
-        "FsSession", &info, G_TYPE_FLAG_ABSTRACT);
-  }
-
-  return type;
-}
-
 static void
 fs_session_class_init (FsSessionClass *klass)
 {
diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.c b/gst-libs/gst/farsight/fs-stream-transmitter.c
index ab20f9d..5478a30 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.c
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.c
@@ -68,12 +68,14 @@ struct _FsStreamTransmitterPrivate
   gboolean disposed;
 };
 
+G_DEFINE_ABSTRACT_TYPE(FsStreamTransmitter, fs_stream_transmitter,
+    G_TYPE_OBJECT);
+
+
 #define FS_STREAM_TRANSMITTER_GET_PRIVATE(o)  \
   (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_STREAM_TRANSMITTER, \
                                 FsStreamTransmitterPrivate))
 
-static void fs_stream_transmitter_class_init (FsStreamTransmitterClass *klass);
-static void fs_stream_transmitter_init (FsStreamTransmitter *self);
 static void fs_stream_transmitter_dispose (GObject *object);
 static void fs_stream_transmitter_finalize (GObject *object);
 
@@ -89,31 +91,6 @@ static void fs_stream_transmitter_set_property (GObject *object,
 static GObjectClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL] = { 0 };
 
-GType
-fs_stream_transmitter_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsStreamTransmitterClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_stream_transmitter_class_init,
-      NULL,
-      NULL,
-      sizeof (FsStreamTransmitter),
-      0,
-      (GInstanceInitFunc) fs_stream_transmitter_init
-    };
-
-    type = g_type_register_static (G_TYPE_OBJECT,
-        "FsStreamTransmitter", &info, G_TYPE_FLAG_ABSTRACT);
-  }
-
-  return type;
-}
-
 static void
 fs_stream_transmitter_class_init (FsStreamTransmitterClass *klass)
 {
diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 1c48607..763b7e2 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -82,11 +82,11 @@ struct _FsStreamPrivate
   gboolean disposed;
 };
 
+G_DEFINE_ABSTRACT_TYPE(FsStream, fs_stream, G_TYPE_OBJECT);
+
 #define FS_STREAM_GET_PRIVATE(o)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_STREAM, FsStreamPrivate))
 
-static void fs_stream_class_init (FsStreamClass *klass);
-static void fs_stream_init (FsStream *self);
 static void fs_stream_dispose (GObject *object);
 static void fs_stream_finalize (GObject *object);
 
@@ -102,31 +102,6 @@ static void fs_stream_set_property (GObject *object,
 static GObjectClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL] = { 0 };
 
-GType
-fs_stream_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsStreamClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_stream_class_init,
-      NULL,
-      NULL,
-      sizeof (FsStream),
-      0,
-      (GInstanceInitFunc) fs_stream_init
-    };
-
-    type = g_type_register_static (G_TYPE_OBJECT,
-        "FsStream", &info, G_TYPE_FLAG_ABSTRACT);
-  }
-
-  return type;
-}
-
 static GType
 fs_stream_direction_get_type (void)
 {
diff --git a/gst-libs/gst/farsight/fs-transmitter.c b/gst-libs/gst/farsight/fs-transmitter.c
index 5fad6bb..ddc5987 100644
--- a/gst-libs/gst/farsight/fs-transmitter.c
+++ b/gst-libs/gst/farsight/fs-transmitter.c
@@ -68,11 +68,11 @@ struct _FsTransmitterPrivate
   gboolean disposed;
 };
 
+G_DEFINE_ABSTRACT_TYPE(FsTransmitter, fs_transmitter, G_TYPE_OBJECT);
+
 #define FS_TRANSMITTER_GET_PRIVATE(o)  \
   (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_TRANSMITTER, FsTransmitterPrivate))
 
-static void fs_transmitter_class_init (FsTransmitterClass *klass);
-static void fs_transmitter_init (FsTransmitter *self);
 static void fs_transmitter_dispose (GObject *object);
 static void fs_transmitter_finalize (GObject *object);
 
@@ -88,30 +88,6 @@ static void fs_transmitter_set_property (GObject *object,
 static GObjectClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL] = { 0 };
 
-GType
-fs_transmitter_get_type (void)
-{
-  static GType type = 0;
-
-  if (type == 0) {
-    static const GTypeInfo info = {
-      sizeof (FsTransmitterClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) fs_transmitter_class_init,
-      NULL,
-      NULL,
-      sizeof (FsTransmitter),
-      0,
-      (GInstanceInitFunc) fs_transmitter_init
-    };
-
-    type = g_type_register_static (G_TYPE_OBJECT,
-        "FsTransmitter", &info, G_TYPE_FLAG_ABSTRACT);
-  }
-
-  return type;
-}
 
 static void
 fs_transmitter_class_init (FsTransmitterClass *klass)
-- 
1.5.6.5




More information about the farsight-commits mailing list