2 * Copyright © 2011 Canonical Ltd.
4 * This library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * licence, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * Author: Ryan Lortie <desrt@desrt.ca>
22 #include "gdbusmenumodel.h"
24 #include "gmenumodel.h"
29 * SECTION:gdbusmenumodel
30 * @title: GDBusMenuModel
31 * @short_description: A D-Bus GMenuModel implementation
32 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
34 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
35 * as a proxy for a menu model that is exported over D-Bus with
36 * g_menu_model_dbus_export_start().
40 * There are 3 main (quasi-)classes involved here:
46 * Each of these classes exists as a parameterised singleton keyed to a
49 * - GDBusMenuPath represents a D-Bus object path on a particular
50 * unique bus name on a particular GDBusConnection.
52 * - GDBusMenuGroup represents a particular group on a particular
55 * - GDBusMenuModel represents a particular menu within a particular
58 * There are also two (and a half) utility structs:
60 * - PathIdentifier and ConstPathIdentifier
61 * - GDBusMenuModelItem
63 * PathIdentifier is the triplet of (GDBusConnection, unique name,
64 * object path) that uniquely identifies a particular GDBusMenuPath.
65 * It holds ownership on each of these things, so we have a
66 * ConstPathIdentifier variant that does not.
68 * We have a 3-level hierarchy of hashtables:
70 * - a global hashtable (g_dbus_menu_paths) maps from PathIdentifier
73 * - each GDBusMenuPath has a hashtable mapping from guint (group
74 * number) to GDBusMenuGroup
76 * - each GDBusMenuGroup has a hashtable mapping from guint (menu
77 * number) to GDBusMenuModel.
79 * In this way, each quintuplet of (connection, bus name, object path,
80 * group id, menu id) maps to a single GDBusMenuModel instance that can be
81 * located via 3 hashtable lookups.
83 * All of the 3 classes are refcounted (GDBusMenuPath and
84 * GDBusMenuGroup manually, and GDBusMenuModel by virtue of being a
85 * GObject). The hashtables do not hold references -- rather, when the
86 * last reference is dropped, the object is removed from the hashtable.
88 * The hard references go in the other direction: GDBusMenuModel is created
89 * as the user requests it and only exists as long as the user holds a
90 * reference on it. GDBusMenuModel holds a reference on the GDBusMenuGroup
91 * from which it came. GDBusMenuGroup holds a reference on
94 * In addition to refcounts, each object has an 'active' variable (ints
95 * for GDBusMenuPath and GDBusMenuGroup, boolean for GDBusMenuModel).
97 * - GDBusMenuModel is inactive when created and becomes active only when
98 * first queried for information. This prevents extra work from
99 * happening just by someone acquiring a GDBusMenuModel (and not
100 * actually trying to display it yet).
102 * - The active count on GDBusMenuGroup is equal to the number of
103 * GDBusMenuModel instances in that group that are active. When the
104 * active count transitions from 0 to 1, the group calls the 'Start'
105 * method on the service to begin monitoring that group. When it
106 * drops from 1 to 0, the group calls the 'End' method to stop
109 * - The active count on GDBusMenuPath is equal to the number of
110 * GDBusMenuGroup instances on that path with a non-zero active
111 * count. When the active count transitions from 0 to 1, the path
112 * sets up a signal subscription to monitor any changes. The signal
113 * subscription is taken down when the active count transitions from
116 * When active, GDBusMenuPath gets incoming signals when changes occur.
117 * If the change signal mentions a group for which we currently have an
118 * active GDBusMenuGroup, the change signal is passed along to that
119 * group. If the group is inactive, the change signal is ignored.
121 * Most of the "work" occurs in GDBusMenuGroup. In addition to the
122 * hashtable of GDBusMenuModel instances, it keeps a hashtable of the actual
123 * menu contents, each encoded as GSequence of GDBusMenuModelItem. It
124 * initially populates this table with the results of the "Start" method
125 * call and then updates it according to incoming change signals. If
126 * the change signal mentions a menu for which we current have an active
127 * GDBusMenuModel, the change signal is passed along to that model. If the
128 * model is inactive, the change signal is ignored.
130 * GDBusMenuModelItem is just a pair of hashtables, one for the attributes
131 * and one for the links of the item. Both map strings to GVariant
132 * instances. In the case of links, the GVariant has type '(uu)' and is
133 * turned into a GDBusMenuModel at the point that the user pulls it through
136 * Following the "empty is the same as non-existent" rule, the hashtable
137 * of GSequence of GDBusMenuModelItem holds NULL for empty menus.
139 * GDBusMenuModel contains very little functionality of its own. It holds a
140 * (weak) reference to the GSequence of GDBusMenuModelItem contained in the
141 * GDBusMenuGroup. It uses this GSequence to implement the GMenuModel
142 * interface. It also emits the "items-changed" signal if it is active
143 * and it was told that the contents of the GSequence changed.
146 typedef struct _GDBusMenuGroup GDBusMenuGroup;
147 typedef struct _GDBusMenuPath GDBusMenuPath;
149 static void g_dbus_menu_group_changed (GDBusMenuGroup *group,
154 static void g_dbus_menu_model_changed (GDBusMenuModel *proxy,
159 static GDBusMenuGroup * g_dbus_menu_group_get_from_path (GDBusMenuPath *path,
161 static GDBusMenuModel * g_dbus_menu_model_get_from_group (GDBusMenuGroup *group,
164 /* PathIdentifier {{{1 */
167 GDBusConnection *connection;
174 GDBusConnection *connection;
175 const gchar *bus_name;
176 const gchar *object_path;
177 } ConstPathIdentifier;
180 path_identifier_hash (gconstpointer data)
182 ConstPathIdentifier *id = data;
184 return g_str_hash (id->object_path);
188 path_identifier_equal (gconstpointer a,
191 ConstPathIdentifier *id_a = a;
192 ConstPathIdentifier *id_b = b;
194 return id_a->connection == id_b->connection &&
195 g_str_equal (id_a->bus_name, id_b->bus_name) &&
196 g_str_equal (id_a->object_path, id_b->object_path);
200 path_identifier_free (PathIdentifier *id)
202 g_object_unref (id->connection);
203 g_free (id->bus_name);
204 g_free (id->object_path);
206 g_slice_free (PathIdentifier, id);
209 static PathIdentifier *
210 path_identifier_new (ConstPathIdentifier *cid)
214 id = g_slice_new (PathIdentifier);
215 id->connection = g_object_ref (cid->connection);
216 id->bus_name = g_strdup (cid->bus_name);
217 id->object_path = g_strdup (cid->object_path);
222 /* GDBusMenuPath {{{1 */
224 struct _GDBusMenuPath
234 static GHashTable *g_dbus_menu_paths;
236 static GDBusMenuPath *
237 g_dbus_menu_path_ref (GDBusMenuPath *path)
245 g_dbus_menu_path_unref (GDBusMenuPath *path)
247 if (--path->ref_count == 0)
249 g_hash_table_remove (g_dbus_menu_paths, path->id);
250 g_hash_table_unref (path->groups);
251 path_identifier_free (path->id);
253 g_slice_free (GDBusMenuPath, path);
258 g_dbus_menu_path_signal (GDBusConnection *connection,
259 const gchar *sender_name,
260 const gchar *object_path,
261 const gchar *interface_name,
262 const gchar *signal_name,
263 GVariant *parameters,
266 GDBusMenuPath *path = user_data;
274 if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(a(uuuuaa{sv}))")))
277 g_variant_get (parameters, "(a(uuuuaa{sv}))", &iter);
278 while (g_variant_iter_loop (iter, "(uuuu@aa{sv})", &group_id, &menu_id, &position, &removes, &adds))
280 GDBusMenuGroup *group;
282 group = g_hash_table_lookup (path->groups, GINT_TO_POINTER (group_id));
285 g_dbus_menu_group_changed (group, menu_id, position, removes, adds);
287 g_variant_iter_free (iter);
291 g_dbus_menu_path_activate (GDBusMenuPath *path)
293 if (path->active++ == 0)
294 path->watch_id = g_dbus_connection_signal_subscribe (path->id->connection, path->id->bus_name,
295 "org.gtk.Menus", "Changed", path->id->object_path,
296 NULL, G_DBUS_SIGNAL_FLAGS_NONE,
297 g_dbus_menu_path_signal, path, NULL);
301 g_dbus_menu_path_deactivate (GDBusMenuPath *path)
303 if (--path->active == 0)
304 g_dbus_connection_signal_unsubscribe (path->id->connection, path->watch_id);
307 static GDBusMenuPath *
308 g_dbus_menu_path_get (GDBusConnection *connection,
309 const gchar *bus_name,
310 const gchar *object_path)
312 ConstPathIdentifier cid = { connection, bus_name, object_path };
315 if (g_dbus_menu_paths == NULL)
316 g_dbus_menu_paths = g_hash_table_new (path_identifier_hash, path_identifier_equal);
318 path = g_hash_table_lookup (g_dbus_menu_paths, &cid);
322 path = g_slice_new (GDBusMenuPath);
323 path->id = path_identifier_new (&cid);
324 path->groups = g_hash_table_new (NULL, NULL);
328 g_hash_table_insert (g_dbus_menu_paths, path->id, path);
331 return g_dbus_menu_path_ref (path);
334 /* GDBusMenuGroup, GDBusMenuModelItem {{{1 */
342 struct _GDBusMenuGroup
347 GHashTable *proxies; /* uint -> unowned GDBusMenuModel */
348 GHashTable *menus; /* uint -> owned GSequence */
356 GHashTable *attributes;
358 } GDBusMenuModelItem;
360 static GDBusMenuGroup *
361 g_dbus_menu_group_ref (GDBusMenuGroup *group)
369 g_dbus_menu_group_unref (GDBusMenuGroup *group)
371 if (--group->ref_count == 0)
373 g_assert (group->state == GROUP_OFFLINE);
374 g_assert (group->active == 0);
376 g_hash_table_remove (group->path->groups, GINT_TO_POINTER (group->id));
377 g_hash_table_unref (group->proxies);
379 g_dbus_menu_path_unref (group->path);
381 g_slice_free (GDBusMenuGroup, group);
386 g_dbus_menu_model_item_free (gpointer data)
388 GDBusMenuModelItem *item = data;
390 g_hash_table_unref (item->attributes);
391 g_hash_table_unref (item->links);
393 g_slice_free (GDBusMenuModelItem, item);
396 static GDBusMenuModelItem *
397 g_dbus_menu_group_create_item (GVariant *description)
399 GDBusMenuModelItem *item;
404 item = g_slice_new (GDBusMenuModelItem);
405 item->attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
406 item->links = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
408 g_variant_iter_init (&iter, description);
409 while (g_variant_iter_loop (&iter, "{&sv}", &key, &value))
411 /* key + 1 to skip the ':' */
412 g_hash_table_insert (item->links, g_strdup (key + 1), g_variant_ref (value));
414 g_hash_table_insert (item->attributes, g_strdup (key), g_variant_ref (value));
420 * GDBusMenuGroup can be in three states:
422 * OFFLINE: not subscribed to this group
423 * PENDING: we made the call to subscribe to this group, but the result
424 * has not come back yet
425 * ONLINE: we are fully subscribed
427 * We can get into some nasty situations where we make a call due to an
428 * activation request but receive a deactivation request before the call
429 * returns. If another activation request occurs then we could risk
430 * sending a Start request even though one is already in progress. For
431 * this reason, we have to carefully consider what to do in each of the
432 * three states for each of the following situations:
434 * - activation requested
435 * - deactivation requested
436 * - Start call finishes
438 * To simplify things a bit, we do not have a callback for the Stop
439 * call. We just send it and assume that it takes effect immediately.
441 * Activation requested:
442 * OFFLINE: make the Start call and transition to PENDING
443 * PENDING: do nothing -- call is already in progress.
444 * ONLINE: this should not be possible
446 * Deactivation requested:
447 * OFFLINE: this should not be possible
448 * PENDING: do nothing -- handle it when the Start call finishes
449 * ONLINE: send the Stop call and move to OFFLINE immediately
451 * Start call finishes:
452 * OFFLINE: this should not be possible
454 * If we should be active (ie: active count > 0): move to ONLINE
455 * If not: send Stop call and move to OFFLINE immediately
456 * ONLINE: this should not be possible
458 * We have to take care with regards to signal subscriptions (ie:
459 * activation of the GDBusMenuPath). The signal subscription is always
460 * established when transitioning from OFFLINE to PENDING and taken down
461 * when transitioning to OFFLINE (from either PENDING or ONLINE).
463 * Since there are two places where we transition to OFFLINE, we split
464 * that code out into a separate function.
467 g_dbus_menu_group_go_offline (GDBusMenuGroup *group)
469 g_dbus_menu_path_deactivate (group->path);
470 g_dbus_connection_call (group->path->id->connection,
471 group->path->id->bus_name,
472 group->path->id->object_path,
473 "org.gtk.Menus", "End",
474 g_variant_new_parsed ("([ %u ],)", group->id),
475 NULL, G_DBUS_CALL_FLAGS_NONE, -1,
477 group->state = GROUP_OFFLINE;
482 g_dbus_menu_group_start_ready (GObject *source_object,
483 GAsyncResult *result,
486 GDBusConnection *connection = G_DBUS_CONNECTION (source_object);
487 GDBusMenuGroup *group = user_data;
490 g_assert (group->state == GROUP_PENDING);
492 reply = g_dbus_connection_call_finish (connection, result, NULL);
496 group->state = GROUP_ONLINE;
498 /* If we receive no reply, just act like we got an empty reply. */
506 g_variant_get (reply, "(a(uuaa{sv}))", &iter);
507 while (g_variant_iter_loop (iter, "(uu@aa{sv})", &group_id, &menu_id, &items))
508 if (group_id == group->id)
509 g_dbus_menu_group_changed (group, menu_id, 0, 0, items);
510 g_variant_iter_free (iter);
514 g_dbus_menu_group_go_offline (group);
517 g_variant_unref (reply);
519 g_dbus_menu_group_unref (group);
523 g_dbus_menu_group_activate (GDBusMenuGroup *group)
525 if (group->active++ == 0)
527 g_assert (group->state != GROUP_ONLINE);
529 if (group->state == GROUP_OFFLINE)
531 g_dbus_menu_path_activate (group->path);
533 g_dbus_connection_call (group->path->id->connection,
534 group->path->id->bus_name,
535 group->path->id->object_path,
536 "org.gtk.Menus", "Start",
537 g_variant_new_parsed ("([ %u ],)", group->id),
538 G_VARIANT_TYPE ("(a(uuaa{sv}))"),
539 G_DBUS_CALL_FLAGS_NONE, -1, NULL,
540 g_dbus_menu_group_start_ready,
541 g_dbus_menu_group_ref (group));
542 group->state = GROUP_PENDING;
548 g_dbus_menu_group_deactivate (GDBusMenuGroup *group)
550 if (--group->active == 0)
552 g_assert (group->state != GROUP_OFFLINE);
554 if (group->state == GROUP_ONLINE)
556 /* We are here because nobody is watching, so just free
557 * everything and don't bother with the notifications.
559 g_hash_table_remove_all (group->menus);
561 g_dbus_menu_group_go_offline (group);
567 g_dbus_menu_group_changed (GDBusMenuGroup *group,
573 GSequenceIter *point;
575 GDBusMenuModel *proxy;
580 /* We could have signals coming to us when we're not active (due to
581 * some other process having subscribed to this group) or when we're
582 * pending. In both of those cases, we want to ignore the signal
583 * since we'll get our own information when we call "Start" for
586 if (group->state != GROUP_ONLINE)
589 items = g_hash_table_lookup (group->menus, GINT_TO_POINTER (menu_id));
593 items = g_sequence_new (g_dbus_menu_model_item_free);
594 g_hash_table_insert (group->menus, GINT_TO_POINTER (menu_id), items);
597 point = g_sequence_get_iter_at_pos (items, position + removed);
599 g_return_if_fail (point != NULL);
603 GSequenceIter *start;
605 start = g_sequence_get_iter_at_pos (items, position);
606 g_sequence_remove_range (start, point);
609 n_added = g_variant_iter_init (&iter, added);
610 while (g_variant_iter_loop (&iter, "@a{sv}", &item))
611 g_sequence_insert_before (point, g_dbus_menu_group_create_item (item));
613 if (g_sequence_get_length (items) == 0)
615 g_hash_table_remove (group->menus, GINT_TO_POINTER (menu_id));
619 if ((proxy = g_hash_table_lookup (group->proxies, GINT_TO_POINTER (menu_id))))
620 g_dbus_menu_model_changed (proxy, items, position, removed, n_added);
623 static GDBusMenuGroup *
624 g_dbus_menu_group_get_from_path (GDBusMenuPath *path,
627 GDBusMenuGroup *group;
629 group = g_hash_table_lookup (path->groups, GINT_TO_POINTER (group_id));
633 group = g_slice_new (GDBusMenuGroup);
634 group->path = g_dbus_menu_path_ref (path);
635 group->id = group_id;
636 group->proxies = g_hash_table_new (NULL, NULL);
637 group->menus = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_sequence_free);
638 group->state = GROUP_OFFLINE;
640 group->ref_count = 0;
642 g_hash_table_insert (path->groups, GINT_TO_POINTER (group->id), group);
645 return g_dbus_menu_group_ref (group);
648 static GDBusMenuGroup *
649 g_dbus_menu_group_get (GDBusConnection *connection,
650 const gchar *bus_name,
651 const gchar *object_path,
654 GDBusMenuGroup *group;
657 path = g_dbus_menu_path_get (connection, bus_name, object_path);
658 group = g_dbus_menu_group_get_from_path (path, group_id);
659 g_dbus_menu_path_unref (path);
664 /* GDBusMenuModel {{{1 */
666 typedef GMenuModelClass GDBusMenuModelClass;
667 struct _GDBusMenuModel
671 GDBusMenuGroup *group;
674 GSequence *items; /* unowned */
678 G_DEFINE_TYPE (GDBusMenuModel, g_dbus_menu_model, G_TYPE_MENU_MODEL)
681 g_dbus_menu_model_is_mutable (GMenuModel *model)
687 g_dbus_menu_model_get_n_items (GMenuModel *model)
689 GDBusMenuModel *proxy = G_DBUS_MENU_MODEL (model);
693 g_dbus_menu_group_activate (proxy->group);
694 proxy->active = TRUE;
697 return proxy->items ? g_sequence_get_length (proxy->items) : 0;
701 g_dbus_menu_model_get_item_attributes (GMenuModel *model,
705 GDBusMenuModel *proxy = G_DBUS_MENU_MODEL (model);
706 GDBusMenuModelItem *item;
709 g_return_if_fail (proxy->active);
710 g_return_if_fail (proxy->items);
712 iter = g_sequence_get_iter_at_pos (proxy->items, item_index);
713 g_return_if_fail (iter);
715 item = g_sequence_get (iter);
716 g_return_if_fail (item);
718 *table = g_hash_table_ref (item->attributes);
722 g_dbus_menu_model_get_item_links (GMenuModel *model,
726 GDBusMenuModel *proxy = G_DBUS_MENU_MODEL (model);
727 GDBusMenuModelItem *item;
730 g_return_if_fail (proxy->active);
731 g_return_if_fail (proxy->items);
733 iter = g_sequence_get_iter_at_pos (proxy->items, item_index);
734 g_return_if_fail (iter);
736 item = g_sequence_get (iter);
737 g_return_if_fail (item);
739 *table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
746 g_hash_table_iter_init (&tmp, item->links);
747 while (g_hash_table_iter_next (&tmp, &key, &value))
749 if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(uu)")))
751 guint group_id, menu_id;
752 GDBusMenuGroup *group;
753 GDBusMenuModel *link;
755 g_variant_get (value, "(uu)", &group_id, &menu_id);
757 /* save the hash lookup in a relatively common case */
758 if (proxy->group->id != group_id)
759 group = g_dbus_menu_group_get_from_path (proxy->group->path, group_id);
761 group = g_dbus_menu_group_ref (proxy->group);
763 link = g_dbus_menu_model_get_from_group (group, menu_id);
765 g_hash_table_insert (*table, g_strdup (key), link);
767 g_dbus_menu_group_unref (group);
774 g_dbus_menu_model_finalize (GObject *object)
776 GDBusMenuModel *proxy = G_DBUS_MENU_MODEL (object);
779 g_dbus_menu_group_deactivate (proxy->group);
781 g_hash_table_remove (proxy->group->proxies, GINT_TO_POINTER (proxy->id));
782 g_dbus_menu_group_unref (proxy->group);
784 G_OBJECT_CLASS (g_dbus_menu_model_parent_class)
789 g_dbus_menu_model_init (GDBusMenuModel *proxy)
794 g_dbus_menu_model_class_init (GDBusMenuModelClass *class)
796 GObjectClass *object_class = G_OBJECT_CLASS (class);
798 class->is_mutable = g_dbus_menu_model_is_mutable;
799 class->get_n_items = g_dbus_menu_model_get_n_items;
800 class->get_item_attributes = g_dbus_menu_model_get_item_attributes;
801 class->get_item_links = g_dbus_menu_model_get_item_links;
803 object_class->finalize = g_dbus_menu_model_finalize;
807 g_dbus_menu_model_changed (GDBusMenuModel *proxy,
813 proxy->items = items;
815 if (proxy->active && (removed || added))
816 g_menu_model_items_changed (G_MENU_MODEL (proxy), position, removed, added);
819 static GDBusMenuModel *
820 g_dbus_menu_model_get_from_group (GDBusMenuGroup *group,
823 GDBusMenuModel *proxy;
825 proxy = g_hash_table_lookup (group->proxies, GINT_TO_POINTER (menu_id));
827 g_object_ref (proxy);
831 proxy = g_object_new (G_TYPE_DBUS_MENU_MODEL, NULL);
832 proxy->items = g_hash_table_lookup (group->menus, GINT_TO_POINTER (menu_id));
833 g_hash_table_insert (group->proxies, GINT_TO_POINTER (menu_id), proxy);
834 proxy->group = g_dbus_menu_group_ref (group);
842 * g_dbus_menu_model_get:
843 * @connection: a #GDBusConnection
844 * @bus_name: the bus name which exports the menu model
845 * @object_path: the object path at which the menu model is exported
847 * Obtains a #GDBusMenuModel for the menu model which is exported
848 * at the given @bus_name and @object_path.
850 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
853 g_dbus_menu_model_get (GDBusConnection *connection,
854 const gchar *bus_name,
855 const gchar *object_path)
857 GDBusMenuGroup *group;
858 GDBusMenuModel *proxy;
860 group = g_dbus_menu_group_get (connection, bus_name, object_path, 0);
861 proxy = g_dbus_menu_model_get_from_group (group, 0);
862 g_dbus_menu_group_unref (group);
869 dump_proxy (gpointer key, gpointer value, gpointer data)
871 GDBusMenuModel *proxy = value;
873 g_print (" menu %d refcount %d active %d\n",
874 proxy->id, G_OBJECT (proxy)->ref_count, proxy->active);
878 dump_group (gpointer key, gpointer value, gpointer data)
880 GDBusMenuGroup *group = value;
882 g_print (" group %d refcount %d state %d active %d\n",
883 group->id, group->ref_count, group->state, group->active);
885 g_hash_table_foreach (group->proxies, dump_proxy, NULL);
889 dump_path (gpointer key, gpointer value, gpointer data)
891 PathIdentifier *pid = key;
892 GDBusMenuPath *path = value;
894 g_print ("%s active %d\n", pid->object_path, path->active);
895 g_hash_table_foreach (path->groups, dump_group, NULL);
899 g_dbus_menu_model_dump (void)
901 g_hash_table_foreach (g_dbus_menu_paths, dump_path, NULL);
907 /* vim:set foldmethod=marker: */