diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
commit | f26aad1916445d25c99878138dfc384de67a2060 (patch) | |
tree | b72263ecb326e82a49f1e8d1871ec4288b8aa299 /gtk/gtktreeviewcolumn.c | |
parent | 33cddd12d78abb2efe6facba9c859017f8df9819 (diff) | |
download | gtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz |
Boilerplate reduction
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 8313a264ef..17b0f51e61 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -77,8 +77,6 @@ struct _GtkTreeViewColumnCellInfo }; /* Type methods */ -static void gtk_tree_view_column_init (GtkTreeViewColumn *tree_column); -static void gtk_tree_view_column_class_init (GtkTreeViewColumnClass *klass); static void gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface); /* GObject methods */ @@ -153,48 +151,11 @@ static GList *gtk_tree_view_column_cell_prev (GtkTreeViewColum static void gtk_tree_view_column_clear_attributes_by_info (GtkTreeViewColumn *tree_column, GtkTreeViewColumnCellInfo *info); -static GtkObjectClass *parent_class = NULL; static guint tree_column_signals[LAST_SIGNAL] = { 0 }; - -GType -gtk_tree_view_column_get_type (void) -{ - static GType tree_column_type = 0; - - if (!tree_column_type) - { - static const GTypeInfo tree_column_info = - { - sizeof (GtkTreeViewColumnClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_tree_view_column_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkTreeViewColumn), - 0, - (GInstanceInitFunc) gtk_tree_view_column_init - }; - - static const GInterfaceInfo cell_layout_info = - { - (GInterfaceInitFunc) gtk_tree_view_column_cell_layout_init, - NULL, - NULL - }; - - tree_column_type = - g_type_register_static (GTK_TYPE_OBJECT, I_("GtkTreeViewColumn"), - &tree_column_info, 0); - - g_type_add_interface_static (tree_column_type, - GTK_TYPE_CELL_LAYOUT, - &cell_layout_info); - } - - return tree_column_type; -} +G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, GTK_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT, + gtk_tree_view_column_cell_layout_init)); static void gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class) @@ -203,8 +164,6 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class) object_class = (GObjectClass*) class; - parent_class = g_type_class_peek_parent (class); - class->clicked = NULL; object_class->finalize = gtk_tree_view_column_finalize; @@ -433,7 +392,7 @@ gtk_tree_view_column_finalize (GObject *object) if (tree_column->child) g_object_unref (tree_column->child); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->finalize (object); } static void |