From 1d72374535de222cb816c74506555c71af10d429 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 9 Mar 2007 11:40:59 -0500 Subject: add a tool to autogenerate dbus object ref docs I hope I didn't reinvent a wheel but it seems to work much better than hand coding these refentries. Still need to add support for comments and actual descriptions ala gtk-doc. --- doc/ConsoleKit.xml.in | 10 +- doc/Makefile.am | 6 +- doc/ck-dbus-manager.xml | 52 ---------- doc/ck-dbus-seat.xml | 39 ------- doc/ck-dbus-session.xml | 55 ---------- doc/docbook-dbus.xsl | 261 +++++++++++++++++++++++++++++++++++++++++++++++ doc/docize-dbus-xml.sh | 34 +++++++ doc/ref-ck-manager.xml | 181 +++++++++++++++++++++++++++++++++ doc/ref-ck-seat.xml | 111 ++++++++++++++++++++ doc/ref-ck-session.xml | 262 ++++++++++++++++++++++++++++++++++++++++++++++++ src/ck-manager.xml | 12 ++- src/ck-seat.xml | 12 ++- src/ck-session.xml | 9 +- 13 files changed, 884 insertions(+), 160 deletions(-) delete mode 100644 doc/ck-dbus-manager.xml delete mode 100644 doc/ck-dbus-seat.xml delete mode 100644 doc/ck-dbus-session.xml create mode 100644 doc/docbook-dbus.xsl create mode 100755 doc/docize-dbus-xml.sh create mode 100644 doc/ref-ck-manager.xml create mode 100644 doc/ref-ck-seat.xml create mode 100644 doc/ref-ck-session.xml diff --git a/doc/ConsoleKit.xml.in b/doc/ConsoleKit.xml.in index 73834a1..fca0aa4 100644 --- a/doc/ConsoleKit.xml.in +++ b/doc/ConsoleKit.xml.in @@ -1,8 +1,8 @@ - - + + + ]> @@ -62,4 +62,8 @@ + + Index + + diff --git a/doc/Makefile.am b/doc/Makefile.am index 6f96464..c7ac22a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,9 +3,9 @@ NULL = SPEC_XML_FILES = \ ConsoleKit.xml \ ck-introduction.xml \ - ck-dbus-manager.xml \ - ck-dbus-seat.xml \ - ck-dbus-session.xml \ + ref-ck-manager.xml \ + ref-ck-seat.xml \ + ref-ck-session.xml \ $(NULL) if DOCBOOK_DOCS_ENABLED diff --git a/doc/ck-dbus-manager.xml b/doc/ck-dbus-manager.xml deleted file mode 100644 index 77577a5..0000000 --- a/doc/ck-dbus-manager.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - org.freedesktop.ConsoleKit.Manager - 1 - - - - org.freedesktop.ConsoleKit.Manager - Primary management interface - - - - Synopsis - - - Interface: - org.freedesktop.ConsoleKit.Manager - - Methods: - GetSeats (out OBJECT_PATH ARRAY seats) - GetSessionsForUser (in UINT32 uid, - out OBJECT_PATH ARRAY sessions) - GetCurrentSession (out OBJECT_PATH session) - GetSessionForUnixProcess (in UINT32 pid, - out OBJECT_PATH session) - GetSessionForCookie (in STRING cookie, - out OBJECT_PATH session) - GetSystemIdleHint (out BOOLEAN hint) - GetSystemIdleSinceHint (out STRING iso8601_datetime) - - OpenSession (out STRING cookie) - OpenSessionWithParameters (int STRING,VARIANT STRUCT ARRAY parameters, - out STRING cookie) - CloseSession (int STRING cookie, - out BOOLEAN result) - - Signals: - SeatAdded (STRING sid) - SeatRemoved (STRING sid) - SystemIdleHintChanged (BOOLEAN hint) - - - - - - - Description - - - - - diff --git a/doc/ck-dbus-seat.xml b/doc/ck-dbus-seat.xml deleted file mode 100644 index 738f6e2..0000000 --- a/doc/ck-dbus-seat.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - org.freedesktop.ConsoleKit.Seat - 2 - - - - org.freedesktop.ConsoleKit.Seat - Seat interface - - - - Synopsis - - - Interface: - org.freedesktop.ConsoleKit.Seat - - Methods: - GetId (out OBJECT_PATH sid) - ActivateSession (in OBJECT_PATH ssid) - GetActiveSession (out OBJECT_PATH ssid) - GetSessions (out OBJECT_PATH ARRAY sessions) - - Signals: - SessionAdded (STRING ssid) - SessionRemoved (STRING ssid) - ActiveSessionChanged (STRING ssid) - - - - - - Description - - - - - diff --git a/doc/ck-dbus-session.xml b/doc/ck-dbus-session.xml deleted file mode 100644 index 77181ec..0000000 --- a/doc/ck-dbus-session.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - org.freedesktop.ConsoleKit.Session - 3 - - - - org.freedesktop.ConsoleKit.Session - Session interface - - - - Synopsis - - - Interface: - org.freedesktop.ConsoleKit.Session - - Methods: - GetId (out STRING ssid) - GetSeatId (out STRING sid) - GetUser (out INT32 uid) - GetIdleHint (out BOOLEAN hint) - SetIdleHint (in BOOLEAN hint) - GetIdleSinceHint (out STRING iso8601_datetime) - GetCreationTime (out STRING iso8601_datetime) - GetRemoteHostName (out STRING hostname) - GetDisplayDevice (out STRING device) - GetX11DisplayDevice (out STRING device) - GetX11Display (out STRING display) - GetSessionType (out STRING type) - IsLocal (out BOOLEAN local) - IsActive (out BOOLEAN active) - Unlock () - Lock () - Activate () - - Signals: - ActiveChanged (BOOLEAN active) - IdleHintChanged (BOOLEAN hint) - Unlock () - Lock () - - Properties: - - - - - - Description - - - - - diff --git a/doc/docbook-dbus.xsl b/doc/docbook-dbus.xsl new file mode 100644 index 0000000..56eada4 --- /dev/null +++ b/doc/docbook-dbus.xsl @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + interface + + + + Methods + + + + + + + + + Signals + + + + + + + + + Implemented Interfaces + + implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + + + Properties + + + + + + + + + Description + + + + + + + Details + + + + + + + Signal Details + + + + + + + Property Details + + + + + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>-property-<xsl:value-of select="@name"/></xsl:attribute></anchor>'<xsl:value-of select="@name"/>' +property +'' + + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>-signal-<xsl:value-of select="@name"/></xsl:attribute></anchor><xsl:value-of select="@name"/> () +signal + () + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>-<xsl:value-of select="@name"/></xsl:attribute></anchor><xsl:value-of select="@name"/> () +method + () + + + + + + + + + + + + + +-property-'' + + + + + + + + + + + + +-signal-() + + + + + + + + + + + + +-() + + + + + +'' +, + + + + + +'' +, + + + + + + +'' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/docize-dbus-xml.sh b/doc/docize-dbus-xml.sh new file mode 100755 index 0000000..1df63e1 --- /dev/null +++ b/doc/docize-dbus-xml.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +DIST_BIN=`dirname "$0"` + +CMD=xsltproc +XSL=${DIST_BIN}/docbook-dbus.xsl + +if test "x$1" = "x" -o "x$1" = "x-h" -o "x$1" = "x--help"; then + echo "usage: $0 [file] ..." + exit 1 +fi + +if [ ! -r ${XSL} ]; then + echo "Cannot find XSLT file" + exit 1 +fi + +FILES="$@" +for FILE in $FILES; do + echo "${FILE}" | grep ".xml$" > /dev/null + if [ $? -ne 0 ]; then + echo "Skipping non-xml file: ${FILE}" + continue + fi + + d=`dirname ${FILE}` + b=`basename ${FILE} .xml` + + outfile="ref-${b}.xml" + echo "Creating: ${outfile}" + ${CMD} ${XSL} ${FILE} | tail -n +2 > ${outfile} +done + +exit 0 diff --git a/doc/ref-ck-manager.xml b/doc/ref-ck-manager.xml new file mode 100644 index 0000000..c2392f3 --- /dev/null +++ b/doc/ref-ck-manager.xml @@ -0,0 +1,181 @@ + + + org.freedesktop.ConsoleKit.Manager + + + org.freedesktop.ConsoleKit.Manager + Manager interface + + + Methods + OpenSession (out 's' cookie) +OpenSessionWithParameters (in 'a(sv)' parameters, + out 's' cookie) +CloseSession (in 's' cookie, + out 'b' result) +GetSeats (out 'ao' seats) +GetCurrentSession (out 'o' ssid) +GetSessionForCookie (in 's' cookie, + out 'o' ssid) +GetSessionForUnixProcess (in 'u' pid, + out 'o' ssid) +GetSessionsForUser (in 'u' uid, + out 'ao' sessions) +GetSystemIdleHint (out 'b' idle_hint) +GetSystemIdleSinceHint (out 's' iso8601_datetime) + + + + Signals + SeatAdded ('o' sid) +SeatRemoved ('o' sid) +SystemIdleHintChanged ('b' hint) + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Manager implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + + + + Description + + + + Details + + <anchor role="function" id="Manager-OpenSession"/>OpenSession () + + OpenSession + Manager + method + + OpenSession (out 's' cookie) + + + <anchor role="function" id="Manager-OpenSessionWithParameters"/>OpenSessionWithParameters () + + OpenSessionWithParameters + Manager + method + + OpenSessionWithParameters (in 'a(sv)' parameters, + out 's' cookie) + + + <anchor role="function" id="Manager-CloseSession"/>CloseSession () + + CloseSession + Manager + method + + CloseSession (in 's' cookie, + out 'b' result) + + + <anchor role="function" id="Manager-GetSeats"/>GetSeats () + + GetSeats + Manager + method + + GetSeats (out 'ao' seats) + + + <anchor role="function" id="Manager-GetCurrentSession"/>GetCurrentSession () + + GetCurrentSession + Manager + method + + GetCurrentSession (out 'o' ssid) + + + <anchor role="function" id="Manager-GetSessionForCookie"/>GetSessionForCookie () + + GetSessionForCookie + Manager + method + + GetSessionForCookie (in 's' cookie, + out 'o' ssid) + + + <anchor role="function" id="Manager-GetSessionForUnixProcess"/>GetSessionForUnixProcess () + + GetSessionForUnixProcess + Manager + method + + GetSessionForUnixProcess (in 'u' pid, + out 'o' ssid) + + + <anchor role="function" id="Manager-GetSessionsForUser"/>GetSessionsForUser () + + GetSessionsForUser + Manager + method + + GetSessionsForUser (in 'u' uid, + out 'ao' sessions) + + + <anchor role="function" id="Manager-GetSystemIdleHint"/>GetSystemIdleHint () + + GetSystemIdleHint + Manager + method + + GetSystemIdleHint (out 'b' idle_hint) + + + <anchor role="function" id="Manager-GetSystemIdleSinceHint"/>GetSystemIdleSinceHint () + + GetSystemIdleSinceHint + Manager + method + + GetSystemIdleSinceHint (out 's' iso8601_datetime) + + + + Signal Details + + <anchor role="function" id="Manager-signal-SeatAdded"/>SeatAdded () + + SeatAdded + Manager + signal + + SeatAdded ('o' sid) + + + <anchor role="function" id="Manager-signal-SeatRemoved"/>SeatRemoved () + + SeatRemoved + Manager + signal + + SeatRemoved ('o' sid) + + + <anchor role="function" id="Manager-signal-SystemIdleHintChanged"/>SystemIdleHintChanged () + + SystemIdleHintChanged + Manager + signal + + SystemIdleHintChanged ('b' hint) + + + + Property Details + + diff --git a/doc/ref-ck-seat.xml b/doc/ref-ck-seat.xml new file mode 100644 index 0000000..a679d8e --- /dev/null +++ b/doc/ref-ck-seat.xml @@ -0,0 +1,111 @@ + + + org.freedesktop.ConsoleKit.Seat + + + org.freedesktop.ConsoleKit.Seat + Seat interface + + + Methods + GetId (out 'o' sid) +GetSessions (out 'ao' sessions) +GetActiveSession (out 'o' ssid) +ActivateSession (in 'o' ssid) + + + + Signals + ActiveSessionChanged ('o' sid) +SessionAdded ('o' sid) +SessionRemoved ('o' sid) + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Seat implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + + + + Description + + + + Details + + <anchor role="function" id="Seat-GetId"/>GetId () + + GetId + Seat + method + + GetId (out 'o' sid) + + + <anchor role="function" id="Seat-GetSessions"/>GetSessions () + + GetSessions + Seat + method + + GetSessions (out 'ao' sessions) + + + <anchor role="function" id="Seat-GetActiveSession"/>GetActiveSession () + + GetActiveSession + Seat + method + + GetActiveSession (out 'o' ssid) + + + <anchor role="function" id="Seat-ActivateSession"/>ActivateSession () + + ActivateSession + Seat + method + + ActivateSession (in 'o' ssid) + + + + Signal Details + + <anchor role="function" id="Seat-signal-ActiveSessionChanged"/>ActiveSessionChanged () + + ActiveSessionChanged + Seat + signal + + ActiveSessionChanged ('o' sid) + + + <anchor role="function" id="Seat-signal-SessionAdded"/>SessionAdded () + + SessionAdded + Seat + signal + + SessionAdded ('o' sid) + + + <anchor role="function" id="Seat-signal-SessionRemoved"/>SessionRemoved () + + SessionRemoved + Seat + signal + + SessionRemoved ('o' sid) + + + + Property Details + + diff --git a/doc/ref-ck-session.xml b/doc/ref-ck-session.xml new file mode 100644 index 0000000..bd165bc --- /dev/null +++ b/doc/ref-ck-session.xml @@ -0,0 +1,262 @@ + + + org.freedesktop.ConsoleKit.Session + + + org.freedesktop.ConsoleKit.Session + Session interface + + + Methods + GetId (out 'o' ssid) +GetSeatId (out 'o' sid) +GetSessionType (out 's' type) +GetUser (out 'i' uid) +GetX11Display (out 's' display) +GetX11DisplayDevice (out 's' x11_display_device) +GetDisplayDevice (out 's' display_device) +GetRemoteHostName (out 's' remote_host_name) +IsActive (out 'b' active) +IsLocal (out 'b' local) +GetCreationTime (out 's' iso8601_datetime) +Activate () +Lock () +Unlock () +GetIdleHint (out 'b' idle_hint) +GetIdleSinceHint (out 's' iso8601_datetime) +SetIdleHint (in 'b' idle_hint) + + + + Signals + ActiveChanged ('b' is_active) +IdleHintChanged ('b' hint) +Lock () +Unlock () + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Session implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + 'is-local' read 'b' + + + + Description + + + + Details + + <anchor role="function" id="Session-GetId"/>GetId () + + GetId + Session + method + + GetId (out 'o' ssid) + + + <anchor role="function" id="Session-GetSeatId"/>GetSeatId () + + GetSeatId + Session + method + + GetSeatId (out 'o' sid) + + + <anchor role="function" id="Session-GetSessionType"/>GetSessionType () + + GetSessionType + Session + method + + GetSessionType (out 's' type) + + + <anchor role="function" id="Session-GetUser"/>GetUser () + + GetUser + Session + method + + GetUser (out 'i' uid) + + + <anchor role="function" id="Session-GetX11Display"/>GetX11Display () + + GetX11Display + Session + method + + GetX11Display (out 's' display) + + + <anchor role="function" id="Session-GetX11DisplayDevice"/>GetX11DisplayDevice () + + GetX11DisplayDevice + Session + method + + GetX11DisplayDevice (out 's' x11_display_device) + + + <anchor role="function" id="Session-GetDisplayDevice"/>GetDisplayDevice () + + GetDisplayDevice + Session + method + + GetDisplayDevice (out 's' display_device) + + + <anchor role="function" id="Session-GetRemoteHostName"/>GetRemoteHostName () + + GetRemoteHostName + Session + method + + GetRemoteHostName (out 's' remote_host_name) + + + <anchor role="function" id="Session-IsActive"/>IsActive () + + IsActive + Session + method + + IsActive (out 'b' active) + + + <anchor role="function" id="Session-IsLocal"/>IsLocal () + + IsLocal + Session + method + + IsLocal (out 'b' local) + + + <anchor role="function" id="Session-GetCreationTime"/>GetCreationTime () + + GetCreationTime + Session + method + + GetCreationTime (out 's' iso8601_datetime) + + + <anchor role="function" id="Session-Activate"/>Activate () + + Activate + Session + method + + Activate () + + + <anchor role="function" id="Session-Lock"/>Lock () + + Lock + Session + method + + Lock () + + + <anchor role="function" id="Session-Unlock"/>Unlock () + + Unlock + Session + method + + Unlock () + + + <anchor role="function" id="Session-GetIdleHint"/>GetIdleHint () + + GetIdleHint + Session + method + + GetIdleHint (out 'b' idle_hint) + + + <anchor role="function" id="Session-GetIdleSinceHint"/>GetIdleSinceHint () + + GetIdleSinceHint + Session + method + + GetIdleSinceHint (out 's' iso8601_datetime) + + + <anchor role="function" id="Session-SetIdleHint"/>SetIdleHint () + + SetIdleHint + Session + method + + SetIdleHint (in 'b' idle_hint) + + + + Signal Details + + <anchor role="function" id="Session-signal-ActiveChanged"/>ActiveChanged () + + ActiveChanged + Session + signal + + ActiveChanged ('b' is_active) + + + <anchor role="function" id="Session-signal-IdleHintChanged"/>IdleHintChanged () + + IdleHintChanged + Session + signal + + IdleHintChanged ('b' hint) + + + <anchor role="function" id="Session-signal-Lock"/>Lock () + + Lock + Session + signal + + Lock () + + + <anchor role="function" id="Session-signal-Unlock"/>Unlock () + + Unlock + Session + signal + + Unlock () + + + + Property Details + + <anchor role="function" id="Session-property-is-local"/>'is-local' + + is-local + Session + property + + 'is-local' read 'b' + + + + diff --git a/src/ck-manager.xml b/src/ck-manager.xml index 6eadd11..ced06b0 100644 --- a/src/ck-manager.xml +++ b/src/ck-manager.xml @@ -49,8 +49,14 @@ - - - + + + + + + + + + diff --git a/src/ck-seat.xml b/src/ck-seat.xml index 9a32e57..3e7a0fa 100644 --- a/src/ck-seat.xml +++ b/src/ck-seat.xml @@ -20,8 +20,14 @@ - - - + + + + + + + + + diff --git a/src/ck-session.xml b/src/ck-session.xml index 0c90fb1..c40e8f2 100644 --- a/src/ck-session.xml +++ b/src/ck-session.xml @@ -58,11 +58,16 @@ - + + + + + + - + -- cgit