diff --git a/Makefile b/Makefile index 22d3f7c..c2292d9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PACKAGE = Mailer VERSION = 0.1.4 -SUBDIRS = data include po src +SUBDIRS = data doc include po src RM ?= rm -f LN ?= ln -f TAR ?= tar -czvf @@ -48,6 +48,16 @@ dist: $(PACKAGE)-$(VERSION)/data/48x48/mailer-outbox.png \ $(PACKAGE)-$(VERSION)/data/48x48/mailer-sent.png \ $(PACKAGE)-$(VERSION)/data/48x48/project.conf \ + $(PACKAGE)-$(VERSION)/doc/Makefile \ + $(PACKAGE)-$(VERSION)/doc/GRAMMAR \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc.sh \ + $(PACKAGE)-$(VERSION)/doc/project.conf \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/Makefile \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/Mailer-docs.xml \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/project.conf \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/Makefile \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/Mailer.sgml \ + $(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/project.conf \ $(PACKAGE)-$(VERSION)/include/Mailer.h \ $(PACKAGE)-$(VERSION)/include/Makefile \ $(PACKAGE)-$(VERSION)/include/project.conf \ diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..5ca83c8 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,45 @@ +SUBDIRS = gtkdoc +TARGETS = gtkdoc/Mailer.types gtkdoc/tmpl.stamp gtkdoc/sgml.stamp gtkdoc/html.stamp +PREFIX = /usr/local +DESTDIR = +RM ?= rm -f +LN ?= ln -f +MKDIR ?= mkdir -p +INSTALL ?= install + + +all: subdirs $(TARGETS) + +subdirs: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done + +gtkdoc/Mailer.types: ../config.sh + ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/Mailer.types" + +gtkdoc/tmpl.stamp: gtkdoc/Mailer.types + ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/tmpl.stamp" + +gtkdoc/sgml.stamp: gtkdoc/tmpl.stamp + ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/sgml.stamp" + +gtkdoc/html.stamp: gtkdoc/Mailer-docs.xml gtkdoc/sgml.stamp + ./gtkdoc.sh -P "$(PREFIX)" -- "gtkdoc/html.stamp" + +clean: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done + $(RM) -- $(gtkdoc/Mailer.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS) + +distclean: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done + $(RM) -- $(gtkdoc/Mailer.types_OBJS) $(gtkdoc/tmpl.stamp_OBJS) $(gtkdoc/sgml.stamp_OBJS) $(gtkdoc/html.stamp_OBJS) + $(RM) -- $(TARGETS) + +install: $(TARGETS) + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done + ./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -i -- "gtkdoc/html.stamp" + +uninstall: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done + ./gtkdoc.sh -P "$(DESTDIR)$(PREFIX)" -u -- "gtkdoc/html.stamp" + +.PHONY: all subdirs clean distclean install uninstall diff --git a/doc/gtkdoc.sh b/doc/gtkdoc.sh new file mode 100755 index 0000000..0902187 --- /dev/null +++ b/doc/gtkdoc.sh @@ -0,0 +1,160 @@ +#!/bin/sh +#$Id$ +#Copyright (c) 2012 Pierre Pronchery +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +#FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +#DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +#SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +#OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +#variables +PREFIX="/usr/local" +. "../config.sh" +DEBUG="_debug" +GTKDOC_FIXXREF="gtkdoc-fixxref" +GTKDOC_MKDB="gtkdoc-mkdb" +GTKDOC_MKHTML="gtkdoc-mkhtml" +GTKDOC_MKTMPL="gtkdoc-mktmpl" +GTKDOC_SCAN="gtkdoc-scan" +INSTALL="install -m 0644" +MKDIR="mkdir -p" +MODULE="$PACKAGE" +RM="rm -f" +TOUCH="touch" + + +#functions +#debug +_debug() +{ + echo $@ + $@ +} + + +#usage +_usage() +{ + echo "Usage: gtkdoc.sh [-i|-u][-P prefix] target" 1>&2 + return 1 +} + + +#main +install=0 +uninstall=0 +while getopts "iuP:" "name"; do + case "$name" in + i) + uninstall=0 + install=1 + ;; + u) + install=0 + uninstall=1 + ;; + P) + PREFIX="$2" + ;; + ?) + _usage + exit $? + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -eq 0 ]; then + _usage + exit $? +fi + +[ -z "$DATADIR" ] && DATADIR="$PREFIX/share" +instdir="$DATADIR/gtk-doc/html" + +while [ $# -gt 0 ]; do + target="$1" + shift + + #uninstall + if [ "$uninstall" -eq 1 ]; then + for i in gtkdoc/html/*.*; do + file="${i##*/}" + echo $DEBUG $RM "$instdir/$MODULE/$file" \ + || exit 2 + done + continue + fi + + #create + case "$target" in + gtkdoc/html.stamp) + $MKDIR "gtkdoc/html" && + (cd "gtkdoc/html" && + $DEBUG $GTKDOC_MKHTML "$MODULE" \ + "../$MODULE-docs.xml") && + (cd "gtkdoc" && + $DEBUG $GTKDOC_FIXXREF \ + --module="$MODULE" \ + --module-dir="html" \ + --html-dir="$instdir") + ;; + gtkdoc/sgml.stamp) + (cd "gtkdoc" && + $DEBUG $GTKDOC_MKDB \ + --module="$MODULE" \ + --output-dir="xml" \ + --output-format="xml" \ + --tmpl-dir="tmpl") + ;; + gtkdoc/tmpl.stamp) + (cd "gtkdoc" && + $DEBUG $GTKDOC_MKTMPL \ + --module="$MODULE" \ + --output-dir="tmpl") + ;; + gtkdoc/*.types) + (cd ".." && + $DEBUG $GTKDOC_SCAN \ + --module="$MODULE" \ + --source-dir="include" \ + --output-dir="doc/gtkdoc") + ;; + *) + echo "$0: $target: Unknown type" 1>&2 + exit 2 + ;; + esac + #XXX ignore errors + if [ $? -ne 0 ]; then + echo "$0: $target: Could not create documentation" 1>&2 + install=0 + fi + $TOUCH "$target" + + #install + if [ "$install" -eq 1 ]; then + $DEBUG $MKDIR "$instdir/$MODULE" || exit 2 + for i in gtkdoc/html/*.*; do + file="${i##*/}" + $DEBUG $INSTALL "$i" "$instdir/$MODULE/$file" \ + || exit 2 + done + fi +done diff --git a/doc/gtkdoc/Mailer-docs.xml b/doc/gtkdoc/Mailer-docs.xml new file mode 100644 index 0000000..4d3e10f --- /dev/null +++ b/doc/gtkdoc/Mailer-docs.xml @@ -0,0 +1,40 @@ + + + + + +]> + + + Mailer Reference Manual + + for Mailer &version;. + The latest version of this documentation can be found on-line at + http://&server;/Mailer/. + + + + + &title; + + + + + + + + + + API Index + + + + Index of deprecated API + + + + + diff --git a/doc/gtkdoc/Makefile b/doc/gtkdoc/Makefile new file mode 100644 index 0000000..38b7ceb --- /dev/null +++ b/doc/gtkdoc/Makefile @@ -0,0 +1,21 @@ +SUBDIRS = tmpl + + +all: subdirs + +subdirs: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done + +clean: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done + +distclean: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done + +install: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done + +uninstall: + @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done + +.PHONY: all subdirs clean distclean install uninstall diff --git a/doc/gtkdoc/project.conf b/doc/gtkdoc/project.conf new file mode 100644 index 0000000..ec91131 --- /dev/null +++ b/doc/gtkdoc/project.conf @@ -0,0 +1,2 @@ +subdirs=tmpl +dist=Makefile,Mailer-docs.xml diff --git a/doc/gtkdoc/tmpl/Mailer-unused.sgml b/doc/gtkdoc/tmpl/Mailer-unused.sgml new file mode 100644 index 0000000..e69de29 diff --git a/doc/gtkdoc/tmpl/Mailer.sgml b/doc/gtkdoc/tmpl/Mailer.sgml new file mode 100644 index 0000000..9d7c821 --- /dev/null +++ b/doc/gtkdoc/tmpl/Mailer.sgml @@ -0,0 +1,22 @@ + +Mailer + + +DeforaOS Desktop Mailer + + + +e-mail client for the DeforaOS desktop. + + + + +DeforaOS libDesktop, DeforaOS libSystem + + + + + + + + diff --git a/doc/gtkdoc/tmpl/account.sgml b/doc/gtkdoc/tmpl/account.sgml new file mode 100644 index 0000000..963297c --- /dev/null +++ b/doc/gtkdoc/tmpl/account.sgml @@ -0,0 +1,208 @@ + +Account + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@ACT_NONE: +@ACT_STRING: +@ACT_PASSWORD: +@ACT_FILE: +@ACT_UINT16: +@ACT_BOOLEAN: +@ACT_SEPARATOR: + + + + + + + + + + + + +@account: +@message: +@Returns: + + + + + + + +@account: +@message: +@Returns: + + + + + + + +@plugin: +@Returns: + + + + + + + +@account: +@message: +@ret: +@Returns: + + + + + + + +@folder: + + + + + + + +@account: +@folder: +@parent: +@type: +@name: +@Returns: + + + + + + + +@plugin: +@Returns: + + + + + + + +@plugin: +@folder: +@message: +@Returns: + + + + + + + +@account: +@Returns: + + + + + + + +@helper: +@Returns: + + + + + + + +@message: + + + + + + + +@account: +@folder: +@message: +@Returns: + + + + + + + +@message: +@buf: +@cnt: +@append: +@Returns: + + + + + + + +@message: +@header: +@Returns: + + + + + + + +@plugin: +@folder: +@message: +@Returns: + + + + + + + +@account: +@format: +@...: + + diff --git a/doc/gtkdoc/tmpl/folder.sgml b/doc/gtkdoc/tmpl/folder.sgml new file mode 100644 index 0000000..562cce7 --- /dev/null +++ b/doc/gtkdoc/tmpl/folder.sgml @@ -0,0 +1,86 @@ + +Folder + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@FT_INBOX: +@FT_DRAFTS: +@FT_SENT: +@FT_TRASH: +@FT_FOLDER: + + + + + + +@folder: +@Returns: + + + + + + + +@folder: +@Returns: + + + + + + + +@folder: +@type: + + diff --git a/doc/gtkdoc/tmpl/helper.sgml b/doc/gtkdoc/tmpl/helper.sgml new file mode 100644 index 0000000..77f1ca3 --- /dev/null +++ b/doc/gtkdoc/tmpl/helper.sgml @@ -0,0 +1,49 @@ + +Helper + + + + + + + + + + + + + + + + + + + + + + + + + +@header: +@Returns: + + + + + + + +@header: +@Returns: + + + + + + + +@email: +@Returns: + + diff --git a/doc/gtkdoc/tmpl/mailer.sgml b/doc/gtkdoc/tmpl/mailer.sgml new file mode 100644 index 0000000..f534726 --- /dev/null +++ b/doc/gtkdoc/tmpl/mailer.sgml @@ -0,0 +1,87 @@ + +Mailer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@MFC_ACCOUNT: +@MFC_ENABLED: +@MFC_DELETE: +@MFC_FOLDER: +@MFC_ICON: +@MFC_NAME: + + + + + + +@MHC_ACCOUNT: +@MHC_FOLDER: +@MHC_MESSAGE: +@MHC_ICON: +@MHC_SUBJECT: +@MHC_FROM: +@MHC_FROM_EMAIL: +@MHC_TO: +@MHC_TO_EMAIL: +@MHC_DATE: +@MHC_DATE_DISPLAY: +@MHC_READ: +@MHC_WEIGHT: + diff --git a/doc/gtkdoc/tmpl/message.sgml b/doc/gtkdoc/tmpl/message.sgml new file mode 100644 index 0000000..aaf45e9 --- /dev/null +++ b/doc/gtkdoc/tmpl/message.sgml @@ -0,0 +1,44 @@ + +Message + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@message: +@header: +@Returns: + + diff --git a/doc/gtkdoc/tmpl/plugin.sgml b/doc/gtkdoc/tmpl/plugin.sgml new file mode 100644 index 0000000..ef063ca --- /dev/null +++ b/doc/gtkdoc/tmpl/plugin.sgml @@ -0,0 +1,86 @@ + +MailerPlugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@plugin: +@Returns: + + + + + + + +@account: +@message: +@ret: +@Returns: + + + + + + + +@folder: +@Returns: + + + + + + + +@plugin: +@Returns: + + + + + + + +@helper: +@Returns: + + + + + + + +@plugin: +@folder: +@message: +@Returns: + + diff --git a/doc/gtkdoc/tmpl/transport.sgml b/doc/gtkdoc/tmpl/transport.sgml new file mode 100644 index 0000000..f87749c --- /dev/null +++ b/doc/gtkdoc/tmpl/transport.sgml @@ -0,0 +1,22 @@ + +Transport + + + + + + + + + + + + + + + + + + + + diff --git a/doc/project.conf b/doc/project.conf new file mode 100644 index 0000000..bea697e --- /dev/null +++ b/doc/project.conf @@ -0,0 +1,24 @@ +subdirs=gtkdoc +targets=gtkdoc/Mailer.types,gtkdoc/tmpl.stamp,gtkdoc/sgml.stamp,gtkdoc/html.stamp +dist=Makefile,GRAMMAR,gtkdoc.sh + +[gtkdoc/Mailer.types] +type=script +script=./gtkdoc.sh +depends=../config.sh + +[gtkdoc/tmpl.stamp] +type=script +script=./gtkdoc.sh +depends=gtkdoc/Mailer.types + +[gtkdoc/sgml.stamp] +type=script +script=./gtkdoc.sh +depends=gtkdoc/tmpl.stamp + +[gtkdoc/html.stamp] +type=script +script=./gtkdoc.sh +depends=gtkdoc/Mailer-docs.xml,gtkdoc/sgml.stamp +install= diff --git a/project.conf b/project.conf index d16a432..9681077 100644 --- a/project.conf +++ b/project.conf @@ -2,5 +2,5 @@ package=Mailer version=0.1.4 config=h,sh -subdirs=data,include,po,src +subdirs=data,doc,include,po,src dist=Makefile,COPYING,config.h,config.sh