Rename exporter APIs
authorMatthias Clasen <mclasen@redhat.com>
Sun, 27 Nov 2011 04:21:12 +0000 (23:21 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 8 Dec 2011 23:05:12 +0000 (18:05 -0500)
There are no public 'exporter' objects, so don't allude to them
in the function names. At the same time, we want to make it clear
that these functions are D-Bus specific.

The new APIs are
g_action_group_dbus_export_start
g_action_group_dbus_export_query
g_action_group_dbus_export_stop
g_menu_model_dbus_export_start
g_menu_model_dbus_export_query
g_menu_model_dbus_export_stop

docs/reference/gio/gio-sections.txt
gio/gactiongroupexporter.c
gio/gactiongroupexporter.h
gio/gapplicationimpl-dbus.c
gio/gdbusactiongroup.c
gio/gio.symbols
gio/gmenuexporter.c
gio/gmenuexporter.h
gio/gmenuproxy.c
gio/tests/gmenumodel.c

index 0996b501b415ea7cd448235e8e68a8d39375b090..5f2ddf676b48ff3283bc99581054ef7299047c7f 100644 (file)
@@ -2909,9 +2909,9 @@ G_ACTION_GROUP
 
 <SECTION>
 <FILE>gactiongroupexporter</FILE>
-g_action_group_exporter_export
-g_action_group_exporter_stop
-g_action_group_exporter_query
+g_action_group_dbus_export_start
+g_action_group_dbus_export_stop
+g_action_group_dbus_export_query
 </SECTION>
 
 <SECTION>
@@ -3545,9 +3545,9 @@ G_NETWORK_MONITOR_GET_INTERFACE
 
 <SECTION>
 <FILE>gmenuexporter</FILE>
-g_menu_exporter_export
-g_menu_exporter_stop
-g_menu_exporter_query
+g_menu_model_dbus_export_start
+g_menu_model_dbus_export_stop
+g_menu_model_dbus_export_query
 </SECTION>
 
 <SECTION>
index a7c353ec3d35f1e9d1724fe82ee14cee7c6333ad..2287323c0afbaf8a04229bfd4f8e58ad389b874c 100644 (file)
@@ -455,7 +455,7 @@ org_gtk_Actions_method_call (GDBusConnection       *connection,
 }
 
 /**
- * g_action_group_exporter_export:
+ * g_action_group_dbus_export_start:
  * @connection: a #GDBusConnection
  * @object_path: a D-Bus object path
  * @action_group: a #GActionGroup
@@ -467,22 +467,22 @@ org_gtk_Actions_method_call (GDBusConnection       *connection,
  * subject to change in the future.
  *
  * A given action group can only be exported on one object path and an
- * object_path can only have one action group exported on it.  If either
+ * object path can only have one action group exported on it. If either
  * constraint is violated, the export will fail and %FALSE will be
  * returned (with @error set accordingly).
  *
- * Use g_action_group_exporter_stop() to stop exporting @action_group,
- * or g_action_group_exporter_query() to find out if and where a given
+ * Use g_action_group_dbus_export_stop() to stop exporting @action_group,
+ * or g_action_group_dbus_export_query() to find out if and where a given
  * action group is exported.
  *
  * Returns: %TRUE if the export is successful, or %FALSE (with @error
  *          set) in the event of a failure.
  **/
 gboolean
-g_action_group_exporter_export (GDBusConnection  *connection,
-                                const gchar      *object_path,
-                                GActionGroup     *action_group,
-                                GError          **error)
+g_action_group_dbus_export_start (GDBusConnection  *connection,
+                                  const gchar      *object_path,
+                                  GActionGroup     *action_group,
+                                  GError          **error)
 {
   const GDBusInterfaceVTable vtable = {
     org_gtk_Actions_method_call
@@ -547,19 +547,19 @@ g_action_group_exporter_export (GDBusConnection  *connection,
 }
 
 /**
- * g_action_group_exporter_stop:
+ * g_action_group_dbus_export_stop:
  * @action_group: a #GActionGroup
  *
  * Stops the export of @action_group.
  *
  * This reverses the effect of a previous call to
- * g_action_group_exporter_export() for @action_group.
+ * g_action_group_dbus_export_start() for @action_group.
  *
  * Returns: %TRUE if an export was stopped or %FALSE if @action_group
  *          was not exported in the first place
  **/
 gboolean
-g_action_group_exporter_stop (GActionGroup *action_group)
+g_action_group_dbus_export_stop (GActionGroup *action_group)
 {
   GActionGroupExporter *exporter;
   gint i;
@@ -584,7 +584,7 @@ g_action_group_exporter_stop (GActionGroup *action_group)
 }
 
 /**
- * g_action_group_exporter_query:
+ * g_action_group_dbus_export_query:
  * @action_group: a #GActionGroup
  * @connection: (out): the #GDBusConnection used for exporting
  * @object_path: (out): the object path used for exporting
@@ -601,9 +601,9 @@ g_action_group_exporter_stop (GActionGroup *action_group)
  * Returns: %TRUE if @action_group was exported, else %FALSE
  **/
 gboolean
-g_action_group_exporter_query (GActionGroup     *action_group,
-                               GDBusConnection **connection,
-                               const gchar     **object_path)
+g_action_group_dbus_export_query (GActionGroup     *action_group,
+                                  GDBusConnection **connection,
+                                  const gchar     **object_path)
 {
   GActionGroupExporter *exporter;
 
index 8307dd16a2814232f378b2a6f130bcd9f2551cca..6493e3954bafdbb40db159973dcd7ba1cdfabf28 100644 (file)
 
 G_BEGIN_DECLS
 
-gboolean                g_action_group_exporter_export                  (GDBusConnection  *connection,
-                                                                         const gchar      *object_path,
-                                                                         GActionGroup     *action_group,
-                                                                         GError          **error);
+gboolean g_action_group_dbus_export_start (GDBusConnection  *connection,
+                                           const gchar      *object_path,
+                                           GActionGroup     *action_group,
+                                           GError          **error);
 
-gboolean                g_action_group_exporter_stop                    (GActionGroup     *action_group);
+gboolean g_action_group_dbus_export_stop  (GActionGroup     *action_group);
 
-gboolean                g_action_group_exporter_query                   (GActionGroup     *action_group,
-                                                                         GDBusConnection **connection,
-                                                                         const gchar     **object_path);
+gboolean g_action_group_dbus_export_query (GActionGroup     *action_group,
+                                           GDBusConnection **connection,
+                                           const gchar     **object_path);
 
 G_END_DECLS
 
index 27cd39cd4e7900416110a4a8b1893821d848c65a..0046534fb30aae276b022b593f64516514dd5195 100644 (file)
@@ -239,9 +239,9 @@ g_application_impl_destroy (GApplicationImpl *impl)
         g_dbus_connection_unregister_object (impl->session_bus,
                                              impl->object_id);
       if (impl->actions_exported)
-        g_action_group_exporter_stop (impl->app);
+        g_action_group_dbus_export_stop (impl->app);
       if (impl->menu_exported)
-        g_menu_exporter_stop (g_application_get_menu (impl->app));
+        g_menu_model_dbus_export_stop (g_application_get_menu (impl->app));
 
       g_dbus_connection_call (impl->session_bus,
                               "org.freedesktop.DBus",
@@ -324,9 +324,9 @@ g_application_impl_register (GApplication       *application,
           return NULL;
         }
 
-      if (!g_action_group_exporter_export (impl->session_bus,
-                                           impl->object_path,
-                                           impl->app, error))
+      if (!g_action_group_dbus_export_start (impl->session_bus,
+                                             impl->object_path,
+                                             impl->app, error))
         {
           g_dbus_connection_unregister_object (impl->session_bus,
                                                impl->object_id);
@@ -343,12 +343,12 @@ g_application_impl_register (GApplication       *application,
 
       if (g_application_get_menu (impl->app))
         {
-          if (!g_menu_exporter_export (impl->session_bus,
-                                       impl->object_path,
-                                       g_application_get_menu (impl->app),
-                                       error))
+          if (!g_menu_model_dbus_export_start (impl->session_bus,
+                                               impl->object_path,
+                                               g_application_get_menu (impl->app),
+                                               error))
             {
-              g_action_group_exporter_stop (impl->app);
+              g_action_group_dbus_export_stop (impl->app);
               impl->actions_exported = FALSE;
 
               g_dbus_connection_unregister_object (impl->session_bus,
@@ -383,12 +383,12 @@ g_application_impl_register (GApplication       *application,
                                                impl->object_id);
           impl->object_id = 0;
 
-          g_action_group_exporter_stop (impl->app);
+          g_action_group_dbus_export_stop (impl->app);
           impl->actions_exported = FALSE;
 
           if (impl->menu_exported)
             {
-              g_menu_exporter_stop (g_application_get_menu (impl->app));
+              g_menu_model_dbus_export_stop (g_application_get_menu (impl->app));
               impl->menu_exported = FALSE;
             }
 
@@ -424,11 +424,11 @@ g_application_impl_register (GApplication       *application,
       g_dbus_connection_unregister_object (impl->session_bus,
                                            impl->object_id);
       impl->object_id = 0;
-      g_action_group_exporter_stop (impl->app);
+      g_action_group_dbus_export_stop (impl->app);
       impl->actions_exported = FALSE;
       if (impl->menu_exported)
         {
-          g_menu_exporter_stop (g_application_get_menu (impl->app));
+          g_menu_model_dbus_export_stop (g_application_get_menu (impl->app));
           impl->menu_exported = FALSE;
         }
 
index bb05ebedab2bfe52fd5c45d6aa3746cebb167fc0..b0e1116670cc3efbaf5c968fa836b96d7eafb725 100644 (file)
@@ -37,7 +37,7 @@
  *
  * #GDBusActionGroup is an implementation of the #GActionGroup
  * interface that can be used as a proxy for an action group
- * that is exported over D-Bus with g_action_group_exporter_export().
+ * that is exported over D-Bus with g_action_group_dbus_export_start().
  */
 
 struct _GDBusActionGroup
index 76f6b606c0f23b0c7555de093ab5fcffbebeb082..94a25521070138bbaeffb90818de7ede0ef092bf 100644 (file)
@@ -1413,9 +1413,9 @@ g_action_group_has_action
 g_action_group_list_actions
 g_action_group_query_action
 g_action_group_change_action_state
-g_action_group_exporter_export
-g_action_group_exporter_query
-g_action_group_exporter_stop
+g_action_group_dbus_export_start
+g_action_group_dbus_export_query
+g_action_group_dbus_export_stop
 g_action_activate
 g_action_get_enabled
 g_action_get_name
@@ -1615,9 +1615,9 @@ g_menu_attribute_iter_get_next
 g_menu_attribute_iter_get_type
 g_menu_attribute_iter_get_value
 g_menu_attribute_iter_next
-g_menu_exporter_export
-g_menu_exporter_query
-g_menu_exporter_stop
+g_menu_model_dbus_export_start
+g_menu_model_dbus_export_query
+g_menu_model_dbus_export_stop
 g_menu_freeze
 g_menu_get_type
 g_menu_insert
index e0fb4cab727892b2864177df35bf4297e545c9fc..0f173c507c2a1c296109458982b24ffb447a76f4 100644 (file)
@@ -759,7 +759,7 @@ g_menu_exporter_new (GDBusConnection  *connection,
 static GHashTable *g_menu_exporter_exported_menus;
 
 /**
- * g_menu_exporter_export:
+ * g_menu_model_dbus_export_start:
  * @connection: a #GDBusConnection
  * @object_path: a D-Bus object path
  * @menu: a #GMenuModel
@@ -771,22 +771,22 @@ static GHashTable *g_menu_exporter_exported_menus;
  * It is subject to change in the future.
  *
  * A given menu model can only be exported on one object path
- * and an object_path can only have one action group exported
- * on it.  If either constraint is violated, the export will
+ * and an object path can only have one action group exported
+ * on it. If either constraint is violated, the export will
  * fail and %FALSE will be returned (with @error set accordingly).
  *
- * Use g_menu_exporter_stop() to stop exporting @menu
- * or g_menu_exporter_query() to find out if and where a given
- * menu model is exported.
+ * Use g_menu_model_dbus_export_stop() to stop exporting @menu
+ * or g_menu_model_dbus_export_query() to find out if and where
+ * a given menu model is exported.
  *
  * Returns: %TRUE if the export is successful, or %FALSE (with
  *     @error set) in the event of a failure.
  */
 gboolean
-g_menu_exporter_export (GDBusConnection  *connection,
-                        const gchar      *object_path,
-                        GMenuModel       *menu,
-                        GError          **error)
+g_menu_model_dbus_export_start (GDBusConnection  *connection,
+                                const gchar      *object_path,
+                                GMenuModel       *menu,
+                                GError          **error)
 {
   GMenuExporter *exporter;
 
@@ -810,19 +810,19 @@ g_menu_exporter_export (GDBusConnection  *connection,
 }
 
 /**
- * g_menu_exporter_stop:
+ * g_menu_model_dbus_export_stop:
  * @menu: a #GMenuModel
  *
  * Stops the export of @menu.
  *
  * This reverses the effect of a previous call to
- * g_menu_exporter_export() for @menu.
+ * g_menu_model_dbus_export_start() for @menu.
  *
  * Returns: %TRUE if an export was stopped or %FALSE
  *     if @menu was not exported in the first place
  */
 gboolean
-g_menu_exporter_stop (GMenuModel *menu)
+g_menu_model_dbus_export_stop (GMenuModel *menu)
 {
   GMenuExporter *exporter;
 
@@ -840,7 +840,7 @@ g_menu_exporter_stop (GMenuModel *menu)
 }
 
 /**
- * g_menu_exporter_query:
+ * g_menu_model_dbus_export_query:
  * @menu: a #GMenuModel
  * @connection: (out): the #GDBusConnection used for exporting
  * @object_path: (out): the object path used for exporting
@@ -858,9 +858,9 @@ g_menu_exporter_stop (GMenuModel *menu)
  * Returns: %TRUE if @menu was exported, else %FALSE
  */
 gboolean
-g_menu_exporter_query (GMenuModel       *menu,
-                       GDBusConnection **connection,
-                       const gchar     **object_path)
+g_menu_model_dbus_export_query (GMenuModel       *menu,
+                                GDBusConnection **connection,
+                                const gchar     **object_path)
 {
   GMenuExporter *exporter;
 
index 602bf31ff3ffbf7be26ec525889a2b681b3c222a..5d07185d9f921c678c181d3ef436a5baf78a9551 100644 (file)
 
 G_BEGIN_DECLS
 
-gboolean        g_menu_exporter_export          (GDBusConnection  *connection,
-                                                 const gchar      *object_path,
-                                                 GMenuModel       *menu,
-                                                 GError          **error);
+gboolean g_menu_model_dbus_export_start (GDBusConnection  *connection,
+                                         const gchar      *object_path,
+                                         GMenuModel       *menu,
+                                         GError          **error);
 
-gboolean        g_menu_exporter_stop            (GMenuModel       *menu);
+gboolean g_menu_model_dbus_export_stop  (GMenuModel       *menu);
 
-
-
-gboolean        g_menu_exporter_query           (GMenuModel       *menu,
-                                                 GDBusConnection **connection,
-                                                 const gchar     **object_path);
+gboolean g_menu_model_dbus_export_query (GMenuModel       *menu,
+                                         GDBusConnection **connection,
+                                         const gchar     **object_path);
 
 G_END_DECLS
 
index 3e4f1a4873b4f4a67676caf9a77e23fb4f2e5d66..547957f18f8725eef69cd4873738d1176e9faeb0 100644 (file)
@@ -33,7 +33,7 @@
  *
  * #GMenuProxy is an implementation of #GMenuModel that can be used
  * as a proxy for a menu model that is exported over D-Bus with
- * g_menu_exporter_export().
+ * g_menu_model_dbus_export_start().
  */
 
 /*
index b5825f2a1ea9b6440ac029387372a2e675794bfe..afc5c7980da52e12a0cba7c38660bbd4858ce347 100644 (file)
@@ -590,7 +590,7 @@ test_roundtrip (void)
   state.rand = g_rand_new_with_seed (g_test_rand_int ());
 
   state.random = random_menu_new (state.rand, TOP_ORDER);
-  g_menu_exporter_export (bus, "/", G_MENU_MODEL (state.random), NULL);
+  g_menu_model_dbus_export_start (bus, "/", G_MENU_MODEL (state.random), NULL);
   state.proxy = g_menu_proxy_get (bus, g_dbus_connection_get_unique_name (bus), "/");
   state.count = 0;
   state.success = 0;
@@ -602,7 +602,7 @@ test_roundtrip (void)
 
   g_main_loop_unref (state.loop);
   g_object_unref (state.proxy);
-  g_menu_exporter_stop (G_MENU_MODEL (state.random));
+  g_menu_model_dbus_export_stop (G_MENU_MODEL (state.random));
   g_object_unref (state.random);
   g_rand_free (state.rand);
   g_object_unref (bus);