[krb5-auth-dialog] prefs: Use G_DECLARE_FINAL_TYPE



commit 4fc881f3f34b2d7d3fea80586ddbfb7d9611d7a8
Author: Guido Günther <agx sigxcpu org>
Date:   Thu Oct 20 17:00:05 2022 +0200

    prefs: Use G_DECLARE_FINAL_TYPE
    
    Makes the switch to AdwPreferencesWindow simpler

 src/ka-preferences.c | 18 +++++++-----------
 src/ka-preferences.h | 18 ++----------------
 2 files changed, 9 insertions(+), 27 deletions(-)
---
diff --git a/src/ka-preferences.c b/src/ka-preferences.c
index ff7ec77..e74b930 100644
--- a/src/ka-preferences.c
+++ b/src/ka-preferences.c
@@ -29,17 +29,7 @@
 
 #define N_BINDINGS 3
 
-struct _KaPreferences {
-    GtkDialog parent;
-
-    KaPreferencesPrivate *priv;
-};
-
-struct _KaPreferencesClass {
-    GtkDialogClass parent;
-};
-
-struct _KaPreferencesPrivate {
+typedef struct _KaPreferencesPrivate {
     GtkWidget *dialog;
     GtkWidget *notebook;
     GtkWidget *principal_entry;
@@ -58,6 +48,12 @@ struct _KaPreferencesPrivate {
     int       n_bindings;
 
     KaApplet *applet;
+} KaPreferencesPrivate;
+
+struct _KaPreferences {
+    GtkDialog parent;
+
+    KaPreferencesPrivate *priv;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (KaPreferences, ka_preferences, GTK_TYPE_DIALOG);
diff --git a/src/ka-preferences.h b/src/ka-preferences.h
index 4b6a732..23061d5 100644
--- a/src/ka-preferences.h
+++ b/src/ka-preferences.h
@@ -12,22 +12,8 @@
 
 G_BEGIN_DECLS
 
-#define KA_TYPE_PREFERENCES            (ka_preferences_get_type ())
-#define KA_PREFERENCES(obj)            \
-    (G_TYPE_CHECK_INSTANCE_CAST ((obj), KA_TYPE_PREFERENCES, KaPreferences))
-#define KA_PREFERENCES_CLASS(klass)    \
-    (G_TYPE_CHECK_CLASS_CAST ((klass), KA_TYPE_PREFERENCES, KaPreferencesClass))
-#define KA_IS_PREFERENCES(obj)         \
-    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KA_TYPE_PREFERENCES))
-#define KA_IS_PREFERENCES_CLASS(klass) \
-    (G_TYPE_CHECK_CLASS_TYPE ((klass), KA_TYPE_PREFERENCES))
-#define KA_PREFERENCES_GET_CLASS(obj)  \
-    (G_TYPE_INSTANCE_GET_CLASS ((obj), KA_TYPE_PREFERENCES, KaPreferencesClass))
-    typedef struct _KaPreferences KaPreferences;
-typedef struct _KaPreferencesClass KaPreferencesClass;
-typedef struct _KaPreferencesPrivate KaPreferencesPrivate;
-
-GType ka_preferences_get_type (void);
+#define KA_TYPE_PREFERENCES   (ka_preferences_get_type ())
+G_DECLARE_FINAL_TYPE          (KaPreferences, ka_preferences, KA, PREFERENCES, GtkDialog)
 
 KaPreferences* ka_preferences_new (KaApplet *applet);
 void ka_preferences_run (KaPreferences *self);


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