[nautilus-actions] Reference manual: fix D-Bus Services documentation
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Reference manual: fix D-Bus Services documentation
- Date: Sat, 11 Dec 2010 12:05:35 +0000 (UTC)
commit 5c3b8e6d1316ae0e050eb2d04097b285d813edc9
Author: Pierre Wieser <pwieser trychlos org>
Date: Sat Dec 11 13:06:30 2010 +0100
Reference manual: fix D-Bus Services documentation
ChangeLog | 12 +++
docs/reference/nautilus-actions-docs.xml | 2 +-
docs/reference/nautilus-actions-sections.txt | 17 +++--
src/api/na-dbus.h | 97 ++++++++++++++++++++++++--
src/plugin-tracker/na-tracker-dbus.h | 3 -
src/plugin-tracker/na-tracker.c | 2 +-
src/utils/nautilus-actions-run.c | 7 +-
tools/dbus-introspect.sh | 10 ++--
8 files changed, 123 insertions(+), 27 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e225b0c..f26d90f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-11 Pierre Wieser <pwieser trychlos org>
+
+ Fix D-Bus Services documentation.
+
+ * docs/reference/nautilus-actions-docs.xml:
+ * docs/reference/nautilus-actions-sections.txt:
+ * src/api/na-dbus.h:
+ * src/plugin-tracker/na-tracker-dbus.h:
+ * src/plugin-tracker/na-tracker.c:
+ * src/utils/nautilus-actions-run.c:
+ * tools/dbus-introspect.sh: Updated accordingly.
+
2010-12-10 Pierre Wieser <pwieser trychlos org>
Fix Data Factory Management System documentation.
diff --git a/docs/reference/nautilus-actions-docs.xml b/docs/reference/nautilus-actions-docs.xml
index 99159d4..de42886 100644
--- a/docs/reference/nautilus-actions-docs.xml
+++ b/docs/reference/nautilus-actions-docs.xml
@@ -53,7 +53,7 @@
</chapter>
<chapter>
- <title>DBus services (nautilus-actions-api.xml title)</title>
+ <title>DBus services</title>
<xi:include href="xml/dbus.xml" />
</chapter>
diff --git a/docs/reference/nautilus-actions-sections.txt b/docs/reference/nautilus-actions-sections.txt
index 779bf9e..6126a06 100644
--- a/docs/reference/nautilus-actions-sections.txt
+++ b/docs/reference/nautilus-actions-sections.txt
@@ -85,6 +85,16 @@ NAIExporterInterfacePrivate
</SECTION>
# ---------------------------------------------------------------------
+# D-Bus â?? The D-Bus Services
+
+<SECTION>
+<FILE>dbus</FILE>
+NAUTILUS_ACTIONS_DBUS_SERVICE
+NAUTILUS_ACTIONS_DBUS_TRACKER_PATH
+NAUTILUS_ACTIONS_DBUS_TRACKER_INTERFACE
+</SECTION>
+
+# ---------------------------------------------------------------------
# NAIFactoryProvider â?? The Data Factory Provider Interface v 1
<SECTION>
@@ -158,6 +168,7 @@ na_data_boxed_get_type
NA_DATA_BOXED_CLASS
NA_IS_DATA_BOXED_CLASS
NA_DATA_BOXED_GET_CLASS
+NADataBoxedClass
<SUBSECTION Private>
NADataBoxedPrivate
@@ -250,12 +261,6 @@ NAFO_DATA_CAPABILITITES
# ---------------------------------------------------------------------
<SECTION>
-<FILE>dbus</FILE>
-<TITLE>DBus (nautilus-actions-sections title)</TITLE>
-NAUTILUS_ACTIONS_DBUS_SERVICE
-</SECTION>
-
-<SECTION>
<FILE>object</FILE>
<TITLE>NAObject</TITLE>
NA_OBJECT_TYPE
diff --git a/src/api/na-dbus.h b/src/api/na-dbus.h
index da73129..d003feb 100644
--- a/src/api/na-dbus.h
+++ b/src/api/na-dbus.h
@@ -33,21 +33,104 @@
/**
* SECTION: dbus
- * @section_id: dbus
- * @title: DBus interface (na-dbus.h title)
- * @short_description: DBus interface (na-dbus.h short description)
+ * @title: D-Bus
+ * @short_description: The D-Bus Services
* @include: nautilus-actions/na-dbus.h
*
- * Nautilus-Actions, through its Tracker plugin, exposes several DBus interfaces.
- * These interfaces may be queried in order to get informations about current
- * selection, Nautilus-Actions status, and so on.
+ * &prodname;, through its <emphasis>tracker</emphasis> plugin, exposes
+ * several D-Bus interfaces. These interfaces may be queried in order to get
+ * informations about current selection, &prodname; status, and so on.
+ *
+ * <note>
+ * <para>
+ * To be really clear, &prodname; relies on &nautilus; being
+ * run at the startup of the session, in order to be able to register
+ * its own D-Bus services via the <emphasis>tracker</emphasis> plugin.
+ * </para>
+ * <para>
+ * If &nautilus; is not run at the startup of the session, or the
+ * <emphasis>tracker</emphasis> plugin is not loaded at &nautilus; startup,
+ * then these D-Bus services will not be available.
+ * </para>
+ * </note>
*/
#include <glib.h>
G_BEGIN_DECLS
-#define NAUTILUS_ACTIONS_DBUS_SERVICE "org.nautilus-actions.DBus"
+/**
+ * NAUTILUS_ACTIONS_DBUS_SERVICE:
+ *
+ * This is the name that &prodname; reserves on D-Bus session bus.
+ */
+#define NAUTILUS_ACTIONS_DBUS_SERVICE "org.nautilus-actions.DBus"
+
+/**
+ * NAUTILUS_ACTIONS_DBUS_TRACKER_PATH:
+ *
+ * The D-Bus path of the <emphasis>tracker</emphasis> object.
+ *
+ * When requested through the <methodname>Introspect</methodname> of the
+ * <interfacename>Introspectable</interfacename> D-Bus interface, the
+ * <emphasis>tracker</emphasis> object returns following informations:
+ *
+ * <programlisting>
+ * <command>
+ * dbus-send \
+ * --session \
+ * --type=method_call \
+ * --print-reply \
+ * --dest=org.nautilus-actions.DBus \
+ * /org/nautilus_actions/DBus/Tracker \
+ * org.freedesktop.DBus.Introspectable.Introspect
+ * </command>
+ * <computeroutput>
+ * <![CDATA[
+ * method return sender=:1.29 -> dest=:1.145 reply_serial=2
+ * string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ * "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+ * <node>
+ * <interface name="org.freedesktop.DBus.Introspectable">
+ * <method name="Introspect">
+ * <arg name="data" direction="out" type="s"/>
+ * </method>
+ * </interface>
+ * <interface name="org.freedesktop.DBus.Properties">
+ * <method name="Get">
+ * <arg name="interface" direction="in" type="s"/>
+ * <arg name="propname" direction="in" type="s"/>
+ * <arg name="value" direction="out" type="v"/>
+ * </method>
+ * <method name="Set">
+ * <arg name="interface" direction="in" type="s"/>
+ * <arg name="propname" direction="in" type="s"/>
+ * <arg name="value" direction="in" type="v"/>
+ * </method>
+ * <method name="GetAll">
+ * <arg name="interface" direction="in" type="s"/>
+ * <arg name="props" direction="out" type="a{sv}"/>
+ * </method>
+ * </interface>
+ * <interface name="org.nautilus_actions.DBus.Tracker.Status">
+ * <method name="GetSelectedPaths">
+ * <arg name="paths" type="as" direction="out"/>
+ * </method>
+ * </interface>
+ * </node>
+ * ]]>
+ * </computeroutput>
+ * </programlisting>
+ */
+#define NAUTILUS_ACTIONS_DBUS_TRACKER_PATH "/org/nautilus_actions/DBus/Tracker"
+
+/**
+ * NAUTILUS_ACTIONS_DBUS_TRACKER_INTERFACE:
+ *
+ * An interface defined on the <emphasis>tracker</emphasis> object,
+ * identified by its %NAUTILUS_ACTIONS_DBUS_TRACKER_PATH D-Bus path.
+ */
+#define NAUTILUS_ACTIONS_DBUS_TRACKER_INTERFACE "org.nautilus_actions.DBus.Tracker.Status"
G_END_DECLS
diff --git a/src/plugin-tracker/na-tracker-dbus.h b/src/plugin-tracker/na-tracker-dbus.h
index 91e4837..2f55cf5 100644
--- a/src/plugin-tracker/na-tracker-dbus.h
+++ b/src/plugin-tracker/na-tracker-dbus.h
@@ -80,9 +80,6 @@ void na_tracker_dbus_set_uris( NATrackerDBus *tracker, GList *files );
gboolean na_tracker_dbus_get_selected_paths( NATrackerDBus *tracker, char ***paths, GError **error );
-#define NA_TRACKER_DBUS_TRACKER_PATH "/org/nautilus_actions/DBus/Tracker"
-#define NA_TRACKER_DBUS_TRACKER_INTERFACE "org.nautilus_actions.DBus.Tracker.Status"
-
G_END_DECLS
#endif /* __NA_TRACKER_DBUS_H__ */
diff --git a/src/plugin-tracker/na-tracker.c b/src/plugin-tracker/na-tracker.c
index ff6ff91..8fb7247 100644
--- a/src/plugin-tracker/na-tracker.c
+++ b/src/plugin-tracker/na-tracker.c
@@ -202,7 +202,7 @@ initialize_dbus_connection( void )
* instantiation takes care of installing introspection infos
*/
tracker = g_object_new( NA_TRACKER_DBUS_TYPE, NULL );
- dbus_g_connection_register_g_object( connection, NA_TRACKER_DBUS_TRACKER_PATH, G_OBJECT( tracker ));
+ dbus_g_connection_register_g_object( connection, NAUTILUS_ACTIONS_DBUS_TRACKER_PATH, G_OBJECT( tracker ));
g_debug( "%s: registering tracker path is ok", thisfn );
return( tracker );
diff --git a/src/utils/nautilus-actions-run.c b/src/utils/nautilus-actions-run.c
index a22e48c..1616f44 100644
--- a/src/utils/nautilus-actions-run.c
+++ b/src/utils/nautilus-actions-run.c
@@ -45,9 +45,6 @@
#include <core/na-selected-info.h>
#include <core/na-tokens.h>
-#include <plugin-tracker/na-tracker.h>
-#include <plugin-tracker/na-tracker-dbus.h>
-
#include "console-utils.h"
#include "nautilus-actions-run-bindings.h"
@@ -274,7 +271,9 @@ targets_from_selection( void )
g_debug( "%s: connection is ok", thisfn );
proxy = dbus_g_proxy_new_for_name( connection,
- NAUTILUS_ACTIONS_DBUS_SERVICE, NA_TRACKER_DBUS_TRACKER_PATH, NA_TRACKER_DBUS_TRACKER_INTERFACE );
+ NAUTILUS_ACTIONS_DBUS_SERVICE,
+ NAUTILUS_ACTIONS_DBUS_TRACKER_PATH,
+ NAUTILUS_ACTIONS_DBUS_TRACKER_INTERFACE );
if( !proxy ){
g_printerr( _( "Error: unable to get a proxy on %s service" ), NAUTILUS_ACTIONS_DBUS_SERVICE );
diff --git a/tools/dbus-introspect.sh b/tools/dbus-introspect.sh
index b0d19d7..0a0b1e2 100755
--- a/tools/dbus-introspect.sh
+++ b/tools/dbus-introspect.sh
@@ -2,10 +2,10 @@
#
# let's check the NATracker service
-NA_SERVICE=org.nautilus-actions.DBus
-NA_PATH_TRACKER=/org/nautilus_actions/DBus/Tracker
+NA_SERVICE=$(grep '#define NAUTILUS_ACTIONS_DBUS_SERVICE' src/api/na-dbus.h | awk '{ print $3 }' | sed 's?"??g')
+NA_TRACKER_PATH=$(grep '#define NAUTILUS_ACTIONS_DBUS_TRACKER_PATH' src/api/na-dbus.h | awk '{ print $3 }' | sed 's?"??g')
-echo ""
echo "D-Bus service = ${NA_SERVICE}"
-echo "D-Bus tracker path = ${NA_PATH_TRACKER}"
-dbus-send --session --type=method_call --print-reply --dest=${NA_SERVICE} ${NA_PATH_TRACKER} org.freedesktop.DBus.Introspectable.Introspect
+echo "D-Bus tracker path = ${NA_TRACKER_PATH}"
+echo ""
+dbus-send --session --type=method_call --print-reply --dest=${NA_SERVICE} ${NA_TRACKER_PATH} org.freedesktop.DBus.Introspectable.Introspect
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]