[gnome-calendar/wip/gbsneto/gdatetime: 6/13] date-selector: turn into a final class
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/wip/gbsneto/gdatetime: 6/13] date-selector: turn into a final class
- Date: Mon, 4 Jan 2016 04:19:49 +0000 (UTC)
commit 916ce2854683f085f4a1279d60a0029b8e4a8a64
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Dec 31 13:37:44 2015 -0200
date-selector: turn into a final class
We're not subclassing GcalDateSelector, nor exposing
it for anyone to subclass it. Thus, turn the class
into a final one.
src/gcal-date-selector.c | 9 +++++++--
src/gcal-date-selector.h | 26 +-------------------------
2 files changed, 8 insertions(+), 27 deletions(-)
---
diff --git a/src/gcal-date-selector.c b/src/gcal-date-selector.c
index a2a66bf..fc7c7df 100644
--- a/src/gcal-date-selector.c
+++ b/src/gcal-date-selector.c
@@ -32,7 +32,7 @@ enum
NUM_ENTRIES
};
-struct _GcalDateSelectorPrivate
+typedef struct
{
/* widgets */
GtkWidget *date_label;
@@ -53,6 +53,11 @@ struct _GcalDateSelectorPrivate
guint day_pos;
guint month_pos;
guint year_pos;
+} GcalDateSelectorPrivate;
+
+struct _GcalDateSelector
+{
+ GtkMenuButton parent;
};
enum
@@ -201,7 +206,7 @@ gcal_date_selector_class_init (GcalDateSelectorClass *klass)
signals[MODIFIED] = g_signal_new ("modified",
GCAL_TYPE_DATE_SELECTOR,
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GcalDateSelectorClass, modified),
+ 0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
diff --git a/src/gcal-date-selector.h b/src/gcal-date-selector.h
index dde2fc1..f4c35a8 100644
--- a/src/gcal-date-selector.h
+++ b/src/gcal-date-selector.h
@@ -25,32 +25,8 @@
G_BEGIN_DECLS
#define GCAL_TYPE_DATE_SELECTOR (gcal_date_selector_get_type ())
-#define GCAL_DATE_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCAL_TYPE_DATE_SELECTOR,
GcalDateSelector))
-#define GCAL_DATE_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCAL_TYPE_DATE_SELECTOR,
GcalDateSelectorClass))
-#define GCAL_IS_DATE_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCAL_TYPE_DATE_SELECTOR))
-#define GCAL_IS_DATE_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCAL_TYPE_DATE_SELECTOR))
-#define GCAL_DATE_SELECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCAL_TYPE_DATE_SELECTOR,
GcalDateSelectorClass))
-typedef struct _GcalTime GcalTime;
-
-typedef struct _GcalDateSelector GcalDateSelector;
-typedef struct _GcalDateSelectorClass GcalDateSelectorClass;
-typedef struct _GcalDateSelectorPrivate GcalDateSelectorPrivate;
-
-struct _GcalDateSelector
-{
- GtkMenuButton parent;
-};
-
-struct _GcalDateSelectorClass
-{
- GtkMenuButtonClass parent_class;
-
- /* signals */
- void (*modified) (GcalDateSelector *selector);
-};
-
-GType gcal_date_selector_get_type (void);
+G_DECLARE_FINAL_TYPE (GcalDateSelector, gcal_date_selector, GCAL, DATE_SELECTOR, GtkMenuButton);
GtkWidget* gcal_date_selector_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]