[file-roller/wip/jtojnar/gobject-modernization: 5/8] archive-libarchive: Use G_DECLARE_FINAL_TYPE




commit ddc01eb96b345a433aafec3b3f4ae03c61d1fbeb
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Aug 5 21:18:30 2022 +0200

    archive-libarchive: Use G_DECLARE_FINAL_TYPE

 src/fr-archive-libarchive.c |  2 +-
 src/fr-archive-libarchive.h | 19 +++----------------
 2 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index e5244241..8a5606d9 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -48,7 +48,7 @@ struct _FrArchiveLibarchivePrivate {
 };
 
 
-G_DEFINE_TYPE_WITH_PRIVATE (FrArchiveLibarchive, fr_archive_libarchive, FR_TYPE_ARCHIVE)
+G_DEFINE_FINAL_TYPE_WITH_PRIVATE (FrArchiveLibarchive, fr_archive_libarchive, FR_TYPE_ARCHIVE)
 
 
 static void
diff --git a/src/fr-archive-libarchive.h b/src/fr-archive-libarchive.h
index e90e3846..161b9cb0 100644
--- a/src/fr-archive-libarchive.h
+++ b/src/fr-archive-libarchive.h
@@ -25,26 +25,13 @@
 #include <glib.h>
 #include "fr-archive.h"
 
-#define FR_TYPE_ARCHIVE_LIBARCHIVE            (fr_archive_libarchive_get_type ())
-#define FR_ARCHIVE_LIBARCHIVE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
FR_TYPE_ARCHIVE_LIBARCHIVE, FrArchiveLibarchive))
-#define FR_ARCHIVE_LIBARCHIVE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), FR_TYPE_ARCHIVE_LIBARCHIVE, 
FrArchiveLibarchiveClass))
-#define FR_IS_ARCHIVE_LIBARCHIVE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
FR_TYPE_ARCHIVE_LIBARCHIVE))
-#define FR_IS_ARCHIVE_LIBARCHIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FR_TYPE_ARCHIVE_LIBARCHIVE))
-#define FR_ARCHIVE_LIBARCHIVE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), FR_TYPE_ARCHIVE_LIBARCHIVE, 
FrArchiveLibarchiveClass))
-
-typedef struct _FrArchiveLibarchive        FrArchiveLibarchive;
-typedef struct _FrArchiveLibarchiveClass   FrArchiveLibarchiveClass;
-typedef struct _FrArchiveLibarchivePrivate FrArchiveLibarchivePrivate;
+#define FR_TYPE_ARCHIVE_LIBARCHIVE (fr_archive_libarchive_get_type ())
+G_DECLARE_FINAL_TYPE (FrArchiveLibarchive, fr_archive_libarchive, FR, ARCHIVE_LIBARCHIVE, FrArchive)
 
+typedef struct _FrArchiveLibarchivePrivate  FrArchiveLibarchivePrivate;
 struct _FrArchiveLibarchive {
        FrArchive  __parent;
        FrArchiveLibarchivePrivate *priv;
 };
 
-struct _FrArchiveLibarchiveClass {
-       FrArchiveClass __parent_class;
-};
-
-GType  fr_archive_libarchive_get_type  (void);
-
 #endif /* FR_ARCHIVE_LIBARCHIVE_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]