From 22ae9d0884fffb61ee826ec450e8d62ad1cdb957 Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Tue, 6 Sep 2016 23:26:22 +0530 Subject: [PATCH] examples: use G_DECLARE_FINAL_TYPE in applications G_DECLARE_FINAL_TYPE was introduced in glib 2.44. We shall use that now so that lots of boilerplate code can be reduced. https://bugzilla.gnome.org/show_bug.cgi?id=770278 --- examples/application1/exampleapp.c | 5 ----- examples/application1/exampleapp.h | 8 +------- examples/application1/exampleappwin.c | 5 ----- examples/application1/exampleappwin.h | 7 +------ examples/application10/exampleapp.c | 5 ----- examples/application10/exampleapp.h | 7 +------ examples/application10/exampleappprefs.c | 5 ----- examples/application10/exampleappprefs.h | 7 +------ examples/application10/exampleappwin.c | 5 ----- examples/application10/exampleappwin.h | 8 +------- examples/application2/exampleapp.c | 5 ----- examples/application2/exampleapp.h | 7 +------ examples/application2/exampleappwin.c | 5 ----- examples/application2/exampleappwin.h | 7 +------ examples/application3/exampleapp.c | 5 ----- examples/application3/exampleapp.h | 7 +------ examples/application3/exampleappwin.c | 5 ----- examples/application3/exampleappwin.h | 7 +------ examples/application4/exampleapp.c | 5 ----- examples/application4/exampleapp.h | 7 +------ examples/application4/exampleappwin.c | 5 ----- examples/application4/exampleappwin.h | 7 +------ examples/application5/exampleapp.c | 5 ----- examples/application5/exampleapp.h | 7 +------ examples/application5/exampleappwin.c | 5 ----- examples/application5/exampleappwin.h | 7 +------ examples/application6/exampleapp.c | 7 +------ examples/application6/exampleapp.h | 7 +------ examples/application6/exampleappprefs.c | 5 ----- examples/application6/exampleappprefs.h | 7 +------ examples/application6/exampleappwin.c | 7 +------ examples/application6/exampleappwin.h | 7 +------ examples/application7/exampleapp.c | 5 ----- examples/application7/exampleapp.h | 7 +------ examples/application7/exampleappprefs.c | 5 ----- examples/application7/exampleappprefs.h | 7 +------ examples/application7/exampleappwin.c | 5 ----- examples/application7/exampleappwin.h | 7 +------ examples/application8/exampleapp.c | 5 ----- examples/application8/exampleapp.h | 7 +------ examples/application8/exampleappprefs.c | 5 ----- examples/application8/exampleappprefs.h | 7 +------ examples/application8/exampleappwin.c | 5 ----- examples/application8/exampleappwin.h | 7 +------ examples/application9/exampleapp.c | 5 ----- examples/application9/exampleapp.h | 7 +------ examples/application9/exampleappprefs.c | 5 ----- examples/application9/exampleappprefs.h | 7 +------ examples/application9/exampleappwin.c | 5 ----- examples/application9/exampleappwin.h | 7 +------ 50 files changed, 27 insertions(+), 279 deletions(-) diff --git a/examples/application1/exampleapp.c b/examples/application1/exampleapp.c index 6c4c5ed3cc..565bc35c75 100644 --- a/examples/application1/exampleapp.c +++ b/examples/application1/exampleapp.c @@ -8,11 +8,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application1/exampleapp.h b/examples/application1/exampleapp.h index 824049d699..f7b837fbd5 100644 --- a/examples/application1/exampleapp.h +++ b/examples/application1/exampleapp.h @@ -5,14 +5,8 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) - -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application1/exampleappwin.c b/examples/application1/exampleappwin.c index a4e9733e34..24dd05dd9f 100644 --- a/examples/application1/exampleappwin.c +++ b/examples/application1/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW); static void diff --git a/examples/application1/exampleappwin.h b/examples/application1/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application1/exampleappwin.h +++ b/examples/application1/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application10/exampleapp.c b/examples/application10/exampleapp.c index 66e85793f8..64a3ceb100 100644 --- a/examples/application10/exampleapp.c +++ b/examples/application10/exampleapp.c @@ -9,11 +9,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application10/exampleapp.h b/examples/application10/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application10/exampleapp.h +++ b/examples/application10/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application10/exampleappprefs.c b/examples/application10/exampleappprefs.c index 6a033817bd..9b3cc33586 100644 --- a/examples/application10/exampleappprefs.c +++ b/examples/application10/exampleappprefs.c @@ -9,11 +9,6 @@ struct _ExampleAppPrefs GtkDialog parent; }; -struct _ExampleAppPrefsClass -{ - GtkDialogClass parent_class; -}; - typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate; struct _ExampleAppPrefsPrivate diff --git a/examples/application10/exampleappprefs.h b/examples/application10/exampleappprefs.h index c684889adf..2f08819ffb 100644 --- a/examples/application10/exampleappprefs.h +++ b/examples/application10/exampleappprefs.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ()) -#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs)) +G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog) -typedef struct _ExampleAppPrefs ExampleAppPrefs; -typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass; - - -GType example_app_prefs_get_type (void); ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win); diff --git a/examples/application10/exampleappwin.c b/examples/application10/exampleappwin.c index 7ac1649a08..294650f671 100644 --- a/examples/application10/exampleappwin.c +++ b/examples/application10/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application10/exampleappwin.h b/examples/application10/exampleappwin.h index ed4b34fcf5..88de502f88 100644 --- a/examples/application10/exampleappwin.h +++ b/examples/application10/exampleappwin.h @@ -6,14 +6,8 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) - -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application2/exampleapp.c b/examples/application2/exampleapp.c index 6c4c5ed3cc..565bc35c75 100644 --- a/examples/application2/exampleapp.c +++ b/examples/application2/exampleapp.c @@ -8,11 +8,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application2/exampleapp.h b/examples/application2/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application2/exampleapp.h +++ b/examples/application2/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application2/exampleappwin.c b/examples/application2/exampleappwin.c index 8098225f68..46c43ef85e 100644 --- a/examples/application2/exampleappwin.c +++ b/examples/application2/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW); static void diff --git a/examples/application2/exampleappwin.h b/examples/application2/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application2/exampleappwin.h +++ b/examples/application2/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application3/exampleapp.c b/examples/application3/exampleapp.c index 6c4c5ed3cc..565bc35c75 100644 --- a/examples/application3/exampleapp.c +++ b/examples/application3/exampleapp.c @@ -8,11 +8,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application3/exampleapp.h b/examples/application3/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application3/exampleapp.h +++ b/examples/application3/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application3/exampleappwin.c b/examples/application3/exampleappwin.c index 96475a7591..4cbdf2bf32 100644 --- a/examples/application3/exampleappwin.c +++ b/examples/application3/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application3/exampleappwin.h b/examples/application3/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application3/exampleappwin.h +++ b/examples/application3/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application4/exampleapp.c b/examples/application4/exampleapp.c index e83f139c26..0f01fb388a 100644 --- a/examples/application4/exampleapp.c +++ b/examples/application4/exampleapp.c @@ -8,11 +8,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application4/exampleapp.h b/examples/application4/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application4/exampleapp.h +++ b/examples/application4/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application4/exampleappwin.c b/examples/application4/exampleappwin.c index 96475a7591..4cbdf2bf32 100644 --- a/examples/application4/exampleappwin.c +++ b/examples/application4/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application4/exampleappwin.h b/examples/application4/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application4/exampleappwin.h +++ b/examples/application4/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application5/exampleapp.c b/examples/application5/exampleapp.c index e83f139c26..0f01fb388a 100644 --- a/examples/application5/exampleapp.c +++ b/examples/application5/exampleapp.c @@ -8,11 +8,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application5/exampleapp.h b/examples/application5/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application5/exampleapp.h +++ b/examples/application5/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application5/exampleappwin.c b/examples/application5/exampleappwin.c index 829afb98e0..d716f2a1cf 100644 --- a/examples/application5/exampleappwin.c +++ b/examples/application5/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application5/exampleappwin.h b/examples/application5/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application5/exampleappwin.h +++ b/examples/application5/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application6/exampleapp.c b/examples/application6/exampleapp.c index d0e0774453..64a3ceb100 100644 --- a/examples/application6/exampleapp.c +++ b/examples/application6/exampleapp.c @@ -4,16 +4,11 @@ #include "exampleappwin.h" #include "exampleappprefs.h" -struct ExampleApp +struct _ExampleApp { GtkApplication parent; }; -struct ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application6/exampleapp.h b/examples/application6/exampleapp.h index 8b51c598ea..51093791a3 100644 --- a/examples/application6/exampleapp.h +++ b/examples/application6/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct ExampleApp ExampleApp; -typedef struct ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application6/exampleappprefs.c b/examples/application6/exampleappprefs.c index 6a033817bd..9b3cc33586 100644 --- a/examples/application6/exampleappprefs.c +++ b/examples/application6/exampleappprefs.c @@ -9,11 +9,6 @@ struct _ExampleAppPrefs GtkDialog parent; }; -struct _ExampleAppPrefsClass -{ - GtkDialogClass parent_class; -}; - typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate; struct _ExampleAppPrefsPrivate diff --git a/examples/application6/exampleappprefs.h b/examples/application6/exampleappprefs.h index c684889adf..2f08819ffb 100644 --- a/examples/application6/exampleappprefs.h +++ b/examples/application6/exampleappprefs.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ()) -#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs)) +G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog) -typedef struct _ExampleAppPrefs ExampleAppPrefs; -typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass; - - -GType example_app_prefs_get_type (void); ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win); diff --git a/examples/application6/exampleappwin.c b/examples/application6/exampleappwin.c index 103dac5d31..45e7de44a2 100644 --- a/examples/application6/exampleappwin.c +++ b/examples/application6/exampleappwin.c @@ -3,16 +3,11 @@ #include "exampleapp.h" #include "exampleappwin.h" -struct ExampleAppWindow +struct _ExampleAppWindow { GtkApplicationWindow parent; }; -struct ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct ExampleAppWindowPrivate ExampleAppWindowPrivate; struct ExampleAppWindowPrivate diff --git a/examples/application6/exampleappwin.h b/examples/application6/exampleappwin.h index 11ff3c27a7..786338d083 100644 --- a/examples/application6/exampleappwin.h +++ b/examples/application6/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct ExampleAppWindow ExampleAppWindow; -typedef struct ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application7/exampleapp.c b/examples/application7/exampleapp.c index 66e85793f8..64a3ceb100 100644 --- a/examples/application7/exampleapp.c +++ b/examples/application7/exampleapp.c @@ -9,11 +9,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application7/exampleapp.h b/examples/application7/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application7/exampleapp.h +++ b/examples/application7/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application7/exampleappprefs.c b/examples/application7/exampleappprefs.c index 6a033817bd..9b3cc33586 100644 --- a/examples/application7/exampleappprefs.c +++ b/examples/application7/exampleappprefs.c @@ -9,11 +9,6 @@ struct _ExampleAppPrefs GtkDialog parent; }; -struct _ExampleAppPrefsClass -{ - GtkDialogClass parent_class; -}; - typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate; struct _ExampleAppPrefsPrivate diff --git a/examples/application7/exampleappprefs.h b/examples/application7/exampleappprefs.h index c684889adf..2f08819ffb 100644 --- a/examples/application7/exampleappprefs.h +++ b/examples/application7/exampleappprefs.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ()) -#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs)) +G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog) -typedef struct _ExampleAppPrefs ExampleAppPrefs; -typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass; - - -GType example_app_prefs_get_type (void); ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win); diff --git a/examples/application7/exampleappwin.c b/examples/application7/exampleappwin.c index 88ad7bcdf8..2980393bf5 100644 --- a/examples/application7/exampleappwin.c +++ b/examples/application7/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application7/exampleappwin.h b/examples/application7/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application7/exampleappwin.h +++ b/examples/application7/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application8/exampleapp.c b/examples/application8/exampleapp.c index 66e85793f8..64a3ceb100 100644 --- a/examples/application8/exampleapp.c +++ b/examples/application8/exampleapp.c @@ -9,11 +9,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application8/exampleapp.h b/examples/application8/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application8/exampleapp.h +++ b/examples/application8/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application8/exampleappprefs.c b/examples/application8/exampleappprefs.c index 6a033817bd..9b3cc33586 100644 --- a/examples/application8/exampleappprefs.c +++ b/examples/application8/exampleappprefs.c @@ -9,11 +9,6 @@ struct _ExampleAppPrefs GtkDialog parent; }; -struct _ExampleAppPrefsClass -{ - GtkDialogClass parent_class; -}; - typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate; struct _ExampleAppPrefsPrivate diff --git a/examples/application8/exampleappprefs.h b/examples/application8/exampleappprefs.h index c684889adf..2f08819ffb 100644 --- a/examples/application8/exampleappprefs.h +++ b/examples/application8/exampleappprefs.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ()) -#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs)) +G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog) -typedef struct _ExampleAppPrefs ExampleAppPrefs; -typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass; - - -GType example_app_prefs_get_type (void); ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win); diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c index f85051968f..3570d452d7 100644 --- a/examples/application8/exampleappwin.c +++ b/examples/application8/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application8/exampleappwin.h b/examples/application8/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application8/exampleappwin.h +++ b/examples/application8/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file); diff --git a/examples/application9/exampleapp.c b/examples/application9/exampleapp.c index 66e85793f8..64a3ceb100 100644 --- a/examples/application9/exampleapp.c +++ b/examples/application9/exampleapp.c @@ -9,11 +9,6 @@ struct _ExampleApp GtkApplication parent; }; -struct _ExampleAppClass -{ - GtkApplicationClass parent_class; -}; - G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION); static void diff --git a/examples/application9/exampleapp.h b/examples/application9/exampleapp.h index 824049d699..51093791a3 100644 --- a/examples/application9/exampleapp.h +++ b/examples/application9/exampleapp.h @@ -5,14 +5,9 @@ #define EXAMPLE_APP_TYPE (example_app_get_type ()) -#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp)) +G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) -typedef struct _ExampleApp ExampleApp; -typedef struct _ExampleAppClass ExampleAppClass; - - -GType example_app_get_type (void); ExampleApp *example_app_new (void); diff --git a/examples/application9/exampleappprefs.c b/examples/application9/exampleappprefs.c index 6a033817bd..9b3cc33586 100644 --- a/examples/application9/exampleappprefs.c +++ b/examples/application9/exampleappprefs.c @@ -9,11 +9,6 @@ struct _ExampleAppPrefs GtkDialog parent; }; -struct _ExampleAppPrefsClass -{ - GtkDialogClass parent_class; -}; - typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate; struct _ExampleAppPrefsPrivate diff --git a/examples/application9/exampleappprefs.h b/examples/application9/exampleappprefs.h index c684889adf..2f08819ffb 100644 --- a/examples/application9/exampleappprefs.h +++ b/examples/application9/exampleappprefs.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ()) -#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs)) +G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog) -typedef struct _ExampleAppPrefs ExampleAppPrefs; -typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass; - - -GType example_app_prefs_get_type (void); ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win); diff --git a/examples/application9/exampleappwin.c b/examples/application9/exampleappwin.c index d3103f97d3..15ceb1ef28 100644 --- a/examples/application9/exampleappwin.c +++ b/examples/application9/exampleappwin.c @@ -8,11 +8,6 @@ struct _ExampleAppWindow GtkApplicationWindow parent; }; -struct _ExampleAppWindowClass -{ - GtkApplicationWindowClass parent_class; -}; - typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate; struct _ExampleAppWindowPrivate diff --git a/examples/application9/exampleappwin.h b/examples/application9/exampleappwin.h index ed4b34fcf5..786338d083 100644 --- a/examples/application9/exampleappwin.h +++ b/examples/application9/exampleappwin.h @@ -6,14 +6,9 @@ #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ()) -#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow)) +G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow) -typedef struct _ExampleAppWindow ExampleAppWindow; -typedef struct _ExampleAppWindowClass ExampleAppWindowClass; - - -GType example_app_window_get_type (void); ExampleAppWindow *example_app_window_new (ExampleApp *app); void example_app_window_open (ExampleAppWindow *win, GFile *file);