[gnome-software] GsBox: Port to G_DECLARE_FINAL_TYPE macro
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] GsBox: Port to G_DECLARE_FINAL_TYPE macro
- Date: Mon, 7 Sep 2015 17:37:37 +0000 (UTC)
commit 4f94206a86866fe780c4651c4a0c43394f501a6f
Author: Kalev Lember <klember redhat com>
Date: Mon Sep 7 16:41:29 2015 +0200
GsBox: Port to G_DECLARE_FINAL_TYPE macro
src/gs-box.c | 4 ----
src/gs-box.h | 13 +++----------
2 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/gs-box.c b/src/gs-box.c
index bb497c7..f6e33c5 100644
--- a/src/gs-box.c
+++ b/src/gs-box.c
@@ -38,10 +38,6 @@ struct _GsBox {
gdouble total;
};
-struct _GsBoxClass {
- GtkContainerClass parent_class;
-};
-
G_DEFINE_TYPE (GsBox, gs_box, GTK_TYPE_CONTAINER)
enum {
diff --git a/src/gs-box.h b/src/gs-box.h
index 8120ae8..77d714f 100644
--- a/src/gs-box.h
+++ b/src/gs-box.h
@@ -24,19 +24,12 @@
#include <gtk/gtk.h>
-#define GS_TYPE_BOX (gs_box_get_type())
-#define GS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GS_TYPE_BOX, GsBox))
-#define GS_BOX_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST((cls), GS_TYPE_BOX, GsBoxClass))
-#define GS_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GS_TYPE_BOX))
-#define GS_IS_BOX_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), GS_TYPE_BOX))
-#define GS_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GS_TYPE_BOX, GsBoxClass))
-
G_BEGIN_DECLS
-typedef struct _GsBox GsBox;
-typedef struct _GsBoxClass GsBoxClass;
+#define GS_TYPE_BOX (gs_box_get_type ())
+
+G_DECLARE_FINAL_TYPE (GsBox, gs_box, GS, BOX, GtkContainer)
-GType gs_box_get_type (void);
GtkWidget *gs_box_new (void);
void gs_box_add (GsBox *box,
GtkWidget *child,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]