summaryrefslogtreecommitdiffstats
path: root/config/gnu-cxxflags
diff options
context:
space:
mode:
Diffstat (limited to 'config/gnu-cxxflags')
-rw-r--r--config/gnu-cxxflags11
1 files changed, 4 insertions, 7 deletions
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index 9f11406..280679d 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -20,15 +20,15 @@
#
# For now, do not promote any warnings to errors.
#
-PROMOTE_ERRORS_DFLT=no
+WARNINGS_AS_ERRORS_DFLT=no
#
# This filter rewrites -Werror= as -W, in that way demoting warnings
-# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
+# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no.
#
demote_errors()
{
- if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_ERRORS_DFLT}} = no ]; then
sed 's,-Werror=,-W,g'
else
cat
@@ -44,7 +44,7 @@ demote_errors()
load_gnu_arguments()
{
set -- $(for arg; do
- sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg}
+ sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
done)
IFS=' ' echo "$*"
}
@@ -192,7 +192,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)"
H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)"
- H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-general)"
######################
# Developer warnings #
@@ -235,7 +234,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
if test $cxx_vers_major -ge 5; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-5)"
H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-5)"
- H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-5)"
fi
# gcc >= 6
@@ -256,7 +254,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)"
#H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)"
- #H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments noerror-8)"
# Use the C warnings as CXX warnings are the same
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)"
NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)"
width: 98.3%;'/> -rw-r--r--trunk/addon/doxmlparser/examples/metrics/metrics.pro.in20
-rw-r--r--trunk/addon/doxmlparser/include/doxmlintf.h1134
-rw-r--r--trunk/addon/doxmlparser/src/Makefile.in13
-rw-r--r--trunk/addon/doxmlparser/src/basehandler.cpp3
-rw-r--r--trunk/addon/doxmlparser/src/basehandler.h325
-rw-r--r--trunk/addon/doxmlparser/src/baseiterator.h50
-rw-r--r--trunk/addon/doxmlparser/src/compoundhandler.cpp650
-rw-r--r--trunk/addon/doxmlparser/src/compoundhandler.h236
-rw-r--r--trunk/addon/doxmlparser/src/debug.cpp24
-rw-r--r--trunk/addon/doxmlparser/src/debug.h7
-rw-r--r--trunk/addon/doxmlparser/src/dochandler.cpp2240
-rw-r--r--trunk/addon/doxmlparser/src/dochandler.h1352
l---------trunk/addon/doxmlparser/src/doxmlintf.h1
-rw-r--r--trunk/addon/doxmlparser/src/doxmlparser.pro.in27
-rw-r--r--trunk/addon/doxmlparser/src/graphhandler.cpp216
-rw-r--r--trunk/addon/doxmlparser/src/graphhandler.h154
-rw-r--r--trunk/addon/doxmlparser/src/linkedtexthandler.cpp133
-rw-r--r--trunk/addon/doxmlparser/src/linkedtexthandler.h54
-rw-r--r--trunk/addon/doxmlparser/src/loamhandler.cpp75
-rw-r--r--trunk/addon/doxmlparser/src/loamhandler.h52
-rw-r--r--trunk/addon/doxmlparser/src/mainhandler.cpp299
-rw-r--r--trunk/addon/doxmlparser/src/mainhandler.h82
-rw-r--r--trunk/addon/doxmlparser/src/memberhandler.cpp600
-rw-r--r--trunk/addon/doxmlparser/src/memberhandler.h252
-rw-r--r--trunk/addon/doxmlparser/src/paramhandler.cpp158
-rw-r--r--trunk/addon/doxmlparser/src/paramhandler.h103
-rw-r--r--trunk/addon/doxmlparser/src/sectionhandler.cpp168
-rw-r--r--trunk/addon/doxmlparser/src/sectionhandler.h102
-rw-r--r--trunk/addon/doxmlparser/src/stringimpl.h30
-rw-r--r--trunk/addon/doxmlparser/test/Makefile.in13
-rw-r--r--trunk/addon/doxmlparser/test/main.cpp759
-rw-r--r--trunk/addon/doxmlparser/test/xmlparse.pro.in20
-rw-r--r--trunk/addon/doxyapp/Makefile.in17
-rw-r--r--trunk/addon/doxyapp/README8
-rw-r--r--trunk/addon/doxyapp/doxyapp.cpp314
-rw-r--r--trunk/addon/doxyapp/doxyapp.pro.in12
-rw-r--r--trunk/addon/doxywizard/Makefile.in39
-rw-r--r--trunk/addon/doxywizard/README3
-rw-r--r--trunk/addon/doxywizard/doxywizard.cpp600
-rw-r--r--trunk/addon/doxywizard/doxywizard.h83
-rw-r--r--trunk/addon/doxywizard/doxywizard.pro.in27
-rw-r--r--trunk/addon/doxywizard/doxywizard.qrc10
-rw-r--r--trunk/addon/doxywizard/expert.cpp553
-rw-r--r--trunk/addon/doxywizard/expert.h64
-rw-r--r--trunk/addon/doxywizard/helplabel.h33
-rw-r--r--trunk/addon/doxywizard/images/add.pngbin0 -> 4321 bytes-rw-r--r--trunk/addon/doxywizard/images/del.pngbin0 -> 4231 bytes-rw-r--r--trunk/addon/doxywizard/images/file.pngbin0 -> 4380 bytes-rw-r--r--trunk/addon/doxywizard/images/folder.pngbin0 -> 4308 bytes-rw-r--r--trunk/addon/doxywizard/images/refresh.pngbin0 -> 4458 bytes-rw-r--r--trunk/addon/doxywizard/input.h34
-rw-r--r--trunk/addon/doxywizard/inputbool.cpp110
-rw-r--r--trunk/addon/doxywizard/inputbool.h70
-rw-r--r--trunk/addon/doxywizard/inputint.cpp96
-rw-r--r--trunk/addon/doxywizard/inputint.h70
-rw-r--r--trunk/addon/doxywizard/inputstring.cpp191
-rw-r--r--trunk/addon/doxywizard/inputstring.h88
-rw-r--r--trunk/addon/doxywizard/inputstrlist.cpp254
-rw-r--r--trunk/addon/doxywizard/inputstrlist.h91
-rw-r--r--trunk/addon/doxywizard/version.h23
-rw-r--r--trunk/addon/doxywizard/wizard.cpp896
-rw-r--r--trunk/addon/doxywizard/wizard.h182
-rwxr-xr-xtrunk/configure661
-rwxr-xr-xtrunk/configure.bin0
-rw-r--r--trunk/doc/Doxyfile50
-rw-r--r--trunk/doc/Makefile.in36
-rw-r--r--trunk/doc/Makefile.latex25
-rw-r--r--trunk/doc/Makefile.win_make.in36
-rw-r--r--trunk/doc/Makefile.win_nmake.in38
-rw-r--r--trunk/doc/arch.doc241
-rw-r--r--trunk/doc/archoverview.eps380
-rw-r--r--trunk/doc/archoverview.gifbin0 -> 7822 bytes-rw-r--r--trunk/doc/autolink.doc128
-rw-r--r--trunk/doc/commands.doc2489
-rw-r--r--trunk/doc/config.doc2307
-rw-r--r--trunk/doc/custcmd.doc123
-rw-r--r--trunk/doc/customize.doc257
-rw-r--r--trunk/doc/diagrams.doc148
-rw-r--r--trunk/doc/docblocks.doc451
-rw-r--r--trunk/doc/doxygen.146
-rw-r--r--trunk/doc/doxygen.sty86
-rw-r--r--trunk/doc/doxygen_logo.eps6322
-rw-r--r--trunk/doc/doxygen_logo.gifbin0 -> 29863 bytes-rw-r--r--trunk/doc/doxygen_logo_low.gifbin0 -> 3952 bytes-rw-r--r--trunk/doc/doxygen_manual.tex84
-rw-r--r--trunk/doc/doxygen_usage.doc98
-rw-r--r--trunk/doc/doxysearch_usage.doc180
-rw-r--r--trunk/doc/doxytag.121
-rw-r--r--trunk/doc/doxytag_usage.doc97
-rw-r--r--trunk/doc/doxywizard.110
-rw-r--r--trunk/doc/doxywizard.gifbin0 -> 18928 bytes-rw-r--r--trunk/doc/doxywizard_expert.pngbin0 -> 30056 bytes-rw-r--r--trunk/doc/doxywizard_main.pngbin0 -> 57204 bytes-rw-r--r--trunk/doc/doxywizard_menu.pngbin0 -> 58661 bytes-rw-r--r--trunk/doc/doxywizard_page1.pngbin0 -> 39646 bytes-rw-r--r--trunk/doc/doxywizard_page2.pngbin0 -> 39048 bytes-rw-r--r--trunk/doc/doxywizard_page3.pngbin0 -> 50904 bytes-rw-r--r--trunk/doc/doxywizard_page4.pngbin0 -> 43718 bytes-rw-r--r--trunk/doc/doxywizard_usage.doc138
-rw-r--r--trunk/doc/external.doc138
-rw-r--r--trunk/doc/faq.doc293
-rw-r--r--trunk/doc/features.doc97
-rw-r--r--trunk/doc/formulas.doc107
-rw-r--r--trunk/doc/grouping.doc225
-rw-r--r--trunk/doc/history.doc126
-rw-r--r--trunk/doc/htmlcmds.doc147
-rw-r--r--trunk/doc/index.doc199
-rw-r--r--trunk/doc/infoflow.eps646
-rw-r--r--trunk/doc/infoflow.fig240
-rw-r--r--trunk/doc/infoflow.gifbin0 -> 13383 bytes-rw-r--r--trunk/doc/install.doc699
-rw-r--r--trunk/doc/install_prefix2
-rw-r--r--trunk/doc/installdox_usage.doc62
-rw-r--r--trunk/doc/language.doc727
-rw-r--r--trunk/doc/language.tpl357
-rw-r--r--trunk/doc/lists.doc119
-rw-r--r--trunk/doc/maintainers.txt142
-rw-r--r--trunk/doc/output.doc62
-rw-r--r--trunk/doc/perlmod.doc193
-rw-r--r--trunk/doc/perlmod_tree.doc377
-rw-r--r--trunk/doc/preprocessing.doc263
-rw-r--r--trunk/doc/starting.doc292
-rw-r--r--trunk/doc/translator.py1922
-rw-r--r--trunk/doc/translator_report.txt721
-rw-r--r--trunk/doc/trouble.doc142
-rw-r--r--trunk/doc/xmlcmds.doc100
-rw-r--r--trunk/examples/Makefile.in120
-rw-r--r--trunk/examples/Makefile.win.in118
-rw-r--r--trunk/examples/afterdoc.cfg9
-rw-r--r--trunk/examples/afterdoc.h18
-rw-r--r--trunk/examples/author.cfg9
-rw-r--r--trunk/examples/author.cpp14
-rw-r--r--trunk/examples/autolink.cfg9
-rw-r--r--trunk/examples/autolink.cpp99
-rw-r--r--trunk/examples/class.cfg9
-rw-r--r--trunk/examples/class.h11
-rw-r--r--trunk/examples/define.cfg10
-rw-r--r--trunk/examples/define.h18
-rw-r--r--trunk/examples/diagrams.cfg13
-rw-r--r--trunk/examples/diagrams_a.h4
-rw-r--r--trunk/examples/diagrams_b.h5
-rw-r--r--trunk/examples/diagrams_c.h6
-rw-r--r--trunk/examples/diagrams_d.h7
-rw-r--r--trunk/examples/diagrams_e.h5
-rw-r--r--trunk/examples/docstring.cfg10
-rw-r--r--trunk/examples/docstring.py27
-rw-r--r--trunk/examples/enum.cfg9
-rw-r--r--trunk/examples/enum.h24
-rw-r--r--trunk/examples/example.cfg11
-rw-r--r--trunk/examples/example.cpp19
-rw-r--r--trunk/examples/example.tag14
-rw-r--r--trunk/examples/example_test.cpp5
-rw-r--r--trunk/examples/file.cfg9
-rw-r--r--trunk/examples/file.h10
-rw-r--r--trunk/examples/func.cfg9
-rw-r--r--trunk/examples/func.h21
-rw-r--r--trunk/examples/group.cfg9
-rw-r--r--trunk/examples/group.cpp88
-rw-r--r--trunk/examples/include.cfg10
-rw-r--r--trunk/examples/include.cpp22
-rw-r--r--trunk/examples/jdstyle.cfg9
-rw-r--r--trunk/examples/jdstyle.cpp66
-rw-r--r--trunk/examples/manual.c87
-rw-r--r--trunk/examples/manual.cfg15
-rw-r--r--trunk/examples/memgrp.cfg10
-rw-r--r--trunk/examples/memgrp.cpp41
-rw-r--r--trunk/examples/mux.cfg13
-rw-r--r--trunk/examples/mux.vhdl32
-rw-r--r--trunk/examples/overload.cfg10
-rw-r--r--trunk/examples/overload.cpp25
-rw-r--r--trunk/examples/page.cfg9
-rw-r--r--trunk/examples/page.doc14
-rw-r--r--trunk/examples/par.cfg9
-rw-r--r--trunk/examples/par.cpp20
-rw-r--r--trunk/examples/pyexample.cfg9
-rw-r--r--trunk/examples/pyexample.py30
-rw-r--r--trunk/examples/qtstyle.cfg9
-rw-r--r--trunk/examples/qtstyle.cpp65
-rw-r--r--trunk/examples/relates.cfg9
-rw-r--r--trunk/examples/relates.cpp23
-rw-r--r--trunk/examples/restypedef.cfg9
-rw-r--r--trunk/examples/restypedef.cpp25
-rw-r--r--trunk/examples/structcmd.cfg9
-rw-r--r--trunk/examples/structcmd.h57
-rw-r--r--trunk/examples/tag.cfg11
-rw-r--r--trunk/examples/tag.cpp9
-rw-r--r--trunk/examples/templ.cfg9
-rw-r--r--trunk/examples/templ.cpp35
-rw-r--r--trunk/libmd5/Makefile.in16
-rw-r--r--trunk/libmd5/libmd5.pro.in10
-rw-r--r--trunk/libmd5/md5.c313
-rw-r--r--trunk/libmd5/md5.h57
-rw-r--r--trunk/libmd5/md5_loc.h6
-rw-r--r--trunk/libpng/LICENSE102
-rw-r--r--trunk/libpng/Makefile.in16
-rw-r--r--trunk/libpng/README2
-rw-r--r--trunk/libpng/adler32.c149
-rw-r--r--trunk/libpng/compress.c79
-rw-r--r--trunk/libpng/crc32.c423
-rw-r--r--trunk/libpng/crc32.h441
-rw-r--r--trunk/libpng/deflate.c1736
-rw-r--r--trunk/libpng/deflate.h331
-rw-r--r--trunk/libpng/gzio.c1026
-rw-r--r--trunk/libpng/infback.c623
-rw-r--r--trunk/libpng/infblock.c388
-rw-r--r--trunk/libpng/infblock.h39
-rw-r--r--trunk/libpng/infcodes.c246
-rw-r--r--trunk/libpng/infcodes.h27
-rw-r--r--trunk/libpng/inffast.c318
-rw-r--r--trunk/libpng/inffast.h11
-rw-r--r--trunk/libpng/inffixed.h94
-rw-r--r--trunk/libpng/inflate.c1368
-rw-r--r--trunk/libpng/inflate.h115
-rw-r--r--trunk/libpng/inftrees.c329
-rw-r--r--trunk/libpng/inftrees.h55
-rw-r--r--trunk/libpng/infutil.c84
-rw-r--r--trunk/libpng/infutil.h98
-rw-r--r--trunk/libpng/libpng.pro.in47
-rw-r--r--trunk/libpng/png.574
-rw-r--r--trunk/libpng/png.c798
-rw-r--r--trunk/libpng/png.h3540
-rw-r--r--trunk/libpng/pngasmrd.h11
-rw-r--r--trunk/libpng/pngconf.h1483
-rw-r--r--trunk/libpng/pngerror.c341
-rw-r--r--trunk/libpng/pnggccrd.c101
-rw-r--r--trunk/libpng/pngget.c901
-rw-r--r--trunk/libpng/pngmem.c608
-rw-r--r--trunk/libpng/pngpread.c1584
-rw-r--r--trunk/libpng/pngread.c1472
-rw-r--r--trunk/libpng/pngrio.c167
-rw-r--r--trunk/libpng/pngrtran.c4284
-rw-r--r--trunk/libpng/pngrutil.c3163
-rw-r--r--trunk/libpng/pngset.c1248
-rw-r--r--trunk/libpng/pngtest.c1553
-rw-r--r--trunk/libpng/pngtrans.c662
-rw-r--r--trunk/libpng/pngvcrd.c1
-rw-r--r--trunk/libpng/pngwio.c234
-rw-r--r--trunk/libpng/pngwrite.c1514
-rw-r--r--trunk/libpng/pngwtran.c572
-rw-r--r--trunk/libpng/pngwutil.c2792
-rw-r--r--trunk/libpng/trees.c1219
-rw-r--r--trunk/libpng/trees.h128
-rw-r--r--trunk/libpng/uncompr.c61
-rw-r--r--trunk/libpng/zconf.h332
-rw-r--r--trunk/libpng/zconf.in.h332
-rw-r--r--trunk/libpng/zlib.h1357
-rw-r--r--trunk/libpng/zutil.c318
-rw-r--r--trunk/libpng/zutil.h269
-rw-r--r--trunk/make.bat61
-rw-r--r--trunk/packages/rpm/doxygen.spec.in101
-rw-r--r--trunk/qtools/Doxyfile237
-rw-r--r--trunk/qtools/LICENSE.GPL349
-rw-r--r--trunk/qtools/LICENSE.QPL103
-rw-r--r--trunk/qtools/Makefile.in30
-rw-r--r--trunk/qtools/README4
-rw-r--r--trunk/qtools/qarray.doc486
-rw-r--r--trunk/qtools/qarray.h110
-rw-r--r--trunk/qtools/qasciidict.h107
-rw-r--r--trunk/qtools/qbuffer.cpp465
-rw-r--r--trunk/qtools/qbuffer.h98
-rw-r--r--trunk/qtools/qcache.h148
-rw-r--r--trunk/qtools/qcollection.cpp182
-rw-r--r--trunk/qtools/qcollection.h74
-rw-r--r--trunk/qtools/qconfig.h1
-rw-r--r--trunk/qtools/qcstring.cpp794
-rw-r--r--trunk/qtools/qcstring.h453
-rw-r--r--trunk/qtools/qdatastream.cpp951
-rw-r--r--trunk/qtools/qdatastream.h173
-rw-r--r--trunk/qtools/qdatetime.cpp1434
-rw-r--r--trunk/qtools/qdatetime.h216
-rw-r--r--trunk/qtools/qdict.doc492
-rw-r--r--trunk/qtools/qdict.h116
-rw-r--r--trunk/qtools/qdir.cpp1200
-rw-r--r--trunk/qtools/qdir.h235
-rw-r--r--trunk/qtools/qdir_unix.cpp288
-rw-r--r--trunk/qtools/qdir_win32.cpp406
-rw-r--r--trunk/qtools/qfeatures.h978
-rw-r--r--trunk/qtools/qfile.cpp550
-rw-r--r--trunk/qtools/qfile.h128
-rw-r--r--trunk/qtools/qfile_unix.cpp668
-rw-r--r--trunk/qtools/qfile_win32.cpp629
-rw-r--r--trunk/qtools/qfiledefs_p.h261
-rw-r--r--trunk/qtools/qfileinfo.cpp458
-rw-r--r--trunk/qtools/qfileinfo.h138
-rw-r--r--trunk/qtools/qfileinfo_unix.cpp425
-rw-r--r--trunk/qtools/qfileinfo_win32.cpp334
-rw-r--r--trunk/qtools/qgarray.cpp747
-rw-r--r--trunk/qtools/qgarray.h120
-rw-r--r--trunk/qtools/qgcache.cpp868
-rw-r--r--trunk/qtools/qgcache.h128
-rw-r--r--trunk/qtools/qgdict.cpp1218
-rw-r--r--trunk/qtools/qgdict.h222
-rw-r--r--trunk/qtools/qgeneric.h43
-rw-r--r--trunk/qtools/qglist.cpp1223
-rw-r--r--trunk/qtools/qglist.h257
-rw-r--r--trunk/qtools/qglobal.cpp685
-rw-r--r--trunk/qtools/qglobal.h638
-rw-r--r--trunk/qtools/qgstring.cpp223
-rw-r--r--trunk/qtools/qgstring.h137
-rw-r--r--trunk/qtools/qgvector.cpp638
-rw-r--r--trunk/qtools/qgvector.h120
-rw-r--r--trunk/qtools/qintdict.doc475
-rw-r--r--trunk/qtools/qintdict.h102
-rw-r--r--trunk/qtools/qiodevice.cpp638
-rw-r--r--trunk/qtools/qiodevice.h155
-rw-r--r--trunk/qtools/qlist.doc1048
-rw-r--r--trunk/qtools/qlist.h139
-rw-r--r--trunk/qtools/qmap.cpp254
-rw-r--r--trunk/qtools/qmap.h606
-rw-r--r--trunk/qtools/qmodules.h11
-rw-r--r--trunk/qtools/qptrdict.doc486
-rw-r--r--trunk/qtools/qptrdict.h103
-rw-r--r--trunk/qtools/qqueue.h70
-rw-r--r--trunk/qtools/qregexp.cpp1091
-rw-r--r--trunk/qtools/qregexp.h92
-rw-r--r--trunk/qtools/qshared.h55
-rw-r--r--trunk/qtools/qsortedlist.doc94
-rw-r--r--trunk/qtools/qsortedlist.h59
-rw-r--r--trunk/qtools/qstack.doc135
-rw-r--r--trunk/qtools/qstack.h71
-rw-r--r--trunk/qtools/qstring.cpp15222
-rw-r--r--trunk/qtools/qstring.h825
-rw-r--r--trunk/qtools/qstringlist.cpp302
-rw-r--r--trunk/qtools/qstringlist.h81
-rw-r--r--trunk/qtools/qstrlist.doc5
-rw-r--r--trunk/qtools/qstrlist.h109
-rw-r--r--trunk/qtools/qstrvec.h90
-rw-r--r--trunk/qtools/qtextcodec.cpp2071
-rw-r--r--trunk/qtools/qtextcodec.h104
-rw-r--r--trunk/qtools/qtextstream.cpp2237
-rw-r--r--trunk/qtools/qtextstream.h351
-rw-r--r--trunk/qtools/qtl.doc249
-rw-r--r--trunk/qtools/qtl.h223
-rw-r--r--trunk/qtools/qtools.pro.in85
-rw-r--r--trunk/qtools/qvaluelist.doc772
-rw-r--r--trunk/qtools/qvaluelist.h449
-rw-r--r--trunk/qtools/qvaluestack.h64
-rw-r--r--trunk/qtools/qvector.doc344
-rw-r--r--trunk/qtools/qvector.h85
-rw-r--r--trunk/qtools/qxml.cpp6046
-rw-r--r--trunk/qtools/qxml.h671
-rw-r--r--trunk/qtools/scstring.cpp792
-rw-r--r--trunk/qtools/scstring.h154
-rw-r--r--trunk/src/Makefile.in54
-rw-r--r--trunk/src/bufstr.h107
-rw-r--r--trunk/src/classdef.cpp3411
-rw-r--r--trunk/src/classdef.h463
-rw-r--r--trunk/src/classlist.cpp182
-rw-r--r--trunk/src/classlist.h59
-rw-r--r--trunk/src/cmdmapper.cpp196
-rw-r--r--trunk/src/cmdmapper.h214
-rw-r--r--trunk/src/code.h35
-rw-r--r--trunk/src/code.l3463
-rw-r--r--trunk/src/commentcnv.h27
-rw-r--r--trunk/src/commentcnv.l793
-rw-r--r--trunk/src/commentscan.h83
-rw-r--r--trunk/src/commentscan.l2603
-rw-r--r--trunk/src/compound.xsd797
-rw-r--r--trunk/src/compound_xsd.h797
-rw-r--r--trunk/src/config.h609
-rw-r--r--trunk/src/config.l1571
-rw-r--r--trunk/src/config.xml1390
-rwxr-xr-xtrunk/src/configgen.py137
-rw-r--r--trunk/src/configoptions.cpp2123
-rw-r--r--trunk/src/configoptions.h26
-rw-r--r--trunk/src/constexp.h33
-rw-r--r--trunk/src/constexp.l120
-rw-r--r--trunk/src/constexp.y278
-rw-r--r--trunk/src/cppvalue.cpp95
-rw-r--r--trunk/src/cppvalue.h62
-rw-r--r--trunk/src/debug.cpp116
-rw-r--r--trunk/src/debug.h49
-rw-r--r--trunk/src/declinfo.h33
-rw-r--r--trunk/src/declinfo.l355
-rw-r--r--trunk/src/defargs.h29
-rw-r--r--trunk/src/defargs.l478
-rw-r--r--trunk/src/defgen.cpp630
-rw-r--r--trunk/src/defgen.h20
-rw-r--r--trunk/src/define.cpp46
-rw-r--r--trunk/src/define.h91
-rw-r--r--trunk/src/definition.cpp1563
-rw-r--r--trunk/src/definition.h368
-rw-r--r--trunk/src/diagram.cpp1297
-rw-r--r--trunk/src/diagram.h132
-rw-r--r--trunk/src/dirdef.cpp909
-rw-r--r--trunk/src/dirdef.h179
-rw-r--r--trunk/src/docparser.cpp6312
-rw-r--r--trunk/src/docparser.h1254
-rw-r--r--trunk/src/docsets.cpp391
-rw-r--r--trunk/src/docsets.h86
-rw-r--r--trunk/src/doctokenizer.h151
-rw-r--r--trunk/src/doctokenizer.l1105
-rw-r--r--trunk/src/docvisitor.h184
-rw-r--r--trunk/src/dot.cpp3459
-rw-r--r--trunk/src/dot.h342
-rw-r--r--trunk/src/doxygen.cpp10529
-rw-r--r--trunk/src/doxygen.css491
-rw-r--r--trunk/src/doxygen.h173
-rw-r--r--trunk/src/doxygen.pro.in40
-rw-r--r--trunk/src/doxygen_css.h491
-rw-r--r--trunk/src/doxytag.l930
-rw-r--r--trunk/src/doxytag.pro.in31
-rw-r--r--trunk/src/doxytag.t50
-rw-r--r--trunk/src/entry.cpp463
-rw-r--r--trunk/src/entry.h448
-rw-r--r--trunk/src/example.h45
-rw-r--r--trunk/src/filedef.cpp1550
-rw-r--r--trunk/src/filedef.h319
-rw-r--r--trunk/src/filename.cpp144
-rw-r--r--trunk/src/filename.h69
-rw-r--r--trunk/src/formula.cpp320
-rw-r--r--trunk/src/formula.h59
-rw-r--r--trunk/src/fortrancode.h35
-rw-r--r--trunk/src/fortrancode.l1016
-rw-r--r--trunk/src/fortranscanner.h50
-rw-r--r--trunk/src/fortranscanner.l1767
-rw-r--r--trunk/src/ftvhelp.cpp760
-rw-r--r--trunk/src/ftvhelp.h104
-rw-r--r--trunk/src/groupdef.cpp1324
-rw-r--r--trunk/src/groupdef.h190
-rw-r--r--trunk/src/htags.cpp177
-rw-r--r--trunk/src/htags.h28
-rw-r--r--trunk/src/htmlattrib.h65
-rw-r--r--trunk/src/htmldocvisitor.cpp1571
-rw-r--r--trunk/src/htmldocvisitor.h160
-rw-r--r--trunk/src/htmlgen.cpp2111
-rw-r--r--trunk/src/htmlgen.h262
-rw-r--r--trunk/src/htmlhelp.cpp659
-rw-r--r--trunk/src/htmlhelp.h99
-rw-r--r--trunk/src/image.cpp331
-rw-r--r--trunk/src/image.h52
-rwxr-xr-xtrunk/src/increasebuffer.pl9
-rw-r--r--trunk/src/index.cpp3133
-rw-r--r--trunk/src/index.h255
-rw-r--r--trunk/src/index.xsd66
-rw-r--r--trunk/src/index_xsd.h66
-rw-r--r--trunk/src/indexlog.cpp152
-rw-r--r--trunk/src/indexlog.h57
-rw-r--r--trunk/src/instdox.cpp186
-rw-r--r--trunk/src/instdox.h23
-rw-r--r--trunk/src/lang_cfg.h37
-rw-r--r--trunk/src/language.cpp413
-rw-r--r--trunk/src/language.h26
-rw-r--r--trunk/src/latexdocvisitor.cpp1274
-rw-r--r--trunk/src/latexdocvisitor.h169
-rw-r--r--trunk/src/latexgen.cpp1892
-rw-r--r--trunk/src/latexgen.h255
-rw-r--r--trunk/src/layout.cpp1141
-rw-r--r--trunk/src/layout.h187
-rw-r--r--trunk/src/layout_default.h184
-rw-r--r--trunk/src/layout_default.xml184
-rw-r--r--trunk/src/libdoxycfg.pro.in27
-rw-r--r--trunk/src/libdoxycfg.t49
-rw-r--r--trunk/src/libdoxygen.pro.in245
-rw-r--r--trunk/src/libdoxygen.t116
-rw-r--r--trunk/src/lockingptr.h162
-rw-r--r--trunk/src/logos.cpp2256
-rw-r--r--trunk/src/logos.h27
-rw-r--r--trunk/src/main.cpp41
-rw-r--r--trunk/src/mandocvisitor.cpp946
-rw-r--r--trunk/src/mandocvisitor.h155
-rw-r--r--trunk/src/mangen.cpp715
-rw-r--r--trunk/src/mangen.h245
-rw-r--r--trunk/src/marshal.cpp826
-rw-r--r--trunk/src/marshal.h132
-rw-r--r--trunk/src/memberdef.cpp4153
-rw-r--r--trunk/src/memberdef.h372
-rw-r--r--trunk/src/membergroup.cpp300
-rw-r--r--trunk/src/membergroup.h138
-rw-r--r--trunk/src/memberlist.cpp611
-rw-r--r--trunk/src/memberlist.h196
-rw-r--r--trunk/src/membername.cpp83
-rw-r--r--trunk/src/membername.h98
-rw-r--r--trunk/src/message.cpp196
-rw-r--r--trunk/src/message.h31
-rw-r--r--trunk/src/msc.cpp173
-rw-r--r--trunk/src/msc.h32
-rw-r--r--trunk/src/namespacedef.cpp905
-rw-r--r--trunk/src/namespacedef.h163
-rw-r--r--trunk/src/objcache.cpp332
-rw-r--r--trunk/src/objcache.h113
-rw-r--r--trunk/src/outputgen.cpp124
-rw-r--r--trunk/src/outputgen.h481
-rw-r--r--trunk/src/outputlist.cpp314
-rw-r--r--trunk/src/outputlist.h484
-rw-r--r--trunk/src/pagedef.cpp241
-rw-r--r--trunk/src/pagedef.h76
-rw-r--r--trunk/src/parserintf.h168
-rw-r--r--trunk/src/perlmodgen.cpp2877
-rw-r--r--trunk/src/perlmodgen.h23
-rw-r--r--trunk/src/pngenc.cpp170
-rw-r--r--trunk/src/pngenc.h58
-rw-r--r--trunk/src/portable.cpp370
-rw-r--r--trunk/src/portable.h41
-rw-r--r--trunk/src/portable_c.c24
-rw-r--r--trunk/src/pre.h35
-rw-r--r--trunk/src/pre.l2534
-rw-r--r--trunk/src/printdocvisitor.h676
-rw-r--r--trunk/src/pycode.h41
-rw-r--r--trunk/src/pycode.l1456
-rw-r--r--trunk/src/pyscanner.h59
-rw-r--r--trunk/src/pyscanner.l1659
-rw-r--r--trunk/src/qhp.cpp300
-rw-r--r--trunk/src/qhp.h67
-rw-r--r--trunk/src/qhpxmlwriter.cpp151
-rw-r--r--trunk/src/qhpxmlwriter.h63
-rw-r--r--trunk/src/qtbc.h45
-rw-r--r--trunk/src/reflist.cpp105
-rw-r--r--trunk/src/reflist.h70
-rw-r--r--trunk/src/rtfdocvisitor.cpp1496
-rw-r--r--trunk/src/rtfdocvisitor.h163
-rw-r--r--trunk/src/rtfgen.cpp2715
-rw-r--r--trunk/src/rtfgen.h269
-rw-r--r--trunk/src/rtfstyle.cpp518
-rw-r--r--trunk/src/rtfstyle.h83
-rw-r--r--trunk/src/scanner.h54
-rw-r--r--trunk/src/scanner.l5730
-rw-r--r--trunk/src/search.php324
-rw-r--r--trunk/src/search_php.h324
-rw-r--r--trunk/src/searchindex.cpp287
-rw-r--r--trunk/src/searchindex.h71
-rw-r--r--trunk/src/section.h63
-rw-r--r--trunk/src/sortdict.h645
-rw-r--r--trunk/src/store.cpp405
-rw-r--r--trunk/src/store.h118
-rw-r--r--trunk/src/tagreader.cpp1402
-rw-r--r--trunk/src/tagreader.h28
-rw-r--r--trunk/src/textdocvisitor.cpp86
-rw-r--r--trunk/src/textdocvisitor.h132
-rw-r--r--trunk/src/translator.cpp248
-rw-r--r--trunk/src/translator.h481
-rw-r--r--trunk/src/translator_adapter.h236
-rw-r--r--trunk/src/translator_ar.h1615
-rw-r--r--trunk/src/translator_br.h1778
-rw-r--r--trunk/src/translator_ca.h1788
-rw-r--r--trunk/src/translator_cn.h1793
-rw-r--r--trunk/src/translator_cz.h1821
-rw-r--r--trunk/src/translator_de.h1873
-rw-r--r--trunk/src/translator_dk.h1513
-rw-r--r--trunk/src/translator_en.h1782
-rw-r--r--trunk/src/translator_eo.h1780
-rw-r--r--trunk/src/translator_es.h1840
-rw-r--r--trunk/src/translator_fa.h1719
-rw-r--r--trunk/src/translator_fi.h1903
-rw-r--r--trunk/src/translator_fr.h1742
-rw-r--r--trunk/src/translator_gr.h1605
-rw-r--r--trunk/src/translator_hr.h1483
-rw-r--r--trunk/src/translator_hu.h1546
-rw-r--r--trunk/src/translator_id.h1596
-rw-r--r--trunk/src/translator_it.h1755
-rw-r--r--trunk/src/translator_je.h67
-rw-r--r--trunk/src/translator_jp.h1772
-rw-r--r--trunk/src/translator_ke.h59
-rw-r--r--trunk/src/translator_kr.h1799
-rw-r--r--trunk/src/translator_lt.h1563
-rw-r--r--trunk/src/translator_mk.h1767
-rw-r--r--trunk/src/translator_nl.h1377
-rw-r--r--trunk/src/translator_no.h1617
-rw-r--r--trunk/src/translator_pl.h1787
-rw-r--r--trunk/src/translator_pt.h1483
-rw-r--r--trunk/src/translator_ro.h1797
-rw-r--r--trunk/src/translator_ru.h1758
-rw-r--r--trunk/src/translator_sc.h1805
-rw-r--r--trunk/src/translator_si.h1251
-rw-r--r--trunk/src/translator_sk.h1398
-rw-r--r--trunk/src/translator_sr.h1838
-rw-r--r--trunk/src/translator_sv.h1662
-rw-r--r--trunk/src/translator_tr.h1781
-rw-r--r--trunk/src/translator_tw.h1759
-rw-r--r--trunk/src/translator_ua.h1589
-rw-r--r--trunk/src/translator_vi.h1787
-rw-r--r--trunk/src/translator_za.h1555
-rw-r--r--trunk/src/translatordecoder.h719
-rw-r--r--trunk/src/util.cpp6846
-rw-r--r--trunk/src/util.h366
-rw-r--r--trunk/src/version.h23
-rw-r--r--trunk/src/vhdlcode.h18
-rw-r--r--trunk/src/vhdlcode.l1603
-rw-r--r--trunk/src/vhdldocgen.cpp2452
-rw-r--r--trunk/src/vhdldocgen.h276
-rw-r--r--trunk/src/vhdlscanner.h89
-rw-r--r--trunk/src/vhdlscanner.l2006
-rw-r--r--trunk/src/xmldocvisitor.cpp933
-rw-r--r--trunk/src/xmldocvisitor.h156
-rw-r--r--trunk/src/xmlgen.cpp1972
-rw-r--r--trunk/src/xmlgen.h20
-rw-r--r--trunk/tmake/CHANGES49
-rw-r--r--trunk/tmake/LICENSE9
-rw-r--r--trunk/tmake/README10
-rwxr-xr-xtrunk/tmake/bin/progen249
-rwxr-xr-xtrunk/tmake/bin/tmake1262
-rw-r--r--trunk/tmake/doc/m-linux-gcc.html85
-rw-r--r--trunk/tmake/doc/m-win32-msvc.html89
-rw-r--r--trunk/tmake/doc/tmake.html727
-rw-r--r--trunk/tmake/doc/tmake_ref.html463
-rw-r--r--trunk/tmake/example/hello.cpp102
-rw-r--r--trunk/tmake/example/hello.h34
-rw-r--r--trunk/tmake/example/hello.pro3
-rw-r--r--trunk/tmake/example/main.cpp38
-rw-r--r--trunk/tmake/example/wc.t6
-rwxr-xr-xtrunk/tmake/lib/aix-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/aix-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/aix-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/aix-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/aix-xlc/app.t2
-rwxr-xr-xtrunk/tmake/lib/aix-xlc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/aix-xlc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/aix-xlc/tmake.conf64
-rwxr-xr-xtrunk/tmake/lib/beos-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/beos-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/beos-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/beos-g++/tmake.conf51
-rwxr-xr-xtrunk/tmake/lib/bsdi-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/bsdi-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/bsdi-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/bsdi-g++/tmake.conf61
-rwxr-xr-xtrunk/tmake/lib/dgux-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/dgux-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/dgux-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/dgux-g++/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/freebsd-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/freebsd-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/freebsd-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/freebsd-g++/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/gnu-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/gnu-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/gnu-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/gnu-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/hpux-acc/app.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-acc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-acc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-acc/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/hpux-cc/app.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-cc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-cc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-cc/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/hpux-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/hpux-g++/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/irix-64/app.t2
-rwxr-xr-xtrunk/tmake/lib/irix-64/lib.t2
-rwxr-xr-xtrunk/tmake/lib/irix-64/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/irix-64/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/irix-dcc/app.t2
-rwxr-xr-xtrunk/tmake/lib/irix-dcc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/irix-dcc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/irix-dcc/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/irix-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/irix-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/irix-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/irix-g++/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/irix-n32/app.t2
-rwxr-xr-xtrunk/tmake/lib/irix-n32/lib.t2
-rwxr-xr-xtrunk/tmake/lib/irix-n32/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/irix-n32/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/irix-o32/app.t2
-rwxr-xr-xtrunk/tmake/lib/irix-o32/lib.t2
-rwxr-xr-xtrunk/tmake/lib/irix-o32/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/irix-o32/tmake.conf60
-rw-r--r--trunk/tmake/lib/linux-64/app.t2
-rw-r--r--trunk/tmake/lib/linux-64/lib.t2
-rw-r--r--trunk/tmake/lib/linux-64/subdirs.t2
-rw-r--r--trunk/tmake/lib/linux-64/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/linux-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/linux-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/linux-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/linux-g++/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/m68k-atari-mint-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/m68k-atari-mint-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/m68k-atari-mint-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/m68k-atari-mint-g++/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/macosx-c++/app.t2
-rwxr-xr-xtrunk/tmake/lib/macosx-c++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/macosx-c++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/macosx-c++/tmake.conf59
-rw-r--r--trunk/tmake/lib/macosx-uni-c++/app.t2
-rw-r--r--trunk/tmake/lib/macosx-uni-c++/lib.t2
-rw-r--r--trunk/tmake/lib/macosx-uni-c++/subdirs.t2
-rw-r--r--trunk/tmake/lib/macosx-uni-c++/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/netbsd-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/netbsd-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/netbsd-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/netbsd-g++/tmake.conf61
-rwxr-xr-xtrunk/tmake/lib/openbsd-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/openbsd-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/openbsd-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/openbsd-g++/tmake.conf61
-rwxr-xr-xtrunk/tmake/lib/osf1-cxx/app.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-cxx/lib.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-cxx/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-cxx/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/osf1-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/osf1-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/qnx-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/qnx-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/qnx-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/qnx-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/sco-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/sco-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/sco-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/sco-g++/tmake.conf58
-rw-r--r--trunk/tmake/lib/solaris-cc-64/app.t2
-rw-r--r--trunk/tmake/lib/solaris-cc-64/lib.t2
-rw-r--r--trunk/tmake/lib/solaris-cc-64/subdirs.t2
-rw-r--r--trunk/tmake/lib/solaris-cc-64/tmake.conf61
-rwxr-xr-xtrunk/tmake/lib/solaris-cc-gcc/app.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc-gcc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc-gcc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc-gcc/tmake.conf62
-rwxr-xr-xtrunk/tmake/lib/solaris-cc/app.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-cc/tmake.conf61
-rwxr-xr-xtrunk/tmake/lib/solaris-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/solaris-g++/tmake.conf59
-rwxr-xr-xtrunk/tmake/lib/sunos-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/sunos-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/sunos-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/sunos-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/ultrix-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/ultrix-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/ultrix-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/ultrix-g++/tmake.conf58
-rwxr-xr-xtrunk/tmake/lib/unix/app.t6
-rwxr-xr-xtrunk/tmake/lib/unix/generic.t283
-rwxr-xr-xtrunk/tmake/lib/unix/lib.t6
-rwxr-xr-xtrunk/tmake/lib/unix/subdirs.t38
-rwxr-xr-xtrunk/tmake/lib/unixware-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/unixware-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/unixware-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/unixware-g++/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/unixware7-cc/app.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-cc/lib.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-cc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-cc/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/unixware7-g++/app.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-g++/lib.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/unixware7-g++/tmake.conf60
-rwxr-xr-xtrunk/tmake/lib/win32-borland/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-borland/generic.t237
-rwxr-xr-xtrunk/tmake/lib/win32-borland/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-borland/subdirs.t3
-rwxr-xr-xtrunk/tmake/lib/win32-borland/tmake.conf56
-rwxr-xr-xtrunk/tmake/lib/win32-g++/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-g++/generic.t241
-rwxr-xr-xtrunk/tmake/lib/win32-g++/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-g++/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-g++/tmake.conf56
-rwxr-xr-xtrunk/tmake/lib/win32-mingw/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-mingw/generic.t241
-rwxr-xr-xtrunk/tmake/lib/win32-mingw/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-mingw/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-mingw/tmake.conf56
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/generic.t229
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/tmake.conf65
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/vcapp.t244
-rwxr-xr-xtrunk/tmake/lib/win32-msvc/vclib.t178
-rwxr-xr-xtrunk/tmake/lib/win32-symantec/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-symantec/generic.t211
-rwxr-xr-xtrunk/tmake/lib/win32-symantec/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-symantec/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-symantec/tmake.conf56
-rwxr-xr-xtrunk/tmake/lib/win32-visage/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-visage/generic.t207
-rwxr-xr-xtrunk/tmake/lib/win32-visage/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-visage/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-visage/tmake.conf56
-rwxr-xr-xtrunk/tmake/lib/win32-watcom/app.t6
-rwxr-xr-xtrunk/tmake/lib/win32-watcom/generic.t201
-rwxr-xr-xtrunk/tmake/lib/win32-watcom/lib.t6
-rwxr-xr-xtrunk/tmake/lib/win32-watcom/subdirs.t2
-rwxr-xr-xtrunk/tmake/lib/win32-watcom/tmake.conf54
-rwxr-xr-xtrunk/tmake/lib/win32/subdirs.t54
-rw-r--r--trunk/winbuild/Doxygen.sln58
-rw-r--r--trunk/winbuild/Doxygen.vcproj2602
-rw-r--r--trunk/winbuild/Doxytag.vcproj327
-rw-r--r--trunk/winbuild/Doxywizard.vcproj585
-rw-r--r--trunk/winbuild/Lex.rules40
-rw-r--r--trunk/winbuild/iconv.h141
-rw-r--r--trunk/winbuild/iconv.libbin0 -> 958612 bytes-rw-r--r--trunk/winbuild/libpng.vcproj570
-rw-r--r--trunk/winbuild/moc.rules20
-rw-r--r--trunk/winbuild/qtools.vcproj924
-rw-r--r--trunk/winbuild/runbison.bat3
-rw-r--r--trunk/winbuild/unistd.h7
-rw-r--r--trunk/winbuild/version.bat24
-rw-r--r--trunk/winbuild/zlib.vcproj474
-rw-r--r--trunk/wintools/Doxygen.dsp720
-rw-r--r--trunk/wintools/Doxygen.dsw113
-rw-r--r--trunk/wintools/Doxytag.dsp157
-rw-r--r--trunk/wintools/Doxytag.dsw33
-rw-r--r--trunk/wintools/README20
-rw-r--r--trunk/wintools/libpng.dsp173
-rw-r--r--trunk/wintools/libpng.dsw29
-rwxr-xr-xtrunk/wintools/make.pl39
-rw-r--r--trunk/wintools/qtools.dsp373
-rw-r--r--trunk/wintools/qtools.dsw33
-rw-r--r--trunk/wintools/version.pl25
-rw-r--r--trunk/wintools/zlib.dsp193
-rw-r--r--trunk/wintools/zlib.dsw33
833 files changed, 353171 insertions, 0 deletions
diff --git a/trunk/CVSROOT/checkoutlist b/trunk/CVSROOT/checkoutlist
new file mode 100644
index 0000000..b04b350
--- /dev/null
+++ b/trunk/CVSROOT/checkoutlist
@@ -0,0 +1,13 @@
+# The "checkoutlist" file is used to support additional version controlled
+# administrative files in $CVSROOT/CVSROOT, such as template files.
+#
+# The first entry on a line is a filename which will be checked out from
+# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
+# The remainder of the line is an error message to use if the file cannot
+# be checked out.
+#
+# File format:
+#
+# [<whitespace>]<filename><whitespace><error message><end-of-line>
+#
+# comment lines begin with '#'
diff --git a/trunk/CVSROOT/commitinfo b/trunk/CVSROOT/commitinfo
new file mode 100644
index 0000000..b19e7b7
--- /dev/null
+++ b/trunk/CVSROOT/commitinfo
@@ -0,0 +1,15 @@
+# The "commitinfo" file is used to control pre-commit checks.
+# The filter on the right is invoked with the repository and a list
+# of files to check. A non-zero exit of the filter program will
+# cause the commit to be aborted.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being committed to, relative
+# to the $CVSROOT. For the first match that is found, then the remainder
+# of the line is the name of the filter to run.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".
diff --git a/trunk/CVSROOT/config b/trunk/CVSROOT/config
new file mode 100644
index 0000000..8817419
--- /dev/null
+++ b/trunk/CVSROOT/config
@@ -0,0 +1,9 @@
+# Set this to "no" if pserver shouldn't check system users/passwords
+#SystemAuth=no
+
+# Set `PreservePermissions' to `yes' to save file status information
+# in the repository.
+#PreservePermissions=no
+
+TopLevelAdmin=yes
+#LockDir=/u/kp3softd/cvslocks/
diff --git a/trunk/CVSROOT/cvswrappers b/trunk/CVSROOT/cvswrappers
new file mode 100644
index 0000000..0c725ea
--- /dev/null
+++ b/trunk/CVSROOT/cvswrappers
@@ -0,0 +1,23 @@
+# This file affects handling of files based on their names.
+#
+# The -t/-f options allow one to treat directories of files
+# as a single file, or to transform a file in other ways on
+# its way in and out of CVS.
+#
+# The -m option specifies whether CVS attempts to merge files.
+#
+# The -k option specifies keyword expansion (e.g. -kb for binary).
+#
+# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
+#
+# wildcard [option value][option value]...
+#
+# where option is one of
+# -f from cvs filter value: path to filter
+# -t to cvs filter value: path to filter
+# -m update methodology value: MERGE or COPY
+# -k expansion mode value: b, o, kkv, &c
+#
+# and value is a single-quote delimited value.
+# For example:
+*.gif -k 'b' -m 'COPY'
diff --git a/trunk/CVSROOT/editinfo b/trunk/CVSROOT/editinfo
new file mode 100644
index 0000000..d78886c
--- /dev/null
+++ b/trunk/CVSROOT/editinfo
@@ -0,0 +1,21 @@
+# The "editinfo" file is used to allow verification of logging
+# information. It works best when a template (as specified in the
+# rcsinfo file) is provided for the logging procedure. Given a
+# template with locations for, a bug-id number, a list of people who
+# reviewed the code before it can be checked in, and an external
+# process to catalog the differences that were code reviewed, the
+# following test can be applied to the code:
+#
+# Making sure that the entered bug-id number is correct.
+# Validating that the code that was reviewed is indeed the code being
+# checked in (using the bug-id number or a seperate review
+# number to identify this particular code set.).
+#
+# If any of the above test failed, then the commit would be aborted.
+#
+# Actions such as mailing a copy of the report to each reviewer are
+# better handled by an entry in the loginfo file.
+#
+# One thing that should be noted is the the ALL keyword is not
+# supported. There can be only one entry that matches a given
+# repository.
diff --git a/trunk/CVSROOT/loginfo b/trunk/CVSROOT/loginfo
new file mode 100644
index 0000000..5a59f0a
--- /dev/null
+++ b/trunk/CVSROOT/loginfo
@@ -0,0 +1,26 @@
+# The "loginfo" file controls where "cvs commit" log information
+# is sent. The first entry on a line is a regular expression which must match
+# the directory that the change is being made to, relative to the
+# $CVSROOT. If a match is found, then the remainder of the line is a filter
+# program that should expect log information on its standard input.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name ALL appears as a regular expression it is always used
+# in addition to the first matching regex or DEFAULT.
+#
+# You may specify a format string as part of the
+# filter. The string is composed of a `%' followed
+# by a single format character, or followed by a set of format
+# characters surrounded by `{' and `}' as separators. The format
+# characters are:
+#
+# s = file name
+# V = old version number (pre-checkin)
+# v = new version number (post-checkin)
+#
+# For example:
+#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
+# or
+#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
diff --git a/trunk/CVSROOT/modules b/trunk/CVSROOT/modules
new file mode 100644
index 0000000..581582c
--- /dev/null
+++ b/trunk/CVSROOT/modules
@@ -0,0 +1,27 @@
+# Three different line formats are valid:
+# key -a aliases...
+# key [options] directory
+# key [options] directory files...
+#
+# Where "options" are composed of:
+# -i prog Run "prog" on "cvs commit" from top-level of module.
+# -o prog Run "prog" on "cvs checkout" of module.
+# -e prog Run "prog" on "cvs export" of module.
+# -t prog Run "prog" on "cvs rtag" of module.
+# -u prog Run "prog" on "cvs update" of module.
+# -d dir Place module in directory "dir" instead of module name.
+# -l Top-level directory only -- do not recurse.
+#
+# NOTE: If you change any of the "Run" options above, you'll have to
+# release and re-checkout any working directories of these modules.
+#
+# And "directory" is a path to a directory relative to $CVSROOT.
+#
+# The "-a" option specifies an alias. An alias is interpreted as if
+# everything on the right of the "-a" had been typed on the command line.
+#
+# You can encode a module within a module by using the special '&'
+# character to interpose another module into the current module. This
+# can be useful for creating a module that consists of many directories
+# spread out over the entire source repository.
+doxygen -a addon bin doc examples html lib objects packages qtools src tmake wintools libpng libmd5
diff --git a/trunk/CVSROOT/notify b/trunk/CVSROOT/notify
new file mode 100644
index 0000000..34f0bc2
--- /dev/null
+++ b/trunk/CVSROOT/notify
@@ -0,0 +1,12 @@
+# The "notify" file controls where notifications from watches set by
+# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
+# a regular expression which is tested against the directory that the
+# change is being made to, relative to the $CVSROOT. If it matches,
+# then the remainder of the line is a filter program that should contain
+# one occurrence of %s for the user to notify, and information on its
+# standard input.
+#
+# "ALL" or "DEFAULT" can be used in place of the regular expression.
+#
+# For example:
+#ALL mail %s -s "CVS notification"
diff --git a/trunk/CVSROOT/rcsinfo b/trunk/CVSROOT/rcsinfo
new file mode 100644
index 0000000..49e59f4
--- /dev/null
+++ b/trunk/CVSROOT/rcsinfo
@@ -0,0 +1,13 @@
+# The "rcsinfo" file is used to control templates with which the editor
+# is invoked on commit and import.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being made to, relative to the
+# $CVSROOT. For the first match that is found, then the remainder of the
+# line is the name of the file that contains the template.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".
diff --git a/trunk/CVSROOT/taginfo b/trunk/CVSROOT/taginfo
new file mode 100644
index 0000000..274a46d
--- /dev/null
+++ b/trunk/CVSROOT/taginfo
@@ -0,0 +1,20 @@
+# The "taginfo" file is used to control pre-tag checks.
+# The filter on the right is invoked with the following arguments:
+#
+# $1 -- tagname
+# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
+# $3 -- repository
+# $4-> file revision [file revision ...]
+#
+# A non-zero exit of the filter program will cause the tag to be aborted.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being committed to, relative
+# to the $CVSROOT. For the first match that is found, then the remainder
+# of the line is the name of the filter to run.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name "ALL" appears as a regular expression it is always used
+# in addition to the first matching regex or "DEFAULT".
diff --git a/trunk/CVSROOT/verifymsg b/trunk/CVSROOT/verifymsg
new file mode 100644
index 0000000..86f747c
--- /dev/null
+++ b/trunk/CVSROOT/verifymsg
@@ -0,0 +1,21 @@
+# The "verifymsg" file is used to allow verification of logging
+# information. It works best when a template (as specified in the
+# rcsinfo file) is provided for the logging procedure. Given a
+# template with locations for, a bug-id number, a list of people who
+# reviewed the code before it can be checked in, and an external
+# process to catalog the differences that were code reviewed, the
+# following test can be applied to the code:
+#
+# Making sure that the entered bug-id number is correct.
+# Validating that the code that was reviewed is indeed the code being
+# checked in (using the bug-id number or a seperate review
+# number to identify this particular code set.).
+#
+# If any of the above test failed, then the commit would be aborted.
+#
+# Actions such as mailing a copy of the report to each reviewer are
+# better handled by an entry in the loginfo file.
+#
+# One thing that should be noted is the the ALL keyword is not
+# supported. There can be only one entry that matches a given
+# repository.
diff --git a/trunk/Doxyfile b/trunk/Doxyfile
new file mode 100644
index 0000000..79a1cee
--- /dev/null
+++ b/trunk/Doxyfile
@@ -0,0 +1,275 @@
+# Doxyfile 1.5.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = Doxygen
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY = doxygen_docs
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = YES
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text "
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = src
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS = *.h \
+ *.cpp
+RECURSIVE = NO
+EXCLUDE = src/code.cpp \
+ src/ce_lex.cpp \
+ src/ce_parse.cpp \
+ src/declinfo.cpp \
+ src/defargs.cpp \
+ src/doxytag.cpp \
+ src/pre.cpp \
+ src/scanner.cpp \
+ src/tag.cpp \
+ src/doctokenizer.cpp \
+ src/logos.cpp \
+ src/suffixtree.cpp \
+ src/suffixtree.h \
+ src/searchindex.cpp \
+ src/searchindex.h \
+ src/commentcnv.cpp \
+ src/commentscan.cpp \
+ src/pycode.cpp \
+ src/config.cpp \
+ src/pyscanner.cpp \
+ src/fortranscanner.cpp \
+ src/fortrancode.cpp \
+ src/vhdlscanner.cpp \
+ src/vhdlcode.cpp
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT =
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+HTML_DYNAMIC_SECTIONS = YES
+GENERATE_DOCSET = YES
+DOCSET_FEEDNAME = "Doxygen docs"
+DOCSET_BUNDLE_ID = org.doxygen.Doxygen
+GENERATE_HTMLHELP = YES
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE = org.doxygen.Project
+QHP_VIRTUAL_FOLDER = doc
+QHG_LOCATION =
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+FORMULA_FONTSIZE = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT =
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT =
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT =
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES = qtools_docs/qtools.tag=../../qtools_docs/html
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
+DOT_FONTNAME = FreeSans
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = YES
diff --git a/trunk/INSTALL b/trunk/INSTALL
new file mode 100644
index 0000000..79fd565
--- /dev/null
+++ b/trunk/INSTALL
@@ -0,0 +1,7 @@
+DOXYGEN Version 1.5.9-20090522
+
+Please read the installation section of the manual
+(http://www.doxygen.org/install.html) for instructions.
+
+--------
+Dimitri van Heesch (22 May 2009)
diff --git a/trunk/LANGUAGE.HOWTO b/trunk/LANGUAGE.HOWTO
new file mode 100644
index 0000000..306b4bf
--- /dev/null
+++ b/trunk/LANGUAGE.HOWTO
@@ -0,0 +1,49 @@
+This short howto explains how to add support for a new language to Doxygen:
+
+Just follow these steps:
+
+1) Tell me for which language you want to add support. If no one else
+ is already working on support for that language, you will be
+ assigned as the maintainer for the language. I'll create a
+ list on Doxygen's homepage, so everyone knows who is doing what.
+2) Create a copy of translator_en.h and name it
+ translator_<your_2_letter_counter_code>.h
+ I'll use xx in the rest of this document.
+3) Edit language.cpp:
+ - Add a #include<translator_xx.h>
+ - In setTranslator() add
+
+ else if (L_EQUAL("your_language_name"))
+ {
+ theTranslator = new TranslatorYourLanguage;
+ }
+
+ after the if { ... }
+4) Edit libdoxygen.pro.in and add translator_xx.h to the HEADERS line.
+5) Edit translator_xx.h:
+ - Rename TRANSLATOR_EN_H to TRANSLATOR_XX_H twice.
+ - Rename TranslatorEnglish to TranslatorYourLanguage
+ - In the member idLanguage() change "english" into the name of your
+ language (use lower case characters only). Depending on the language you
+ may also wish to change the member functions latexLanguageSupportCommand()
+ and idLanguageCharset().
+ - Edit all the strings that are returned by the members that start
+ with tr. Try to match punctuation and capitals!
+ To enter special characters (with accents) you can:
+ a) Enter them directly if your keyboard supports that and you are
+ using a Latin-1 font.
+ Doxygen will translate the characters to proper Latex and
+ leave the Html and man output for what it is (which is fine, if
+ idLanguageCharset() is set correctly).
+ b) Use html codes like &auml; for an a with an umlaut (i.e. ä).
+ See the HTML specification for the codes.
+6) Run configure and make again from the root of the distribution,
+ in order to regenerate the Makefiles.
+7) Now you can use OUTPUT_LANGUAGE = your_language_name
+ in the config file to generate output in your language.
+8) Send translator_xx.h to me so I can add it to doxygen.
+ Send also your name and e-mail address to be included in the
+ maintainers.txt list.
+
+Good luck, and let me know if there are problems.
+
diff --git a/trunk/LICENSE b/trunk/LICENSE
new file mode 100644
index 0000000..219ec28
--- /dev/null
+++ b/trunk/LICENSE
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) yyyy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) yyyy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/trunk/Makefile.in b/trunk/Makefile.in
new file mode 100644
index 0000000..618fb05
--- /dev/null
+++ b/trunk/Makefile.in
@@ -0,0 +1,143 @@
+#all: src/version.cpp doxywizard
+# cd qtools ; $(MAKE)
+# cd src ; $(MAKE)
+
+DESTDIR =
+
+clean: FORCE
+ cd examples ; $(MAKE) clean
+ cd doc ; $(MAKE) clean
+ cd qtools ; $(MAKE) clean
+ cd src ; $(MAKE) clean
+ cd libpng ; $(MAKE) clean
+ cd libmd5 ; $(MAKE) clean
+ cd addon/doxywizard ; $(MAKE) clean
+ cd addon/doxmlparser/src ; $(MAKE) clean
+ cd addon/doxmlparser/test ; $(MAKE) clean
+ cd addon/doxmlparser/examples/metrics ; $(MAKE) clean
+ -rm -f bin/doxy*
+ -rm -f objects/*.o
+
+distclean: clean
+ cd src ; $(MAKE) distclean
+ cd libpng ; $(MAKE) distclean
+ cd libmd5 ; $(MAKE) distclean
+ cd addon/doxywizard ; $(MAKE) distclean
+ cd addon/doxmlparser/src ; $(MAKE) distclean
+ cd addon/doxmlparser/test ; $(MAKE) distclean
+ cd addon/doxmlparser/examples/metrics ; $(MAKE) distclean
+ cd addon/doxyapp ; $(MAKE) distclean
+ -rm -f lib/lib*
+ -rm -f bin/doxy*
+ -rm -f html
+ -rm -f latex
+ -rm -f objects/*.o
+ -rm -f src/Makefile.doxygen src/Makefile.libdoxygen
+ -rm -f src/Makefile.doxytag src/Makefile.libdoxycfg
+ -rm -f libpng/Makefile.libpng
+ -rm -f libmd5/Makefile.libmd5
+ -rm -f Makefile qtools/Makefile src/Makefile examples/Makefile doc/Makefile
+ -rm -f .makeconfig .tmakeconfig
+ -rm -f src/doxygen.pro src/libdoxygen.pro src/doxytag.pro qtools/qtools.pro src/libdoxycfg.pro libpng/libpng.pro libmd5/libmd5.pro
+ -rm -f src/version.cpp
+ -rm -r addon/doxywizard/Makefile
+ -rm -f addon/doxywizard/doxywizard.pro
+ -rm -f VERSION
+ -rm -f packages/rpm/doxygen.spec
+
+DATE=$(shell date "+%B %Y")
+
+MAN1DIR = man/man1
+
+install: doxywizard_install
+ $(INSTTOOL) -d $(DESTDIR)/$(INSTALL)/bin
+ $(INSTTOOL) -m 755 bin/doxygen $(DESTDIR)/$(INSTALL)/bin
+ $(INSTTOOL) -m 755 bin/doxytag $(DESTDIR)/$(INSTALL)/bin
+ $(INSTTOOL) -d $(DESTDIR)/$(INSTALL)/$(MAN1DIR)
+ cat doc/doxygen.1 | sed -e "s/DATE/$(DATE)/g" -e "s/VERSION/$(VERSION)/g" > doxygen.1
+ $(INSTTOOL) -m 644 doxygen.1 $(DESTDIR)/$(INSTALL)/$(MAN1DIR)/doxygen.1
+ rm doxygen.1
+ cat doc/doxytag.1 | sed -e "s/DATE/$(DATE)/g" -e "s/VERSION/$(VERSION)/g" > doxytag.1
+ $(INSTTOOL) -m 644 doxytag.1 $(DESTDIR)/$(INSTALL)/$(MAN1DIR)/doxytag.1
+ rm doxytag.1
+
+install_docs:
+ $(INSTTOOL) -d $(DESTDIR)/$(DOCDIR)
+ $(MAKE) -C examples
+ $(MAKE) -C doc
+ $(MAKE) -C latex
+ $(INSTTOOL) -m 644 latex/doxygen_manual.pdf $(DESTDIR)/$(DOCDIR)
+ cp -r examples $(DESTDIR)/$(DOCDIR)
+ cp -r html $(DESTDIR)/$(DOCDIR)
+
+docs: FORCE
+ cd examples ; $(MAKE)
+ cd doc ; $(MAKE)
+
+pdf: docs
+ cd latex ; $(MAKE)
+
+DISTFILES = Doxyfile libpng libmd5 addon tmake doc wintools examples bin lib objects \
+ qtools src configure configure.bin Makefile.in Makefile.win_nmake.in \
+ Makefile.win_make.in INSTALL make.bat LANGUAGE.HOWTO LICENSE PLATFORMS \
+ VERSION packages winbuild
+
+archive: clean
+ tar zcvf dx`date +%y%m%d`.tgz $(DISTFILES)
+
+DISTDIR = doxygen-`echo $(VERSION) | tr - _`
+
+dist: clean
+ rm -rf $(DISTDIR)
+ mkdir $(DISTDIR)
+ cp -a $(DISTFILES) README $(DISTDIR)
+ find $(DISTDIR) \( -name ".svn" \) -print0 | xargs -0 rm -rf
+ tar zcvf $(DISTDIR).src.tar.gz $(DISTDIR)
+ rm -rf $(DISTDIR)
+
+src/version.cpp: Makefile
+ echo "char versionString[]=\"$(VERSION)\";" > src/version.cpp
+
+addon/doxywizard/version.cpp: Makefile
+ echo "char versionString[]=\"$(VERSION)\";" > addon/doxywizard/version.cpp
+
+DISTDIR = doxygen-`echo $(VERSION) | tr - _`
+rpm: dist
+ gzip -df $(DISTDIR).src.tar.gz
+ mkdir $(DISTDIR)
+ mkdir $(DISTDIR)/packages
+ mkdir $(DISTDIR)/packages/rpm
+ cp packages/rpm/doxygen.spec $(DISTDIR)/packages/rpm
+ tar -rvf $(DISTDIR).src.tar $(DISTDIR)/packages/rpm/doxygen.spec
+ rm -rf $(DISTDIR)
+ gzip -9v $(DISTDIR).src.tar
+ rpmbuild -ta %%WITHDOXYWIZARD%% $(DISTDIR).src.tar.gz
+
+rpmsrc: dist
+ gzip -df $(DISTDIR).src.tar.gz
+ mkdir $(DISTDIR)
+ mkdir $(DISTDIR)/packages
+ mkdir $(DISTDIR)/packages/rpm
+ cp packages/rpm/doxygen.spec $(DISTDIR)/packages/rpm
+ tar -rvf $(DISTDIR).src.tar $(DISTDIR)/packages/rpm/doxygen.spec
+ rm -rf $(DISTDIR)
+ gzip -9v $(DISTDIR).src.tar
+ rpmbuild -ts %%WITHDOXYWIZARD%% $(DISTDIR).src.tar.gz
+
+rpmbinary: dist
+ gzip -df $(DISTDIR).src.tar.gz
+ mkdir $(DISTDIR)
+ mkdir $(DISTDIR)/packages
+ mkdir $(DISTDIR)/packages/rpm
+ cp packages/rpm/doxygen.spec $(DISTDIR)/packages/rpm
+ tar -rvf $(DISTDIR).src.tar $(DISTDIR)/packages/rpm/doxygen.spec
+ rm -rf $(DISTDIR)
+ gzip -9v $(DISTDIR).src.tar
+ rpmbuild -tb %%WITHDOXYWIZARD%% $(DISTDIR).src.tar.gz
+
+
+ctags:
+ ctags -f tags src addon/doxywizard qtools
+
+FORCE:
+
diff --git a/trunk/Makefile.win_make.in b/trunk/Makefile.win_make.in
new file mode 100644
index 0000000..8635696
--- /dev/null
+++ b/trunk/Makefile.win_make.in
@@ -0,0 +1,33 @@
+all: src\version.cpp
+ set TMAKEPATH=$(TMAKEPATH) & cd qtools & $(MAKE)
+ set TMAKEPATH=$(TMAKEPATH) & cd libpng & $(MAKE)
+ set TMAKEPATH=$(TMAKEPATH) & cd libmd5 & $(MAKE)
+ set TMAKEPATH=$(TMAKEPATH) & cd src & $(MAKE)
+
+clean:
+ cd examples & $(MAKE) clean
+ cd doc & $(MAKE) clean
+ cd src & $(MAKE) clean
+ -del bin\doxy*.*
+ -del objects\*.o
+
+distclean: clean
+ -del src\Makefile.libdoxygen \
+ src\Makefile.doxygen \
+ src\Makefile.doxytag \
+ src\Makefile.libdoxycfg
+ -del Makefile src\Makefile examples\Makefile doc\Makefile
+ -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\libdoxycfg.pro
+ -del src\version.cpp
+
+docs:
+ set TMAKEPATH=$(TMAKEPATH) & cd examples & $(MAKE)
+ set TMAKEPATH=$(TMAKEPATH) & cd doc & $(MAKE)
+
+ps: docs
+ cd latex & $(MAKE)
+
+src\version.cpp: Makefile
+ echo char versionString[]="""$(VERSION)"""; > src\version.cpp
+
+FORCE:
diff --git a/trunk/Makefile.win_nmake.in b/trunk/Makefile.win_nmake.in
new file mode 100644
index 0000000..d618b6c
--- /dev/null
+++ b/trunk/Makefile.win_nmake.in
@@ -0,0 +1,52 @@
+all: src\version.cpp
+ set TMAKEPATH=$(TMAKEPATH)
+ cd qtools
+ $(MAKE)
+ cd ..
+ cd libpng
+ $(MAKE)
+ cd ..
+ cd libmd5
+ $(MAKE)
+ cd ..
+ cd src
+ $(MAKE)
+
+clean: FORCE
+ cd examples
+ $(MAKE) clean
+ cd ..
+ cd doc
+ $(MAKE) clean
+ cd ..
+ cd src
+ $(MAKE) clean
+ cd ..
+ -del bin\doxy*.*
+ -del objects\*.o
+
+distclean: clean
+ -del src\Makefile.libdoxygen \
+ src\Makefile.doxygen \
+ src\Makefile.doxytag \
+ src\Makefile.libdoxycfg
+ -del Makefile src\Makefile examples\Makefile doc\Makefile
+ -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\libdoxycfg.pro
+ -del src\version.cpp
+
+docs: FORCE
+ cd examples
+ $(MAKE)
+ cd ..
+ cd doc
+ $(MAKE)
+ cd ..
+
+ps: docs
+ cd latex
+ $(MAKE)
+
+src\version.cpp: Makefile
+ echo char versionString[]="$(VERSION)"; > src\version.cpp
+
+FORCE:
diff --git a/trunk/PLATFORMS b/trunk/PLATFORMS
new file mode 100644
index 0000000..c358a1d
--- /dev/null
+++ b/trunk/PLATFORMS
@@ -0,0 +1,31 @@
+aix-g++
+aix-xlc
+beos-g++
+dgux-g++
+freebsd-g++
+gnu-g++
+hpux-acc
+hpux-cc
+hpux-g++
+irix-64
+irix-dcc
+irix-g++
+irix-n32
+linux-g++
+linux-64
+macosx-c++
+macosx-uni-c++
+m68k-atari-mint-g++
+netbsd-g++
+openbsd-g++
+osf1-cxx
+osf1-g++
+qnx-g++
+sco-g++
+solaris-cc
+solaris-cc-64
+solaris-g++
+sunos-g++
+ultrix-g++
+unixware-g++
+win32-g++
diff --git a/trunk/README b/trunk/README
new file mode 100644
index 0000000..604f849
--- /dev/null
+++ b/trunk/README
@@ -0,0 +1,20 @@
+DOXYGEN Version 1.5.9_20090522
+
+Please read INSTALL for compilation instructions.
+
+The latest version of doxygen can be obtained at
+ http://www.doxygen.org/
+
+There are two mailing lists
+ doxygen-users@lists.sourceforge.net
+ doxygen-develop@lists.sourceforge.net
+
+please follow the link in
+
+ http://sourceforge.net/projects/doxygen
+
+to subscribe to the lists or to visit the archives.
+
+Enjoy,
+
+Dimitri van Heesch (dimitri@stack.nl) (22 May 2009)
diff --git a/trunk/addon/doxmlparser/Doxyfile b/trunk/addon/doxmlparser/Doxyfile
new file mode 100644
index 0000000..faf4bee
--- /dev/null
+++ b/trunk/addon/doxmlparser/Doxyfile
@@ -0,0 +1,177 @@
+# Doxyfile 1.2.12-20011209
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = doxmlparser
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY = doc
+OUTPUT_LANGUAGE = English
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+STRIP_CODE_COMMENTS = YES
+CASE_SENSE_NAMES = YES
+SHORT_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+VERBATIM_HEADERS = YES
+SHOW_INCLUDE_FILES = YES
+JAVADOC_AUTOBRIEF = NO
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+ALIASES =
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = NO
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_FORMAT =
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = include
+FILE_PATTERNS = *.h
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT =
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT =
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT =
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT =
+MAN_EXTENSION =
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+PERL_PATH =
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+TEMPLATE_RELATIONS = YES
+HIDE_UNDOC_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1280
+MAX_DOT_GRAPH_HEIGHT = 1024
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
+CGI_NAME =
+CGI_URL =
+DOC_URL =
+DOC_ABSPATH =
+BIN_ABSPATH =
+EXT_DOC_PATHS =
diff --git a/trunk/addon/doxmlparser/Doxyfile.impl b/trunk/addon/doxmlparser/Doxyfile.impl
new file mode 100644
index 0000000..a954db3
--- /dev/null
+++ b/trunk/addon/doxmlparser/Doxyfile.impl
@@ -0,0 +1,179 @@
+# Doxyfile 1.2.13.1
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = doxmlparser
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY = doc_impl
+OUTPUT_LANGUAGE = English
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+STRIP_CODE_COMMENTS = YES
+CASE_SENSE_NAMES = YES
+SHORT_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+VERBATIM_HEADERS = YES
+SHOW_INCLUDE_FILES = YES
+JAVADOC_AUTOBRIEF = NO
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+ALIASES =
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = NO
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_FORMAT =
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = src
+FILE_PATTERNS =
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT =
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT =
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT =
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT =
+MAN_EXTENSION =
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED = DEFINE_CLS_IMPL
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH =
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+TEMPLATE_RELATIONS = YES
+HIDE_UNDOC_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1280
+MAX_DOT_GRAPH_HEIGHT = 1024
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
+CGI_NAME =
+CGI_URL =
+DOC_URL =
+DOC_ABSPATH =
+BIN_ABSPATH =
+EXT_DOC_PATHS =
diff --git a/trunk/addon/doxmlparser/examples/metrics/Makefile.in b/trunk/addon/doxmlparser/examples/metrics/Makefile.in
new file mode 100644
index 0000000..83cbc28
--- /dev/null
+++ b/trunk/addon/doxmlparser/examples/metrics/Makefile.in
@@ -0,0 +1,13 @@
+all clean depend: Makefile.metrics
+ $(MAKE) -f Makefile.metrics $@
+
+distclean: clean
+ $(RM) -rf Makefile.metrics metrics.pro Makefile obj
+
+tmake:
+ $(ENV) $(PERL) $(TMAKE) metrics.pro >Makefile.metrics
+
+Makefile.metrics: metrics.pro
+ $(ENV) $(PERL) $(TMAKE) metrics.pro >Makefile.metrics
+
+install:
diff --git a/trunk/addon/doxmlparser/examples/metrics/main.cpp b/trunk/addon/doxmlparser/examples/metrics/main.cpp
new file mode 100644
index 0000000..1328abe
--- /dev/null
+++ b/trunk/addon/doxmlparser/examples/metrics/main.cpp
@@ -0,0 +1,254 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+/*! \mainpage Metrics
+ * This is a small example that shows how to use doxygen's XML output and
+ * the doxmlparser library. The example shows some very basic code metrics.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <doxmlintf.h>
+
+bool isDocumented(IDocRoot *brief,IDocRoot *detailed)
+{
+ bool found=false;
+ if (brief)
+ {
+ IDocIterator *docIt = brief->contents();
+ if (docIt->current()) // method has brief description
+ {
+ found=true;
+ }
+ docIt->release();
+ }
+ if (detailed && !found)
+ {
+ IDocIterator *docIt = detailed->contents();
+ if (docIt->current())
+ {
+ found=true;
+ }
+ docIt->release();
+ }
+ return found;
+}
+
+int main(int argc,char **argv)
+{
+ if (argc!=2)
+ {
+ printf("Usage: %s xml_output_dir\n",argv[0]);
+ exit(1);
+ }
+
+ int numClasses=0;
+ int numDocClasses=0;
+ int numStructs=0;
+ int numUnions=0;
+ int numInterfaces=0;
+ int numExceptions=0;
+ int numNamespaces=0;
+ int numFiles=0;
+ int numGroups=0;
+ int numPages=0;
+ int numPackages=0;
+ int numPubMethods=0;
+ int numProMethods=0;
+ int numPriMethods=0;
+ int numDocPubMethods=0;
+ int numDocProMethods=0;
+ int numDocPriMethods=0;
+ int numFunctions=0;
+ int numAttributes=0;
+ int numVariables=0;
+ int numDocFunctions=0;
+ int numDocAttributes=0;
+ int numDocVariables=0;
+ int numParams=0;
+
+ IDoxygen *dox = createObjectModel();
+
+ dox->setDebugLevel(0);
+
+ if (!dox->readXMLDir(argv[1]))
+ {
+ printf("Error reading %s/index.xml\n",argv[1]);
+ exit(1);
+ }
+
+ ICompoundIterator *cli = dox->compounds();
+ ICompound *comp;
+ for (cli->toFirst();(comp=cli->current());cli->toNext())
+ {
+ printf("Processing %s...\n",comp->name()->latin1());
+ bool hasDocs = isDocumented(comp->briefDescription(),comp->detailedDescription());
+ switch (comp->kind())
+ {
+ case ICompound::Class:
+ numClasses++;
+ if (hasDocs) numDocClasses++;
+ break;
+ case ICompound::Struct: numStructs++; break;
+ case ICompound::Union: numUnions++; break;
+ case ICompound::Interface: numInterfaces++; break;
+ case ICompound::Exception: numExceptions++; break;
+ case ICompound::Namespace: numNamespaces++; break;
+ case ICompound::File: numFiles++; break;
+ case ICompound::Group: numGroups++; break;
+ case ICompound::Page: numPages++; break;
+ default: break;
+ }
+
+ ISectionIterator *sli = comp->sections();
+ ISection *sec;
+ for (sli->toFirst();(sec=sli->current());sli->toNext())
+ {
+ IMemberIterator *mli = sec->members();
+ IMember *mem;
+ for (mli->toFirst();(mem=mli->current());mli->toNext())
+ {
+ IParamIterator *pli = mem->parameters();
+ IParam *par;
+ if (comp->kind()==ICompound::Class ||
+ comp->kind()==ICompound::Struct ||
+ comp->kind()==ICompound::Interface
+ )
+ {
+ if (mem->kind()==IMember::Function ||
+ mem->kind()==IMember::Prototype ||
+ mem->kind()==IMember::Signal ||
+ mem->kind()==IMember::Slot ||
+ mem->kind()==IMember::DCOP
+ ) // is a "method"
+ {
+ if (mem->section()->isPublic())
+ {
+ numPubMethods++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocPubMethods++;
+ }
+ }
+ else if (mem->section()->isProtected())
+ {
+ numProMethods++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocProMethods++;
+ }
+ }
+ else if (mem->section()->isPrivate())
+ {
+ numPriMethods++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocPriMethods++;
+ }
+ }
+ }
+ else if (mem->kind()==IMember::Variable ||
+ mem->kind()==IMember::Property
+ ) // is an "attribute"
+ {
+ numAttributes++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocAttributes++;
+ }
+ }
+ }
+ else if (comp->kind()==ICompound::File ||
+ comp->kind()==ICompound::Namespace
+ )
+ {
+ if (mem->kind()==IMember::Function ||
+ mem->kind()==IMember::Prototype ||
+ mem->kind()==IMember::Signal ||
+ mem->kind()==IMember::Slot ||
+ mem->kind()==IMember::DCOP
+ ) // is a "method"
+ {
+ numFunctions++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocFunctions++;
+ }
+ }
+ else if (mem->kind()==IMember::Variable ||
+ mem->kind()==IMember::Property
+ ) // is an "attribute"
+ {
+ numVariables++;
+ if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
+ {
+ numDocVariables++;
+ }
+ }
+ }
+
+ for (pli->toFirst();(par=pli->current());pli->toNext())
+ {
+ numParams++;
+ }
+ const char *type = mem->typeString()->latin1();
+ if (type && strcmp(type, "void"))
+ {
+ numParams++; // count non-void return types as well
+ }
+ pli->release();
+ }
+ mli->release();
+ }
+ sli->release();
+
+ comp->release();
+ }
+ cli->release();
+
+ dox->release();
+
+ int numMethods = numPubMethods+numProMethods+numPriMethods;
+ int numDocMethods = numDocPubMethods+numDocProMethods+numDocPriMethods;
+
+ printf("Metrics:\n");
+ printf("-----------------------------------\n");
+ if (numClasses>0) printf("Classes: %10d (%d documented)\n",numClasses,numDocClasses);
+ if (numStructs>0) printf("Structs: %10d\n",numStructs);
+ if (numUnions>0) printf("Unions: %10d\n",numUnions);
+ if (numInterfaces>0) printf("Interfaces: %10d\n",numInterfaces);
+ if (numExceptions>0) printf("Exceptions: %10d\n",numExceptions);
+ if (numNamespaces>0) printf("Namespaces: %10d\n",numNamespaces);
+ if (numFiles>0) printf("Files: %10d\n",numFiles);
+ if (numGroups>0) printf("Groups: %10d\n",numGroups);
+ if (numPages>0) printf("Pages: %10d\n",numPages);
+ if (numPackages>0) printf("Packages: %10d\n",numPackages);
+ if (numMethods>0) printf("Methods: %10d (%d documented)\n",numMethods,numDocMethods);
+ if (numPubMethods>0) printf(" Public: %10d (%d documented)\n",numPubMethods,numDocPubMethods);
+ if (numProMethods>0) printf(" Protected: %10d (%d documented)\n",numProMethods,numDocProMethods);
+ if (numPriMethods>0) printf(" Private: %10d (%d documented)\n",numPriMethods,numDocPriMethods);
+ if (numFunctions>0) printf("Functions: %10d (%d documented)\n",numFunctions,numDocFunctions);
+ if (numAttributes>0) printf("Attributes: %10d (%d documented)\n",numAttributes,numDocAttributes);
+ if (numVariables>0) printf("Variables: %10d (%d documented)\n",numVariables,numDocVariables);
+ if (numParams>0) printf("Params: %10d\n",numParams);
+ printf("-----------------------------------\n");
+ if (numClasses>0) printf("Avg. #methods/compound: %10f\n",(double)numMethods/(double)numClasses);
+ if (numMethods>0) printf("Avg. #params/method: %10f\n",(double)numParams/(double)numMethods);
+ printf("-----------------------------------\n");
+
+ return 0;
+}
+
diff --git a/trunk/addon/doxmlparser/examples/metrics/metrics.pro.in b/trunk/addon/doxmlparser/examples/metrics/metrics.pro.in
new file mode 100644
index 0000000..6dd344f
--- /dev/null
+++ b/trunk/addon/doxmlparser/examples/metrics/metrics.pro.in
@@ -0,0 +1,20 @@
+TEMPLATE = app.t
+CONFIG = console warn_on $extraopts
+HEADERS =
+SOURCES = main.cpp
+unix:LIBS += -L../../../../lib -L../../lib -ldoxmlparser -lqtools
+win32:INCLUDEPATH += .
+win32-mingw:LIBS += -L../../../../lib -L../../lib -ldoxmlparser -lqtools
+win32-msvc:LIBS += doxmlparser.lib qtools.lib shell32.lib
+win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\..\..\..\lib;..\..\lib
+win32-borland:LIBS += doxmlparser.lib qtools.lib shell32.lib
+win32-borland:TMAKE_LFLAGS += -L..\..\..\..\lib -L..\..\lib
+win32:TMAKE_CXXFLAGS += -DQT_NODLL
+DESTDIR =
+OBJECTS_DIR = obj
+TARGET = metrics
+DEPENDPATH = ../../include
+INCLUDEPATH += ../../../../qtools ../../include
+unix:TARGETDEPS = ../../lib/libdoxmlparser.a
+win32:TARGETDEPS = ..\..\lib\doxmlparser.lib
+
diff --git a/trunk/addon/doxmlparser/include/doxmlintf.h b/trunk/addon/doxmlparser/include/doxmlintf.h
new file mode 100644
index 0000000..88cb2e3
--- /dev/null
+++ b/trunk/addon/doxmlparser/include/doxmlintf.h
@@ -0,0 +1,1134 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _DOXMLINTF_H
+#define _DOXMLINTF_H
+
+/*! \file
+ * \brief The interface to the object model provided by the XML parser
+ * library.
+ *
+ * To start using this library one calls createObjectModel() and then
+ * uses the returned IDoxygen interface to read doxygen generated
+ * XML output and navigate through the information contained in it.
+ *
+ * @see createObjectModel()
+ */
+
+class IMember;
+class IDocIterator;
+class ICompound;
+class ISection;
+class INode;
+class IDocInternal;
+class IDocRoot;
+
+#define VIRTUAL_DESTRUCTOR(x) virtual ~x() {}
+
+/*! \brief Read only interface to a string.
+ */
+class IString
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IString)
+ /*! Returns a latin1 character representation of the string. */
+ virtual const char *latin1() const = 0;
+ /*! Returns a utf8 character representation of the string. */
+ virtual const char *utf8() const = 0;
+ /*! Returns a 16-bit unicode character representation of the character at
+ * position \a index in the string. The first character is at index 0.
+ */
+ virtual unsigned short unicodeCharAt(int index) const = 0;
+ /*! Returns true if this string is empty or false otherwise */
+ virtual bool isEmpty() const = 0;
+ /*! Returns the number of characters in the string. */
+ virtual int length() const = 0;
+};
+
+/*! \brief Base interface for hyperlinked text
+ *
+ * Depending on the result of kind() the interface is extended by
+ * ILT_Text or ILT_Ref.
+ */
+class ILinkedText
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ILinkedText)
+ enum Kind { Kind_Text, Kind_Ref };
+ virtual Kind kind() const = 0;
+};
+
+/*! \brief Plain text fragment.
+ */
+class ILT_Text : public ILinkedText
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ILT_Text)
+ virtual const IString *text() const = 0;
+};
+
+/*! \brief Reference to an object.
+ */
+class ILT_Ref : public ILinkedText
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ILT_Ref)
+ enum TargetKind { Member, Compound };
+ virtual const IString *id() const = 0;
+ virtual TargetKind targetKind() const = 0;
+ virtual const IString *external() const = 0;
+ virtual const IString *text() const = 0;
+};
+
+/*! \brief Iterates over a list of ILinkedText fragments.
+ */
+class ILinkedTextIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ILinkedTextIterator)
+ virtual ILinkedText *toFirst() = 0;
+ virtual ILinkedText *toLast() = 0;
+ virtual ILinkedText *toNext() = 0;
+ virtual ILinkedText *toPrev() = 0;
+ virtual ILinkedText *current() const = 0;
+ virtual void release() = 0;
+};
+
+/*! \brief Representation of a parameter of a function. */
+class IParam
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IParam)
+ virtual ILinkedTextIterator *type() const = 0;
+ virtual const IString * declarationName() const = 0;
+ virtual const IString * definitionName() const = 0;
+ virtual const IString * attrib() const = 0;
+ virtual const IString * arraySpecifier() const = 0;
+ virtual ILinkedTextIterator *defaultValue() const = 0;
+ virtual IDocRoot *briefDescription() const = 0;
+};
+
+class IParamIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IParamIterator)
+ virtual IParam *toFirst() = 0;
+ virtual IParam *toLast() = 0;
+ virtual IParam *toNext() = 0;
+ virtual IParam *toPrev() = 0;
+ virtual IParam *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IMemberReference
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IMemberReference)
+ virtual IMember *member() const = 0;
+ virtual const IString * name() const = 0;
+ virtual const IString * scope() const = 0;
+ virtual const IString * protection() const = 0;
+ virtual const IString * virtualness() const = 0;
+ virtual const IString * ambiguityScope() const = 0;
+};
+
+class IMemberReferenceIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IMemberReferenceIterator)
+ virtual IMemberReference *toFirst() = 0;
+ virtual IMemberReference *toLast() = 0;
+ virtual IMemberReference *toNext() = 0;
+ virtual IMemberReference *toPrev() = 0;
+ virtual IMemberReference *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IDoc
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IDoc)
+ enum Kind
+ {
+ Invalid = 0, // 0
+ Para, // 1 -> IDocPara
+ Text, // 2 -> IDocText
+ MarkupModifier, // 3 -> IDocMarkupModifier
+ ItemizedList, // 4 -> IDocItemizedList
+ OrderedList, // 5 -> IDocOrderedList
+ ListItem, // 6 -> IDocListItem
+ ParameterList, // 7 -> IDocParameterList
+ Parameter, // 8 -> IDocParameter
+ SimpleSect, // 9 -> IDocSimpleSect
+ Title, // 10 -> IDocTitle
+ Ref, // 11 -> IDocRef
+ VariableList, // 12 -> IDocVariableList
+ VariableListEntry, // 13 -> IDocVariableListEntry
+ HRuler, // 14 -> IDocHRuler
+ LineBreak, // 15 -> IDocLineBreak
+ ULink, // 16 -> IDocULink
+ EMail, // 17 -> IDocEMail
+ Link, // 18 -> IDocLink
+ ProgramListing, // 19 -> IDocProgramListing
+ CodeLine, // 20 -> IDocCodeLine
+ Highlight, // 21 -> IDocHighlight
+ Formula, // 22 -> IDocFormula
+ Image, // 23 -> IDocImage
+ DotFile, // 24 -> IDocDotFile
+ IndexEntry, // 25 -> IDocIndexEntry
+ Table, // 26 -> IDocTable
+ Row, // 27 -> IDocRow
+ Entry, // 28 -> IDocEntry
+ Section, // 29 -> IDocSection
+ Verbatim, // 30 -> IDocVerbatim
+ Copy, // 31 -> IDocCopy
+ TocList, // 32 -> IDocTocList
+ TocItem, // 33 -> IDocTocItem
+ Anchor, // 34 -> IDocAnchor
+ Symbol, // 35 -> IDocSymbol
+ Internal, // 36 -> IDocInternal
+ Root, // 37 -> IDocRoot
+ ParameterItem // 38 -> IDocParameterItem
+ };
+ virtual Kind kind() const = 0;
+};
+
+class IDocMarkup : public IDoc
+{
+ public:
+ enum Markup
+ {
+ Normal = 0x000,
+ Bold = 0x001,
+ Emphasis = 0x002,
+ ComputerOutput = 0x004,
+ Subscript = 0x008,
+ Superscript = 0x010,
+ SmallFont = 0x020,
+ Center = 0x040,
+ Preformatted = 0x080,
+ Heading = 0x100
+ };
+};
+
+class IDocPara : public IDoc
+{
+ public:
+ virtual IDocIterator *contents() const = 0;
+};
+
+class IDocText : public IDocMarkup
+{
+ public:
+ virtual const IString * text() const = 0;
+ virtual int markup() const = 0;
+ virtual int headingLevel() const = 0;
+};
+
+class IDocMarkupModifier : public IDoc
+{
+ public:
+ virtual bool enabled() const = 0;
+ virtual int markup() const = 0;
+ virtual int headingLevel() const = 0;
+};
+
+class IDocItemizedList : public IDoc
+{
+ public:
+ virtual IDocIterator *elements() const = 0;
+};
+
+class IDocOrderedList : public IDoc
+{
+ public:
+ virtual IDocIterator *elements() const = 0;
+};
+
+class IDocListItem : public IDoc
+{
+ public:
+ virtual IDocIterator *contents() const = 0;
+};
+
+class IDocParameterList : public IDoc
+{
+ public:
+ enum Types { Param, RetVal, Exception };
+ virtual Types sectType() const = 0;
+ virtual IDocIterator *params() const = 0;
+};
+
+class IDocParameterItem : public IDoc
+{
+ public:
+ virtual IDocIterator *paramNames() const = 0;
+ virtual IDocPara *description() const = 0;
+};
+
+class IDocParameter : public IDoc
+{
+ public:
+ virtual const IString * name() const = 0;
+};
+
+class IDocTitle : public IDoc
+{
+ public:
+ virtual IDocIterator *title() const = 0;
+};
+
+class IDocSimpleSect : public IDoc
+{
+ public:
+ enum Types { Invalid = 0,
+ See, Return, Author, Version,
+ Since, Date, Bug, Note,
+ Warning, Par, Deprecated, Pre,
+ Post, Invar, Remark, Attention,
+ Todo, Test, RCS, EnumValues,
+ Examples
+ };
+ virtual Types type() const = 0;
+ virtual const IString * typeString() const = 0;
+ virtual IDocTitle *title() const = 0;
+ virtual IDocPara *description() const = 0;
+};
+
+class IDocRef : public IDoc
+{
+ public:
+ enum TargetKind { Member, Compound };
+ virtual const IString * refId() const = 0;
+ virtual TargetKind targetKind() const = 0;
+ virtual const IString * external() const = 0;
+ virtual const IString * text() const = 0;
+};
+
+class IDocVariableList : public IDoc
+{
+ public:
+ virtual IDocIterator *entries() const = 0;
+};
+
+class IDocVariableListEntry : public IDoc
+{
+ public:
+ virtual ILinkedTextIterator * term() const = 0;
+ virtual IDocPara *description() const = 0;
+};
+
+class IDocHRuler : public IDoc
+{
+};
+
+class IDocLineBreak : public IDoc
+{
+};
+
+class IDocULink : public IDoc
+{
+ public:
+ virtual const IString * url() const = 0;
+ virtual const IString * text() const = 0;
+};
+
+class IDocEMail : public IDoc
+{
+ public:
+ virtual const IString * address() const = 0;
+};
+
+class IDocLink : public IDoc
+{
+ public:
+ virtual const IString * refId() const = 0;
+ virtual const IString * text() const = 0;
+};
+
+class IDocProgramListing : public IDoc
+{
+ public:
+ virtual IDocIterator *codeLines() const = 0;
+};
+
+class IDocCodeLine : public IDoc
+{
+ public:
+ virtual int lineNumber() const = 0;
+ virtual const IString * refId() const = 0;
+ virtual IDocIterator *codeElements() const = 0;
+};
+
+class IDocHighlight : public IDoc
+{
+ public:
+ enum HighlightKind
+ { Invalid=0,
+ Comment, Keyword,
+ KeywordType, KeywordFlow, CharLiteral,
+ StringLiteral, Preprocessor
+ };
+ virtual HighlightKind highlightKind() const = 0;
+ virtual IDocIterator *codeElements() const = 0;
+};
+
+class IDocFormula : public IDoc
+{
+ public:
+ virtual const IString * id() const = 0;
+ virtual const IString * text() const = 0;
+};
+
+class IDocImage : public IDoc
+{
+ public:
+ virtual const IString * name() const = 0;
+ virtual const IString * caption() const = 0;
+};
+
+class IDocDotFile : public IDoc
+{
+ public:
+ virtual const IString * name() const = 0;
+ virtual const IString * caption() const = 0;
+};
+
+class IDocIndexEntry : public IDoc
+{
+ public:
+ virtual const IString * primary() const = 0;
+ virtual const IString * secondary() const = 0;
+};
+
+class IDocTable : public IDoc
+{
+ public:
+ virtual IDocIterator *rows() const = 0;
+ virtual int numColumns() const = 0;
+ virtual const IString * caption() const = 0;
+};
+
+class IDocRow : public IDoc
+{
+ public:
+ virtual IDocIterator *entries() const = 0;
+};
+
+class IDocEntry : public IDoc
+{
+ public:
+ virtual IDocIterator *contents() const = 0;
+};
+
+class IDocSection : public IDoc
+{
+ public:
+ virtual const IString * id() const = 0;
+ virtual int level() const = 0;
+ virtual IDocTitle *title() const = 0;
+ virtual IDocIterator *paragraphs() const = 0;
+ virtual IDocIterator *subSections() const = 0;
+ virtual IDocInternal *internal() const = 0;
+};
+
+class IDocInternal : public IDoc
+{
+ public:
+ virtual IDocIterator *paragraphs() const = 0;
+ virtual IDocIterator *subSections() const = 0;
+};
+
+class IDocTocList : public IDoc
+{
+ public:
+ virtual IDocIterator *elements() const = 0;
+};
+
+class IDocTocItem : public IDoc
+{
+ public:
+ virtual const IString *id() const = 0;
+ virtual const IString *title() const = 0;
+};
+
+class IDocCopy : public IDoc
+{
+ public:
+ virtual IDocIterator *contents() const = 0;
+};
+
+class IDocVerbatim : public IDoc
+{
+ public:
+ enum Types { Invalid = 0, HtmlOnly, LatexOnly, Verbatim };
+ virtual const IString *text() const = 0;
+ virtual Types type() const = 0;
+};
+
+class IDocAnchor : public IDoc
+{
+ public:
+ virtual const IString *id() const = 0;
+};
+
+class IDocSymbol : public IDoc
+{
+ public:
+ enum Types
+ { Invalid = 0,
+ Umlaut, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Copy
+ };
+ virtual Types type() const = 0;
+ virtual const IString * typeString() const = 0;
+ virtual char letter() const = 0;
+};
+
+class IDocRoot : public IDoc
+{
+ public:
+ virtual IDocIterator *contents() const = 0;
+ virtual IDocInternal *internal() const = 0;
+};
+
+class IDocIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IDocIterator)
+ virtual IDoc *toFirst() = 0;
+ virtual IDoc *toLast() = 0;
+ virtual IDoc *toNext() = 0;
+ virtual IDoc *toPrev() = 0;
+ virtual IDoc *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IEdgeLabel
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IEdgeLabel)
+ virtual const IString * label() const = 0;
+};
+
+class IEdgeLabelIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IEdgeLabelIterator)
+ virtual IEdgeLabel *toFirst() = 0;
+ virtual IEdgeLabel *toLast() = 0;
+ virtual IEdgeLabel *toNext() = 0;
+ virtual IEdgeLabel *toPrev() = 0;
+ virtual IEdgeLabel *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IChildNode
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IChildNode)
+ enum NodeRelation { PublicInheritance, ProtectedInheritance,
+ PrivateInheritance, Usage, TemplateInstance
+ };
+ virtual INode * node() const = 0;
+ virtual NodeRelation relation() const = 0;
+ virtual const IString * relationString() const = 0;
+ virtual IEdgeLabelIterator *edgeLabels() const = 0;
+};
+
+class IChildNodeIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IChildNodeIterator)
+ virtual IChildNode *toFirst() = 0;
+ virtual IChildNode *toLast() = 0;
+ virtual IChildNode *toNext() = 0;
+ virtual IChildNode *toPrev() = 0;
+ virtual IChildNode *current() const = 0;
+ virtual void release() = 0;
+};
+
+class INode
+{
+ public:
+ VIRTUAL_DESTRUCTOR(INode)
+ virtual const IString * id() const = 0;
+ virtual const IString * label() const = 0;
+ virtual const IString * linkId() const = 0;
+ virtual IChildNodeIterator *children() const = 0;
+};
+
+class INodeIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(INodeIterator)
+ virtual INode *toFirst() = 0;
+ virtual INode *toLast() = 0;
+ virtual INode *toNext() = 0;
+ virtual INode *toPrev() = 0;
+ virtual INode *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IGraph
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IGraph)
+ virtual INodeIterator *nodes() const = 0;
+};
+
+class IMember
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IMember)
+ enum MemberKind { Invalid=0,
+ Define, Property, Variable, Typedef, Enum,
+ Function, Signal, Prototype, Friend, DCOP, Slot,
+ EnumValue
+ };
+ virtual ICompound *compound() const = 0;
+ virtual ISection *section() const = 0;
+ virtual MemberKind kind() const = 0;
+ virtual const IString * kindString() const = 0;
+ virtual const IString * id() const = 0;
+ virtual const IString * protection() const = 0;
+ virtual const IString * virtualness() const = 0;
+ virtual ILinkedTextIterator *type() const = 0;
+ virtual const IString * typeString() const = 0;
+ virtual const IString * name() const = 0;
+ virtual const IString * readAccessor() const = 0;
+ virtual const IString * writeAccessor() const = 0;
+ virtual const IString * definition() const = 0;
+ virtual const IString * argsstring() const = 0;
+ virtual bool isConst() const = 0;
+ virtual bool isVolatile() const = 0;
+ virtual bool isStatic() const = 0;
+ virtual bool isExplicit() const = 0;
+ virtual bool isInline() const = 0;
+ virtual bool isMutable() const = 0;
+ virtual bool isReadable() const = 0;
+ virtual bool isWritable() const = 0;
+ virtual IParamIterator *parameters() const = 0;
+ virtual IParamIterator *templateParameters() const = 0;
+ virtual ILinkedTextIterator *initializer() const = 0;
+ virtual ILinkedTextIterator *exceptions() const = 0;
+ virtual IMemberReferenceIterator *references() const = 0;
+ virtual IMemberReferenceIterator *referencedBy() const = 0;
+ virtual const IString *bodyFile() const = 0;
+ virtual int bodyStart() const = 0;
+ virtual int bodyEnd() const = 0;
+ virtual const IString * definitionFile() const = 0;
+ virtual int definitionLine() const = 0;
+ virtual IMemberReference *reimplements() const = 0;
+ virtual IMemberReferenceIterator *reimplementedBy() const = 0;
+ virtual IDocRoot *briefDescription() const = 0;
+ virtual IDocRoot *detailedDescription() const = 0;
+ virtual IDocRoot *inbodyDescription() const = 0;
+};
+
+class IDefine : public IMember
+{
+ public:
+};
+
+class IProperty : public IMember
+{
+ public:
+};
+
+class IVariable : public IMember
+{
+ public:
+};
+
+class ITypedef : public IMember
+{
+ public:
+};
+
+class IFunction : public IMember
+{
+ public:
+};
+
+class ISignal : public IMember
+{
+ public:
+};
+
+class IPrototype : public IMember
+{
+ public:
+};
+
+class IFriend : public IMember
+{
+ public:
+};
+
+class IDCOP : public IMember
+{
+ public:
+};
+
+class ISlot : public IMember
+{
+ public:
+};
+
+class IEnumValue : public IMember
+{
+ public:
+ virtual const IString * name() const = 0;
+};
+
+/*! \brief Include relation
+ */
+class IInclude
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IInclude)
+ virtual const IString * name() const = 0;
+ virtual const IString * refId() const = 0;
+ virtual bool isLocal() const = 0;
+};
+
+class IIncludeIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IIncludeIterator)
+ virtual IInclude *toFirst() = 0;
+ virtual IInclude *toLast() = 0;
+ virtual IInclude *toNext() = 0;
+ virtual IInclude *toPrev() = 0;
+ virtual IInclude *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IMemberIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IMemberIterator)
+ virtual IMember *toFirst() = 0;
+ virtual IMember *toLast() = 0;
+ virtual IMember *toNext() = 0;
+ virtual IMember *toPrev() = 0;
+ virtual IMember *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IEnum : public IMember
+{
+ public:
+ virtual IMemberIterator *enumValues() const = 0;
+};
+
+/*! \brief The interface to a section in the object model.
+ *
+ * A compound can have a number of sections, where each
+ * section contains a set of members with the properties implied by
+ * the section kind. The kind() method returns the kind of the section.
+ * The members of the section can be accessed via members(). Apart
+ * from using kind(), some of the individual properties of the section can
+ * also be inspected via isStatic(), isPublic(), isProtected() and
+ * isPrivate().
+ */
+class ISection
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ISection)
+ /*! Possible section types */
+ enum SectionKind
+ { Invalid=0,
+ UserDefined, //!< A user defined member group
+ PubTypes, //!< Public member typedefs
+ PubFuncs, //!< Public member functions
+ PubAttribs, //!< Public member attributes
+ PubSlots, //!< Public Qt Slots
+ Signals, //!< Qt Signals
+ DCOPFuncs, //!< KDE-DCOP interface functions
+ Properties, //!< IDL properties
+ Events, //!< C# events
+ PubStatFuncs, //!< Public static member functions
+ PubStatAttribs, //!< Public static attributes
+ ProTypes, //!< Protected member typedefs
+ ProFuncs, //!< Protected member functions
+ ProAttribs, //!< Protected member attributes
+ ProSlots, //!< Protected slots
+ ProStatFuncs, //!< Protected static member functions
+ ProStatAttribs, //!< Protected static member attributes
+ PacTypes, //!< Package member typedefs
+ PacFuncs, //!< Package member functions
+ PacAttribs, //!< Package member attributes
+ PacStatFuncs, //!< Package static member functions
+ PacStatAttribs, //!< Package static member attributes
+ PriTypes, //!< Private member typedefs
+ PriFuncs, //!< Private member functions
+ PriAttribs, //!< Private member attributes
+ PriSlots, //!< Private Qt slots
+ PriStatFuncs, //!< Private static member functions
+ PriStatAttribs, //!< Private static member attributes
+ Friend, //!< Friends
+ Related, //!< Function marked as related
+ Defines, //!< Preprocessor defines
+ Prototypes, //!< Global function prototypes
+ Typedefs, //!< Global typedefs
+ Enums, //!< Enumerations
+ Functions, //!< Global functions
+ Variables //!< Global variables
+ };
+
+ /*! Returns a string representation of the value returned by kind() */
+ virtual const IString * kindString() const = 0;
+
+ /*! Returns what kind of section this is */
+ virtual SectionKind kind() const = 0;
+
+ /*! Returns the description attached to this section (for user defined
+ * sections, also known as member groups).
+ */
+ virtual IDocRoot *description() const = 0;
+
+ /*! Returns an iterator for the members of this section */
+ virtual IMemberIterator *members() const = 0;
+
+ /*! Returns \c true if this section contains statics */
+ virtual bool isStatic() const = 0;
+
+ /*! Returns \c true if this section belongs to a
+ * public section of a class
+ */
+ virtual bool isPublic() const = 0;
+
+ /*! Returns \c true if this section belongs to a
+ * private section of a class
+ */
+ virtual bool isPrivate() const = 0;
+
+ /*! Returns \c true if this section belongs to a
+ * protected section of a class
+ * */
+ virtual bool isProtected() const = 0;
+};
+
+class IUserDefined : public ISection
+{
+ public:
+ virtual const IString * header() const = 0;
+};
+
+class ISectionIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ISectionIterator)
+ virtual ISection *toFirst() = 0;
+ virtual ISection *toLast() = 0;
+ virtual ISection *toNext() = 0;
+ virtual ISection *toPrev() = 0;
+ virtual ISection *current() const = 0;
+ virtual void release() = 0;
+};
+
+/*! \brief The interface to a compound in the object model.
+ *
+ * A compound has a name which can be obtained via the name() method
+ * and a unique id, which is return via the id() method.
+ * A compound consists zero or more members which are grouped into sections.
+ * The sections() method can be used to access the individual sections.
+ * Alternatively, members can be obtained by name or id. There are
+ * different types of compounds. The kind() method returns what kind of
+ * compound this is. Depending on the return value one can dynamically
+ * cast an interface pointer to an more specialised interface that provides
+ * additional methods.
+ * Example:
+ * \code
+ * ICompound *comp=...;
+ * if (comp->kind()==ICompound::Class)
+ * {
+ * IClass *cls = dynamic_cast<IClass*>(comp);
+ * // use methods of IClass
+ * }
+ * \endcode
+ * The documentation that is provided by a compound is available via
+ * the briefDescription() and detailedDescription() methods.
+ * To avoid excessive memory usage, release() should be called (once) on each
+ * compound interface pointer that is no longer needed.
+ */
+class ICompound
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ICompound)
+ /*! Represents the kind of compounds recognised by doxygen. */
+ enum CompoundKind { Invalid=0,
+ Class, Struct, Union, Interface, Protocol, Category,
+ Exception, File, Namespace, Group, Page, Example, Dir
+ };
+
+ /*! Returns the name of this compound */
+ virtual const IString * name() const = 0;
+
+ /*! Returns the id of this compound. The id is a
+ * unique string representing a specific compound object.
+ */
+ virtual const IString * id() const = 0;
+
+ /*! Returns the kind of compound. See #CompoundKind for possible
+ * values.
+ */
+ virtual CompoundKind kind() const = 0;
+
+ /*! Returns a string representation of the compound kind.
+ * @see kind()
+ */
+ virtual const IString * kindString() const = 0;
+
+ /*! Returns an iterator for the different member sections in this
+ * compound.
+ */
+ virtual ISectionIterator *sections() const = 0;
+
+ /*! Returns a tree-structured representation of the brief
+ * description that is attached to this compound.
+ */
+ virtual IDocRoot *briefDescription() const = 0;
+
+ /*! Returns a tree-structured representation of the detailed
+ * description that is attached to this compound.
+ */
+ virtual IDocRoot *detailedDescription() const = 0;
+
+ /*! Returns an interface to a member given its id.
+ * @param id The member id.
+ */
+ virtual IMember *memberById(const char * id) const = 0;
+
+ /*! Returns a list of all members within the compound having a certain
+ * name. Member overloading is the reason why there can be more than
+ * one member.
+ * @param name The name of the member.
+ */
+ virtual IMemberIterator *memberByName(const char * name) const = 0;
+
+ /*! Decreases the reference counter for this compound. If it reaches
+ * zero, the memory for the compound will be released.
+ */
+ virtual void release() = 0;
+};
+
+class ICompoundIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(ICompoundIterator)
+ virtual void toFirst() = 0;
+ virtual void toLast() = 0;
+ virtual void toNext() = 0;
+ virtual void toPrev() = 0;
+ virtual ICompound *current() const = 0;
+ virtual void release() = 0;
+};
+
+class IRelatedCompound
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IRelatedCompound)
+ enum Protection { Public, Protected, Private };
+ enum Kind { Normal, Virtual };
+ virtual ICompound *compound() const = 0;
+ virtual Protection protection() const = 0;
+ virtual Kind kind() const = 0;
+ virtual const IString *name() const = 0;
+
+};
+
+class IRelatedCompoundIterator
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IRelatedCompoundIterator)
+ virtual IRelatedCompound *toFirst() = 0;
+ virtual IRelatedCompound *toLast() = 0;
+ virtual IRelatedCompound *toNext() = 0;
+ virtual IRelatedCompound *toPrev() = 0;
+ virtual IRelatedCompound *current() const = 0;
+ virtual void release() = 0;
+};
+
+/*! \brief The interface to a class in the object model.
+ */
+class IClass : public ICompound
+{
+ public:
+ virtual IGraph *inheritanceGraph() const = 0;
+ virtual IGraph *collaborationGraph() const = 0;
+ virtual IRelatedCompoundIterator *baseCompounds() const = 0;
+ virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+ virtual IParamIterator *templateParameters() const = 0;
+ virtual const IString *locationFile() const = 0;
+ virtual int locationLine() const = 0;
+ virtual const IString *locationBodyFile() const = 0;
+ virtual int locationBodyStartLine() const = 0;
+ virtual int locationBodyEndLine() const = 0;
+
+ // TODO:
+ // class:
+ // listOfAllMembers()
+ // protection()
+ // isAbstract()
+};
+
+/*! \brief The interface to a struct in the object model.
+ */
+class IStruct : public ICompound
+{
+ public:
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+ virtual IRelatedCompoundIterator *baseCompounds() const = 0;
+ virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
+ virtual const IString *locationFile() const = 0;
+ virtual int locationLine() const = 0;
+ virtual int locationBodyStartLine() const = 0;
+ virtual int locationBodyEndLine() const = 0;
+};
+
+/*! \brief The interface to a union in the object model.
+ */
+class IUnion : public ICompound
+{
+ public:
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+};
+
+/*! \brief The interface to a Java/IDL interface in the object model.
+ */
+class IInterface : public ICompound
+{
+ public:
+ virtual IRelatedCompoundIterator *baseCompounds() const = 0;
+ virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
+};
+
+
+/*! \brief The interface to a Java/IDL exception in the object model.
+ */
+class IException : public ICompound
+{
+};
+
+/*! \brief The interface to a namespace in the object model.
+ */
+class INamespace : public ICompound
+{
+ public:
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+};
+
+/*! \brief The interface to a file in the object model.
+ */
+class IFile : public ICompound
+{
+ public:
+ virtual IGraph *includeDependencyGraph() const = 0;
+ virtual IGraph *includedByDependencyGraph() const = 0;
+ virtual IDocProgramListing *source() const = 0;
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+
+ virtual IIncludeIterator *includes() const = 0;
+ virtual IIncludeIterator *includedBy() const = 0;
+
+ // ICompound *innerNamespaces()
+ // ICompoundIterator *innerClasses()
+};
+
+/*! \brief The interface to a group in the object model.
+ */
+class IGroup : public ICompound
+{
+ public:
+ virtual ICompoundIterator *nestedCompounds() const = 0;
+ // group:
+ // Title()
+ // innerFile()
+ // innerPage()
+};
+
+/*! \brief The interface to a page in the object model.
+ */
+class IPage : public ICompound
+{
+ public:
+ virtual const IDocTitle *title() const = 0;
+};
+
+/*! Root node of the object model. */
+class IDoxygen
+{
+ public:
+ VIRTUAL_DESTRUCTOR(IDoxygen)
+
+ /*! Returns an iterator that can be used to iterate over the list
+ * of compounds found in the project.
+ */
+ virtual ICompoundIterator *compounds() const = 0;
+
+ /*! Returns a compound given its unique \a id. If you have a
+ * compound id this function is much more efficient than iterating
+ * over the compound list. Returns 0 if the id is not valid.
+ */
+ virtual ICompound *compoundById(const char * id) const = 0;
+
+ /*! Returns a compound given its name (including the scope).
+ * Returns 0 if the name is not found in the project.
+ */
+ virtual ICompound *compoundByName(const char * name) const = 0;
+
+ /*! Returns an interface to a compound containing a member given it the
+ * member's id. Given the ICompound interface one can use the same id
+ * to obtain the IMember interface.
+ * @param id The member id.
+ */
+ virtual ICompound *memberById(const char * id) const = 0;
+
+ /*! Returns a list of all compounds containing at least one members
+ * with a certain name. Each compound can be asked to return the
+ * list of members with that name.
+ * @param name The name of the member.
+ */
+ virtual ICompoundIterator *memberByName(const char * name) const = 0;
+
+ /*! Releases the memory for the object hierarchy obtained by
+ * createdObjecModelFromXML(). First release all iterators before calling
+ * this function.
+ */
+ virtual void release() = 0;
+
+ /*! Sets the debug level.
+ * - 0 all debugging messages are disabled (the default).
+ * - 1 display important messages only
+ * - 2 display any messages.
+ */
+ virtual void setDebugLevel(int level) = 0;
+
+ /*! Reads an XML directory produced by doxygen and builds up a data
+ * structure representing the contents of the XML files in the directory.
+ */
+ virtual bool readXMLDir(const char *xmlDirName) = 0;
+};
+
+/*! Factory method that creates an empty object model for a doxygen generated XML file.
+ * Use the readXMLDir() method to build the model from an XML output
+ * directory containing doxygen output.
+ */
+IDoxygen *createObjectModel();
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/Makefile.in b/trunk/addon/doxmlparser/src/Makefile.in
new file mode 100644
index 0000000..049f969
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/Makefile.in
@@ -0,0 +1,13 @@
+all clean depend: Makefile.doxmlparser
+ $(MAKE) -f Makefile.doxmlparser $@
+
+distclean: clean
+ $(RM) -rf Makefile.doxmlparser doxmlparser.pro Makefile obj
+
+tmake:
+ $(ENV) $(PERL) $(TMAKE) doxmlparser.pro >Makefile.doxmlparser
+
+Makefile.doxmlparser: doxmlparser.pro
+ $(ENV) $(PERL) $(TMAKE) doxmlparser.pro >Makefile.doxmlparser
+
+install:
diff --git a/trunk/addon/doxmlparser/src/basehandler.cpp b/trunk/addon/doxmlparser/src/basehandler.cpp
new file mode 100644
index 0000000..02d98c2
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/basehandler.cpp
@@ -0,0 +1,3 @@
+#include "basehandler.h"
+
+QXmlLocator * LocatorContainer::s_theLocator=0;
diff --git a/trunk/addon/doxmlparser/src/basehandler.h b/trunk/addon/doxmlparser/src/basehandler.h
new file mode 100644
index 0000000..cc275a6
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/basehandler.h
@@ -0,0 +1,325 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _BASEHANDLER_H
+#define _BASEHANDLER_H
+
+#include <qxml.h>
+#include <qdict.h>
+#include <qstring.h>
+
+#include "debug.h"
+
+//-----------------------------------------------------------------------------
+
+class IBaseHandler
+{
+ public:
+ virtual void setDelegate(QXmlDefaultHandler *delegate) = 0;
+ virtual QXmlDefaultHandler *delegate() const = 0;
+ virtual ~IBaseHandler() {}
+};
+
+//-----------------------------------------------------------------------------
+
+class IFallBackHandler
+{
+ public:
+ virtual bool handleStartElement(const QString & name,
+ const QXmlAttributes & attrib) = 0;
+ virtual bool handleEndElement(const QString &name) = 0;
+ virtual ~IFallBackHandler() {}
+};
+
+//-----------------------------------------------------------------------------
+
+template<class T> class ElementMapper
+{
+ class StartElementHandler
+ {
+ typedef void (T::*Handler)(const QXmlAttributes &attrib);
+ public:
+ StartElementHandler() : m_parent(0) {}
+ StartElementHandler(T *parent, Handler h)
+ : m_parent(parent), m_handler(h) {}
+ void operator()(const QXmlAttributes &attrib)
+ { if (m_parent) (m_parent->*m_handler)(attrib); }
+ private:
+ T *m_parent;
+ Handler m_handler;
+ };
+
+ class EndElementHandler
+ {
+ typedef void (T::*Handler)();
+ public:
+ EndElementHandler() : m_parent(0) {}
+ EndElementHandler(T *parent, Handler h)
+ : m_parent(parent), m_handler(h) {}
+ void operator()()
+ { if (m_parent) (m_parent->*m_handler)(); }
+ private:
+ T *m_parent;
+ Handler m_handler;
+ };
+
+ public:
+ typedef StartElementHandler StartElementHandlerT;
+ typedef EndElementHandler EndElementHandlerT;
+
+ ElementMapper() : m_startHandlers(67), m_endHandlers(67)
+ {
+ m_startHandlers.setAutoDelete(TRUE);
+ m_endHandlers.setAutoDelete(TRUE);
+ }
+ virtual ~ElementMapper()
+ {
+ }
+
+ void addStartHandler(const char *key)
+ {
+ m_startHandlers.insert(key,new StartElementHandlerT);
+ }
+
+ void addStartHandler(const char *key, T *obj, void (T::*handler)(const QXmlAttributes &))
+ {
+ m_startHandlers.insert(key,new StartElementHandlerT(obj,handler));
+ }
+
+ void addEndHandler(const char *key)
+ {
+ m_endHandlers.insert(key,new EndElementHandlerT);
+ }
+
+ void addEndHandler(const char *key, T *obj, void (T::*handler)())
+ {
+ m_endHandlers.insert(key,new EndElementHandlerT(obj,handler));
+ }
+
+
+ protected:
+ QDict<StartElementHandlerT> m_startHandlers;
+ QDict<EndElementHandlerT> m_endHandlers;
+};
+
+//-----------------------------------------------------------------------------
+
+struct LocatorContainer
+{
+ static QXmlLocator *s_theLocator;
+};
+
+//-----------------------------------------------------------------------------
+
+template<class T> class BaseHandler : public QXmlDefaultHandler,
+ public ElementMapper<T>,
+ public LocatorContainer,
+ public IBaseHandler
+{
+ public:
+ typedef typename ElementMapper<T>::StartElementHandlerT StartElementHandlerT;
+ typedef typename ElementMapper<T>::EndElementHandlerT EndElementHandlerT;
+
+ BaseHandler() : m_delegateHandler(0), m_fallBackHandler(0)
+ {
+ }
+
+ virtual ~BaseHandler()
+ {
+ ASSERT(m_delegateHandler==0);
+ }
+
+ virtual bool startDocument()
+ {
+ return TRUE;
+ }
+
+ virtual bool startElement( const QString & namespaceURI,
+ const QString & localName,
+ const QString & name,
+ const QXmlAttributes & attrib
+ )
+ {
+ if (m_delegateHandler)
+ {
+ return m_delegateHandler->startElement(namespaceURI,localName,name,attrib);
+ }
+ if (!m_skipUntil.isEmpty()) // skip mode
+ {
+ if (m_skipUntil==name) m_skipCount++;
+ debug(1,"line %d, col %d: skipping start tag %s count=%d\n",
+ s_theLocator->lineNumber(),s_theLocator->columnNumber(),
+ name.data(),m_skipCount);
+ return TRUE;
+ }
+
+ StartElementHandlerT *handler = ElementMapper<T>::m_startHandlers[name];
+ if (handler)
+ {
+ (*handler)(attrib);
+ //printf("found start tag %s\n",name.data());
+ }
+ else if (!m_fallBackHandler ||
+ !m_fallBackHandler->handleStartElement(name,attrib)
+ )
+ {
+ debug(1,"line %d, col %d: found unexpected tag `%s', skipping until matching end tag\n",
+ s_theLocator->lineNumber(),s_theLocator->columnNumber(),
+ name.data());
+ m_skipUntil = name;
+ m_skipCount=1;
+ }
+ return TRUE;
+ }
+
+ virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& name )
+ {
+ if (m_delegateHandler)
+ {
+ return m_delegateHandler->endElement(namespaceURI,localName,name);
+ }
+
+ if (name==m_skipUntil)
+ {
+ m_skipCount--;
+ debug(1,"line %d, col %d: skipping end tag %s count=%d\n",
+ s_theLocator->lineNumber(),s_theLocator->columnNumber(),
+ name.data(),m_skipCount);
+ if (m_skipCount==0)
+ {
+ m_skipUntil="";
+ }
+ //printf("found end tag %s\n",name.data());
+ }
+ else if (m_skipUntil.isEmpty())
+ {
+ EndElementHandlerT *handler = ElementMapper<T>::m_endHandlers[name];
+ if (handler)
+ {
+ (*handler)();
+ //printf("found end tag %s\n",name.data());
+ }
+ else if (m_fallBackHandler)
+ {
+ m_fallBackHandler->handleEndElement(name);
+ }
+ }
+ m_curString="";
+ return TRUE;
+ }
+
+ bool skippedEntity ( const QString &s )
+ {
+ if (m_delegateHandler)
+ {
+ return m_delegateHandler->skippedEntity(s);
+ }
+
+ debug(1,"line %d, col %d: Skipped unhandled entity %s\n",
+ s_theLocator->lineNumber(),s_theLocator->columnNumber(),
+ s.data());
+ return TRUE;
+ }
+
+ /*! called when a number of characters are received by the parser.
+ * \param ch the characters.
+ */
+ virtual bool characters ( const QString & ch )
+ {
+ if (m_delegateHandler)
+ {
+ return m_delegateHandler->characters(ch);
+ }
+
+ //printf("Found characters \"%s\"\n",ch.data());
+ m_curString+=ch;
+ return TRUE;
+ }
+
+ void setDelegate(QXmlDefaultHandler *delegate)
+ {
+ m_delegateHandler = delegate;
+ }
+
+ QXmlDefaultHandler *delegate() const
+ {
+ return m_delegateHandler;
+ }
+
+ void setFallBackHandler(IFallBackHandler *h)
+ {
+ m_fallBackHandler = h;
+ }
+
+ IFallBackHandler *fallBackHandler() const
+ {
+ return m_fallBackHandler;
+ }
+
+ void setDocumentLocator( QXmlLocator * locator )
+ {
+ debug(2,"setDocumentLocator(%p)\n",locator);
+ s_theLocator = locator;
+ }
+
+ protected:
+ QString m_curString;
+ QString m_skipUntil;
+ int m_skipCount;
+ QXmlDefaultHandler *m_delegateHandler;
+ IFallBackHandler *m_fallBackHandler;
+};
+
+//-----------------------------------------------------------------------------
+
+template<class T> class BaseFallBackHandler : public ElementMapper<T>,
+ public IFallBackHandler
+{
+ public:
+ typedef typename ElementMapper<T>::StartElementHandlerT StartElementHandlerT;
+ typedef typename ElementMapper<T>::EndElementHandlerT EndElementHandlerT;
+
+ BaseFallBackHandler()
+ {
+ }
+ virtual ~BaseFallBackHandler()
+ {
+ }
+
+ bool handleStartElement(const QString & name,
+ const QXmlAttributes & attrib)
+ {
+ StartElementHandlerT *handler = ElementMapper<T>::m_startHandlers[name];
+ if (handler)
+ {
+ (*handler)(attrib);
+ return TRUE;
+ }
+ return FALSE;
+ }
+ bool handleEndElement(const QString &name)
+ {
+ EndElementHandlerT *handler = ElementMapper<T>::m_endHandlers[name];
+ if (handler)
+ {
+ (*handler)();
+ return TRUE;
+ }
+ return FALSE;
+ }
+};
+
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/baseiterator.h b/trunk/addon/doxmlparser/src/baseiterator.h
new file mode 100644
index 0000000..68dbee4
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/baseiterator.h
@@ -0,0 +1,50 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+#ifndef BASEITERATOR_H
+#define BASEITERATOR_H
+
+#include <qlist.h>
+#include <doxmlintf.h>
+
+template<class Intf,class ElemIntf,class ElemImpl> class BaseIterator :
+ public Intf, public QListIterator<ElemImpl>
+{
+ public:
+ BaseIterator(const QList<ElemImpl> &list) : QListIterator<ElemImpl>(list) {}
+ virtual ~BaseIterator() {}
+ virtual ElemIntf *toFirst() { return QListIterator<ElemImpl>::toFirst(); }
+ virtual ElemIntf *toLast() { return QListIterator<ElemImpl>::toLast(); }
+ virtual ElemIntf *toNext() { return QListIterator<ElemImpl>::operator++(); }
+ virtual ElemIntf *toPrev() { return QListIterator<ElemImpl>::operator--(); }
+ virtual ElemIntf *current() const { return QListIterator<ElemImpl>::current(); }
+ virtual void release() { delete this; }
+};
+
+template<class Intf,class ElemIntf,class ElemImpl,class Intermediate>
+ class BaseIteratorVia :
+ public Intf, public QListIterator<ElemImpl>
+{
+ public:
+ BaseIteratorVia(const QList<ElemImpl> &list) : QListIterator<ElemImpl>(list) {}
+ virtual ~BaseIteratorVia() {}
+ virtual ElemIntf *toFirst() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toFirst()); }
+ virtual ElemIntf *toLast() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toLast()); }
+ virtual ElemIntf *toNext() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator++()); }
+ virtual ElemIntf *toPrev() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator--()); }
+ virtual ElemIntf *current() const { return static_cast<Intermediate *>(QListIterator<ElemImpl>::current()); }
+ virtual void release() { delete this; }
+};
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/compoundhandler.cpp b/trunk/addon/doxmlparser/src/compoundhandler.cpp
new file mode 100644
index 0000000..3246e33
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/compoundhandler.cpp
@@ -0,0 +1,650 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "mainhandler.h"
+#include "compoundhandler.h"
+#include "dochandler.h"
+#include "debug.h"
+#include "graphhandler.h"
+#include "sectionhandler.h"
+#include "paramhandler.h"
+#include "loamhandler.h"
+#include "memberhandler.h"
+
+//----------------------------------------------------------------------------
+
+IncludeHandler::IncludeHandler(IBaseHandler *parent,const char *endtag) :
+ m_parent(parent)
+{
+ addEndHandler(endtag,this,&IncludeHandler::endInclude);
+}
+
+IncludeHandler::~IncludeHandler()
+{
+}
+
+void IncludeHandler::startInclude(const QXmlAttributes &attrib)
+{
+ m_curString = "";
+ m_refId = attrib.value("refid");
+ m_isLocal = attrib.value("local")=="yes";
+ m_parent->setDelegate(this);
+}
+
+void IncludeHandler::endInclude()
+{
+ m_name = m_curString;
+ m_parent->setDelegate(0);
+ debug(2,"Found include %s\n",m_name.data());
+}
+
+//----------------------------------------------------------------------------
+
+class CompoundIdIterator : public ICompoundIterator,
+ public QListIterator<QString>
+{
+ public:
+ CompoundIdIterator(const MainHandler *m,const QList<QString> &list) :
+ QListIterator<QString>(list), m_mainHandler(m) {}
+ virtual ~CompoundIdIterator() {}
+
+ virtual void toFirst()
+ {
+ QListIterator<QString>::toFirst();
+ }
+ virtual void toLast()
+ {
+ QListIterator<QString>::toLast();
+ }
+ virtual void toNext()
+ {
+ QListIterator<QString>::operator++();
+ }
+ virtual void toPrev()
+ {
+ QListIterator<QString>::operator--();
+ }
+ virtual ICompound *current() const
+ {
+ QString *id = QListIterator<QString>::current();
+ return id ? m_mainHandler->compoundById(*id) : 0;
+ }
+ virtual void release()
+ { delete this; }
+
+ private:
+ const MainHandler *m_mainHandler;
+};
+
+//----------------------------------------------------------------------------
+
+ICompound *RelatedCompound::compound() const
+{
+ return m_parent->m_mainHandler->compoundById(m_id);
+}
+
+//----------------------------------------------------------------------------
+
+class CompoundErrorHandler : public QXmlErrorHandler
+{
+ public:
+ virtual ~CompoundErrorHandler() {}
+ bool warning( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool error( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool fatalError( const QXmlParseException &exception )
+ {
+ debug(1,"Fatal error at line %d column %d: %s\n",
+ exception.lineNumber(),exception.columnNumber(),
+ exception.message().data());
+ return FALSE;
+ }
+ QString errorString() { return ""; }
+
+ private:
+ QString errorMsg;
+};
+
+//----------------------------------------------------------------------------
+
+class CompoundTypeMap
+{
+ public:
+ CompoundTypeMap()
+ {
+ m_map.setAutoDelete(TRUE);
+ m_map.insert("class", new int(ICompound::Class));
+ m_map.insert("struct", new int(ICompound::Struct));
+ m_map.insert("union", new int(ICompound::Union));
+ m_map.insert("interface",new int(ICompound::Interface));
+ m_map.insert("protocol", new int(ICompound::Protocol));
+ m_map.insert("category", new int(ICompound::Category));
+ m_map.insert("exception",new int(ICompound::Exception));
+ m_map.insert("file", new int(ICompound::File));
+ m_map.insert("namespace",new int(ICompound::Namespace));
+ m_map.insert("group", new int(ICompound::Group));
+ m_map.insert("page", new int(ICompound::Page));
+ m_map.insert("example", new int(ICompound::Example));
+ m_map.insert("dir", new int(ICompound::Dir));
+ }
+ virtual ~CompoundTypeMap()
+ {
+ }
+ ICompound::CompoundKind map(const QString &s)
+ {
+ int *val = m_map.find(s);
+ if (val==0)
+ {
+ debug(1,"Warning: `%s' is an invalid compound type\n",s.data());
+ return ICompound::Invalid;
+ }
+ else return (ICompound::CompoundKind)*val;
+ }
+ private:
+ QDict<int> m_map;
+};
+
+static CompoundTypeMap *s_typeMap;
+
+void compoundhandler_init()
+{
+ s_typeMap = new CompoundTypeMap;
+}
+
+void compoundhandler_exit()
+{
+ delete s_typeMap;
+}
+
+//----------------------------------------------------------------------------
+
+CompoundHandler::CompoundHandler(const QString &xmlDir)
+ : m_titleHandler(0),
+ m_includeDependencyGraph(0),
+ m_includedByDependencyGraph(0),
+ m_templateParamList(0),
+ m_brief(0),
+ m_detailed(0),
+ m_inheritanceGraph(0),
+ m_collaborationGraph(0),
+ m_programListing(0),
+ m_members(0),
+ m_xmlDir(xmlDir),
+ m_refCount(1),
+ m_memberDict(257),
+ m_memberNameDict(257),
+ m_mainHandler(0)
+{
+ m_superClasses.setAutoDelete(TRUE);
+ m_subClasses.setAutoDelete(TRUE);
+ m_sections.setAutoDelete(TRUE);
+ m_memberNameDict.setAutoDelete(TRUE);
+ m_innerCompounds.setAutoDelete(TRUE);
+ m_includes.setAutoDelete(TRUE);
+ m_includedBy.setAutoDelete(TRUE);
+
+ addStartHandler("doxygen");
+ addEndHandler("doxygen");
+
+ addStartHandler("compounddef",this,&CompoundHandler::startCompound);
+ addEndHandler("compounddef",this,&CompoundHandler::endCompound);
+
+ addStartHandler("compoundname");
+ addEndHandler("compoundname",this,&CompoundHandler::endCompoundName);
+
+ addStartHandler("title",this,&CompoundHandler::startTitle);
+
+ addStartHandler("basecompoundref",this,&CompoundHandler::startSuperClass);
+ addEndHandler("basecompoundref",this,&CompoundHandler::endSuperClass);
+
+ addStartHandler("derivedcompoundref",this,&CompoundHandler::startSubClass);
+ addEndHandler("derivedcompoundref",this,&CompoundHandler::endSubClass);
+
+ addStartHandler("includes",this,&CompoundHandler::startIncludes);
+ addStartHandler("includedby",this,&CompoundHandler::startIncludedBy);
+
+ addStartHandler("incdepgraph",this,&CompoundHandler::startIncludeDependencyGraph);
+
+ addStartHandler("invincdepgraph",this,&CompoundHandler::startIncludedByDependencyGraph);
+
+ addStartHandler("innerdir",this,&CompoundHandler::startInnerDir);
+ addEndHandler("innerdir");
+
+ addStartHandler("innerfile",this,&CompoundHandler::startInnerFile);
+ addEndHandler("innerfile");
+
+ addStartHandler("innerclass",this,&CompoundHandler::startInnerClass);
+ addEndHandler("innerclass");
+
+ addStartHandler("innernamespace",this,&CompoundHandler::startInnerNamespace);
+ addEndHandler("innernamespace");
+
+ addStartHandler("innerpage",this,&CompoundHandler::startInnerPage);
+ addEndHandler("innerpage");
+
+ addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup);
+ addEndHandler("innergroup");
+
+ addStartHandler("templateparamlist",this,&CompoundHandler::startTemplateParamList);
+
+ addStartHandler("sectiondef",this,&CompoundHandler::startSection);
+
+ addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc);
+
+ addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc);
+
+ addStartHandler("inheritancegraph",this,&CompoundHandler::startInheritanceGraph);
+
+ addStartHandler("collaborationgraph",this,&CompoundHandler::startCollaborationGraph);
+
+ addStartHandler("programlisting",this,&CompoundHandler::startProgramListing);
+
+ addStartHandler("location",this,&CompoundHandler::startLocation);
+ addEndHandler("location");
+
+ addStartHandler("listofallmembers",this,&CompoundHandler::startListOfAllMembers);
+}
+
+CompoundHandler::~CompoundHandler()
+{
+ debug(2,"CompoundHandler::~CompoundHandler()\n");
+ delete m_titleHandler;
+ delete m_brief;
+ delete m_detailed;
+ delete m_programListing;
+ delete m_inheritanceGraph;
+ delete m_collaborationGraph;
+ delete m_includeDependencyGraph;
+ delete m_includedByDependencyGraph;
+ delete m_templateParamList;
+ delete m_members;
+}
+
+void CompoundHandler::startSection(const QXmlAttributes& attrib)
+{
+ SectionHandler *sectHandler = new SectionHandler(this);
+ sectHandler->startSection(attrib);
+ m_sections.append(sectHandler);
+}
+
+void CompoundHandler::startBriefDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_brief = docHandler;
+}
+
+void CompoundHandler::startDetailedDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_detailed = docHandler;
+}
+
+void CompoundHandler::startProgramListing(const QXmlAttributes& attrib)
+{
+ ProgramListingHandler *plHandler = new ProgramListingHandler(this);
+ plHandler->startProgramListing(attrib);
+ m_programListing = plHandler;
+}
+
+void CompoundHandler::startIncludes(const QXmlAttributes& attrib)
+{
+ IncludeHandler *inc = new IncludeHandler(this,"includes");
+ m_includes.append(inc);
+ inc->startInclude(attrib);
+}
+
+void CompoundHandler::startIncludedBy(const QXmlAttributes& attrib)
+{
+ IncludeHandler *inc = new IncludeHandler(this,"includedby");
+ m_includedBy.append(inc);
+ inc->startInclude(attrib);
+}
+
+void CompoundHandler::startCompound(const QXmlAttributes& attrib)
+{
+ m_id = attrib.value("id");
+ m_kindString = attrib.value("kind");
+ m_kind = s_typeMap->map(m_kindString);
+ m_protection = attrib.value("prot");
+ debug(2,"startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kindString.data());
+}
+
+void CompoundHandler::endCompound()
+{
+ debug(2,"endCompound()\n");
+}
+
+void CompoundHandler::startLocation(const QXmlAttributes& attrib)
+{
+ m_defFile = attrib.value("file");
+ m_defLine = attrib.value("line").toInt();
+ m_defBodyFile = attrib.value("bodyfile");
+ m_defBodyStart = attrib.value("bodystart").toInt();
+ m_defBodyEnd = attrib.value("bodyend").toInt();
+}
+
+void CompoundHandler::endCompoundName()
+{
+ m_name = m_curString.stripWhiteSpace();
+ debug(2,"Compound name `%s'\n",m_name.data());
+}
+
+void CompoundHandler::startInnerClass(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startInnerNamespace(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startInnerFile(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startInnerPage(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startInnerDir(const QXmlAttributes& attrib)
+{
+ m_innerCompounds.append(new QString(attrib.value("refid")));
+}
+
+void CompoundHandler::startTemplateParamList(const QXmlAttributes& attrib)
+{
+ m_templateParamList = new TemplateParamListHandler(this);
+ m_templateParamList->startTemplateParamList(attrib);
+}
+
+void CompoundHandler::startListOfAllMembers(const QXmlAttributes& attrib)
+{
+ m_members = new ListOfAllMembersHandler(this);
+ m_members->startListOfAllMembers(attrib);
+}
+
+void CompoundHandler::startSuperClass(const QXmlAttributes& attrib)
+{
+ IRelatedCompound::Protection prot = IRelatedCompound::Public;
+ QString protString = attrib.value("prot");
+ if (protString=="protected")
+ {
+ prot = IRelatedCompound::Protected;
+ }
+ else if (protString=="private")
+ {
+ prot = IRelatedCompound::Private;
+ }
+ IRelatedCompound::Kind kind = IRelatedCompound::Normal;
+ QString kindString = attrib.value("virt");
+ if (kindString=="virtual") kind = IRelatedCompound::Virtual;
+
+ RelatedCompound *sc=new RelatedCompound(
+ this,
+ attrib.value("refid"),
+ prot,
+ kind
+ );
+ debug(2,"super class id=`%s' prot=`%s' virt=`%s'\n",
+ attrib.value("refid").data(),
+ protString.data(),
+ kindString.data());
+ m_superClasses.append(sc);
+ m_curString = "";
+}
+
+void CompoundHandler::endSuperClass()
+{
+ m_superClasses.getLast()->setName(m_curString);
+}
+
+void CompoundHandler::startSubClass(const QXmlAttributes& attrib)
+{
+ IRelatedCompound::Protection prot = IRelatedCompound::Public;
+ QString protString = attrib.value("prot");
+ if (protString=="protected") prot = IRelatedCompound::Protected;
+ else if (protString=="private") prot = IRelatedCompound::Private;
+
+ IRelatedCompound::Kind kind = IRelatedCompound::Normal;
+ QString kindString = attrib.value("virt");
+ if (kindString=="virtual") kind = IRelatedCompound::Virtual;
+
+ RelatedCompound *sc = new RelatedCompound(
+ this,
+ attrib.value("refid"),
+ prot,
+ kind
+ );
+ debug(2,"sub class id=`%s' prot=`%s' virt=`%s'\n",
+ attrib.value("refid").data(),
+ protString.data(),
+ kindString.data());
+ m_subClasses.append(sc);
+ m_curString = "";
+}
+
+void CompoundHandler::endSubClass()
+{
+ m_subClasses.getLast()->setName(m_curString);
+}
+
+void CompoundHandler::startTitle(const QXmlAttributes& attrib)
+{
+ ASSERT(m_titleHandler==0);
+ m_titleHandler = new TitleHandler(this);
+ m_titleHandler->startTitle(attrib);
+}
+
+bool CompoundHandler::parseXML(const char *compId)
+{
+ QFile xmlFile(m_xmlDir+"/"+compId+".xml");
+ if (!xmlFile.exists()) return FALSE;
+ CompoundErrorHandler errorHandler;
+ QXmlInputSource source( xmlFile );
+ QXmlSimpleReader reader;
+ reader.setContentHandler( this );
+ reader.setErrorHandler( &errorHandler );
+ reader.parse( source );
+ return TRUE;
+}
+
+void CompoundHandler::initialize(MainHandler *mh)
+{
+ m_mainHandler = mh;
+ QListIterator<SectionHandler> msi(m_sections);
+ SectionHandler *sec;
+ for (;(sec=msi.current());++msi)
+ {
+ sec->initialize(this);
+ }
+ if (m_members)
+ {
+ m_members->initialize(mh);
+ }
+}
+
+void CompoundHandler::insertMember(MemberHandler *mh)
+{
+ m_memberDict.insert(mh->id()->latin1(),mh);
+ mh->initialize(m_mainHandler);
+ QList<MemberHandler> *mhl = m_memberNameDict.find(mh->id()->latin1());
+ if (mhl==0)
+ {
+ mhl = new QList<MemberHandler>;
+ m_memberNameDict.insert(mh->name()->latin1(),mhl);
+ }
+ mhl->append(mh);
+}
+
+ICompound *CompoundHandler::toICompound() const
+{
+ switch (m_kind)
+ {
+ case IClass::Class: return (IClass *)this;
+ case IStruct::Struct: return (IStruct *)this;
+ case IUnion::Union: return (IUnion *)this;
+ case IException::Exception: return (IException *)this;
+ case IInterface::Interface: return (IInterface *)this;
+ case INamespace::Namespace: return (INamespace *)this;
+ case IFile::File: return (IFile *)this;
+ case IGroup::Group: return (IGroup *)this;
+ case IPage::Page: return (IPage *)this;
+ default: return 0;
+ }
+ return 0;
+}
+
+void CompoundHandler::release()
+{
+ debug(2,"CompoundHandler::release() %d->%d\n",m_refCount,m_refCount-1);
+ if (--m_refCount<=0)
+ {
+ m_mainHandler->unloadCompound(this);
+ delete this;
+ }
+}
+
+ISectionIterator *CompoundHandler::sections() const
+{
+ return new SectionIterator(m_sections);
+}
+
+IMemberIterator *CompoundHandler::memberByName(const char *name) const
+{
+ QList<MemberHandler> *ml = m_memberNameDict[name];
+ if (ml==0) return 0;
+ return new MemberIterator(*ml);
+}
+
+void CompoundHandler::startInheritanceGraph(const QXmlAttributes &attrib)
+{
+ m_inheritanceGraph = new GraphHandler(this,"inheritancegraph");
+ m_inheritanceGraph->startGraph(attrib);
+}
+
+void CompoundHandler::startCollaborationGraph(const QXmlAttributes &attrib)
+{
+ m_collaborationGraph = new GraphHandler(this,"collaborationgraph");
+ m_collaborationGraph->startGraph(attrib);
+}
+
+void CompoundHandler::startIncludeDependencyGraph(const QXmlAttributes &attrib)
+{
+ m_includeDependencyGraph = new GraphHandler(this,"incdepgraph");
+ m_includeDependencyGraph->startGraph(attrib);
+}
+
+void CompoundHandler::startIncludedByDependencyGraph(const QXmlAttributes &attrib)
+{
+ m_includedByDependencyGraph = new GraphHandler(this,"invincdepgraph");
+ m_includedByDependencyGraph->startGraph(attrib);
+}
+
+IDocRoot *CompoundHandler::briefDescription() const
+{
+ return m_brief;
+}
+
+IDocRoot *CompoundHandler::detailedDescription() const
+{
+ return m_detailed;
+}
+
+IMember *CompoundHandler::memberById(const char *id) const
+{
+ return (IFunction*)m_memberDict[id];
+}
+
+IGraph *CompoundHandler::inheritanceGraph() const
+{
+ return m_inheritanceGraph;
+}
+
+IGraph *CompoundHandler::collaborationGraph() const
+{
+ return m_collaborationGraph;
+}
+
+IGraph *CompoundHandler::includeDependencyGraph() const
+{
+ return m_includeDependencyGraph;
+}
+
+IGraph *CompoundHandler::includedByDependencyGraph() const
+{
+ return m_includedByDependencyGraph;
+}
+
+IRelatedCompoundIterator *CompoundHandler::baseCompounds() const
+{
+ return new RelatedCompoundIterator(m_superClasses);
+}
+
+IRelatedCompoundIterator *CompoundHandler::derivedCompounds() const
+{
+ return new RelatedCompoundIterator(m_subClasses);
+}
+
+ICompoundIterator *CompoundHandler::nestedCompounds() const
+{
+ return new CompoundIdIterator(m_mainHandler,m_innerCompounds);
+}
+
+IDocProgramListing *CompoundHandler::source() const
+{
+ return m_programListing;
+}
+
+IIncludeIterator *CompoundHandler::includes() const
+{
+ return new IncludeIterator(m_includes);
+}
+
+IIncludeIterator *CompoundHandler::includedBy() const
+{
+ return new IncludeIterator(m_includedBy);
+}
+
+IParamIterator *CompoundHandler::templateParameters() const
+{
+ return m_templateParamList ? m_templateParamList->templateParams() : 0;
+}
+
+const IDocTitle *CompoundHandler::title() const
+{
+ return m_titleHandler;
+}
+
+IMemberReferenceIterator *CompoundHandler::members() const
+{
+ return m_members ? m_members->members() : 0;
+}
+
+
diff --git a/trunk/addon/doxmlparser/src/compoundhandler.h b/trunk/addon/doxmlparser/src/compoundhandler.h
new file mode 100644
index 0000000..d661dc1
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/compoundhandler.h
@@ -0,0 +1,236 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+#ifndef _COMPOUNDHANDLER_H
+#define _COMPOUNDHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <qxml.h>
+#include <doxmlintf.h>
+
+#include "stringimpl.h"
+#include "basehandler.h"
+#include "baseiterator.h"
+
+class MainHandler;
+class DocHandler;
+class ProgramListingHandler;
+class GraphHandler;
+class MemberHandler;
+class CompoundHandler;
+class SectionHandler;
+class ParamHandler;
+class TemplateParamListHandler;
+class TitleHandler;
+class ListOfAllMembersHandler;
+
+class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
+{
+ public:
+ IncludeHandler(IBaseHandler *parent,const char *endtag);
+ virtual ~IncludeHandler();
+
+ void startInclude(const QXmlAttributes &attrib);
+ void endInclude();
+
+ // IInclude
+ virtual const IString * name() const
+ { return &m_name; }
+ virtual const IString * refId() const
+ { return &m_refId; }
+ virtual bool isLocal() const
+ { return &m_isLocal; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_name; // element's content
+ StringImpl m_refId; // refid
+ bool m_isLocal; // local
+};
+
+class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
+{
+ public:
+ IncludeIterator(const QList<IncludeHandler> &list) :
+ BaseIterator<IIncludeIterator,IInclude,IncludeHandler>(list) {}
+};
+
+
+class RelatedCompound : public IRelatedCompound
+{
+ public:
+ RelatedCompound(CompoundHandler *parent,
+ const QString &id,
+ Protection prot,
+ Kind kind
+ ) :
+ m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {}
+ virtual ~RelatedCompound() {}
+ void setName(const QString &str) { m_name = str; }
+
+ virtual ICompound *compound() const;
+ virtual Protection protection() const { return m_protection; }
+ virtual Kind kind() const { return m_kind; }
+ virtual const IString *name() const { return &m_name; }
+
+ private:
+ CompoundHandler *m_parent;
+ QString m_id; // refid
+ Protection m_protection; // prot
+ Kind m_kind; // virt
+ StringImpl m_name; // element's content
+};
+
+class RelatedCompoundIterator : public BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>
+{
+ public:
+ RelatedCompoundIterator(const QList<RelatedCompound> &list) :
+ BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>(list) {}
+};
+
+
+class CompoundHandler : public IClass,
+ public IStruct,
+ public IUnion,
+ public IException,
+ public IInterface,
+ public INamespace,
+ public IFile,
+ public IGroup,
+ public IPage,
+ public BaseHandler<CompoundHandler>
+{
+ friend class RelatedCompound;
+
+ public:
+ virtual void startSection(const QXmlAttributes& attrib);
+ virtual void startCompound(const QXmlAttributes& attrib);
+ virtual void startSuperClass(const QXmlAttributes& attrib);
+ virtual void endSuperClass();
+ virtual void startSubClass(const QXmlAttributes& attrib);
+ virtual void endSubClass();
+ virtual void endCompound();
+ virtual void endCompoundName();
+ virtual void startBriefDesc(const QXmlAttributes& attrib);
+ virtual void startDetailedDesc(const QXmlAttributes& attrib);
+ virtual void startLocation(const QXmlAttributes& attrib);
+ virtual void startProgramListing(const QXmlAttributes& attrib);
+ virtual void startInheritanceGraph(const QXmlAttributes& attrib);
+ virtual void startCollaborationGraph(const QXmlAttributes& attrib);
+ virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib);
+ virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib);
+ virtual void startIncludes(const QXmlAttributes& attrib);
+ virtual void startIncludedBy(const QXmlAttributes& attrib);
+ virtual void startInnerDir(const QXmlAttributes& attrib);
+ virtual void startInnerClass(const QXmlAttributes& attrib);
+ virtual void startInnerNamespace(const QXmlAttributes& attrib);
+ virtual void startInnerFile(const QXmlAttributes& attrib);
+ virtual void startInnerGroup(const QXmlAttributes& attrib);
+ virtual void startInnerPage(const QXmlAttributes& attrib);
+ virtual void startTitle(const QXmlAttributes& attrib);
+ virtual void startTemplateParamList(const QXmlAttributes& attrib);
+ virtual void startListOfAllMembers(const QXmlAttributes& attrib);
+ virtual void addref() { m_refCount++; }
+
+ CompoundHandler(const QString &dirName);
+ virtual ~CompoundHandler();
+ bool parseXML(const char *compId);
+ void initialize(MainHandler *mh);
+ void insertMember(MemberHandler *mh);
+ ICompound *toICompound() const;
+
+ // ICompound implementation
+ const IString *name() const { return &m_name; }
+ const IString *id() const { return &m_id; }
+ CompoundKind kind() const { return m_kind; }
+ const IString *kindString() const { return &m_kindString; }
+ ISectionIterator *sections() const;
+ IDocRoot *briefDescription() const;
+ IDocRoot *detailedDescription() const;
+ IMember *memberById(const char *id) const;
+ IMemberIterator *memberByName(const char *name) const;
+ IParamIterator *templateParameters() const;
+ void release();
+
+ // IClass implementation
+ IGraph *inheritanceGraph() const;
+ IGraph *collaborationGraph() const;
+ IRelatedCompoundIterator *baseCompounds() const;
+ IRelatedCompoundIterator *derivedCompounds() const;
+ ICompoundIterator *nestedCompounds() const;
+ ICompoundIterator *nestedGroup() const;
+ const IString *locationFile() const { return &m_defFile; }
+ int locationLine() const { return m_defLine; }
+ const IString *locationBodyFile() const { return &m_defBodyFile; }
+ int locationBodyStartLine() const { return m_defBodyStart; }
+ int locationBodyEndLine() const { return m_defBodyEnd; }
+ IMemberReferenceIterator *members() const;
+
+ // IFile implementation
+ IGraph *includeDependencyGraph() const;
+ IGraph *includedByDependencyGraph() const;
+ IDocProgramListing *source() const;
+ IIncludeIterator *includes() const;
+ IIncludeIterator *includedBy() const;
+
+ // IPage implementation
+ const IDocTitle *title() const;
+
+ private:
+ // XML elements:
+ // -------------
+ StringImpl m_name; // compoundname
+ TitleHandler* m_titleHandler; // title
+ QList<RelatedCompound> m_subClasses; // basecompoundref
+ QList<RelatedCompound> m_superClasses; // derivedcompoundref
+ QList<IncludeHandler> m_includes; // includes
+ QList<IncludeHandler> m_includedBy; // includedBy
+ GraphHandler* m_includeDependencyGraph; // incdepgraph
+ GraphHandler* m_includedByDependencyGraph; // invincdepgraph
+ QList<QString> m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup
+ TemplateParamListHandler* m_templateParamList; // templateparamlist
+ QList<SectionHandler> m_sections; // sectiondef
+ DocHandler* m_brief; // briefdescription
+ DocHandler* m_detailed; // detaileddescription
+ GraphHandler* m_inheritanceGraph; // inheritancegraph
+ GraphHandler* m_collaborationGraph; // collaborationgraph
+ ProgramListingHandler* m_programListing; // programlisting
+ // location
+ StringImpl m_defFile; // - file
+ int m_defLine; // - line
+ StringImpl m_defBodyFile; // - bodyfile
+ int m_defBodyStart; // - bodystart
+ int m_defBodyEnd; // - bodyend
+ ListOfAllMembersHandler* m_members; // listofallmember
+
+ // XML attributes:
+ // ---------------
+ StringImpl m_id; // id
+ CompoundKind m_kind; // kind
+ StringImpl m_kindString; // kind as a string
+ StringImpl m_protection; // prot
+
+ // local variables
+ QString m_xmlDir; // directory where the info is found
+ int m_refCount; // object reference counter
+ QDict<MemberHandler> m_memberDict; // id->member lookup
+ QDict<QList<MemberHandler> > m_memberNameDict; // name->memberlist lookup
+ MainHandler* m_mainHandler; // parent object
+};
+
+void compoundhandler_init();
+void compoundhandler_exit();
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/debug.cpp b/trunk/addon/doxmlparser/src/debug.cpp
new file mode 100644
index 0000000..a8be32c
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/debug.cpp
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "debug.h"
+
+static int s_debugLevel = 0;
+
+void debug(int level,const char *msg,...)
+{
+ if (level<=s_debugLevel)
+ {
+ va_list args;
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+ }
+}
+
+void setDebugLevel(int level)
+{
+ s_debugLevel = level;
+}
+
diff --git a/trunk/addon/doxmlparser/src/debug.h b/trunk/addon/doxmlparser/src/debug.h
new file mode 100644
index 0000000..c77f7fe
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/debug.h
@@ -0,0 +1,7 @@
+#ifndef _DEBUG_H
+#define _DEBUG_H
+
+void debug(int level,const char *msg,...);
+void setDebugLevel(int level);
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/dochandler.cpp b/trunk/addon/doxmlparser/src/dochandler.cpp
new file mode 100644
index 0000000..ce7cb3f
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/dochandler.cpp
@@ -0,0 +1,2240 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include <qmap.h>
+
+#include "dochandler.h"
+#include "debug.h"
+#include "linkedtexthandler.h"
+
+
+//----------------------------------------------------------------------
+
+class TypeNameMapper
+{
+ public:
+ TypeNameMapper()
+ {
+ m_map.insert("see", SimpleSectHandler::See);
+ m_map.insert("return", SimpleSectHandler::Return);
+ m_map.insert("author", SimpleSectHandler::Author);
+ m_map.insert("version", SimpleSectHandler::Version);
+ m_map.insert("since", SimpleSectHandler::Since);
+ m_map.insert("date", SimpleSectHandler::Date);
+ m_map.insert("bug", SimpleSectHandler::Bug);
+ m_map.insert("note", SimpleSectHandler::Note);
+ m_map.insert("warning", SimpleSectHandler::Warning);
+ m_map.insert("par", SimpleSectHandler::Par);
+ m_map.insert("deprecated",SimpleSectHandler::Deprecated);
+ m_map.insert("pre", SimpleSectHandler::Pre);
+ m_map.insert("post", SimpleSectHandler::Post);
+ m_map.insert("invariant", SimpleSectHandler::Invar);
+ m_map.insert("remark", SimpleSectHandler::Remark);
+ m_map.insert("attention", SimpleSectHandler::Attention);
+ m_map.insert("todo", SimpleSectHandler::Todo);
+ m_map.insert("test", SimpleSectHandler::Test);
+ m_map.insert("rcs", SimpleSectHandler::RCS);
+ m_map.insert("enumvalues",SimpleSectHandler::EnumValues);
+ m_map.insert("examples", SimpleSectHandler::Examples);
+ }
+ SimpleSectHandler::Types stringToType(const QString &typeStr)
+ {
+ return m_map[typeStr];
+ }
+ private:
+ QMap<QString,SimpleSectHandler::Types> m_map;
+};
+
+class HighlightMapper
+{
+ public:
+ HighlightMapper()
+ {
+ m_map.insert("comment", HighlightHandler::Comment);
+ m_map.insert("keyword", HighlightHandler::Keyword);
+ m_map.insert("keywordtype", HighlightHandler::KeywordType);
+ m_map.insert("keywordflow", HighlightHandler::KeywordFlow);
+ m_map.insert("charliteral", HighlightHandler::CharLiteral);
+ m_map.insert("stringliteral", HighlightHandler::StringLiteral);
+ m_map.insert("preprocessor", HighlightHandler::Preprocessor);
+ }
+ HighlightHandler::HighlightKind stringToKind(const QString &kindStr)
+ {
+ return m_map[kindStr];
+ }
+ private:
+ QMap<QString,HighlightHandler::HighlightKind> m_map;
+};
+
+static TypeNameMapper *s_typeMapper;
+static HighlightMapper *s_highlightMapper;
+
+void dochandler_init()
+{
+ s_typeMapper = new TypeNameMapper;
+ s_highlightMapper = new HighlightMapper;
+}
+
+void dochandler_exit()
+{
+ delete s_typeMapper;
+ delete s_highlightMapper;
+}
+
+//----------------------------------------------------------------------
+// MarkupHandler
+//----------------------------------------------------------------------
+
+MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
+ : m_children(children), m_curString(curString),
+ m_curMarkup(IDocMarkup::Normal), m_headingLevel(0)
+{
+ addStartHandler("bold",this,&MarkupHandler::startBold);
+ addEndHandler("bold",this,&MarkupHandler::endBold);
+
+ addStartHandler("emphasis",this,&MarkupHandler::startEmphasis);
+ addEndHandler("emphasis",this,&MarkupHandler::endEmphasis);
+
+ addStartHandler("computeroutput",this,&MarkupHandler::startComputerOutput);
+ addEndHandler("computeroutput",this,&MarkupHandler::endComputerOutput);
+
+ addStartHandler("center",this,&MarkupHandler::startCenter);
+ addEndHandler("center",this,&MarkupHandler::endCenter);
+
+ addStartHandler("small",this,&MarkupHandler::startSmallFont);
+ addEndHandler("small",this,&MarkupHandler::endSmallFont);
+
+ addStartHandler("subscript",this,&MarkupHandler::startSubscript);
+ addEndHandler("subscript",this,&MarkupHandler::endSubscript);
+
+ addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
+ addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
+
+ addStartHandler("preformatted",this,&MarkupHandler::startPreformatted);
+ addEndHandler("preformatted",this,&MarkupHandler::endPreformatted);
+
+ addStartHandler("heading1",this,&MarkupHandler::startHeading1);
+ addEndHandler("heading1",this,&MarkupHandler::endHeading1);
+
+ addStartHandler("heading2",this,&MarkupHandler::startHeading2);
+ addEndHandler("heading2",this,&MarkupHandler::endHeading2);
+
+ addStartHandler("heading3",this,&MarkupHandler::startHeading3);
+ addEndHandler("heading3",this,&MarkupHandler::endHeading3);
+
+ addStartHandler("heading4",this,&MarkupHandler::startHeading4);
+ addEndHandler("heading4",this,&MarkupHandler::endHeading4);
+
+ addStartHandler("heading5",this,&MarkupHandler::startHeading5);
+ addEndHandler("heading5",this,&MarkupHandler::endHeading5);
+
+ addStartHandler("heading6",this,&MarkupHandler::startHeading6);
+ addEndHandler("heading6",this,&MarkupHandler::endHeading6);
+}
+
+MarkupHandler::~MarkupHandler()
+{
+}
+
+void MarkupHandler::addTextNode()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(new TextNode(m_curString,m_curMarkup,m_headingLevel));
+ debug(2,"addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup);
+ m_curString="";
+ }
+}
+
+void MarkupHandler::startBold(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Bold,TRUE));
+ m_curMarkup |= IDocMarkup::Bold;
+}
+
+void MarkupHandler::endBold()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Bold,FALSE));
+ m_curMarkup &= ~IDocMarkup::Bold;
+}
+
+void MarkupHandler::startEmphasis(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,TRUE));
+ m_curMarkup |= IDocMarkup::Emphasis;
+}
+
+void MarkupHandler::endEmphasis()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,FALSE));
+ m_curMarkup &= ~IDocMarkup::Emphasis;
+}
+
+void MarkupHandler::startComputerOutput(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,TRUE));
+ m_curMarkup |= IDocMarkup::ComputerOutput;
+}
+
+void MarkupHandler::endComputerOutput()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,FALSE));
+ m_curMarkup &= ~IDocMarkup::ComputerOutput;
+}
+
+void MarkupHandler::startCenter(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Center,TRUE));
+ m_curMarkup |= IDocMarkup::Center;
+}
+
+void MarkupHandler::endCenter()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Center,FALSE));
+ m_curMarkup &= ~IDocMarkup::Center;
+}
+
+void MarkupHandler::startSmallFont(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,TRUE));
+ m_curMarkup |= IDocMarkup::SmallFont;
+}
+
+void MarkupHandler::endSmallFont()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,FALSE));
+ m_curMarkup &= ~IDocMarkup::SmallFont;
+}
+
+void MarkupHandler::startSubscript(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,TRUE));
+ m_curMarkup |= IDocMarkup::Subscript;
+}
+
+void MarkupHandler::endSubscript()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,FALSE));
+ m_curMarkup &= ~IDocMarkup::Subscript;
+}
+
+void MarkupHandler::startSuperscript(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,TRUE));
+ m_curMarkup |= IDocMarkup::Superscript;
+}
+
+void MarkupHandler::endSuperscript()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,FALSE));
+ m_curMarkup &= ~IDocMarkup::Superscript;
+}
+
+void MarkupHandler::startPreformatted(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,TRUE));
+ m_curMarkup |= IDocMarkup::Preformatted;
+}
+
+void MarkupHandler::endPreformatted()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,FALSE));
+ m_curMarkup &= ~IDocMarkup::Preformatted;
+}
+
+void MarkupHandler::startHeading1(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,1));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=1;
+}
+
+void MarkupHandler::endHeading1()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,1));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+void MarkupHandler::startHeading2(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,2));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=2;
+}
+
+void MarkupHandler::endHeading2()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,2));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+void MarkupHandler::startHeading3(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,3));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=3;
+}
+
+void MarkupHandler::endHeading3()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,3));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+void MarkupHandler::startHeading4(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,4));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=4;
+}
+
+void MarkupHandler::endHeading4()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,4));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+void MarkupHandler::startHeading5(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,5));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=5;
+}
+
+void MarkupHandler::endHeading5()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,5));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+void MarkupHandler::startHeading6(const QXmlAttributes & /*attrib*/)
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,6));
+ m_curMarkup |= IDocMarkup::Heading;
+ m_headingLevel=6;
+}
+
+void MarkupHandler::endHeading6()
+{
+ addTextNode();
+ m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,6));
+ m_curMarkup &= ~IDocMarkup::Heading;
+ m_headingLevel=0;
+}
+
+
+//----------------------------------------------------------------------
+// ListItemHandler
+//----------------------------------------------------------------------
+
+ListItemHandler::ListItemHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+
+ addEndHandler("listitem",this,&ListItemHandler::endListItem);
+
+ addStartHandler("para",this,&ListItemHandler::startParagraph);
+}
+
+ListItemHandler::~ListItemHandler()
+{
+}
+
+void ListItemHandler::startListItem(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start list item handler\n");
+}
+
+void ListItemHandler::endListItem()
+{
+ debug(2,"end list item handler\n");
+ m_parent->setDelegate(0);
+}
+
+void ListItemHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *parHandler = new ParagraphHandler(this);
+ parHandler->startParagraph(attrib);
+ m_children.append(parHandler);
+}
+
+IDocIterator *ListItemHandler::contents() const
+{
+ return new ListItemIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// OrderedListHandler
+//----------------------------------------------------------------------
+
+OrderedListHandler::OrderedListHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("orderedlist",this,&OrderedListHandler::endOrderedList);
+ addStartHandler("listitem",this,&OrderedListHandler::startOrderedListItem);
+}
+
+OrderedListHandler::~OrderedListHandler()
+{
+}
+
+void OrderedListHandler::startOrderedList(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+}
+
+void OrderedListHandler::endOrderedList()
+{
+ m_parent->setDelegate(0);
+}
+
+void OrderedListHandler::startOrderedListItem(const QXmlAttributes& attrib)
+{
+ ListItemHandler *liHandler = new ListItemHandler(this);
+ liHandler->startListItem(attrib);
+ m_children.append(liHandler);
+}
+
+IDocIterator *OrderedListHandler::elements() const
+{
+ return new OrderedListIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// ItemizedListHandler
+//----------------------------------------------------------------------
+
+ItemizedListHandler::ItemizedListHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("itemizedlist",this,&ItemizedListHandler::endItemizedList);
+ addStartHandler("listitem",this,&ItemizedListHandler::startItemizedListItem);
+}
+
+ItemizedListHandler::~ItemizedListHandler()
+{
+}
+
+void ItemizedListHandler::startItemizedList(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+}
+
+void ItemizedListHandler::endItemizedList()
+{
+ m_parent->setDelegate(0);
+}
+
+void ItemizedListHandler::startItemizedListItem(const QXmlAttributes& attrib)
+{
+ ListItemHandler *liHandler = new ListItemHandler(this);
+ liHandler->startListItem(attrib);
+ m_children.append(liHandler);
+}
+
+IDocIterator *ItemizedListHandler::elements() const
+{
+ return new ItemizedListIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// TocListHandler
+//----------------------------------------------------------------------
+
+TocListHandler::TocListHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("toclist",this,&TocListHandler::endTocList);
+ addStartHandler("tocitem",this,&TocListHandler::startTocItem);
+}
+
+TocListHandler::~TocListHandler()
+{
+}
+
+void TocListHandler::startTocList(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+}
+
+void TocListHandler::endTocList()
+{
+ m_parent->setDelegate(0);
+}
+
+void TocListHandler::startTocItem(const QXmlAttributes& attrib)
+{
+ TocItemHandler *tiHandler = new TocItemHandler(this);
+ tiHandler->startTocItem(attrib);
+ m_children.append(tiHandler);
+}
+
+IDocIterator *TocListHandler::elements() const
+{
+ return new TocListIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// TocItemHandler
+//----------------------------------------------------------------------
+
+TocItemHandler::TocItemHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ addEndHandler("tocitem",this,&TocItemHandler::endTocItem);
+}
+
+TocItemHandler::~TocItemHandler()
+{
+}
+
+void TocItemHandler::startTocItem(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_id = attrib.value("id");
+ m_curString="";
+}
+
+void TocItemHandler::endTocItem()
+{
+ m_title = m_curString;
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// ParameterHandler
+//----------------------------------------------------------------------
+
+ParameterHandler::ParameterHandler(IBaseHandler *parent) :
+ m_parent(parent)
+{
+ addEndHandler("parametername",this,&ParameterHandler::endParameterName);
+}
+
+ParameterHandler::~ParameterHandler()
+{
+}
+
+void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+}
+
+void ParameterHandler::endParameterName()
+{
+ m_name = m_curString;
+ debug(2,"parameter %s\n",m_name.data());
+ m_curString="";
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// ParameterListHandler
+//----------------------------------------------------------------------
+
+ParameterItemHandler::ParameterItemHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("parameteritem",this,&ParameterItemHandler::endParameterItem);
+ addStartHandler("parameternamelist");
+ addEndHandler("parameternamelist");
+ addStartHandler("parametername",this,&ParameterItemHandler::startParameterName);
+ addStartHandler("parameterdescription");
+ addEndHandler("parameterdescription");
+ addStartHandler("para",this,&ParameterItemHandler::startParagraph);
+ m_parameters.setAutoDelete(TRUE);
+ m_description = 0;
+}
+
+ParameterItemHandler::~ParameterItemHandler()
+{
+ delete m_description;
+}
+
+void ParameterItemHandler::startParameterItem(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+}
+
+void ParameterItemHandler::endParameterItem()
+{
+ m_parent->setDelegate(0);
+}
+
+void ParameterItemHandler::startParameterName(const QXmlAttributes& attrib)
+{
+ ParameterHandler *param = new ParameterHandler(this);
+ m_parameters.append(param);
+ param->startParameterName(attrib);
+}
+
+void ParameterItemHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ m_description = new ParagraphHandler(this);
+ m_description->startParagraph(attrib);
+}
+
+IDocIterator *ParameterItemHandler::paramNames() const
+{
+ return new ParameterItemIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// ParameterListHandler
+//----------------------------------------------------------------------
+
+ParameterListHandler::ParameterListHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList);
+ addStartHandler("parameteritem",this,&ParameterListHandler::startParameterItem);
+ m_paramItems.setAutoDelete(TRUE);
+}
+
+ParameterListHandler::~ParameterListHandler()
+{
+}
+
+void ParameterListHandler::startParameterList(const QXmlAttributes& attrib)
+{
+ QString kind = attrib.value("kind");
+ if (kind=="retval") m_type=RetVal;
+ else if (kind=="exception") m_type=Exception;
+ else if (kind=="param") m_type=Param;
+ else
+ {
+ debug(1,"Error: invalid parameterlist type: %s\n",kind.data());
+ }
+ debug(2,"parameterlist kind=%s\n",kind.data());
+ m_parent->setDelegate(this);
+}
+
+void ParameterListHandler::endParameterList()
+{
+ m_parent->setDelegate(0);
+}
+
+void ParameterListHandler::startParameterItem(const QXmlAttributes& attrib)
+{
+ ParameterItemHandler *paramItem = new ParameterItemHandler(this);
+ m_paramItems.append(paramItem);
+ paramItem->startParameterItem(attrib);
+}
+
+IDocIterator *ParameterListHandler::params() const
+{
+ return new ParameterListIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// LinkHandler
+//----------------------------------------------------------------------
+
+LinkHandler::LinkHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("link",this,&LinkHandler::endLink);
+}
+
+LinkHandler::~LinkHandler()
+{
+}
+
+void LinkHandler::startLink(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start link\n");
+ m_ref = attrib.value("linkend");
+ m_curString="";
+}
+
+void LinkHandler::endLink()
+{
+ m_text = m_curString;
+ m_curString="";
+ m_parent->setDelegate(0);
+ debug(2,"End link\n");
+}
+
+//----------------------------------------------------------------------
+// EMailHandler
+//----------------------------------------------------------------------
+
+EMailHandler::EMailHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("email",this,&EMailHandler::endEMail);
+}
+
+EMailHandler::~EMailHandler()
+{
+}
+
+void EMailHandler::startEMail(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start email\n");
+ m_curString="";
+}
+
+void EMailHandler::endEMail()
+{
+ m_address = m_curString;
+ m_curString="";
+ m_parent->setDelegate(0);
+ debug(2,"End email\n");
+}
+
+//----------------------------------------------------------------------
+// ULinkHandler
+//----------------------------------------------------------------------
+
+ULinkHandler::ULinkHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("ulink",this,&ULinkHandler::endULink);
+}
+
+ULinkHandler::~ULinkHandler()
+{
+}
+
+void ULinkHandler::startULink(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start ulink\n");
+ m_url = attrib.value("url");
+ m_curString="";
+}
+
+void ULinkHandler::endULink()
+{
+ m_text = m_curString;
+ m_curString="";
+ m_parent->setDelegate(0);
+ debug(2,"End ulink\n");
+}
+
+//----------------------------------------------------------------------
+// LineBreakHandler
+//----------------------------------------------------------------------
+
+LineBreakHandler::LineBreakHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("linebreak",this,&LineBreakHandler::endLineBreak);
+}
+
+LineBreakHandler::~LineBreakHandler()
+{
+}
+
+void LineBreakHandler::startLineBreak(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start linebreak\n");
+}
+
+void LineBreakHandler::endLineBreak()
+{
+ m_parent->setDelegate(0);
+ debug(2,"End linebreak\n");
+}
+
+//----------------------------------------------------------------------
+// HRulerHandler
+//----------------------------------------------------------------------
+
+HRulerHandler::HRulerHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("hruler",this,&HRulerHandler::endHRuler);
+}
+
+HRulerHandler::~HRulerHandler()
+{
+}
+
+void HRulerHandler::startHRuler(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start hruler\n");
+}
+
+void HRulerHandler::endHRuler()
+{
+ m_parent->setDelegate(0);
+ debug(2,"End hruler\n");
+}
+
+//----------------------------------------------------------------------
+// RefHandler
+//----------------------------------------------------------------------
+
+RefHandler::RefHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("ref",this,&RefHandler::endRef);
+}
+
+RefHandler::~RefHandler()
+{
+}
+
+void RefHandler::startRef(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_refId = attrib.value("refid");
+ m_extId = attrib.value("external");
+ ASSERT(attrib.value("kindref")=="compound" ||
+ attrib.value("kindref")=="member");
+ m_targetKind = attrib.value("kindref")=="compound" ? Compound : Member;
+ debug(2,"Start ref refId=%s\n",m_refId.data());
+ m_curString="";
+}
+
+void RefHandler::endRef()
+{
+ m_linkText = m_curString;
+ m_parent->setDelegate(0);
+ debug(2,"End ref: text=`%s'\n",m_linkText.data());
+}
+
+
+//----------------------------------------------------------------------
+// TitleHandler
+//----------------------------------------------------------------------
+
+TitleHandler::TitleHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ m_markupHandler = new MarkupHandler(m_children,m_curString);
+ setFallBackHandler(m_markupHandler);
+ addStartHandler("ref",this,&TitleHandler::startRef);
+ addEndHandler("title",this,&TitleHandler::endTitle);
+}
+
+TitleHandler::~TitleHandler()
+{
+ delete m_markupHandler;
+}
+
+void TitleHandler::startTitle(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start title\n");
+ m_curString="";
+}
+
+void TitleHandler::endTitle()
+{
+ addTextNode();
+ m_parent->setDelegate(0);
+ debug(2,"End title\n");
+}
+
+void TitleHandler::addTextNode()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(
+ new TextNode(
+ m_curString,
+ m_markupHandler->markup(),
+ m_markupHandler->headingLevel()
+ )
+ );
+ debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
+ m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
+ m_curString="";
+ }
+}
+
+void TitleHandler::startRef(const QXmlAttributes& attrib)
+{
+ RefHandler *ref = new RefHandler(this);
+ ref->startRef(attrib);
+ m_children.append(ref);
+}
+
+IDocIterator *TitleHandler::title() const
+{
+ return new TitleIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// SimpleSectHandler
+//----------------------------------------------------------------------
+
+SimpleSectHandler::SimpleSectHandler(IBaseHandler *parent)
+ : m_parent(parent), m_paragraph(0), m_title(0)
+{
+ addStartHandler("title",this,&SimpleSectHandler::startTitle);
+ addStartHandler("para",this,&SimpleSectHandler::startParagraph);
+ addEndHandler("simplesect",this,&SimpleSectHandler::endSimpleSect);
+}
+
+SimpleSectHandler::~SimpleSectHandler()
+{
+}
+
+void SimpleSectHandler::startSimpleSect(const QXmlAttributes& attrib)
+{
+ m_typeString = attrib.value("kind");
+ m_type = s_typeMapper->stringToType(m_typeString);
+ debug(2,"start simple section %s\n",m_typeString.data());
+ m_parent->setDelegate(this);
+}
+
+void SimpleSectHandler::endSimpleSect()
+{
+ debug(2,"end simple section\n");
+ m_parent->setDelegate(0);
+}
+
+void SimpleSectHandler::startTitle(const QXmlAttributes& attrib)
+{
+ ASSERT(m_title==0);
+ m_title = new TitleHandler(this);
+ m_title->startTitle(attrib);
+}
+
+void SimpleSectHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ASSERT(m_paragraph==0);
+ m_paragraph = new ParagraphHandler(this);
+ m_paragraph->startParagraph(attrib);
+}
+
+//----------------------------------------------------------------------
+// VariableListEntryHandler
+//----------------------------------------------------------------------
+
+VariableListEntryHandler::VariableListEntryHandler(IBaseHandler *parent)
+ : m_parent(parent), m_description(0), m_linkedTextHandler(0)
+{
+ addStartHandler("term",this,&VariableListEntryHandler::startTerm);
+ addEndHandler("term",this,&VariableListEntryHandler::endTerm);
+ addStartHandler("para",this,&VariableListEntryHandler::startParagraph);
+ addEndHandler("varlistentry",this,&VariableListEntryHandler::endVarListEntry);
+ addEndHandler("listitem",this,&VariableListEntryHandler::endListItem);
+}
+
+VariableListEntryHandler::~VariableListEntryHandler()
+{
+ delete m_description;
+}
+
+void VariableListEntryHandler::startVarListEntry(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start varlistentry\n");
+}
+
+void VariableListEntryHandler::endVarListEntry()
+{
+ m_parent->setDelegate(0);
+ debug(2,"end varlistentry\n");
+}
+
+void VariableListEntryHandler::startListItem(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start listitem\n");
+}
+
+void VariableListEntryHandler::endListItem()
+{
+ m_parent->setDelegate(0);
+ debug(2,"end listitem\n");
+}
+
+void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/)
+{
+ m_curString="";
+ m_linkedTextHandler = new LinkedTextHandler(this,m_term);
+ m_linkedTextHandler->start("term");
+}
+
+void VariableListEntryHandler::endTerm()
+{
+ delete m_linkedTextHandler;
+}
+
+void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ASSERT(m_description==0);
+ m_description = new ParagraphHandler(this);
+ m_description->startParagraph(attrib);
+}
+
+ILinkedTextIterator *VariableListEntryHandler::term() const
+{
+ return new LinkedTextIterator(m_term);
+}
+
+
+//----------------------------------------------------------------------
+// VariableListHandler
+//----------------------------------------------------------------------
+
+VariableListHandler::VariableListHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_entries.setAutoDelete(TRUE);
+ addStartHandler("varlistentry",this,&VariableListHandler::startVarListEntry);
+ addStartHandler("listitem",this,&VariableListHandler::startListItem);
+ addEndHandler("variablelist",this,&VariableListHandler::endVariableList);
+}
+
+VariableListHandler::~VariableListHandler()
+{
+}
+
+void VariableListHandler::startVariableList(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start variablelist\n");
+}
+
+void VariableListHandler::endVariableList()
+{
+ debug(2,"end variablelist\n");
+ m_parent->setDelegate(0);
+}
+
+void VariableListHandler::startVarListEntry(const QXmlAttributes& attrib)
+{
+ VariableListEntryHandler *vle = new VariableListEntryHandler(this);
+ vle->startVarListEntry(attrib);
+ m_curEntry = vle;
+ m_entries.append(vle);
+}
+
+void VariableListHandler::startListItem(const QXmlAttributes& attrib)
+{
+ ASSERT(m_curEntry!=0);
+ m_curEntry->startListItem(attrib);
+}
+
+IDocIterator *VariableListHandler::entries() const
+{
+ return new VariableListIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// HighlightHandler
+//----------------------------------------------------------------------
+
+HighlightHandler::HighlightHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("highlight",this,&HighlightHandler::endHighlight);
+ addStartHandler("ref",this,&HighlightHandler::startRef);
+ addStartHandler("sp",this,&HighlightHandler::startSpace);
+ m_hl = IDocHighlight::Invalid;
+}
+
+HighlightHandler::~HighlightHandler()
+{
+}
+
+void HighlightHandler::startHighlight(const QXmlAttributes& attrib)
+{
+ m_hlString = attrib.value("class");
+ m_hl = s_highlightMapper->stringToKind(m_hlString);
+ m_curString="";
+ m_parent->setDelegate(this);
+ debug(2,"start highlight\n");
+}
+
+void HighlightHandler::endHighlight()
+{
+ addTextNode();
+ debug(2,"end highlight class=`%s'\n",m_hlString.data());
+ m_parent->setDelegate(0);
+}
+
+void HighlightHandler::startRef(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ RefHandler *rh = new RefHandler(this);
+ m_children.append(rh);
+ rh->startRef(attrib);
+}
+
+void HighlightHandler::startSpace(const QXmlAttributes&)
+{
+ m_curString=" ";
+ addTextNode();
+}
+
+void HighlightHandler::addTextNode()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
+ debug(2,"addTextNode() text=\"%s\"\n",
+ m_curString.data());
+ m_curString="";
+ }
+}
+
+IDocIterator *HighlightHandler::codeElements() const
+{
+ return new HighlightIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// CodeLineHandler
+//----------------------------------------------------------------------
+
+CodeLineHandler::CodeLineHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("codeline",this,&CodeLineHandler::endCodeLine);
+ addEndHandler("linenumber",this,&CodeLineHandler::endLineNumber);
+ addStartHandler("highlight",this,&CodeLineHandler::startHighlight);
+ addStartHandler("ref",this,&CodeLineHandler::startRef);
+ m_lineNumber = 0;
+}
+
+CodeLineHandler::~CodeLineHandler()
+{
+}
+
+void CodeLineHandler::startCodeLine(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start codeline\n");
+}
+
+void CodeLineHandler::endCodeLine()
+{
+ addTextNode();
+ debug(2,"end codeline\n");
+ m_parent->setDelegate(0);
+}
+
+void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start linenumber\n");
+ m_lineNumber = attrib.value("line").toInt();
+ m_refId = attrib.value("refid");
+}
+
+void CodeLineHandler::endLineNumber()
+{
+ m_parent->setDelegate(0);
+}
+
+void CodeLineHandler::startHighlight(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ HighlightHandler *hlh = new HighlightHandler(this);
+ m_children.append(hlh);
+ hlh->startHighlight(attrib);
+}
+
+void CodeLineHandler::startRef(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ RefHandler *rh = new RefHandler(this);
+ m_children.append(rh);
+ rh->startRef(attrib);
+}
+
+void CodeLineHandler::addTextNode()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
+ debug(2,"addTextNode() text=\"%s\"\n",
+ m_curString.data());
+ m_curString="";
+ }
+}
+
+IDocIterator *CodeLineHandler::codeElements() const
+{
+ return new CodeLineIterator(*this);
+}
+
+
+//----------------------------------------------------------------------
+// ProgramListingHandler
+//----------------------------------------------------------------------
+
+ProgramListingHandler::ProgramListingHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ m_hasLineNumber=FALSE;
+ addEndHandler("programlisting",this,&ProgramListingHandler::endProgramListing);
+
+ addStartHandler("linenumber",this,&ProgramListingHandler::startLineNumber);
+ addStartHandler("codeline",this,&ProgramListingHandler::startCodeLine);
+}
+
+ProgramListingHandler::~ProgramListingHandler()
+{
+}
+
+void ProgramListingHandler::startProgramListing(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start programlisting\n");
+}
+
+void ProgramListingHandler::endProgramListing()
+{
+ debug(2,"end programlisting\n");
+ m_parent->setDelegate(0);
+}
+
+void ProgramListingHandler::startLineNumber(const QXmlAttributes& attrib)
+{
+ CodeLineHandler *clh = new CodeLineHandler(this);
+ m_children.append(clh);
+ m_hasLineNumber=TRUE;
+ clh->startLineNumber(attrib);
+}
+
+void ProgramListingHandler::startCodeLine(const QXmlAttributes& attrib)
+{
+ CodeLineHandler *clh = 0;
+ if (!m_hasLineNumber)
+ {
+ clh = new CodeLineHandler(this);
+ m_children.append(clh);
+ }
+ else
+ {
+ clh = m_children.getLast();
+ }
+ ASSERT(clh!=0);
+ clh->startCodeLine(attrib);
+ m_hasLineNumber=FALSE;
+}
+
+IDocIterator *ProgramListingHandler::codeLines() const
+{
+ return new ProgramListingIterator(*this);
+}
+
+
+
+//----------------------------------------------------------------------
+// FormulaHandler
+//----------------------------------------------------------------------
+
+FormulaHandler::FormulaHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("formula",this,&FormulaHandler::endFormula);
+}
+
+FormulaHandler::~FormulaHandler()
+{
+}
+
+void FormulaHandler::startFormula(const QXmlAttributes& attrib)
+{
+ m_id = attrib.value("id");
+ m_curString="";
+ m_parent->setDelegate(this);
+}
+
+void FormulaHandler::endFormula()
+{
+ m_text = m_curString;
+ debug(2,"formula id=`%s' text=`%s'\n",m_id.data(),m_text.data());
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// AnchorHandler
+//----------------------------------------------------------------------
+
+AnchorHandler::AnchorHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("anchor",this,&AnchorHandler::endAnchor);
+}
+
+AnchorHandler::~AnchorHandler()
+{
+}
+
+void AnchorHandler::startAnchor(const QXmlAttributes& attrib)
+{
+ m_id = attrib.value("id");
+ m_parent->setDelegate(this);
+}
+
+void AnchorHandler::endAnchor()
+{
+ debug(2,"anchor id=`%s'\n",m_id.data());
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// ImageHandler
+//----------------------------------------------------------------------
+
+ImageHandler::ImageHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("image",this,&ImageHandler::endImage);
+}
+
+ImageHandler::~ImageHandler()
+{
+}
+
+void ImageHandler::startImage(const QXmlAttributes& attrib)
+{
+ m_name = attrib.value("name");
+ m_curString="";
+ m_parent->setDelegate(this);
+}
+
+void ImageHandler::endImage()
+{
+ m_caption = m_curString;
+ debug(2,"image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data());
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// DotFileHandler
+//----------------------------------------------------------------------
+
+DotFileHandler::DotFileHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("dotfile",this,&DotFileHandler::endDotFile);
+}
+
+DotFileHandler::~DotFileHandler()
+{
+}
+
+void DotFileHandler::startDotFile(const QXmlAttributes& attrib)
+{
+ m_name = attrib.value("name");
+ m_curString="";
+ m_parent->setDelegate(this);
+}
+
+void DotFileHandler::endDotFile()
+{
+ m_caption = m_curString;
+ debug(2,"image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data());
+ m_parent->setDelegate(0);
+}
+
+//----------------------------------------------------------------------
+// IndexEntryHandler
+//----------------------------------------------------------------------
+
+IndexEntryHandler::IndexEntryHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("indexentry",this,&IndexEntryHandler::endIndexEntry);
+ addStartHandler("primaryie",this,&IndexEntryHandler::startPrimaryIE);
+ addEndHandler("primaryie",this,&IndexEntryHandler::endPrimaryIE);
+ addStartHandler("secondaryie",this,&IndexEntryHandler::startSecondaryIE);
+ addEndHandler("secondaryie",this,&IndexEntryHandler::endSecondaryIE);
+}
+
+IndexEntryHandler::~IndexEntryHandler()
+{
+}
+
+void IndexEntryHandler::startIndexEntry(const QXmlAttributes& /*attrib*/)
+{
+ debug(2,"start index entry\n");
+ m_parent->setDelegate(this);
+}
+
+void IndexEntryHandler::endIndexEntry()
+{
+ debug(2,"index entry primary=`%s' secondary=`%s'\n",
+ m_primary.data(),m_secondary.data());
+ m_parent->setDelegate(0);
+}
+
+void IndexEntryHandler::startPrimaryIE(const QXmlAttributes& /*attrib*/)
+{
+ m_curString="";
+}
+
+void IndexEntryHandler::endPrimaryIE()
+{
+ m_primary = m_curString;
+}
+
+void IndexEntryHandler::startSecondaryIE(const QXmlAttributes& /*attrib*/)
+{
+ m_curString="";
+}
+
+void IndexEntryHandler::endSecondaryIE()
+{
+ m_secondary = m_curString;
+}
+
+//----------------------------------------------------------------------
+// EntryHandler
+//----------------------------------------------------------------------
+
+EntryHandler::EntryHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("entry",this,&EntryHandler::endEntry);
+ addStartHandler("para",this,&EntryHandler::startParagraph);
+}
+
+EntryHandler::~EntryHandler()
+{
+}
+
+void EntryHandler::startEntry(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+}
+
+void EntryHandler::endEntry()
+{
+ m_parent->setDelegate(0);
+}
+
+void EntryHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *ph = new ParagraphHandler(this);
+ ph->startParagraph(attrib);
+ m_children.append(ph);
+}
+
+IDocIterator *EntryHandler::contents() const
+{
+ return new EntryIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// RowHandler
+//----------------------------------------------------------------------
+
+RowHandler::RowHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("row",this,&RowHandler::endRow);
+ addStartHandler("entry",this,&RowHandler::startEntry);
+}
+
+RowHandler::~RowHandler()
+{
+}
+
+void RowHandler::startRow(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+}
+
+void RowHandler::endRow()
+{
+ m_parent->setDelegate(0);
+}
+
+void RowHandler::startEntry(const QXmlAttributes& attrib)
+{
+ EntryHandler *eh = new EntryHandler(this);
+ eh->startEntry(attrib);
+ m_children.append(eh);
+}
+
+IDocIterator *RowHandler::entries() const
+{
+ return new RowIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// TableHandler
+//----------------------------------------------------------------------
+
+TableHandler::TableHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("table",this,&TableHandler::endTable);
+ addStartHandler("row",this,&TableHandler::startRow);
+ addStartHandler("caption",this,&TableHandler::startCaption);
+ addEndHandler("caption",this,&TableHandler::endCaption);
+}
+
+TableHandler::~TableHandler()
+{
+}
+
+void TableHandler::startTable(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_numColumns = attrib.value("cols").toInt();
+ debug(2,"table cols=%d\n",m_numColumns);
+}
+
+void TableHandler::endTable()
+{
+ m_parent->setDelegate(0);
+}
+
+void TableHandler::startRow(const QXmlAttributes& attrib)
+{
+ RowHandler *rh = new RowHandler(this);
+ rh->startRow(attrib);
+ m_children.append(rh);
+}
+
+void TableHandler::startCaption(const QXmlAttributes& /*attrib*/)
+{
+ m_curString="";
+}
+
+void TableHandler::endCaption()
+{
+ m_caption = m_curString;
+}
+
+IDocIterator *TableHandler::rows() const
+{
+ return new TableIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// CopyHandler
+//----------------------------------------------------------------------
+
+CopyHandler::CopyHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+
+ addEndHandler("copydoc",this,&CopyHandler::endCopy);
+
+ addStartHandler("para",this,&CopyHandler::startParagraph);
+}
+
+CopyHandler::~CopyHandler()
+{
+}
+
+void CopyHandler::startCopy(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start copy handler\n");
+}
+
+void CopyHandler::endCopy()
+{
+ debug(2,"end copy handler\n");
+ m_parent->setDelegate(0);
+}
+
+void CopyHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *parHandler = new ParagraphHandler(this);
+ parHandler->startParagraph(attrib);
+ m_children.append(parHandler);
+}
+
+IDocIterator *CopyHandler::contents() const
+{
+ return new CopyIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// VerbatimHandler
+//----------------------------------------------------------------------
+
+VerbatimHandler::VerbatimHandler(IBaseHandler *parent)
+ : m_parent(parent), m_type(IDocVerbatim::Invalid)
+{
+ addEndHandler("verbatim",this,&VerbatimHandler::endVerbatim);
+ addEndHandler("latexonly",this,&VerbatimHandler::endVerbatim);
+ addEndHandler("htmlonly",this,&VerbatimHandler::endVerbatim);
+}
+
+VerbatimHandler::~VerbatimHandler()
+{
+}
+
+void VerbatimHandler::startVerbatim(const QXmlAttributes&,Types type)
+{
+ m_type = type;
+ m_parent->setDelegate(this);
+ m_curString="";
+}
+
+void VerbatimHandler::endVerbatim()
+{
+ m_text = m_curString;
+ m_parent->setDelegate(0);
+}
+
+
+//----------------------------------------------------------------------
+// SymbolHandler
+//----------------------------------------------------------------------
+
+SymbolHandler::SymbolHandler(IBaseHandler *parent,Types type)
+ : m_parent(parent), m_letter('\0'), m_type(type)
+{
+ addEndHandler("symbol");
+ switch (type)
+ {
+ case IDocSymbol::Invalid: m_typeString="invalid"; break;
+ case IDocSymbol::Umlaut: m_typeString="umlaut"; break;
+ case IDocSymbol::Acute: m_typeString="acute"; break;
+ case IDocSymbol::Grave: m_typeString="grave"; break;
+ case IDocSymbol::Circ: m_typeString="circ"; break;
+ case IDocSymbol::Tilde: m_typeString="tilde"; break;
+ case IDocSymbol::Szlig: m_typeString="szlig"; break;
+ case IDocSymbol::Cedil: m_typeString="cedil"; break;
+ case IDocSymbol::Ring: m_typeString="ring"; break;
+ case IDocSymbol::Nbsp: m_typeString="nbsp"; break;
+ case IDocSymbol::Copy: m_typeString="copy"; break;
+ }
+}
+
+SymbolHandler::~SymbolHandler()
+{
+}
+
+void SymbolHandler::startSymbol(const QXmlAttributes& attrib)
+{
+ QString ls = attrib.value("char");
+ if (!ls.isEmpty()) m_letter = ls.latin1()[0];
+}
+
+//----------------------------------------------------------------------
+// ParagraphHandler
+//----------------------------------------------------------------------
+
+ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+
+ m_markupHandler = new MarkupHandler(m_children,m_curString);
+
+ // preformatted
+ setFallBackHandler(m_markupHandler);
+
+ addEndHandler("para",this,&ParagraphHandler::endParagraph);
+
+ addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak);
+ addStartHandler("hruler",this,&ParagraphHandler::startHRuler);
+ addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing);
+ addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim);
+ addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
+ addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList);
+ addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList);
+ addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect);
+ // TODO: title
+ addStartHandler("variablelist",this,&ParagraphHandler::startVariableList);
+ addStartHandler("table",this,&ParagraphHandler::startTable);
+ // TODO: heading
+ addStartHandler("image",this,&ParagraphHandler::startImage);
+ addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
+ addStartHandler("toclist",this,&ParagraphHandler::startTocList);
+ // TODO: language???
+ addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList);
+ // TODO: xrefsect
+ addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc);
+
+ addStartHandler("ref",this,&ParagraphHandler::startRef);
+ addStartHandler("ulink",this,&ParagraphHandler::startULink);
+ addStartHandler("email",this,&ParagraphHandler::startEMail);
+ addStartHandler("link",this,&ParagraphHandler::startLink);
+ addStartHandler("formula",this,&ParagraphHandler::startFormula);
+ addStartHandler("latexonly",this,&ParagraphHandler::startHtmlOnly);
+ addStartHandler("htmlonly",this,&ParagraphHandler::startLatexOnly);
+ addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut);
+ addStartHandler("acute",this,&ParagraphHandler::startAcute);
+ addStartHandler("grave",this,&ParagraphHandler::startGrave);
+ addStartHandler("circ",this,&ParagraphHandler::startCirc);
+ addStartHandler("tilde",this,&ParagraphHandler::startTilde);
+ addStartHandler("szlig",this,&ParagraphHandler::startSzlig);
+ addStartHandler("cedil",this,&ParagraphHandler::startCedil);
+ addStartHandler("ring",this,&ParagraphHandler::startRing);
+ addStartHandler("nbsp",this,&ParagraphHandler::startNbsp);
+ addStartHandler("copy",this,&ParagraphHandler::startCopy);
+ addStartHandler("anchor",this,&ParagraphHandler::startAnchor);
+}
+
+ParagraphHandler::~ParagraphHandler()
+{
+ delete m_markupHandler;
+}
+
+void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"para\n");
+}
+
+void ParagraphHandler::endParagraph()
+{
+ addTextNode();
+ debug(2,"end para\n");
+ m_parent->setDelegate(0);
+}
+
+void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ ItemizedListHandler *listHandler = new ItemizedListHandler(this);
+ listHandler->startItemizedList(attrib);
+ m_children.append(listHandler);
+}
+
+void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ OrderedListHandler *listHandler = new OrderedListHandler(this);
+ listHandler->startOrderedList(attrib);
+ m_children.append(listHandler);
+}
+
+void ParagraphHandler::startParameterList(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ ParameterListHandler *listHandler = new ParameterListHandler(this);
+ listHandler->startParameterList(attrib);
+ m_children.append(listHandler);
+}
+
+void ParagraphHandler::startSimpleSect(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SimpleSectHandler *sectHandler = new SimpleSectHandler(this);
+ sectHandler->startSimpleSect(attrib);
+ m_children.append(sectHandler);
+}
+
+void ParagraphHandler::startRef(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ RefHandler *ref = new RefHandler(this);
+ ref->startRef(attrib);
+ m_children.append(ref);
+}
+
+void ParagraphHandler::startVariableList(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ VariableListHandler *vl = new VariableListHandler(this);
+ vl->startVariableList(attrib);
+ m_children.append(vl);
+}
+
+void ParagraphHandler::startHRuler(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ HRulerHandler *hr = new HRulerHandler(this);
+ hr->startHRuler(attrib);
+ m_children.append(hr);
+}
+
+void ParagraphHandler::startLineBreak(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ LineBreakHandler *lb = new LineBreakHandler(this);
+ lb->startLineBreak(attrib);
+ m_children.append(lb);
+}
+
+void ParagraphHandler::startULink(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ ULinkHandler *uh = new ULinkHandler(this);
+ uh->startULink(attrib);
+ m_children.append(uh);
+}
+
+void ParagraphHandler::startEMail(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ EMailHandler *eh = new EMailHandler(this);
+ eh->startEMail(attrib);
+ m_children.append(eh);
+}
+
+void ParagraphHandler::startLink(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ LinkHandler *lh = new LinkHandler(this);
+ lh->startLink(attrib);
+ m_children.append(lh);
+}
+
+void ParagraphHandler::startProgramListing(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ ProgramListingHandler *pl = new ProgramListingHandler(this);
+ pl->startProgramListing(attrib);
+ m_children.append(pl);
+}
+
+void ParagraphHandler::startFormula(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ FormulaHandler *fh = new FormulaHandler(this);
+ fh->startFormula(attrib);
+ m_children.append(fh);
+}
+
+void ParagraphHandler::startImage(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ ImageHandler *ih = new ImageHandler(this);
+ ih->startImage(attrib);
+ m_children.append(ih);
+}
+
+void ParagraphHandler::startDotFile(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ DotFileHandler *df = new DotFileHandler(this);
+ df->startDotFile(attrib);
+ m_children.append(df);
+}
+
+void ParagraphHandler::startIndexEntry(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ IndexEntryHandler *df = new IndexEntryHandler(this);
+ df->startIndexEntry(attrib);
+ m_children.append(df);
+}
+
+void ParagraphHandler::startTable(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ TableHandler *th = new TableHandler(this);
+ th->startTable(attrib);
+ m_children.append(th);
+}
+
+void ParagraphHandler::startVerbatim(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ VerbatimHandler *vh = new VerbatimHandler(this);
+ vh->startVerbatim(attrib,IDocVerbatim::Verbatim);
+ m_children.append(vh);
+}
+
+void ParagraphHandler::startHtmlOnly(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ VerbatimHandler *vh = new VerbatimHandler(this);
+ vh->startVerbatim(attrib,IDocVerbatim::HtmlOnly);
+ m_children.append(vh);
+}
+
+void ParagraphHandler::startLatexOnly(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ VerbatimHandler *vh = new VerbatimHandler(this);
+ vh->startVerbatim(attrib,IDocVerbatim::LatexOnly);
+ m_children.append(vh);
+}
+
+void ParagraphHandler::startUmlaut(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Umlaut);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startAcute(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Acute);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startGrave(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Grave);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startCirc(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Circ);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startTilde(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Tilde);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startSzlig(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Szlig);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startCedil(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Cedil);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startRing(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Ring);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startNbsp(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Nbsp);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startCopy(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Copy);
+ sh->startSymbol(attrib);
+ m_children.append(sh);
+}
+
+void ParagraphHandler::startAnchor(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ AnchorHandler *ah = new AnchorHandler(this);
+ ah->startAnchor(attrib);
+ m_children.append(ah);
+}
+
+void ParagraphHandler::startCopyDoc(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ CopyHandler *ch = new CopyHandler(this);
+ ch->startCopy(attrib);
+ m_children.append(ch);
+}
+
+void ParagraphHandler::startTocList(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ TocListHandler *th = new TocListHandler(this);
+ th->startTocList(attrib);
+ m_children.append(th);
+}
+
+void ParagraphHandler::addTextNode()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(
+ new TextNode(
+ m_curString,
+ m_markupHandler->markup(),
+ m_markupHandler->headingLevel()
+ )
+ );
+ debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
+ m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
+ m_curString="";
+ }
+}
+
+IDocIterator *ParagraphHandler::contents() const
+{
+ return new ParagraphIterator(*this);
+}
+
+//----------------------------------------------------------------------
+// DocSectionHandler
+//----------------------------------------------------------------------
+
+DocSectionHandler::DocSectionHandler(IBaseHandler *parent,int level)
+ : m_parent(parent), m_internal(0), m_level(level), m_title(0)
+{
+ QString sectionKey;
+ m_paragraphs.setAutoDelete(TRUE);
+ m_subsections.setAutoDelete(TRUE);
+ addStartHandler("title",this,&DocSectionHandler::startTitle);
+ addStartHandler("para",this,&DocSectionHandler::startParagraph);
+ if (level<6)
+ {
+ sectionKey.sprintf("sect%d",level+1);
+ addStartHandler(sectionKey,this,&DocSectionHandler::startSubSection);
+ }
+ addStartHandler("internal",this,&DocSectionHandler::startInternal);
+ sectionKey.sprintf("sect%d",level);
+ addEndHandler(sectionKey,this,&DocSectionHandler::endDocSection);
+}
+
+DocSectionHandler::~DocSectionHandler()
+{
+}
+
+void DocSectionHandler::startDocSection(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start docsection\n");
+ m_id = attrib.value("id");
+}
+
+void DocSectionHandler::endDocSection()
+{
+ m_parent->setDelegate(0);
+ debug(2,"End docsection\n");
+}
+
+void DocSectionHandler::startSubSection(const QXmlAttributes& attrib)
+{
+ DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
+ secHandler->startDocSection(attrib);
+ m_subsections.append(secHandler);
+}
+
+void DocSectionHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *parHandler = new ParagraphHandler(this);
+ parHandler->startParagraph(attrib);
+ m_paragraphs.append(parHandler);
+}
+
+void DocSectionHandler::startInternal(const QXmlAttributes& attrib)
+{
+ m_internal = new DocInternalHandler(this,m_level);
+ m_internal->startInternal(attrib);
+}
+
+void DocSectionHandler::startTitle(const QXmlAttributes& attrib)
+{
+ m_title = new TitleHandler(this);
+ m_title->startTitle(attrib);
+}
+
+IDocIterator *DocSectionHandler::paragraphs() const
+{
+ return new DocSectionParaIterator(*this);
+}
+
+IDocIterator *DocSectionHandler::subSections() const
+{
+ return new DocSectionSubIterator(*this);
+}
+
+IDocInternal *DocSectionHandler::internal() const
+{
+ return m_internal;
+}
+
+//----------------------------------------------------------------------
+// DocInternal
+//----------------------------------------------------------------------
+
+DocInternalHandler::DocInternalHandler(IBaseHandler *parent,int level)
+ : m_parent(parent), m_level(level)
+{
+ m_paragraphs.setAutoDelete(TRUE);
+ m_subsections.setAutoDelete(TRUE);
+ addStartHandler("para",this,&DocInternalHandler::startParagraph);
+ QString sectionKey;
+ sectionKey.sprintf("sect%d",level+1);
+ addStartHandler(sectionKey,this,&DocInternalHandler::startSubSection);
+ addEndHandler("internal",this,&DocInternalHandler::endInternal);
+}
+
+DocInternalHandler::~DocInternalHandler()
+{
+}
+
+void DocInternalHandler::startInternal(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+ debug(2,"Start internal\n");
+}
+
+void DocInternalHandler::endInternal()
+{
+ m_parent->setDelegate(0);
+ debug(2,"End internal\n");
+}
+
+void DocInternalHandler::startSubSection(const QXmlAttributes& attrib)
+{
+ DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
+ secHandler->startDocSection(attrib);
+ m_subsections.append(secHandler);
+}
+
+void DocInternalHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *parHandler = new ParagraphHandler(this);
+ parHandler->startParagraph(attrib);
+ m_paragraphs.append(parHandler);
+}
+
+IDocIterator *DocInternalHandler::paragraphs() const
+{
+ return new DocInternalParaIterator(*this);
+}
+
+IDocIterator *DocInternalHandler::subSections() const
+{
+ return new DocInternalSubIterator(*this);
+}
+
+
+//----------------------------------------------------------------------
+// DocHandler
+//----------------------------------------------------------------------
+
+DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+
+ addEndHandler("briefdescription",this,&DocHandler::endDoc);
+ addEndHandler("detaileddescription",this,&DocHandler::endDoc);
+ addEndHandler("inbodydescription",this,&DocHandler::endDoc);
+ //addEndHandler("internal"); // TODO: implement this as a section
+ addStartHandler("internal",this,&DocHandler::startInternal);
+
+ addStartHandler("para",this,&DocHandler::startParagraph);
+ addStartHandler("sect1",this,&DocHandler::startSect1);
+ addStartHandler("title",this,&DocHandler::startTitle);
+ //addStartHandler("internal");
+}
+
+DocHandler::~DocHandler()
+{
+}
+
+void DocHandler::startDoc(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"start dochandler\n");
+}
+
+void DocHandler::endDoc()
+{
+ debug(2,"end dochandler\n");
+ m_parent->setDelegate(0);
+}
+
+void DocHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *parHandler = new ParagraphHandler(this);
+ parHandler->startParagraph(attrib);
+ m_children.append(parHandler);
+}
+
+void DocHandler::startSect1(const QXmlAttributes& attrib)
+{
+ DocSectionHandler *secHandler = new DocSectionHandler(this,1);
+ secHandler->startDocSection(attrib);
+ m_children.append(secHandler);
+}
+
+void DocHandler::startTitle(const QXmlAttributes& attrib)
+{
+ TitleHandler *titleHandler = new TitleHandler(this);
+ titleHandler->startTitle(attrib);
+ m_children.append(titleHandler);
+}
+
+void DocHandler::startInternal(const QXmlAttributes& attrib)
+{
+ m_internal = new DocInternalHandler(this,1);
+ m_internal->startInternal(attrib);
+}
+
+IDocIterator *DocHandler::contents() const
+{
+ return new DocIterator(*this);
+}
+
+IDocInternal *DocHandler::internal() const
+{
+ return m_internal;
+}
+
diff --git a/trunk/addon/doxmlparser/src/dochandler.h b/trunk/addon/doxmlparser/src/dochandler.h
new file mode 100644
index 0000000..77fa379
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/dochandler.h
@@ -0,0 +1,1352 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _DOCHANDLER_H
+#define _DOCHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <qxml.h>
+
+#include <doxmlintf.h>
+#include "stringimpl.h"
+#include "basehandler.h"
+#include "baseiterator.h"
+
+class ParagraphHandler;
+class DocInternalHandler;
+class LinkedTextImpl;
+class LinkedTextHandler;
+
+//-----------------------------------------------------------------------------
+
+class DocImpl : public IDoc { public: virtual ~DocImpl() {} };
+
+#define DEFINE_CLS_IMPL(cls) \
+ class cls##Impl : public I##cls, public DocImpl { public: virtual ~cls##Impl() {} }
+
+DEFINE_CLS_IMPL(DocMarkup);
+DEFINE_CLS_IMPL(DocPara);
+DEFINE_CLS_IMPL(DocText);
+DEFINE_CLS_IMPL(DocMarkupModifier);
+DEFINE_CLS_IMPL(DocItemizedList);
+DEFINE_CLS_IMPL(DocOrderedList);
+DEFINE_CLS_IMPL(DocListItem);
+DEFINE_CLS_IMPL(DocParameterList);
+DEFINE_CLS_IMPL(DocParameterItem);
+DEFINE_CLS_IMPL(DocParameter);
+DEFINE_CLS_IMPL(DocTitle);
+DEFINE_CLS_IMPL(DocSimpleSect);
+DEFINE_CLS_IMPL(DocRef);
+DEFINE_CLS_IMPL(DocVariableList);
+DEFINE_CLS_IMPL(DocVariableListEntry);
+DEFINE_CLS_IMPL(DocHRuler);
+DEFINE_CLS_IMPL(DocLineBreak);
+DEFINE_CLS_IMPL(DocULink);
+DEFINE_CLS_IMPL(DocEMail);
+DEFINE_CLS_IMPL(DocLink);
+DEFINE_CLS_IMPL(DocProgramListing);
+DEFINE_CLS_IMPL(DocCodeLine);
+DEFINE_CLS_IMPL(DocHighlight);
+DEFINE_CLS_IMPL(DocFormula);
+DEFINE_CLS_IMPL(DocImage);
+DEFINE_CLS_IMPL(DocDotFile);
+DEFINE_CLS_IMPL(DocIndexEntry);
+DEFINE_CLS_IMPL(DocTable);
+DEFINE_CLS_IMPL(DocRow);
+DEFINE_CLS_IMPL(DocEntry);
+DEFINE_CLS_IMPL(DocSection);
+DEFINE_CLS_IMPL(DocVerbatim);
+DEFINE_CLS_IMPL(DocCopy);
+DEFINE_CLS_IMPL(DocTocList);
+DEFINE_CLS_IMPL(DocTocItem);
+DEFINE_CLS_IMPL(DocAnchor);
+DEFINE_CLS_IMPL(DocSymbol);
+DEFINE_CLS_IMPL(DocInternal);
+DEFINE_CLS_IMPL(DocRoot);
+
+//-----------------------------------------------------------------------------
+
+
+/*! \brief Node representing a piece of text.
+ *
+ */
+class TextNode : public DocTextImpl
+{
+ public:
+ TextNode(const QString &t,int markup,int level)
+ : m_text(t), m_markup(markup), m_headingLevel(level) {}
+ virtual ~TextNode() {}
+
+ // IDocText
+ virtual Kind kind() const { return DocImpl::Text; }
+ virtual const IString *text() const { return &m_text; }
+ virtual int markup() const { return m_markup; }
+ virtual int headingLevel() const { return m_headingLevel; }
+
+ private:
+ StringImpl m_text;
+ int m_markup;
+ int m_headingLevel;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a change in the markup style.
+ *
+ */
+class MarkupModifierNode : public DocMarkupModifierImpl
+{
+ public:
+ MarkupModifierNode(int markup,bool enabled,int level=0)
+ : m_markup(markup), m_enabled(enabled), m_headingLevel(level) {}
+ virtual ~MarkupModifierNode() {}
+
+ // IDocMarkupModifier
+ virtual Kind kind() const { return DocImpl::MarkupModifier; }
+ virtual bool enabled() const { return m_enabled; }
+ virtual int markup() const { return m_markup; }
+ virtual int headingLevel() const { return m_headingLevel; }
+
+ private:
+ int m_markup;
+ bool m_enabled;
+ int m_headingLevel;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Handles markup commands in the XML input.
+ *
+ */
+class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
+{
+ public:
+ MarkupHandler(QList<DocImpl> &children,QString &curString);
+ virtual ~MarkupHandler();
+ int markup() const { return m_curMarkup; }
+ int headingLevel() const { return m_headingLevel; }
+
+ virtual void startBold(const QXmlAttributes &attrib);
+ virtual void endBold();
+ virtual void startEmphasis(const QXmlAttributes &attrib);
+ virtual void endEmphasis();
+ virtual void startComputerOutput(const QXmlAttributes &attrib);
+ virtual void endComputerOutput();
+ virtual void startCenter(const QXmlAttributes &attrib);
+ virtual void endCenter();
+ virtual void startSmallFont(const QXmlAttributes &attrib);
+ virtual void endSmallFont();
+ virtual void startSubscript(const QXmlAttributes &attrib);
+ virtual void endSubscript();
+ virtual void startSuperscript(const QXmlAttributes &attrib);
+ virtual void endSuperscript();
+ virtual void startPreformatted(const QXmlAttributes &attrib);
+ virtual void endPreformatted();
+ virtual void startHeading1(const QXmlAttributes &attrib);
+ virtual void endHeading1();
+ virtual void startHeading2(const QXmlAttributes &attrib);
+ virtual void endHeading2();
+ virtual void startHeading3(const QXmlAttributes &attrib);
+ virtual void endHeading3();
+ virtual void startHeading4(const QXmlAttributes &attrib);
+ virtual void endHeading4();
+ virtual void startHeading5(const QXmlAttributes &attrib);
+ virtual void endHeading5();
+ virtual void startHeading6(const QXmlAttributes &attrib);
+ virtual void endHeading6();
+
+
+ private:
+ void addTextNode();
+
+ QList<DocImpl> &m_children;
+ QString &m_curString;
+ int m_curMarkup;
+ int m_headingLevel;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a paragraph of text and commands.
+ *
+ */
+// children: itemizedlist, orderedlist, parameterlist, simplesect, ref,
+// variablelist, hruler, linebreak, ulink, email, link
+// programlisting, formula, image, dotfile, indexentry,
+// table
+//
+// children handled by MarkupHandler:
+// bold, computeroutput, emphasis, center,
+// small, subscript, superscript.
+//
+class ParagraphHandler : public DocParaImpl,
+ public BaseHandler<ParagraphHandler>
+{
+ friend class ParagraphIterator;
+
+ public:
+ virtual void startParagraph(const QXmlAttributes& attrib);
+ virtual void endParagraph();
+ virtual void startItemizedList(const QXmlAttributes& attrib);
+ virtual void startOrderedList(const QXmlAttributes& attrib);
+ virtual void startParameterList(const QXmlAttributes& attrib);
+ virtual void startSimpleSect(const QXmlAttributes& attrib);
+ virtual void startRef(const QXmlAttributes& attrib);
+ virtual void startVariableList(const QXmlAttributes& attrib);
+ virtual void startHRuler(const QXmlAttributes& attrib);
+ virtual void startLineBreak(const QXmlAttributes& attrib);
+ virtual void startULink(const QXmlAttributes& attrib);
+ virtual void startEMail(const QXmlAttributes& attrib);
+ virtual void startLink(const QXmlAttributes& attrib);
+ virtual void startProgramListing(const QXmlAttributes& attrib);
+ virtual void startFormula(const QXmlAttributes& attrib);
+ virtual void startImage(const QXmlAttributes& attrib);
+ virtual void startDotFile(const QXmlAttributes& attrib);
+ virtual void startIndexEntry(const QXmlAttributes& attrib);
+ virtual void startTable(const QXmlAttributes& attrib);
+ virtual void startVerbatim(const QXmlAttributes& attrib);
+ virtual void startHtmlOnly(const QXmlAttributes& attrib);
+ virtual void startLatexOnly(const QXmlAttributes& attrib);
+ virtual void startUmlaut(const QXmlAttributes& attrib);
+ virtual void startAcute(const QXmlAttributes& attrib);
+ virtual void startGrave(const QXmlAttributes& attrib);
+ virtual void startCirc(const QXmlAttributes& attrib);
+ virtual void startTilde(const QXmlAttributes& attrib);
+ virtual void startSzlig(const QXmlAttributes& attrib);
+ virtual void startCedil(const QXmlAttributes& attrib);
+ virtual void startRing(const QXmlAttributes& attrib);
+ virtual void startNbsp(const QXmlAttributes& attrib);
+ virtual void startCopy(const QXmlAttributes& attrib);
+ virtual void startAnchor(const QXmlAttributes& attrib);
+ virtual void startCopyDoc(const QXmlAttributes& attrib);
+ virtual void startTocList(const QXmlAttributes& attrib);
+
+ ParagraphHandler(IBaseHandler *parent);
+ virtual ~ParagraphHandler();
+
+ // IDocPara
+ virtual Kind kind() const { return DocImpl::Para; }
+ virtual IDocIterator *contents() const;
+
+ private:
+ void addTextNode();
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+ MarkupHandler *m_markupHandler;
+};
+
+class ParagraphIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ ParagraphIterator(const ParagraphHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a list item.
+ *
+ */
+class ListItemHandler : public DocListItemImpl, public BaseHandler<ListItemHandler>
+{
+ friend class ListItemIterator;
+ public:
+ ListItemHandler(IBaseHandler *parent);
+ virtual ~ListItemHandler();
+ virtual void startListItem(const QXmlAttributes& attrib);
+ virtual void endListItem();
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocItem
+ virtual Kind kind() const { return DocImpl::ListItem; }
+ virtual IDocIterator *contents() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class ListItemIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ ListItemIterator(const ListItemHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing list of items.
+ *
+ */
+class OrderedListHandler : public DocOrderedListImpl, public BaseHandler<OrderedListHandler>
+{
+ friend class OrderedListIterator;
+ public:
+ OrderedListHandler(IBaseHandler *parent);
+ virtual ~OrderedListHandler();
+ virtual void startOrderedList(const QXmlAttributes& attrib);
+ virtual void endOrderedList();
+ virtual void startOrderedListItem(const QXmlAttributes& attrib);
+
+ // IDocOrderedList
+ virtual Kind kind() const { return DocImpl::OrderedList; }
+ virtual IDocIterator *elements() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class OrderedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ OrderedListIterator(const OrderedListHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing table of contents list.
+ *
+ */
+class TocListHandler : public DocTocListImpl, public BaseHandler<TocListHandler>
+{
+ friend class TocListIterator;
+ public:
+ TocListHandler(IBaseHandler *parent);
+ virtual ~TocListHandler();
+ virtual void startTocList(const QXmlAttributes& attrib);
+ virtual void endTocList();
+ virtual void startTocItem(const QXmlAttributes& attrib);
+
+ // IDocTocList
+ virtual Kind kind() const { return DocImpl::TocList; }
+ virtual IDocIterator *elements() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class TocListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ TocListIterator(const TocListHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a table of contents item.
+ *
+ */
+class TocItemHandler : public DocTocItemImpl, public BaseHandler<TocItemHandler>
+{
+ friend class TocItemIterator;
+ public:
+ TocItemHandler(IBaseHandler *parent);
+ virtual ~TocItemHandler();
+ virtual void startTocItem(const QXmlAttributes& attrib);
+ virtual void endTocItem();
+
+ // IDocItem
+ virtual Kind kind() const { return DocImpl::TocItem; }
+ virtual const IString *id() const { return &m_id; }
+ virtual const IString *title() const { return &m_title; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_id;
+ StringImpl m_title;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing list of items.
+ *
+ */
+class ItemizedListHandler : public DocItemizedListImpl, public BaseHandler<ItemizedListHandler>
+{
+ friend class ItemizedListIterator;
+ public:
+ ItemizedListHandler(IBaseHandler *parent);
+ virtual ~ItemizedListHandler();
+ virtual void startItemizedList(const QXmlAttributes& attrib);
+ virtual void endItemizedList();
+ virtual void startItemizedListItem(const QXmlAttributes& attrib);
+
+ // IDocItemizedList
+ virtual Kind kind() const { return DocImpl::ItemizedList; }
+ virtual IDocIterator *elements() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class ItemizedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ ItemizedListIterator(const ItemizedListHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+
+//-----------------------------------------------------------------------------
+/*! \brief Node representing a parameter.
+ *
+ */
+class ParameterHandler : public DocParameterImpl,
+ public BaseHandler<ParameterHandler>
+{
+ public:
+ ParameterHandler(IBaseHandler *parent);
+ virtual ~ParameterHandler();
+ virtual void startParameterName(const QXmlAttributes& attrib);
+ virtual void endParameterName();
+
+ // IDocParameter
+ virtual Kind kind() const { return DocImpl::Parameter; }
+ virtual const IString *name() const { return &m_name; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_name;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a list of param names with a single description.
+ *
+ */
+class ParameterItemHandler : public DocParameterItemImpl,
+ public BaseHandler<ParameterItemHandler>
+{
+ friend class ParameterItemIterator;
+ public:
+ ParameterItemHandler(IBaseHandler *parent);
+ virtual ~ParameterItemHandler();
+ virtual void startParameterItem(const QXmlAttributes& attrib);
+ virtual void endParameterItem();
+ virtual void startParameterName(const QXmlAttributes& attrib);
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocParameterItem
+ virtual Kind kind() const { return DocImpl::ParameterItem; }
+ virtual IDocIterator *paramNames() const;
+ virtual IDocPara *description() const { return m_description; }
+
+ private:
+ IBaseHandler *m_parent;
+ QList<ParameterHandler> m_parameters;
+ ParagraphHandler *m_description;
+};
+
+class ParameterItemIterator : public BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>
+{
+ public:
+ ParameterItemIterator(const ParameterItemHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>(handler.m_parameters) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a parameter section.
+ *
+ */
+class ParameterListHandler : public DocParameterListImpl,
+ public BaseHandler<ParameterListHandler>
+{
+ friend class ParameterListIterator;
+ public:
+ ParameterListHandler(IBaseHandler *parent);
+ virtual ~ParameterListHandler();
+ virtual void startParameterList(const QXmlAttributes& attrib);
+ virtual void endParameterList();
+ virtual void startParameterItem(const QXmlAttributes& attrib);
+
+ // IDocParameterList
+ virtual Kind kind() const { return DocImpl::ParameterList; }
+ virtual Types sectType() const { return m_type; }
+ virtual IDocIterator *params() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<ParameterItemHandler> m_paramItems;
+ Types m_type;
+};
+
+class ParameterListIterator : public BaseIteratorVia<IDocIterator,IDoc,ParameterItemHandler,DocImpl>
+{
+ public:
+ ParameterListIterator(const ParameterListHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,ParameterItemHandler,DocImpl>(handler.m_paramItems) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a horizontal ruler
+ *
+ */
+class LineBreakHandler : public DocLineBreakImpl, public BaseHandler<LineBreakHandler>
+{
+ public:
+ LineBreakHandler(IBaseHandler *parent);
+ virtual ~LineBreakHandler();
+
+ void startLineBreak(const QXmlAttributes& attrib);
+ void endLineBreak();
+
+ // IDocLineBreak
+ virtual Kind kind() const { return DocImpl::LineBreak; }
+
+ private:
+ IBaseHandler *m_parent;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a link to section
+ *
+ */
+class LinkHandler : public DocLinkImpl, public BaseHandler<LinkHandler>
+{
+ public:
+ LinkHandler(IBaseHandler *parent);
+ virtual ~LinkHandler();
+
+ void startLink(const QXmlAttributes& attrib);
+ void endLink();
+
+ // IDocLink
+ virtual Kind kind() const { return DocImpl::Link; }
+ virtual const IString *refId() const { return &m_ref; }
+ virtual const IString *text() const { return &m_text; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_ref;
+ StringImpl m_text;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a link to an email address
+ *
+ */
+class EMailHandler : public DocEMailImpl, public BaseHandler<EMailHandler>
+{
+ public:
+ EMailHandler(IBaseHandler *parent);
+ virtual ~EMailHandler();
+
+ void startEMail(const QXmlAttributes& attrib);
+ void endEMail();
+
+ // IDocEMail
+ virtual Kind kind() const { return DocImpl::EMail; }
+ virtual const IString *address() const { return &m_address; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_address;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a link to an URL
+ *
+ */
+class ULinkHandler : public DocULinkImpl, public BaseHandler<ULinkHandler>
+{
+ public:
+ ULinkHandler(IBaseHandler *parent);
+ virtual ~ULinkHandler();
+
+ void startULink(const QXmlAttributes& attrib);
+ void endULink();
+
+ // IDocULink
+ virtual Kind kind() const { return DocImpl::ULink; }
+ virtual const IString * url() const { return &m_url; }
+ virtual const IString * text() const { return &m_text; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_url;
+ StringImpl m_text;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a horizontal ruler
+ *
+ */
+class HRulerHandler : public DocHRulerImpl, public BaseHandler<HRulerHandler>
+{
+ public:
+ HRulerHandler(IBaseHandler *parent);
+ virtual ~HRulerHandler();
+
+ void startHRuler(const QXmlAttributes& attrib);
+ void endHRuler();
+
+ // IDocHRuler
+ virtual Kind kind() const { return DocImpl::HRuler; }
+
+ private:
+ IBaseHandler *m_parent;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a reference to another item
+ *
+ */
+class RefHandler : public DocRefImpl, public BaseHandler<RefHandler>
+{
+ public:
+ RefHandler(IBaseHandler *parent);
+ virtual ~RefHandler();
+ void startRef(const QXmlAttributes& attrib);
+ void endRef();
+
+ // IDocRef
+ virtual Kind kind() const { return DocImpl::Ref; }
+ virtual const IString *refId() const { return &m_refId; }
+ virtual TargetKind targetKind() const { return m_targetKind; }
+ virtual const IString *external() const { return &m_extId; }
+ virtual const IString *text() const { return &m_linkText; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_refId;
+ StringImpl m_extId;
+ StringImpl m_linkText;
+ TargetKind m_targetKind;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing the title of a section
+ *
+ */
+// children: text, ref
+// children handled by MarkupHandler:
+// bold, computeroutput, emphasis, center,
+// small, subscript, superscript.
+class TitleHandler : public DocTitleImpl, public BaseHandler<TitleHandler>
+{
+ friend class TitleIterator;
+ public:
+ TitleHandler(IBaseHandler *parent);
+ virtual ~TitleHandler();
+ virtual void startTitle(const QXmlAttributes& attrib);
+ virtual void endTitle();
+ virtual void startRef(const QXmlAttributes& attrib);
+ void addTextNode();
+
+ // IDocTitle
+ virtual Kind kind() const { return DocImpl::Title; }
+ virtual IDocIterator *title() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+ MarkupHandler *m_markupHandler;
+};
+
+class TitleIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ TitleIterator(const TitleHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing a simple section with an unnumbered header.
+ *
+ */
+// children: title, para
+class SimpleSectHandler : public DocSimpleSectImpl,
+ public BaseHandler<SimpleSectHandler>
+{
+ public:
+ SimpleSectHandler(IBaseHandler *parent);
+ virtual ~SimpleSectHandler();
+ virtual void startSimpleSect(const QXmlAttributes& attrib);
+ virtual void endSimpleSect();
+ virtual void startTitle(const QXmlAttributes& attrib);
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocSimpleSect
+ virtual Kind kind() const { return DocImpl::SimpleSect; }
+ virtual Types type() const { return m_type; }
+ virtual const IString *typeString() const { return &m_typeString; }
+ virtual IDocTitle *title() const { return m_title; }
+ virtual IDocPara *description() const { return m_paragraph; }
+
+ private:
+ IBaseHandler *m_parent;
+ ParagraphHandler *m_paragraph;
+ Types m_type;
+ StringImpl m_typeString;
+ TitleHandler *m_title;
+};
+
+//-----------------------------------------------------------------------------
+
+/* \brief Node representing an named item of a VariableList.
+ *
+ */
+class VariableListEntryHandler : public DocVariableListEntryImpl,
+ public BaseHandler<VariableListEntryHandler>
+{
+ public:
+ virtual void startVarListEntry(const QXmlAttributes& attrib);
+ virtual void endVarListEntry();
+ virtual void startListItem(const QXmlAttributes& attrib);
+ virtual void endListItem();
+ virtual void startTerm(const QXmlAttributes& attrib);
+ virtual void endTerm();
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ VariableListEntryHandler(IBaseHandler *parent);
+ virtual ~VariableListEntryHandler();
+
+ // IDocVariableListEntry
+ virtual Kind kind() const { return DocImpl::VariableListEntry; }
+ virtual ILinkedTextIterator *term() const;
+ virtual IDocPara *description() const { return m_description; }
+
+ private:
+ IBaseHandler* m_parent;
+ QList<LinkedTextImpl> m_term;
+ ParagraphHandler* m_description;
+ LinkedTextHandler* m_linkedTextHandler;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a list of named items.
+ *
+ */
+// children: varlistentry, listitem
+class VariableListHandler : public DocVariableListImpl,
+ public BaseHandler<VariableListHandler>
+{
+ friend class VariableListIterator;
+
+ public:
+ virtual void startVariableList(const QXmlAttributes& attrib);
+ virtual void endVariableList();
+ virtual void startVarListEntry(const QXmlAttributes& attrib);
+ virtual void startListItem(const QXmlAttributes& attrib);
+
+ VariableListHandler(IBaseHandler *parent);
+ virtual ~VariableListHandler();
+
+ // IDocVariableList
+ virtual Kind kind() const { return DocImpl::VariableList; }
+ virtual IDocIterator *entries() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<VariableListEntryHandler> m_entries;
+ VariableListEntryHandler *m_curEntry;
+};
+
+class VariableListIterator : public BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>
+{
+ public:
+ VariableListIterator(const VariableListHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>(handler.m_entries) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a highlighted text fragment.
+ *
+ */
+// children: ref
+class HighlightHandler : public DocHighlightImpl, public BaseHandler<HighlightHandler>
+{
+ friend class HighlightIterator;
+ public:
+ HighlightHandler(IBaseHandler *parent);
+ virtual ~HighlightHandler();
+ void startHighlight(const QXmlAttributes& attrib);
+ void endHighlight();
+ virtual void startRef(const QXmlAttributes&);
+ virtual void startSpace(const QXmlAttributes&);
+
+ // IDocHighlight
+ virtual Kind kind() const { return DocImpl::Highlight; }
+ virtual HighlightKind highlightKind() const { return m_hl; }
+ virtual IDocIterator *codeElements() const;
+
+ private:
+ void addTextNode();
+
+ IBaseHandler *m_parent;
+ HighlightKind m_hl;
+ QString m_hlString;
+ QList<DocImpl> m_children;
+};
+
+class HighlightIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ HighlightIterator(const HighlightHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a line of code.
+ *
+ */
+// children: linenumber, highlight, anchor, ref
+class CodeLineHandler : public DocCodeLineImpl, public BaseHandler<CodeLineHandler>
+{
+ friend class CodeLineIterator;
+ public:
+
+ virtual void startCodeLine(const QXmlAttributes&);
+ virtual void endCodeLine();
+ virtual void startLineNumber(const QXmlAttributes&);
+ virtual void endLineNumber();
+ virtual void startHighlight(const QXmlAttributes&);
+ virtual void startRef(const QXmlAttributes&);
+
+ CodeLineHandler(IBaseHandler *parent);
+ virtual ~CodeLineHandler();
+
+ // IDocCodeLine
+ virtual Kind kind() const { return DocImpl::CodeLine; }
+ virtual int lineNumber() const { return m_lineNumber; }
+ virtual const IString *refId() const { return &m_refId; }
+ virtual IDocIterator *codeElements() const;
+
+ private:
+ void addTextNode();
+
+ IBaseHandler *m_parent;
+ int m_lineNumber;
+ StringImpl m_refId;
+ QList<DocImpl> m_children;
+};
+
+class CodeLineIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ CodeLineIterator(const CodeLineHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a program listing
+ *
+ */
+// children: codeline, linenumber
+class ProgramListingHandler : public DocProgramListingImpl, public BaseHandler<ProgramListingHandler>
+{
+ friend class ProgramListingIterator;
+ public:
+ virtual void startProgramListing(const QXmlAttributes& attrib);
+ virtual void endProgramListing();
+ virtual void startCodeLine(const QXmlAttributes&);
+ virtual void startLineNumber(const QXmlAttributes&);
+
+ ProgramListingHandler(IBaseHandler *parent);
+ virtual ~ProgramListingHandler();
+
+ // IDocProgramListing
+ virtual Kind kind() const { return DocImpl::ProgramListing; }
+ virtual IDocIterator *codeLines() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<CodeLineHandler> m_children;
+ bool m_hasLineNumber;
+};
+
+//-----------------------------------------------------------------------------
+
+class ProgramListingIterator : public BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>
+{
+ public:
+ ProgramListingIterator(const ProgramListingHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a formula.
+ *
+ */
+// children: -
+class FormulaHandler : public DocFormulaImpl, public BaseHandler<FormulaHandler>
+{
+ public:
+ FormulaHandler(IBaseHandler *parent);
+ virtual ~FormulaHandler();
+ void startFormula(const QXmlAttributes& attrib);
+ void endFormula();
+
+ // IDocFormula
+ virtual Kind kind() const { return DocImpl::Formula; }
+ virtual const IString *id() const { return &m_id; }
+ virtual const IString *text() const { return &m_text; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_id;
+ StringImpl m_text;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an image.
+ *
+ */
+// children: -
+class ImageHandler : public DocImageImpl, public BaseHandler<ImageHandler>
+{
+ public:
+ ImageHandler(IBaseHandler *parent);
+ virtual ~ImageHandler();
+ void startImage(const QXmlAttributes& attrib);
+ void endImage();
+
+ // IDocImage
+ virtual Kind kind() const { return DocImpl::Image; }
+ virtual const IString *name() const { return &m_name; }
+ virtual const IString *caption() const { return &m_caption; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_name;
+ StringImpl m_caption;
+};
+
+
+//-----------------------------------------------------------------------------
+/*! \brief Node representing an anchor.
+ *
+ */
+// children: -
+class AnchorHandler : public DocAnchorImpl, public BaseHandler<AnchorHandler>
+{
+ public:
+ AnchorHandler(IBaseHandler *parent);
+ virtual ~AnchorHandler();
+ void startAnchor(const QXmlAttributes& attrib);
+ void endAnchor();
+
+ // IDocAnchor
+ virtual Kind kind() const { return DocImpl::Anchor; }
+ virtual const IString *id() const { return &m_id; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_id;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a dot file.
+ *
+ */
+// children: -
+class DotFileHandler : public DocDotFileImpl, public BaseHandler<DotFileHandler>
+{
+ public:
+ DotFileHandler(IBaseHandler *parent);
+ virtual ~DotFileHandler();
+ void startDotFile(const QXmlAttributes& attrib);
+ void endDotFile();
+
+ // IDocDotFile
+ virtual Kind kind() const { return DocImpl::DotFile; }
+ virtual const IString *name() const { return &m_name; }
+ virtual const IString *caption() const { return &m_caption; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_name;
+ StringImpl m_caption;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the index.
+ *
+ */
+// children: -
+class IndexEntryHandler : public DocIndexEntryImpl, public BaseHandler<IndexEntryHandler>
+{
+ public:
+ IndexEntryHandler(IBaseHandler *parent);
+ virtual ~IndexEntryHandler();
+ void startIndexEntry(const QXmlAttributes& attrib);
+ void endIndexEntry();
+ void startPrimaryIE(const QXmlAttributes& attrib);
+ void endPrimaryIE();
+ void startSecondaryIE(const QXmlAttributes& attrib);
+ void endSecondaryIE();
+
+ // IDocIndexEntry
+ virtual Kind kind() const { return DocImpl::IndexEntry; }
+ virtual const IString *primary() const { return &m_primary; }
+ virtual const IString *secondary() const { return &m_secondary; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_primary;
+ StringImpl m_secondary;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the table entry.
+ *
+ */
+// children: para
+class EntryHandler : public DocEntryImpl, public BaseHandler<EntryHandler>
+{
+ friend class EntryIterator;
+ public:
+ EntryHandler(IBaseHandler *parent);
+ virtual ~EntryHandler();
+ void startEntry(const QXmlAttributes& attrib);
+ void endEntry();
+ void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocEntry
+ virtual Kind kind() const { return DocImpl::Entry; }
+ virtual IDocIterator *contents() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class EntryIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ EntryIterator(const EntryHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the table row.
+ *
+ */
+// children: entry
+class RowHandler : public DocRowImpl, public BaseHandler<RowHandler>
+{
+ friend class RowIterator;
+ public:
+ RowHandler(IBaseHandler *parent);
+ virtual ~RowHandler();
+ void startRow(const QXmlAttributes& attrib);
+ void endRow();
+ void startEntry(const QXmlAttributes& attrib);
+
+ // IDocRow
+ virtual Kind kind() const { return DocImpl::Row; }
+ virtual IDocIterator *entries() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<EntryHandler> m_children;
+};
+
+class RowIterator : public BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>
+{
+ public:
+ RowIterator(const RowHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the table.
+ *
+ */
+// children: row, caption
+class TableHandler : public DocTableImpl, public BaseHandler<TableHandler>
+{
+ friend class TableIterator;
+ public:
+ TableHandler(IBaseHandler *parent);
+ virtual ~TableHandler();
+ void startTable(const QXmlAttributes& attrib);
+ void endTable();
+ void startRow(const QXmlAttributes& attrib);
+ void startCaption(const QXmlAttributes& attrib);
+ void endCaption();
+
+ // IDocTable
+ virtual Kind kind() const { return DocImpl::Table; }
+ virtual IDocIterator *rows() const;
+ virtual int numColumns() const { return m_numColumns; }
+ virtual const IString *caption() const { return &m_caption; }
+
+ private:
+ IBaseHandler *m_parent;
+ QList<RowHandler> m_children;
+ int m_numColumns;
+ StringImpl m_caption;
+};
+
+class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>
+{
+ public:
+ TableIterator(const TableHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a copied piece of documentation.
+ *
+ */
+class CopyHandler : public DocCopyImpl, public BaseHandler<CopyHandler>
+{
+ friend class CopyIterator;
+ public:
+ CopyHandler(IBaseHandler *parent);
+ virtual ~CopyHandler();
+ virtual void startCopy(const QXmlAttributes& attrib);
+ virtual void endCopy();
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocCopy
+ virtual Kind kind() const { return DocImpl::Copy; }
+ virtual IDocIterator *contents() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+};
+
+class CopyIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ CopyIterator(const CopyHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an preformatted section
+ */
+class VerbatimHandler : public DocVerbatimImpl,
+ public BaseHandler<VerbatimHandler>
+{
+ public:
+ VerbatimHandler(IBaseHandler *parent);
+ virtual ~VerbatimHandler();
+ void startVerbatim(const QXmlAttributes& attrib,Types type);
+ void endVerbatim();
+
+ // IDocVerbatim
+ virtual Kind kind() const { return DocImpl::Verbatim; }
+ virtual const IString *text() const { return &m_text; }
+ virtual Types type() const { return m_type; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_text;
+ Types m_type;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an special symbol.
+ *
+ */
+// children: -
+class SymbolHandler : public DocSymbolImpl, public BaseHandler<SymbolHandler>
+{
+ public:
+ SymbolHandler(IBaseHandler *parent,Types type);
+ virtual ~SymbolHandler();
+ void startSymbol(const QXmlAttributes& attrib);
+ void endSymbol();
+
+ // IDocSymbol
+ virtual Kind kind() const { return DocImpl::Symbol; }
+ virtual Types type() const { return m_type; }
+ virtual const IString *typeString() const { return &m_typeString; }
+ virtual char letter() const { return m_letter; }
+
+ private:
+ IBaseHandler *m_parent;
+ char m_letter;
+ Types m_type;
+ StringImpl m_typeString;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a section.
+ *
+ */
+// children: title, para, sect(n+1)
+class DocSectionHandler : public DocSectionImpl, public BaseHandler<DocSectionHandler>
+{
+ friend class DocSectionParaIterator;
+ friend class DocSectionSubIterator;
+ public:
+ DocSectionHandler(IBaseHandler *parent,int level);
+ virtual ~DocSectionHandler();
+ virtual void startDocSection(const QXmlAttributes& attrib);
+ virtual void endDocSection();
+ virtual void startTitle(const QXmlAttributes& attrib);
+ virtual void startSubSection(const QXmlAttributes& attrib);
+ virtual void startParagraph(const QXmlAttributes& attrib);
+ virtual void startInternal(const QXmlAttributes& attrib);
+
+ // IDocSection
+ virtual Kind kind() const { return DocImpl::Section; }
+ virtual const IString *id() const { return &m_id; }
+ virtual int level() const { return m_level; }
+ virtual IDocTitle *title() const { return m_title; }
+ virtual IDocIterator *paragraphs() const;
+ virtual IDocIterator *subSections() const;
+ virtual IDocInternal *internal() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_paragraphs;
+ QList<DocImpl> m_subsections;
+ DocInternalHandler *m_internal;
+ StringImpl m_id;
+ int m_level;
+ TitleHandler *m_title;
+};
+
+class DocSectionParaIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ DocSectionParaIterator(const DocSectionHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_paragraphs) {}
+};
+
+class DocSectionSubIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ DocSectionSubIterator(const DocSectionHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_subsections) {}
+};
+
+//-----------------------------------------------------------------------------
+
+class DocInternalHandler : public DocInternalImpl, public BaseHandler<DocInternalHandler>
+{
+ public:
+ friend class DocInternalParaIterator;
+ friend class DocInternalSubIterator;
+ DocInternalHandler(IBaseHandler *parent,int level);
+ virtual ~DocInternalHandler();
+ virtual void startInternal(const QXmlAttributes& attrib);
+ virtual void endInternal();
+ virtual void startSubSection(const QXmlAttributes& attrib);
+ virtual void startParagraph(const QXmlAttributes& attrib);
+
+ // IDocInternal
+ virtual Kind kind() const { return DocImpl::Internal; }
+ virtual IDocIterator *paragraphs() const;
+ virtual IDocIterator *subSections() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_paragraphs;
+ QList<DocImpl> m_subsections;
+ int m_level;
+};
+
+class DocInternalParaIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ DocInternalParaIterator(const DocInternalHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_paragraphs) {}
+};
+
+class DocInternalSubIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ DocInternalSubIterator(const DocInternalHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_subsections) {}
+};
+
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing a documentation block.
+ *
+ */
+// children: para, title, sect1, internal
+class DocHandler : public DocRootImpl, public BaseHandler<DocHandler>
+{
+ friend class DocIterator;
+ public:
+ virtual void startDoc(const QXmlAttributes& attrib);
+ virtual void endDoc();
+ virtual void startParagraph(const QXmlAttributes& attrib);
+ virtual void startSect1(const QXmlAttributes& attrib);
+ virtual void startTitle(const QXmlAttributes& attrib);
+ virtual void startInternal(const QXmlAttributes& attrib);
+
+ DocHandler(IBaseHandler *parent);
+ virtual ~DocHandler();
+
+ // IDocRoot
+ virtual Kind kind() const { return DocImpl::Root; }
+ virtual IDocIterator *contents() const;
+ virtual IDocInternal *internal() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocImpl> m_children;
+ DocInternalHandler *m_internal;
+};
+
+class DocIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
+{
+ public:
+ DocIterator(const DocHandler &handler) :
+ BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
+};
+
+//-----------------------------------------------------------------------------
+
+void dochandler_init();
+void dochandler_exit();
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/doxmlintf.h b/trunk/addon/doxmlparser/src/doxmlintf.h
new file mode 120000
index 0000000..1b1e847
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/doxmlintf.h
@@ -0,0 +1 @@
+../include/doxmlintf.h \ No newline at end of file
diff --git a/trunk/addon/doxmlparser/src/doxmlparser.pro.in b/trunk/addon/doxmlparser/src/doxmlparser.pro.in
new file mode 100644
index 0000000..841a46c
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/doxmlparser.pro.in
@@ -0,0 +1,27 @@
+TEMPLATE = lib.t
+CONFIG = console staticlib warn_on $extraopts
+HEADERS = basehandler.h mainhandler.h \
+ compoundhandler.h sectionhandler.h \
+ memberhandler.h paramhandler.h \
+ dochandler.h linkedtexthandler.h \
+ debug.h graphhandler.h stringimpl.h \
+ loamhandler.h
+SOURCES = mainhandler.cpp \
+ compoundhandler.cpp sectionhandler.cpp \
+ memberhandler.cpp paramhandler.cpp \
+ dochandler.cpp linkedtexthandler.cpp \
+ basehandler.cpp debug.cpp graphhandler.cpp \
+ loamhandler.cpp
+unix:LIBS += -L../../../lib -lqtools
+win32:INCLUDEPATH += .
+win32-mingw:LIBS += -L../../../lib -lqtools
+win32-msvc:LIBS += qtools.lib shell32.lib
+win32-msvc:TMAKE_LFLAGS += /LIBPATH:....\\..\lib
+win32-borland:LIBS += qtools.lib doxycfg.lib shell32.lib
+win32-borland:TMAKE_LFLAGS += -L..\..\..\lib
+win32:TMAKE_CXXFLAGS += -DQT_NODLL
+DESTDIR = ../lib
+OBJECTS_DIR = ../objects
+TARGET = doxmlparser
+INCLUDEPATH += ../../../qtools ../include
+
diff --git a/trunk/addon/doxmlparser/src/graphhandler.cpp b/trunk/addon/doxmlparser/src/graphhandler.cpp
new file mode 100644
index 0000000..7816970
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/graphhandler.cpp
@@ -0,0 +1,216 @@
+#include "graphhandler.h"
+
+class EdgeRelationMapper
+{
+ public:
+ EdgeRelationMapper()
+ {
+ m_map.insert("public-inheritance", IChildNode::PublicInheritance);
+ m_map.insert("protected-inheritance", IChildNode::ProtectedInheritance);
+ m_map.insert("private-inheritance", IChildNode::PrivateInheritance);
+ m_map.insert("usage", IChildNode::Usage);
+ m_map.insert("template-instance", IChildNode::TemplateInstance);
+ }
+ IChildNode::NodeRelation stringToNodeRelation(const QString &nrStr)
+ {
+ return m_map[nrStr];
+ }
+ private:
+ QMap<QString,IChildNode::NodeRelation> m_map;
+};
+
+static EdgeRelationMapper *s_edgeRelationMapper;
+
+void graphhandler_init()
+{
+ s_edgeRelationMapper = new EdgeRelationMapper;
+}
+
+void graphhandler_exit()
+{
+ delete s_edgeRelationMapper;
+}
+
+//------------------------------------------------------------------------
+
+GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag)
+ : m_parent(parent)
+{
+ addEndHandler(endTag,this,&GraphHandler::endGraph);
+ addStartHandler("node",this,&GraphHandler::startNode);
+ m_nodes.setAutoDelete(TRUE);
+ m_nodeDict = new QDict<NodeHandler>(1009);
+}
+
+GraphHandler::~GraphHandler()
+{
+ delete m_nodeDict;
+}
+
+void GraphHandler::startGraph(const QXmlAttributes &)
+{
+ debug(2,"startGraph\n");
+ m_parent->setDelegate(this);
+}
+
+void GraphHandler::endGraph()
+{
+ debug(2,"endGraph\n");
+ m_parent->setDelegate(0);
+}
+
+void GraphHandler::startNode(const QXmlAttributes &attrib)
+{
+ NodeHandler *n = new NodeHandler(this);
+ n->startNode(attrib);
+ m_nodes.append(n);
+ m_nodeDict->insert(attrib.value("id"),n);
+}
+
+INodeIterator *GraphHandler::nodes() const
+{
+ return new NodeIterator(*this);
+}
+
+NodeHandler *GraphHandler::getNodeById(const QString &id) const
+{
+ return m_nodeDict->find(id);
+}
+
+//------------------------------------------------------------------------
+
+NodeHandler::NodeHandler(GraphHandler *gh)
+ : m_parent(gh), m_graph(gh)
+{
+ addEndHandler("node",this,&NodeHandler::endNode);
+ addStartHandler("link",this,&NodeHandler::startLink);
+ addEndHandler("link",this,&NodeHandler::endLink);
+ addStartHandler("label",this,&NodeHandler::startLabel);
+ addEndHandler("label",this,&NodeHandler::endLabel);
+ addStartHandler("childnode",this,&NodeHandler::startChildNode);
+ m_children.setAutoDelete(TRUE);
+}
+
+NodeHandler::~NodeHandler()
+{
+}
+
+void NodeHandler::startNode(const QXmlAttributes &attrib)
+{
+ debug(2,"startNode\n");
+ m_parent->setDelegate(this);
+ m_id = attrib.value("id");
+}
+
+void NodeHandler::endNode()
+{
+ debug(2,"endNode\n");
+ m_parent->setDelegate(0);
+}
+
+void NodeHandler::startLink(const QXmlAttributes &attrib)
+{
+ m_link = attrib.value("refid");
+}
+
+void NodeHandler::endLink()
+{
+}
+
+void NodeHandler::startLabel(const QXmlAttributes &/*attrib*/)
+{
+ m_curString="";
+}
+
+void NodeHandler::endLabel()
+{
+ m_label = m_curString;
+}
+
+void NodeHandler::startChildNode(const QXmlAttributes &attrib)
+{
+ ChildNodeHandler *cnh = new ChildNodeHandler(this,m_graph);
+ cnh->startChildNode(attrib);
+ m_children.append(cnh);
+}
+
+IChildNodeIterator *NodeHandler::children() const
+{
+ return new ChildNodeIterator(*this);
+}
+
+//------------------------------------------------------------------------
+
+ChildNodeHandler::ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh)
+ : m_parent(parent), m_graph(gh)
+{
+ addEndHandler("childnode",this,&ChildNodeHandler::endChildNode);
+ addStartHandler("edgelabel",this,&ChildNodeHandler::startEdgeLabel);
+ m_edgeLabels.setAutoDelete(TRUE);
+}
+
+ChildNodeHandler::~ChildNodeHandler()
+{
+}
+
+void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib)
+{
+ debug(2,"startChildNode\n");
+ m_id = attrib.value("refid");
+ m_relationString = attrib.value("relation");
+ m_relation = s_edgeRelationMapper->stringToNodeRelation(m_relationString);
+ m_parent->setDelegate(this);
+}
+
+void ChildNodeHandler::endChildNode()
+{
+ debug(2,"endChildNode\n");
+ m_parent->setDelegate(0);
+}
+
+
+void ChildNodeHandler::startEdgeLabel(const QXmlAttributes &attrib)
+{
+ EdgeLabelHandler *elh = new EdgeLabelHandler(this);
+ elh->startEdgeLabel(attrib);
+ m_edgeLabels.append(elh);
+}
+
+IEdgeLabelIterator *ChildNodeHandler::edgeLabels() const
+{
+ return new EdgeLabelIterator(*this);
+}
+
+INode *ChildNodeHandler::node() const
+{
+ return m_graph->getNodeById(m_id);
+}
+
+//-----------------------------------------------------------------------
+
+EdgeLabelHandler::EdgeLabelHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("edgelabel",this,&EdgeLabelHandler::endEdgeLabel);
+}
+
+EdgeLabelHandler::~EdgeLabelHandler()
+{
+}
+
+void EdgeLabelHandler::startEdgeLabel(const QXmlAttributes &)
+{
+ m_parent->setDelegate(this);
+ m_curString="";
+}
+
+void EdgeLabelHandler::endEdgeLabel()
+{
+ m_label=m_curString;
+ m_parent->setDelegate(0);
+}
+
+
+
+
+
diff --git a/trunk/addon/doxmlparser/src/graphhandler.h b/trunk/addon/doxmlparser/src/graphhandler.h
new file mode 100644
index 0000000..f7105ec
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/graphhandler.h
@@ -0,0 +1,154 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _GRAPHHANDLER_H
+#define _GRAPHHANDLER_H
+
+#include "stringimpl.h"
+#include "doxmlintf.h"
+#include "basehandler.h"
+#include "baseiterator.h"
+
+class NodeHandler;
+class ChildNodeHandler;
+class EdgeLabelHandler;
+
+class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
+{
+ friend class NodeIterator;
+ public:
+ GraphHandler(IBaseHandler *parent,const char *endTag);
+ virtual ~GraphHandler();
+
+ void startGraph(const QXmlAttributes &attrib);
+ void endGraph();
+ void startNode(const QXmlAttributes &attrib);
+ NodeHandler *getNodeById(const QString &id) const;
+
+ // IGraph
+ virtual INodeIterator *nodes() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QList<NodeHandler> m_nodes;
+ QDict<NodeHandler> *m_nodeDict;
+};
+
+//----------------------------------------------------------------------
+
+class NodeHandler : public INode, public BaseHandler<NodeHandler>
+{
+ friend class ChildNodeIterator;
+ public:
+ NodeHandler(GraphHandler *gh);
+ virtual ~NodeHandler();
+
+ void startNode(const QXmlAttributes &attrib);
+ void endNode();
+ void startLabel(const QXmlAttributes &attrib);
+ void endLabel();
+ void startLink(const QXmlAttributes &attrib);
+ void endLink();
+ void startChildNode(const QXmlAttributes &attrib);
+
+ // INode
+ virtual const IString *id() const { return &m_id; }
+ virtual const IString *label() const { return &m_label; }
+ virtual const IString *linkId() const { return &m_link; }
+ virtual IChildNodeIterator *children() const;
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_id;
+ StringImpl m_label;
+ StringImpl m_link;
+ QList<ChildNodeHandler> m_children;
+ GraphHandler *m_graph;
+};
+
+class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler>
+{
+ public:
+ NodeIterator(const GraphHandler &handler) :
+ BaseIterator<INodeIterator,INode,NodeHandler>(handler.m_nodes) {}
+};
+
+//----------------------------------------------------------------------
+
+class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
+{
+ friend class EdgeLabelIterator;
+ public:
+ ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh);
+ virtual ~ChildNodeHandler();
+
+ void startChildNode(const QXmlAttributes &attrib);
+ void endChildNode();
+ void startEdgeLabel(const QXmlAttributes &attrib);
+
+ // IChildNode
+ virtual INode *node() const;
+ virtual NodeRelation relation() const { return m_relation; }
+ virtual const IString * relationString() const { return &m_relationString; }
+ virtual IEdgeLabelIterator *edgeLabels() const;
+
+ private:
+ IBaseHandler *m_parent;
+ QString m_id;
+ NodeRelation m_relation;
+ StringImpl m_relationString;
+ QList<EdgeLabelHandler> m_edgeLabels;
+ GraphHandler *m_graph;
+};
+
+class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>
+{
+ public:
+ ChildNodeIterator(const NodeHandler &handler) :
+ BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>(handler.m_children) {}
+};
+
+//----------------------------------------------------------------------
+
+class EdgeLabelHandler : public IEdgeLabel, public BaseHandler<EdgeLabelHandler>
+{
+ friend class EdgeLabelIterator;
+ public:
+ EdgeLabelHandler(IBaseHandler *parent);
+ virtual ~EdgeLabelHandler();
+
+ void startEdgeLabel(const QXmlAttributes &attrib);
+ void endEdgeLabel();
+
+ // IEdgeLabel
+ virtual const IString *label() const { return &m_label; }
+
+ private:
+ IBaseHandler *m_parent;
+ StringImpl m_label;
+};
+
+class EdgeLabelIterator : public BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>
+{
+ public:
+ EdgeLabelIterator(const ChildNodeHandler &handler) :
+ BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>(handler.m_edgeLabels) {}
+};
+
+void graphhandler_init();
+void graphhandler_exit();
+
+#endif
+
diff --git a/trunk/addon/doxmlparser/src/linkedtexthandler.cpp b/trunk/addon/doxmlparser/src/linkedtexthandler.cpp
new file mode 100644
index 0000000..96d1d49
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/linkedtexthandler.cpp
@@ -0,0 +1,133 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+#include "linkedtexthandler.h"
+#include "debug.h"
+#include <doxmlintf.h>
+#include "stringimpl.h"
+
+class LT_Text : public LinkedTextImpl, public ILT_Text
+{
+ public:
+ LT_Text(const QString &text) : m_text(text) {}
+ virtual ~LT_Text() {}
+
+ // ILT_Text
+ virtual const IString *text() const { return &m_text; }
+ virtual Kind kind() const { return LinkedTextImpl::Kind_Text; }
+ private:
+ StringImpl m_text;
+};
+
+class LT_Ref : public LinkedTextImpl, public ILT_Ref
+{
+ public:
+ LT_Ref() {}
+ virtual ~LT_Ref() {}
+ void setRefId(const QString &refId) { m_refId=refId; }
+ void setText(const QString &text) { m_text=text; }
+ void setExtId(const QString &extId) { m_extId=extId; }
+ void setTargetKind(TargetKind k) { m_targetKind=k; }
+
+ // ILT_Ref
+ virtual const IString *text() const { return &m_text; }
+ virtual const IString * id() const { return &m_refId; }
+ virtual TargetKind targetKind() const { return m_targetKind; }
+ virtual const IString *external() const { return &m_extId; }
+ virtual Kind kind() const { return LinkedTextImpl::Kind_Ref; }
+
+ private:
+ StringImpl m_refId;
+ StringImpl m_extId;
+ StringImpl m_text;
+ TargetKind m_targetKind;
+};
+
+LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent,
+ QList<LinkedTextImpl> &children
+ )
+ : m_parent(parent), m_children(children)
+{
+ addStartHandler("ref",this,&LinkedTextHandler::startRef);
+ addEndHandler("ref",this,&LinkedTextHandler::endRef);
+ m_children.setAutoDelete(TRUE);
+ m_ref=0;
+}
+
+LinkedTextHandler::~LinkedTextHandler()
+{
+}
+
+void LinkedTextHandler::start(const char *endTag)
+{
+ addEndHandler(endTag,this,&LinkedTextHandler::end);
+ m_parent->setDelegate(this);
+ m_curString="";
+}
+
+void LinkedTextHandler::end()
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(new LT_Text(m_curString));
+ debug(2,"LinkedTextHandler: add text `%s'\n",m_curString.data());
+ m_curString="";
+ }
+ m_parent->setDelegate(0);
+}
+
+void LinkedTextHandler::startRef(const QXmlAttributes& attrib)
+{
+ if (!m_curString.isEmpty())
+ {
+ m_children.append(new LT_Text(m_curString));
+ debug(2,"LinkedTextHandler: add text `%s'\n",m_curString.data());
+ m_curString="";
+ }
+ ASSERT(m_ref==0);
+ m_ref = new LT_Ref;
+ m_ref->setRefId(attrib.value("refid"));
+ m_ref->setExtId(attrib.value("external"));
+ ASSERT(attrib.value("kindref")=="compound" || attrib.value("kindref")=="member");
+ m_ref->setTargetKind(attrib.value("kindref")=="compound" ? ILT_Ref::Compound : ILT_Ref::Member);
+}
+
+void LinkedTextHandler::endRef()
+{
+ m_ref->setText(m_curString);
+ m_children.append(m_ref);
+ debug(2,"LinkedTextHandler: add ref `%s'\n",m_ref->text()->latin1());
+ m_ref=0;
+}
+
+QString LinkedTextHandler::toString(const QList<LinkedTextImpl> &list)
+{
+ QListIterator<LinkedTextImpl> li(list);
+ QString result;
+ LinkedTextImpl *lt;
+ for (li.toFirst();(lt=li.current());++li)
+ {
+ switch(lt->kind())
+ {
+ case ILinkedText::Kind_Text:
+ result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1();
+ break;
+ case ILinkedText::Kind_Ref:
+ result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1();
+ break;
+ }
+ }
+ return result;
+}
+
diff --git a/trunk/addon/doxmlparser/src/linkedtexthandler.h b/trunk/addon/doxmlparser/src/linkedtexthandler.h
new file mode 100644
index 0000000..464b39d
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/linkedtexthandler.h
@@ -0,0 +1,54 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+#ifndef LINKEDTEXTHANDLER_H
+#define LINKEDTEXTHANDLER_H
+
+#include "baseiterator.h"
+#include "basehandler.h"
+
+class LT_Ref;
+class LinkedTextImpl : public ILinkedText
+{
+ public:
+ virtual ~LinkedTextImpl() {}
+};
+
+class LinkedTextHandler : public BaseHandler<LinkedTextHandler>
+{
+ public:
+ LinkedTextHandler(IBaseHandler *parent,QList<LinkedTextImpl> &children);
+ virtual ~LinkedTextHandler();
+ virtual void start(const char *endTag);
+ virtual void end();
+ virtual void startRef(const QXmlAttributes& attrib);
+ virtual void endRef();
+ static QString toString(const QList<LinkedTextImpl> &list);
+
+ // ILinkedText
+
+ private:
+ IBaseHandler *m_parent;
+ QList<LinkedTextImpl> &m_children;
+ LT_Ref *m_ref;
+};
+
+class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>
+{
+ public:
+ LinkedTextIterator(const QList<LinkedTextImpl> &list) :
+ BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>(list) {}
+};
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/loamhandler.cpp b/trunk/addon/doxmlparser/src/loamhandler.cpp
new file mode 100644
index 0000000..a939b7b
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/loamhandler.cpp
@@ -0,0 +1,75 @@
+#include "loamhandler.h"
+#include "memberhandler.h"
+
+
+ListOfAllMembersHandler::ListOfAllMembersHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ m_members.setAutoDelete(TRUE);
+
+ addStartHandler("member",this,&ListOfAllMembersHandler::startMember);
+ addStartHandler("name",this,&ListOfAllMembersHandler::startName);
+ addEndHandler("name",this,&ListOfAllMembersHandler::endName);
+ addStartHandler("scope",this,&ListOfAllMembersHandler::startScope);
+ addEndHandler("scope",this,&ListOfAllMembersHandler::endScope);
+
+ addEndHandler("listofallmembers",this,&ListOfAllMembersHandler::endListOfAllMembers);
+}
+
+void ListOfAllMembersHandler::initialize(MainHandler *mh)
+{
+ QListIterator<MemberReference> mli(m_members);
+ MemberReference *mr;
+ for (;(mr=mli.current());++mli)
+ {
+ mr->initialize(mh);
+ }
+}
+
+void ListOfAllMembersHandler::startMember(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("refid");
+ mr->m_virtualness = attrib.value("virt");
+ mr->m_protection = attrib.value("prot");
+ mr->m_ambiguityScope = attrib.value("ambiguityscope");
+ m_members.append(new MemberReference);
+}
+
+void ListOfAllMembersHandler::startName(const QXmlAttributes&)
+{
+ m_curString="";
+}
+
+void ListOfAllMembersHandler::endName()
+{
+ ASSERT(m_members.getLast());
+ m_members.getLast()->m_name = m_curString;
+}
+
+void ListOfAllMembersHandler::startScope(const QXmlAttributes&)
+{
+ m_curString="";
+}
+
+void ListOfAllMembersHandler::endScope()
+{
+ ASSERT(m_members.getLast());
+ m_members.getLast()->m_scope = m_curString;
+}
+
+void ListOfAllMembersHandler::startListOfAllMembers(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"listofallmembers start\n");
+}
+
+void ListOfAllMembersHandler::endListOfAllMembers()
+{
+ m_parent->setDelegate(0);
+ debug(2,"listofallmembers end\n");
+}
+
+IMemberReferenceIterator *ListOfAllMembersHandler::members() const
+{
+ return new MemberReferenceIterator(m_members);
+}
diff --git a/trunk/addon/doxmlparser/src/loamhandler.h b/trunk/addon/doxmlparser/src/loamhandler.h
new file mode 100644
index 0000000..ce2eda2
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/loamhandler.h
@@ -0,0 +1,52 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _LOAMHANDLER_H
+#define _LOAMHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <doxmlintf.h>
+
+#include "basehandler.h"
+
+class MainHandler;
+class MemberReference;
+
+class ListOfAllMembersHandler : public BaseHandler<ListOfAllMembersHandler>
+{
+ public:
+ virtual void startMember(const QXmlAttributes& attrib);
+ virtual void startName(const QXmlAttributes& attrib);
+ virtual void endName();
+ virtual void startScope(const QXmlAttributes& attrib);
+ virtual void endScope();
+ virtual void startListOfAllMembers(const QXmlAttributes& attrib);
+ virtual void endListOfAllMembers();
+
+ ListOfAllMembersHandler(IBaseHandler *parent);
+ virtual ~ListOfAllMembersHandler() {}
+
+ void initialize(MainHandler *mh);
+
+ virtual IMemberReferenceIterator *members() const;
+
+ protected:
+ IBaseHandler *m_parent;
+ QList<MemberReference> m_members;
+};
+
+#endif
+
diff --git a/trunk/addon/doxmlparser/src/mainhandler.cpp b/trunk/addon/doxmlparser/src/mainhandler.cpp
new file mode 100644
index 0000000..81d7d2f
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/mainhandler.cpp
@@ -0,0 +1,299 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include <qxml.h>
+#include "mainhandler.h"
+#include "compoundhandler.h"
+#include "sectionhandler.h"
+#include "graphhandler.h"
+#include "dochandler.h"
+#include "memberhandler.h"
+#include "debug.h"
+
+
+class ErrorHandler : public QXmlErrorHandler
+{
+ public:
+ virtual ~ErrorHandler() {}
+ bool warning( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool error( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool fatalError( const QXmlParseException &exception )
+ {
+ debug(1,"Fatal error at line %d column %d: %s\n",
+ exception.lineNumber(),exception.columnNumber(),
+ exception.message().data());
+ return FALSE;
+ }
+ QString errorString() { return ""; }
+
+ private:
+ QString errorMsg;
+};
+
+//--------------------------------------------------------------------------
+
+class CompoundEntryIterator : public ICompoundIterator,
+ public QListIterator<CompoundEntry>
+{
+ public:
+ CompoundEntryIterator(const MainHandler *m,const QList<CompoundEntry> &list) :
+ QListIterator<CompoundEntry>(list), m_mainHandler(m) {}
+ virtual ~CompoundEntryIterator() {}
+
+ virtual void toFirst()
+ {
+ QListIterator<CompoundEntry>::toFirst();
+ }
+ virtual void toLast()
+ {
+ QListIterator<CompoundEntry>::toLast();
+ }
+ virtual void toNext()
+ {
+ QListIterator<CompoundEntry>::operator++();
+ }
+ virtual void toPrev()
+ {
+ QListIterator<CompoundEntry>::operator--();
+ }
+ virtual ICompound *current() const
+ {
+ CompoundEntry *ch = QListIterator<CompoundEntry>::current();
+ return ch ? m_mainHandler->compoundById(ch->id) : 0;
+ }
+ virtual void release()
+ { delete this; }
+
+ private:
+ const MainHandler *m_mainHandler;
+};
+
+//--------------------------------------------------------------------------
+
+MainHandler::MainHandler() : m_compoundDict(2999), m_compoundNameDict(2999),
+ m_memberDict(12251), m_memberNameDict(12251),
+ m_compoundsLoaded(1009)
+{
+ m_compounds.setAutoDelete(TRUE);
+ m_memberNameDict.setAutoDelete(TRUE);
+ addStartHandler("doxygenindex");
+ addEndHandler("doxygenindex");
+ addStartHandler("compound",this,&MainHandler::startCompound);
+ addEndHandler("compound");
+ addStartHandler("member",this,&MainHandler::startMember);
+ addEndHandler("member",this,&MainHandler::endMember);
+ addStartHandler("name",this,&MainHandler::startName);
+ addEndHandler("name",this,&MainHandler::endName);
+ m_curCompound = 0;
+ m_insideMember = FALSE;
+}
+
+MainHandler::~MainHandler()
+{
+ debug(2,"MainHandler::~MainHandler()\n");
+}
+
+void MainHandler::startCompound(const QXmlAttributes& attrib)
+{
+ m_curCompound = new CompoundEntry(257);
+ m_curCompound->id = attrib.value("refid");
+ m_compounds.append(m_curCompound);
+ m_compoundDict.insert(m_curCompound->id,m_curCompound);
+}
+
+void MainHandler::startName(const QXmlAttributes& /*attrib*/)
+{
+ m_curString = "";
+}
+
+void MainHandler::endName()
+{
+ if (m_insideMember)
+ {
+ m_curMember->name = m_curString;
+ }
+ else
+ {
+ m_curCompound->name = m_curString;
+ m_compoundNameDict.insert(m_curString,m_curCompound);
+ }
+}
+
+void MainHandler::startMember(const QXmlAttributes& attrib)
+{
+ m_insideMember = TRUE;
+ m_curMember = new MemberEntry;
+ m_curMember->id = attrib.value("refid");
+ m_curMember->compound = m_curCompound;
+ m_memberDict.insert(m_curMember->id,m_curMember);
+}
+
+void MainHandler::endMember()
+{
+ m_curCompound->memberDict.insert(m_curMember->name,m_curMember);
+ QList<CompoundEntry> *cel=0;
+ if ((cel=m_memberNameDict.find(m_curMember->name))==0)
+ {
+ cel = new QList<CompoundEntry>;
+ m_memberNameDict.insert(m_curMember->name,cel);
+ }
+ cel->append(m_curCompound);
+ m_insideMember = FALSE;
+}
+
+void MainHandler::setDebugLevel(int level)
+{
+ ::setDebugLevel(level);
+}
+
+void MainHandler::dump()
+{
+ QListIterator<CompoundEntry> cli(m_compounds);
+ CompoundEntry *ce;
+ for (cli.toFirst();(ce=cli.current());++cli)
+ {
+ debug(2,"compound id=`%s' name=`%s'\n",ce->id.data(),ce->name.data());
+ QDictIterator<MemberEntry> mdi(ce->memberDict);
+ MemberEntry *me;
+ for (mdi.toFirst();(me=mdi.current());++mdi)
+ {
+ debug(2," member id=`%s' name=`%s'\n",me->id.data(),me->name.data());
+ }
+ }
+}
+
+bool MainHandler::readXMLDir(const char * xmlDirName)
+{
+ m_xmlDirName = xmlDirName;
+ QString xmlFileName=m_xmlDirName+"/index.xml";
+ QFile xmlFile(xmlFileName);
+ //printf("Trying %s xmlFile.exists()=%d isReadable()=%d\n",
+ // xmlFileName.data(),xmlFile.exists(),xmlFile.isReadable());
+ if (xmlFile.exists())
+ {
+ ErrorHandler errorHandler;
+ QXmlInputSource source( xmlFile );
+ QXmlSimpleReader reader;
+ reader.setContentHandler( this );
+ reader.setErrorHandler( &errorHandler );
+ reader.parse( source );
+ dump();
+ return TRUE;
+ }
+ return FALSE;
+}
+
+ICompoundIterator *MainHandler::compounds() const
+{
+ return new CompoundEntryIterator(this,m_compounds);
+}
+
+ICompound *MainHandler::compoundById(const char *id) const
+{
+ QString ids = id;
+ if (ids.isEmpty()) return 0;
+ CompoundHandler *ch = m_compoundsLoaded[ids];
+ if (ch) // compound already in memory
+ {
+ ch->addref(); // returning alias -> increase reference counter
+ return ch->toICompound();
+ }
+ CompoundEntry *ce = m_compoundDict.find(ids);
+ if (ce==0) return 0; // id not found
+ // create and load a new compound
+ ch = new CompoundHandler(m_xmlDirName);
+ if (!ch->parseXML(id))
+ {
+ // compound could not be initialized.
+ delete ch;
+ return 0;
+ }
+
+ // we disregard the constness here, because the object stays conceptually
+ // unchanged.
+ MainHandler *that = (MainHandler *)this;
+ ch->initialize(that);
+ //printf("loading compound %s in memory\n",id);
+ that->m_compoundsLoaded.insert(id,ch);
+ return ch->toICompound();
+}
+
+void MainHandler::unloadCompound(CompoundHandler *ch)
+{
+ //printf("unloading compound %s from memory\n",ch->id()->latin1());
+ bool result = m_compoundsLoaded.remove(ch->id()->latin1());
+ if (!result) debug(1,"Failed to unload component!\n");
+}
+
+ICompound *MainHandler::compoundByName(const char *name) const
+{
+ QString nameStr = name;
+ if (nameStr.isEmpty()) return 0;
+ CompoundEntry *ce = m_compoundNameDict[name];
+ if (ce==0) return 0; // name not found
+ return compoundById(ce->id);
+}
+
+ICompound *MainHandler::memberById(const char *id) const
+{
+ QString ids = id;
+ if (ids.isEmpty()) return 0;
+ MemberEntry *me = m_memberDict[id];
+ if (me==0) return 0; // id not found
+ return compoundById(me->compound->id);
+}
+
+ICompoundIterator *MainHandler::memberByName(const char *name) const
+{
+ QString nameStr = name;
+ if (nameStr.isEmpty()) return 0;
+ QList<CompoundEntry> *cel = m_memberNameDict[name];
+ if (cel==0) return 0; // name not found
+ return new CompoundEntryIterator(this,*cel);
+}
+
+IDoxygen *createObjectModel()
+{
+ compoundhandler_init();
+ sectionhandler_init();
+ memberhandler_init();
+ dochandler_init();
+ graphhandler_init();
+ return new MainHandler;
+}
+
+void MainHandler::release()
+{
+ //printf("MainHandler::release()\n");
+ QDictIterator<CompoundHandler> chi(m_compoundsLoaded);
+ CompoundHandler *ch;
+ for (chi.toFirst();(ch=chi.current());++chi)
+ {
+ debug(1,"Compound %s not released\n",ch->name()->latin1());
+ }
+ graphhandler_exit();
+ dochandler_exit();
+ memberhandler_exit();
+ sectionhandler_exit();
+ compoundhandler_exit();
+ delete this;
+}
+
diff --git a/trunk/addon/doxmlparser/src/mainhandler.h b/trunk/addon/doxmlparser/src/mainhandler.h
new file mode 100644
index 0000000..9ac8b79
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/mainhandler.h
@@ -0,0 +1,82 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _MAINHANDLER_H
+#define _MAINHANDLER_H
+
+#include <qlist.h>
+
+#include <doxmlintf.h>
+#include "basehandler.h"
+
+class CompoundHandler;
+struct CompoundEntry;
+
+struct IndexEntry
+{
+ QString id;
+ QString name;
+};
+
+struct MemberEntry : public IndexEntry
+{
+ CompoundEntry *compound;
+};
+
+struct CompoundEntry : public IndexEntry
+{
+ CompoundEntry(int size) : memberDict(size)
+ { memberDict.setAutoDelete(TRUE); }
+ QDict<MemberEntry> memberDict;
+};
+
+class MainHandler : public IDoxygen, public BaseHandler<MainHandler>
+{
+ public:
+ virtual void startCompound(const QXmlAttributes& attrib);
+ virtual void startMember(const QXmlAttributes& attrib);
+ virtual void endMember();
+ virtual void startName(const QXmlAttributes& attrib);
+ virtual void endName();
+ MainHandler();
+ virtual ~MainHandler();
+
+ // IDoxygen
+ ICompoundIterator *compounds() const;
+ ICompound *compoundById(const char *id) const;
+ virtual ICompound *compoundByName(const char *name) const;
+ virtual ICompound *memberById(const char *id) const;
+ virtual ICompoundIterator *memberByName(const char *name) const;
+
+ virtual void release();
+ void setDebugLevel(int level);
+ bool readXMLDir(const char *dirName);
+ void dump();
+ void unloadCompound(CompoundHandler *ch);
+
+ private:
+ CompoundEntry *m_curCompound;
+ MemberEntry *m_curMember;
+ QList<CompoundEntry> m_compounds;
+ QDict<CompoundEntry> m_compoundDict;
+ QDict<CompoundEntry> m_compoundNameDict;
+ QDict<MemberEntry> m_memberDict;
+ QDict<QList<CompoundEntry> > m_memberNameDict;
+ QString m_xmlDirName;
+ QDict<CompoundHandler> m_compoundsLoaded;
+ bool m_insideMember;
+};
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/memberhandler.cpp b/trunk/addon/doxmlparser/src/memberhandler.cpp
new file mode 100644
index 0000000..9ccc014
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/memberhandler.cpp
@@ -0,0 +1,600 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "memberhandler.h"
+#include "sectionhandler.h"
+#include "dochandler.h"
+#include "mainhandler.h"
+#include "linkedtexthandler.h"
+#include "paramhandler.h"
+#include "compoundhandler.h"
+#include "debug.h"
+
+//------------------------------------------------------------------------------
+
+class MemberTypeMap
+{
+ public:
+ MemberTypeMap()
+ {
+ m_map.setAutoDelete(TRUE);
+ m_map.insert("define",new int(IMember::Define));
+ m_map.insert("property",new int(IMember::Property));
+ m_map.insert("variable",new int(IMember::Variable));
+ m_map.insert("typedef",new int(IMember::Typedef));
+ m_map.insert("enum",new int(IMember::Enum));
+ m_map.insert("function",new int(IMember::Function));
+ m_map.insert("signal",new int(IMember::Signal));
+ m_map.insert("prototype",new int(IMember::Prototype));
+ m_map.insert("friend",new int(IMember::Friend));
+ m_map.insert("dcop",new int(IMember::DCOP));
+ m_map.insert("slot",new int(IMember::Slot));
+ m_map.insert("enumvalue",new int(IMember::EnumValue));
+ }
+ IMember::MemberKind map(const QString &s)
+ {
+ int *val = m_map.find(s);
+ if (val==0)
+ {
+ debug(1,"Warning: `%s' is an invalid member type\n",s.data());
+ return IMember::Invalid;
+ }
+ else return (IMember::MemberKind)*val;
+ }
+ private:
+ QDict<int> m_map;
+};
+
+static MemberTypeMap *s_typeMap;
+
+void memberhandler_init()
+{
+ s_typeMap = new MemberTypeMap;
+}
+
+void memberhandler_exit()
+{
+ delete s_typeMap;
+}
+
+//------------------------------------------------------------------------------
+
+void MemberReference::initialize(MainHandler *mh)
+{
+ m_mainHandler = mh;
+}
+
+IMember *MemberReference::member() const
+{
+ //return m_mainHandler->memberById(m_memId);
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+
+
+#if 0
+EnumValueHandler::EnumValueHandler(IBaseHandler *parent) :
+ m_parent(parent), m_brief(0), m_detailed(0), m_linkedTextHandler(0)
+{
+ addEndHandler("enumvalue",this,&EnumValueHandler::endEnumValue);
+
+ addStartHandler("name",this,&EnumValueHandler::startName);
+ addEndHandler("name",this,&EnumValueHandler::endName);
+ addStartHandler("initializer",this,&EnumValueHandler::startInitializer);
+
+ addStartHandler("briefdescription",this,&EnumValueHandler::startBriefDesc);
+
+ addStartHandler("detaileddescription",this,&EnumValueHandler::startDetailedDesc);
+
+ m_initializer.setAutoDelete(TRUE);
+}
+
+EnumValueHandler::~EnumValueHandler()
+{
+ delete m_brief;
+ delete m_detailed;
+ delete m_linkedTextHandler;
+}
+
+void EnumValueHandler::startEnumValue(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+}
+
+void EnumValueHandler::endEnumValue()
+{
+ m_parent->setDelegate(0);
+}
+
+void EnumValueHandler::startName(const QXmlAttributes& /*attrib*/)
+{
+ m_curString="";
+}
+
+void EnumValueHandler::endName()
+{
+ m_name = m_curString;
+}
+
+void EnumValueHandler::startInitializer(const QXmlAttributes& /*attrib*/)
+{
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_initializer);
+ m_linkedTextHandler->start("initializer");
+}
+
+void EnumValueHandler::startBriefDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_brief = docHandler;
+}
+
+void EnumValueHandler::startDetailedDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_detailed = docHandler;
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+MemberHandler::MemberHandler(IBaseHandler *parent)
+ : m_brief(0), m_detailed(0), m_inbody(0),
+ m_compound(0), m_section(0), m_parent(parent)
+{
+ //printf("MemberHandler::MemberHandler() %p\n",this);
+ addEndHandler("memberdef",this,&MemberHandler::endMember);
+
+ addStartHandler("templateparamlist",this,&MemberHandler::startTemplateParamList);
+ addEndHandler("templateparamlist",this,&MemberHandler::endTemplateParamList);
+
+ addStartHandler("type",this,&MemberHandler::startType);
+
+ addStartHandler("definition",this,&MemberHandler::startDefinition);
+ addEndHandler("definition",this,&MemberHandler::endDefinition);
+
+ addStartHandler("argsstring",this,&MemberHandler::startArgsString);
+ addEndHandler("argsstring",this,&MemberHandler::endArgsString);
+
+ addStartHandler("name",this,&MemberHandler::startName);
+ addEndHandler("name",this,&MemberHandler::endName);
+
+ addStartHandler("read",this,&MemberHandler::startRead);
+ addEndHandler("read",this,&MemberHandler::endRead);
+
+ addStartHandler("write",this,&MemberHandler::startWrite);
+ addEndHandler("write",this,&MemberHandler::endWrite);
+
+ addStartHandler("reimplements",this,&MemberHandler::startReimplements);
+ addEndHandler("reimplements",this,&MemberHandler::endReimplements);
+
+ addStartHandler("reimplementedby",this,&MemberHandler::startReimplementedBy);
+ addEndHandler("reimplementedby",this,&MemberHandler::endReimplementedBy);
+
+ addStartHandler("param",this,&MemberHandler::startParam);
+
+ addStartHandler("enumvalue",this,&MemberHandler::startEnumValue2);
+ addEndHandler("enumvalue",this,&MemberHandler::endMember);
+
+ addStartHandler("initializer",this,&MemberHandler::startInitializer);
+ addStartHandler("exceptions",this,&MemberHandler::startException);
+
+ addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc);
+
+ addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc);
+
+ addStartHandler("inbodydescription",this,&MemberHandler::startInbodyDesc);
+
+ addStartHandler("location",this,&MemberHandler::startLocation);
+ addEndHandler("location");
+
+ addStartHandler("references",this,&MemberHandler::startReferences);
+ addEndHandler("references",this,&MemberHandler::endReferences);
+
+ addStartHandler("referencedby",this,&MemberHandler::startReferencedBy);
+ addEndHandler("referencedby",this,&MemberHandler::endReferencedBy);
+
+ m_type.setAutoDelete(TRUE);
+ m_initializer.setAutoDelete(TRUE);
+ m_exception.setAutoDelete(TRUE);
+ m_params.setAutoDelete(TRUE);
+ m_references.setAutoDelete(TRUE);
+ m_referencedBy.setAutoDelete(TRUE);
+ m_reimplements = 0;
+ m_reimplementedBy.setAutoDelete(TRUE);
+ m_enumValues.setAutoDelete(TRUE);
+ m_linkedTextHandler = 0;
+ m_defLine=0;
+ m_bodyStart=0;
+ m_bodyEnd=0;
+ m_insideTemplateParamList=FALSE;
+ m_hasTemplateParamList=FALSE;
+}
+
+MemberHandler::~MemberHandler()
+{
+ debug(2,"MemberHandler::~MemberHandler() %p\n",this);
+ delete m_brief;
+ delete m_detailed;
+ delete m_inbody;
+ delete m_linkedTextHandler;
+ delete m_reimplements;
+}
+
+void MemberHandler::startMember(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_kindString = attrib.value("kind");
+ //printf("startMember kindString=`%s'\n",m_kindString.data());
+ m_kind = s_typeMap->map(m_kindString);
+ m_id = attrib.value("id");
+ m_protection = attrib.value("prot");
+ m_isStatic = attrib.value("static")=="yes";
+ m_isConst = attrib.value("const")=="yes";
+ m_isExplicit = attrib.value("explicit")=="yes";
+ m_isInline = attrib.value("inline")=="yes";
+ m_virtualness = attrib.value("virt");
+ m_isVolatile = attrib.value("volatile")=="yes";
+ m_isMutable = attrib.value("mutable")=="yes";
+ m_isReadable = attrib.value("readable")=="yes";
+ m_isWritable = attrib.value("writable")=="yes";
+
+ debug(2,"member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n",
+ m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data());
+}
+
+void MemberHandler::startEnumValue(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_kindString = "enumvalue";
+ //printf("startEnumValue kindString=`%s'\n",m_kindString.data());
+ m_kind = s_typeMap->map(m_kindString);
+ m_id = attrib.value("id");
+ m_protection = attrib.value("prot");
+ m_isStatic = FALSE;
+ m_isConst = FALSE;
+ m_isExplicit = FALSE;
+ m_isInline = FALSE;
+ m_virtualness = "non-virtual";
+ m_isVolatile = FALSE;
+ m_isMutable = FALSE;
+ m_isReadable = FALSE;
+ m_isWritable = FALSE;
+ debug(2,"member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n",
+ m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data());
+}
+
+void MemberHandler::startEnumValue2(const QXmlAttributes& attrib)
+{
+ MemberHandler *mh = new MemberHandler(this);
+ mh->startEnumValue(attrib);
+ m_enumValues.append(mh);
+}
+
+
+void MemberHandler::startBriefDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_brief = docHandler;
+}
+
+void MemberHandler::startDetailedDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_detailed = docHandler;
+}
+
+void MemberHandler::startInbodyDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_inbody = docHandler;
+}
+
+void MemberHandler::startLocation(const QXmlAttributes& attrib)
+{
+ m_defFile = attrib.value("file");
+ m_bodyFile = attrib.value("bodyfile");
+ QCString s;
+ s = attrib.value("line");
+ if (!s.isEmpty()) m_defLine=s.toInt();
+ s = attrib.value("bodystart");
+ if (!s.isEmpty()) m_bodyStart=s.toInt();
+ s = attrib.value("bodyend");
+ if (!s.isEmpty()) m_bodyEnd=s.toInt();
+}
+
+void MemberHandler::startReferences(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("refid");
+ m_references.append(mr);
+ m_curString="";
+}
+
+void MemberHandler::endReferences()
+{
+ m_references.getLast()->m_name = m_curString;
+}
+
+void MemberHandler::startReferencedBy(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("refid");
+ m_referencedBy.append(mr);
+ m_curString="";
+}
+
+void MemberHandler::endReferencedBy()
+{
+ m_referencedBy.getLast()->m_name = m_curString;
+}
+
+void MemberHandler::startReimplements(const QXmlAttributes& attrib)
+{
+ m_reimplements = new MemberReference;
+ m_reimplements->m_memId = attrib.value("refid");
+ m_curString="";
+}
+
+void MemberHandler::endReimplements()
+{
+ m_reimplements->m_name = m_curString;
+}
+
+void MemberHandler::startReimplementedBy(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("refid");
+ m_reimplementedBy.append(mr);
+ m_curString="";
+}
+
+void MemberHandler::endReimplementedBy()
+{
+ m_reimplementedBy.getLast()->m_name = m_curString;
+}
+
+void MemberHandler::endMember()
+{
+ m_parent->setDelegate(0);
+}
+
+void MemberHandler::startType(const QXmlAttributes &)
+{
+ debug(2,"startType!\n");
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_type);
+ m_linkedTextHandler->start("type");
+}
+
+void MemberHandler::startInitializer(const QXmlAttributes &)
+{
+ debug(2,"startInitializer!\n");
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_initializer);
+ m_linkedTextHandler->start("initializer");
+}
+
+void MemberHandler::startException(const QXmlAttributes &)
+{
+ debug(2,"startException!\n");
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_exception);
+ m_linkedTextHandler->start("exceptions");
+}
+
+void MemberHandler::startName(const QXmlAttributes &)
+{
+ m_curString="";
+}
+
+void MemberHandler::endName()
+{
+ m_name = m_curString.stripWhiteSpace();
+ debug(2,"member name=`%s'\n",m_name.data());
+}
+
+void MemberHandler::startRead(const QXmlAttributes &)
+{
+ m_curString="";
+}
+
+void MemberHandler::endRead()
+{
+ m_read = m_curString.stripWhiteSpace();
+ debug(2,"member read=`%s'\n",m_read.data());
+}
+
+void MemberHandler::startWrite(const QXmlAttributes &)
+{
+ m_curString="";
+}
+
+void MemberHandler::endWrite()
+{
+ m_write = m_curString.stripWhiteSpace();
+ debug(2,"member write=`%s'\n",m_write.data());
+}
+
+void MemberHandler::startDefinition(const QXmlAttributes&)
+{
+ m_curString="";
+}
+
+void MemberHandler::endDefinition()
+{
+ m_definition = m_curString.stripWhiteSpace();
+ debug(2,"definition=%s\n",m_definition.data());
+}
+
+void MemberHandler::startArgsString(const QXmlAttributes&)
+{
+ m_curString="";
+}
+
+void MemberHandler::endArgsString()
+{
+ m_argsstring = m_curString.stripWhiteSpace();
+ debug(2,"arggstring=%s\n",m_argsstring.data());
+}
+
+void MemberHandler::startParam(const QXmlAttributes& attrib)
+{
+ ParamHandler *paramHandler = new ParamHandler(this);
+ paramHandler->startParam(attrib);
+ if (m_insideTemplateParamList)
+ {
+ m_templateParams.append(paramHandler);
+ }
+ else
+ {
+ m_params.append(paramHandler);
+ }
+}
+
+void MemberHandler::startTemplateParamList(const QXmlAttributes&)
+{
+ m_insideTemplateParamList = TRUE;
+ m_hasTemplateParamList = TRUE;
+}
+
+void MemberHandler::endTemplateParamList()
+{
+ m_insideTemplateParamList = FALSE;
+}
+
+void MemberHandler::initialize(MainHandler *mh)
+{
+ {
+ QListIterator<MemberReference> mli(m_references);
+ MemberReference *mr;
+ for (;(mr=mli.current());++mli)
+ {
+ mr->initialize(mh);
+ }
+ }
+ {
+ QListIterator<MemberReference> mli(m_referencedBy);
+ MemberReference *mr;
+ for (;(mr=mli.current());++mli)
+ {
+ mr->initialize(mh);
+ }
+ }
+ {
+ QListIterator<MemberReference> mli(m_reimplementedBy);
+ MemberReference *mr;
+ for (;(mr=mli.current());++mli)
+ {
+ mr->initialize(mh);
+ }
+ }
+ if (m_reimplements) m_reimplements->initialize(mh);
+}
+
+void MemberHandler::setCompoundHandler(CompoundHandler *c)
+{
+ m_compound = c;
+}
+
+ICompound *MemberHandler::compound() const
+{
+ m_compound->addref();
+ return m_compound->toICompound();
+}
+
+void MemberHandler::setSectionHandler(SectionHandler *c)
+{
+ m_section = c;
+}
+
+ISection *MemberHandler::section() const
+{
+ return m_section;
+}
+
+IMemberIterator *MemberHandler::enumValues() const
+{
+ return new MemberIterator(m_enumValues);
+}
+
+ILinkedTextIterator *MemberHandler::type() const
+{
+ return new LinkedTextIterator(m_type);
+}
+
+const IString *MemberHandler::typeString() const
+{
+ MemberHandler *that = (MemberHandler *)this;
+ that->m_typeString = LinkedTextHandler::toString(m_type);
+ return &m_typeString;
+}
+
+IParamIterator *MemberHandler::parameters() const
+{
+ return new ParamIterator(m_params);
+}
+
+IParamIterator *MemberHandler::templateParameters() const
+{
+ return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0;
+}
+
+IMemberReferenceIterator *MemberHandler::references() const
+{
+ return new MemberReferenceIterator(m_references);
+}
+
+IMemberReferenceIterator *MemberHandler::referencedBy() const
+{
+ return new MemberReferenceIterator(m_referencedBy);
+}
+
+ILinkedTextIterator *MemberHandler::initializer() const
+{
+ return new LinkedTextIterator(m_initializer);
+}
+
+ILinkedTextIterator *MemberHandler::exceptions() const
+{
+ return new LinkedTextIterator(m_exception);
+}
+
+IMemberReferenceIterator *MemberHandler::reimplementedBy() const
+{
+ return new MemberReferenceIterator(m_reimplementedBy);
+}
+
+IDocRoot *MemberHandler::briefDescription() const
+{
+ return m_brief;
+}
+
+IDocRoot *MemberHandler::detailedDescription() const
+{
+ return m_detailed;
+}
+
+IDocRoot *MemberHandler::inbodyDescription() const
+{
+ return m_inbody;
+}
+
diff --git a/trunk/addon/doxmlparser/src/memberhandler.h b/trunk/addon/doxmlparser/src/memberhandler.h
new file mode 100644
index 0000000..9b409b6
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/memberhandler.h
@@ -0,0 +1,252 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _MEMBERHANDLER_H
+#define _MEMBERHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <qxml.h>
+#include <doxmlintf.h>
+
+#include "basehandler.h"
+#include "baseiterator.h"
+#include "stringimpl.h"
+
+class MainHandler;
+class CompoundHandler;
+class SectionHandler;
+class ParamHandler;
+class LinkedTextImpl;
+class LinkedTextHandler;
+class DocHandler;
+
+class MemberReference : public IMemberReference
+{
+ public:
+ virtual ~MemberReference() {}
+ virtual IMember *member() const;
+ virtual const IString *name() const { return &m_name; }
+ virtual const IString *scope() const { return &m_scope; }
+ virtual const IString *protection() const { return &m_protection; }
+ virtual const IString *virtualness() const { return &m_virtualness; }
+ virtual const IString *ambiguityScope() const { return &m_ambiguityScope; }
+ void initialize(MainHandler *m);
+
+ QString m_memId;
+ StringImpl m_name;
+ StringImpl m_scope;
+ StringImpl m_virtualness;
+ StringImpl m_protection;
+ StringImpl m_ambiguityScope;
+ MainHandler *m_mainHandler;
+};
+
+class MemberReferenceIterator : public BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>
+{
+ public:
+ MemberReferenceIterator(const QList<MemberReference> &list) :
+ BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>(list) {}
+};
+
+class MemberHandler : public IDefine,
+ public IProperty,
+ public IVariable,
+ public ITypedef,
+ public IFunction,
+ public ISignal,
+ public IPrototype,
+ public IFriend,
+ public IDCOP,
+ public ISlot,
+ public IEnum,
+ public IEnumValue,
+ public BaseHandler<MemberHandler>
+{
+ public:
+ virtual void startMember(const QXmlAttributes& attrib);
+ virtual void endMember();
+ virtual void startParam(const QXmlAttributes& attrib);
+ virtual void startType(const QXmlAttributes& attrib);
+ virtual void startName(const QXmlAttributes& attrib);
+ virtual void endName();
+ virtual void startRead(const QXmlAttributes& attrib);
+ virtual void endRead();
+ virtual void startWrite(const QXmlAttributes& attrib);
+ virtual void endWrite();
+ virtual void startDefinition(const QXmlAttributes& attrib);
+ virtual void endDefinition();
+ virtual void startArgsString(const QXmlAttributes& attrib);
+ virtual void endArgsString();
+ virtual void startBriefDesc(const QXmlAttributes& attrib);
+ virtual void startDetailedDesc(const QXmlAttributes& attrib);
+ virtual void startInbodyDesc(const QXmlAttributes& attrib);
+ virtual void startLocation(const QXmlAttributes& attrib);
+ virtual void startReferences(const QXmlAttributes& attrib);
+ virtual void endReferences();
+ virtual void startReferencedBy(const QXmlAttributes& attrib);
+ virtual void endReferencedBy();
+ virtual void startReimplements(const QXmlAttributes& attrib);
+ virtual void endReimplements();
+ virtual void startReimplementedBy(const QXmlAttributes& attrib);
+ virtual void endReimplementedBy();
+ virtual void startInitializer(const QXmlAttributes& attrib);
+ virtual void startException(const QXmlAttributes& attrib);
+ virtual void startEnumValue(const QXmlAttributes& attrib);
+ virtual void startEnumValue2(const QXmlAttributes& attrib);
+ virtual void startTemplateParamList(const QXmlAttributes &attrib);
+ virtual void endTemplateParamList();
+
+ MemberHandler(IBaseHandler *parent);
+ virtual ~MemberHandler();
+
+ // IMember implementation
+ virtual ICompound *compound() const;
+ virtual ISection *section() const;
+ virtual MemberKind kind() const
+ { return m_kind; }
+ virtual const IString *kindString() const
+ { return &m_kindString; }
+ virtual const IString *id() const
+ { return &m_id; }
+ virtual const IString *protection() const
+ { return &m_protection; }
+ virtual const IString *virtualness() const
+ { return &m_virtualness; }
+ virtual const IString *name() const
+ { return &m_name; }
+ virtual const IString *readAccessor() const
+ { return &m_read; }
+ virtual const IString *writeAccessor() const
+ { return &m_write; }
+ virtual const IString *definition() const
+ { return &m_definition; }
+ virtual const IString *argsstring() const
+ { return &m_argsstring; }
+ virtual bool isConst() const
+ { return m_isConst; }
+ virtual bool isVolatile() const
+ { return m_isVolatile; }
+ virtual bool isStatic() const
+ { return m_isStatic; }
+ virtual bool isExplicit() const
+ { return m_isExplicit; }
+ virtual bool isInline() const
+ { return m_isInline; }
+ virtual bool isMutable() const
+ { return m_isMutable; }
+ virtual bool isReadable() const
+ { return m_isReadable; }
+ virtual bool isWritable() const
+ { return m_isWritable; }
+ virtual ILinkedTextIterator *type() const;
+ virtual const IString *typeString() const;
+ virtual IParamIterator *parameters() const;
+ virtual IParamIterator *templateParameters() const;
+ virtual IMemberReferenceIterator *references() const;
+ virtual IMemberReferenceIterator *referencedBy() const;
+ virtual ILinkedTextIterator *initializer() const;
+ virtual ILinkedTextIterator *exceptions() const;
+ virtual const IString *bodyFile() const
+ { return &m_bodyFile; }
+ virtual int bodyStart() const
+ { return m_bodyStart; }
+ virtual int bodyEnd() const
+ { return m_bodyEnd; }
+ virtual const IString *definitionFile() const
+ { return &m_defFile; }
+ virtual int definitionLine() const
+ { return m_defLine; }
+ virtual IMemberReference *reimplements() const
+ { return m_reimplements; }
+ virtual IMemberReferenceIterator *reimplementedBy() const;
+ virtual IDocRoot *briefDescription() const;
+ virtual IDocRoot *detailedDescription() const;
+ virtual IDocRoot *inbodyDescription() const;
+
+ // IEnum
+ virtual IMemberIterator *enumValues() const;
+
+ void initialize(MainHandler *m);
+ void setCompoundHandler(CompoundHandler *c);
+ void setSectionHandler(SectionHandler *s);
+
+ private:
+ // XML elements:
+ // -----------------
+ QList<ParamHandler> m_templateParams; // templateparamlist
+ QList<LinkedTextImpl> m_type; // type
+ StringImpl m_definition; // definition
+ StringImpl m_argsstring; // argsstring
+ StringImpl m_name; // name
+ StringImpl m_read; // read
+ StringImpl m_write; // write
+ MemberReference *m_reimplements; // reimplements
+ QList<MemberReference> m_reimplementedBy; // reimplementedby
+ QList<ParamHandler> m_params; // param
+ QList<MemberHandler> m_enumValues; // enumvalue
+ QList<LinkedTextImpl> m_initializer; // initializer
+ QList<LinkedTextImpl> m_exception; // exceptions
+ DocHandler *m_brief; // briefdescription
+ DocHandler *m_detailed; // detaileddescription
+ DocHandler *m_inbody; // inbodydescription
+ // location
+ StringImpl m_defFile; // - file
+ int m_defLine; // - line
+ StringImpl m_bodyFile; // - bodyfile
+ int m_bodyStart; // - bodystart
+ int m_bodyEnd; // - bodyend
+ QList<MemberReference> m_references; // references
+ QList<MemberReference> m_referencedBy; // referencedby
+
+ // XML attributes:
+ // ---------------
+ MemberKind m_kind; // kind
+ StringImpl m_kindString; // kind as a string
+ StringImpl m_id; // id
+ StringImpl m_protection; // prot
+ bool m_isStatic; // static
+ bool m_isConst; // const
+ bool m_isExplicit; // explicit
+ bool m_isInline; // inline
+ StringImpl m_virtualness; // virt
+ bool m_isVolatile; // volatile
+ bool m_isMutable; // mutable
+ bool m_isReadable; // readable
+ bool m_isWritable; // writable
+
+ CompoundHandler *m_compound;
+ SectionHandler *m_section;
+ StringImpl m_typeString;
+ LinkedTextHandler *m_linkedTextHandler;
+ bool m_insideTemplateParamList;
+ bool m_hasTemplateParamList;
+ IBaseHandler *m_parent;
+};
+
+class MemberIterator : public BaseIteratorVia<IMemberIterator,
+ IMember,
+ MemberHandler,
+ IFunction>
+{
+ public:
+ MemberIterator(const QList<MemberHandler> &list) :
+ BaseIteratorVia<IMemberIterator,IMember,MemberHandler,IFunction>(list) {}
+};
+
+void memberhandler_init();
+void memberhandler_exit();
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/paramhandler.cpp b/trunk/addon/doxmlparser/src/paramhandler.cpp
new file mode 100644
index 0000000..733dde4
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/paramhandler.cpp
@@ -0,0 +1,158 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "paramhandler.h"
+#include "memberhandler.h"
+#include "linkedtexthandler.h"
+#include "debug.h"
+#include "dochandler.h"
+
+TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ addStartHandler("param",this,&TemplateParamListHandler::startParam);
+
+ addEndHandler("templateparamlist",this,&TemplateParamListHandler::endTemplateParamList);
+}
+
+void TemplateParamListHandler::startParam(const QXmlAttributes& attrib)
+{
+ ParamHandler *ph = new ParamHandler(this);
+ ph->startParam(attrib);
+ m_templateParams.append(ph);
+}
+
+void TemplateParamListHandler::endParam()
+{
+}
+
+void TemplateParamListHandler::startTemplateParamList(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"templateparamlist\n");
+}
+
+void TemplateParamListHandler::endTemplateParamList()
+{
+ m_parent->setDelegate(0);
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ParamHandler::ParamHandler(IBaseHandler *parent) : m_brief(0), m_parent(parent)
+{
+ addEndHandler("param",this,&ParamHandler::endParam);
+
+ addStartHandler("type",this,&ParamHandler::startType);
+
+ addStartHandler("declname");
+ addEndHandler("declname",this,&ParamHandler::endDeclName);
+
+ addStartHandler("defname");
+ addEndHandler("defname",this,&ParamHandler::endDefName);
+
+ addStartHandler("array");
+ addEndHandler("array",this,&ParamHandler::endArray);
+
+ addStartHandler("attribute");
+ addEndHandler("attribute",this,&ParamHandler::endAttrib);
+
+ addStartHandler("briefdescription",this,&ParamHandler::startBriefDesc);
+
+ addStartHandler("defval",this,&ParamHandler::startDefVal);
+
+ m_linkedTextHandler = 0;
+}
+
+ParamHandler::~ParamHandler()
+{
+ delete m_brief;
+ delete m_linkedTextHandler;
+}
+
+void ParamHandler::startParam(const QXmlAttributes& /*attrib*/)
+{
+ m_parent->setDelegate(this);
+ debug(2,"param\n");
+}
+
+void ParamHandler::endParam()
+{
+ m_parent->setDelegate(0);
+}
+
+void ParamHandler::startType(const QXmlAttributes& /*attrib*/)
+{
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_type);
+ m_linkedTextHandler->start("type");
+ debug(2,"param type\n");
+}
+
+void ParamHandler::endDeclName()
+{
+ m_declName = m_curString.stripWhiteSpace();
+ debug(2,"member declName=`%s'\n",m_declName.data());
+}
+
+void ParamHandler::endDefName()
+{
+ m_defName = m_curString.stripWhiteSpace();
+ debug(2,"member defName=`%s'\n",m_defName.data());
+}
+
+void ParamHandler::endAttrib()
+{
+ m_attrib = m_curString.stripWhiteSpace();
+ debug(2,"member attrib=`%s'\n",m_attrib.data());
+}
+
+void ParamHandler::endArray()
+{
+ m_array = m_curString.stripWhiteSpace();
+ debug(2,"member array=`%s'\n",m_array.data());
+}
+
+void ParamHandler::startDefVal(const QXmlAttributes& /*attrib*/)
+{
+ delete m_linkedTextHandler;
+ m_linkedTextHandler = new LinkedTextHandler(this,m_defVal);
+ m_linkedTextHandler->start("defval");
+ debug(2,"member defVal\n");
+}
+
+void ParamHandler::startBriefDesc(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_brief = docHandler;
+}
+
+ILinkedTextIterator *ParamHandler::type() const
+{
+ return new LinkedTextIterator(m_type);
+}
+
+ILinkedTextIterator *ParamHandler::defaultValue() const
+{
+ return new LinkedTextIterator(m_defVal);
+}
+
+IDocRoot *ParamHandler::briefDescription() const
+{
+ return m_brief;
+}
+
+
+
diff --git a/trunk/addon/doxmlparser/src/paramhandler.h b/trunk/addon/doxmlparser/src/paramhandler.h
new file mode 100644
index 0000000..d840679
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/paramhandler.h
@@ -0,0 +1,103 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _PARAMHANDLER_H
+#define _PARAMHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <qxml.h>
+#include <doxmlintf.h>
+
+#include "stringimpl.h"
+#include "basehandler.h"
+#include "baseiterator.h"
+
+class LinkedTextImpl;
+class LinkedTextHandler;
+class DocHandler;
+
+
+class ParamHandler : public IParam, public BaseHandler<ParamHandler>
+{
+ public:
+ virtual void startParam(const QXmlAttributes& attrib);
+ virtual void endParam();
+ virtual void startType(const QXmlAttributes& attrib);
+ virtual void endDeclName();
+ virtual void endDefName();
+ virtual void endAttrib();
+ virtual void endArray();
+ virtual void startDefVal(const QXmlAttributes& attrib);
+ virtual void startBriefDesc(const QXmlAttributes& attrib);
+
+ ParamHandler(IBaseHandler *parent);
+ virtual ~ParamHandler();
+
+ // IParam
+ virtual ILinkedTextIterator *type() const;
+ virtual const IString * declarationName() const { return &m_declName; }
+ virtual const IString * definitionName() const { return &m_defName; }
+ virtual const IString * attrib() const { return &m_attrib; }
+ virtual const IString * arraySpecifier() const { return &m_array; }
+ virtual ILinkedTextIterator *defaultValue() const;
+ virtual IDocRoot *briefDescription() const;
+
+ private:
+
+ // XML elements:
+ // -------------
+ QList<LinkedTextImpl> m_type; // type
+ StringImpl m_declName; // declname
+ StringImpl m_defName; // defname
+ StringImpl m_array; // array
+ QList<LinkedTextImpl> m_defVal; // defval
+ DocHandler *m_brief; // briefdescription
+
+ StringImpl m_attrib; // TODO: not yet in XML output
+
+ IBaseHandler *m_parent;
+ LinkedTextHandler *m_linkedTextHandler;
+};
+
+class ParamIterator : public BaseIterator<IParamIterator,IParam,ParamHandler>
+{
+ public:
+ ParamIterator(const QList<ParamHandler> &list) :
+ BaseIterator<IParamIterator,IParam,ParamHandler>(list) {}
+};
+
+class TemplateParamListHandler : public BaseHandler<TemplateParamListHandler>
+{
+ public:
+
+ virtual void startParam(const QXmlAttributes& attrib);
+ virtual void endParam();
+
+ virtual void startTemplateParamList(const QXmlAttributes& attrib);
+ virtual void endTemplateParamList();
+
+ TemplateParamListHandler(IBaseHandler *parent);
+ virtual ~TemplateParamListHandler() {}
+
+ ParamIterator* templateParams() { return new ParamIterator(m_templateParams); }
+
+ protected:
+ IBaseHandler *m_parent;
+ QList<ParamHandler> m_templateParams;
+};
+
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/sectionhandler.cpp b/trunk/addon/doxmlparser/src/sectionhandler.cpp
new file mode 100644
index 0000000..403cb6f
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/sectionhandler.cpp
@@ -0,0 +1,168 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "mainhandler.h"
+#include "compoundhandler.h"
+#include "sectionhandler.h"
+#include "memberhandler.h"
+#include "dochandler.h"
+#include "debug.h"
+
+class SectionTypeMap
+{
+ public:
+ SectionTypeMap() : m_map(37)
+ {
+ m_map.setAutoDelete(TRUE);
+ m_map.insert("user-defined",new int(ISection::UserDefined));
+ m_map.insert("public-type",new int(ISection::PubTypes));
+ m_map.insert("public-func",new int(ISection::PubFuncs));
+ m_map.insert("public-attrib",new int(ISection::PubAttribs));
+ m_map.insert("public-slot",new int(ISection::PubSlots));
+ m_map.insert("signal",new int(ISection::Signals));
+ m_map.insert("dcop-func",new int(ISection::DCOPFuncs));
+ m_map.insert("property",new int(ISection::Properties));
+ m_map.insert("event",new int(ISection::Events));
+ m_map.insert("public-static-func",new int(ISection::PubStatFuncs));
+ m_map.insert("public-static-attrib",new int(ISection::PubStatAttribs));
+ m_map.insert("protected-type",new int(ISection::ProTypes));
+ m_map.insert("protected-func",new int(ISection::ProFuncs));
+ m_map.insert("protected-attrib",new int(ISection::ProAttribs));
+ m_map.insert("protected-slot",new int(ISection::ProSlots));
+ m_map.insert("protected-static-func",new int(ISection::ProStatFuncs));
+ m_map.insert("protected-static-attrib",new int(ISection::ProStatAttribs));
+ m_map.insert("package-type",new int(ISection::PacTypes));
+ m_map.insert("package-func",new int(ISection::PacFuncs));
+ m_map.insert("package-attrib",new int(ISection::PacAttribs));
+ m_map.insert("package-static-func",new int(ISection::PacStatFuncs));
+ m_map.insert("package-static-attrib",new int(ISection::PacStatAttribs));
+ m_map.insert("private-type",new int(ISection::PriTypes));
+ m_map.insert("private-func",new int(ISection::PriFuncs));
+ m_map.insert("private-attrib",new int(ISection::PriAttribs));
+ m_map.insert("private-slot",new int(ISection::PriSlots));
+ m_map.insert("private-static-func",new int(ISection::PriStatFuncs));
+ m_map.insert("private-static-attrib",new int(ISection::PriStatAttribs));
+ m_map.insert("friend",new int(ISection::Friend));
+ m_map.insert("related",new int(ISection::Related));
+ m_map.insert("define",new int(ISection::Defines));
+ m_map.insert("prototype",new int(ISection::Prototypes));
+ m_map.insert("typedef",new int(ISection::Typedefs));
+ m_map.insert("enum",new int(ISection::Enums));
+ m_map.insert("func",new int(ISection::Functions));
+ m_map.insert("var",new int(ISection::Variables));
+ }
+ ISection::SectionKind map(const QString &s)
+ {
+ int *val = m_map.find(s);
+ if (val==0)
+ {
+ debug(1,"Warning: `%s' is an invalid section type\n",s.data());
+ return ISection::Invalid;
+ }
+ else return (ISection::SectionKind)*val;
+ }
+ private:
+ QDict<int> m_map;
+};
+
+static SectionTypeMap *s_typeMap;
+
+void sectionhandler_init()
+{
+ s_typeMap = new SectionTypeMap;
+}
+
+void sectionhandler_exit()
+{
+ delete s_typeMap;
+}
+
+SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent)
+{
+ //printf("SectionHandler::SectionHandler()\n");
+ m_members.setAutoDelete(TRUE);
+ addEndHandler("sectiondef",this,&SectionHandler::endSection);
+ addStartHandler("memberdef",this,&SectionHandler::startMember);
+ addStartHandler("header",this,&SectionHandler::startHeader);
+ addEndHandler("header",this,&SectionHandler::endHeader);
+ addStartHandler("description",this,&SectionHandler::startDescription);
+}
+
+SectionHandler::~SectionHandler()
+{
+ debug(2,"SectionHandler::~SectionHandler()\n");
+}
+
+void SectionHandler::startSection(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_kindString = attrib.value("kind");
+ m_kind = s_typeMap->map(m_kindString);
+ debug(2,"section kind=`%s'\n",m_kindString.data());
+}
+
+void SectionHandler::startDescription(const QXmlAttributes& attrib)
+{
+ DocHandler *docHandler = new DocHandler(this);
+ docHandler->startDoc(attrib);
+ m_description = docHandler;
+}
+
+void SectionHandler::endSection()
+{
+ m_parent->setDelegate(0);
+}
+
+void SectionHandler::startMember(const QXmlAttributes& attrib)
+{
+ MemberHandler *memHandler = new MemberHandler(this);
+ memHandler->startMember(attrib);
+ m_members.append(memHandler);
+}
+
+void SectionHandler::startHeader(const QXmlAttributes&)
+{
+ m_header="";
+ m_curString="";
+}
+
+void SectionHandler::endHeader()
+{
+ m_header = m_curString.stripWhiteSpace();
+ debug(2,"member header=`%s'\n",m_header.data());
+}
+
+void SectionHandler::initialize(CompoundHandler *ch)
+{
+ QListIterator<MemberHandler> mli(m_members);
+ MemberHandler *mh;
+ for (;(mh=mli.current());++mli)
+ {
+ mh->setCompoundHandler(ch);
+ ch->insertMember(mh);
+ mh->setSectionHandler(this);
+ }
+}
+
+IDocRoot *SectionHandler::description() const
+{
+ return m_description;
+}
+
+IMemberIterator *SectionHandler::members() const
+{
+ return new MemberIterator(m_members);
+}
+
diff --git a/trunk/addon/doxmlparser/src/sectionhandler.h b/trunk/addon/doxmlparser/src/sectionhandler.h
new file mode 100644
index 0000000..c462b91
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/sectionhandler.h
@@ -0,0 +1,102 @@
+/******************************************************************************
+ *
+ * $Id:$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _SECTIONHANDLER_H
+#define _SECTIONHANDLER_H
+
+#include <qstring.h>
+#include <qlist.h>
+#include <qxml.h>
+#include <doxmlintf.h>
+
+#include "basehandler.h"
+
+class SectionIterator :
+ public BaseIterator<ISectionIterator,ISection,SectionHandler>
+{
+ public:
+ SectionIterator(const QList<SectionHandler> &list) :
+ BaseIterator<ISectionIterator,ISection,SectionHandler>(list) {}
+};
+
+
+class SectionHandler : public IUserDefined, public BaseHandler<SectionHandler>
+{
+ public:
+ virtual void startMember(const QXmlAttributes& attrib);
+ virtual void startHeader(const QXmlAttributes& attrib);
+ virtual void startSection(const QXmlAttributes& attrib);
+ virtual void startDescription(const QXmlAttributes& attrib);
+ virtual void endSection();
+ virtual void endHeader();
+
+ SectionHandler(IBaseHandler *parent);
+ virtual ~SectionHandler();
+
+ // ISection
+ virtual const IString *kindString() const
+ { return &m_kindString; }
+ virtual SectionKind kind() const
+ { return m_kind; }
+ IDocRoot *description() const;
+ virtual IMemberIterator *members() const;
+ virtual bool isStatic() const
+ {
+ return m_kind==PubStatFuncs || m_kind==PubStatAttribs ||
+ m_kind==ProStatFuncs || m_kind==ProStatAttribs ||
+ m_kind==PriStatFuncs || m_kind==PriStatAttribs;
+ }
+ virtual bool isPublic() const
+ {
+ return !isProtected() && !isPrivate();
+ }
+ virtual bool isProtected() const
+ {
+ return m_kind==ProTypes || m_kind==ProFuncs || m_kind==ProAttribs ||
+ m_kind==ProSlots || m_kind==ProStatFuncs || m_kind==ProStatAttribs;
+ }
+ virtual bool isPrivate() const
+ {
+ return m_kind==PriTypes || m_kind==PriFuncs || m_kind==PriAttribs ||
+ m_kind==PriSlots || m_kind==PriStatFuncs || m_kind==PriStatAttribs;
+ }
+
+ void initialize(CompoundHandler *c);
+
+ // IUserDefined implementation
+ virtual const IString *header() const
+ {
+ return &m_header;
+ }
+
+ private:
+ IBaseHandler *m_parent;
+
+ // XML elements:
+ // -------------
+ StringImpl m_header; // header
+ DocHandler* m_description; // description
+ QList<MemberHandler> m_members; // memberdef
+
+ // XML attributes:
+ // ---------------
+ SectionKind m_kind; // kind
+ StringImpl m_kindString; // kind as a string
+};
+
+void sectionhandler_init();
+void sectionhandler_exit();
+
+#endif
diff --git a/trunk/addon/doxmlparser/src/stringimpl.h b/trunk/addon/doxmlparser/src/stringimpl.h
new file mode 100644
index 0000000..013858f
--- /dev/null
+++ b/trunk/addon/doxmlparser/src/stringimpl.h
@@ -0,0 +1,30 @@
+#ifndef STRINGIMPL_H
+#define STRINGIMPL_H
+
+#include <qstring.h>
+#include "doxmlintf.h"
+
+class StringImpl : public QString, public IString
+{
+ public:
+ StringImpl() {}
+ StringImpl(const QString &str) : QString(str) {}
+ StringImpl &operator=(const QString &str)
+ { QString::operator=(str); return *this; }
+ virtual ~StringImpl() {}
+
+ // IString
+ const char *latin1() const
+ { return QString::latin1(); }
+ const char *utf8() const
+ { return QString::utf8(); }
+ unsigned short unicodeCharAt(int index) const
+ { return QString::unicode()[index].unicode(); }
+ bool isEmpty() const
+ { return QString::isEmpty(); }
+ int length() const
+ { return QString::length(); }
+};
+
+#endif
+
diff --git a/trunk/addon/doxmlparser/test/Makefile.in b/trunk/addon/doxmlparser/test/Makefile.in
new file mode 100644
index 0000000..1dfbd17
--- /dev/null
+++ b/trunk/addon/doxmlparser/test/Makefile.in
@@ -0,0 +1,13 @@
+all clean depend: Makefile.xmlparse
+ $(MAKE) -f Makefile.xmlparse $@
+
+distclean: clean
+ $(RM) -rf Makefile.xmlparse xmlparse.pro Makefile obj
+
+tmake:
+ $(ENV) $(PERL) $(TMAKE) xmlparse.pro >Makefile.xmlparse
+
+Makefile.xmlparse: xmlparse.pro
+ $(ENV) $(PERL) $(TMAKE) xmlparse.pro >Makefile.xmlparse
+
+install:
diff --git a/trunk/addon/doxmlparser/test/main.cpp b/trunk/addon/doxmlparser/test/main.cpp
new file mode 100644
index 0000000..5f37c81
--- /dev/null
+++ b/trunk/addon/doxmlparser/test/main.cpp
@@ -0,0 +1,759 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <doxmlintf.h>
+#include <qstring.h>
+
+/*! Dumps the contents of a hyperlinked text fragment as plain text to the
+ * output.
+ */
+QString linkedTextToString(ILinkedTextIterator *ti)
+{
+ QString result;
+ ILinkedText *lt=0;
+ for (ti->toFirst();(lt=ti->current());ti->toNext())
+ {
+ switch (lt->kind())
+ {
+ case ILinkedText::Kind_Text: // plain text
+ result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1(); break;
+ case ILinkedText::Kind_Ref: // a link
+ result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1(); break;
+ }
+ }
+ return result;
+}
+
+/*! Macro for printing an indented message. */
+#define InPrint(x) printf("%s",indent.latin1()), printf x;
+
+/*! Dumps the contents of a documentation block to stdout.
+ * @note This function will call itself recursively.
+ * @param doc The root of the documentation tree.
+ * @param level The indent level.
+ */
+void DumpDoc(IDoc *doc,int level)
+{
+ if (doc==0) return;
+ QString indent;
+ indent.fill(' ',level);
+ //printf(" doc node kind=`%d'\n",doc->kind());
+ switch (doc->kind())
+ {
+ case IDoc::Para:
+ {
+ InPrint(("<para>\n"));
+ IDocPara *par = dynamic_cast<IDocPara*>(doc);
+ ASSERT(par!=0);
+ IDocIterator *di = par->contents();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</para>\n"));
+ }
+ break;
+ case IDoc::Text:
+ {
+ IDocText *txt = dynamic_cast<IDocText*>(doc);
+ ASSERT(txt!=0);
+ InPrint(("<text value=`%s' markup=%d headingLevel=%d/>\n",
+ txt->text()->latin1(),txt->markup(),txt->headingLevel()));
+ }
+ break;
+ case IDoc::MarkupModifier:
+ {
+ IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc);
+ ASSERT(md!=0);
+ InPrint(("<markup modifier enabled=%d markup=%d headingLevel=%d/>\n",
+ md->enabled(),md->markup(),md->headingLevel()));
+ }
+ break;
+ case IDoc::ItemizedList:
+ {
+ InPrint(("<itemized list>\n"));
+ IDocItemizedList *list = dynamic_cast<IDocItemizedList*>(doc);
+ ASSERT(list!=0);
+ IDocIterator *di = list->elements();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</itemized list>\n"));
+ }
+ break;
+ case IDoc::OrderedList:
+ {
+ InPrint(("<ordered list>\n"));
+ IDocOrderedList *list = dynamic_cast<IDocOrderedList*>(doc);
+ ASSERT(list!=0);
+ IDocIterator *di = list->elements();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</ordered list>\n"));
+ }
+ break;
+ case IDoc::ListItem:
+ {
+ InPrint(("<list item>\n"));
+ IDocListItem *li = dynamic_cast<IDocListItem*>(doc);
+ ASSERT(li!=0);
+ IDocIterator *di = li->contents();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</list item>\n"));
+ }
+ break;
+ case IDoc::ParameterItem:
+ {
+ IDocParameterItem *item = dynamic_cast<IDocParameterItem*>(doc);
+ InPrint(("<parameter item>\n"));
+ IDocIterator *di = item->paramNames();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ DumpDoc(item->description(),level+1);
+ InPrint(("</parameter item>\n"));
+ }
+ break;
+ case IDoc::ParameterList:
+ {
+ IDocParameterList *list = dynamic_cast<IDocParameterList*>(doc);
+ InPrint(("<parameter list type=%d>\n",list->sectType()));
+ IDocIterator *di = list->params();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</parameter list>\n"));
+ ASSERT(list!=0);
+ }
+ break;
+ case IDoc::Parameter:
+ {
+ IDocParameter *par = dynamic_cast<IDocParameter*>(doc);
+ ASSERT(par!=0);
+ InPrint(("<parameter name=%s/>\n",par->name()->latin1()));
+ }
+ break;
+ case IDoc::SimpleSect:
+ {
+ IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc);
+ ASSERT(ss!=0);
+ InPrint(("<simplesect type=%s>\n",ss->typeString()->latin1()));
+ DumpDoc(ss->title(),level+1);
+ DumpDoc(ss->description(),level+1);
+ InPrint(("<simplesect/>\n"));
+ }
+ break;
+ case IDoc::Title:
+ {
+ InPrint(("<title>\n"));
+ IDocTitle *t = dynamic_cast<IDocTitle*>(doc);
+ ASSERT(t!=0);
+ IDocIterator *di = t->title();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ InPrint(("<title/>\n"));
+ }
+ break;
+ case IDoc::Ref:
+ {
+ IDocRef *ref = dynamic_cast<IDocRef*>(doc);
+ ASSERT(ref!=0);
+ InPrint(("<ref id=%s text=%s/>\n",
+ ref->refId()->latin1(),ref->text()->latin1()));
+ }
+ break;
+ case IDoc::VariableList:
+ {
+ InPrint(("<variablelist>\n"));
+ IDocVariableList *vl = dynamic_cast<IDocVariableList*>(doc);
+ ASSERT(vl!=0);
+ IDocIterator *di = vl->entries();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("<variablelist/>\n"));
+ }
+ break;
+ case IDoc::VariableListEntry:
+ {
+ IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc);
+ ASSERT(vle!=0);
+ ILinkedTextIterator *lti = vle->term();
+ QString term = linkedTextToString(lti);
+ lti->release();
+ InPrint(("<variablelistentry term=%s>\n",term.latin1()));
+ DumpDoc(vle->description(),level+1);
+ InPrint(("<variablelistentry/>\n"));
+ }
+ break;
+ case IDoc::HRuler:
+ {
+ IDocHRuler *hr = dynamic_cast<IDocHRuler*>(doc);
+ ASSERT(hr!=0);
+ InPrint(("<hruler/>\n"));
+ }
+ break;
+ case IDoc::LineBreak:
+ {
+ IDocLineBreak *lb = dynamic_cast<IDocLineBreak*>(doc);
+ ASSERT(lb!=0);
+ InPrint(("<linebreak/>\n"));
+ }
+ break;
+ case IDoc::ULink:
+ {
+ IDocULink *ul = dynamic_cast<IDocULink*>(doc);
+ ASSERT(ul!=0);
+ InPrint(("<ulink url=`%s' text=`%s'/>\n",ul->url()->latin1(),ul->text()->latin1()));
+ }
+ break;
+ case IDoc::EMail:
+ {
+ IDocEMail *em = dynamic_cast<IDocEMail*>(doc);
+ ASSERT(em!=0);
+ InPrint(("<email address=`%s'/>\n",em->address()->latin1()));
+ }
+ break;
+ case IDoc::Link:
+ {
+ IDocLink *lk = dynamic_cast<IDocLink*>(doc);
+ ASSERT(lk!=0);
+ InPrint(("<link refid=`%s' text=`%s'/>\n",lk->refId()->latin1(),lk->text()->latin1()));
+ }
+ break;
+ case IDoc::ProgramListing:
+ {
+ IDocProgramListing *pl = dynamic_cast<IDocProgramListing*>(doc);
+ ASSERT(pl!=0);
+ InPrint(("<programlisting>\n"));
+ IDocIterator *cli = pl->codeLines();
+ IDoc *cl;
+ for (cli->toFirst();(cl=cli->current());cli->toNext())
+ {
+ DumpDoc(cl,level+1);
+ }
+ cli->release();
+ InPrint(("</programlisting>\n"));
+ }
+ break;
+ case IDoc::CodeLine:
+ {
+ IDocCodeLine *cl = dynamic_cast<IDocCodeLine*>(doc);
+ ASSERT(cl!=0);
+ InPrint(("<codeline lineNumber=%d refId=`%s'>\n",cl->lineNumber(),cl->refId()->latin1()));
+ IDocIterator *cei = cl->codeElements();
+ IDoc *ce;
+ for (cei->toFirst();(ce=cei->current());cei->toNext())
+ {
+ DumpDoc(ce,level+1);
+ }
+ cei->release();
+ InPrint(("</codeline>\n"));
+ }
+ break;
+ case IDoc::Highlight:
+ {
+ IDocHighlight *hl = dynamic_cast<IDocHighlight*>(doc);
+ ASSERT(hl!=0);
+ InPrint(("<highlight kind=%d>\n",hl->kind()));
+ IDocIterator *cei = hl->codeElements();
+ IDoc *ce;
+ for (cei->toFirst();(ce=cei->current());cei->toNext())
+ {
+ DumpDoc(ce,level+1);
+ }
+ cei->release();
+ InPrint(("</highlight>\n"));
+ }
+ break;
+ case IDoc::Formula:
+ {
+ IDocFormula *fm = dynamic_cast<IDocFormula*>(doc);
+ ASSERT(fm!=0);
+ InPrint(("<formula id=`%s' text=`%s'/>\n",fm->id()->latin1(),fm->text()->latin1()));
+ }
+ break;
+ case IDoc::Image:
+ {
+ IDocImage *img = dynamic_cast<IDocImage*>(doc);
+ ASSERT(img!=0);
+ InPrint(("<image name=`%s' caption=`%s'/>\n",img->name()->latin1(),img->caption()->latin1()));
+ }
+ break;
+ case IDoc::DotFile:
+ {
+ IDocDotFile *df = dynamic_cast<IDocDotFile*>(doc);
+ ASSERT(df!=0);
+ InPrint(("<dotfile name=`%s' caption=`%s'/>\n",df->name()->latin1(),df->caption()->latin1()));
+ }
+ break;
+ case IDoc::IndexEntry:
+ {
+ IDocIndexEntry *ie = dynamic_cast<IDocIndexEntry*>(doc);
+ ASSERT(ie!=0);
+ InPrint(("<indexentry primary=`%s' secondary=`%s'/>\n",ie->primary()->latin1(),ie->secondary()->latin1()));
+ }
+ break;
+ case IDoc::Table:
+ {
+ IDocTable *tbl = dynamic_cast<IDocTable*>(doc);
+ ASSERT(tbl!=0);
+ InPrint(("<table numcols=%d caption=`%s'>\n",tbl->numColumns(),tbl->caption()->latin1()));
+ IDocIterator *ri = tbl->rows();
+ IDoc *row;
+ for (ri->toFirst();(row=ri->current());ri->toNext())
+ {
+ DumpDoc(row,level+1);
+ }
+ ri->release();
+ InPrint(("</table>\n"));
+ }
+ break;
+ case IDoc::Row:
+ {
+ IDocRow *row = dynamic_cast<IDocRow*>(doc);
+ ASSERT(row!=0);
+ InPrint(("<row>\n"));
+ IDocIterator *ei = row->entries();
+ IDoc *e;
+ for (ei->toFirst();(e=ei->current());ei->toNext())
+ {
+ DumpDoc(e,level+1);
+ }
+ ei->release();
+ InPrint(("</row>\n"));
+ }
+ break;
+ case IDoc::Entry:
+ {
+ IDocEntry *ent = dynamic_cast<IDocEntry*>(doc);
+ ASSERT(ent!=0);
+ InPrint(("<entry>\n"));
+ IDocIterator *di = ent->contents();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</entry>\n"));
+ }
+ break;
+ case IDoc::Section:
+ {
+ IDocSection *sec = dynamic_cast<IDocSection*>(doc);
+ ASSERT(sec!=0);
+ InPrint(("<section id=`%s' level=%d>\n",
+ sec->id()->latin1(),sec->level()));
+ DumpDoc(sec->title(),level+1);
+ IDocIterator *di = sec->paragraphs();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di=sec->subSections();
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ IDocInternal *intern = sec->internal();
+ if (intern)
+ {
+ DumpDoc(intern,level+1);
+ }
+ InPrint(("</section>\n"));
+ }
+ break;
+ case IDoc::Internal:
+ {
+ IDocInternal *intern = dynamic_cast<IDocInternal*>(doc);
+ ASSERT(intern!=0);
+ InPrint(("<internal>\n"));
+ IDocIterator *di = intern->paragraphs();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di=intern->subSections();
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ InPrint(("</internal>\n"));
+ }
+ break;
+ case IDoc::Copy:
+ {
+ IDocCopy *cpy = dynamic_cast<IDocCopy*>(doc);
+ ASSERT(cpy!=0);
+ InPrint(("<copydoc>\n"));
+ IDocIterator *di = cpy->contents();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("<copydoc/>\n"));
+ }
+ break;
+ case IDoc::TocItem:
+ {
+ IDocTocItem *ti = dynamic_cast<IDocTocItem*>(doc);
+ ASSERT(ti!=0);
+ InPrint(("<tocitem id=\"%s\" title=\"%s\"/>\n",
+ ti->id()->latin1(),ti->title()->latin1()));
+ }
+ break;
+ case IDoc::TocList:
+ {
+ IDocTocList *tl = dynamic_cast<IDocTocList*>(doc);
+ ASSERT(tl!=0);
+ InPrint(("<toclist>\n"));
+ IDocIterator *di = tl->elements();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("<toclist/>\n"));
+ }
+ break;
+ case IDoc::Verbatim:
+ {
+ IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc);
+ ASSERT(vt!=0);
+ const char *s=0;
+ switch (vt->type())
+ {
+ case IDocVerbatim::Verbatim: s="verbatim"; break;
+ case IDocVerbatim::HtmlOnly: s="htmlonly"; break;
+ case IDocVerbatim::LatexOnly: s="latexonly"; break;
+ default:
+ printf("Invalid verbatim type!\n");
+ }
+ InPrint(("<verbatim %s>\n",s));
+ InPrint(("%s",vt->text()->latin1()));
+ InPrint(("</verbatim>\n"));
+ }
+ break;
+ case IDoc::Anchor:
+ {
+ IDocAnchor *anc = dynamic_cast<IDocAnchor*>(doc);
+ ASSERT(anc!=0);
+ InPrint(("<anchor id='%s'/>\n",anc->id()->latin1()));
+ }
+ break;
+ case IDoc::Symbol:
+ {
+ IDocSymbol *sym = dynamic_cast<IDocSymbol*>(doc);
+ ASSERT(sym!=0);
+ InPrint(("<symbol type=%s letter=%c/>\n",
+ sym->typeString()->latin1(),sym->letter()));
+ }
+ break;
+ case IDoc::Root:
+ {
+ InPrint(("<root>\n"));
+ IDocRoot *root = dynamic_cast<IDocRoot*>(doc);
+ ASSERT(root!=0);
+ IDocIterator *di = root->contents();
+ IDoc *pdoc;
+ for (di->toFirst();(pdoc=di->current());di->toNext())
+ {
+ DumpDoc(pdoc,level+1);
+ }
+ di->release();
+ InPrint(("</root>\n"));
+ }
+ break;
+
+ default:
+ printf("Found unsupported node type %d!\n",doc->kind());
+ break;
+ }
+}
+
+void DumpGraph(IGraph *graph)
+{
+ if (graph==0) { printf(" --- no graph ---\n"); return; }
+ printf(" --- graph ----\n");
+ INodeIterator *ni = graph->nodes();
+ INode *node;
+ for (ni->toFirst();(node=ni->current());ni->toNext())
+ {
+ printf(" --- node id=%s label=%s linkId=%s\n",
+ node->id()->latin1(),
+ node->label()->latin1(),
+ node->linkId()->latin1()
+ );
+ IChildNodeIterator *cni = node->children();
+ IChildNode *cn;
+ for (cni->toFirst();(cn=cni->current());cni->toNext())
+ {
+ printf(" + child id=%s label=%s relation=%s\n",
+ cn->node()->id()->latin1(),
+ cn->node()->label()->latin1(),
+ cn->relationString()->latin1()
+ );
+ IEdgeLabelIterator *eli = cn->edgeLabels();
+ IEdgeLabel *el;
+ for (eli->toFirst();(el=eli->current());eli->toNext())
+ {
+ printf(" edgeLabel=%s\n",el->label()->latin1());
+ }
+ eli->release();
+ }
+ cni->release();
+ }
+ ni->release();
+ printf(" --- end graph ----\n");
+
+}
+
+void DumpParamList(IParamIterator *pli,int indent)
+{
+ QString indentStr;
+ indentStr.fill(' ',indent);
+ IParam *par;
+ for (pli->toFirst();(par=pli->current());pli->toNext())
+ {
+ ILinkedTextIterator *lti = par->type();
+ QString parType = linkedTextToString(lti);
+ lti->release();
+ lti = par->defaultValue();
+ QString defVal = linkedTextToString(lti);
+ lti->release();
+ printf("%sParam type=%s decl_name=%s def_name=%s defvalue=%s\n",
+ indentStr.data(), parType.latin1(),
+ par->declarationName()->latin1(),
+ par->definitionName()->latin1(),
+ defVal.latin1());
+ }
+}
+
+int main(int argc,char **argv)
+{
+ if (argc!=2)
+ {
+ printf("Usage: %s xmldir\n",argv[0]);
+ exit(1);
+ }
+
+ IDoxygen *dox = createObjectModel();
+
+ dox->setDebugLevel(4);
+
+ if (!dox->readXMLDir(argv[1]))
+ {
+ printf("Error reading %s/index.xml\n",argv[1]);
+ exit(1);
+ }
+
+ ICompoundIterator *cli = dox->compounds();
+ ICompound *comp;
+ printf("--- compound list ---------\n");
+ for (cli->toFirst();(comp=cli->current());cli->toNext())
+ {
+ printf("Compound name=%s id=%s kind=%s\n",
+ comp->name()->latin1(),comp->id()->latin1(),comp->kindString()->latin1());
+
+ ISectionIterator *sli = comp->sections();
+ ISection *sec;
+ for (sli->toFirst();(sec=sli->current());sli->toNext())
+ {
+ printf(" Section kind=%s\n",sec->kindString()->latin1());
+ IMemberIterator *mli = sec->members();
+ IMember *mem;
+ if( sec->kind() == ISection::UserDefined )
+ {
+ IUserDefined *group = dynamic_cast<IUserDefined*>(sec);
+ printf(" Title=%s\n", group->header()->latin1() );
+ }
+ for (mli->toFirst();(mem=mli->current());mli->toNext())
+ {
+ ILinkedTextIterator *lti = mem->type();
+ printf(" Member type=%s name=%s\n",
+ linkedTextToString(lti).latin1(),mem->name()->latin1());
+ lti->release();
+
+ IParamIterator *pli = mem->parameters();
+ DumpParamList(pli,6);
+ pli->release();
+ IMemberReferenceIterator *mri = mem->references();
+ IMemberReference *mr;
+ for (mri->toFirst();(mr=mri->current());mri->toNext())
+ {
+ IMember *memr = mr->member();
+ printf(" References %s at line %d\n",
+ mr->name()->latin1(),memr->bodyStart());
+ }
+
+ mri->release();
+ mri = mem->referencedBy();
+ for (mri->toFirst();(mr=mri->current());mri->toNext())
+ {
+ IMember *memr = mr->member();
+ printf(" ReferencedBy %s at line %d\n",
+ mr->name()->latin1(),memr->bodyStart());
+ }
+ mri->release();
+
+ if (mem->kind()==IMember::Enum) // we have found an enum
+ {
+ IEnum *e = dynamic_cast<IEnum*>(mem);
+ IMemberIterator *evi = e->enumValues(); // get the enum values
+ IMember *mev;
+ for (evi->toFirst();(mev=evi->current());evi->toNext())
+ {
+ IEnumValue *ev = dynamic_cast<IEnumValue*>(mev);
+ ILinkedTextIterator *lti = ev->initializer();
+ QString init = linkedTextToString(lti);
+ lti->release();
+ printf(" Enum value `%s' init=`%s'\n",
+ ev->name()->latin1(),init.latin1());
+ }
+ evi->release();
+ }
+
+ pli = mem->templateParameters();
+ if (pli)
+ {
+ printf(" Template parameters\n");
+ DumpParamList(pli,8);
+ pli->release();
+ }
+
+ IDoc *doc = mem->briefDescription();
+ if (doc)
+ {
+ printf("===== brief description ==== \n");
+ DumpDoc(doc,0);
+ }
+
+ doc = mem->detailedDescription();
+ if (doc)
+ {
+ printf("===== detailed description ==== \n");
+ DumpDoc(doc,0);
+ }
+ }
+ mli->release();
+ }
+ sli->release();
+
+ IDoc *doc = comp->briefDescription();
+ if (doc)
+ {
+ printf("===== brief description ==== \n");
+ DumpDoc(doc,0);
+ }
+
+ doc = comp->detailedDescription();
+ if (doc)
+ {
+ printf("===== detailed description ==== \n");
+ DumpDoc(doc,0);
+ }
+
+ if (comp->kind()==ICompound::Class)
+ {
+ IClass *cls = dynamic_cast<IClass*>(comp);
+ ASSERT(cls!=0);
+
+ printf("==== inheritance graph ==== \n");
+ DumpGraph(cls->inheritanceGraph());
+
+ printf("==== collabration graph ==== \n");
+ DumpGraph(cls->collaborationGraph());
+
+ printf("==== base classes ==== \n");
+ IRelatedCompoundIterator *bcli = cls->baseCompounds();
+ IRelatedCompound *bClass;
+ for (bcli->toFirst();(bClass=bcli->current());bcli->toNext())
+ {
+ ICompound *bc = bClass->compound();
+ printf(" + class %s\n",bc->name()->latin1());
+ bc->release();
+ }
+ bcli->release();
+
+ printf("==== derived classes ==== \n");
+ IRelatedCompoundIterator *dcli = cls->derivedCompounds();
+ IRelatedCompound *dClass;
+ for (dcli->toFirst();(dClass=dcli->current());dcli->toNext())
+ {
+ ICompound *dc = dClass->compound();
+ printf(" + class %s\n",dc->name()->latin1());
+ dc->release();
+ }
+ dcli->release();
+ }
+ else if (comp->kind()==ICompound::File)
+ {
+ IFile *file = dynamic_cast<IFile*>(comp);
+ ASSERT(file!=0);
+
+ printf("==== include dependency graph ==== \n");
+ DumpGraph(file->includeDependencyGraph());
+
+ printf("==== included by dependency graph ==== \n");
+ DumpGraph(file->includedByDependencyGraph());
+
+ printf("==== source ====\n");
+ DumpDoc(file->source(),0);
+ }
+
+ comp->release();
+ }
+ cli->release();
+ printf("---------------------------\n");
+
+ dox->release();
+
+ return 0;
+}
+
diff --git a/trunk/addon/doxmlparser/test/xmlparse.pro.in b/trunk/addon/doxmlparser/test/xmlparse.pro.in
new file mode 100644
index 0000000..cfb95be
--- /dev/null
+++ b/trunk/addon/doxmlparser/test/xmlparse.pro.in
@@ -0,0 +1,20 @@
+TEMPLATE = app.t
+CONFIG = console warn_on $extraopts
+HEADERS =
+SOURCES = main.cpp
+unix:LIBS += -L../../../lib -L../lib -ldoxmlparser -lqtools
+win32:INCLUDEPATH += .
+win32-mingw:LIBS += -L../../../lib -L../lib -ldoxmlparser -lqtools
+win32-msvc:LIBS += doxmlparser.lib qtools.lib shell32.lib
+win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\..\..\lib;..\lib
+win32-borland:LIBS += doxmlparser.lib qtools.lib shell32.lib
+win32-borland:TMAKE_LFLAGS += -L..\..\..\lib -L..\lib
+win32:TMAKE_CXXFLAGS += -DQT_NODLL
+DESTDIR =
+OBJECTS_DIR = ../objects
+TARGET = xmlparse
+INCLUDEPATH += ../../../qtools ../include
+DEPENDPATH += ../include
+unix:TARGETDEPS = ../lib/libdoxmlparser.a
+win32:TARGETDEPS = ..\lib\doxmlparser.lib
+
diff --git a/trunk/addon/doxyapp/Makefile.in b/trunk/addon/doxyapp/Makefile.in
new file mode 100644
index 0000000..c5acd67
--- /dev/null
+++ b/trunk/addon/doxyapp/Makefile.in
@@ -0,0 +1,17 @@
+
+all clean depend distclean: Makefile.doxyapp
+ $(MAKE) -f Makefile.doxyapp $@
+
+distclean: clean
+ $(RM) -rf Makefile doxyapp.pro Makefile.doxyapp
+
+tmake:
+ $(ENV) $(PERL) $(TMAKE) doxyapp.pro >Makefile.doxyapp
+
+strip:
+ strip doxyapp
+
+Makefile.doxyapp: doxyapp.pro
+ $(ENV) $(PERL) $(TMAKE) doxyapp.pro >Makefile.doxyapp
+
+install:
diff --git a/trunk/addon/doxyapp/README b/trunk/addon/doxyapp/README
new file mode 100644
index 0000000..f92e106
--- /dev/null
+++ b/trunk/addon/doxyapp/README
@@ -0,0 +1,8 @@
+This directory contains an example of how to use doxygen as
+an "source parsing engine" in an application. It shows how to configure doxygen
+from the application and shows how to run doxygen without generating output,
+and then uses the information about the symbols found in the source code.
+
+Note that if you use this approach your application should be licensed under the GPL.
+
+
diff --git a/trunk/addon/doxyapp/doxyapp.cpp b/trunk/addon/doxyapp/doxyapp.cpp
new file mode 100644
index 0000000..c6b7ed4
--- /dev/null
+++ b/trunk/addon/doxyapp/doxyapp.cpp
@@ -0,0 +1,314 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+/** @file
+ * @brief Example of how to use doxygen as part of another GPL applications
+ *
+ * This example shows how to configure and run doxygen programmatically from
+ * within an application without generating the usual output.
+ * The example should work on any Unix like OS (including Linux and Mac OS X).
+ *
+ * This example shows how to use to code parser to get cross-references information
+ * and it also shows how to look up symbols in a program parsed by doxygen and
+ * show some information about them.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include "doxygen.h"
+#include "outputgen.h"
+#include "parserintf.h"
+
+class XRefDummyCodeGenerator : public CodeOutputInterface
+{
+ public:
+ XRefDummyCodeGenerator(FileDef *fd) : m_fd(fd) {}
+ ~XRefDummyCodeGenerator() {}
+
+ // these are just null functions, they can be used to produce a syntax highlighted
+ // and cross-linked version of the source code, but who needs that anyway ;-)
+ void codify(const char *) {}
+ void writeCodeLink(const char *,const char *,const char *,const char *,const char *) {}
+ void startCodeLine() {}
+ void endCodeLine() {}
+ void startCodeAnchor(const char *) {}
+ void endCodeAnchor() {}
+ void startFontClass(const char *) {}
+ void endFontClass() {}
+ void writeCodeAnchor(const char *) {}
+ void writeLineNumber(const char *,const char *,const char *,int) {}
+
+ // here we are presented with the symbols found by the code parser
+ void linkableSymbol(int l, const char *sym,Definition *symDef,Definition *context)
+ {
+ QCString ctx;
+ if (context) // the context of the symbol is known
+ {
+ if (context->definitionType()==Definition::TypeMember) // it is inside a member
+ {
+ Definition *parentContext = context->getOuterScope();
+ if (parentContext && parentContext->definitionType()==Definition::TypeClass)
+ // it is inside a member of a class
+ {
+ ctx.sprintf("inside %s %s of %s %s",
+ ((MemberDef *)context)->memberTypeName().data(),
+ context->name().data(),
+ ((ClassDef*)parentContext)->compoundTypeString().data(),
+ parentContext->name().data());
+ }
+ else if (parentContext==Doxygen::globalScope) // it is inside a global member
+ {
+ ctx.sprintf("inside %s %s",
+ ((MemberDef *)context)->memberTypeName().data(),
+ context->name().data());
+ }
+ }
+ if (ctx.isEmpty()) // it is something else (class, or namespace member, ...)
+ {
+ ctx.sprintf("in %s",context->name().data());
+ }
+ }
+ printf("Found symbol %s at line %d of %s %s\n",
+ sym,l,m_fd->getDefFileName().data(),ctx.data());
+ if (symDef && context) // in this case the definition of the symbol is
+ // known to doxygen.
+ {
+ printf("-> defined at line %d of %s\n",
+ symDef->getDefLine(),symDef->getDefFileName().data());
+ }
+ }
+ private:
+ FileDef *m_fd;
+};
+
+static void findXRefSymbols(FileDef *fd)
+{
+ // get the interface to a parser that matches the file extension
+ ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
+
+ // reset the parsers state
+ pIntf->resetCodeParserState();
+
+ // create a new backend object
+ XRefDummyCodeGenerator *xrefGen = new XRefDummyCodeGenerator(fd);
+
+ // parse the source code
+ pIntf->parseCode(*xrefGen,
+ 0,
+ fileToString(fd->absFilePath()),
+ FALSE,
+ 0,
+ fd);
+
+ // dismiss the object.
+ delete xrefGen;
+}
+
+static void listSymbol(Definition *d)
+{
+ if (d!=Doxygen::globalScope && // skip the global namespace symbol
+ d->name().at(0)!='@' // skip anonymous stuff
+ )
+ {
+ printf("%s\n",
+ d->name().data());
+ }
+}
+
+static void listSymbols()
+{
+ QDictIterator<DefinitionIntf> sli(*Doxygen::symbolMap);
+ DefinitionIntf *di;
+ for (sli.toFirst();(di=sli.current());++sli)
+ {
+ if (di->definitionType()==DefinitionIntf::TypeSymbolList) // list of symbols
+ // with same name
+ {
+ DefinitionListIterator dli(*(DefinitionList*)di);
+ Definition *d;
+ // for each symbol
+ for (dli.toFirst();(d=dli.current());++dli)
+ {
+ listSymbol(d);
+ }
+ }
+ else // single symbol
+ {
+ listSymbol((Definition*)di);
+ }
+ }
+}
+
+static void lookupSymbol(Definition *d)
+{
+ if (d!=Doxygen::globalScope && // skip the global namespace symbol
+ d->name().at(0)!='@' // skip anonymous stuff
+ )
+ {
+ printf("Symbol info\n");
+ printf("-----------\n");
+ printf("Name: %s\n",d->name().data());
+ printf("File: %s\n",d->getDefFileName().data());
+ printf("Line: %d\n",d->getDefLine());
+ // depending on the definition type we can case to the appropriate
+ // derived to get additional information
+ switch (d->definitionType())
+ {
+ case Definition::TypeClass:
+ {
+ ClassDef *cd = (ClassDef *)d;
+ printf("Kind: %s\n",cd->compoundTypeString().data());
+ }
+ break;
+ case Definition::TypeFile:
+ {
+ FileDef *fd = (FileDef *)d;
+ printf("Kind: File: #includes %d other files\n",
+ fd->includeFileList() ? fd->includeFileList()->count() : 0);
+ }
+ break;
+ case Definition::TypeNamespace:
+ {
+ NamespaceDef *nd = (NamespaceDef *)d;
+ printf("Kind: Namespace: contains %d classes and %d namespaces\n",
+ nd->getClassSDict() ? nd->getClassSDict()->count() : 0,
+ nd->getNamespaceSDict() ? nd->getNamespaceSDict()->count() : 0);
+ }
+ break;
+ case Definition::TypeMember:
+ {
+ MemberDef *md = (MemberDef *)d;
+ printf("Kind: %s\n",md->memberTypeName().data());
+ }
+ break;
+ default:
+ // ignore groups/pages/packages/dirs for now
+ break;
+ }
+ }
+}
+
+static void lookupSymbols(const QCString &sym)
+{
+ if (!sym.isEmpty())
+ {
+ DefinitionIntf *di = Doxygen::symbolMap->find(sym);
+ if (di)
+ {
+ if (di->definitionType()==DefinitionIntf::TypeSymbolList)
+ {
+ DefinitionListIterator dli(*(DefinitionList*)di);
+ Definition *d;
+ // for each symbol with the given name
+ for (dli.toFirst();(d=dli.current());++dli)
+ {
+ lookupSymbol(d);
+ }
+ }
+ else
+ {
+ lookupSymbol((Definition*)di);
+ }
+ }
+ else
+ {
+ printf("Unknown symbol\n");
+ }
+ }
+}
+
+int main(int argc,char **argv)
+{
+ char cmd[256];
+
+ if (argc<2)
+ {
+ printf("Usage: %s [source_file | source_dir]\n",argv[0]);
+ exit(1);
+ }
+
+ // initialize data structures
+ initDoxygen();
+
+ // setup the non-default configuration options
+
+ // we need a place to put intermediate files
+ Config_getString("OUTPUT_DIRECTORY")="/tmp/doxygen";
+ // disable html output
+ Config_getBool("GENERATE_HTML")=FALSE;
+ // disable latex output
+ Config_getBool("GENERATE_LATEX")=FALSE;
+ // be quiet
+ Config_getBool("QUIET")=TRUE;
+ // turn off warnings
+ Config_getBool("WARNINGS")=FALSE;
+ Config_getBool("WARN_IF_UNDOCUMENTED")=FALSE;
+ Config_getBool("WARN_IF_DOC_ERROR")=FALSE;
+ // Extract as much as possible
+ Config_getBool("EXTRACT_ALL")=TRUE;
+ Config_getBool("EXTRACT_STATIC")=TRUE;
+ Config_getBool("EXTRACT_PRIVATE")=TRUE;
+ Config_getBool("EXTRACT_LOCAL_METHODS")=TRUE;
+ // Extract source browse information, needed
+ // to make doxygen gather the cross reference info
+ Config_getBool("SOURCE_BROWSER")=TRUE;
+
+ // set the input
+ Config_getList("INPUT").append(argv[1]);
+
+ // check and finialize the configuration
+ checkConfiguration();
+ adjustConfiguration();
+
+ // parse the files
+ parseInput();
+
+ // iterate over the input files
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ // foreach file with a certain name
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
+ {
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ // for each file definition
+ for (;(fd=fni.current());++fni)
+ {
+ // get the references (linked and unlinked) found in this file
+ findXRefSymbols(fd);
+ }
+ }
+
+ // remove temporary files
+ if (!Doxygen::objDBFileName.isEmpty()) unlink(Doxygen::objDBFileName);
+ if (!Doxygen::entryDBFileName.isEmpty()) unlink(Doxygen::entryDBFileName);
+ // clean up after us
+ rmdir("/tmp/doxygen");
+
+ while (1)
+ {
+ printf("> Type a symbol name or\n> .list for a list of symbols or\n> .quit to exit\n> ");
+ fgets(cmd,256,stdin);
+ QCString s(cmd);
+ if (s.at(s.length()-1)=='\n') s=s.left(s.length()-1); // strip trailing \n
+ if (s==".list")
+ listSymbols();
+ else if (s==".quit")
+ exit(0);
+ else
+ lookupSymbols(s);
+ }
+}
+
diff --git a/trunk/addon/doxyapp/doxyapp.pro.in b/trunk/addon/doxyapp/doxyapp.pro.in
new file mode 100644
index 0000000..68fea3d
--- /dev/null
+++ b/trunk/addon/doxyapp/doxyapp.pro.in
@@ -0,0 +1,12 @@
+TEMPLATE = app.t
+CONFIG = console warn_on debug
+HEADERS =
+SOURCES = doxyapp.cpp
+LIBS += -L../../lib -L../../lib -ldoxygen -lqtools -lmd5 -ldoxycfg -lpng
+DESTDIR =
+OBJECTS_DIR = ../../objects
+TARGET = ../../bin/doxyapp
+INCLUDEPATH += ../../qtools ../../src
+DEPENDPATH += ../../src
+TARGETDEPS = ../../lib/libdoxygen.a
+
diff --git a/trunk/addon/doxywizard/Makefile.in b/trunk/addon/doxywizard/Makefile.in
new file mode 100644
index 0000000..fa459c2
--- /dev/null
+++ b/trunk/addon/doxywizard/Makefile.in
@@ -0,0 +1,39 @@
+#
+#
+#
+# Copyright (C) 1997-2008 by Dimitri van Heesch.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation under the terms of the GNU General Public License is hereby
+# granted. No representations are made about the suitability of this software
+# for any purpose. It is provided "as is" without express or implied warranty.
+# See the GNU General Public License for more details.
+#
+
+QMAKE = qmake
+
+all: Makefile.doxywizard
+ $(MAKE) -f Makefile.doxywizard
+
+Makefile.doxywizard: doxywizard.pro
+ $(QTDIR)/bin/qmake doxywizard.pro -o Makefile.doxywizard
+
+qmake:
+ $(QTDIR)/bin/qmake doxywizard.pro -o Makefile.doxywizard
+
+clean: Makefile.doxywizard
+ $(MAKE) -f Makefile.doxywizard clean
+
+distclean: Makefile.doxywizard
+ $(MAKE) -f Makefile.doxywizard distclean
+ $(RM) Makefile.doxywizard
+
+install:
+ $(INSTTOOL) -d $(INSTALL)/bin
+ $(INSTTOOL) -m 755 ../../bin/doxywizard $(INSTALL)/bin
+ $(INSTTOOL) -d $(INSTALL)/$(MAN1DIR)
+ cat ../../doc/doxywizard.1 | sed -e "s/DATE/$(DATE)/g" -e "s/VERSION/$(VERSION)/g" > doxywizard.1
+ $(INSTTOOL) -m 644 doxywizard.1 $(INSTALL)/$(MAN1DIR)/doxywizard.1
+ rm doxywizard.1
+
+FORCE:
diff --git a/trunk/addon/doxywizard/README b/trunk/addon/doxywizard/README
new file mode 100644
index 0000000..57705f0
--- /dev/null
+++ b/trunk/addon/doxywizard/README
@@ -0,0 +1,3 @@
+Doxywizard is a graphical front-end to read/edit/write doxygen configuration
+files and to launch doxygen. It requires Qt version 4.3 or higher.
+
diff --git a/trunk/addon/doxywizard/doxywizard.cpp b/trunk/addon/doxywizard/doxywizard.cpp
new file mode 100644
index 0000000..5928524
--- /dev/null
+++ b/trunk/addon/doxywizard/doxywizard.cpp
@@ -0,0 +1,600 @@
+#include <QtGui>
+#include "doxywizard.h"
+#include "version.h"
+#include "expert.h"
+#include "wizard.h"
+
+const int messageTimeout = 5000; //!< status bar message timeout in millisec.
+
+MainWindow &MainWindow::instance()
+{
+ static MainWindow *theInstance = new MainWindow;
+ return *theInstance;
+}
+
+MainWindow::MainWindow()
+ : m_settings(QString::fromAscii("Doxygen.org"), QString::fromAscii("Doxywizard"))
+{
+ QMenu *file = menuBar()->addMenu(tr("File"));
+ file->addAction(tr("Open..."),
+ this, SLOT(openConfig()), Qt::CTRL+Qt::Key_O);
+ m_recentMenu = file->addMenu(tr("Open recent"));
+ file->addAction(tr("Save"),
+ this, SLOT(saveConfig()), Qt::CTRL+Qt::Key_S);
+ file->addAction(tr("Save as..."),
+ this, SLOT(saveConfigAs()), Qt::SHIFT+Qt::CTRL+Qt::Key_S);
+ file->addAction(tr("Quit"),
+ this, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
+
+ QMenu *settings = menuBar()->addMenu(tr("Settings"));
+ settings->addAction(tr("Reset to factory defaults"),
+ this,SLOT(resetToDefaults()));
+ settings->addAction(tr("Use current settings at startup"),
+ this,SLOT(makeDefaults()));
+
+ QMenu *help = menuBar()->addMenu(tr("Help"));
+ help->addAction(tr("Online manual"),
+ this, SLOT(manual()), Qt::Key_F1);
+ help->addAction(tr("About"),
+ this, SLOT(about()) );
+
+ m_expert = new Expert;
+ m_wizard = new Wizard(m_expert->modelData());
+
+ // ----------- top part ------------------
+ QWidget *topPart = new QWidget;
+ QVBoxLayout *rowLayout = new QVBoxLayout(topPart);
+
+ // select working directory
+ QHBoxLayout *dirLayout = new QHBoxLayout;
+ m_workingDir = new QLineEdit;
+ m_selWorkingDir = new QPushButton(tr("Select..."));
+ dirLayout->addWidget(m_workingDir);
+ dirLayout->addWidget(m_selWorkingDir);
+
+ //------------- bottom part --------------
+ QWidget *runTab = new QWidget;
+ QVBoxLayout *runTabLayout = new QVBoxLayout(runTab);
+
+ // run doxygen
+ QHBoxLayout *runLayout = new QHBoxLayout;
+ m_run = new QPushButton(tr("Run doxygen"));
+ m_run->setEnabled(false);
+ m_runStatus = new QLabel(tr("Status: not running"));
+ m_saveLog = new QPushButton(tr("Save log..."));
+ m_saveLog->setEnabled(false);
+ QPushButton *showSettings = new QPushButton(tr("Show configuration"));
+ runLayout->addWidget(m_run);
+ runLayout->addWidget(m_runStatus);
+ runLayout->addStretch(1);
+ runLayout->addWidget(showSettings);
+ runLayout->addWidget(m_saveLog);
+
+ // output produced by doxygen
+ runTabLayout->addLayout(runLayout);
+ runTabLayout->addWidget(new QLabel(tr("Output produced by doxygen")));
+ QGridLayout *grid = new QGridLayout;
+ m_outputLog = new QTextEdit;
+ m_outputLog->setReadOnly(true);
+ m_outputLog->setFontFamily(QString::fromAscii("courier"));
+ m_outputLog->setMinimumWidth(600);
+ grid->addWidget(m_outputLog,0,0);
+ grid->setColumnStretch(0,1);
+ grid->setRowStretch(0,1);
+ QHBoxLayout *launchLayout = new QHBoxLayout;
+ m_launchHtml = new QPushButton(tr("Show HTML output"));
+ launchLayout->addWidget(m_launchHtml);
+
+#if 0
+ m_launchPdf = new QPushButton(tr("Show PDF output"));
+ launchLayout->addWidget(m_launchPdf);
+#endif
+ launchLayout->addStretch(1);
+ grid->addLayout(launchLayout,1,0);
+ runTabLayout->addLayout(grid);
+
+ QTabWidget *tabs = new QTabWidget;
+ tabs->addTab(m_wizard,tr("Wizard"));
+ tabs->addTab(m_expert,tr("Expert"));
+ tabs->addTab(runTab,tr("Run"));
+
+ rowLayout->addWidget(new QLabel(tr("Step 1: Specify the working directory from which doxygen will run")));
+ rowLayout->addLayout(dirLayout);
+ rowLayout->addWidget(new QLabel(tr("Step 2: Configure doxygen using the Wizard and/or Expert tab, then switch to the Run tab to generate the documentation")));
+ rowLayout->addWidget(tabs);
+
+ setCentralWidget(topPart);
+ statusBar()->showMessage(tr("Welcome to Doxygen"),messageTimeout);
+ loadSettings();
+
+ m_runProcess = new QProcess;
+ m_running = false;
+ m_timer = new QTimer;
+ updateLaunchButtonState();
+ m_modified = false;
+ updateTitle();
+
+ // connect signals and slots
+ connect(tabs,SIGNAL(currentChanged(int)),SLOT(selectTab(int)));
+ connect(m_selWorkingDir,SIGNAL(clicked()),SLOT(selectWorkingDir()));
+ connect(m_recentMenu,SIGNAL(triggered(QAction*)),SLOT(openRecent(QAction*)));
+ connect(m_workingDir,SIGNAL(returnPressed()),SLOT(updateWorkingDir()));
+ connect(m_runProcess,SIGNAL(readyReadStandardOutput()),SLOT(readStdout()));
+ connect(m_runProcess,SIGNAL(finished(int, QProcess::ExitStatus)),SLOT(runComplete()));
+ connect(m_timer,SIGNAL(timeout()),SLOT(readStdout()));
+ connect(m_run,SIGNAL(clicked()),SLOT(runDoxygen()));
+ connect(m_launchHtml,SIGNAL(clicked()),SLOT(showHtmlOutput()));
+ connect(m_saveLog,SIGNAL(clicked()),SLOT(saveLog()));
+ connect(showSettings,SIGNAL(clicked()),SLOT(showSettings()));
+ connect(m_expert,SIGNAL(changed()),SLOT(configChanged()));
+}
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ if (discardUnsavedChanges())
+ {
+ saveSettings();
+ event->accept();
+ }
+ else
+ {
+ event->ignore();
+ }
+}
+
+void MainWindow::quit()
+{
+ if (discardUnsavedChanges())
+ {
+ saveSettings();
+ }
+ QApplication::exit(0);
+}
+
+void MainWindow::setWorkingDir(const QString &dirName)
+{
+ QDir::setCurrent(dirName);
+ m_workingDir->setText(dirName);
+ m_run->setEnabled(!dirName.isEmpty());
+}
+
+void MainWindow::selectWorkingDir()
+{
+ QString dirName = QFileDialog::getExistingDirectory(this,
+ tr("Select working directory"),m_workingDir->text());
+ if (!dirName.isEmpty())
+ {
+ setWorkingDir(dirName);
+ }
+}
+
+void MainWindow::updateWorkingDir()
+{
+ setWorkingDir(m_workingDir->text());
+}
+
+void MainWindow::manual()
+{
+ QDesktopServices::openUrl(QUrl(QString::fromAscii("http://www.doxygen.org/manual.html")));
+}
+
+void MainWindow::about()
+{
+ QString msg;
+ QTextStream t(&msg,QIODevice::WriteOnly);
+ t << QString::fromAscii("<qt><center>A tool to configure and run doxygen version ")+
+ QString::fromAscii(versionString)+
+ QString::fromAscii(" on your source files.</center><p><br>"
+ "<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2008</center><p>"
+ "</qt>");
+ QMessageBox::about(this,tr("Doxygen GUI"),msg);
+}
+
+void MainWindow::openConfig()
+{
+ if (discardUnsavedChanges(false))
+ {
+ QString fn = QFileDialog::getOpenFileName(this,
+ tr("Open configuration file"),
+ m_workingDir->text());
+ if (!fn.isEmpty())
+ {
+ loadConfigFromFile(fn);
+ }
+ }
+}
+
+void MainWindow::updateConfigFileName(const QString &fileName)
+{
+ if (m_fileName!=fileName)
+ {
+ m_fileName = fileName;
+ QString curPath = QFileInfo(fileName).path();
+ setWorkingDir(curPath);
+ addRecentFile(fileName);
+ updateTitle();
+ }
+}
+
+void MainWindow::loadConfigFromFile(const QString & fileName)
+{
+ m_expert->loadConfig(fileName);
+ m_wizard->refresh();
+ updateConfigFileName(fileName);
+ updateLaunchButtonState();
+ m_modified = false;
+ updateTitle();
+}
+
+void MainWindow::saveConfig(const QString &fileName)
+{
+ if (fileName.isEmpty()) return;
+ QFile f(fileName);
+ if (!f.open(QIODevice::WriteOnly)) return;
+ QTextStream t(&f);
+ m_expert->writeConfig(t,false);
+ updateConfigFileName(fileName);
+ m_modified = false;
+ updateTitle();
+}
+
+bool MainWindow::saveConfig()
+{
+ if (m_fileName.isEmpty())
+ {
+ return saveConfigAs();
+ }
+ else
+ {
+ saveConfig(m_fileName);
+ return true;
+ }
+}
+
+bool MainWindow::saveConfigAs()
+{
+ QString fileName = QFileDialog::getSaveFileName(this, QString(),
+ m_workingDir->text()+QString::fromAscii("/Doxyfile"));
+ if (fileName.isEmpty()) return false;
+ saveConfig(fileName);
+ return true;
+}
+
+void MainWindow::makeDefaults()
+{
+ if (QMessageBox::question(this,tr("Use current setting at startup?"),
+ tr("Do you want to save the current settings "
+ "and use them next time Doxywizard starts?"),
+ QMessageBox::Save|
+ QMessageBox::Cancel)==QMessageBox::Save)
+ {
+ //printf("MainWindow:makeDefaults()\n");
+ m_expert->saveSettings(&m_settings);
+ m_settings.setValue(QString::fromAscii("wizard/loadsettings"), true);
+ }
+}
+
+void MainWindow::resetToDefaults()
+{
+ if (QMessageBox::question(this,tr("Reset settings to their default values?"),
+ tr("Do you want to revert all settings back "
+ "to their original values?"),
+ QMessageBox::Reset|
+ QMessageBox::Cancel)==QMessageBox::Reset)
+ {
+ //printf("MainWindow:resetToDefaults()\n");
+ m_expert->resetToDefaults();
+ m_settings.setValue(QString::fromAscii("wizard/loadsettings"), false);
+ m_wizard->refresh();
+ }
+}
+
+void MainWindow::loadSettings()
+{
+ QVariant geometry = m_settings.value(QString::fromAscii("main/geometry"), QVariant::Invalid);
+ QVariant state = m_settings.value(QString::fromAscii("main/state"), QVariant::Invalid);
+ QVariant expState = m_settings.value(QString::fromAscii("expert/state"), QVariant::Invalid);
+ QVariant expState2 = m_settings.value(QString::fromAscii("expert/state2"), QVariant::Invalid);
+ QVariant wizState = m_settings.value(QString::fromAscii("wizard/state"), QVariant::Invalid);
+ QVariant loadSettings = m_settings.value(QString::fromAscii("wizard/loadsettings"), QVariant::Invalid);
+ //QVariant workingDir = m_settings.value(QString::fromAscii("main/defdir"), QVariant::Invalid);
+
+ if (geometry !=QVariant::Invalid) restoreGeometry(geometry.toByteArray());
+ if (state !=QVariant::Invalid) restoreState (state.toByteArray());
+ if (expState !=QVariant::Invalid) m_expert->restoreState(expState.toByteArray());
+ if (expState2 !=QVariant::Invalid) m_expert->restoreInnerState(expState2.toByteArray());
+ if (wizState !=QVariant::Invalid) m_wizard->restoreState(wizState.toByteArray());
+ //if (workingDir!=QVariant::Invalid)
+ //{
+ // QString dir = workingDir.toString();
+ // m_workingDir->setText(dir);
+ // QDir::setCurrent(dir);
+ // m_run->setEnabled(!dir.isEmpty());
+ //}
+ if (loadSettings!=QVariant::Invalid && loadSettings.toBool())
+ {
+ m_expert->loadSettings(&m_settings);
+ }
+
+ for (int i=0;i<10;i++)
+ {
+ QString entry = m_settings.value(QString().sprintf("recent/config%d",i)).toString();
+ if (!entry.isEmpty()) addRecentFile(entry);
+ }
+
+}
+
+void MainWindow::saveSettings()
+{
+ QSettings settings(QString::fromAscii("Doxygen.org"), QString::fromAscii("Doxywizard"));
+
+ m_settings.setValue(QString::fromAscii("main/geometry"), saveGeometry());
+ m_settings.setValue(QString::fromAscii("main/state"), saveState());
+ m_settings.setValue(QString::fromAscii("expert/state"), m_expert->saveState());
+ m_settings.setValue(QString::fromAscii("expert/state2"), m_expert->saveInnerState());
+ m_settings.setValue(QString::fromAscii("wizard/state"), m_wizard->saveState());
+}
+
+void MainWindow::selectTab(int id)
+{
+ if (id==0) m_wizard->refresh();
+}
+
+void MainWindow::addRecentFile(const QString &fileName)
+{
+ int i=m_recentFiles.indexOf(fileName);
+ if (i!=-1) m_recentFiles.removeAt(i);
+
+ // not found
+ if (m_recentFiles.count() < 10) // append
+ {
+ m_recentFiles.prepend(fileName);
+ }
+ else // add + drop last item
+ {
+ m_recentFiles.removeLast();
+ m_recentFiles.prepend(fileName);
+ }
+ m_recentMenu->clear();
+ i=0;
+ foreach( QString str, m_recentFiles )
+ {
+ m_recentMenu->addAction(str);
+ m_settings.setValue(QString().sprintf("recent/config%d",i++),str);
+ }
+}
+
+void MainWindow::openRecent(QAction *action)
+{
+ if (discardUnsavedChanges(false))
+ {
+ loadConfigFromFile(action->text());
+ }
+}
+
+void MainWindow::runDoxygen()
+{
+ if (!m_running)
+ {
+ QString doxygenPath;
+#if defined(Q_OS_MACX)
+ doxygenPath = qApp->applicationDirPath()+QString::fromAscii("/../Resources/");
+ qDebug() << tr("Doxygen path: ") << doxygenPath;
+ if ( !QFile(doxygenPath + QString::fromAscii("doxygen")).exists() ) {
+ // No doygen binary in the resources, if there is a system doxygen binary, use that instead
+ if ( QFile(QString::fromAscii("/usr/local/bin/doxygen")).exists() )
+ doxygenPath = QString::fromAscii("/usr/local/bin/");
+ else {
+ qDebug() << tr("Can't find the doxygen command, make sure it's in your $$PATH");
+ doxygenPath = QString::fromAscii("");
+ }
+ }
+ qDebug() << tr("Getting doxygen from: ") << doxygenPath;
+#endif
+
+ m_runProcess->setReadChannel(QProcess::StandardOutput);
+ m_runProcess->setProcessChannelMode(QProcess::MergedChannels);
+ m_runProcess->setWorkingDirectory(m_workingDir->text());
+ QStringList env=QProcess::systemEnvironment();
+ // set PWD environment variable to m_workingDir
+ env.replaceInStrings(QRegExp(QString::fromAscii("^PWD=(.*)"),Qt::CaseInsensitive),
+ QString::fromAscii("PWD=")+m_workingDir->text());
+ m_runProcess->setEnvironment(env);
+
+ QStringList args;
+ args << QString::fromAscii("-b"); // make stdout unbuffered
+ args << QString::fromAscii("-"); // read config from stdin
+
+ m_outputLog->clear();
+ m_runProcess->start(doxygenPath + QString::fromAscii("doxygen"), args);
+
+ if (!m_runProcess->waitForStarted())
+ {
+ m_outputLog->append(QString::fromAscii("*** Failed to run doxygen\n"));
+ return;
+ }
+ QTextStream t(m_runProcess);
+ m_expert->writeConfig(t,false);
+ m_runProcess->closeWriteChannel();
+
+ if (m_runProcess->state() == QProcess::NotRunning)
+ {
+ m_outputLog->append(QString::fromAscii("*** Failed to run doxygen\n"));
+ }
+ else
+ {
+ m_saveLog->setEnabled(false);
+ m_running=true;
+ m_run->setText(tr("Stop doxygen"));
+ m_runStatus->setText(tr("Status: running"));
+ m_timer->start(1000);
+ }
+ }
+ else
+ {
+ m_running=false;
+ m_run->setText(tr("Run doxygen"));
+ m_runStatus->setText(tr("Status: not running"));
+ m_runProcess->kill();
+ m_timer->stop();
+ //updateRunnable(m_workingDir->text());
+ }
+}
+
+void MainWindow::readStdout()
+{
+ if (m_running)
+ {
+ QByteArray data = m_runProcess->readAllStandardOutput();
+ QString text = QString::fromLocal8Bit(data);
+ if (!text.isEmpty())
+ {
+ m_outputLog->append(text.trimmed());
+ }
+ }
+}
+
+void MainWindow::runComplete()
+{
+ if (m_running)
+ {
+ m_outputLog->append(tr("*** Doxygen has finished\n"));
+ }
+ else
+ {
+ m_outputLog->append(tr("*** Cancelled by user\n"));
+ }
+ m_outputLog->ensureCursorVisible();
+ m_run->setText(tr("Run doxygen"));
+ m_runStatus->setText(tr("Status: not running"));
+ m_running=false;
+ updateLaunchButtonState();
+ //updateRunnable(m_workingDir->text());
+ m_saveLog->setEnabled(true);
+}
+
+void MainWindow::updateLaunchButtonState()
+{
+ m_launchHtml->setEnabled(m_expert->htmlOutputPresent(m_workingDir->text()));
+#if 0
+ m_launchPdf->setEnabled(m_expert->pdfOutputPresent(m_workingDir->text()));
+#endif
+}
+
+void MainWindow::showHtmlOutput()
+{
+ QString indexFile = m_expert->getHtmlOutputIndex(m_workingDir->text());
+ QFileInfo fi(indexFile);
+#ifdef WIN32
+ QString indexUrl(QString::fromAscii("file:///"));
+#else
+ QString indexUrl(QString::fromAscii("file://"));
+#endif
+ indexUrl+=fi.absoluteFilePath();
+ QDesktopServices::openUrl(QUrl(indexUrl));
+}
+
+void MainWindow::saveLog()
+{
+ QString fn = QFileDialog::getSaveFileName(this, tr("Save log file"),
+ m_workingDir->text()+
+ QString::fromAscii("/doxygen_log.txt"));
+ if (!fn.isEmpty())
+ {
+ QFile f(fn);
+ if (f.open(QIODevice::WriteOnly))
+ {
+ QTextStream t(&f);
+ t << m_outputLog->toPlainText();
+ statusBar()->showMessage(tr("Output log saved"),messageTimeout);
+ }
+ else
+ {
+ QMessageBox::warning(0,tr("Warning"),
+ tr("Cannot open file ")+fn+tr(" for writing. Nothing saved!"),tr("ok"));
+ }
+ }
+}
+
+void MainWindow::showSettings()
+{
+ QString text;
+ QTextStream t(&text);
+ m_expert->writeConfig(t,true);
+ m_outputLog->clear();
+ m_outputLog->append(text);
+ m_outputLog->ensureCursorVisible();
+ m_saveLog->setEnabled(true);
+}
+
+void MainWindow::configChanged()
+{
+ m_modified = true;
+ updateTitle();
+}
+
+void MainWindow::updateTitle()
+{
+ QString title = tr("Doxygen GUI frontend");
+ if (m_modified)
+ {
+ title+=QString::fromAscii(" +");
+ }
+ if (!m_fileName.isEmpty())
+ {
+ title+=QString::fromAscii(" (")+m_fileName+QString::fromAscii(")");
+ }
+ setWindowTitle(title);
+}
+
+bool MainWindow::discardUnsavedChanges(bool saveOption)
+{
+ if (m_modified)
+ {
+ QMessageBox::StandardButton button;
+ if (saveOption)
+ {
+ button = QMessageBox::question(this,
+ tr("Unsaved changes"),
+ tr("Unsaved changes will be lost! Do you want to save the configuration file?"),
+ QMessageBox::Save |
+ QMessageBox::Discard |
+ QMessageBox::Cancel
+ );
+ if (button==QMessageBox::Save)
+ {
+ return saveConfig();
+ }
+ }
+ else
+ {
+ button = QMessageBox::question(this,
+ tr("Unsaved changes"),
+ tr("Unsaved changes will be lost! Do you want to continue?"),
+ QMessageBox::Discard |
+ QMessageBox::Cancel
+ );
+ }
+ return button==QMessageBox::Discard;
+ }
+ return true;
+}
+
+//-----------------------------------------------------------------------
+
+int main(int argc,char **argv)
+{
+ QApplication a(argc,argv);
+ MainWindow &main = MainWindow::instance();
+ if (argc==2 && argv[1][0]!='-') // name of config file as an argument
+ {
+ main.loadConfigFromFile(QString::fromLocal8Bit(argv[1]));
+ }
+ else if (argc>1)
+ {
+ printf("Usage: %s [config file]\n",argv[0]);
+ exit(1);
+ }
+ main.show();
+ return a.exec();
+}
diff --git a/trunk/addon/doxywizard/doxywizard.h b/trunk/addon/doxywizard/doxywizard.h
new file mode 100644
index 0000000..49e13cc
--- /dev/null
+++ b/trunk/addon/doxywizard/doxywizard.h
@@ -0,0 +1,83 @@
+#ifndef DOXYWIZARD_H
+#define DOXYWIZARD_H
+
+#include <QMainWindow>
+#include <QSettings>
+#include <QStringList>
+
+class Expert;
+class Wizard;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QTextEdit;
+class QMenu;
+class QProcess;
+class QTimer;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+ public:
+ static MainWindow &instance();
+ void loadConfigFromFile(const QString &fileName);
+ void loadSettings();
+ void saveSettings();
+ void closeEvent(QCloseEvent *event);
+ QString configFileName() const { return m_fileName; }
+ void updateTitle();
+
+ public slots:
+ void manual();
+ void about();
+ void openConfig();
+ bool saveConfig();
+ bool saveConfigAs();
+ void makeDefaults();
+ void resetToDefaults();
+ void selectTab(int);
+ void quit();
+
+ private slots:
+ void openRecent(QAction *action);
+ void selectWorkingDir();
+ void updateWorkingDir();
+ void runDoxygen();
+ void readStdout();
+ void runComplete();
+ void showHtmlOutput();
+ void saveLog();
+ void showSettings();
+ void configChanged();
+
+ private:
+ MainWindow();
+ void saveConfig(const QString &fileName);
+ void addRecentFile(const QString &fileName);
+ void updateConfigFileName(const QString &fileName);
+ void setWorkingDir(const QString &dirName);
+ void updateLaunchButtonState();
+ bool discardUnsavedChanges(bool saveOption=true);
+
+ QLineEdit *m_workingDir;
+ QPushButton *m_selWorkingDir;
+ QPushButton *m_run;
+ QPushButton *m_saveLog;
+ QPushButton *m_launchHtml;
+ QPushButton *m_launchPdf;
+ QTextEdit *m_outputLog;
+ QLabel *m_runStatus;
+ Expert *m_expert;
+ Wizard *m_wizard;
+ QString m_fileName;
+ QSettings m_settings;
+ QMenu *m_recentMenu;
+ QStringList m_recentFiles;
+ QProcess *m_runProcess;
+ QTimer *m_timer;
+ bool m_running;
+ bool m_modified;
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/doxywizard.pro.in b/trunk/addon/doxywizard/doxywizard.pro.in
new file mode 100644
index 0000000..b9f8f70
--- /dev/null
+++ b/trunk/addon/doxywizard/doxywizard.pro.in
@@ -0,0 +1,27 @@
+######################################################################
+# Automatically generated by qmake (2.01a) zo okt 19 12:50:02 2008
+######################################################################
+
+TEMPLATE = app
+DESTDIR = ../../bin
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += xml
+CONFIG += $extraopts
+OBJECTS_DIR = obj
+MOC_DIR = moc
+RCC_DIR = rcc
+DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
+
+macx-g++ {
+ CONFIG += x86 ppc
+}
+
+# Input
+HEADERS += doxywizard.h version.h expert.h config.h helplabel.h \
+ inputbool.h inputstring.h inputint.h inputstrlist.h wizard.h
+SOURCES += doxywizard.cpp ../../src/version.cpp expert.cpp wizard.cpp \
+ inputbool.cpp inputstring.cpp inputint.cpp inputstrlist.cpp
+LEXSOURCES += config.l
+RESOURCES += doxywizard.qrc
diff --git a/trunk/addon/doxywizard/doxywizard.qrc b/trunk/addon/doxywizard/doxywizard.qrc
new file mode 100644
index 0000000..dd23c5d
--- /dev/null
+++ b/trunk/addon/doxywizard/doxywizard.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file alias="config.xml">../../src/config.xml</file>
+ <file>images/add.png</file>
+ <file>images/del.png</file>
+ <file>images/file.png</file>
+ <file>images/folder.png</file>
+ <file>images/refresh.png</file>
+</qresource>
+</RCC>
diff --git a/trunk/addon/doxywizard/expert.cpp b/trunk/addon/doxywizard/expert.cpp
new file mode 100644
index 0000000..7c16c28
--- /dev/null
+++ b/trunk/addon/doxywizard/expert.cpp
@@ -0,0 +1,553 @@
+#include "expert.h"
+#include "inputbool.h"
+#include "inputstring.h"
+#include "inputint.h"
+#include "inputstring.h"
+#include "inputstrlist.h"
+#include <QtGui>
+#include <QtXml>
+#include "config.h"
+#include "version.h"
+
+#undef SA
+#define SA(x) QString::fromAscii(x)
+
+static QString convertToComment(const QString &s)
+{
+ if (s.isEmpty())
+ {
+ return QString();
+ }
+ else
+ {
+ return SA("# ")+
+ s.trimmed().replace(SA("\n"),SA("\n# "))+
+ SA("\n");
+ }
+}
+
+//------------------------------------------------------------------------------------
+
+Expert::Expert()
+{
+ m_treeWidget = new QTreeWidget;
+ m_treeWidget->setColumnCount(1);
+ m_topicStack = new QStackedWidget;
+
+ QFile file(SA(":/config.xml"));
+ QString err;
+ int errLine,errCol;
+ QDomDocument configXml;
+ if (file.open(QIODevice::ReadOnly))
+ {
+ if (!configXml.setContent(&file,false,&err,&errLine,&errCol))
+ {
+ QString msg = tr("Error parsing internal config.xml at line %1 column %2.\n%3").
+ arg(errLine).arg(errCol).arg(err);
+ QMessageBox::warning(this, tr("Error"), msg);
+ exit(1);
+ }
+ }
+ m_rootElement = configXml.documentElement();
+
+ createTopics(m_rootElement);
+ m_helper = new QTextEdit;
+ m_helper->setReadOnly(true);
+ m_splitter = new QSplitter(Qt::Vertical);
+ m_splitter->addWidget(m_treeWidget);
+ m_splitter->addWidget(m_helper);
+
+ QWidget *rightSide = new QWidget;
+ QGridLayout *grid = new QGridLayout(rightSide);
+ m_prev = new QPushButton(tr("Previous"));
+ m_prev->setEnabled(false);
+ m_next = new QPushButton(tr("Next"));
+ grid->addWidget(m_topicStack,0,0,1,2);
+ grid->addWidget(m_prev,1,0,Qt::AlignLeft);
+ grid->addWidget(m_next,1,1,Qt::AlignRight);
+ grid->setColumnStretch(0,1);
+ grid->setRowStretch(0,1);
+
+ addWidget(m_splitter);
+ addWidget(rightSide);
+ connect(m_next,SIGNAL(clicked()),SLOT(nextTopic()));
+
+ connect(m_prev,SIGNAL(clicked()),SLOT(prevTopic()));
+}
+
+Expert::~Expert()
+{
+ QHashIterator<QString,Input*> i(m_options);
+ while (i.hasNext())
+ {
+ i.next();
+ delete i.value();
+ }
+}
+
+void Expert::createTopics(const QDomElement &rootElem)
+{
+ QList<QTreeWidgetItem*> items;
+ QDomElement childElem = rootElem.firstChildElement();
+ while (!childElem.isNull())
+ {
+ if (childElem.tagName()==SA("group"))
+ {
+ QString name = childElem.attribute(SA("name"));
+ items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(name)));
+ QWidget *widget = createTopicWidget(childElem);
+ m_topics[name] = widget;
+ m_topicStack->addWidget(widget);
+ }
+ childElem = childElem.nextSiblingElement();
+ }
+ m_treeWidget->setHeaderLabels(QStringList() << SA("Topics"));
+ m_treeWidget->insertTopLevelItems(0,items);
+ connect(m_treeWidget,
+ SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),
+ this,
+ SLOT(activateTopic(QTreeWidgetItem *,QTreeWidgetItem *)));
+}
+
+
+QWidget *Expert::createTopicWidget(QDomElement &elem)
+{
+ QScrollArea *area = new QScrollArea;
+ QWidget *topic = new QWidget;
+ QGridLayout *layout = new QGridLayout(topic);
+ QDomElement child = elem.firstChildElement();
+ int row=0;
+ while (!child.isNull())
+ {
+ QString type = child.attribute(SA("type"));
+ if (type==SA("bool"))
+ {
+ InputBool *boolOption =
+ new InputBool(
+ layout,row,
+ child.attribute(SA("id")),
+ child.attribute(SA("defval"))==SA("1"),
+ child.attribute(SA("docs"))
+ );
+ m_options.insert(
+ child.attribute(SA("id")),
+ boolOption
+ );
+ connect(boolOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*)));
+ connect(boolOption,SIGNAL(changed()),SIGNAL(changed()));
+ }
+ else if (type==SA("string"))
+ {
+ InputString::StringMode mode;
+ QString format = child.attribute(SA("format"));
+ if (format==SA("dir"))
+ {
+ mode = InputString::StringDir;
+ }
+ else if (format==SA("file"))
+ {
+ mode = InputString::StringFile;
+ }
+ else // format=="string"
+ {
+ mode = InputString::StringFree;
+ }
+ InputString *stringOption =
+ new InputString(
+ layout,row,
+ child.attribute(SA("id")),
+ child.attribute(SA("defval")),
+ mode,
+ child.attribute(SA("docs"))
+ );
+ m_options.insert(
+ child.attribute(SA("id")),
+ stringOption
+ );
+ connect(stringOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*)));
+ connect(stringOption,SIGNAL(changed()),SIGNAL(changed()));
+ }
+ else if (type==SA("enum"))
+ {
+ InputString *enumList = new InputString(
+ layout,row,
+ child.attribute(SA("id")),
+ child.attribute(SA("defval")),
+ InputString::StringFixed,
+ child.attribute(SA("docs"))
+ );
+ QDomElement enumVal = child.firstChildElement();
+ while (!enumVal.isNull())
+ {
+ enumList->addValue(enumVal.attribute(SA("name")));
+ enumVal = enumVal.nextSiblingElement();
+ }
+ enumList->setDefault();
+
+ m_options.insert(child.attribute(SA("id")),enumList);
+ connect(enumList,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*)));
+ connect(enumList,SIGNAL(changed()),SIGNAL(changed()));
+ }
+ else if (type==SA("int"))
+ {
+ InputInt *intOption =
+ new InputInt(
+ layout,row,
+ child.attribute(SA("id")),
+ child.attribute(SA("defval")).toInt(),
+ child.attribute(SA("minval")).toInt(),
+ child.attribute(SA("maxval")).toInt(),
+ child.attribute(SA("docs"))
+ );
+ m_options.insert(
+ child.attribute(SA("id")),
+ intOption
+ );
+ connect(intOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*)));
+ connect(intOption,SIGNAL(changed()),SIGNAL(changed()));
+ }
+ else if (type==SA("list"))
+ {
+ InputStrList::ListMode mode;
+ QString format = child.attribute(SA("format"));
+ if (format==SA("dir"))
+ {
+ mode = InputStrList::ListDir;
+ }
+ else if (format==SA("file"))
+ {
+ mode = InputStrList::ListFile;
+ }
+ else if (format==SA("filedir"))
+ {
+ mode = InputStrList::ListFileDir;
+ }
+ else // format=="string"
+ {
+ mode = InputStrList::ListString;
+ }
+ QStringList sl;
+ QDomElement listVal = child.firstChildElement();
+ while (!listVal.isNull())
+ {
+ sl.append(listVal.attribute(SA("name")));
+ listVal = listVal.nextSiblingElement();
+ }
+ InputStrList *listOption =
+ new InputStrList(
+ layout,row,
+ child.attribute(SA("id")),
+ sl,
+ mode,
+ child.attribute(SA("docs"))
+ );
+ m_options.insert(
+ child.attribute(SA("id")),
+ listOption
+ );
+ connect(listOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*)));
+ connect(listOption,SIGNAL(changed()),SIGNAL(changed()));
+ }
+ else if (type==SA("obsolete"))
+ {
+ // ignore
+ }
+ else // should not happen
+ {
+ printf("Unsupported type %s\n",qPrintable(child.attribute(SA("type"))));
+ }
+ child = child.nextSiblingElement();
+ }
+
+ // compute dependencies between options
+ child = elem.firstChildElement();
+ while (!child.isNull())
+ {
+ QString dependsOn = child.attribute(SA("depends"));
+ QString id = child.attribute(SA("id"));
+ if (!dependsOn.isEmpty())
+ {
+ Input *parentOption = m_options[dependsOn];
+ Input *thisOption = m_options[id];
+ Q_ASSERT(parentOption);
+ Q_ASSERT(thisOption);
+ if (parentOption && thisOption)
+ {
+ //printf("Adding dependency '%s' (%p)->'%s' (%p)\n",
+ // qPrintable(dependsOn),parentOption,
+ // qPrintable(id),thisOption);
+ parentOption->addDependency(thisOption);
+ }
+ }
+ child = child.nextSiblingElement();
+ }
+
+ // set initial dependencies
+ QHashIterator<QString,Input*> i(m_options);
+ while (i.hasNext())
+ {
+ i.next();
+ if (i.value())
+ {
+ i.value()->updateDependencies();
+ }
+ }
+
+ layout->setRowStretch(row,1);
+ layout->setColumnStretch(1,2);
+ layout->setSpacing(5);
+ topic->setLayout(layout);
+ area->setWidget(topic);
+ area->setWidgetResizable(true);
+ return area;
+}
+
+void Expert::activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *)
+{
+ if (item)
+ {
+ QWidget *w = m_topics[item->text(0)];
+ m_topicStack->setCurrentWidget(w);
+ m_prev->setEnabled(m_topicStack->currentIndex()!=0);
+ m_next->setEnabled(m_topicStack->currentIndex()!=m_topicStack->count()-1);
+ }
+}
+
+void Expert::loadSettings(QSettings *s)
+{
+ QHashIterator<QString,Input*> i(m_options);
+ while (i.hasNext())
+ {
+ i.next();
+ QVariant var = s->value(SA("config/")+i.key());
+ //printf("Loading key %s: type=%d\n",qPrintable(i.key()),var.type());
+ if (i.value())
+ {
+ i.value()->value() = var;
+ i.value()->update();
+ }
+ }
+}
+
+void Expert::saveSettings(QSettings *s)
+{
+ QHashIterator<QString,Input*> i(m_options);
+ while (i.hasNext())
+ {
+ i.next();
+ if (i.value())
+ {
+ s->value(SA("config/")+i.key(),i.value()->value());
+ }
+ }
+}
+
+void Expert::loadConfig(const QString &fileName)
+{
+ //printf("Expert::loadConfig(%s)\n",qPrintable(fileName));
+ parseConfig(fileName,m_options);
+}
+
+void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
+ bool brief)
+{
+ // write group header
+ t << endl;
+ t << "#---------------------------------------------------------------------------" << endl;
+ t << "# " << elem.attribute(SA("docs")) << endl;
+ t << "#---------------------------------------------------------------------------" << endl;
+
+ // write options...
+ QDomElement childElem = elem.firstChildElement();
+ while (!childElem.isNull())
+ {
+ QString type = childElem.attribute(SA("type"));
+ QString name = childElem.attribute(SA("id"));
+ QHash<QString,Input*>::const_iterator i = m_options.find(name);
+ if (i!=m_options.end())
+ {
+ Input *option = i.value();
+ if (!brief)
+ {
+ t << endl;
+ t << convertToComment(childElem.attribute(SA("docs")));
+ t << endl;
+ }
+ t << name.leftJustified(23) << "= ";
+ if (option)
+ {
+ option->writeValue(t,codec);
+ }
+ t << endl;
+ }
+ childElem = childElem.nextSiblingElement();
+ }
+
+}
+
+bool Expert::writeConfig(QTextStream &t,bool brief)
+{
+ if (!brief)
+ {
+ // write global header
+ t << "# Doxyfile " << versionString << endl << endl; // TODO: add version
+ t << "# This file describes the settings to be used by the documentation system\n";
+ t << "# doxygen (www.doxygen.org) for a project\n";
+ t << "#\n";
+ t << "# All text after a hash (#) is considered a comment and will be ignored\n";
+ t << "# The format is:\n";
+ t << "# TAG = value [value, ...]\n";
+ t << "# For lists items can also be appended using:\n";
+ t << "# TAG += value [value, ...]\n";
+ t << "# Values that contain spaces should be placed between quotes (\" \")\n";
+ }
+
+ QTextCodec *codec = 0;
+ Input *option = m_options[QString::fromAscii("DOXYFILE_ENCODING")];
+ if (option)
+ {
+ codec = QTextCodec::codecForName(option->value().toString().toAscii());
+ if (codec==0) // fallback: use UTF-8
+ {
+ codec = QTextCodec::codecForName("UTF-8");
+ }
+ }
+ QDomElement childElem = m_rootElement.firstChildElement();
+ while (!childElem.isNull())
+ {
+ saveTopic(t,childElem,codec,brief);
+ childElem = childElem.nextSiblingElement();
+ }
+ return true;
+}
+
+QByteArray Expert::saveInnerState () const
+{
+ return m_splitter->saveState();
+}
+
+bool Expert::restoreInnerState ( const QByteArray & state )
+{
+ return m_splitter->restoreState(state);
+}
+
+void Expert::showHelp(Input *option)
+{
+ m_helper->setText(
+ QString::fromAscii("<qt><b>")+option->id()+
+ QString::fromAscii("</b><br>")+
+ option->docs().
+ replace(QChar::fromAscii('\n'),QChar::fromAscii(' '))+
+ QString::fromAscii("<qt>")
+ );
+}
+
+void Expert::nextTopic()
+{
+ m_topicStack->setCurrentIndex(m_topicStack->currentIndex()+1);
+ m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
+ m_prev->setEnabled(m_topicStack->currentIndex()!=0);
+ m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
+}
+
+void Expert::prevTopic()
+{
+ m_topicStack->setCurrentIndex(m_topicStack->currentIndex()-1);
+ m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
+ m_prev->setEnabled(m_topicStack->currentIndex()!=0);
+ m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
+}
+
+void Expert::resetToDefaults()
+{
+ //printf("Expert::makeDefaults()\n");
+ QHashIterator<QString,Input*> i(m_options);
+ while (i.hasNext())
+ {
+ i.next();
+ if (i.value())
+ {
+ i.value()->reset();
+ }
+ }
+}
+
+static bool stringVariantToBool(const QVariant &v)
+{
+ QString s = v.toString().toLower();
+ return s==QString::fromAscii("yes") || s==QString::fromAscii("true") || s==QString::fromAscii("1");
+}
+
+static bool getBoolOption(
+ const QHash<QString,Input*>&model,const QString &name)
+{
+ Input *option = model[name];
+ Q_ASSERT(option!=0);
+ return stringVariantToBool(option->value());
+}
+
+static QString getStringOption(
+ const QHash<QString,Input*>&model,const QString &name)
+{
+ Input *option = model[name];
+ Q_ASSERT(option!=0);
+ return option->value().toString();
+}
+
+
+bool Expert::htmlOutputPresent(const QString &workingDir) const
+{
+ bool generateHtml = getBoolOption(m_options,QString::fromAscii("GENERATE_HTML"));
+ if (!generateHtml || workingDir.isEmpty()) return false;
+ QString indexFile = getHtmlOutputIndex(workingDir);
+ QFileInfo fi(indexFile);
+ return fi.exists() && fi.isFile();
+}
+
+QString Expert::getHtmlOutputIndex(const QString &workingDir) const
+{
+ QString outputDir = getStringOption(m_options,QString::fromAscii("OUTPUT_DIRECTORY"));
+ QString htmlOutputDir = getStringOption(m_options,QString::fromAscii("HTML_OUTPUT"));
+ //printf("outputDir=%s\n",qPrintable(outputDir));
+ //printf("htmlOutputDir=%s\n",qPrintable(htmlOutputDir));
+ QString indexFile = workingDir;
+ if (QFileInfo(outputDir).isAbsolute()) // override
+ {
+ indexFile = outputDir;
+ }
+ else // append
+ {
+ indexFile += QString::fromAscii("/")+outputDir;
+ }
+ if (QFileInfo(htmlOutputDir).isAbsolute()) // override
+ {
+ indexFile = htmlOutputDir;
+ }
+ else // append
+ {
+ indexFile += QString::fromAscii("/")+htmlOutputDir;
+ }
+ indexFile+=QString::fromAscii("/index.html");
+ return indexFile;
+}
+
+bool Expert::pdfOutputPresent(const QString &workingDir) const
+{
+ bool generateLatex = getBoolOption(m_options,QString::fromAscii("GENERATE_LATEX"));
+ bool pdfLatex = getBoolOption(m_options,QString::fromAscii("USE_PDFLATEX"));
+ if (!generateLatex || !pdfLatex) return false;
+ QString latexOutput = getStringOption(m_options,QString::fromAscii("LATEX_OUTPUT"));
+ QString indexFile;
+ if (QFileInfo(latexOutput).isAbsolute())
+ {
+ indexFile = latexOutput+QString::fromAscii("/refman.pdf");
+ }
+ else
+ {
+ indexFile = workingDir+QString::fromAscii("/")+
+ latexOutput+QString::fromAscii("/refman.pdf");
+ }
+ QFileInfo fi(indexFile);
+ return fi.exists() && fi.isFile();
+}
+
diff --git a/trunk/addon/doxywizard/expert.h b/trunk/addon/doxywizard/expert.h
new file mode 100644
index 0000000..3372ae6
--- /dev/null
+++ b/trunk/addon/doxywizard/expert.h
@@ -0,0 +1,64 @@
+#ifndef EXPERT_H
+#define EXPERT_H
+
+#include <QSplitter>
+#include <QDomElement>
+#include <QHash>
+
+class QTreeWidget;
+class QTreeWidgetItem;
+class QStackedWidget;
+class QSettings;
+class QTextEdit;
+class QTextCodec;
+class QPushButton;
+class Input;
+
+class Expert : public QSplitter
+{
+ Q_OBJECT
+
+ public:
+ Expert();
+ ~Expert();
+ void loadSettings(QSettings *);
+ void saveSettings(QSettings *);
+ void loadConfig(const QString &fileName);
+ bool writeConfig(QTextStream &t,bool brief);
+ QByteArray saveInnerState () const;
+ bool restoreInnerState ( const QByteArray & state );
+ const QHash<QString,Input*> &modelData() const { return m_options; }
+ void resetToDefaults();
+ bool htmlOutputPresent(const QString &workingDir) const;
+ bool pdfOutputPresent(const QString &workingDir) const;
+ QString getHtmlOutputIndex(const QString &workingDir) const;
+
+ public slots:
+ void activateTopic(QTreeWidgetItem *,QTreeWidgetItem *);
+ QWidget *createTopicWidget(QDomElement &elem);
+
+ private slots:
+ void showHelp(Input *);
+ void nextTopic();
+ void prevTopic();
+
+ signals:
+ void changed();
+
+ private:
+ void createTopics(const QDomElement &);
+ void saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,bool brief);
+
+ QSplitter *m_splitter;
+ QTextEdit *m_helper;
+ QTreeWidget *m_treeWidget;
+ QStackedWidget *m_topicStack;
+ QHash<QString,QWidget *> m_topics;
+ QHash<QString,QObject *> m_optionWidgets;
+ QHash<QString,Input *> m_options;
+ QPushButton *m_next;
+ QPushButton *m_prev;
+ QDomElement m_rootElement;
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/helplabel.h b/trunk/addon/doxywizard/helplabel.h
new file mode 100644
index 0000000..07e2932
--- /dev/null
+++ b/trunk/addon/doxywizard/helplabel.h
@@ -0,0 +1,33 @@
+#ifndef HELPLABEL_H
+#define HELPLABEL_H
+
+#include <QLabel>
+#include <QMenu>
+
+class HelpLabel : public QLabel
+{
+ Q_OBJECT
+ public:
+ HelpLabel(const QString &text) : QLabel(text)
+ { setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),
+ this,SLOT(showMenu(const QPoint&)));
+ }
+ signals:
+ void enter();
+ void reset();
+ private slots:
+ void showMenu(const QPoint &p)
+ {
+ QMenu menu(this);
+ QAction *a = menu.addAction(tr("Reset to default"));
+ if (menu.exec(mapToGlobal(p))==a)
+ {
+ reset();
+ }
+ }
+ protected:
+ void enterEvent( QEvent * event ) { enter(); QLabel::enterEvent(event); }
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/images/add.png b/trunk/addon/doxywizard/images/add.png
new file mode 100644
index 0000000..30a7090
--- /dev/null
+++ b/trunk/addon/doxywizard/images/add.png
Binary files differ
diff --git a/trunk/addon/doxywizard/images/del.png b/trunk/addon/doxywizard/images/del.png
new file mode 100644
index 0000000..ceb6a60
--- /dev/null
+++ b/trunk/addon/doxywizard/images/del.png
Binary files differ
diff --git a/trunk/addon/doxywizard/images/file.png b/trunk/addon/doxywizard/images/file.png
new file mode 100644
index 0000000..e204f67
--- /dev/null
+++ b/trunk/addon/doxywizard/images/file.png
Binary files differ
diff --git a/trunk/addon/doxywizard/images/folder.png b/trunk/addon/doxywizard/images/folder.png
new file mode 100644
index 0000000..2e420e0
--- /dev/null
+++ b/trunk/addon/doxywizard/images/folder.png
Binary files differ
diff --git a/trunk/addon/doxywizard/images/refresh.png b/trunk/addon/doxywizard/images/refresh.png
new file mode 100644
index 0000000..fd6d565
--- /dev/null
+++ b/trunk/addon/doxywizard/images/refresh.png
Binary files differ
diff --git a/trunk/addon/doxywizard/input.h b/trunk/addon/doxywizard/input.h
new file mode 100644
index 0000000..dd1773c
--- /dev/null
+++ b/trunk/addon/doxywizard/input.h
@@ -0,0 +1,34 @@
+#ifndef INPUT_H
+#define INPUT_H
+
+#include <QVariant>
+
+class QTextStream;
+class QTextCodec;
+
+class Input
+{
+ public:
+ enum Kind
+ {
+ Bool,
+ Int,
+ String,
+ StrList,
+ Obsolete
+ };
+ virtual ~Input() {}
+ virtual QVariant &value() = 0;
+ virtual void update() = 0;
+ virtual Kind kind() const = 0;
+ virtual QString docs() const = 0;
+ virtual QString id() const = 0;
+ virtual void addDependency(Input *option) = 0;
+ virtual void setEnabled(bool) = 0;
+ virtual void updateDependencies() = 0;
+ virtual void reset() = 0;
+ virtual void writeValue(QTextStream &t,QTextCodec *codec) = 0;
+};
+
+
+#endif
diff --git a/trunk/addon/doxywizard/inputbool.cpp b/trunk/addon/doxywizard/inputbool.cpp
new file mode 100644
index 0000000..8dbedb1
--- /dev/null
+++ b/trunk/addon/doxywizard/inputbool.cpp
@@ -0,0 +1,110 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "inputbool.h"
+#include "helplabel.h"
+#include <QtGui>
+
+InputBool::InputBool( QGridLayout *layout, int &row,
+ const QString &id, bool checked,
+ const QString &docs )
+ : m_default(checked), m_docs(docs), m_id(id)
+{
+ m_lab = new HelpLabel(id);
+ m_cb = new QCheckBox;
+ layout->addWidget(m_lab,row, 0);
+ layout->addWidget(m_cb,row, 1);
+ m_enabled = true;
+ m_state=!checked; // force update
+ setValue(checked);
+ connect( m_cb, SIGNAL(toggled(bool)), SLOT(setValue(bool)) );
+ connect( m_lab, SIGNAL(enter()), SLOT(help()) );
+ connect( m_lab, SIGNAL(reset()), SLOT(reset()) );
+ row++;
+}
+
+void InputBool::help()
+{
+ showHelp(this);
+}
+
+void InputBool::setEnabled(bool b)
+{
+ m_enabled = b;
+ m_cb->setEnabled(b);
+ updateDependencies();
+}
+
+void InputBool::updateDependencies()
+{
+ for (int i=0;i<m_dependencies.count();i++)
+ {
+ m_dependencies[i]->setEnabled(m_enabled && m_state);
+ }
+}
+
+void InputBool::setValue( bool s )
+{
+ if (m_state!=s)
+ {
+ m_state=s;
+ updateDefault();
+ updateDependencies();
+ m_cb->setChecked( s );
+ m_value = m_state;
+ emit changed();
+ }
+}
+
+void InputBool::updateDefault()
+{
+ if (m_state==m_default)
+ {
+ m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt"));
+ }
+ else
+ {
+ m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>"));
+ }
+}
+
+QVariant &InputBool::value()
+{
+ return m_value;
+}
+
+void InputBool::update()
+{
+ QString v = m_value.toString().toLower();
+ m_state = (v==QString::fromAscii("yes") ||
+ v==QString::fromAscii("true") ||
+ v==QString::fromAscii("1"));
+ m_cb->setChecked( m_state );
+ updateDefault();
+ updateDependencies();
+}
+
+void InputBool::reset()
+{
+ setValue(m_default);
+}
+
+void InputBool::writeValue(QTextStream &t,QTextCodec *codec)
+{
+ if (m_state)
+ t << codec->fromUnicode(QString::fromAscii("YES"));
+ else
+ t << codec->fromUnicode(QString::fromAscii("NO"));
+}
+
diff --git a/trunk/addon/doxywizard/inputbool.h b/trunk/addon/doxywizard/inputbool.h
new file mode 100644
index 0000000..5ec8998
--- /dev/null
+++ b/trunk/addon/doxywizard/inputbool.h
@@ -0,0 +1,70 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _INPUTBOOL_H
+#define _INPUTBOOL_H
+
+#include "input.h"
+#include <QObject>
+
+class QCheckBox;
+class QGridLayout;
+class QLabel;
+
+class InputBool : public QObject, public Input
+{
+ Q_OBJECT
+
+ public:
+ InputBool(QGridLayout *layout,int &row,const QString &id,
+ bool enabled, const QString &docs );
+
+ // Input
+ QVariant &value();
+ void update();
+ Kind kind() const { return Bool; }
+ QString docs() const { return m_docs; }
+ QString id() const { return m_id; }
+ void addDependency(Input *option) { m_dependencies+=option; }
+ void setEnabled(bool);
+ void updateDependencies();
+ void writeValue(QTextStream &t,QTextCodec *codec);
+
+ public slots:
+ void reset();
+ void setValue(bool);
+
+ signals:
+ void changed();
+ void toggle(QString,bool);
+ void showHelp(Input *);
+
+ private slots:
+ void help();
+
+ private:
+ void updateDefault();
+ bool m_state;
+ bool m_default;
+ bool m_enabled;
+ QVariant m_value;
+ QCheckBox *m_cb;
+ QString m_docs;
+ QList<Input*> m_dependencies;
+ QString m_id;
+ QLabel *m_lab;
+
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/inputint.cpp b/trunk/addon/doxywizard/inputint.cpp
new file mode 100644
index 0000000..cb9846b
--- /dev/null
+++ b/trunk/addon/doxywizard/inputint.cpp
@@ -0,0 +1,96 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "inputint.h"
+#include "helplabel.h"
+
+#include <QtGui>
+
+InputInt::InputInt( QGridLayout *layout,int &row,
+ const QString & id,
+ int defVal, int minVal,int maxVal,
+ const QString & docs )
+ : m_default(defVal), m_minVal(minVal), m_maxVal(maxVal), m_docs(docs), m_id(id)
+{
+ m_lab = new HelpLabel(id);
+ m_sp = new QSpinBox;
+ m_sp->setMinimum(minVal);
+ m_sp->setMaximum(maxVal);
+ m_sp->setSingleStep(1);
+ m_val=defVal-1; // force update
+ setValue(defVal);
+
+ layout->addWidget( m_lab, row, 0 );
+ layout->addWidget( m_sp, row, 1 );
+
+ connect(m_sp, SIGNAL(valueChanged(int)),
+ this, SLOT(setValue(int)) );
+ connect( m_lab, SIGNAL(enter()), SLOT(help()) );
+ connect( m_lab, SIGNAL(reset()), SLOT(reset()) );
+ row++;
+}
+
+void InputInt::help()
+{
+ showHelp(this);
+}
+
+
+void InputInt::setValue(int val)
+{
+ val = qMax(m_minVal,val);
+ val = qMin(m_maxVal,val);
+ if (val!=m_val)
+ {
+ m_val = val;
+ m_sp->setValue(val);
+ m_value = m_val;
+ if (m_val==m_default)
+ {
+ m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt"));
+ }
+ else
+ {
+ m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>"));
+ }
+ emit changed();
+ }
+}
+
+void InputInt::setEnabled(bool state)
+{
+ m_lab->setEnabled(state);
+ m_sp->setEnabled(state);
+}
+
+QVariant &InputInt::value()
+{
+ return m_value;
+}
+
+void InputInt::update()
+{
+ setValue(m_value.toInt());
+}
+
+void InputInt::reset()
+{
+ setValue(m_default);
+}
+
+void InputInt::writeValue(QTextStream &t,QTextCodec *)
+{
+ t << m_val;
+}
+
diff --git a/trunk/addon/doxywizard/inputint.h b/trunk/addon/doxywizard/inputint.h
new file mode 100644
index 0000000..73100ae
--- /dev/null
+++ b/trunk/addon/doxywizard/inputint.h
@@ -0,0 +1,70 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _INPUTINT_H
+#define _INPUTINT_H
+
+#include "input.h"
+#include <QObject>
+
+class QGridLayout;
+class QLabel;
+class QSpinBox;
+
+class InputInt : public QObject, public Input
+{
+ Q_OBJECT
+
+ public:
+ InputInt( QGridLayout *layout,int &row,
+ const QString &id, int defVal,
+ int minVal, int maxVal,
+ const QString &docs );
+ ~InputInt(){};
+
+ // Input
+ QVariant &value();
+ void update();
+ Kind kind() const { return Int; }
+ QString docs() const { return m_docs; }
+ QString id() const { return m_id; }
+ void addDependency(Input *) { Q_ASSERT(false); }
+ void setEnabled(bool);
+ void updateDependencies() {}
+ void writeValue(QTextStream &t,QTextCodec *codec);
+
+ public slots:
+ void reset();
+ void setValue(int val);
+
+ private slots:
+ void help();
+
+ signals:
+ void changed();
+ void showHelp(Input *);
+
+ private:
+ QLabel *m_lab;
+ QSpinBox *m_sp;
+ int m_val;
+ int m_default;
+ int m_minVal;
+ int m_maxVal;
+ QVariant m_value;
+ QString m_docs;
+ QString m_id;
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/inputstring.cpp b/trunk/addon/doxywizard/inputstring.cpp
new file mode 100644
index 0000000..7b0aea0
--- /dev/null
+++ b/trunk/addon/doxywizard/inputstring.cpp
@@ -0,0 +1,191 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "inputstring.h"
+#include "helplabel.h"
+#include "doxywizard.h"
+#include "config.h"
+
+#include <QtGui>
+
+InputString::InputString( QGridLayout *layout,int &row,
+ const QString & id, const QString &s,
+ StringMode m, const QString &docs )
+ : m_default(s), m_sm(m), m_index(0), m_docs(docs), m_id(id)
+{
+ m_lab = new HelpLabel(id);
+ if (m==StringFixed)
+ {
+ layout->addWidget( m_lab, row, 0 );
+ m_com = new QComboBox;
+ layout->addWidget( m_com, row, 1, 1, 3, Qt::AlignLeft );
+ m_le=0;
+ m_br=0;
+ row++;
+ }
+ else
+ {
+ layout->addWidget( m_lab, row, 0 );
+ m_le = new QLineEdit;
+ m_le->setText( s );
+ //layout->setColumnMinimumWidth(2,150);
+ if (m==StringFile || m==StringDir)
+ {
+ layout->addWidget( m_le, row, 1 );
+ m_br = new QToolBar;
+ m_br->setIconSize(QSize(24,24));
+ if (m==StringFile)
+ {
+ QAction *file = m_br->addAction(QIcon(QString::fromAscii(":/images/file.png")),QString(),this,SLOT(browse()));
+ file->setToolTip(tr("Browse to a file"));
+ }
+ else
+ {
+ QAction *dir = m_br->addAction(QIcon(QString::fromAscii(":/images/folder.png")),QString(),this,SLOT(browse()));
+ dir->setToolTip(tr("Browse to a folder"));
+ }
+ layout->addWidget( m_br,row,2 );
+ }
+ else
+ {
+ layout->addWidget( m_le, row, 1, 1, 2 );
+ m_br=0;
+ }
+ m_com=0;
+ row++;
+ }
+
+ if (m_le) connect( m_le, SIGNAL(textChanged(const QString&)),
+ this, SLOT(setValue(const QString&)) );
+ if (m_com) connect( m_com, SIGNAL(activated(const QString &)),
+ this, SLOT(setValue(const QString &)) );
+ m_str = s+QChar::fromAscii('!'); // force update
+ setValue(s);
+ connect( m_lab, SIGNAL(enter()), SLOT(help()) );
+ connect( m_lab, SIGNAL(reset()), SLOT(reset()) );
+}
+
+void InputString::help()
+{
+ showHelp(this);
+}
+
+
+InputString::~InputString()
+{
+}
+
+
+void InputString::setValue(const QString &s)
+{
+ if (m_str!=s)
+ {
+ m_str = s;
+ m_value = m_str;
+ if (m_str==m_default)
+ {
+ m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt"));
+ }
+ else
+ {
+ m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>"));
+ }
+ if (m_le && m_le->text()!=m_str) m_le->setText( m_str );
+ emit changed();
+ }
+}
+
+void InputString::setEnabled(bool state)
+{
+ m_lab->setEnabled(state);
+ if (m_le) m_le->setEnabled(state);
+ if (m_br) m_br->setEnabled(state);
+ if (m_com) m_com->setEnabled(state);
+}
+
+void InputString::browse()
+{
+ QString path = QFileInfo(MainWindow::instance().configFileName()).path();
+ if (m_sm==StringFile)
+ {
+ QString fileName = QFileDialog::getOpenFileName(&MainWindow::instance(),
+ tr("Select file"),path);
+ if (!fileName.isNull())
+ {
+ QDir dir(path);
+ if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
+ {
+ fileName = dir.relativeFilePath(fileName);
+ }
+ setValue(fileName);
+ }
+ }
+ else // sm==StringDir
+ {
+ QString dirName = QFileDialog::getExistingDirectory(&MainWindow::instance(),
+ tr("Select directory"),path);
+ if (!dirName.isNull())
+ {
+ QDir dir(path);
+ if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
+ {
+ dirName = dir.relativeFilePath(dirName);
+ }
+ setValue(dirName);
+ }
+ }
+}
+
+void InputString::clear()
+{
+ setValue(QString());
+}
+
+void InputString::addValue(QString s)
+{
+ if (m_sm==StringFixed)
+ {
+ m_values.append(s);
+ m_com->addItem(s);
+ }
+}
+
+void InputString::setDefault()
+{
+ int index = m_values.indexOf(m_str);
+ if (index!=-1 && m_com) m_com->setCurrentIndex(index);
+}
+
+QVariant &InputString::value()
+{
+ return m_value;
+}
+
+void InputString::update()
+{
+ setValue(m_value.toString().trimmed());
+ setDefault();
+}
+
+void InputString::reset()
+{
+ setValue(m_default);
+ setDefault();
+}
+
+void InputString::writeValue(QTextStream &t,QTextCodec *codec)
+{
+ writeStringValue(t,codec,m_str);
+}
+
diff --git a/trunk/addon/doxywizard/inputstring.h b/trunk/addon/doxywizard/inputstring.h
new file mode 100644
index 0000000..13efb44
--- /dev/null
+++ b/trunk/addon/doxywizard/inputstring.h
@@ -0,0 +1,88 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _INPUTSTRING_H
+#define _INPUTSTRING_H
+
+#include "input.h"
+
+#include <QObject>
+#include <QMap>
+#include <QStringList>
+
+class QLabel;
+class QLineEdit;
+class QToolBar;
+class QComboBox;
+class QGridLayout;
+
+class InputString : public QObject, public Input
+{
+ Q_OBJECT
+
+ public:
+ enum StringMode { StringFree=0,
+ StringFile=1,
+ StringDir=2,
+ StringFixed=3
+ };
+
+ InputString( QGridLayout *layout,int &row,
+ const QString &id, const QString &s,
+ StringMode m,
+ const QString &docs );
+ ~InputString();
+ void addValue(QString s);
+ void setDefault();
+
+ // Input
+ QVariant &value();
+ void update();
+ Kind kind() const { return String; }
+ QString docs() const { return m_docs; }
+ QString id() const { return m_id; }
+ void addDependency(Input *) { Q_ASSERT(false); }
+ void setEnabled(bool);
+ void updateDependencies() {}
+ void writeValue(QTextStream &t,QTextCodec *codec);
+
+ public slots:
+ void reset();
+ void setValue(const QString&);
+
+ signals:
+ void changed();
+ void showHelp(Input *);
+
+ private slots:
+ void browse();
+ void clear();
+ void help();
+
+ private:
+ QLabel *m_lab;
+ QLineEdit *m_le;
+ QToolBar *m_br;
+ QComboBox *m_com;
+ QString m_str;
+ QString m_default;
+ StringMode m_sm;
+ QStringList m_values;
+ int m_index;
+ QVariant m_value;
+ QString m_docs;
+ QString m_id;
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/inputstrlist.cpp b/trunk/addon/doxywizard/inputstrlist.cpp
new file mode 100644
index 0000000..d0ebdc7
--- /dev/null
+++ b/trunk/addon/doxywizard/inputstrlist.cpp
@@ -0,0 +1,254 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include "inputstrlist.h"
+#include "helplabel.h"
+#include "doxywizard.h"
+#include "config.h"
+
+#include <QtGui>
+
+InputStrList::InputStrList( QGridLayout *layout,int &row,
+ const QString & id,
+ const QStringList &sl, ListMode lm,
+ const QString & docs)
+ : m_default(sl), m_strList(sl), m_docs(docs), m_id(id)
+{
+ m_lab = new HelpLabel( id );
+
+ m_le = new QLineEdit;
+ m_le->clear();
+
+ QToolBar *toolBar = new QToolBar;
+ toolBar->setIconSize(QSize(24,24));
+ m_add = toolBar->addAction(QIcon(QString::fromAscii(":/images/add.png")),QString(),
+ this,SLOT(addString()));
+ m_add->setToolTip(tr("Add item"));
+ m_del = toolBar->addAction(QIcon(QString::fromAscii(":/images/del.png")),QString(),
+ this,SLOT(delString()));
+ m_del->setToolTip(tr("Delete selected item"));
+ m_upd = toolBar->addAction(QIcon(QString::fromAscii(":/images/refresh.png")),QString(),
+ this,SLOT(updateString()));
+ m_upd->setToolTip(tr("Update selected item"));
+
+ m_lb = new QListWidget;
+ //m_lb->setMinimumSize(400,100);
+ foreach (QString s, m_strList) m_lb->addItem(s);
+
+ m_brFile=0;
+ m_brDir=0;
+ if (lm!=ListString)
+ {
+ if (lm&ListFile)
+ {
+ m_brFile = toolBar->addAction(QIcon(QString::fromAscii(":/images/file.png")),QString(),
+ this,SLOT(browseFiles()));
+ m_brFile->setToolTip(tr("Browse to a file"));
+ }
+ if (lm&ListDir)
+ {
+ m_brDir = toolBar->addAction(QIcon(QString::fromAscii(":/images/folder.png")),QString(),
+ this,SLOT(browseDir()));
+ m_brDir->setToolTip(tr("Browse to a folder"));
+ }
+ }
+ QHBoxLayout *rowLayout = new QHBoxLayout;
+ rowLayout->addWidget( m_le );
+ rowLayout->addWidget( toolBar );
+ layout->addWidget( m_lab, row,0 );
+ layout->addLayout( rowLayout, row,1,1,2 );
+ layout->addWidget( m_lb, row+1,1,1,2 );
+ row+=2;
+
+ m_value = m_strList;
+
+ connect(m_le, SIGNAL(returnPressed()),
+ this, SLOT(addString()) );
+ connect(m_lb, SIGNAL(currentTextChanged(const QString &)),
+ this, SLOT(selectText(const QString &)));
+ connect( m_lab, SIGNAL(enter()), SLOT(help()) );
+ connect( m_lab, SIGNAL(reset()), SLOT(reset()) );
+}
+
+void InputStrList::help()
+{
+ showHelp(this);
+}
+
+
+void InputStrList::addString()
+{
+ if (!m_le->text().isEmpty())
+ {
+ m_lb->addItem(m_le->text());
+ m_strList.append(m_le->text());
+ m_value = m_strList;
+ updateDefault();
+ emit changed();
+ m_le->clear();
+ }
+}
+
+void InputStrList::delString()
+{
+ if (m_lb->currentRow()!=-1)
+ {
+ int itemIndex = m_lb->currentRow();
+ delete m_lb->currentItem();
+ m_strList.removeAt(itemIndex);
+ m_value = m_strList;
+ updateDefault();
+ emit changed();
+ }
+}
+
+void InputStrList::updateString()
+{
+ if (m_lb->currentRow()!=-1 && !m_le->text().isEmpty())
+ {
+ m_lb->currentItem()->setText(m_le->text());
+ m_strList.insert(m_lb->currentRow(),m_le->text());
+ m_strList.removeAt(m_lb->currentRow()+1);
+ m_value = m_strList;
+ updateDefault();
+ emit changed();
+ }
+}
+
+void InputStrList::selectText(const QString &s)
+{
+ m_le->setText(s);
+}
+
+void InputStrList::setEnabled(bool state)
+{
+ m_lab->setEnabled(state);
+ m_le->setEnabled(state);
+ m_add->setEnabled(state);
+ m_del->setEnabled(state);
+ m_upd->setEnabled(state);
+ m_lb->setEnabled(state);
+ if (m_brFile) m_brFile->setEnabled(state);
+ if (m_brDir) m_brDir->setEnabled(state);
+}
+
+void InputStrList::browseFiles()
+{
+ QString path = QFileInfo(MainWindow::instance().configFileName()).path();
+ QStringList fileNames = QFileDialog::getOpenFileNames();
+
+ if (!fileNames.isEmpty())
+ {
+ QStringList::Iterator it;
+ for ( it= fileNames.begin(); it != fileNames.end(); ++it )
+ {
+ QString fileName;
+ QDir dir(path);
+ if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
+ {
+ fileName = dir.relativeFilePath(*it);
+ }
+ if (fileName.isEmpty())
+ {
+ fileName = *it;
+ }
+ m_lb->addItem(fileName);
+ m_strList.append(fileName);
+ m_value = m_strList;
+ updateDefault();
+ emit changed();
+ }
+ m_le->setText(m_strList[0]);
+ }
+}
+
+void InputStrList::browseDir()
+{
+ QString path = QFileInfo(MainWindow::instance().configFileName()).path();
+ QString dirName = QFileDialog::getExistingDirectory();
+
+ if (!dirName.isNull())
+ {
+ QDir dir(path);
+ if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
+ {
+ dirName = dir.relativeFilePath(dirName);
+ }
+ if (dirName.isEmpty())
+ {
+ dirName=QString::fromAscii(".");
+ }
+ m_lb->addItem(dirName);
+ m_strList.append(dirName);
+ m_value = m_strList;
+ updateDefault();
+ emit changed();
+ m_le->setText(dirName);
+ }
+}
+
+void InputStrList::setValue(const QStringList &sl)
+{
+ m_le->clear();
+ m_lb->clear();
+ m_strList = sl;
+ for (int i=0;i<m_strList.size();i++)
+ {
+ m_lb->addItem(m_strList[i].trimmed());
+ }
+ updateDefault();
+}
+
+QVariant &InputStrList::value()
+{
+ return m_value;
+}
+
+void InputStrList::update()
+{
+ setValue(m_value.toStringList());
+}
+
+void InputStrList::updateDefault()
+{
+ if (m_strList==m_default)
+ {
+ m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt"));
+ }
+ else
+ {
+ m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>"));
+ }
+}
+
+void InputStrList::reset()
+{
+ setValue(m_default);
+}
+
+void InputStrList::writeValue(QTextStream &t,QTextCodec *codec)
+{
+ bool first=TRUE;
+ foreach (QString s, m_strList)
+ {
+ if (!first)
+ {
+ t << " \\" << endl;
+ t << " ";
+ }
+ first=FALSE;
+ writeStringValue(t,codec,s);
+ }
+}
+
diff --git a/trunk/addon/doxywizard/inputstrlist.h b/trunk/addon/doxywizard/inputstrlist.h
new file mode 100644
index 0000000..912f441
--- /dev/null
+++ b/trunk/addon/doxywizard/inputstrlist.h
@@ -0,0 +1,91 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _INPUTSTRLIST_H
+#define _INPUTSTRLIST_H
+
+#include "input.h"
+
+#include <QObject>
+#include <QStringList>
+
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QListWidget;
+class QStringList;
+class QGridLayout;
+class QAction;
+
+class InputStrList : public QObject, public Input
+{
+ Q_OBJECT
+
+ public:
+ enum ListMode { ListString = 0,
+ ListFile = 1,
+ ListDir = 2,
+ ListFileDir = ListFile | ListDir
+ };
+
+ InputStrList( QGridLayout *layout,int &row,
+ const QString &id, const QStringList &sl,
+ ListMode v, const QString &docs);
+ void setValue(const QStringList &sl);
+
+ QVariant &value();
+ void update();
+ Kind kind() const { return StrList; }
+ QString docs() const { return m_docs; }
+ QString id() const { return m_id; }
+ void addDependency(Input *) { Q_ASSERT(false); }
+ void setEnabled(bool);
+ void updateDependencies() {}
+ void writeValue(QTextStream &t,QTextCodec *codec);
+
+ public slots:
+ void reset();
+
+ signals:
+ void changed();
+ void showHelp(Input *);
+
+ private slots:
+ void addString();
+ void delString();
+ void updateString();
+ void selectText(const QString &s);
+ void browseFiles();
+ void browseDir();
+ void help();
+
+ private:
+ void updateDefault();
+ QLabel *m_lab;
+ QLineEdit *m_le;
+ QAction *m_add;
+ QAction *m_del;
+ QAction *m_upd;
+ QAction *m_brFile;
+ QAction *m_brDir;
+ QListWidget *m_lb;
+ QStringList m_default;
+ QStringList m_strList;
+ QVariant m_value;
+ QString m_docs;
+ QString m_id;
+
+};
+
+#endif
diff --git a/trunk/addon/doxywizard/version.h b/trunk/addon/doxywizard/version.h
new file mode 100644
index 0000000..a040af7
--- /dev/null
+++ b/trunk/addon/doxywizard/version.h
@@ -0,0 +1,23 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2007 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef VERSION_H
+#define VERSION_H
+
+extern char versionString[];
+
+#endif
diff --git a/trunk/addon/doxywizard/wizard.cpp b/trunk/addon/doxywizard/wizard.cpp
new file mode 100644