From 80e87c941f634c85a61116207904d0200641d7a2 Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Tue, 25 Sep 2001 01:12:08 +0000 Subject: add marshal function types. 2001-09-24 James Henstridge * gtk/gtkmarshal.list (VOID): add marshal function types. * gtk/gtkctree.c (gtk_ctree_class_init): make arguments have type GTK_TYPE_CTREE_NODE|G_SIGNAL_TYPE_STATIC_SCOPE rather than GTK_TYPE_POINTER. (gtk_ctree_node_get_type): implement boxed type for GtkCTreeNodes with no-op copy/free functions. * gtk/gtkctree.h (gtk_ctree_node_get_type): add prototype for GtkCTreeNode get_type function. --- gtk/gtkctree.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 11 deletions(-) (limited to 'gtk/gtkctree.c') diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index c250eeaba5..1fac2ce5cb 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -432,37 +432,45 @@ gtk_ctree_class_init (GtkCTreeClass *klass) GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_select_row), - gtk_marshal_VOID__POINTER_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT); + gtk_marshal_VOID__BOXED_INT, + GTK_TYPE_NONE, 2, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE, + GTK_TYPE_INT); ctree_signals[TREE_UNSELECT_ROW] = gtk_signal_new ("tree_unselect_row", GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_unselect_row), - gtk_marshal_VOID__POINTER_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT); + gtk_marshal_VOID__BOXED_INT, + GTK_TYPE_NONE, 2, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE, + GTK_TYPE_INT); ctree_signals[TREE_EXPAND] = gtk_signal_new ("tree_expand", GTK_RUN_LAST, GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_expand), - gtk_marshal_VOID__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + gtk_marshal_VOID__BOXED, + GTK_TYPE_NONE, 1, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE); ctree_signals[TREE_COLLAPSE] = gtk_signal_new ("tree_collapse", GTK_RUN_LAST, GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_collapse), - gtk_marshal_VOID__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + gtk_marshal_VOID__BOXED, + GTK_TYPE_NONE, 1, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE); ctree_signals[TREE_MOVE] = gtk_signal_new ("tree_move", GTK_RUN_LAST, GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_move), - gtk_marshal_VOID__POINTER_POINTER_POINTER, - GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, - GTK_TYPE_POINTER, GTK_TYPE_POINTER); + gtk_marshal_VOID__BOXED_BOXED_BOXED, + GTK_TYPE_NONE, 3, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE, + GTK_TYPE_CTREE_NODE | G_SIGNAL_TYPE_STATIC_SCOPE); ctree_signals[CHANGE_FOCUS_ROW_EXPANSION] = gtk_signal_new ("change_focus_row_expansion", GTK_RUN_LAST | GTK_RUN_ACTION, @@ -6116,3 +6124,31 @@ gtk_ctree_drag_data_received (GtkWidget *widget, } } } + +/* dummy boxed type definition, used so that the GtkCTreeNode signal + * arguments have a reasonable type. + */ +gpointer +ctree_node_copy (gpointer boxed) +{ + return boxed; +} + +void +ctree_node_free (gpointer boxed) +{ + /* nothing */ +} + +GType +gtk_ctree_node_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkCTreeNode", + (GBoxedCopyFunc)ctree_node_copy, + (GBoxedFreeFunc)ctree_node_free); + + return our_type; +} -- cgit v1.2.1