menu/action exporter docs fixup

This commit is contained in:
Ryan Lortie 2011-12-02 16:50:09 -05:00
parent 46e3dca2e4
commit 4f2c207745
5 changed files with 55 additions and 33 deletions

View File

@ -2911,9 +2911,8 @@ G_ACTION_GROUP
<SECTION> <SECTION>
<FILE>gactiongroupexporter</FILE> <FILE>gactiongroupexporter</FILE>
g_action_group_dbus_export_start g_dbus_connection_export_action_group
g_action_group_dbus_export_stop g_dbus_connection_unexport_action_group
g_action_group_dbus_export_query
</SECTION> </SECTION>
<SECTION> <SECTION>
@ -3567,9 +3566,8 @@ G_NETWORK_MONITOR_GET_INTERFACE
<SECTION> <SECTION>
<FILE>gmenuexporter</FILE> <FILE>gmenuexporter</FILE>
g_menu_model_dbus_export_start g_dbus_connection_export_menu_model
g_menu_model_dbus_export_stop g_dbus_connection_unexport_menu_model
g_menu_model_dbus_export_query
</SECTION> </SECTION>
<SECTION> <SECTION>

View File

@ -561,7 +561,7 @@ g_action_group_exporter_free (gpointer user_data)
} }
/** /**
* g_action_group_dbus_export_start: * g_dbus_connection_export_action_group:
* @connection: a #GDBusConnection * @connection: a #GDBusConnection
* @object_path: a D-Bus object path * @object_path: a D-Bus object path
* @action_group: a #GActionGroup * @action_group: a #GActionGroup
@ -572,17 +572,17 @@ g_action_group_exporter_free (gpointer user_data)
* The implemented D-Bus API should be considered private. It is * The implemented D-Bus API should be considered private. It is
* subject to change in the future. * subject to change in the future.
* *
* A given action group can only be exported on one object path and an * A given * object path can only have one action group exported on it.
* object path can only have one action group exported on it. If either * If this constraint is violated, the export will fail and 0 will be
* constraint is violated, the export will fail and %FALSE will be
* returned (with @error set accordingly). * returned (with @error set accordingly).
* *
* Use g_action_group_dbus_export_stop() to stop exporting @action_group, * You can unexport the action group using
* or g_action_group_dbus_export_query() to find out if and where a given * g_dbus_connection_unexport_action_group() with the return value of
* action group is exported. * this function.
* *
* Returns: %TRUE if the export is successful, or %FALSE (with @error * Returns: the ID of the export (never zero), or 0 in case of failure
* set) in the event of a failure. *
* Since: 2.32
**/ **/
guint guint
g_dbus_connection_export_action_group (GDBusConnection *connection, g_dbus_connection_export_action_group (GDBusConnection *connection,
@ -642,9 +642,23 @@ g_dbus_connection_export_action_group (GDBusConnection *connection,
return id; return id;
} }
gboolean /**
* g_dbus_connection_unexport_action_group:
* @connection: a #GDBusConnection
* @export_id: the ID from g_dbus_connection_export_action_group()
*
* Reverses the effect of a previous call to
* g_dbus_connection_export_action_group().
*
* It is an error to call this function with an ID that wasn't returned
* from g_dbus_connection_export_action_group() or to call it with the
* same ID more than once.
*
* Since: 2.32
**/
void
g_dbus_connection_unexport_action_group (GDBusConnection *connection, g_dbus_connection_unexport_action_group (GDBusConnection *connection,
guint export_id) guint export_id)
{ {
return g_dbus_connection_unregister_object (connection, export_id); g_dbus_connection_unregister_object (connection, export_id);
} }

View File

@ -37,7 +37,7 @@ guint g_dbus_connection_export_action_group (GDBusCo
GActionGroup *action_group, GActionGroup *action_group,
GError **error); GError **error);
gboolean g_dbus_connection_unexport_action_group (GDBusConnection *connection, void g_dbus_connection_unexport_action_group (GDBusConnection *connection,
guint export_id); guint export_id);
G_END_DECLS G_END_DECLS

View File

@ -832,7 +832,7 @@ g_menu_exporter_method_call (GDBusConnection *connection,
/* {{{1 Public API */ /* {{{1 Public API */
/** /**
* g_menu_model_dbus_export_start: * g_dbus_connection_export_menu_model:
* @connection: a #GDBusConnection * @connection: a #GDBusConnection
* @object_path: a D-Bus object path * @object_path: a D-Bus object path
* @menu: a #GMenuModel * @menu: a #GMenuModel
@ -843,17 +843,15 @@ g_menu_exporter_method_call (GDBusConnection *connection,
* The implemented D-Bus API should be considered private. * The implemented D-Bus API should be considered private.
* It is subject to change in the future. * It is subject to change in the future.
* *
* A given menu model can only be exported on one object path * An object path can only have one action group exported on it. If this
* and an object path can only have one action group exported * constraint is violated, the export will fail and 0 will be
* on it. If either constraint is violated, the export will * returned (with @error set accordingly).
* fail and %FALSE will be returned (with @error set accordingly).
* *
* Use g_menu_model_dbus_export_stop() to stop exporting @menu * You can unexport the menu model using
* or g_menu_model_dbus_export_query() to find out if and where * g_dbus_connection_unexport_menu_model() with the return value of
* a given menu model is exported. * this function.
* *
* Returns: %TRUE if the export is successful, or %FALSE (with * Returns: the ID of the export (never zero), or 0 in case of failure
* @error set) in the event of a failure.
*/ */
guint guint
g_dbus_connection_export_menu_model (GDBusConnection *connection, g_dbus_connection_export_menu_model (GDBusConnection *connection,
@ -887,18 +885,30 @@ g_dbus_connection_export_menu_model (GDBusConnection *connection,
return id; return id;
} }
gboolean /**
* g_dbus_connection_unexport_menu_model:
* @connection: a #GDBusConnection
* @export_id: the ID from g_dbus_connection_export_menu_model()
*
* Reverses the effect of a previous call to
* g_dbus_connection_export_menu_model().
*
* It is an error to call this function with an ID that wasn't returned
* from g_dbus_connection_export_menu_model() or to call it with the
* same ID more than once.
*
* Since: 2.32
**/
void
g_dbus_connection_unexport_menu_model (GDBusConnection *connection, g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
guint export_id) guint export_id)
{ {
if (!g_dbus_connection_unregister_object (connection, export_id)) if (!g_dbus_connection_unregister_object (connection, export_id))
return FALSE; return;
g_assert (g_menu_exporter_to_free != NULL); g_assert (g_menu_exporter_to_free != NULL);
g_menu_exporter_actually_free (g_menu_exporter_to_free); g_menu_exporter_actually_free (g_menu_exporter_to_free);
g_menu_exporter_to_free = NULL; g_menu_exporter_to_free = NULL;
return TRUE;
} }
/* {{{1 Epilogue */ /* {{{1 Epilogue */

View File

@ -32,7 +32,7 @@ guint g_dbus_connection_export_menu_model (GDBusCo
GMenuModel *menu, GMenuModel *menu,
GError **error); GError **error);
gboolean g_dbus_connection_unexport_menu_model (GDBusConnection *connection, void g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
guint export_id); guint export_id);
G_END_DECLS G_END_DECLS