From 9deb892820f4b9d121b971d6af86116f3e18b6e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 26 Jun 2013 20:37:43 -0400 Subject: ETableState: Add a private section. --- .../evolution-util/evolution-util-sections.txt | 2 ++ e-util/e-table-state.c | 28 ++++++++++++++++++++-- e-util/e-table-state.h | 2 ++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/doc/reference/evolution-util/evolution-util-sections.txt b/doc/reference/evolution-util/evolution-util-sections.txt index af3847346e..25fada5207 100644 --- a/doc/reference/evolution-util/evolution-util-sections.txt +++ b/doc/reference/evolution-util/evolution-util-sections.txt @@ -3949,6 +3949,8 @@ E_IS_TABLE_STATE_CLASS E_TABLE_STATE_GET_CLASS ETableStateClass e_table_state_get_type + +ETableStatePrivate
diff --git a/e-util/e-table-state.c b/e-util/e-table-state.c index 20137f65a9..cbde70b554 100644 --- a/e-util/e-table-state.c +++ b/e-util/e-table-state.c @@ -28,8 +28,16 @@ #include "e-xml-utils.h" +#define E_TABLE_STATE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_TABLE_STATE, ETableStatePrivate)) + #define STATE_VERSION 0.1 +struct _ETableStatePrivate { + gint placeholder; +}; + G_DEFINE_TYPE (ETableState, e_table_state, G_TYPE_OBJECT) static void @@ -55,19 +63,35 @@ table_state_finalize (GObject *object) G_OBJECT_CLASS (e_table_state_parent_class)->finalize (object); } +static void +table_state_constructed (GObject *object) +{ + ETableState *state; + + state = E_TABLE_STATE (object); + state->sort_info = e_table_sort_info_new (); + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_table_state_parent_class)->constructed (object); +} + static void e_table_state_class_init (ETableStateClass *class) { - GObjectClass *object_class = G_OBJECT_CLASS (class); + GObjectClass *object_class; + g_type_class_add_private (class, sizeof (ETableStatePrivate)); + + object_class = G_OBJECT_CLASS (class); object_class->dispose = table_state_dispose; object_class->finalize = table_state_finalize; + object_class->constructed = table_state_constructed; } static void e_table_state_init (ETableState *state) { - state->sort_info = e_table_sort_info_new (); + state->priv = E_TABLE_STATE_GET_PRIVATE (state); } ETableState * diff --git a/e-util/e-table-state.h b/e-util/e-table-state.h index 2129e2a65c..27bda8440e 100644 --- a/e-util/e-table-state.h +++ b/e-util/e-table-state.h @@ -50,9 +50,11 @@ G_BEGIN_DECLS typedef struct _ETableState ETableState; typedef struct _ETableStateClass ETableStateClass; +typedef struct _ETableStatePrivate ETableStatePrivate; struct _ETableState { GObject parent; + ETableStatePrivate *priv; ETableSortInfo *sort_info; gint col_count; -- cgit v1.2.3