2009-03-02 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Mon, 2 Mar 2009 13:32:12 +0000 (13:32 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Mon, 2 Mar 2009 13:32:12 +0000 (13:32 +0000)
* doc/hildon-sections.txt
* src/hildon-app-menu.h
* src/hildon-app-menu.c (+hildon_app_menu_get_items)
(+hildon_app_menu_get_filters): New methods to get the contents of
a HildonAppMenu.

Fixes: NB#103761 (HildonAppMenu doesn't have methods to get its
children)

ChangeLog
doc/hildon-sections.txt
src/hildon-app-menu.c
src/hildon-app-menu.h

index e948e9c..2c02346 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2009-03-02  Alberto Garcia  <agarcia@igalia.com>
 
+       * doc/hildon-sections.txt
+       * src/hildon-app-menu.h
+       * src/hildon-app-menu.c (+hildon_app_menu_get_items)
+       (+hildon_app_menu_get_filters): New methods to get the contents of
+       a HildonAppMenu.
+
+       Fixes: NB#103761 (HildonAppMenu doesn't have methods to get its
+       children)
+
+2009-03-02  Alberto Garcia  <agarcia@igalia.com>
+
        * src/hildon-app-menu.c (hildon_app_menu_popup):
        Add "Since" tag.
 
index 079a291..22aa0b6 100644 (file)
@@ -360,6 +360,8 @@ hildon_app_menu_prepend
 hildon_app_menu_insert
 hildon_app_menu_reorder_child
 hildon_app_menu_add_filter
+hildon_app_menu_get_items
+hildon_app_menu_get_filters
 hildon_app_menu_popup
 <SUBSECTION Standard>
 HILDON_APP_MENU
index 86b8812..bf4f859 100644 (file)
@@ -896,6 +896,51 @@ hildon_app_menu_popup                           (HildonAppMenu *menu,
     gtk_widget_show (GTK_WIDGET (menu));
 }
 
+/**
+ * hildon_app_menu_get_items:
+ * @menu: a #HildonAppMenu
+ *
+ * Returns a list of all items (regular items, not filters) contained
+ * in @menu.
+ *
+ * Returns: a newly-allocated list containing the items in @menu
+ *
+ * Since: 2.2
+ **/
+GList *
+hildon_app_menu_get_items                       (HildonAppMenu *menu)
+{
+    HildonAppMenuPrivate *priv;
+
+    g_return_if_fail (HILDON_IS_APP_MENU (menu));
+
+    priv = HILDON_APP_MENU_GET_PRIVATE (menu);
+
+    return g_list_copy (priv->buttons);
+}
+
+/**
+ * hildon_app_menu_get_filters:
+ * @menu: a #HildonAppMenu
+ *
+ * Returns a list of all filters contained in @menu.
+ *
+ * Returns: a newly-allocated list containing the filters in @menu
+ *
+ * Since: 2.2
+ **/
+GList *
+hildon_app_menu_get_filters                     (HildonAppMenu *menu)
+{
+    HildonAppMenuPrivate *priv;
+
+    g_return_if_fail (HILDON_IS_APP_MENU (menu));
+
+    priv = HILDON_APP_MENU_GET_PRIVATE (menu);
+
+    return g_list_copy (priv->filters);
+}
+
 static void
 hildon_app_menu_init                            (HildonAppMenu *menu)
 {
index 8962817..f0a20bb 100644 (file)
@@ -92,6 +92,12 @@ void
 hildon_app_menu_popup                           (HildonAppMenu *menu,
                                                  GtkWindow     *parent_window);
 
+GList *
+hildon_app_menu_get_items                       (HildonAppMenu *menu);
+
+GList *
+hildon_app_menu_get_filters                     (HildonAppMenu *menu);
+
 G_END_DECLS
 
 #endif /* __HILDON_APP_MENU_H__ */