]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreeselection.c
Reset gail library versioning to 0.0.0, since we changed soname
[~andy/gtk] / gtk / gtktreeselection.c
index e7aad5bff7de32c6ca01bbc240438405c076790f..4a275da5c0f0caea38324580b7bd1b60869cf828 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
 #include <string.h>
 #include "gtktreeselection.h"
 #include "gtktreeprivate.h"
@@ -77,7 +77,7 @@ gtk_tree_selection_finalize (GObject *object)
 
   if (selection->destroy)
     {
-      GtkDestroyNotify d = selection->destroy;
+      GDestroyNotify d = selection->destroy;
 
       selection->destroy = NULL;
       d (selection->user_data);
@@ -256,14 +256,14 @@ void
 gtk_tree_selection_set_select_function (GtkTreeSelection     *selection,
                                        GtkTreeSelectionFunc  func,
                                        gpointer              data,
-                                       GtkDestroyNotify      destroy)
+                                       GDestroyNotify        destroy)
 {
   g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
   g_return_if_fail (func != NULL);
 
   if (selection->destroy)
     {
-      GtkDestroyNotify d = selection->destroy;
+      GDestroyNotify d = selection->destroy;
 
       selection->destroy = NULL;
       d (selection->user_data);
@@ -274,6 +274,24 @@ gtk_tree_selection_set_select_function (GtkTreeSelection     *selection,
   selection->destroy = destroy;
 }
 
+/**
+ * gtk_tree_selection_get_select_function:
+ * @selection: A #GtkTreeSelection.
+ *
+ * Returns the current selection function.
+ *
+ * Return value: The function.
+ *
+ * Since: 2.14
+ **/
+GtkTreeSelectionFunc
+gtk_tree_selection_get_select_function (GtkTreeSelection *selection)
+{
+  g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), NULL);
+
+  return selection->user_func;
+}
+
 /**
  * gtk_tree_selection_get_user_data:
  * @selection: A #GtkTreeSelection.
@@ -309,8 +327,8 @@ gtk_tree_selection_get_tree_view (GtkTreeSelection *selection)
 /**
  * gtk_tree_selection_get_selected:
  * @selection: A #GtkTreeSelection.
- * @model: A pointer to set to the #GtkTreeModel, or NULL.
- * @iter: The #GtkTreeIter, or NULL.
+ * @model: (out) (allow-none): A pointer to set to the #GtkTreeModel, or NULL.
+ * @iter: (allow-none): The #GtkTreeIter, or NULL.
  *
  * Sets @iter to the currently selected node if @selection is set to
  * #GTK_SELECTION_SINGLE or #GTK_SELECTION_BROWSE.  @iter may be NULL if you
@@ -384,7 +402,7 @@ gtk_tree_selection_get_selected (GtkTreeSelection  *selection,
 /**
  * gtk_tree_selection_get_selected_rows:
  * @selection: A #GtkTreeSelection.
- * @model: A pointer to set to the #GtkTreeModel, or NULL.
+ * @model: (allow-none): A pointer to set to the #GtkTreeModel, or NULL.
  *
  * Creates a list of path of all selected rows. Additionally, if you are
  * planning on modifying the model after calling this function, you may
@@ -392,12 +410,12 @@ gtk_tree_selection_get_selected (GtkTreeSelection  *selection,
  * To do this, you can use gtk_tree_row_reference_new().
  *
  * To free the return value, use:
- * <informalexample><programlisting>
- * g_list_foreach (list, gtk_tree_path_free, NULL);
+ * |[
+ * g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
  * g_list_free (list);
- * </programlisting></informalexample>
+ * ]|
  *
- * Return value: A #GList containing a #GtkTreePath for each selected row.
+ * Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.
  *
  * Since: 2.2
  **/
@@ -413,13 +431,13 @@ gtk_tree_selection_get_selected_rows (GtkTreeSelection   *selection,
   g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), NULL);
   g_return_val_if_fail (selection->tree_view != NULL, NULL);
 
+  if (model)
+    *model = selection->tree_view->priv->model;
+
   if (selection->tree_view->priv->tree == NULL ||
       selection->tree_view->priv->tree->root == NULL)
     return NULL;
 
-  if (model)
-    *model = selection->tree_view->priv->model;
-
   if (selection->type == GTK_SELECTION_NONE)
     return NULL;
   else if (selection->type != GTK_SELECTION_MULTIPLE)
@@ -619,13 +637,13 @@ gtk_tree_selection_selected_foreach (GtkTreeSelection            *selection,
   g_object_ref (model);
 
   /* connect to signals to monitor changes in treemodel */
-  inserted_id = g_signal_connect_swapped (model, "row_inserted",
+  inserted_id = g_signal_connect_swapped (model, "row-inserted",
                                          G_CALLBACK (model_changed),
                                          &stop);
-  deleted_id = g_signal_connect_swapped (model, "row_deleted",
+  deleted_id = g_signal_connect_swapped (model, "row-deleted",
                                         G_CALLBACK (model_changed),
                                         &stop);
-  reordered_id = g_signal_connect_swapped (model, "rows_reordered",
+  reordered_id = g_signal_connect_swapped (model, "rows-reordered",
                                           G_CALLBACK (model_changed),
                                           &stop);
   changed_id = g_signal_connect_swapped (selection->tree_view, "notify::model",