From f8172191adf212f4829e05be6a224c13e10b898c Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 5 Nov 2002 15:05:25 +0000 Subject: use GObject api for models GObjectify GObjectify GObjectify GObjectify 2002-11-05 Mike Kestner * e-table-item.c : use GObject api for models * e-table-memory-callbacks.[ch] : GObjectify * e-table-memory-store.[ch] : GObjectify * e-table-memory.[ch] : GObjectify * e-table-model.[ch] : GObjectify * e-table-one.[ch] : GObjectify * e-table-simple.[ch] : GObjectify * e-tree-memory.[ch] : GObjectify * e-tree-model.[ch] : GObjectify * e-tree-selection-model.c : use GObject api for models * e-tree-simple.[ch] : GObjectify * e-tree-sorted.[ch] : GObjectify * e-tree-table-adapter.[ch] : GObjectify * e-tree.c : use GObject api for models svn path=/trunk/; revision=18553 --- widgets/table/e-table-simple.c | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'widgets/table/e-table-simple.c') diff --git a/widgets/table/e-table-simple.c b/widgets/table/e-table-simple.c index c8a7d4fe16..b7cf8f66be 100644 --- a/widgets/table/e-table-simple.c +++ b/widgets/table/e-table-simple.c @@ -24,8 +24,7 @@ #include #include "e-table-simple.h" - -#define PARENT_TYPE e_table_model_get_type () +#include "gal/util/e-util.h" static int simple_column_count (ETableModel *etm) @@ -166,7 +165,7 @@ simple_value_to_string (ETableModel *etm, int col, const void *value) } static void -e_table_simple_class_init (GtkObjectClass *object_class) +e_table_simple_class_init (GObjectClass *object_class) { ETableModelClass *model_class = (ETableModelClass *) object_class; @@ -188,28 +187,7 @@ e_table_simple_class_init (GtkObjectClass *object_class) model_class->value_to_string = simple_value_to_string; } -GtkType -e_table_simple_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "ETableSimple", - sizeof (ETableSimple), - sizeof (ETableSimpleClass), - (GtkClassInitFunc) e_table_simple_class_init, - (GtkObjectInitFunc) NULL, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - - return type; -} +E_MAKE_TYPE(e_table_simple, "ETableSimple", ETableSimple, e_table_simple_class_init, NULL, E_TABLE_MODEL_TYPE) /** * e_table_simple_new: @@ -257,9 +235,7 @@ e_table_simple_new (ETableSimpleColumnCountFn col_count, ETableSimpleValueToStringFn value_to_string, void *data) { - ETableSimple *et; - - et = gtk_type_new (e_table_simple_get_type ()); + ETableSimple *et = g_object_new (E_TABLE_SIMPLE_TYPE, NULL); et->col_count = col_count; et->row_count = row_count; -- cgit v1.2.3