summaryrefslogtreecommitdiffstats
path: root/doc/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'doc/dbus')
-rw-r--r--doc/dbus/.gitignore6
-rw-r--r--doc/dbus/ConsoleKit.xml.in74
-rw-r--r--doc/dbus/Makefile.am46
-rw-r--r--doc/dbus/ck-design.xml180
-rw-r--r--doc/dbus/ck-introduction.xml28
-rw-r--r--doc/dbus/ck-terms.xml67
-rw-r--r--doc/dbus/config.xsl6
-rw-r--r--doc/dbus/dbus-introspect-docs.dtd32
-rw-r--r--doc/dbus/docbook.css78
-rw-r--r--doc/dbus/spec-to-docbook.xsl543
10 files changed, 1060 insertions, 0 deletions
diff --git a/doc/dbus/.gitignore b/doc/dbus/.gitignore
new file mode 100644
index 0000000..4337b46
--- /dev/null
+++ b/doc/dbus/.gitignore
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+ConsoleKit.xml
+ConsoleKit.html
+*.o
+*~
diff --git a/doc/dbus/ConsoleKit.xml.in b/doc/dbus/ConsoleKit.xml.in
new file mode 100644
index 0000000..8a86511
--- /dev/null
+++ b/doc/dbus/ConsoleKit.xml.in
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY dbus-Manager SYSTEM "xml/org.freedesktop.ConsoleKit.Manager.ref.xml">
+<!ENTITY dbus-Seat SYSTEM "xml/org.freedesktop.ConsoleKit.Seat.ref.xml">
+<!ENTITY dbus-Session SYSTEM "xml/org.freedesktop.ConsoleKit.Session.ref.xml">
+<!ENTITY Intro SYSTEM "xml/ck-introduction.xml">
+<!ENTITY Terms SYSTEM "xml/ck-terms.xml">
+<!ENTITY Design SYSTEM "xml/ck-design.xml">
+]>
+
+<book id="index">
+ <bookinfo>
+ <title>ConsoleKit @VERSION@ Documentation</title>
+ <releaseinfo>Version @VERSION@</releaseinfo>
+ <date>8 March, 2007</date>
+ <authorgroup>
+ <author>
+ <firstname>William Jon</firstname>
+ <surname>McCann</surname>
+ <affiliation>
+ <address>
+ <email>mccann@jhu.edu</email>
+ </address>
+ </affiliation>
+ </author>
+ </authorgroup>
+ </bookinfo>
+
+ <preface>
+ <title>Introduction</title>
+ <para>
+ </para>
+ </preface>
+
+ <part>
+ <title>Concepts</title>
+
+ &Intro;
+ &Terms;
+ &Design;
+ </part>
+
+ <part>
+ <title>Reference</title>
+
+ <reference id="dbus-reference">
+ <title>D-Bus API Reference</title>
+
+ <partintro>
+ <para>
+ ConsoleKit provides a D-Bus API for programs to obtain information about the
+ users, sessions, and seats that are present on a system.
+ </para>
+ <para>
+ Please see the other sections of this manual for an introduction to
+ these concepts.
+ </para>
+ <para>
+ This API is not yet stable and is likely to change in the future.
+ </para>
+ </partintro>
+
+ &dbus-Manager;
+ &dbus-Seat;
+ &dbus-Session;
+
+ </reference>
+ </part>
+
+ <index>
+ <title>Index</title>
+ </index>
+
+</book>
diff --git a/doc/dbus/Makefile.am b/doc/dbus/Makefile.am
new file mode 100644
index 0000000..d8bb0ee
--- /dev/null
+++ b/doc/dbus/Makefile.am
@@ -0,0 +1,46 @@
+NULL =
+
+SPEC_XML_FILES = \
+ ConsoleKit.xml \
+ ck-introduction.xml \
+ ck-terms.xml \
+ ck-design.xml \
+ org.freedesktop.ConsoleKit.Manager.ref.xml \
+ org.freedesktop.ConsoleKit.Seat.ref.xml \
+ org.freedesktop.ConsoleKit.Session.ref.xml \
+ $(NULL)
+
+if DOCBOOK_DOCS_ENABLED
+
+htmldocdir = $(docdir)/spec
+htmldoc_DATA = ConsoleKit.html
+
+ConsoleKit.html : $(SPEC_XML_FILES)
+ $(XMLTO) xhtml-nochunks -m $(top_srcdir)/doc/dbus/config.xsl ConsoleKit.xml
+
+endif # DOCBOOK_DOCS_ENABLED
+
+org.freedesktop.ConsoleKit.Manager.ref.xml : $(top_srcdir)/src/org.freedesktop.ConsoleKit.Manager.xml spec-to-docbook.xsl
+ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 > $@
+org.freedesktop.ConsoleKit.Seat.ref.xml : $(top_srcdir)/src/org.freedesktop.ConsoleKit.Seat.xml spec-to-docbook.xsl
+ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 > $@
+org.freedesktop.ConsoleKit.Session.ref.xml : $(top_srcdir)/src/org.freedesktop.ConsoleKit.Session.xml spec-to-docbook.xsl
+ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 > $@
+
+EXTRA_DIST = \
+ spec-to-docbook.xsl \
+ ConsoleKit.xml.in \
+ config.xsl \
+ docbook.css \
+ dbus-introspect-docs.dtd \
+ $(SPEC_XML_FILES)
+ $(NULL)
+
+MAINTAINERCLEANFILES = \
+ *~ \
+ Makefile.in \
+ $(NULL)
+
+clean-local:
+ rm -f *~ *.ref.xml
+ rm -f ConsoleKit.html
diff --git a/doc/dbus/ck-design.xml b/doc/dbus/ck-design.xml
new file mode 100644
index 0000000..1148773
--- /dev/null
+++ b/doc/dbus/ck-design.xml
@@ -0,0 +1,180 @@
+<chapter id="design">
+ <title>Design</title>
+
+ <sect1>
+ <title>Session Lifecycle</title>
+ <para>
+The session leader process is responsible for asking
+ConsoleKit to open a new session. In this respect, it is
+similar to the traditional POSIX user login accounting framework.
+In the typical case, the session leader is either an immediate descendant of
+a login manager or the login manager itself. The leader makes a connection to the D-Bus system bus and asks ConsoleKit to open a session. There are two methods available for opening a session: org.freedesktop.ConsoleKit.Manager.OpenSession() and org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters().
+ </para>
+ <para>
+If the operation succeeds, a secret cookie will be returned to the session leader. The session leader should store this secret in the environment as XDG_SESSION_COOKIE so that it may be shared with its child processes.
+ </para>
+ <para>
+At this point the session will be registered with ConsoleKit and a particular
+set of information about the session will be stored along with it.
+ </para>
+ <para>
+ConsoleKit will decide, based on the information associated with the session, what Seat the session will be added to.
+ </para>
+ <para>
+It will also be determined, based on the same set of information, whether the Session will control the hardware associated with the Seat. In other words, whether the Session will be active for the Seat it is attached to. The exact mechanism for this determination depends on the type of Seat and the capabilities of the host system.
+ </para>
+ <para>
+The Session will remain open until the Session Leader disconnects from the D-Bus system bus or calls org.freedesktop.ConsoleKit.Manager.CloseSession(). The session will be removed from its Seat, and deregistered.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Expected Usage</title>
+ <para>Use of this service will usually follow one of the following patterns:</para>
+
+ <sect2>
+ <title>Text Login Manager</title>
+ <para>This pattern operates as the Session Leader for a new Session. This pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To open a new Session.
+ </listitem>
+ <listitem>
+ To set properties for the Session.
+ </listitem>
+ <listitem>
+ To maintain a connection to the D-Bus system bus.
+ </listitem>
+ <listitem>
+ To close the Session at logout.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Graphical Login Manager</title>
+ <para>In addition to the requirements for the Text Graphical Login Manager, this pattern is typically used to show information about currently open sessions. It needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To determine which Seat it is running on.
+ </listitem>
+ <listitem>
+ To know if the current seat supports session switching.
+ </listitem>
+ <listitem>
+ A list of all sessions on the current Seat.
+ </listitem>
+ <listitem>
+ To know which session is active for the current Seat.
+ </listitem>
+ <listitem>
+ To know when the session active state changes.
+ </listitem>
+ <listitem>
+ To know when sessions are added or removed.
+ </listitem>
+ <listitem>
+ Access to the metadata for any open Session.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>System Daemon</title>
+ <para>This is generally a daemon process running outside of a user session as a special user. This pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To know if any user sessions are open.
+ </listitem>
+ <listitem>
+ To know if the system is currently being used.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Hardware Abstraction Layer</title>
+ <para>This is a special case of System Daemon that provides catalogs and control mechanisms for hardware devices. In addition to the requirements of System Daemon, this pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To determine what hardware is associated with a Seat.
+ </listitem>
+ <listitem>
+ To determine what Session is active and inactive on a particular Seat.
+ </listitem>
+ <listitem>
+ To know when the session active state changes.
+ </listitem>
+ <listitem>
+ To determine what Session a process belongs to.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Fast User Switching Agent</title>
+ <para>This is related to the Graphical Login Manager and provides a shortcut to similar functionality. It is usually a tool available in the user session that allows one to quickly switch to another user session. This pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To determine which session it is running in.
+ </listitem>
+ <listitem>
+ To determine which Seat it is running on.
+ </listitem>
+ <listitem>
+ To know if the current seat supports session switching.
+ </listitem>
+ <listitem>
+ A list of all sessions on the current Seat.
+ </listitem>
+ <listitem>
+ Which session is active for the current Seat.
+ </listitem>
+ <listitem>
+ To know when the session active state changes.
+ </listitem>
+ <listitem>
+ Access to the metadata for any open Session.
+ </listitem>
+ <listitem>
+ To know when sessions are added or removed.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Session Daemon (aka Policy Agent)</title>
+ <para>This is typically a daemon running in a user session that acts on policy only when the session is active. This pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To determine which session it is running in.
+ </listitem>
+ <listitem>
+ To know when the session active state changes.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Session Application</title>
+ <para>This is typically an application running in a user session that may alter its behavior when the session active state changes. This pattern needs:
+ </para>
+ <orderedlist>
+ <listitem>
+ To determine which session it is running in.
+ </listitem>
+ <listitem>
+ To know when the session active state changes.
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ </sect1>
+
+</chapter>
diff --git a/doc/dbus/ck-introduction.xml b/doc/dbus/ck-introduction.xml
new file mode 100644
index 0000000..b38adf5
--- /dev/null
+++ b/doc/dbus/ck-introduction.xml
@@ -0,0 +1,28 @@
+<chapter id="introduction">
+ <title>Introduction</title>
+
+ <sect1>
+ <title>About</title>
+ <para>
+ ConsoleKit is a framework for keeping track of the various
+ users, sessions, and seats present on a system. It
+ provides a mechanism for software to react to changes of any of
+ these items or of any of the metadata associated with them.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Defining the Problem</title>
+ <para>
+ To be written.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Relevant art</title>
+ <para>
+ To be written.
+ </para>
+ </sect1>
+
+</chapter>
diff --git a/doc/dbus/ck-terms.xml b/doc/dbus/ck-terms.xml
new file mode 100644
index 0000000..d3d544d
--- /dev/null
+++ b/doc/dbus/ck-terms.xml
@@ -0,0 +1,67 @@
+<chapter id="terms">
+ <title>Terminology</title>
+
+ <sect1>
+ <title>Session</title>
+ <para>
+A session is a collection of all processes that share knowledge of a
+secret. In the typical (or ideal) case, these processes all originate
+from a single common ancestor.
+ </para>
+ <para>
+As an implementation detail, for now, this secret should be stored in
+the process environment by the session leader under the name
+XDG_SESSION_COOKIE. When and if we are able to take advantage of a
+mechanism in the underlying system to store session registration
+information - we will. However, such a mechanism is not known at the
+present time.
+ </para>
+ <para>
+Using an environment variable does have certain advantages. For one,
+it is quite easy for a process to opt-out of a Session by simply
+unsetting the XDG_SESSION_COOKIE variable.
+ </para>
+ <para>
+Limitations of using an environment variable implementation include
+not being able to strictly limit visibility of the secret to a particular
+process ancestry. So, it is not possible to enforce session boundaries
+other than on a per-user basis. For example, we don't yet have a way
+to prevent a process from moving between sessions owned by the same
+user.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Session leader</title>
+ <para>
+The session leader is the process that requests that a new session be
+opened. It does this by connecting to the D-Bus system bus and using
+either org.freedesktop.ConsoleKit.Manager.OpenSession() or
+org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters(). The session
+that it registers will remain open until the connection to the system
+bus is lost or it calls org.freedesktop.ConsoleKit.Manager.CloseSession().
+ </para>
+ <para>
+The session leader is the only process for which CloseSession() will
+be allowed.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Seat</title>
+ <para>
+A seat is a collection of sessions and a set of hardware (usually at
+least a keyboard and mouse). Only one session may be active on a
+seat at a time.
+ </para>
+ <para>
+At the present time, all Sessions that are considered "local" to
+a system will be added the the first Seat and every other Session
+will be added to its own Seat.
+ </para>
+ <para>
+True, hardware, multi-seat capabilities will be added in a later release.
+ </para>
+ </sect1>
+
+</chapter>
diff --git a/doc/dbus/config.xsl b/doc/dbus/config.xsl
new file mode 100644
index 0000000..7aa9def
--- /dev/null
+++ b/doc/dbus/config.xsl
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+ <xsl:param name="html.stylesheet" select="'docbook.css'"/>
+</xsl:stylesheet>
diff --git a/doc/dbus/dbus-introspect-docs.dtd b/doc/dbus/dbus-introspect-docs.dtd
new file mode 100644
index 0000000..ca918fb
--- /dev/null
+++ b/doc/dbus/dbus-introspect-docs.dtd
@@ -0,0 +1,32 @@
+<!-- DTD for D-Bus Introspection Documentation -->
+
+<!ELEMENT doc (summary?,description?,errors?,permission?,since?,deprecated,seealso?)>
+
+<!ELEMENT summary (#PCDATA|ref)*>
+<!ELEMENT description (#PCDATA|para|example)*>
+<!ELEMENT errors (error)*>
+<!ELEMENT permission (#PCDATA|ref|para)*>
+<!ELEMENT since EMPTY>
+<!ATTLIST since version CDATA #REQUIRED>
+<!ELEMENT deprecated (#PCDATA|ref)>
+<!ATTLIST deprecated version CDATA #REQUIRED>
+<!ATTLIST deprecated instead CDATA #REQUIRED>
+<!ELEMENT seealso (ref+)>
+
+<!ELEMENT error (#PCDATA|para)*>
+<!ATTLIST error name CDATA #REQUIRED>
+<!ELEMENT para (#PCDATA|example|code|list|ref)*>
+<!ELEMENT example (#PCDATA|para|code|ref)*>
+<!ATTLIST language (c|glib|python|shell) #REQUIRED>
+<!ATTLIST title CDATA #IMPLIED>
+<!ELEMENT list (item*)>
+<!ATTLIST list type (bullet|number) #REQUIRED>
+<!ELEMENT item (term|definition)*>
+<!ELEMENT term (#PCDATA|ref)*>
+<!ELEMENT definition (#PCDATA|para)*>
+
+<!ELEMENT code (#PCDATA)>
+<!ATTLIST code lang CDATA #IMPLIED>
+<!ELEMENT ref CDATA>
+<!ATTLIST ref type (parameter|arg|signal|method|interface) #REQUIRED>
+<!ATTLIST ref to CDATA #REQUIRED>
diff --git a/doc/dbus/docbook.css b/doc/dbus/docbook.css
new file mode 100644
index 0000000..6a7373e
--- /dev/null
+++ b/doc/dbus/docbook.css
@@ -0,0 +1,78 @@
+body
+{
+ font-family: sans-serif;
+}
+h1.title
+{
+}
+.permission
+{
+ color: #ee0000;
+ text-decoration: underline;
+}
+.synopsis, .classsynopsis
+{
+ background: #eeeeee;
+ border: solid 1px #aaaaaa;
+ padding: 0.5em;
+}
+.programlisting
+{
+ background: #eeeeff;
+ border: solid 1px #aaaaff;
+ padding: 0.5em;
+}
+.variablelist
+{
+ padding: 4px;
+ margin-left: 3em;
+}
+.variablelist td:first-child
+{
+ vertical-align: top;
+}
+td.shortcuts
+{
+ color: #770000;
+ font-size: 80%;
+}
+div.refnamediv
+{
+ margin-top: 2em;
+}
+div.toc
+{
+ border: 2em;
+}
+a
+{
+ text-decoration: none;
+}
+a:hover
+{
+ text-decoration: underline;
+ color: #FF0000;
+}
+
+div.table table
+{
+ border-collapse: collapse;
+ border-spacing: 0px;
+ border-style: solid;
+ border-color: #777777;
+ border-width: 1px;
+}
+
+div.table table td, div.table table th
+{
+ border-style: solid;
+ border-color: #777777;
+ border-width: 1px;
+ padding: 3px;
+ vertical-align: top;
+}
+
+div.table table th
+{
+ background-color: #eeeeee;
+}
diff --git a/doc/dbus/spec-to-docbook.xsl b/doc/dbus/spec-to-docbook.xsl
new file mode 100644
index 0000000..1864414
--- /dev/null
+++ b/doc/dbus/spec-to-docbook.xsl
@@ -0,0 +1,543 @@
+<?xml version='1.0'?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
+ exclude-result-prefixes="doc">
+<!--
+ Convert D-Bus Glib xml into DocBook refentries
+ Copyright (C) 2007 William Jon McCann
+ License: GPL
+-->
+<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
+
+<xsl:template match="/">
+
+<xsl:variable name="interface" select="//interface/@name"/>
+<xsl:variable name="basename">
+ <xsl:call-template name="interface-basename">
+ <xsl:with-param name="str" select="$interface"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<refentry><xsl:attribute name="id"><xsl:value-of select="$basename"/></xsl:attribute>
+ <refmeta>
+ <refentrytitle role="top_of_page"><xsl:value-of select="//interface/@name"/></refentrytitle>
+ </refmeta>
+
+ <refnamediv>
+ <refname><xsl:value-of select="//interface/@name"/></refname>
+ <refpurpose><xsl:value-of select="$basename"/> interface</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv role="synopsis">
+ <title role="synopsis.title">Methods</title>
+ <synopsis>
+ <xsl:call-template name="methods-synopsis">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </synopsis>
+ </refsynopsisdiv>
+
+ <xsl:choose>
+ <xsl:when test="count(///signal) > 0">
+ <refsect1 role="signal_proto">
+ <title role="signal_proto.title">Signals</title>
+ <synopsis>
+ <xsl:call-template name="signals-synopsis">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </synopsis>
+ </refsect1>
+ </xsl:when>
+ </xsl:choose>
+
+ <refsect1 role="impl_interfaces">
+ <title role="impl_interfaces.title">Implemented Interfaces</title>
+ <para>
+ Objects implementing <xsl:value-of select="$interface"/> also implements
+ org.freedesktop.DBus.Introspectable,
+ org.freedesktop.DBus.Properties
+ </para>
+ </refsect1>
+
+ <xsl:choose>
+ <xsl:when test="count(///property) > 0">
+ <refsect1 role="properties">
+ <title role="properties.title">Properties</title>
+ <synopsis>
+ <xsl:call-template name="properties-synopsis">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </synopsis>
+ </refsect1>
+ </xsl:when>
+ </xsl:choose>
+
+ <refsect1 role="desc">
+ <title role="desc.title">Description</title>
+ <para>
+ <xsl:apply-templates select="//interface/doc:doc"/>
+ </para>
+ </refsect1>
+
+ <refsect1 role="details">
+ <title role="details.title">Details</title>
+ <xsl:call-template name="method-details">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </refsect1>
+
+ <xsl:choose>
+ <xsl:when test="count(///signal) > 0">
+ <refsect1 role="signals">
+ <title role="signals.title">Signal Details</title>
+ <xsl:call-template name="signal-details">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </refsect1>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="count(///property) > 0">
+ <refsect1 role="property_details">
+ <title role="property_details.title">Property Details</title>
+ <xsl:call-template name="property-details">
+ <xsl:with-param name="basename" select="$basename"/>
+ </xsl:call-template>
+ </refsect1>
+ </xsl:when>
+ </xsl:choose>
+
+</refentry>
+</xsl:template>
+
+
+<xsl:template name="property-doc">
+ <xsl:apply-templates select="doc:doc/doc:description"/>
+
+ <variablelist role="params">
+ <xsl:for-each select="arg">
+<varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term>
+<listitem><simpara><xsl:value-of select="doc:doc/doc:summary"/></simpara></listitem>
+</varlistentry>
+ </xsl:for-each>
+ </variablelist>
+
+ <xsl:apply-templates select="doc:doc/doc:since"/>
+ <xsl:apply-templates select="doc:doc/doc:deprecated"/>
+ <xsl:apply-templates select="doc:doc/doc:permission"/>
+ <xsl:apply-templates select="doc:doc/doc:seealso"/>
+</xsl:template>
+
+
+<xsl:template name="property-details">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///property">
+ <refsect2>
+ <title><anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>:<xsl:value-of select="@name"/></xsl:attribute></anchor>The "<xsl:value-of select="@name"/>" property</title>
+<indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm>
+<programlisting>'<xsl:value-of select="@name"/>'<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="2"/></xsl:call-template>
+<xsl:call-template name="property-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/></xsl:call-template></programlisting>
+ </refsect2>
+
+ <xsl:call-template name="property-doc"/>
+
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="signal-doc">
+ <xsl:apply-templates select="doc:doc/doc:description"/>
+
+ <variablelist role="params">
+ <xsl:for-each select="arg">
+<varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term>
+<listitem><simpara><xsl:value-of select="doc:doc/doc:summary"/></simpara></listitem>
+</varlistentry>
+ </xsl:for-each>
+ </variablelist>
+
+ <xsl:apply-templates select="doc:doc/doc:since"/>
+ <xsl:apply-templates select="doc:doc/doc:deprecated"/>
+ <xsl:apply-templates select="doc:doc/doc:permission"/>
+ <xsl:apply-templates select="doc:doc/doc:seealso"/>
+</xsl:template>
+
+<xsl:template name="signal-details">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///signal">
+ <refsect2>
+ <title><anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>::<xsl:value-of select="@name"/></xsl:attribute></anchor>The <xsl:value-of select="@name"/> signal</title>
+<indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm>
+<programlisting><xsl:value-of select="@name"/> (<xsl:call-template name="signal-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/><xsl:with-param name="prefix" select="."/></xsl:call-template>)</programlisting>
+ </refsect2>
+
+ <xsl:call-template name="signal-doc"/>
+
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="doc:code">
+<programlisting>
+<xsl:apply-templates />
+</programlisting>
+</xsl:template>
+
+<xsl:template match="doc:tt">
+ <literal>
+ <xsl:apply-templates />
+ </literal>
+</xsl:template>
+
+<xsl:template match="doc:i">
+ <emphasis>
+ <xsl:apply-templates />
+ </emphasis>
+</xsl:template>
+
+<xsl:template match="doc:b">
+ <emphasis role="bold">
+ <xsl:apply-templates />
+ </emphasis>
+</xsl:template>
+
+<xsl:template match="doc:ulink">
+ <ulink>
+ <xsl:attribute name="url"><xsl:value-of select="@url"/></xsl:attribute>
+ <xsl:value-of select="."/>
+ </ulink>
+</xsl:template>
+
+<xsl:template match="doc:summary">
+ <xsl:apply-templates />
+</xsl:template>
+
+<xsl:template match="doc:example">
+<informalexample>
+<xsl:apply-templates />
+</informalexample>
+</xsl:template>
+
+<xsl:template name="listitems-do-term">
+ <xsl:param name="str"/>
+ <xsl:choose>
+ <xsl:when test="string-length($str) > 0">
+ <emphasis role="bold"><xsl:value-of select="$str"/>: </emphasis>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="do-listitems">
+ <xsl:for-each select="doc:item">
+ <listitem>
+ <xsl:call-template name="listitems-do-term"><xsl:with-param name="str" select="doc:term"/></xsl:call-template>
+ <xsl:apply-templates select="doc:definition"/>
+ </listitem>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="doc:list">
+ <para>
+ <xsl:choose>
+ <xsl:when test="contains(@type,'number')">
+ <orderedlist>
+ <xsl:call-template name="do-listitems"/>
+ </orderedlist>
+ </xsl:when>
+ <xsl:otherwise>
+ <itemizedlist>
+ <xsl:call-template name="do-listitems"/>
+ </itemizedlist>
+ </xsl:otherwise>
+ </xsl:choose>
+ </para>
+</xsl:template>
+
+<xsl:template match="doc:para">
+<para>
+<xsl:apply-templates />
+</para>
+</xsl:template>
+
+<xsl:template match="doc:description">
+<xsl:apply-templates />
+</xsl:template>
+
+<xsl:template match="doc:since">
+<para role="since">Since <xsl:value-of select="@version"/>
+</para>
+</xsl:template>
+
+<xsl:template match="doc:deprecated">
+ <xsl:variable name="name" select="../../@name"/>
+ <xsl:variable name="parent">
+ <xsl:call-template name="interface-basename">
+ <xsl:with-param name="str" select="../../../@name"/>/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="type" select="name(../..)"/>
+
+ <para role="deprecated">
+ <warning><para><literal><xsl:value-of select="$name"/></literal> is deprecated since version <xsl:value-of select="@version"/> and should not be used in newly-written code. Use
+
+ <xsl:variable name="to">
+ <xsl:choose>
+ <xsl:when test="contains($type,'property')">
+ <xsl:value-of select="$parent"/>:<xsl:value-of select="@instead"/>
+ </xsl:when>
+ <xsl:when test="contains($type,'signal')">
+ <xsl:value-of select="$parent"/>::<xsl:value-of select="@instead"/>
+ </xsl:when>
+ <xsl:when test="contains($type,'method')">
+ <xsl:value-of select="$parent"/>.<xsl:value-of select="@instead"/>
+ </xsl:when>
+ <xsl:when test="contains($type,'interface')">
+ <xsl:value-of select="@instead"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@instead"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="create-link">
+ <xsl:with-param name="type" select="$type"/>
+ <xsl:with-param name="to" select="$to"/>
+ <xsl:with-param name="val" select="@instead"/>
+ </xsl:call-template>
+instead.</para></warning>
+</para>
+</xsl:template>
+
+<xsl:template match="doc:permission">
+<para role="permission">
+<xsl:apply-templates />
+</para>
+</xsl:template>
+
+<xsl:template match="doc:errors">
+<para role="errors">
+<xsl:apply-templates />
+</para>
+</xsl:template>
+
+<xsl:template match="doc:seealso">
+<para>
+See also:
+<xsl:apply-templates />
+
+</para>
+</xsl:template>
+
+<xsl:template name="create-link">
+ <xsl:param name="type"/>
+ <xsl:param name="to"/>
+ <xsl:param name="val"/>
+
+ <xsl:choose>
+ <xsl:when test="contains($type,'property')">
+ <link><xsl:attribute name="linkend"><xsl:value-of select="$to"/></xsl:attribute><literal><xsl:value-of select="$val"/></literal></link>
+ </xsl:when>
+ <xsl:when test="contains($type,'signal')">
+ <link><xsl:attribute name="linkend"><xsl:value-of select="$to"/></xsl:attribute><literal><xsl:value-of select="$val"/></literal></link>
+ </xsl:when>
+ <xsl:when test="contains($type,'method')">
+ <link><xsl:attribute name="linkend"><xsl:value-of select="$to"/></xsl:attribute><function><xsl:value-of select="$val"/></function></link>
+ </xsl:when>
+ <xsl:when test="contains($type,'interface')">
+ <link><xsl:attribute name="linkend"><xsl:value-of select="$to"/></xsl:attribute><xsl:value-of select="$val"/></link>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="doc:ref">
+ <xsl:call-template name="create-link">
+ <xsl:with-param name="type" select="@type"/>
+ <xsl:with-param name="to" select="@to"/>
+ <xsl:with-param name="val" select="."/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="method-doc">
+ <xsl:apply-templates select="doc:doc/doc:description"/>
+
+ <variablelist role="params">
+ <xsl:for-each select="arg">
+<varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term>
+<listitem><simpara><xsl:apply-templates select="doc:doc/doc:summary"/></simpara></listitem>
+</varlistentry>
+ </xsl:for-each>
+ </variablelist>
+
+ <xsl:apply-templates select="doc:doc/doc:since"/>
+ <xsl:apply-templates select="doc:doc/doc:deprecated"/>
+
+ <xsl:choose>
+ <xsl:when test="count(doc:doc/doc:errors) > 0">
+ <refsect3>
+ <title>Errors</title>
+ <variablelist role="errors">
+ <xsl:for-each select="doc:doc/doc:errors/doc:error">
+ <varlistentry>
+ <term><parameter><xsl:value-of select="@name"/></parameter>:</term>
+ <listitem><simpara><xsl:apply-templates select="."/></simpara></listitem>
+ </varlistentry>
+ </xsl:for-each>
+ </variablelist>
+ </refsect3>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="count(doc:doc/doc:permission) > 0">
+ <refsect3>
+ <title>Permissions</title>
+ <xsl:apply-templates select="doc:doc/doc:permission"/>
+ </refsect3>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates select="doc:doc/doc:seealso"/>
+</xsl:template>
+
+<xsl:template name="method-details">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///method">
+ <refsect2>
+ <title><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"/> ()</title>
+<indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm>
+<programlisting><xsl:value-of select="@name"/> (<xsl:call-template name="method-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/><xsl:with-param name="prefix" select="."/></xsl:call-template>)</programlisting>
+ </refsect2>
+
+ <xsl:call-template name="method-doc"/>
+
+ </xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="properties-synopsis">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="///property/@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///property">
+<link><xsl:attribute name="linkend"><xsl:value-of select="$basename"/>:<xsl:value-of select="@name"/></xsl:attribute>'<xsl:value-of select="@name"/>'</link><xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$longest - string-length(@name) + 1"/></xsl:call-template> <xsl:call-template name="property-args"><xsl:with-param name="indent" select="$longest + 2"/></xsl:call-template>
+</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="signals-synopsis">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="///signal/@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///signal">
+<link><xsl:attribute name="linkend"><xsl:value-of select="$basename"/>::<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/></link><xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$longest - string-length(@name) + 1"/></xsl:call-template>(<xsl:call-template name="signal-args"><xsl:with-param name="indent" select="$longest + 2"/><xsl:with-param name="prefix" select="///signal"/></xsl:call-template>)
+</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="methods-synopsis">
+ <xsl:param name="basename"/>
+ <xsl:variable name="longest">
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="///method/@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:for-each select="///method">
+<link><xsl:attribute name="linkend"><xsl:value-of select="$basename"/>.<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/></link><xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$longest - string-length(@name) + 1"/></xsl:call-template>(<xsl:call-template name="method-args"><xsl:with-param name="indent" select="$longest + 2"/><xsl:with-param name="prefix" select="///method"/></xsl:call-template>)
+</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="method-args"><xsl:param name="indent"/><xsl:param name="prefix"/><xsl:variable name="longest"><xsl:call-template name="find-longest"><xsl:with-param name="set" select="$prefix/arg/@type"/></xsl:call-template></xsl:variable><xsl:for-each select="arg"><xsl:value-of select="@direction"/>
+<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="4 - string-length(@direction)"/></xsl:call-template>'<xsl:value-of select="@type"/>'<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$longest - string-length(@type) + 1"/></xsl:call-template>
+<xsl:value-of select="@name"/><xsl:if test="not(position() = last())">,
+<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$indent"/></xsl:call-template></xsl:if>
+</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="signal-args"><xsl:param name="indent"/><xsl:param name="prefix"/><xsl:variable name="longest"><xsl:call-template name="find-longest"><xsl:with-param name="set" select="$prefix/arg/@type"/></xsl:call-template></xsl:variable><xsl:for-each select="arg">'<xsl:value-of select="@type"/>'<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$longest - string-length(@type) + 1"/></xsl:call-template>
+<xsl:value-of select="@name"/><xsl:if test="not(position() = last())">,
+<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="$indent"/></xsl:call-template></xsl:if>
+</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="property-args"><xsl:param name="indent"/>
+<xsl:value-of select="@access"/><xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="9 - string-length(@access) + 1"/></xsl:call-template>'<xsl:value-of select="@type"/>'
+</xsl:template>
+
+
+<xsl:template name="pad-spaces">
+ <xsl:param name="width"/>
+ <xsl:variable name="spaces" xml:space="preserve"> </xsl:variable>
+ <xsl:value-of select="substring($spaces,1,$width)"/>
+</xsl:template>
+
+
+<xsl:template name="find-longest">
+ <xsl:param name="set"/>
+ <xsl:param name="index" select="1"/>
+ <xsl:param name="longest" select="0"/>
+
+ <xsl:choose>
+ <xsl:when test="$index > count($set)">
+ <!--finished looking-->
+ <xsl:value-of select="$longest"/>
+ </xsl:when>
+ <xsl:when test="string-length($set[$index])>$longest">
+ <!--found new longest-->
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="$set"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="longest" select="string-length($set[$index])"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--this isn't any longer-->
+ <xsl:call-template name="find-longest">
+ <xsl:with-param name="set" select="$set"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="longest" select="$longest"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template name="interface-basename">
+ <xsl:param name="str"/>
+ <xsl:choose>
+ <xsl:when test="contains($str,'.')">
+ <xsl:call-template name="interface-basename">
+ <xsl:with-param name="str" select="substring-after($str,'.')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$str"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>