aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/parser.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-27 14:13:18 -0600
committerTed Gould <ted@gould.cx>2011-01-27 14:13:18 -0600
commit85d445990bcbccc75b7b3c70c278dfaee96652b6 (patch)
treef6679046299ee7084b024aa34caeab3b79349678 /libdbusmenu-gtk/parser.c
parentb3088525e0497a660667dc4069554274e95ec498 (diff)
parentb41b9f202bcae24d256c1a4a9dd044e9e21b984f (diff)
downloadlibdbusmenu-85d445990bcbccc75b7b3c70c278dfaee96652b6.tar.gz
libdbusmenu-85d445990bcbccc75b7b3c70c278dfaee96652b6.tar.bz2
libdbusmenu-85d445990bcbccc75b7b3c70c278dfaee96652b6.zip
Fixing warnings from 'use-fallback'
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r--libdbusmenu-gtk/parser.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index 9b132ce..5d71585 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -68,10 +68,22 @@ static void menuitem_notify_cb (GtkWidget * widget,
GParamSpec * pspec,
gpointer data);
+/**
+ dbusmenu_gtk_parse_menu_structure:
+ @widget: A #GtkMenuItem or #GtkMenuShell to turn into a #DbusmenuMenuitem
+ Goes through the GTK structures and turns them into the appropraite
+ Dbusmenu structures along with setting up all the relationships
+ between the objects. It also stores the dbusmenu items as a cache
+ on the GTK items so that they'll be reused if necissary.
+
+ Return value: A dbusmenu item representing the menu structure
+*/
DbusmenuMenuitem *
dbusmenu_gtk_parse_menu_structure (GtkWidget * widget)
{
+ g_return_val_if_fail(GTK_IS_MENU_ITEM(widget) || GTK_IS_MENU_SHELL(widget), NULL);
+
RecurseContext recurse = {0};
recurse.toplevel = gtk_widget_get_toplevel(widget);
@@ -219,7 +231,7 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
use its own build function */
if (DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM(widget)) {
DbusmenuGtkSerializableMenuItem * smi = DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM(widget);
- return dbusmenu_gtk_serializable_menu_item_build_dbusmenu_menuitem(smi);
+ return dbusmenu_gtk_serializable_menu_item_build_menuitem(smi);
}
/* If it's a standard GTK Menu Item we need to do some of our own work */