GActionGroupExporter: stop using signal IDs
[platform/upstream/glib.git] / gio / gactiongroupexporter.c
1 /*
2  * Copyright © 2010 Codethink Limited
3  * Copyright © 2011 Canonical Limited
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published
7  * by the Free Software Foundation; either version 2 of the licence or (at
8  * your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Authors: Ryan Lortie <desrt@desrt.ca>
21  */
22
23 #include "config.h"
24
25 #include "gactiongroupexporter.h"
26
27 #include "gdbusmethodinvocation.h"
28 #include "gdbusintrospection.h"
29 #include "gdbusconnection.h"
30 #include "gactiongroup.h"
31 #include "gapplication.h"
32 #include "gdbuserror.h"
33
34 /**
35  * SECTION:gactiongroupexporter
36  * @title: GActionGroup exporter
37  * @short_description: Export GActionGroups on D-Bus
38  * @see_also: #GActionGroup, #GDBusActionGroup
39  *
40  * These functions support exporting a #GActionGroup on D-Bus.
41  * The D-Bus interface that is used is a private implementation
42  * detail.
43  *
44  * To access an exported #GActionGroup remotely, use
45  * g_dbus_action_group_new() to obtain a #GDBusActionGroup.
46  */
47
48 G_GNUC_INTERNAL GVariant *
49 g_action_group_describe_action (GActionGroup *action_group,
50                                 const gchar  *name)
51 {
52   const GVariantType *type;
53   GVariantBuilder builder;
54   gboolean enabled;
55   GVariant *state;
56
57   g_variant_builder_init (&builder, G_VARIANT_TYPE ("(bgav)"));
58
59   enabled = g_action_group_get_action_enabled (action_group, name);
60   g_variant_builder_add (&builder, "b", enabled);
61
62   if ((type = g_action_group_get_action_parameter_type (action_group, name)))
63     {
64       gchar *str = g_variant_type_dup_string (type);
65       g_variant_builder_add (&builder, "g", str);
66       g_free (str);
67     }
68   else
69     g_variant_builder_add (&builder, "g", "");
70
71   g_variant_builder_open (&builder, G_VARIANT_TYPE ("av"));
72   if ((state = g_action_group_get_action_state (action_group, name)))
73     {
74       g_variant_builder_add (&builder, "v", state);
75       g_variant_unref (state);
76     }
77   g_variant_builder_close (&builder);
78
79   return g_variant_builder_end (&builder);
80 }
81
82 /* The org.gtk.Actions interface
83  * =============================
84  *
85  * This interface describes a group of actions.
86  *
87  * Each action:
88  * - has a unique string name
89  * - can be activated
90  * - optionally has a parameter type that must be given to the activation
91  * - has an enabled state that may be true or false
92  * - optionally has a state which can change value, but not type
93  *
94  * Methods
95  * -------
96  *
97  * List :: () → (as)
98  *
99  *   Lists the names of the actions exported at this object path.
100  *
101  * Describe :: (s) → (bgav)
102  *
103  *   Describes a single action, or a given name.
104  *
105  *   The return value has the following components:
106  *   b: specifies if the action is currently enabled. This is
107  *      a hint that attempting to interact with the action will
108  *      produce no effect.
109  *   g: specifies the optional parameter type. If not "",
110  *      the string specifies the type of argument that must
111  *      be passed to the activation.
112  *   av: specifies the optional state. If not empty, the array
113  *       contains the current value of the state as a variant
114  *
115  * DescribeAll :: () → (a{s(bgav)})
116  *
117  *   Describes all actions in a single round-trip.
118  *
119  *   The dictionary maps action name strings to their descriptions
120  *   (in the format discussed above).
121  *
122  * Activate :: (sava{sv}) → ()
123  *
124  *   Requests activation of the named action.
125  *
126  *   The action is named by the first parameter (s).
127  *
128  *   If the action activation requires a parameter then this parameter
129  *   must be given in the second parameter (av). If there is no parameter
130  *   to be specified, the array must be empty.
131  *
132  *   The final parameter (a{sv}) is a list of "platform data".
133  *
134  *   This method is not guaranteed to have any particular effect. The
135  *   implementation may take some action (including changing the state
136  *   of the action, if it is stateful) or it may take none at all. In
137  *   particular, callers should expect their request to be completely
138  *   ignored when the enabled flag is false (but even this is not
139  *   guaranteed).
140  *
141  * SetState :: (sva{sv}) → ()
142  *
143  *   Requests the state of an action to be changed to the given value.
144  *
145  *   The action is named by the first parameter (s).
146  *
147  *   The requested new state is given in the second parameter (v).
148  *   It must be equal in type to the existing state.
149  *
150  *   The final parameter (a{sv}) is a list of "platform data".
151  *
152  *   This method is not guaranteed to have any particular effect.
153  *   The implementation of an action can choose to ignore the requested
154  *   state change, or choose to change its state to something else or
155  *   to trigger other side effects. In particular, callers should expect
156  *   their request to be completely ignored when the enabled flag is
157  *   false (but even this is not guaranteed).
158  *
159  * Signals
160  * -------
161  *
162  * Changed :: (asa{sb}a{sv}a{s(bgav)})
163  *
164  *   Signals that some change has occured to the action group.
165  *
166  *   Four separate types of changes are possible, and the 4 parameters
167  *   of the change signal reflect these possibilities:
168  *   as: a list of removed actions
169  *   a{sb}: a list of actions that had their enabled flag changed
170  *   a{sv}: a list of actions that had their state changed
171  *   a{s(bgav)}: a list of new actions added in the same format as
172  *               the return value of the DescribeAll method
173  */
174
175 /* Using XML saves us dozens of relocations vs. using the introspection
176  * structure types.  We only need to burn cycles and memory if we
177  * actually use the exporter -- not in every single app using GIO.
178  *
179  * It's also a lot easier to read. :)
180  */
181 const char org_gtk_Actions_xml[] =
182   "<node>"
183   "  <interface name='org.gtk.Actions'>"
184   "    <method name='List'>"
185   "      <arg type='as' name='list' direction='out'/>"
186   "    </method>"
187   "    <method name='Describe'>"
188   "      <arg type='s' name='action_name' direction='in'/>"
189   "      <arg type='(bgav)' name='description' direction='out'/>"
190   "    </method>"
191   "    <method name='DescribeAll'>"
192   "      <arg type='a{s(bgav)}' name='descriptions' direction='out'/>"
193   "    </method>"
194   "    <method name='Activate'>"
195   "      <arg type='s' name='action_name' direction='in'/>"
196   "      <arg type='av' name='parameter' direction='in'/>"
197   "      <arg type='a{sv}' name='platform_data' direction='in'/>"
198   "    </method>"
199   "    <method name='SetState'>"
200   "      <arg type='s' name='action_name' direction='in'/>"
201   "      <arg type='v' name='value' direction='in'/>"
202   "      <arg type='a{sv}' name='platform_data' direction='in'/>"
203   "    </method>"
204   "    <signal name='Changed'>"
205   "      <arg type='as' name='removals'/>"
206   "      <arg type='a{sb}' name='enable_changes'/>"
207   "      <arg type='a{sv}' name='state_changes'/>"
208   "      <arg type='a{s(bgav)}' name='additions'/>"
209   "    </signal>"
210   "  </interface>"
211   "</node>";
212
213 static GDBusInterfaceInfo *org_gtk_Actions;
214
215 typedef struct
216 {
217   GActionGroup    *action_group;
218   GDBusConnection *connection;
219   GMainContext    *context;
220   gchar           *object_path;
221   GHashTable      *pending_changes;
222   GSource         *pending_source;
223 } GActionGroupExporter;
224
225 #define ACTION_ADDED_EVENT             (1u<<0)
226 #define ACTION_REMOVED_EVENT           (1u<<1)
227 #define ACTION_STATE_CHANGED_EVENT     (1u<<2)
228 #define ACTION_ENABLED_CHANGED_EVENT   (1u<<3)
229
230 static gboolean
231 g_action_group_exporter_dispatch_events (gpointer user_data)
232 {
233   GActionGroupExporter *exporter = user_data;
234   GVariantBuilder removes;
235   GVariantBuilder enabled_changes;
236   GVariantBuilder state_changes;
237   GVariantBuilder adds;
238   GHashTableIter iter;
239   gpointer value;
240   gpointer key;
241
242   g_variant_builder_init (&removes, G_VARIANT_TYPE_STRING_ARRAY);
243   g_variant_builder_init (&enabled_changes, G_VARIANT_TYPE ("a{sb}"));
244   g_variant_builder_init (&state_changes, G_VARIANT_TYPE ("a{sv}"));
245   g_variant_builder_init (&adds, G_VARIANT_TYPE ("a{s(bgav)}"));
246
247   g_hash_table_iter_init (&iter, exporter->pending_changes);
248   while (g_hash_table_iter_next (&iter, &key, &value))
249     {
250       guint events = GPOINTER_TO_INT (value);
251       const gchar *name = key;
252
253       /* Adds and removes are incompatible with enabled or state
254        * changes, but we must report at least one event.
255        */
256       g_assert (((events & (ACTION_ENABLED_CHANGED_EVENT | ACTION_STATE_CHANGED_EVENT)) == 0) !=
257                 ((events & (ACTION_REMOVED_EVENT | ACTION_ADDED_EVENT)) == 0));
258
259       if (events & ACTION_REMOVED_EVENT)
260         g_variant_builder_add (&removes, "s", name);
261
262       if (events & ACTION_ENABLED_CHANGED_EVENT)
263         {
264           gboolean enabled;
265
266           enabled = g_action_group_get_action_enabled (exporter->action_group, name);
267           g_variant_builder_add (&enabled_changes, "{sb}", name, enabled);
268         }
269
270       if (events & ACTION_STATE_CHANGED_EVENT)
271         {
272           GVariant *state;
273
274           state = g_action_group_get_action_state (exporter->action_group, name);
275           g_variant_builder_add (&state_changes, "{sv}", name, state);
276           g_variant_unref (state);
277         }
278
279       if (events & ACTION_ADDED_EVENT)
280         {
281           GVariant *description;
282
283           description = g_action_group_describe_action (exporter->action_group, name);
284           g_variant_builder_add (&adds, "{s@(bgav)}", name, description);
285         }
286     }
287
288   g_hash_table_remove_all (exporter->pending_changes);
289
290   g_dbus_connection_emit_signal (exporter->connection, NULL, exporter->object_path,
291                                  "org.gtk.Actions", "Changed",
292                                  g_variant_new ("(asa{sb}a{sv}a{s(bgav)})",
293                                                 &removes, &enabled_changes,
294                                                 &state_changes, &adds),
295                                  NULL);
296
297   exporter->pending_source = NULL;
298
299   return FALSE;
300 }
301
302 static guint
303 g_action_group_exporter_get_events (GActionGroupExporter *exporter,
304                                     const gchar          *name)
305 {
306   return (gsize) g_hash_table_lookup (exporter->pending_changes, name);
307 }
308
309 static void
310 g_action_group_exporter_set_events (GActionGroupExporter *exporter,
311                                     const gchar          *name,
312                                     guint                 events)
313 {
314   gboolean have_events;
315   gboolean is_queued;
316
317   if (events != 0)
318     g_hash_table_insert (exporter->pending_changes, g_strdup (name), GINT_TO_POINTER (events));
319   else
320     g_hash_table_remove (exporter->pending_changes, name);
321
322   have_events = g_hash_table_size (exporter->pending_changes) > 0;
323   is_queued = exporter->pending_source != NULL;
324
325   if (have_events && !is_queued)
326     {
327       GSource *source;
328
329       source = g_idle_source_new ();
330       exporter->pending_source = source;
331       g_source_set_callback (source, g_action_group_exporter_dispatch_events, exporter, NULL);
332       g_source_attach (source, exporter->context);
333       g_source_unref (source);
334     }
335
336   if (!have_events && is_queued)
337     {
338       g_source_destroy (exporter->pending_source);
339       exporter->pending_source = NULL;
340     }
341 }
342
343 static void
344 g_action_group_exporter_action_added (GActionGroup *action_group,
345                                       const gchar  *action_name,
346                                       gpointer      user_data)
347 {
348   GActionGroupExporter *exporter = user_data;
349   guint event_mask;
350
351   event_mask = g_action_group_exporter_get_events (exporter, action_name);
352
353   /* The action is new, so we should not have any pending
354    * enabled-changed or state-changed signals for it.
355    */
356   g_assert (~event_mask & (ACTION_STATE_CHANGED_EVENT |
357                            ACTION_ENABLED_CHANGED_EVENT));
358
359   event_mask |= ACTION_ADDED_EVENT;
360
361   g_action_group_exporter_set_events (exporter, action_name, event_mask);
362 }
363
364 static void
365 g_action_group_exporter_action_removed (GActionGroup *action_group,
366                                         const gchar  *action_name,
367                                         gpointer      user_data)
368 {
369   GActionGroupExporter *exporter = user_data;
370   guint event_mask;
371
372   event_mask = g_action_group_exporter_get_events (exporter, action_name);
373
374   /* If the add event for this is still queued then just cancel it since
375    * it's gone now.
376    *
377    * If the event was freshly added, there should not have been any
378    * enabled or state changed events.
379    */
380   if (event_mask & ACTION_ADDED_EVENT)
381     {
382       g_assert (~event_mask & ~(ACTION_STATE_CHANGED_EVENT | ACTION_ENABLED_CHANGED_EVENT));
383       event_mask &= ~ACTION_ADDED_EVENT;
384     }
385
386   /* Otherwise, queue a remove event.  Drop any state or enabled changes
387    * that were queued before the remove. */
388   else
389     {
390       event_mask |= ACTION_REMOVED_EVENT;
391       event_mask &= ~(ACTION_STATE_CHANGED_EVENT | ACTION_ENABLED_CHANGED_EVENT);
392     }
393
394   g_action_group_exporter_set_events (exporter, action_name, event_mask);
395 }
396
397 static void
398 g_action_group_exporter_action_state_changed (GActionGroup *action_group,
399                                               const gchar  *action_name,
400                                               GVariant     *value,
401                                               gpointer      user_data)
402 {
403   GActionGroupExporter *exporter = user_data;
404   guint event_mask;
405
406   event_mask = g_action_group_exporter_get_events (exporter, action_name);
407
408   /* If it was removed, it must have been added back.  Otherwise, why
409    * are we hearing about changes?
410    */
411   g_assert (~event_mask & ACTION_REMOVED_EVENT ||
412             event_mask & ACTION_ADDED_EVENT);
413
414   /* If it is freshly added, don't also bother with the state change
415    * signal since the updated state will be sent as part of the pending
416    * add message.
417    */
418   if (~event_mask & ACTION_ADDED_EVENT)
419     event_mask |= ACTION_STATE_CHANGED_EVENT;
420
421   g_action_group_exporter_set_events (exporter, action_name, event_mask);
422 }
423
424 static void
425 g_action_group_exporter_action_enabled_changed (GActionGroup *action_group,
426                                                 const gchar  *action_name,
427                                                 gboolean      enabled,
428                                                 gpointer      user_data)
429 {
430   GActionGroupExporter *exporter = user_data;
431   guint event_mask;
432
433   event_mask = g_action_group_exporter_get_events (exporter, action_name);
434
435   /* Reasoning as above. */
436   g_assert (~event_mask & ACTION_REMOVED_EVENT ||
437             event_mask & ACTION_ADDED_EVENT);
438
439   if (~event_mask & ACTION_ADDED_EVENT)
440     event_mask |= ACTION_ENABLED_CHANGED_EVENT;
441
442   g_action_group_exporter_set_events (exporter, action_name, event_mask);
443 }
444
445 static void
446 g_action_group_exporter_pre_emit (GActionGroupExporter *exporter,
447                                   GVariant             *platform_data)
448 {
449   if (G_IS_APPLICATION (exporter->action_group))
450     G_APPLICATION_GET_CLASS (exporter->action_group)
451       ->before_emit (G_APPLICATION (exporter->action_group), platform_data);
452 }
453
454 static void
455 g_action_group_exporter_post_emit (GActionGroupExporter *exporter,
456                                    GVariant             *platform_data)
457 {
458   if (G_IS_APPLICATION (exporter->action_group))
459     G_APPLICATION_GET_CLASS (exporter->action_group)
460       ->after_emit (G_APPLICATION (exporter->action_group), platform_data);
461 }
462
463 static void
464 org_gtk_Actions_method_call (GDBusConnection       *connection,
465                              const gchar           *sender,
466                              const gchar           *object_path,
467                              const gchar           *interface_name,
468                              const gchar           *method_name,
469                              GVariant              *parameters,
470                              GDBusMethodInvocation *invocation,
471                              gpointer               user_data)
472 {
473   GActionGroupExporter *exporter = user_data;
474   GVariant *result = NULL;
475
476   if (g_str_equal (method_name, "List"))
477     {
478       gchar **list;
479
480       list = g_action_group_list_actions (exporter->action_group);
481       result = g_variant_new ("(^as)", list);
482       g_strfreev (list);
483     }
484
485   else if (g_str_equal (method_name, "Describe"))
486     {
487       const gchar *name;
488       GVariant *desc;
489
490       g_variant_get (parameters, "(&s)", &name);
491       desc = g_action_group_describe_action (exporter->action_group, name);
492       result = g_variant_new ("(@(bgav))", desc);
493     }
494
495   else if (g_str_equal (method_name, "DescribeAll"))
496     {
497       GVariantBuilder builder;
498       gchar **list;
499       gint i;
500
501       list = g_action_group_list_actions (exporter->action_group);
502       g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{s(bgav)}"));
503       for (i = 0; list[i]; i++)
504         {
505           const gchar *name = list[i];
506           GVariant *description;
507
508           description = g_action_group_describe_action (exporter->action_group, name);
509           g_variant_builder_add (&builder, "{s@(bgav)}", name, description);
510         }
511       result = g_variant_new ("(a{s(bgav)})", &builder);
512       g_strfreev (list);
513     }
514
515   else if (g_str_equal (method_name, "Activate"))
516     {
517       GVariant *parameter = NULL;
518       GVariant *platform_data;
519       GVariantIter *iter;
520       const gchar *name;
521
522       g_variant_get (parameters, "(&sav@a{sv})", &name, &iter, &platform_data);
523       g_variant_iter_next (iter, "v", &parameter);
524       g_variant_iter_free (iter);
525
526       g_action_group_exporter_pre_emit (exporter, platform_data);
527       g_action_group_activate_action (exporter->action_group, name, parameter);
528       g_action_group_exporter_post_emit (exporter, platform_data);
529
530       if (parameter)
531         g_variant_unref (parameter);
532
533       g_variant_unref (platform_data);
534     }
535
536   else if (g_str_equal (method_name, "SetState"))
537     {
538       GVariant *platform_data;
539       const gchar *name;
540       GVariant *state;
541
542       g_variant_get (parameters, "(&sv@a{sv})", &name, &state, &platform_data);
543       g_action_group_exporter_pre_emit (exporter, platform_data);
544       g_action_group_change_action_state (exporter->action_group, name, state);
545       g_action_group_exporter_post_emit (exporter, platform_data);
546       g_variant_unref (platform_data);
547       g_variant_unref (state);
548     }
549
550   else
551     g_assert_not_reached ();
552
553   g_dbus_method_invocation_return_value (invocation, result);
554 }
555
556 static void
557 g_action_group_exporter_free (gpointer user_data)
558 {
559   GActionGroupExporter *exporter = user_data;
560
561   g_signal_handlers_disconnect_by_func (exporter->action_group,
562                                         g_action_group_exporter_action_added, exporter);
563   g_signal_handlers_disconnect_by_func (exporter->action_group,
564                                         g_action_group_exporter_action_enabled_changed, exporter);
565   g_signal_handlers_disconnect_by_func (exporter->action_group,
566                                         g_action_group_exporter_action_state_changed, exporter);
567   g_signal_handlers_disconnect_by_func (exporter->action_group,
568                                         g_action_group_exporter_action_removed, exporter);
569
570   g_hash_table_unref (exporter->pending_changes);
571   if (exporter->pending_source)
572     g_source_destroy (exporter->pending_source);
573
574   g_main_context_unref (exporter->context);
575   g_object_unref (exporter->connection);
576   g_object_unref (exporter->action_group);
577   g_free (exporter->object_path);
578
579   g_slice_free (GActionGroupExporter, exporter);
580 }
581
582 /**
583  * g_dbus_connection_export_action_group:
584  * @connection: a #GDBusConnection
585  * @object_path: a D-Bus object path
586  * @action_group: a #GActionGroup
587  * @error: a pointer to a %NULL #GError, or %NULL
588  *
589  * Exports @action_group on @connection at @object_path.
590  *
591  * The implemented D-Bus API should be considered private.  It is
592  * subject to change in the future.
593  *
594  * A given object path can only have one action group exported on it.
595  * If this constraint is violated, the export will fail and 0 will be
596  * returned (with @error set accordingly).
597  *
598  * You can unexport the action group using
599  * g_dbus_connection_unexport_action_group() with the return value of
600  * this function.
601  *
602  * The thread default main context is taken at the time of this call.
603  * All incoming action activations and state change requests are
604  * reported from this context.  Any changes on the action group that
605  * cause it to emit signals must also come from this same context.
606  * Since incoming action activations and state change requests are
607  * rather likely to cause changes on the action group, this effectively
608  * limits a given action group to being exported from only one main
609  * context.
610  *
611  * Returns: the ID of the export (never zero), or 0 in case of failure
612  *
613  * Since: 2.32
614  **/
615 guint
616 g_dbus_connection_export_action_group (GDBusConnection  *connection,
617                                        const gchar      *object_path,
618                                        GActionGroup     *action_group,
619                                        GError          **error)
620 {
621   const GDBusInterfaceVTable vtable = {
622     org_gtk_Actions_method_call
623   };
624   GActionGroupExporter *exporter;
625   guint id;
626
627   if G_UNLIKELY (org_gtk_Actions == NULL)
628     {
629       GError *error = NULL;
630       GDBusNodeInfo *info;
631
632       info = g_dbus_node_info_new_for_xml (org_gtk_Actions_xml, &error);
633       if G_UNLIKELY (info == NULL)
634         g_error ("%s", error->message);
635       org_gtk_Actions = g_dbus_node_info_lookup_interface (info, "org.gtk.Actions");
636       g_assert (org_gtk_Actions != NULL);
637       g_dbus_interface_info_ref (org_gtk_Actions);
638       g_dbus_node_info_unref (info);
639     }
640
641   exporter = g_slice_new (GActionGroupExporter);
642   id = g_dbus_connection_register_object (connection, object_path, org_gtk_Actions, &vtable,
643                                           exporter, g_action_group_exporter_free, error);
644
645   if (id == 0)
646     {
647       g_slice_free (GActionGroupExporter, exporter);
648       return 0;
649     }
650
651   exporter->context = g_main_context_ref_thread_default ();
652   exporter->pending_changes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
653   exporter->pending_source = NULL;
654   exporter->action_group = g_object_ref (action_group);
655   exporter->connection = g_object_ref (connection);
656   exporter->object_path = g_strdup (object_path);
657
658   g_signal_connect (action_group, "action-added",
659                     G_CALLBACK (g_action_group_exporter_action_added), exporter);
660   g_signal_connect (action_group, "action-removed",
661                     G_CALLBACK (g_action_group_exporter_action_removed), exporter);
662   g_signal_connect (action_group, "action-state-changed",
663                     G_CALLBACK (g_action_group_exporter_action_state_changed), exporter);
664   g_signal_connect (action_group, "action-enabled-changed",
665                     G_CALLBACK (g_action_group_exporter_action_enabled_changed), exporter);
666
667   return id;
668 }
669
670 /**
671  * g_dbus_connection_unexport_action_group:
672  * @connection: a #GDBusConnection
673  * @export_id: the ID from g_dbus_connection_export_action_group()
674  *
675  * Reverses the effect of a previous call to
676  * g_dbus_connection_export_action_group().
677  *
678  * It is an error to call this function with an ID that wasn't returned
679  * from g_dbus_connection_export_action_group() or to call it with the
680  * same ID more than once.
681  *
682  * Since: 2.32
683  **/
684 void
685 g_dbus_connection_unexport_action_group (GDBusConnection *connection,
686                                          guint            export_id)
687 {
688   g_dbus_connection_unregister_object (connection, export_id);
689 }