From: Takashi Sakamoto Date: Mon, 11 Apr 2022 08:42:26 +0000 (+0900) Subject: seq: event_cntr: use an utility macro to declare GObject-derived object X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=55f6a40d88c863b21ce588019ef827c815d9fcb8;p=alsa-gobject.git seq: event_cntr: use an utility macro to declare GObject-derived object 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 --- diff --git a/src/seq/event-cntr.h b/src/seq/event-cntr.h index c87fd30..d9d32ce 100644 --- a/src/seq/event-cntr.h +++ b/src/seq/event-cntr.h @@ -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);