Wed, 28 Aug 2019 21:10:11 -0400
Add docs for callback prototypes.
gntbindable.h | file | annotate | diff | comparison | revisions | |
gntmenuitem.h | file | annotate | diff | comparison | revisions | |
gnttree.h | file | annotate | diff | comparison | revisions | |
gntutils.h | file | annotate | diff | comparison | revisions |
--- a/gntbindable.h Wed Aug 28 17:25:18 2019 -0400 +++ b/gntbindable.h Wed Aug 28 21:10:11 2019 -0400 @@ -74,10 +74,24 @@ /******************/ const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text); -/******************/ +/********************/ /* Bindable Actions */ -/******************/ -typedef gboolean (*GntBindableActionCallback) (GntBindable *bindable, GList *params); +/********************/ +/** + * GntBindableActionCallback: + * @bindable: A bindable object. + * @params: Parameters passed to gnt_bindable_class_register_action(). + * + * A callback for an action registered by gnt_bindable_class_register_action(). + */ +typedef gboolean (*GntBindableActionCallback)(GntBindable *bindable, + GList *params); +/** + * GntBindableActionCallbackNoParam: + * @bindable: A bindable object. + * + * A callback for an action with no parameters. + */ typedef gboolean (*GntBindableActionCallbackNoParam)(GntBindable *bindable); /**
--- a/gntmenuitem.h Wed Aug 28 17:25:18 2019 -0400 +++ b/gntmenuitem.h Wed Aug 28 21:10:11 2019 -0400 @@ -39,6 +39,13 @@ #define GNT_TYPE_MENU_ITEM gnt_menuitem_get_type() +/** + * GntMenuItemCallback: + * @item: The menu item which was activated. + * @data: The user data specified in gnt_menuitem_set_callback(). + * + * A callback for when a menu item is activated. + */ typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data); /** @@ -77,7 +84,7 @@ /** * gnt_menuitem_set_callback: * @item: The menuitem. - * @callback: (scope call): The callback function. + * @callback: (scope async): The callback function. * @data: Data to send to the callback function. * * Set a callback function for a menuitem.
--- a/gnttree.h Wed Aug 28 17:25:18 2019 -0400 +++ b/gnttree.h Wed Aug 28 21:10:11 2019 -0400 @@ -75,6 +75,21 @@ }; /** + * GntTreeSearchFunc: + * @tree: The tree being searched. + * @key: The key of a row. + * @search: The search string. + * @current: The content of row in the search column. + * + * A custom tree search function. + * + * Returns: If %TRUE, the row should be displayed, otherwise it's not. + */ +typedef gboolean (*GntTreeSearchFunc)(GntTree *tree, gpointer key, + const gchar *search, + const gchar *current); + +/** * gnt_tree_row_get_type: * * Returns: The #GType for the #GntTreeRow boxed structure. @@ -640,18 +655,13 @@ /** * gnt_tree_set_search_function: * @tree: The tree - * @func: The custom search function. The search function is - * sent the tree itself, the key of a row, the search - * string and the content of row in the search column. - * If the function returns %TRUE, the row is dislayed, - * otherwise it's not. + * @func: The custom search function. * * Set a custom search function. * * Since: 2.1.0 */ -void gnt_tree_set_search_function(GntTree *tree, - gboolean (*func)(GntTree *tree, gpointer key, const char *search, const char *current)); +void gnt_tree_set_search_function(GntTree *tree, GntTreeSearchFunc func); /** * gnt_tree_get_parent_key:
--- a/gntutils.h Wed Aug 28 17:25:18 2019 -0400 +++ b/gntutils.h Wed Aug 28 21:10:11 2019 -0400 @@ -35,6 +35,13 @@ #include "gnttextview.h" #include "gntwidget.h" +/** + * GntDuplicateFunc: + * @data: The data to be copied. + * + * A function used to duplicate some data in a hash table. See + * gnt_hash_table_duplicate(). + */ typedef gpointer (*GntDuplicateFunc)(gconstpointer data); /**