]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: event_cntr: use an utility macro to declare GObject-derived object
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 11 Apr 2022 08:42:26 +0000 (17:42 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 12 Apr 2022 03:42:19 +0000 (12:42 +0900)
Since gobject v2.44, an utility macro is available to declare
GObject-derived objects.

This commit replaces existent boireplates with it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/event-cntr.h

index c87fd3084f7d97b03c426ca11b1ea0b4bafb356d..d9d32ce4a0758342bcc49fe9fa4b5820333f890e 100644 (file)
@@ -8,42 +8,12 @@ G_BEGIN_DECLS
 
 #define ALSASEQ_TYPE_EVENT_CNTR     (alsaseq_event_cntr_get_type())
 
-#define ALSASEQ_EVENT_CNTR(obj)                             \
-    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
-                                ALSASEQ_TYPE_EVENT_CNTR,    \
-                                ALSASeqEventCntr))
-#define ALSASEQ_IS_EVENT_CNTR(obj)                          \
-    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
-                                ALSASEQ_TYPE_EVENT_CNTR))
-
-#define ALSASEQ_EVENT_CNTR_CLASS(klass)                     \
-    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
-                             ALSASEQ_TYPE_EVENT_CNTR,       \
-                             ALSASeqEventCntrClass))
-#define ALSASEQ_IS_EVENT_CNTR_CLASS(klass)                  \
-    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
-                             ALSASEQ_TYPE_EVENT_CNTR))
-#define ALSASEQ_EVENT_CNTR_GET_CLASS(obj)                   \
-    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
-                               ALSASEQ_TYPE_EVENT_CNTR,     \
-                               ALSASeqEventCntrClass))
-
-typedef struct _ALSASeqEventCntr            ALSASeqEventCntr;
-typedef struct _ALSASeqEventCntrClass       ALSASeqEventCntrClass;
-typedef struct _ALSASeqEventCntrPrivate     ALSASeqEventCntrPrivate;
-
-struct _ALSASeqEventCntr {
-    GObject parent_instance;
-
-    ALSASeqEventCntrPrivate *priv;
-};
+G_DECLARE_DERIVABLE_TYPE(ALSASeqEventCntr, alsaseq_event_cntr, ALSASEQ, EVENT_CNTR, GObject);
 
 struct _ALSASeqEventCntrClass {
     GObjectClass parent_class;
 };
 
-GType alsaseq_event_cntr_get_type() G_GNUC_CONST;
-
 ALSASeqEventCntr *alsaseq_event_cntr_new(guint count, GError **error);
 
 void alsaseq_event_cntr_count_events(ALSASeqEventCntr *self, gsize *count);