pax_global_header00006660000000000000000000000064115373566660014534gustar00rootroot0000000000000052 comment=04394bad2ee838a9e5cc2035571f25e7d02772d8 shr-specs-2011.03.08.2/000077500000000000000000000000001153735666600141775ustar00rootroot00000000000000shr-specs-2011.03.08.2/LICENSE000066400000000000000000000001311153735666600151770ustar00rootroot00000000000000This work is licensed under CC-BY-SA. http://creativecommons.org/licenses/by-sa/3.0/de/ shr-specs-2011.03.08.2/Makefile.am000066400000000000000000000010361153735666600162330ustar00rootroot00000000000000SUBDIRS = \ org.shr.phonefso \ org.shr.phoneui EXTRA_DIST = shr-specs.pc.in pkgconfigdir = $(datadir)/pkgconfig dist_pkgconfig_DATA = shr-specs.pc install-data-local: $(MAKE) $(INSTALL) -d $(DESTDIR)/$(datadir)/shr-specs/xml for i in xml/*.xml; do $(INSTALL) -m 0644 $$i $(DESTDIR)/$(datadir)/shr-specs/$$i; done MAINTAINERCLEANFILES = \ aclocal.m4 compile config.guess config.sub \ configure depcomp install-sh ltmain.sh \ Makefile.in missing config.h.in \ mkinstalldirs \ src/*.h src/*.c .deps xml/*.xml shr-specs-2011.03.08.2/autogen.sh000077500000000000000000000002511153735666600161760ustar00rootroot00000000000000#!/bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? $srcdir/configure "$@" shr-specs-2011.03.08.2/configure.ac000066400000000000000000000022031153735666600164620ustar00rootroot00000000000000############################################################################## # init AC_INIT([shr-specs], [2011.03.08.2], [shr-devel@lists.shr-project.org], [shr-specs]) AC_CONFIG_SRCDIR([tools/rules.mk]) AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-bzip2]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) ############################################################################## # xlst is necessary for specs generation AC_PATH_PROG(XSLTPROC, xsltproc, no) AC_SUBST(XSLTPROC) if test $XSLTPROC = "no"; then AC_MSG_ERROR([xsltproc is mandatory for this package]) fi ############################################################################## # python is mandatory for docs generation AC_PATH_PROG(PYTHON, python, no) AC_SUBST(PYTHON) if test $PYTHON = "no"; then AC_MSG_ERROR([python is mandatory for this package]) fi ############################################################################## # output AC_CONFIG_FILES([ Makefile shr-specs.pc ]) AC_OUTPUT echo echo echo echo "shr-specs configured successfully." echo echo "Now type 'make' to compile and 'make install' to install this package." shr-specs-2011.03.08.2/html/000077500000000000000000000000001153735666600151435ustar00rootroot00000000000000shr-specs-2011.03.08.2/html/index.html000066400000000000000000000040251153735666600171410ustar00rootroot00000000000000 SHR DBus Interface Specification
SHR DBus Interface Specification

The SHR phone system via the DBus IPC system. This page links to reference works which can be used when programming for devices running the freesmartphone.org development platform. This reference is primarily intended for software developers. You may want to try out a few DBus Tutorials before diving into these documents.


Table of Contents — SHR Version 0.0.1


0. Introduction

1. PhoneUI API org.shr.phoneui


| Specified 2009 by the SHR team | Join us and discuss further drafts via shr-devel (at) shr-project (dot) org |
shr-specs-2011.03.08.2/org.shr.phonefso/000077500000000000000000000000001153735666600174015ustar00rootroot00000000000000shr-specs-2011.03.08.2/org.shr.phonefso/Makefile000066400000000000000000000001031153735666600210330ustar00rootroot00000000000000 files = \ org.shr.phonefso.Usage.xml include ../tools/rules.mk shr-specs-2011.03.08.2/org.shr.phonefso/docbook-org.shr.phonefso.Usage.xml000066400000000000000000000064301153735666600260110ustar00rootroot00000000000000 SHR phonefso Usage Interface org.shr.phonefso.Usage org.shr.phonefso.Usage Usage interface Methods RequestResource (in 's'resource) ReleaseResource (in 's'resource) GetResourceState (in 's'resource, out 'b'state) Implemented Interfaces org.shr.phonefso.Usage implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Usage.RequestResource"/>RequestResource () RequestResource Usage RequestResource (in 's' resource) resource: <anchor role="function" id="Usage.ReleaseResource"/>ReleaseResource () ReleaseResource Usage ReleaseResource (in 's' resource) resource: <anchor role="function" id="Usage.GetResourceState"/>GetResourceState () GetResourceState Usage GetResourceState (in 's' resource, out 'b' state) resource: state: shr-specs-2011.03.08.2/org.shr.phonefso/org.shr.phonefso.Usage.xml.in000066400000000000000000000026571153735666600250070ustar00rootroot00000000000000 SHR phonefso Usage Interface 0.0.0.1 shr-specs-2011.03.08.2/org.shr.phoneui/000077500000000000000000000000001153735666600172275ustar00rootroot00000000000000shr-specs-2011.03.08.2/org.shr.phoneui/Makefile000066400000000000000000000004571153735666600206750ustar00rootroot00000000000000 files = \ org.shr.phoneui.Dialer.xml \ org.shr.phoneui.Contacts.xml \ org.shr.phoneui.CallManagement.xml \ org.shr.phoneui.Notification.xml \ org.shr.phoneui.Messages.xml \ org.shr.phoneui.PhoneLog.xml \ org.shr.phoneui.IdleScreen.xml \ org.shr.phoneui.Settings.xml include ../tools/rules.mk shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.CallManagement.xml000066400000000000000000000113501153735666600272660ustar00rootroot00000000000000 SHR phoneui CallManagement Interface org.shr.phoneui.CallManagement org.shr.phoneui.CallManagement CallManagement interface Methods DisplayIncoming (in 'i'call_id, in 'i'status, in 's'number) HideIncoming (in 'i'call_id) DisplayOutgoing (in 'i'call_id, in 'i'status, in 's'number) HideOutgoing (in 'i'call_id) Implemented Interfaces org.shr.phoneui.CallManagement implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="CallManagement.DisplayIncoming"/>DisplayIncoming () DisplayIncoming CallManagement DisplayIncoming (in 'i' call_id, in 'i' status, in 's' number) call_id: status: number: <anchor role="function" id="CallManagement.HideIncoming"/>HideIncoming () HideIncoming CallManagement HideIncoming (in 'i' call_id) call_id: <anchor role="function" id="CallManagement.DisplayOutgoing"/>DisplayOutgoing () DisplayOutgoing CallManagement DisplayOutgoing (in 'i' call_id, in 'i' status, in 's' number) call_id: status: number: <anchor role="function" id="CallManagement.HideOutgoing"/>HideOutgoing () HideOutgoing CallManagement HideOutgoing (in 'i' call_id) call_id: shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.Contacts.xml000066400000000000000000000102731153735666600261770ustar00rootroot00000000000000 SHR phoneui Contacts Interface org.shr.phoneui.Contacts org.shr.phoneui.Contacts Contacts interface Methods DisplayList (in 'a{sv}'filter) DisplayContact (in 's'path) CreateContact (in 'a{sv}'values, out 's'path) EditContact (in 's'path) Implemented Interfaces org.shr.phoneui.Contacts implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Contacts.DisplayList"/>DisplayList () DisplayList Contacts DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of contacts to be shown. <anchor role="function" id="Contacts.DisplayContact"/>DisplayContact () DisplayContact Contacts DisplayContact (in 's' path) path: the DBus path of the contact to show <anchor role="function" id="Contacts.CreateContact"/>CreateContact () CreateContact Contacts CreateContact (in 'a{sv}' values, out 's' path) values: Values to be prefilled for the new contact path: the DBus path of the freshly created contact <anchor role="function" id="Contacts.EditContact"/>EditContact () EditContact Contacts EditContact (in 's' path) path: the DBus path for the contact to be edited shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.Dialer.xml000066400000000000000000000034401153735666600256170ustar00rootroot00000000000000 SHR phoneui Dialer Interface org.shr.phoneui.Dialer org.shr.phoneui.Dialer Dialer interface Methods Display (in 'a{sv}'values) Implemented Interfaces org.shr.phoneui.Dialer implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Dialer.Display"/>Display () Display Dialer Display (in 'a{sv}' values) values: Values to prefill the Dialer screen with shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.Messages.xml000066400000000000000000000063541153735666600261750ustar00rootroot00000000000000 SHR phoneui Messages Interface org.shr.phoneui.Messages org.shr.phoneui.Messages Messages interface Methods DisplayList (in 'a{sv}'filter) DisplayMessage (in 's'path) CreateMessage (in 'a{sv}'values) Implemented Interfaces org.shr.phoneui.Messages implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Messages.DisplayList"/>DisplayList () DisplayList Messages DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of messages to be shown. <anchor role="function" id="Messages.DisplayMessage"/>DisplayMessage () DisplayMessage Messages DisplayMessage (in 's' path) path: the DBus path of the message to show <anchor role="function" id="Messages.CreateMessage"/>CreateMessage () CreateMessage Messages CreateMessage (in 'a{sv}' values) values: Values to be prefilled for the new message shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.Notification.xml000066400000000000000000000076761153735666600270640ustar00rootroot00000000000000 SHR phoneui Notification Interface org.shr.phoneui.Notification org.shr.phoneui.Notification Notification interface Methods DisplaySimAuth (in 'i'status) HideSimAuth (in 'i'status) DisplayUssd (in 'i'mode, in 's'message) DisplayDialog (in 'i'dialog) Implemented Interfaces org.shr.phoneui.Notification implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Notification.DisplaySimAuth"/>DisplaySimAuth () DisplaySimAuth Notification DisplaySimAuth (in 'i' status) status: <anchor role="function" id="Notification.HideSimAuth"/>HideSimAuth () HideSimAuth Notification HideSimAuth (in 'i' status) status: <anchor role="function" id="Notification.DisplayUssd"/>DisplayUssd () DisplayUssd Notification DisplayUssd (in 'i' mode, in 's' message) mode: message: <anchor role="function" id="Notification.DisplayDialog"/>DisplayDialog () DisplayDialog Notification DisplayDialog (in 'i' dialog) dialog: shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneui.PhoneLog.xml000066400000000000000000000035521153735666600261360ustar00rootroot00000000000000 SHR phoneui PhoneLog Interface org.shr.phoneui.PhoneLog org.shr.phoneui.PhoneLog PhoneLog interface Methods DisplayList (in 'a{sv}'filter) Implemented Interfaces org.shr.phoneui.PhoneLog implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="PhoneLog.DisplayList"/>DisplayList () DisplayList PhoneLog DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of calls to be shown. shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.CallManagement.xml000066400000000000000000000113571153735666600274410ustar00rootroot00000000000000 SHR phoneuid CallManagement Interface org.shr.phoneuid.CallManagement org.shr.phoneuid.CallManagement CallManagement interface Methods DisplayIncoming (in 'i'call_id, in 'i'status, in 's'number) HideIncoming (in 'i'call_id) DisplayOutgoing (in 'i'call_id, in 'i'status, in 's'number) HideOutgoing (in 'i'call_id) Implemented Interfaces org.shr.phoneuid.CallManagement implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="CallManagement.DisplayIncoming"/>DisplayIncoming () DisplayIncoming CallManagement DisplayIncoming (in 'i' call_id, in 'i' status, in 's' number) call_id: status: number: <anchor role="function" id="CallManagement.HideIncoming"/>HideIncoming () HideIncoming CallManagement HideIncoming (in 'i' call_id) call_id: <anchor role="function" id="CallManagement.DisplayOutgoing"/>DisplayOutgoing () DisplayOutgoing CallManagement DisplayOutgoing (in 'i' call_id, in 'i' status, in 's' number) call_id: status: number: <anchor role="function" id="CallManagement.HideOutgoing"/>HideOutgoing () HideOutgoing CallManagement HideOutgoing (in 'i' call_id) call_id: shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.Contacts.xml000066400000000000000000000102561153735666600263440ustar00rootroot00000000000000 SHR phoneuid Contacts Interface org.shr.phoneuid.Contacts org.shr.phoneuid.Contacts Contacts interface Methods DisplayList (in 'a{sv}'filter) DisplayItem (in 's'path) CreateContact (in 'a{sv}'values, out 's'path) EditContact (in 's'path) Implemented Interfaces org.shr.phoneuid.Contacts implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Contacts.DisplayList"/>DisplayList () DisplayList Contacts DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of contacts to be shown. <anchor role="function" id="Contacts.DisplayItem"/>DisplayItem () DisplayItem Contacts DisplayItem (in 's' path) path: the DBus path of the contact to show <anchor role="function" id="Contacts.CreateContact"/>CreateContact () CreateContact Contacts CreateContact (in 'a{sv}' values, out 's' path) values: Values to be prefilled for the new contact path: the DBus path of the freshly created contact <anchor role="function" id="Contacts.EditContact"/>EditContact () EditContact Contacts EditContact (in 's' path) path: the DBus path for the contact to be edited shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.Dialer.xml000066400000000000000000000034471153735666600257720ustar00rootroot00000000000000 SHR phoneuid Dialer Interface org.shr.phoneuid.Dialer org.shr.phoneuid.Dialer Dialer interface Methods Display (in 'a{sv}'values) Implemented Interfaces org.shr.phoneuid.Dialer implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Dialer.Display"/>Display () Display Dialer Display (in 'a{sv}' values) values: Values to prefill the Dialer screen with shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.Dialogs.xml000066400000000000000000000075461153735666600261600ustar00rootroot00000000000000 SHR phoneuid Dialogs Interface org.shr.phoneuid.Dialogs org.shr.phoneuid.Dialogs Dialogs interface Methods DisplaySimAuth (in 'i'status) HideSimAuth (in 'i'status) DisplayUssd (in 'i'mode, in 's'message) DisplayDialog (in 'i'dialog) Implemented Interfaces org.shr.phoneuid.Dialogs implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Dialogs.DisplaySimAuth"/>DisplaySimAuth () DisplaySimAuth Dialogs DisplaySimAuth (in 'i' status) status: <anchor role="function" id="Dialogs.HideSimAuth"/>HideSimAuth () HideSimAuth Dialogs HideSimAuth (in 'i' status) status: <anchor role="function" id="Dialogs.DisplayUssd"/>DisplayUssd () DisplayUssd Dialogs DisplayUssd (in 'i' mode, in 's' message) mode: message: <anchor role="function" id="Dialogs.DisplayDialog"/>DisplayDialog () DisplayDialog Dialogs DisplayDialog (in 'i' dialog) dialog: shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.Messages.xml000066400000000000000000000063411153735666600263350ustar00rootroot00000000000000 SHR phoneuid Messages Interface org.shr.phoneuid.Messages org.shr.phoneuid.Messages Messages interface Methods DisplayList (in 'a{sv}'filter) DisplayItem (in 's'path) CreateMessage (in 'a{sv}'values) Implemented Interfaces org.shr.phoneuid.Messages implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="Messages.DisplayList"/>DisplayList () DisplayList Messages DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of messages to be shown. <anchor role="function" id="Messages.DisplayItem"/>DisplayItem () DisplayItem Messages DisplayItem (in 's' path) path: the DBus path of the message to show <anchor role="function" id="Messages.CreateMessage"/>CreateMessage () CreateMessage Messages CreateMessage (in 'a{sv}' values) values: Values to be prefilled for the new message shr-specs-2011.03.08.2/org.shr.phoneui/docbook-org.shr.phoneuid.PhoneLog.xml000066400000000000000000000035611153735666600263020ustar00rootroot00000000000000 SHR phoneuid PhoneLog Interface org.shr.phoneuid.PhoneLog org.shr.phoneuid.PhoneLog PhoneLog interface Methods DisplayList (in 'a{sv}'filter) Implemented Interfaces org.shr.phoneuid.PhoneLog implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties Properties Details <anchor role="function" id="PhoneLog.DisplayList"/>DisplayList () DisplayList PhoneLog DisplayList (in 'a{sv}' filter) filter: List of filter attributes to limit the list of calls to be shown. shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.CallManagement.xml.in000066400000000000000000000023701153735666600262570ustar00rootroot00000000000000 SHR phoneui CallManagement Interface 0.0.0.1 shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.Contacts.xml.in000066400000000000000000000035421153735666600251670ustar00rootroot00000000000000 SHR phoneui Contacts Interface 0.0.0.1 The Contacts Interface is used to show the different contact screens to show a list of contacts, a contact itself, edit or add a contact. List of filter attributes to limit the list of contacts to be shown. the DBus path of the contact to show Values to be prefilled for the new contact the DBus path of the freshly created contact the DBus path for the contact to be edited shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.Dialer.xml.in000066400000000000000000000014511153735666600246060ustar00rootroot00000000000000 SHR phoneui Dialer Interface 0.0.0.1 The Dialer Interface is used to show the Dialer screen - optionally prefilled with some values Values to prefill the Dialer screen with shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.IdleScreen.xml.in000066400000000000000000000016551153735666600254310ustar00rootroot00000000000000 SHR phoneui IdleScreen Interface 0.0.0.1 shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.Messages.xml.in000066400000000000000000000026721153735666600251630ustar00rootroot00000000000000 SHR phoneui Messages Interface 0.0.0.1 The Messages Interface is used to show the different message screens, as the list of messages, a message itself or a screen to write a new message. List of filter attributes to limit the list of messages to be shown. the DBus path of the message to show Values to be prefilled for the new message shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.Notification.xml.in000066400000000000000000000024431153735666600260360ustar00rootroot00000000000000 SHR phoneui Notification Interface 0.0.0.1 shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.PhoneLog.xml.in000066400000000000000000000016051153735666600251220ustar00rootroot00000000000000 SHR phoneui PhoneLog Interface 0.0.0.1 The PhoneLog Interface is used to show the screen with a list of call events (incoming, outgoing, missed) optionally filtered by some criteria. List of filter attributes to limit the list of calls to be shown. shr-specs-2011.03.08.2/org.shr.phoneui/org.shr.phoneui.Settings.xml.in000066400000000000000000000017051153735666600252100ustar00rootroot00000000000000 SHR phoneui Settings Interface 0.0.0.1 shr-specs-2011.03.08.2/shr-specs.pc.in000066400000000000000000000005411153735666600170370ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ datarootdir=@datarootdir@ #pkgdatadir=${datarootdir}/@PACKAGE@ pkgdatadir=${datarootdir}/shr-specs includedir=@includedir@ specsdir=${pkgdatadir}/xml Name: shr-specs Description: shr-project.org DBus API introspection data Requires: Version: @VERSION@ Cflags: -DSHR_SPECS_DIR='\"${specsdir}\"' shr-specs-2011.03.08.2/tools/000077500000000000000000000000001153735666600153375ustar00rootroot00000000000000shr-specs-2011.03.08.2/tools/gendoc000077500000000000000000000001541153735666600165240ustar00rootroot00000000000000#!/bin/sh for file in ../*/*.xml.in do echo converting $file... python makedoc.py $file >/dev/null done shr-specs-2011.03.08.2/tools/makedoc.py000077500000000000000000000365621153735666600173330ustar00rootroot00000000000000#!/usr/bin/env python # (C) 2008-2011 Michael 'Mickey' Lauer # GPLv2 or later. """ Yes, I'm aware that this could have been solved with xslt in a much more elegant way. Alas, I'm a very learning-resistant person sometimes... This time I even tried to wrap my head around docbook, xslt, and stuff -- but I really couldn't get it. Then I gave up and wrote this. It's not versatile, but it gets my job done. """ __version__ = "0.9.9.3" import sys from xml.sax import parse from xml.sax.handler import ContentHandler #----------------------------------------------------------------------------# class Entity( object ): #----------------------------------------------------------------------------# def __init__( self, name, attrs=None ): print( "creating entity: ", self.__class__.__name__, name ) self.name = name self.attrs = attrs self.title = "Untitled" def output( self ): pass def out( self ): return "" def outputSectionHeader( self, content, size=1 ): return "%s" % ( size, content, size ) def outputParagraph( self, content ): return "

%s

" % ( content ) def outputTypewriter( self, content ): return "%s" % ( content ) def outputAnchorLink( self, content ): return """%s""" % ( content, content ) def outputAnchorLabel( self, content ): return """%s""" % ( content, content ) def outputCrosslinked( self, content ): result = "" for word in content.split( ' ' ): if word.startswith( "org.freesmartphone" ): word = word.strip( ",./:;()" ) dotted = word.split( '.' ) html, method = '.'.join( dotted[:-1] ), dotted[-1] print( "possible link to %s.%s detected", html, method ) result += """%s""" % ( html, method, method ) else: result += word result += " " return result def outputDescription( self, content ): # check for crosslinks result = "Description: " result += self.outputCrosslinked( content ) return result def outputImplementationNote( self, content ): return """
%s
""" % self.outputSemiFormatted( content ) def outputSemiFormatted( self, content ): content = self.outputCrosslinked( content ) """convert known html entities""" for i in "ul ol li".split(): content = content.replace( "[%s]" % i, "<%s>" % i ) content = content.replace( "[/%s]" % i, "" % i ) return """

%s

""" % content def outputList( self, entries ): if not len( entries ): return "None\n" else: t = "\n" return t def outputHeader( self, cssfile=None ): return \ """ %s
SHR DBus Interface Specification
""" % ( self.title ) def outputFooter( self ): return \ """
| Specified 2009 by the SHR team. | Join us and discuss further drafts shr-devel (at) shr-project (dot) org
""" #----------------------------------------------------------------------------# class Interface( Entity ): #----------------------------------------------------------------------------# def __init__( self, filename ): Entity.__init__( self, None, None ) self.filename = filename self.methods = [] self.signals = [] self.errors = [] self.outfile = None self.namespace = "Unknown" self.description = "Unknown" def output( self ): import os.path basename = os.path.basename( self.filename ).replace( ".xml.in", ".html" ) dirname = os.path.dirname( __file__ ) self.outfilename = "%s/../html/%s" % ( dirname, basename ) self.outfile = open( self.outfilename, "w" ) text = self.outputHeader( __file__.replace( "makedoc.py", "style.xml" ) ) text += "\n" text += self.outputSectionHeader( self.namespace ) # description text += self.outputSectionHeader( "Description", 2 ) text += "\n" text += self.outputParagraph( self.description ) text += "\n" # namespace text += self.outputSectionHeader( "Namespace", 2 ) text += "\n" text += self.outputParagraph( self.outputTypewriter( self.namespace ) ) text += "\n" # method overview text += self.outputSectionHeader( "Methods", 2 ) text += self.outputList( [ self.outputAnchorLink(method.name) for method in self.methods ] ) # signal overview text += self.outputSectionHeader( "Signals", 2 ) text += self.outputList( [ self.outputAnchorLink(method.name) for method in self.signals ] ) # error overview text += self.outputSectionHeader( "Errors", 2 ) text += self.outputList( [ self.outputAnchorLink(method.name) for method in self.errors ] ) # methods en detail if len( self.methods ): text += self.outputSectionHeader( "Methods" ) for m in self.methods: text += m.out() # signals en detail if len( self.signals ): text += self.outputSectionHeader( "Signals" ) for s in self.signals: text += s.out() # errors en detail if len( self.errors ): text += self.outputSectionHeader( "Errors" ) for e in self.errors: text += e.out() text += self.outputFooter() text += "\n" assert self.outfile is not None self.outfile.write( text ) #----------------------------------------------------------------------------# class Describable( Entity ): #----------------------------------------------------------------------------# def __init__( self, name, attrs ): Entity.__init__( self, name, attrs ) self.description = None self.inote = None def describe( self ): text = "" if self.description is not None: text += self.outputParagraph( self.outputDescription( self.description ) ) if self.inote is not None: text += self.outputParagraph( self.outputImplementationNote( self.inote ) ) return text def __repr__( self ): return "" % self.name #----------------------------------------------------------------------------# class Method( Describable ): #----------------------------------------------------------------------------# def __init__( self, name, attrs ): Describable.__init__( self, name, attrs ) self.args = [] def signature( self ): outparam = "" inparam = "" try: for arg in self.args: if arg.attrs["direction"] == "in": inparam += arg.attrs["type"] elif arg.attrs["direction"] == "out": outparam += arg.attrs["type"] else: raise KeyError( "Direction neither 'in' nor 'out'" ) except KeyError as e: print >>sys.stderr, "[ERROR] Invalid signature for method", self, e sys.exit( -1 ) return inparam, outparam def out( self ): text = "" inparam, outparam = self.signature() if inparam and outparam: text += "%s ( %s ) → %s" % ( self.outputAnchorLabel( self.name ), inparam, outparam ) text = self.outputSectionHeader( text, 3 ) text += "\n" text += self.describe() text += self.inparam() text += self.outparam() elif inparam and not outparam: text += "%s ( %s )" % ( self.outputAnchorLabel( self.name ), inparam ) text = self.outputSectionHeader( text, 3 ) text += "\n" text += self.describe() text += self.inparam() elif not inparam and outparam: text += "%s ( ) → %s" % ( self.outputAnchorLabel( self.name ), outparam ) text = self.outputSectionHeader( text, 3 ) text += "\n" text += self.describe() text += self.outparam() else: text += "%s ( )" % ( self.outputAnchorLabel( self.name ) ) text = self.outputSectionHeader( text, 3 ) text += self.describe() text += "\n" return text def inparam( self ): text = self.outputSectionHeader( "Parameters", 4 ) for arg in self.args: if arg.attrs["direction"] == "in": text += arg.out() return text def outparam( self ): text = self.outputSectionHeader( "Returns", 4 ) for arg in self.args: if arg.attrs["direction"] == "out": text += arg.out() return text #----------------------------------------------------------------------------# class Signal( Describable ): #----------------------------------------------------------------------------# def __init__( self, name, attrs ): Describable.__init__( self, name, attrs ) self.args = [] def signature( self ): param = "" for arg in self.args: param += arg.attrs["type"] return param def out( self ): text = "" param = self.signature() if param: text += "%s ( %s )" % ( self.outputAnchorLabel( self.name ), param ) text = self.outputSectionHeader( text, 3 ) text += self.describe() text += self.param() else: text += "%s ( )" % ( self.outputAnchorLabel( self.name ) ) text = self.outputSectionHeader( text, 3 ) text += "\n" return text def param( self ): text = self.outputSectionHeader( "Parameters", 4 ) for arg in self.args: text += arg.out() return text #----------------------------------------------------------------------------# class Error( Describable ): #----------------------------------------------------------------------------# def __init__( self, name, attrs ): Describable.__init__( self, name, attrs ) def out( self ): text = "" text += "%s" % ( self.outputAnchorLabel( self.name ) ) text = self.outputSectionHeader( text, 3 ) text += self.describe() text += "\n" return text #----------------------------------------------------------------------------# class Argument( Entity ): #----------------------------------------------------------------------------# def __init__( self, name, attrs ): Entity.__init__( self, name, attrs ) self.docs = "" def out( self ): text = "" text += "%s: %s%s" % ( self.attrs["type"], self.attrs["name"], self.outputSemiFormatted( self.docs ) ) return text #----------------------------------------------------------------------------# class Handler( ContentHandler ): #----------------------------------------------------------------------------# def __init__( self, iface ): ContentHandler.__init__( self ) self.iface = iface self.parent = None self.current = None self.doc = None self.method = None self.signal = None self.error = None self.arg = None self.text = "" self.significantElements = "node interface method signal error arg".split() def startDocument( self ): pass def endDocument( self ): pass def startElement( self, element, attrs ): if element in self.significantElements: print( "--- setting current element to ", element ) self.current = element if element.startswith( "doc:" ): self.doc = element.split( ':' )[1] self.name = attrs.get( "name", "" ) self.attrs = attrs print( element, self.name, "(in %s)" % self.current or None ) if element == "interface": self.iface.namespace = self.name.strip() elif element == "method": self.method = Method( self.name.strip(), attrs ) elif element == "arg": self.arg = Argument( self.name.strip(), attrs ) elif element == "signal": self.signal = Signal( self.name.strip(), attrs ) elif element == "error": self.error = Error( self.name.strip(), attrs ) def characters( self, char ): c = char.strip() + " " if c: # print c self.text += c def endElement( self, element ): if element == "doc:summary" and self.current == "node": self.iface.title = self.text.strip() elif element == "doc:summary" and self.current == "arg": self.arg.docs = self.text.strip() elif element == "doc:para" and self.current == "interface": self.iface.description = self.text.strip() elif element == "doc:description" and self.current == "method": self.method.description = self.text.strip() elif element == "doc:description" and self.current == "signal": self.signal.description = self.text.strip() elif element == "doc:description" and self.current == "error": self.error.description = self.text.strip() elif element == "doc:inote" and self.current == "method": self.method.inote = self.text.strip() elif element == "method": assert self.method is not None self.iface.methods.append( self.method ) self.method = None elif element == "signal": assert self.signal is not None self.iface.signals.append( self.signal ) self.signal = None elif element == "error": assert self.error is not None self.iface.errors.append( self.error ) self.error = None elif element == "arg": assert self.arg is not None if self.method is not None: self.method.args.append( self.arg ) else: self.signal.args.append( self.arg ) self.arg = None print( repr(self.text), repr(element) ) self.text = "" if element in self.significantElements: print( "resetting current element" ) self.current = None self.parent = element #----------------------------------------------------------------------------# if __name__ == "__main__": #----------------------------------------------------------------------------# import sys import xml.sax print( "parsing..." ) interfaces = [] for filename in sys.argv[1:]: interface = Interface( filename ) interfaces.append( interface ) handler = Handler( interface ) xml.sax.parse( filename, handler ) print( "creating..." ) for iface in interfaces: iface.output() shr-specs-2011.03.08.2/tools/rules.mk000066400000000000000000000015131153735666600170220ustar00rootroot00000000000000XMLLINT_FLAGS = XMLLINT = xmllint $(XMLLINT_FLAGS) XSLT_FLAGS = -o $@ ../tools/spec-strip-docs.xsl $< XSLT = xsltproc $(XSLT_FLAGS) docbook_xml_files = $(addprefix docbook-, $(files)) pydoc_html_files = $(files:.xml=.html) all: pydocs xml xml: $(files) pydocs: $(pydoc_html_files) $(pydoc_html_files): %.html: %.xml.in @echo calling pydoc on $@ ../tools/makedoc.py $< >/dev/null $(files): %.xml: %.xml.in @echo calling xsltproc spec-strip-docs on $@ ... @xsltproc -o ../xml/$@ ../tools/spec-strip-docs.xsl $< install: xml @echo nothing to install here check: @echo checking integrity... @xmllint *.xml.in >/dev/null && echo "OK" || echo "FAIL" clean: @rm -f $(files) *~ for i in $(pydoc_html_files); do rm -f ../html/$$i; done for i in $(files); do rm -f ../xml/$$i; done @rm -rf xhtml *.html maintainer-clean: clean : shr-specs-2011.03.08.2/tools/spec-strip-docs.xsl000066400000000000000000000021231153735666600211040ustar00rootroot00000000000000 shr-specs-2011.03.08.2/tools/spec-to-docbook.xsl000066400000000000000000000432361153735666600210670ustar00rootroot00000000000000 <xsl:value-of select="doc:doc/doc:summary"/> 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"/>:<xsl:value-of select="@name"/></xsl:attribute></anchor>The "<xsl:value-of select="@name"/>" property '' : <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 () Since /> is deprecated since version and should not be used in newly-written code. Use : :: . instead. See also: Implementation notes: : <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"/> () () :'' ::() .() '' , '' , '' shr-specs-2011.03.08.2/tools/style.xml000066400000000000000000000057031153735666600172260ustar00rootroot00000000000000