]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: system_info: 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)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 11 Apr 2022 08:42:26 +0000 (17: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/system-info.c
src/seq/system-info.h

index cc4821e0dc0e1b9ff76d8d7f5190ee59f82df12f..40fc926b6c43ba34683c78d9016508a47ef95604 100644 (file)
@@ -13,9 +13,9 @@
  *
  * The object wraps 'struct snd_seq_system_info' in UAPI of Linux sound subsystem.
  */
-struct _ALSASeqSystemInfoPrivate {
+typedef struct {
     struct snd_seq_system_info info;
-};
+} ALSASeqSystemInfoPrivate;
 G_DEFINE_TYPE_WITH_PRIVATE(ALSASeqSystemInfo, alsaseq_system_info, G_TYPE_OBJECT)
 
 enum seq_system_info_prop_type {
index ce0907bcde95ddf0c27165314eda6d6c1da34cf4..caf770cbe64c56449a895749b6a755b43ced73a2 100644 (file)
@@ -8,42 +8,12 @@ G_BEGIN_DECLS
 
 #define ALSASEQ_TYPE_SYSTEM_INFO     (alsaseq_system_info_get_type())
 
-#define ALSASEQ_SYSTEM_INFO(obj)                            \
-    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
-                                ALSASEQ_TYPE_SYSTEM_INFO,   \
-                                ALSASeqSystemInfo))
-#define ALSASEQ_IS_SYSTEM_INFO(obj)                         \
-    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
-                                ALSASEQ_TYPE_SYSTEM_INFO))
-
-#define ALSASEQ_SYSTEM_INFO_CLASS(klass)                    \
-    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
-                             ALSASEQ_TYPE_SYSTEM_INFO,      \
-                             ALSASeqSystemInfoClass))
-#define ALSASEQ_IS_SYSTEM_INFO_CLASS(klass)                 \
-    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
-                             ALSASEQ_TYPE_SYSTEM_INFO))
-#define ALSASEQ_SYSTEM_INFO_GET_CLASS(obj)                  \
-    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
-                               ALSASEQ_TYPE_SYSTEM_INFO,    \
-                               ALSASeqSystemInfoClass))
-
-typedef struct _ALSASeqSystemInfo           ALSASeqSystemInfo;
-typedef struct _ALSASeqSystemInfoClass      ALSASeqSystemInfoClass;
-typedef struct _ALSASeqSystemInfoPrivate    ALSASeqSystemInfoPrivate;
-
-struct _ALSASeqSystemInfo {
-    GObject parent_instance;
-
-    ALSASeqSystemInfoPrivate *priv;
-};
+G_DECLARE_DERIVABLE_TYPE(ALSASeqSystemInfo, alsaseq_system_info, ALSASEQ, SYSTEM_INFO, GObject);
 
 struct _ALSASeqSystemInfoClass {
     GObjectClass parent_class;
 };
 
-GType alsaseq_system_info_get_type() G_GNUC_CONST;
-
 G_END_DECLS
 
 #endif