From e568903360be156973c5767cda2f3248e722d507 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Mon, 26 May 2014 09:24:00 -0700 Subject: [PATCH] gtk: fix many callback annotations to include closure information Without this information introspection-based consumers don't realize they can include context information, but instead think that they receive an extra gpointer argument (which they don't know how to handle). https://bugzilla.gnome.org/show_bug.cgi?id=730745 --- gtk/deprecated/gtkstock.h | 3 ++- gtk/gtkcelllayout.c | 2 +- gtk/gtkcelllayout.h | 2 +- gtk/gtkclipboard.h | 9 ++++++--- gtk/gtkiconview.h | 2 +- gtk/gtkmain.c | 2 +- gtk/gtkmain.h | 2 +- gtk/gtktexttagtable.h | 5 +++++ gtk/gtktreemodel.h | 2 +- gtk/gtktreeviewcolumn.c | 2 +- gtk/gtktreeviewcolumn.h | 2 +- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/gtk/deprecated/gtkstock.h b/gtk/deprecated/gtkstock.h index 1ef97e7380..bdbed8c311 100644 --- a/gtk/deprecated/gtkstock.h +++ b/gtk/deprecated/gtkstock.h @@ -38,7 +38,8 @@ G_BEGIN_DECLS * GtkTranslateFunc: * @path: The id of the message. In #GtkActionGroup this will be a label * or tooltip from a #GtkActionEntry. - * @func_data: user data passed in when registering the function + * @func_data: (closure): user data passed in when registering the + * function * * The function used to translate messages in e.g. #GtkIconFactory * and #GtkActionGroup. diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c index af9cee5be3..16b9e85461 100644 --- a/gtk/gtkcelllayout.c +++ b/gtk/gtkcelllayout.c @@ -500,7 +500,7 @@ gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout, * @cell_layout: a #GtkCellLayout * @cell: a #GtkCellRenderer * @func: (allow-none): the #GtkCellLayoutDataFunc to use, or %NULL - * @func_data: user data for @func + * @func_data: (closure): user data for @func * @destroy: destroy notify for @func_data * * Sets the #GtkCellLayoutDataFunc to use for @cell_layout. diff --git a/gtk/gtkcelllayout.h b/gtk/gtkcelllayout.h index 13cd9b23f9..3e3e33fe69 100644 --- a/gtk/gtkcelllayout.h +++ b/gtk/gtkcelllayout.h @@ -44,7 +44,7 @@ typedef struct _GtkCellLayoutIface GtkCellLayoutIface; * @cell: the cell renderer whose value is to be set * @tree_model: the model * @iter: a #GtkTreeIter indicating the row to set the value for - * @data: user data passed to gtk_cell_layout_set_cell_data_func() + * @data: (closure): user data passed to gtk_cell_layout_set_cell_data_func() * * A function which should set the value of @cell_layout’s cell renderer(s) * as appropriate. diff --git a/gtk/gtkclipboard.h b/gtk/gtkclipboard.h index 9fa8837a0c..f7d27d73b0 100644 --- a/gtk/gtkclipboard.h +++ b/gtk/gtkclipboard.h @@ -38,7 +38,8 @@ G_BEGIN_DECLS * @selection_data: a #GtkSelectionData containing the data was received. * If retrieving the data failed, then then length field * of @selection_data will be negative. - * @data: the @user_data supplied to gtk_clipboard_request_contents(). + * @data: (closure): the @user_data supplied to + * gtk_clipboard_request_contents(). * * A function to be called when the results of gtk_clipboard_request_contents() * are received, or when the request fails. @@ -71,7 +72,8 @@ typedef void (* GtkClipboardRichTextReceivedFunc) (GtkClipboard *clipboard, * GtkClipboardImageReceivedFunc: * @clipboard: the #GtkClipboard * @pixbuf: the received image - * @data: the @user_data supplied to gtk_clipboard_request_image(). + * @data: (closure): the @user_data supplied to + * gtk_clipboard_request_image(). * * A function to be called when the results of gtk_clipboard_request_image() * are received, or when the request fails. @@ -92,7 +94,8 @@ typedef void (* GtkClipboardURIReceivedFunc) (GtkClipboard *clipboard, * @atoms: the supported targets, as array of #GdkAtom, or %NULL * if retrieving the data failed. * @n_atoms: the length of the @atoms array. - * @data: the @user_data supplied to gtk_clipboard_request_targets(). + * @data: (closure): the @user_data supplied to + * gtk_clipboard_request_targets(). * * A function to be called when the results of gtk_clipboard_request_targets() * are received, or when the request fails. diff --git a/gtk/gtkiconview.h b/gtk/gtkiconview.h index 4a2468ca3f..d52f2a9368 100644 --- a/gtk/gtkiconview.h +++ b/gtk/gtkiconview.h @@ -46,7 +46,7 @@ typedef struct _GtkIconViewPrivate GtkIconViewPrivate; * GtkIconViewForeachFunc: * @icon_view: a #GtkIconView * @path: The #GtkTreePath of a selected row - * @data: user data + * @data: (closure): user data * * A function used by gtk_icon_view_selected_foreach() to map all * selected rows. It will be called on every selected row in the view. diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 16a071241b..c1a6076de4 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -2197,7 +2197,7 @@ gtk_device_grab_remove (GtkWidget *widget, /** * gtk_key_snooper_install: (skip) * @snooper: a #GtkKeySnoopFunc - * @func_data: data to pass to @snooper + * @func_data: (closure): data to pass to @snooper * * Installs a key snooper function, which will get called on all * key events before delivering them normally. diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 11f2f7406d..8c3b17fcb4 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -54,7 +54,7 @@ G_BEGIN_DECLS * GtkKeySnoopFunc: * @grab_widget: the widget to which the event will be delivered * @event: the key event - * @func_data: data supplied to gtk_key_snooper_install() + * @func_data: (closure): data supplied to gtk_key_snooper_install() * * Key snooper functions are called before normal event delivery. * They can be used to implement custom key event handling. diff --git a/gtk/gtktexttagtable.h b/gtk/gtktexttagtable.h index e853c40a42..333f834616 100644 --- a/gtk/gtktexttagtable.h +++ b/gtk/gtktexttagtable.h @@ -33,6 +33,11 @@ G_BEGIN_DECLS +/** + * GtkTextTagTableForeach: + * @tag: the #GtkTextTag + * @data: (closure): data passed to gtk_text_tag_table_foreach() + */ typedef void (* GtkTextTagTableForeach) (GtkTextTag *tag, gpointer data); #define GTK_TYPE_TEXT_TAG_TABLE (gtk_text_tag_table_get_type ()) diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index 9eef7c62ce..3edece2695 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -47,7 +47,7 @@ typedef struct _GtkTreeModelIface GtkTreeModelIface; * @model: the #GtkTreeModel being iterated * @path: the current #GtkTreePath * @iter: the current #GtkTreeIter - * @data: The user data passed to gtk_tree_model_foreach() + * @data: (closure): The user data passed to gtk_tree_model_foreach() * * Type of the callback passed to gtk_tree_model_foreach() to * iterate over the rows in a tree model. diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index c2439eadae..64429fa845 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -1823,7 +1823,7 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column, * @tree_column: A #GtkTreeViewColumn * @cell_renderer: A #GtkCellRenderer * @func: (allow-none): The #GtkTreeCellDataFunc to use. - * @func_data: The user data for @func. + * @func_data: (closure): The user data for @func. * @destroy: The destroy notification for @func_data * * Sets the #GtkTreeCellDataFunc to use for the column. This diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h index a991218e2b..b91092eabd 100644 --- a/gtk/gtktreeviewcolumn.h +++ b/gtk/gtktreeviewcolumn.h @@ -65,7 +65,7 @@ typedef enum * @cell: The #GtkCellRenderer that is being rendered by @tree_column * @tree_model: The #GtkTreeModel being rendered * @iter: A #GtkTreeIter of the current row rendered - * @data: user data + * @data: (closure): user data * * A function to set the properties of a cell instead of just using the * straight mapping between the cell and the model. This is useful for