[gnome-menus] libmenu: Add the forgotten gmenu_tree_iter_get_separator



commit 8cd6efdf03a7056ed4c7373e00a2eb7657e5c6cc
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Jun 2 13:27:24 2012 -0400

    libmenu: Add the forgotten gmenu_tree_iter_get_separator
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677344

 libmenu/gmenu-tree.c |   19 +++++++++++++++++++
 libmenu/gmenu-tree.h |    1 +
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
index 23cd353..1c46c8e 100644
--- a/libmenu/gmenu-tree.c
+++ b/libmenu/gmenu-tree.c
@@ -1039,6 +1039,25 @@ gmenu_tree_iter_get_alias (GMenuTreeIter *iter)
   return (GMenuTreeAlias*)gmenu_tree_item_ref (iter->item);
 }
 
+/**
+ * gmenu_tree_iter_get_separator:
+ * @iter: iter
+ *
+ * This method may only be called if gmenu_tree_iter_next()
+ * returned #GMENU_TREE_ITEM_SEPARATOR.
+ *
+ * Returns: (transfer full): A separator
+ */
+GMenuTreeSeparator *
+gmenu_tree_iter_get_separator (GMenuTreeIter *iter)
+{
+  g_return_val_if_fail (iter != NULL, NULL);
+  g_return_val_if_fail (iter->item != NULL, NULL);
+  g_return_val_if_fail (iter->item->type == GMENU_TREE_ITEM_SEPARATOR, NULL);
+
+  return (GMenuTreeSeparator*)gmenu_tree_item_ref (iter->item);
+}
+
 const char *
 gmenu_tree_directory_get_name (GMenuTreeDirectory *directory)
 {
diff --git a/libmenu/gmenu-tree.h b/libmenu/gmenu-tree.h
index 95f9be8..3b3a12d 100644
--- a/libmenu/gmenu-tree.h
+++ b/libmenu/gmenu-tree.h
@@ -125,6 +125,7 @@ GMenuTreeDirectory *gmenu_tree_iter_get_directory        (GMenuTreeIter *iter);
 GMenuTreeEntry     *gmenu_tree_iter_get_entry            (GMenuTreeIter *iter);
 GMenuTreeHeader    *gmenu_tree_iter_get_header           (GMenuTreeIter *iter);
 GMenuTreeAlias     *gmenu_tree_iter_get_alias            (GMenuTreeIter *iter);
+GMenuTreeSeparator *gmenu_tree_iter_get_separator        (GMenuTreeIter *iter);
 
 char *gmenu_tree_directory_make_path (GMenuTreeDirectory *directory,
 				      GMenuTreeEntry     *entry);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]