diff options
author | Murray Cumming <murrayc@usa.net> | 2003-12-17 17:52:47 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@src.gnome.org> | 2003-12-17 17:52:47 +0000 |
commit | c64c7ee080d4a5a64e9b8a056ada6b452be8bde4 (patch) | |
tree | a62a244a8dea109a810072eb1915d985183cda2f /gtk/gtktreemodel.c | |
parent | 8baf8571b52f21c0012420669483f4769cfa13ca (diff) | |
download | gtk+-c64c7ee080d4a5a64e9b8a056ada6b452be8bde4.tar.gz |
Actually call the default signal handlers instead of calling the
2003-12-07 Murray Cumming <murrayc@usa.net>
* gtk/gtktreemodel.c:
(row_inserted_marshal, row_deleted_marshal, rows_reorderered_marshal)
Actually call the default signal handlers instead of calling the
marshallers themselves in an endless loop. These default signal handler
callbacks are not actually set so this is only noticed by gtkmm at
the moment. Bug 123923.
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r-- | gtk/gtktreemodel.c | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index c84e863a01..96c8c48d4d 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -206,25 +206,28 @@ row_inserted_marshal (GClosure *closure, gpointer marshal_data) { GtkTreeModelIface *iface; - gpointer callback; + + void (* row_inserted_callback) (GtkTreeModel *tree_model, + GtkTreePath *path, + GtkTreeIter *iter) = 0; + GObject *model = g_value_get_object (param_values + 0); + GtkTreePath *path = (GtkTreePath *)g_value_get_boxed (param_values + 1); + GtkTreeIter *iter = (GtkTreeIter *)g_value_get_boxed (param_values + 2); /* first, we need to update internal row references */ gtk_tree_row_ref_inserted ((RowRefList *)g_object_get_data (model, ROW_REF_DATA_STRING), - (GtkTreePath *)g_value_get_boxed (param_values + 1), - (GtkTreeIter *)g_value_get_boxed (param_values + 2)); - + path, iter); + /* fetch the interface ->row_inserted implementation */ iface = GTK_TREE_MODEL_GET_IFACE (model); - callback = G_STRUCT_MEMBER (gpointer, iface, + row_inserted_callback = G_STRUCT_MEMBER (gpointer, iface, G_STRUCT_OFFSET (GtkTreeModelIface, row_inserted)); - if (callback) - closure->marshal (closure, - return_value, - n_param_values, param_values, - invocation_hint, - callback); + + /* Call that default signal handler, it if has been set */ + if (row_inserted_callback) + row_inserted_callback (GTK_TREE_MODEL (model), path, iter); } static void @@ -236,24 +239,25 @@ row_deleted_marshal (GClosure *closure, gpointer marshal_data) { GtkTreeModelIface *iface; - gpointer callback; + void (* row_deleted_callback) (GtkTreeModel *tree_model, + GtkTreePath *path) = 0; GObject *model = g_value_get_object (param_values + 0); + GtkTreePath *path = (GtkTreePath *)g_value_get_boxed (param_values + 1); + /* first, we need to update internal row references */ gtk_tree_row_ref_deleted ((RowRefList *)g_object_get_data (model, ROW_REF_DATA_STRING), - (GtkTreePath *)g_value_get_boxed (param_values + 1)); + path); - /* emit signal */ + /* fetch the interface ->row_deleted implementation */ iface = GTK_TREE_MODEL_GET_IFACE (model); - callback = G_STRUCT_MEMBER (gpointer, iface, + row_deleted_callback = G_STRUCT_MEMBER (gpointer, iface, G_STRUCT_OFFSET (GtkTreeModelIface, row_deleted)); - if (callback) - closure->marshal (closure, - return_value, - n_param_values, param_values, - invocation_hint, - callback); + + /* Call that default signal handler, it if has been set */ + if (row_deleted_callback) + row_deleted_callback (GTK_TREE_MODEL (model), path); } static void @@ -265,26 +269,29 @@ rows_reordered_marshal (GClosure *closure, gpointer marshal_data) { GtkTreeModelIface *iface; - gpointer callback; + void (* rows_reordered_callback) (GtkTreeModel *tree_model, + GtkTreePath *path, + GtkTreeIter *iter, + gint *new_order); + GObject *model = g_value_get_object (param_values + 0); - + GtkTreePath *path = (GtkTreePath *)g_value_get_boxed (param_values + 1); + GtkTreeIter *iter = (GtkTreeIter *)g_value_get_boxed (param_values + 2); + gint *new_order = (gint *)g_value_get_pointer (param_values + 3); + /* first, we need to update internal row references */ gtk_tree_row_ref_reordered ((RowRefList *)g_object_get_data (model, ROW_REF_DATA_STRING), - (GtkTreePath *)g_value_get_boxed (param_values + 1), - (GtkTreeIter *)g_value_get_boxed (param_values + 2), - (gint *)g_value_get_pointer (param_values + 3)); + path, iter, new_order); - /* emit signal */ + /* fetch the interface ->rows_reordered implementation */ iface = GTK_TREE_MODEL_GET_IFACE (model); - callback = G_STRUCT_MEMBER (gpointer, iface, + rows_reordered_callback = G_STRUCT_MEMBER (gpointer, iface, G_STRUCT_OFFSET (GtkTreeModelIface, rows_reordered)); - if (callback) - closure->marshal (closure, - return_value, - n_param_values, param_values, - invocation_hint, - callback); + + /* Call that default signal handler, it if has been set */ + if (rows_reordered_callback) + rows_reordered_callback (GTK_TREE_MODEL (model), path, iter, new_order); } /** |