[Xfce4-commits] <exo:master> Add new API exo_icon_view_get_item_{column, row}.

Nick Schermer noreply at xfce.org
Tue Jan 24 18:44:03 CET 2012


Updating branch refs/heads/master
         to 721949e67afae2b11e3463999c221a50d1ba0c97 (commit)
       from cbd91e776776501a962696e64acb2e9904d0881c (commit)

commit 721949e67afae2b11e3463999c221a50d1ba0c97
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jan 24 18:40:47 2012 +0100

    Add new API exo_icon_view_get_item_{column,row}.

 docs/reference/exo-sections.txt |    2 +
 exo/exo-icon-view.c             |   62 +++++++++++++++++++++++++++++++++++++++
 exo/exo-icon-view.h             |    7 ++++-
 exo/exo.symbols                 |    2 +
 4 files changed, 72 insertions(+), 1 deletions(-)

diff --git a/docs/reference/exo-sections.txt b/docs/reference/exo-sections.txt
index d9a865d..842fc1c 100644
--- a/docs/reference/exo-sections.txt
+++ b/docs/reference/exo-sections.txt
@@ -193,6 +193,8 @@ exo_icon_view_selected_foreach
 exo_icon_view_select_path
 exo_icon_view_unselect_path
 exo_icon_view_path_is_selected
+exo_icon_view_get_item_column
+exo_icon_view_get_item_row
 exo_icon_view_get_selected_items
 exo_icon_view_select_all
 exo_icon_view_unselect_all
diff --git a/exo/exo-icon-view.c b/exo/exo-icon-view.c
index 3fc9980..a208e4b 100644
--- a/exo/exo-icon-view.c
+++ b/exo/exo-icon-view.c
@@ -5693,6 +5693,68 @@ exo_icon_view_item_activated (ExoIconView *icon_view,
 
 
 /**
+ * exo_icon_view_get_item_column:
+ * @icon_view : A #ExoIconView.
+ * @path      : The #GtkTreePath of the item.
+ *
+ * Gets the column in which the item @path is currently
+ * displayed. Column numbers start at 0.
+ *
+ * Returns: The column in which the item is displayed
+ *
+ * Since: 0.7.1
+ **/
+gint
+exo_icon_view_get_item_column (ExoIconView *icon_view,
+                               GtkTreePath *path)
+{
+  ExoIconViewItem *item;
+
+  g_return_val_if_fail (EXO_IS_ICON_VIEW (icon_view), -1);
+  g_return_val_if_fail (icon_view->priv->model != NULL, -1);
+  g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, -1);
+
+  item = g_list_nth_data (icon_view->priv->items, gtk_tree_path_get_indices(path)[0]);
+  if (G_LIKELY (item != NULL))
+    return item->col;
+
+  return -1;
+}
+
+
+
+/**
+ * exo_icon_view_get_item_row:
+ * @icon_view : A #ExoIconView.
+ * @path      : The #GtkTreePath of the item.
+ *
+ * Gets the row in which the item @path is currently
+ * displayed. Row numbers start at 0.
+ *
+ * Returns: The row in which the item is displayed
+ *
+ * Since: 0.7.1
+ */
+gint
+exo_icon_view_get_item_row (ExoIconView *icon_view,
+                            GtkTreePath *path)
+{
+  ExoIconViewItem *item;
+
+  g_return_val_if_fail (EXO_IS_ICON_VIEW (icon_view), -1);
+  g_return_val_if_fail (icon_view->priv->model != NULL, -1);
+  g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, -1);
+
+  item = g_list_nth_data (icon_view->priv->items, gtk_tree_path_get_indices(path)[0]);
+  if (G_LIKELY (item != NULL))
+    return item->row;
+
+  return -1;
+}
+
+
+
+/**
  * exo_icon_view_get_cursor:
  * @icon_view : A #ExoIconView
  * @path      : Return location for the current cursor path, or %NULL
diff --git a/exo/exo-icon-view.h b/exo/exo-icon-view.h
index 43d51c2..f2be53a 100644
--- a/exo/exo-icon-view.h
+++ b/exo/exo-icon-view.h
@@ -233,7 +233,7 @@ void                  exo_icon_view_icon_to_widget_coords     (const ExoIconView
                                                                gint                      ix,
                                                                gint                      iy,
                                                                gint                     *wx,
-                                                             gint                     *wy);
+                                                               gint                     *wy);
 
 GtkTreePath          *exo_icon_view_get_path_at_pos           (const ExoIconView        *icon_view,
                                                                gint                      x,
@@ -263,6 +263,11 @@ void                  exo_icon_view_unselect_all              (ExoIconView
 void                  exo_icon_view_item_activated            (ExoIconView              *icon_view,
                                                                GtkTreePath              *path);
 
+gint                  exo_icon_view_get_item_column           (ExoIconView              *icon_view,
+                                                               GtkTreePath              *path);
+gint                  exo_icon_view_get_item_row              (ExoIconView              *icon_view,
+                                                               GtkTreePath              *path);
+
 gboolean              exo_icon_view_get_cursor                (const ExoIconView        *icon_view,
                                                                GtkTreePath             **path,
                                                                GtkCellRenderer         **cell);
diff --git a/exo/exo.symbols b/exo/exo.symbols
index a45cc56..07d2cf5 100644
--- a/exo/exo.symbols
+++ b/exo/exo.symbols
@@ -192,6 +192,8 @@ exo_icon_view_selected_foreach
 exo_icon_view_select_path
 exo_icon_view_unselect_path
 exo_icon_view_path_is_selected
+exo_icon_view_get_item_column
+exo_icon_view_get_item_row
 exo_icon_view_get_selected_items
 exo_icon_view_select_all
 exo_icon_view_unselect_all


More information about the Xfce4-commits mailing list