[gtk+] examples: use G_DECLARE_FINAL_TYPE in applications
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] examples: use G_DECLARE_FINAL_TYPE in applications
- Date: Sat, 10 Sep 2016 13:01:21 +0000 (UTC)
commit 22ae9d0884fffb61ee826ec450e8d62ad1cdb957
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Tue Sep 6 23:26:22 2016 +0530
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 6c4c5ed..565bc35 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 824049d..f7b837f 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 a4e9733..24dd05d 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 ed4b34f..786338d 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 66e8579..64a3ceb 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 824049d..5109379 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 6a03381..9b3cc33 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 c684889..2f08819 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 7ac1649..294650f 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 ed4b34f..88de502 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 6c4c5ed..565bc35 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 824049d..5109379 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 8098225..46c43ef 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 ed4b34f..786338d 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 6c4c5ed..565bc35 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 824049d..5109379 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 96475a7..4cbdf2b 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 ed4b34f..786338d 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 e83f139..0f01fb3 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 824049d..5109379 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 96475a7..4cbdf2b 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 ed4b34f..786338d 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 e83f139..0f01fb3 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 824049d..5109379 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 829afb9..d716f2a 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 ed4b34f..786338d 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 d0e0774..64a3ceb 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 8b51c59..5109379 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 6a03381..9b3cc33 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 c684889..2f08819 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 103dac5..45e7de4 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 11ff3c2..786338d 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 66e8579..64a3ceb 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 824049d..5109379 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 6a03381..9b3cc33 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 c684889..2f08819 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 88ad7bc..2980393 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 ed4b34f..786338d 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 66e8579..64a3ceb 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 824049d..5109379 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 6a03381..9b3cc33 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 c684889..2f08819 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 f850519..3570d45 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 ed4b34f..786338d 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 66e8579..64a3ceb 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 824049d..5109379 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 6a03381..9b3cc33 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 c684889..2f08819 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 d3103f9..15ceb1e 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 ed4b34f..786338d 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]