Updated book. Added build target for HTML using HeVeA.

This commit is contained in:
Vincent Richard 2013-02-05 13:01:39 +01:00
parent 1da9117fa5
commit 230a2c73ab
11 changed files with 140 additions and 75 deletions

17
doc/book/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# PDFLatex
*.log
*.aux
*.toc
*.out
*.pdf
*.lo[flt]
# Hevea
*.haux
*.htoc
book.image.tex
book.html
images/Makefile2
images/*.png

View File

@ -1,19 +1,29 @@
all: convert-images book
all: book
convert-images:
cd images ; make
book: book_pdf book_html
# Full build: multiple runs for correct references...
book:
book_pdf: convert-images
pdflatex book.tex
pdflatex book.tex
pdflatex book.tex
book_html: convert-images
hevea book.tex
hevea book.tex
hevea book.tex
#latexml --path=/opt/local/share/texmf-texlive-dist/tex/latex/base/ --path=/opt/local/share/texmf-texlive-dist/tex/latex/mdwtools/ --path=/opt/local/share/texmf-texlive-dist/tex/latex/geometry/ --path=/opt/local/share/texmf-texlive-dist/tex/latex/ucs/ --path=/opt/local/share/texmf-texlive-dist/tex/latex/fancyhdr/ --path=/opt/local/share/texmf-texlive-dist/tex/latex/footmisc --destination book.xml book.tex
#latexmlpost --destination=book.html book.xml
# Only one run for development (faster)
book-dev:
book-dev: convert-images
pdflatex book.tex
clean:
rm -f *.toc *.aux *.lof *.log *.lol *.pdf
rm -f *.log *.aux *.toc *.out *.pdf *.lo[flt]
rm -f *.haux *.htoc book.image.tex book.html

View File

@ -296,7 +296,7 @@ grp->appendMailbox(mbox2);
\begin{figure}[ht!]
\center\includegraphics[width=0.7\textwidth]
{images/address-mailbox-mailboxgroup.png}
{images/address-mailbox-mailboxgroup.png}\endcenter
\caption{Diagram for address-related classes}
\label{uml_addr_mbox_mboxgroup}
\end{figure}
@ -314,7 +314,7 @@ model is implemented in VMime, and all classes that take part in it.
\begin{figure}
\center\includegraphics[width=1.0\textwidth]
{images/message-body-header.png}
{images/message-body-header.png}\endcenter
\caption{Overall structure of MIME messages}
\label{uml_msg_body_header}
\end{figure}

View File

@ -1,31 +1,24 @@
\documentclass[11pt]{report}
\title{{\Huge VMime Book} \\ \ \\ A Developer's Guide To VMime}
\author{Vincent Richard \\ vincent@vincent-richard.net}
\author{Vincent Richard \\ vincent@vmime.org}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{array}
\usepackage{listings}
\usepackage[usenames]{color}
\usepackage{ucs}
\usepackage[latin1]{inputenc}
\usepackage[utf8x]{inputenc}
\usepackage[vcentering,dvips]{geometry}
%\usepackage{type1cm} % scalable Computer Modern fonts
\usepackage{courier} % use Adobe Courier instead of Computer Modern Typewriter
\usepackage{fancyheadings}
\usepackage{hyperref}
\usepackage{sverb}
\usepackage{verbatim}
\usepackage{footmisc}
\addtolength{\parskip}{+0.3cm}
\linespread{1.05}
\setlength{\skip\footins}{1cm} % margin between text and footnotes
\clubpenalty=1000
\widowpenalty=1000
\setcounter{secnumdepth}{10}
\setcounter{tocdepth}{10}
@ -40,12 +33,10 @@
\newcommand{\Chapter}[1]{\chapter{#1} \setcounter{figure}{1}}
% 'geometry' configuration
\geometry{papersize={210mm,297mm},total={160mm,230mm}}
% 'listings' configuration
\definecolor{listingFrame}{rgb}{0.9,0.9,0.9}
\lstset{language=C++,showstringspaces=false}
\lstset{keywordstyle=\bf,commentstyle=\it}
\lstset{captionpos=b,extendedchars=true,inputencoding=latin1}
\lstset{fontadjust=true,basewidth={0.5em,0.4em},columns=fixed,flexiblecolumns=false}
\lstset{frame=leftline,framerule=0.1cm,framesep=0.3cm,rulecolor=\color{listingFrame}}
@ -57,6 +48,27 @@
breaklinks=true,urlcolor=blue,linkcolor=black,bookmarks=true,bookmarksopen=true
}
% HTML output configuration
%HEVEA\renewcommand{\includegraphics}[2][]{\imgsrc{#2}}
%HEVEA\renewcommand{\verti}[1]{#1}
%HEVEA\def\vdot{\bullet}
%HEVEA\newcommand{\linespread}{}
%HEVEA\newcommand{\clubpenalty}{}
%HEVEA\newcommand{\widowpenalty}{}
%HEVEA\newcommand{\geometry}{}
% Page layout
\geometry{papersize={210mm,297mm},total={160mm,230mm}}
% Text layout
\setlength{\skip\footins}{1cm} % margin between text and footnotes
\clubpenalty=1000
\addtolength{\parskip}{+0.3cm}
\linespread{1.05}
\widowpenalty=1000
\begin{document}
% Title page
@ -78,6 +90,9 @@
\thispagestyle{empty}
\ \newpage
%HEVEA\begin{comment}
% List of listings
\lstlistoflistings
\addcontentsline{toc}{chapter}{Listings}
@ -90,11 +105,14 @@
\listoftables
\addcontentsline{toc}{chapter}{List of tables}
%HEVEA\end{comment}
% Appendixes
\appendix
\chapter{The GNU General Public License\label{appendix_license}}
\verbinput{../../COPYING}
\verbatiminput{../../COPYING}
\end{document}

View File

@ -15,13 +15,13 @@ To build VMime from the sources, you will need the following:
\begin{itemize}
\item a working C++ compiler with good STL implementation and also a good
support for templates (for example, \href{http://gcc.gnu.org/}{GNU GCC}) ;
\item \href{http://www.scons.org/}{SCons} build system, or the
autoconf/automake tool chain ;
\item \href{http://www.cmake.org/}{CMake} build system ;
\item an usable iconv() implementation (see
\href{http://www.gnu.org/software/libiconv/}{libiconv of GNU Project}) ;
\item the \href{http://www.gnu.org/software/gsasl/}{GNU SASL Library} if you
want SASL\footnote{Simple Authentication and Security Layer} support ;
\item the \href{http://www.gnu.org/software/gnutls/}{GNU TLS Library} if you
\item either the \href{http://www.openssl.org}{OpenSSL library} or the
\href{http://www.gnu.org/software/gnutls/}{GNU TLS Library} if you
want SSL and TLS\footnote{Transport Layer Security} support ;
\end{itemize}
@ -31,49 +31,62 @@ want SSL and TLS\footnote{Transport Layer Security} support ;
You can download a package containing the source files of the latest release
of the VMime library from the \href{http://www.vmime.org/}{VMime web site}.
You can also obtain the current development version from the CVS. VMime's CVS
repository can be checked out from anonymous CVS with the following
instructions. When prompted for a password for {\em anonymous}, simply press
Enter key.
You can also obtain the current development version from the Git repository,
which is currently hosted at GitHub. It can be checked out through anonymous
access with the following instruction:
\begin{verbatim}
cvs -d:pserver:anonymous@cvs.vmime.org:/cvsroot/vmime login
cvs -z3 -d:pserver:anonymous@cvs.vmime.org:/cvsroot/vmime co -P vmime
git clone git://github.com/kisli/vmime
\end{verbatim}
% ============================================================================
\section{Compiling and installing}
There are two possibilities for compiling VMime: using SCons building system,
or using the Autotools.
\vnote{MS Visual C++ users, you can skip this section as a project file
is provided in the distribution tarball.}
or using CMake.
SCons is only used for development purposes, and so it is recommended that you
use Autotools to build the project as it is a more portable solution, and is
use CMake to build the project as it is a more portable solution, and is
likely to work out-of-the-box on your computer. Thus, we will not describe
the process of compiling VMime using SCons here.
\vnote{Windows users, you can use MinGW and MSYS\footnote{See on the MinGW
website: http://www.mingw.org/} to install a POSIX compatible environment
on top of Windows. This allow executing configure scripts and Makefiles on
Windows}.
CMake is an open source, cross-platform build system. It will generate all
build scripts required to compile VMime on your platform.
Before compiling VMime, you should run the {\vcode configure} script to
detect some parameters specific to your platform. Go into the directory where
you extracted the tarball and type:
First, from the directory where you extracted the tarball or checked out
the sources, run {\vcode cmake} with the {\vcode -G} argument corresponding
to your platform. For example, if you are on a Unix-compatible platform (like
GNU/Linux or MacOS), type:
\begin{verbatim}
$ ./configure
$ cmake -G "Unix Makefiles"
\end{verbatim}
This will create a file named {\vcode config.hpp} in the {\vcode vmime/}
directory, with the parameters detected for your platform. You should modify
this file only if you know what you are doing!
This will perform some tests on your system to check for libs installed
and some platform-specific includes. It will then create a Makefile in
the root directory of VMime.
\vnote{Delete the {\vcode CMakeCache.txt} file if something changed on your
system, as CMake may cache some values to speed up things.}
This will also create a file named {\vcode config.hpp} in the {\vcode vmime/}
directory, with the parameters detected for your platform. You should not
modify this file directly. Instead, you can run again {\vcode cmake} and
specify your own defines on the command line.
For example, to force using OpenSSL library instead of GnuTLS for TLS
support, type:
\begin{verbatim}
$ cmake -G "Unix Makefiles" -DVMIME_TLS_SUPPORT_LIB_IS_OPENSSL=ON \
-DVMIME_TLS_SUPPORT_LIB_IS_GNUTLS=OFF
\end{verbatim}
If you want to enable or disable some features in VMime, you can obtain some
help by typing {\vcode ./configure --help}. The defaults should be OK though.
help by typing {\vcode cmake -L}. The defaults should be OK though.
For more information about using CMake, go to
\href{http://www.cmake.org/}{the CMake web site}.
Next, you can start the compilation process:
@ -84,8 +97,8 @@ Next, you can start the compilation process:
Please wait a few minutes will the compilation runs (you should have some time
to have a coffee right now!). If you get errors during the compilation, be
sure your system meet the requirements given at the beginning of the chapter.
You can also try to get a newer version (from the CVS, for example) or to
get some help on VMime user forums.
You can also try to get a newer version (from the Git repository, for example)
or to get some help on VMime user forums.
If everything has been compiled successfully, you can install the library and
the development files on your system:

View File

@ -1,23 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="629.28000pt"
height="615.89000pt"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.42.2"
sodipodi:docbase="/home/vincent/projects/vmime/doc/book/images"
inkscape:version="0.48.0 r9654"
sodipodi:docname="messaging-services.svg"
inkscape:export-filename="/home/vincent/www/vmime/documentation/images/design-messaging.png"
inkscape:export-xdpi="74.639999"
inkscape:export-ydpi="74.639999">
inkscape:export-ydpi="74.639999"
version="1.1">
<defs
id="defs3">
<marker
@ -63,7 +64,7 @@
style="fill-rule:evenodd;stroke-width:1.0000000pt;marker-end:none" />
<path
transform="matrix(6.793608e-17,-1.109517,1.109517,6.793608e-17,25.96648,19.71619)"
d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z"
d="m 16.779951,-28.685045 c 0,0.335412 -0.271905,0.607317 -0.607317,0.607317 -0.335412,0 -0.607317,-0.271905 -0.607317,-0.607317 0,-0.335412 0.271905,-0.607318 0.607317,-0.607318 0.335412,0 0.607317,0.271906 0.607317,0.607318 z"
sodipodi:ry="0.60731727"
sodipodi:rx="0.60731727"
sodipodi:cy="-28.685045"
@ -73,7 +74,7 @@
sodipodi:type="arc" />
<path
transform="matrix(6.793608e-17,-1.109517,1.109517,6.793608e-17,26.82450,16.99126)"
d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z"
d="m 16.779951,-28.685045 c 0,0.335412 -0.271905,0.607317 -0.607317,0.607317 -0.335412,0 -0.607317,-0.271905 -0.607317,-0.607317 0,-0.335412 0.271905,-0.607318 0.607317,-0.607318 0.335412,0 0.607317,0.271906 0.607317,0.607318 z"
sodipodi:ry="0.60731727"
sodipodi:rx="0.60731727"
sodipodi:cy="-28.685045"
@ -109,11 +110,13 @@
inkscape:cx="365.32198"
inkscape:cy="407.27112"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:current-layer="svg2"
inkscape:window-width="1150"
inkscape:window-height="986"
inkscape:window-x="0"
inkscape:window-y="30" />
inkscape:window-x="69"
inkscape:window-y="33"
showgrid="false"
inkscape:window-maximized="0" />
<metadata
id="metadata4">
<rdf:RDF>
@ -604,13 +607,6 @@
id="path5436"
d="M 325.97175,390.06210 L 661.85821,390.06210"
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.2515085;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
<rect
y="102.22088"
x="-7.6927943"
height="76.000000"
width="106.00000"
id="rect3358"
style="fill:none;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.2500000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000" />
<rect
y="170.36218"
x="668.00000"

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -15,7 +15,7 @@ chapter, so it is important you take some time to read it.
\begin{figure}
\center\includegraphics[width=0.9\textwidth]
{images/messaging-services.png}
{images/messaging-services.png}\endcenter
\caption{Overall structure of the messaging module}
\label{uml_messaging_module}
\end{figure}

View File

@ -48,10 +48,9 @@ namespace with the C++ keywork {\vcode using} (not recommended, though).
not in a standard path (ie. not in /usr/lib or /usr/local/lib).
\vnote{if you want to link your program with the shared version of VMime
library, make sure the library has been compiled using the autotools version
of the build system ({\vcode ./configure}, {\vcode make} and {\vcode make
install}). When you compile with SCons, only the static library is built and
installed.}
library, make sure the library has been compiled using CMake build system
({\vcode make}, then {\vcode make install}). When you compile with SCons,
only the static library is built and installed.}
{\bf Linking with the static library (.a):} follow the same procedure as for
shared linking and append the flag -static to force static linking. Although
@ -73,9 +72,9 @@ then you are lucky: VMime has built-in support for these platforms. If not,
don't worry, the sources of the built-in platform handlers are very well
documented, so writing you own should not be very difficult.
At the beginning of your program (before using \emph{any} VMime object, or
calling \emph{any} VMime global function), you should tell VMime which
platform handler you want to use.
If your VMime version is $<=$ 0.9.1, you should tell VMime which platform
handler you want to use at the beginning of your program (before using
\emph{any} VMime object, or calling \emph{any} VMime global function).
So, if your platform is POSIX, your program should look like this:
@ -94,7 +93,7 @@ int main()
\end{lstlisting}
For using VMime on Windows, include
$<$vmime/platforms/windows/windowsHandler.hpp$>$ and use the following line
{\vcode vmime/platforms/windows/windowsHandler.hpp} and use the following line
to initialize the platform handler:
\begin{lstlisting}
@ -102,6 +101,10 @@ vmime::platform::
setHandler <vmime::platforms::windows::windowsHandler>();
\end{lstlisting}
\vnote{since version 0.9.2, this is not needed any more: the platform
handler is installed automatically using the platform detected during the
build configuration.}
\vnote{since version 0.8.1, {\vcode vmime::platformDependant} was renamed
to {\vcode vmime::platform}. The old name has been kept for compatibility
but it is recommended that you update your code, if needed.}

8
examples/Makefile Normal file
View File

@ -0,0 +1,8 @@
all: example1 example6
example1: example1.cpp ../libvmime-debug.a
g++-mp-4.8 -o example1 example1.cpp -I.. ../libvmime-debug.a -L /opt/local/lib -lgnutls -lgsasl -liconv
example6: example6.cpp ../libvmime-debug.a
g++-mp-4.8 -o example6 example6.cpp -I.. ../libvmime-debug.a -L /opt/local/lib -lgnutls -lgsasl -liconv

BIN
examples/example1 Executable file

Binary file not shown.

BIN
examples/example6 Executable file

Binary file not shown.