[gnome-software] GsPage: Port to G_DECLARE_DERIVABLE_TYPE macro
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] GsPage: Port to G_DECLARE_DERIVABLE_TYPE macro
- Date: Mon, 7 Sep 2015 17:39:08 +0000 (UTC)
commit 939c2e111e3ae1182f93e0062e833fd419f92802
Author: Kalev Lember <klember redhat com>
Date: Mon Sep 7 18:06:28 2015 +0200
GsPage: Port to G_DECLARE_DERIVABLE_TYPE macro
src/gs-page.c | 4 ++--
src/gs-page.h | 17 ++---------------
2 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/src/gs-page.c b/src/gs-page.c
index c3790e7..bb88349 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -31,12 +31,12 @@
#include "gs-shell.h"
#include "gs-utils.h"
-struct _GsPagePrivate
+typedef struct
{
GsPluginLoader *plugin_loader;
GCancellable *cancellable;
GsShell *shell;
-};
+} GsPagePrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GsPage, gs_page, GTK_TYPE_BIN)
diff --git a/src/gs-page.h b/src/gs-page.h
index 9f349e7..70fcae9 100644
--- a/src/gs-page.h
+++ b/src/gs-page.h
@@ -30,16 +30,9 @@
G_BEGIN_DECLS
-#define GS_TYPE_PAGE (gs_page_get_type ())
-#define GS_PAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_PAGE, GsPage))
-#define GS_PAGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_PAGE, GsPageClass))
-#define GS_IS_PAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_PAGE))
-#define GS_IS_PAGE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_PAGE))
-#define GS_PAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_PAGE, GsPageClass))
+#define GS_TYPE_PAGE (gs_page_get_type ())
-typedef struct _GsPage GsPage;
-typedef struct _GsPageClass GsPageClass;
-typedef struct _GsPagePrivate GsPagePrivate;
+G_DECLARE_DERIVABLE_TYPE (GsPage, gs_page, GS, PAGE, GtkBin)
struct _GsPageClass
{
@@ -51,12 +44,6 @@ struct _GsPageClass
GsApp *app);
};
-struct _GsPage
-{
- GtkBin parent;
-};
-
-GType gs_page_get_type (void);
GsPage *gs_page_new (void);
void gs_page_install_app (GsPage *page,
GsApp *app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]