From ff11b7d98ad7d24770afd151aa6b439adc7506d2 Mon Sep 17 00:00:00 2001 From: dimitri Date: Sat, 29 Dec 2001 18:30:48 +0000 Subject: Release-1.2.13 --- Doxyfile | 37 +- INSTALL | 4 +- Makefile.in | 7 +- README | 4 +- VERSION | 2 +- addon/doxmlparser/Doxyfile | 177 ++++ addon/doxmlparser/doxygen.dtd | 123 +++ addon/doxmlparser/include/doxmlintf.h | 422 ++++++++ addon/doxmlparser/src/Makefile.in | 13 + addon/doxmlparser/src/basehandler.h | 282 +++++ addon/doxmlparser/src/baseiterator.h | 35 + addon/doxmlparser/src/compoundhandler.cpp | 148 +++ addon/doxmlparser/src/compoundhandler.h | 101 ++ addon/doxmlparser/src/dochandler.cpp | 1479 +++++++++++++++++++++++++++ addon/doxmlparser/src/dochandler.h | 859 ++++++++++++++++ addon/doxmlparser/src/doxmlintf.h | 422 ++++++++ addon/doxmlparser/src/doxmlparser.pro.in | 23 + addon/doxmlparser/src/linkedtexthandler.cpp | 107 ++ addon/doxmlparser/src/linkedtexthandler.h | 46 + addon/doxmlparser/src/mainhandler.cpp | 126 +++ addon/doxmlparser/src/mainhandler.h | 68 ++ addon/doxmlparser/src/memberhandler.cpp | 299 ++++++ addon/doxmlparser/src/memberhandler.h | 193 ++++ addon/doxmlparser/src/paramhandler.cpp | 98 ++ addon/doxmlparser/src/paramhandler.h | 71 ++ addon/doxmlparser/src/sectionhandler.cpp | 61 ++ addon/doxmlparser/src/sectionhandler.h | 62 ++ addon/doxmlparser/test/Makefile.in | 13 + addon/doxmlparser/test/main.cpp | 225 ++++ addon/doxmlparser/test/xmlparse.pro.in | 19 + addon/xmlparse/Doxyfile | 161 --- addon/xmlparse/Makefile.in | 16 - addon/xmlparse/basehandler.h | 279 ----- addon/xmlparse/compoundhandler.cpp | 148 --- addon/xmlparse/compoundhandler.h | 87 -- addon/xmlparse/dochandler.cpp | 1373 ------------------------- addon/xmlparse/dochandler.h | 749 -------------- addon/xmlparse/doxmlintf.h | 87 -- addon/xmlparse/main.cpp | 66 -- addon/xmlparse/mainhandler.cpp | 124 --- addon/xmlparse/mainhandler.h | 64 -- addon/xmlparse/memberhandler.cpp | 160 --- addon/xmlparse/memberhandler.h | 91 -- addon/xmlparse/paramhandler.cpp | 94 -- addon/xmlparse/paramhandler.h | 59 -- addon/xmlparse/sectionhandler.cpp | 61 -- addon/xmlparse/sectionhandler.h | 51 - addon/xmlparse/xmlparse.pro.in | 26 - configure | 8 +- doc/Makefile.win_make.in | 2 +- doc/Makefile.win_nmake.in | 2 +- doc/config.doc | 23 +- doc/faq.doc | 11 + doc/language.doc | 49 +- doc/language.tpl | 17 + doc/maintainers.txt | 3 + doc/translator.pl | 108 +- examples/example.tag | 1 + packages/rpm/doxygen.spec | 2 +- src/classdef.cpp | 205 ++-- src/classdef.h | 8 + src/code.l | 4 +- src/config.l | 77 +- src/defargs.l | 5 +- src/doc.l | 4 + src/doxygen.cpp | 374 +++---- src/filedef.cpp | 2 +- src/groupdef.cpp | 2 +- src/htmlgen.h | 5 + src/lang_cfg.h | 1 + src/language.cpp | 16 + src/latexgen.cpp | 34 +- src/latexgen.h | 5 + src/libdoxygen.pro.in | 1 + src/mangen.cpp | 1 + src/mangen.h | 5 + src/memberdef.cpp | 75 +- src/memberdef.h | 2 +- src/membergroup.cpp | 2 +- src/memberlist.cpp | 50 +- src/namespacedef.cpp | 2 +- src/outputgen.h | 5 + src/outputlist.h | 9 + src/rtfgen.h | 5 + src/scanner.l | 67 +- src/tagreader.cpp | 6 + src/translator_adapter.h | 248 ----- src/translator_fi.h | 101 +- src/translator_gr.h | 1334 ++++++++++++++++++++++++ src/translator_se.h | 15 +- src/util.cpp | 79 +- src/util.h | 3 +- src/xmlgen.cpp | 302 ++++-- 93 files changed, 7966 insertions(+), 4536 deletions(-) create mode 100644 addon/doxmlparser/Doxyfile create mode 100644 addon/doxmlparser/doxygen.dtd create mode 100644 addon/doxmlparser/include/doxmlintf.h create mode 100644 addon/doxmlparser/src/Makefile.in create mode 100644 addon/doxmlparser/src/basehandler.h create mode 100644 addon/doxmlparser/src/baseiterator.h create mode 100644 addon/doxmlparser/src/compoundhandler.cpp create mode 100644 addon/doxmlparser/src/compoundhandler.h create mode 100644 addon/doxmlparser/src/dochandler.cpp create mode 100644 addon/doxmlparser/src/dochandler.h create mode 100644 addon/doxmlparser/src/doxmlintf.h create mode 100644 addon/doxmlparser/src/doxmlparser.pro.in create mode 100644 addon/doxmlparser/src/linkedtexthandler.cpp create mode 100644 addon/doxmlparser/src/linkedtexthandler.h create mode 100644 addon/doxmlparser/src/mainhandler.cpp create mode 100644 addon/doxmlparser/src/mainhandler.h create mode 100644 addon/doxmlparser/src/memberhandler.cpp create mode 100644 addon/doxmlparser/src/memberhandler.h create mode 100644 addon/doxmlparser/src/paramhandler.cpp create mode 100644 addon/doxmlparser/src/paramhandler.h create mode 100644 addon/doxmlparser/src/sectionhandler.cpp create mode 100644 addon/doxmlparser/src/sectionhandler.h create mode 100644 addon/doxmlparser/test/Makefile.in create mode 100644 addon/doxmlparser/test/main.cpp create mode 100644 addon/doxmlparser/test/xmlparse.pro.in delete mode 100644 addon/xmlparse/Doxyfile delete mode 100644 addon/xmlparse/Makefile.in delete mode 100644 addon/xmlparse/basehandler.h delete mode 100644 addon/xmlparse/compoundhandler.cpp delete mode 100644 addon/xmlparse/compoundhandler.h delete mode 100644 addon/xmlparse/dochandler.cpp delete mode 100644 addon/xmlparse/dochandler.h delete mode 100644 addon/xmlparse/doxmlintf.h delete mode 100644 addon/xmlparse/main.cpp delete mode 100644 addon/xmlparse/mainhandler.cpp delete mode 100644 addon/xmlparse/mainhandler.h delete mode 100644 addon/xmlparse/memberhandler.cpp delete mode 100644 addon/xmlparse/memberhandler.h delete mode 100644 addon/xmlparse/paramhandler.cpp delete mode 100644 addon/xmlparse/paramhandler.h delete mode 100644 addon/xmlparse/sectionhandler.cpp delete mode 100644 addon/xmlparse/sectionhandler.h delete mode 100644 addon/xmlparse/xmlparse.pro.in create mode 100644 src/translator_gr.h diff --git a/Doxyfile b/Doxyfile index c8028ec..e42f3d6 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.2.5-20010304 +# Doxyfile 1.2.12-20011209 #--------------------------------------------------------------------------- # General configuration options @@ -8,21 +8,21 @@ PROJECT_NUMBER = OUTPUT_DIRECTORY = doxygen_docs OUTPUT_LANGUAGE = English EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES +EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO 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 = YES STRIP_FROM_PATH = $(PWD)/ INTERNAL_DOCS = NO -CLASS_DIAGRAMS = NO -SOURCE_BROWSER = YES -INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES CASE_SENSE_NAMES = NO +SHORT_NAMES = NO HIDE_SCOPE_NAMES = NO VERBATIM_HEADERS = YES SHOW_INCLUDE_FILES = YES @@ -32,11 +32,11 @@ INLINE_INFO = YES SORT_MEMBER_DOCS = YES DISTRIBUTE_GROUP_DOC = NO TAB_SIZE = 8 -ENABLED_SECTIONS = 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 @@ -51,7 +51,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = src +INPUT = src FILE_PATTERNS = *.h \ *.cpp RECURSIVE = NO @@ -75,10 +75,18 @@ EXCLUDE = src/code.cpp \ 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 = YES @@ -121,12 +129,22 @@ 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 +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- @@ -138,6 +156,7 @@ INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::addtions related to external references #--------------------------------------------------------------------------- @@ -148,13 +167,17 @@ PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # 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 = NO GRAPHICAL_HIERARCHY = YES DOT_PATH = +DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 GENERATE_LEGEND = YES diff --git a/INSTALL b/INSTALL index 2e3c8c1..91de7e1 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ -DOXYGEN Version 1.2.12-20011209 +DOXYGEN Version 1.2.13 Please read the installation section of the manual for instructions. -------- -Dimitri van Heesch (09 December 2001) +Dimitri van Heesch (29 December 2001) diff --git a/Makefile.in b/Makefile.in index b625014..7a2968a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,14 +8,16 @@ clean: FORCE cd qtools ; $(MAKE) clean cd src ; $(MAKE) clean cd addon/doxywizard ; $(MAKE) clean - cd addon/xmlparse ; $(MAKE) clean + cd addon/doxmlparser/src ; $(MAKE) clean + cd addon/doxmlparser/test ; $(MAKE) clean -rm -f bin/doxy* -rm -f objects/*.o distclean: clean cd src ; $(MAKE) distclean cd addon/doxywizard ; $(MAKE) distclean - cd addon/xmlparse ; $(MAKE) distclean + cd addon/doxmlparser/src ; $(MAKE) distclean + cd addon/doxmlparser/test ; $(MAKE) distclean -rm -f lib/lib* -rm -f bin/doxy* -rm -f html @@ -48,6 +50,7 @@ install_docs: echo "DOXYGEN = $(INSTALL)" > $(DOCDIR)/doc/Makefile echo "DOXYDOCS = .." >> $(DOCDIR)/doc/Makefile echo "VERSION = $(VERSION)" >> $(DOCDIR)/doc/Makefile + echo "PERL = $(PERL)" >> $(DOCDIR)/doc/Makefile cat doc/Makefile.in >> $(DOCDIR)/doc/Makefile cd $(DOCDIR)/examples ; $(MAKE) cd $(DOCDIR)/doc ; $(MAKE) diff --git a/README b/README index 4e667f9..68d7eab 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.2.12_20011209 +DOXYGEN Version 1.2.13 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (09 December 2001) +Dimitri van Heesch (dimitri@stack.nl) (29 December 2001) diff --git a/VERSION b/VERSION index 377516d..0b1f1ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.12-20011209 +1.2.13 diff --git a/addon/doxmlparser/Doxyfile b/addon/doxmlparser/Doxyfile new file mode 100644 index 0000000..6225af2 --- /dev/null +++ b/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 = YES +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 = 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/addon/doxmlparser/doxygen.dtd b/addon/doxmlparser/doxygen.dtd new file mode 100644 index 0000000..5b293d0 --- /dev/null +++ b/addon/doxmlparser/doxygen.dtd @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h new file mode 100644 index 0000000..ec2950c --- /dev/null +++ b/addon/doxmlparser/include/doxmlintf.h @@ -0,0 +1,422 @@ +#ifndef _DOXMLINTF_H +#define _DOXMLINTF_H + +#include + +class IMember; +class IDocIterator; + +class ILinkedText +{ + public: + enum Kind { Kind_Text, Kind_Ref }; + virtual Kind kind() const = 0; +}; + +class ILT_Text : public ILinkedText +{ + public: + virtual QString text() const = 0; +}; + +class ILT_Ref : public ILinkedText +{ + public: + virtual QString id() const = 0; + virtual QString external() const = 0; + virtual QString text() const = 0; +}; + +class ILinkedTextIterator +{ + public: + 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; +}; + +class IParam +{ + public: + virtual ILinkedTextIterator *type() const = 0; + virtual QString declarationName() const = 0; + virtual QString definitionName() const = 0; + virtual QString attrib() const = 0; + virtual QString arraySpecifier() const = 0; + virtual ILinkedTextIterator *defaultValue() const = 0; +}; + +class IParamIterator +{ + public: + 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 IMember *member() const = 0; + virtual QString memberName() const = 0; +}; + +class IMemberReferenceIterator +{ + public: + 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 IEnumValue +{ + public: + virtual QString name() const = 0; + virtual QString initializer() const = 0; +}; + +class IEnumValueIterator +{ + public: + virtual IEnumValue *toFirst() = 0; + virtual IEnumValue *toLast() = 0; + virtual IEnumValue *toNext() = 0; + virtual IEnumValue *toPrev() = 0; + virtual IEnumValue *current() const = 0; + virtual void release() = 0; +}; + +class IDoc +{ + public: + enum Kind + { + Para, // 0 -> IDocPara + Text, // 1 -> IDocText + MarkupModifier, // 2 -> IDocMarkupModifier + ItemizedList, // 3 -> IDocList + OrderedList, // 4 -> IDocList + ListItem, // 5 -> IDocListItem + ParameterList, // 6 -> IDocParameterList + Parameter, // 7 -> IDocParameter + SimpleSect, // 8 -> IDocSimpleSect + Title, // 9 -> IDocTitle + Ref, // 10 -> IDocRef + VariableList, // 11 -> IDocVariableList + VariableListEntry, // 12 -> IDocVariableListEntry + HRuler, // 13 -> IDocHRuler + LineBreak, // 14 -> IDocLineBreak + ULink, // 15 -> IDocULink + EMail, // 16 -> IDocEMail + Link, // 17 -> IDocLink + ProgramListing, // 18 -> IDocProgramListing + CodeLine, // 19 -> IDocCodeLine + Highlight, // 20 -> IDocHighlight + Anchor, // 21 -> IDocAnchor + Formula, // 22 -> IDocFormula + Image, // 23 -> IDocImage + DotFile, // 24 -> IDocDotFile + IndexEntry, // 25 -> IDocIndexEntry + Table, // 26 -> IDocTable + Row, // 27 -> IDocRow + Entry, // 28 -> IDocEntry + Section, // 29 -> IDocSection + Root // 30 -> IDocRoot + }; + virtual Kind kind() const = 0; +}; + +class IDocMarkup : public IDoc +{ + public: + enum Markup + { + Normal = 0x00, + Bold = 0x01, + Emphasis = 0x02, + ComputerOutput = 0x04, + Subscript = 0x08, + Superscript = 0x10, + SmallFont = 0x20, + Center = 0x40 + }; + +}; + +class IDocPara : public IDoc +{ + public: + virtual IDocIterator *contents() const = 0; +}; + +class IDocText : public IDocMarkup +{ + public: + virtual QString text() const = 0; + virtual int markup() const = 0; +}; + +class IDocMarkupModifier : public IDoc +{ +}; + +class IDocList : public IDoc +{ +}; + +class IDocListItem : public IDoc +{ +}; + +class IDocParameterList : public IDoc +{ +}; + +class IDocParameter : public IDoc +{ +}; + +class IDocSimpleSect : public IDoc +{ +}; + +class IDocTitle : public IDoc +{ + public: + virtual IDocIterator *title() const = 0; +}; + +class IDocRef : public IDoc +{ +}; + +class IDocVariableList : public IDoc +{ +}; + +class IDocVariableListEntry : public IDoc +{ +}; + +class IDocHRuler : public IDoc +{ +}; + +class IDocLineBreak : public IDoc +{ +}; + +class IDocULink : public IDoc +{ +}; + +class IDocEMail : public IDoc +{ +}; + +class IDocLink : public IDoc +{ +}; + +class IDocProgramListing : public IDoc +{ +}; + +class IDocCodeLine : public IDoc +{ +}; + +class IDocHighlight : public IDoc +{ +}; + +class IDocAnchor : public IDoc +{ +}; + +class IDocFormula : public IDoc +{ +}; + +class IDocImage : public IDoc +{ +}; + +class IDocDotFile : public IDoc +{ +}; + +class IDocIndexEntry : public IDoc +{ +}; + +class IDocTable : public IDoc +{ +}; + +class IDocRow : public IDoc +{ +}; + +class IDocEntry : public IDoc +{ +}; + +class IDocSection : public IDoc +{ + public: + virtual QString id() const = 0; + virtual int level() const = 0; + virtual IDocIterator *title() const = 0; +}; + +class IDocRoot : public IDoc +{ + public: + virtual IDocIterator *contents() const = 0; +}; + +class IDocIterator +{ + public: + 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 IMember +{ + public: + virtual QString kind() const = 0; + virtual QString id() const = 0; + virtual QString protection() const = 0; + virtual QString virtualness() const = 0; + virtual ILinkedTextIterator *type() const = 0; + virtual QString name() const = 0; + virtual bool isConst() const = 0; + virtual bool isVolatile() const = 0; + virtual IParamIterator *params() const = 0; + virtual ILinkedTextIterator *initializer() const = 0; + virtual ILinkedTextIterator *exceptions() const = 0; + virtual IMemberReferenceIterator *references() const = 0; + virtual IMemberReferenceIterator *referencedBy() const = 0; + virtual int bodyStart() const = 0; + virtual int bodyEnd() const = 0; + virtual QString definitionFile() const = 0; + virtual int definitionLine() const = 0; + virtual IMemberReference *reimplements() const = 0; + virtual IMemberReferenceIterator *reimplementedBy() const = 0; + virtual IEnumValueIterator *enumValues() const = 0; + virtual IDocRoot *briefDescription() const = 0; + virtual IDocRoot *detailedDescription() const = 0; +}; + +class IMemberIterator +{ + public: + 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 ISection +{ + public: + virtual QString kind() const = 0; + virtual IMemberIterator *members() const = 0; +}; + +class ISectionIterator +{ + public: + 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; +}; + +class ICompound +{ + public: + virtual QString name() const = 0; + virtual QString id() const = 0; + virtual QString kind() const = 0; + virtual ISectionIterator *sections() const = 0; + virtual IDocRoot *briefDescription() const = 0; + virtual IDocRoot *detailedDescription() const = 0; +}; + +class ICompoundIterator +{ + public: + virtual ICompound *toFirst() = 0; + virtual ICompound *toLast() = 0; + virtual ICompound *toNext() = 0; + virtual ICompound *toPrev() = 0; + virtual ICompound *current() const = 0; + virtual void release() = 0; +}; + +/*! Root node of the object model. */ +class IDoxygen +{ + public: + /*! 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 QString &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 QString &name) const = 0; + + /*! Returns an interface to a member given its id. + * @param id The member id. + */ + virtual IMember *memberById(const QString &id) const = 0; + + /*! Returns a list of all members with a certain name. + * @param name The name of the member. + */ + virtual IMemberIterator *memberByName(const QString &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; +}; + +/*! Factory method that creates an object model given an XML file generated + * by doxygen. + * @param xmlFileName The name of the XML to parse. + * @returns An iterface to the object model. + */ +IDoxygen *createObjectModelFromXML(const char *xmlFileName); + +#endif diff --git a/addon/doxmlparser/src/Makefile.in b/addon/doxmlparser/src/Makefile.in new file mode 100644 index 0000000..049f969 --- /dev/null +++ b/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/addon/doxmlparser/src/basehandler.h b/addon/doxmlparser/src/basehandler.h new file mode 100644 index 0000000..d62cf74 --- /dev/null +++ b/addon/doxmlparser/src/basehandler.h @@ -0,0 +1,282 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include + +class IBaseHandler +{ + public: + virtual void setDelegate(QXmlDefaultHandler *delegate) = 0; + virtual QXmlDefaultHandler *delegate() const = 0; +}; + +class IFallBackHandler +{ + public: + virtual bool handleStartElement(const QString & name, + const QXmlAttributes & attrib) = 0; + virtual bool handleEndElement(const QString &name) = 0; +}; + +template 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; + }; + + typedef StartElementHandler StartElementHandlerT; + typedef EndElementHandler EndElementHandlerT; + + public: + 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 m_startHandlers; + QDict m_endHandlers; +}; + +template class BaseHandler : public IBaseHandler, + public QXmlDefaultHandler, + public ElementMapper +{ + public: + 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++; + printf("skipping start tag %s count=%d\n",name.data(),m_skipCount); + return TRUE; + } + + StartElementHandlerT *handler = m_startHandlers[name]; + if (handler) + { + (*handler)(attrib); + //printf("found start tag %s\n",name.data()); + } + else if (!m_fallBackHandler || + !m_fallBackHandler->handleStartElement(name,attrib) + ) + { + printf("found unexpected tag `%s', skipping until matching end tag\n",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--; + printf("skipping end tag %s count=%d\n",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 = 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); + } + + printf("Skipped unhandled entity %s\n",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; + } + + protected: + QString m_curString; + QString m_skipUntil; + int m_skipCount; + QXmlDefaultHandler *m_delegateHandler; + IFallBackHandler *m_fallBackHandler; +}; + +template class BaseFallBackHandler : public ElementMapper, + public IFallBackHandler +{ + public: + BaseFallBackHandler() + { + } + virtual ~BaseFallBackHandler() + { + } + bool handleStartElement(const QString & name, + const QXmlAttributes & attrib) + { + StartElementHandlerT *handler = m_startHandlers[name]; + if (handler) + { + (*handler)(attrib); + return TRUE; + } + return FALSE; + } + bool handleEndElement(const QString &name) + { + EndElementHandlerT *handler = m_endHandlers[name]; + if (handler) + { + (*handler)(); + return TRUE; + } + return FALSE; + } +}; + + +#endif diff --git a/addon/doxmlparser/src/baseiterator.h b/addon/doxmlparser/src/baseiterator.h new file mode 100644 index 0000000..52a4c4e --- /dev/null +++ b/addon/doxmlparser/src/baseiterator.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include + +template class BaseIterator : + public Intf, public QListIterator +{ + public: + BaseIterator(const QList &list) : QListIterator(list) {} + virtual ~BaseIterator() {} + virtual ElemIntf *toFirst() { return QListIterator::toFirst(); } + virtual ElemIntf *toLast() { return QListIterator::toLast(); } + virtual ElemIntf *toNext() { return QListIterator::operator++(); } + virtual ElemIntf *toPrev() { return QListIterator::operator--(); } + virtual ElemIntf *current() const { return QListIterator::current(); } + virtual void release() { delete this; } +}; + +#endif diff --git a/addon/doxmlparser/src/compoundhandler.cpp b/addon/doxmlparser/src/compoundhandler.cpp new file mode 100644 index 0000000..0b420bf --- /dev/null +++ b/addon/doxmlparser/src/compoundhandler.cpp @@ -0,0 +1,148 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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" + +CompoundHandler::CompoundHandler(IBaseHandler *parent) + : m_parent(parent), m_brief(0), m_detailed(0), m_programListing(0) +{ + m_superClasses.setAutoDelete(TRUE); + m_subClasses.setAutoDelete(TRUE); + m_sections.setAutoDelete(TRUE); + + addEndHandler("compounddef",this,&CompoundHandler::endCompound); + + addStartHandler("compoundname"); + addEndHandler("compoundname",this,&CompoundHandler::endCompoundName); + + addStartHandler("derivedcompoundref",this,&CompoundHandler::addSubClass); + addEndHandler("derivedcompoundref"); + + addStartHandler("basecompoundref",this,&CompoundHandler::addSuperClass); + addEndHandler("basecompoundref"); + + addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc); + + addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc); + + addStartHandler("sectiondef",this,&CompoundHandler::startSection); + + addStartHandler("location",this,&CompoundHandler::startLocation); + addEndHandler("location"); + + addStartHandler("programlisting",this,&CompoundHandler::startProgramListing); +} + +CompoundHandler::~CompoundHandler() +{ + delete m_brief; + delete m_detailed; + delete m_programListing; +} + +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::startCompound(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + m_id = attrib.value("id"); + m_kind = attrib.value("kind"); + printf("startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kind.data()); +} + +void CompoundHandler::startLocation(const QXmlAttributes& attrib) +{ + m_defFile = attrib.value("file"); + m_defLine = attrib.value("line").toInt(); +} + +void CompoundHandler::endCompound() +{ + printf("endCompound()\n"); + m_parent->setDelegate(0); +} + +void CompoundHandler::endCompoundName() +{ + m_name = m_curString.stripWhiteSpace(); + printf("Compound name `%s'\n",m_name.data()); +} + +void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) +{ + SuperClass *sc=new SuperClass( + attrib.value("idref"), + attrib.value("prot"), + attrib.value("virt") + ); + printf("super class id=`%s' prot=`%s' virt=`%s'\n", + sc->m_id.data(), + sc->m_protection.data(), + sc->m_virtualness.data()); + m_superClasses.append(sc); +} + +void CompoundHandler::addSubClass(const QXmlAttributes& attrib) +{ + SubClass *sc = new SubClass( + attrib.value("idref"), + attrib.value("prot"), + attrib.value("virt") + ); + printf("sub class id=`%s' prot=`%s' virt=`%s'\n", + sc->m_id.data(), + sc->m_protection.data(), + sc->m_virtualness.data()); + m_subClasses.append(sc); +} + +void CompoundHandler::initialize(MainHandler *m) +{ + QListIterator msi(m_sections); + SectionHandler *sec; + for (;(sec=(SectionHandler *)msi.current());++msi) + { + sec->initialize(m); + } +} + diff --git a/addon/doxmlparser/src/compoundhandler.h b/addon/doxmlparser/src/compoundhandler.h new file mode 100644 index 0000000..99db5d8 --- /dev/null +++ b/addon/doxmlparser/src/compoundhandler.h @@ -0,0 +1,101 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include +#include + +#include "basehandler.h" +#include "baseiterator.h" +#include "sectionhandler.h" + +class MainHandler; +class DocHandler; +class ProgramListingHandler; + +class CompoundIterator : public BaseIterator +{ + public: + CompoundIterator(const QList &list) : + BaseIterator(list) {} +}; + +class CompoundHandler : public ICompound, public BaseHandler +{ + public: + virtual void startSection(const QXmlAttributes& attrib); + virtual void startCompound(const QXmlAttributes& attrib); + virtual void addSuperClass(const QXmlAttributes& attrib); + virtual void addSubClass(const QXmlAttributes& attrib); + 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); + + CompoundHandler(IBaseHandler *parent); + virtual ~CompoundHandler(); + void initialize(MainHandler *m); + + // ICompound implementation + QString name() const { return m_name; } + QString id() const { return m_id; } + QString kind() const { return m_kind; } + ISectionIterator *sections() const + { return new SectionIterator(m_sections); } + virtual IDocRoot *briefDescription() const + { return m_brief; } + virtual IDocRoot *detailedDescription() const + { return m_detailed; } + + + private: + struct SuperClass + { + SuperClass(const QString &id,const QString &prot,const QString &virt) : + m_id(id),m_protection(prot),m_virtualness(virt) {} + + QString m_id; + QString m_protection; + QString m_virtualness; + }; + struct SubClass + { + SubClass(const QString &id,const QString &prot,const QString &virt) : + m_id(id),m_protection(prot),m_virtualness(virt) {} + + QString m_id; + QString m_protection; + QString m_virtualness; + }; + QList m_superClasses; + QList m_subClasses; + QList m_sections; + IBaseHandler *m_parent; + DocHandler *m_brief; + DocHandler *m_detailed; + ProgramListingHandler *m_programListing; + QString m_id; + QString m_kind; + QString m_name; + QString m_defFile; + int m_defLine; +}; + +#endif diff --git a/addon/doxmlparser/src/dochandler.cpp b/addon/doxmlparser/src/dochandler.cpp new file mode 100644 index 0000000..3350cf4 --- /dev/null +++ b/addon/doxmlparser/src/dochandler.cpp @@ -0,0 +1,1479 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 "dochandler.h" +#include + +class TypeNameMapper +{ + public: + TypeNameMapper() + { + m_typeNameMap.insert("see", SimpleSectHandler::See); + m_typeNameMap.insert("return", SimpleSectHandler::Return); + m_typeNameMap.insert("author", SimpleSectHandler::Author); + m_typeNameMap.insert("version", SimpleSectHandler::Version); + m_typeNameMap.insert("since", SimpleSectHandler::Since); + m_typeNameMap.insert("date", SimpleSectHandler::Date); + m_typeNameMap.insert("bug", SimpleSectHandler::Bug); + m_typeNameMap.insert("note", SimpleSectHandler::Note); + m_typeNameMap.insert("warning", SimpleSectHandler::Warning); + m_typeNameMap.insert("par", SimpleSectHandler::Par); + m_typeNameMap.insert("deprecated",SimpleSectHandler::Deprecated); + m_typeNameMap.insert("pre", SimpleSectHandler::Pre); + m_typeNameMap.insert("post", SimpleSectHandler::Post); + m_typeNameMap.insert("invariant", SimpleSectHandler::Invar); + m_typeNameMap.insert("remark", SimpleSectHandler::Remark); + m_typeNameMap.insert("attention", SimpleSectHandler::Attention); + m_typeNameMap.insert("todo", SimpleSectHandler::Todo); + m_typeNameMap.insert("test", SimpleSectHandler::Test); + m_typeNameMap.insert("rcs", SimpleSectHandler::RCS); + m_typeNameMap.insert("enumvalues",SimpleSectHandler::EnumValues); + m_typeNameMap.insert("examples", SimpleSectHandler::Examples); + } + SimpleSectHandler::Types stringToType(const QString &typeStr) + { + return m_typeNameMap[typeStr]; + } + private: + QMap m_typeNameMap; +}; + +static TypeNameMapper g_typeMapper; + + +//---------------------------------------------------------------------- +// MarkupHandler +//---------------------------------------------------------------------- + +MarkupHandler::MarkupHandler(QList &children,QString &curString) + : m_children(children), m_curString(curString), m_curMarkup(IDocMarkup::Normal) +{ + 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); +} + +MarkupHandler::~MarkupHandler() +{ +} + +void MarkupHandler::addTextNode() +{ + if (!m_curString.isEmpty()) + { + m_children.append(new TextNode(m_curString,m_curMarkup)); + printf("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; +} + +//---------------------------------------------------------------------- +// 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); + printf("start list item handler\n"); +} + +void ListItemHandler::endListItem() +{ + printf("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); +} + +//---------------------------------------------------------------------- +// ListHandler +//---------------------------------------------------------------------- + +ListHandler::ListHandler(Kind k,IBaseHandler *parent) + : m_parent(parent), m_kind(k) +{ + m_children.setAutoDelete(TRUE); + const char *endListName=0; + switch(k) + { + case ItemizedList : endListName="itemizedlist"; break; + case OrderedList : endListName="orderedlist"; break; + default: ASSERT(0); + } + addEndHandler(endListName,this,&ListHandler::endList); + + addStartHandler("listitem",this,&ListHandler::startListItem); +} + +ListHandler::~ListHandler() +{ +} + +void ListHandler::startList(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); +} + +void ListHandler::endList() +{ + m_parent->setDelegate(0); +} + +void ListHandler::startListItem(const QXmlAttributes& attrib) +{ + ListItemHandler *liHandler = new ListItemHandler(this); + liHandler->startListItem(attrib); + m_children.append(liHandler); +} + +//---------------------------------------------------------------------- +// ParameterHandler +//---------------------------------------------------------------------- + +ParameterHandler::ParameterHandler(IBaseHandler *parent) : + m_parent(parent), m_description(0) +{ + addEndHandler("parametername",this,&ParameterHandler::endParameterName); + addEndHandler("parameterdescription",this,&ParameterHandler::endParameterDescription); + addStartHandler("para",this,&ParameterHandler::startParagraph); +} + +ParameterHandler::~ParameterHandler() +{ + delete m_description; +} + +void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); +} + +void ParameterHandler::endParameterName() +{ + m_name = m_curString; + printf("parameter %s\n",m_name.data()); + m_curString=""; + m_parent->setDelegate(0); +} + +void ParameterHandler::startParameterDescription(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); +} + +void ParameterHandler::endParameterDescription() +{ + m_parent->setDelegate(0); +} + +void ParameterHandler::startParagraph(const QXmlAttributes& attrib) +{ + ASSERT(m_description==0); + m_description = new ParagraphHandler(this); + m_description->startParagraph(attrib); +} + +//---------------------------------------------------------------------- +// ParameterListHandler +//---------------------------------------------------------------------- + +ParameterListHandler::ParameterListHandler(IBaseHandler *parent) + : m_parent(parent) +{ + addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList); + addStartHandler("parametername",this,&ParameterListHandler::startParameterName); + addStartHandler("parameterdescription",this,&ParameterListHandler::startParameterDescription); + addStartHandler("title"); + addEndHandler("title"); + m_parameters.setAutoDelete(TRUE); + m_curParam=0; +} + +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 + { + printf("Error: invalid parameterlist type: %s\n",kind.data()); + } + printf("parameterlist kind=%s\n",kind.data()); + m_parent->setDelegate(this); +} + +void ParameterListHandler::endParameterList() +{ + m_parent->setDelegate(0); +} + +void ParameterListHandler::startParameterName(const QXmlAttributes& attrib) +{ + m_curParam = new ParameterHandler(this); + m_parameters.append(m_curParam); + m_curParam->startParameterName(attrib); +} + +void ParameterListHandler::startParameterDescription(const QXmlAttributes& attrib) +{ + ASSERT(m_curParam!=0); + m_curParam->startParameterDescription(attrib); +} + +//---------------------------------------------------------------------- +// 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); + printf("Start link\n"); + m_ref = attrib.value("linkend"); + m_curString=""; +} + +void LinkHandler::endLink() +{ + m_text = m_curString; + m_curString=""; + m_parent->setDelegate(0); + printf("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); + printf("Start email\n"); + m_curString=""; +} + +void EMailHandler::endEMail() +{ + m_address = m_curString; + m_curString=""; + m_parent->setDelegate(0); + printf("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); + printf("Start ulink\n"); + m_url = attrib.value("url"); + m_curString=""; +} + +void ULinkHandler::endULink() +{ + m_text = m_curString; + m_curString=""; + m_parent->setDelegate(0); + printf("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); + printf("Start linebreak\n"); +} + +void LineBreakHandler::endLineBreak() +{ + m_parent->setDelegate(0); + printf("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); + printf("Start hruler\n"); +} + +void HRulerHandler::endHRuler() +{ + m_parent->setDelegate(0); + printf("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("idref"); + m_anchor = attrib.value("anchor"); + printf("Start ref refId=%s anchor=%s\n",m_refId.data(),m_anchor.data()); + m_curString=""; +} + +void RefHandler::endRef() +{ + m_linkText = m_curString; + m_parent->setDelegate(0); + printf("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); + printf("Start title\n"); + m_curString=""; +} + +void TitleHandler::endTitle() +{ + addTextNode(); + m_parent->setDelegate(0); + printf("End title\n"); +} + +void TitleHandler::addTextNode() +{ + if (!m_curString.isEmpty()) + { + m_children.append(new TextNode(m_curString,m_markupHandler->markup())); + printf("addTextNode() text=\"%s\" markup=%x\n", + m_curString.data(),m_markupHandler->markup()); + 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_type = g_typeMapper.stringToType(attrib.value("kind")); + printf("start simple section %s\n",attrib.value("kind").data()); + m_parent->setDelegate(this); +} + +void SimpleSectHandler::endSimpleSect() +{ + printf("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) +{ + 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); + printf("start varlistentry\n"); +} + +void VariableListEntryHandler::endVarListEntry() +{ + m_parent->setDelegate(0); + printf("end varlistentry\n"); +} + +void VariableListEntryHandler::startListItem(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); + printf("start listitem\n"); +} + +void VariableListEntryHandler::endListItem() +{ + m_parent->setDelegate(0); + printf("end listitem\n"); +} + +void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/) +{ + m_curString=""; +} + +void VariableListEntryHandler::endTerm() +{ + m_term = m_curString; + printf("term=%s\n",m_term.data()); +} + +void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib) +{ + ASSERT(m_description==0); + m_description = new ParagraphHandler(this); + m_description->startParagraph(attrib); +} + + + +//---------------------------------------------------------------------- +// 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); + printf("start variablelist\n"); +} + +void VariableListHandler::endVariableList() +{ + printf("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); +} + +//---------------------------------------------------------------------- +// HighlightHandler +//---------------------------------------------------------------------- + +HighlightHandler::HighlightHandler(IBaseHandler *parent) + : m_parent(parent) +{ + addEndHandler("highlight",this,&HighlightHandler::endHighlight); +} + +HighlightHandler::~HighlightHandler() +{ +} + +void HighlightHandler::startHighlight(const QXmlAttributes& attrib) +{ + m_class = attrib.value("class"); + m_curString=""; + m_parent->setDelegate(this); +} + +void HighlightHandler::endHighlight() +{ + m_text = m_curString; + printf("highlight class=`%s' text=`%s'\n",m_class.data(),m_text.data()); + m_parent->setDelegate(0); +} + +//---------------------------------------------------------------------- +// 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); + printf("start codeline\n"); +} + +void CodeLineHandler::endCodeLine() +{ + addTextNode(); + printf("end codeline\n"); + m_parent->setDelegate(0); +} + +void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + printf("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)); + printf("addTextNode() text=\"%s\"\n", + m_curString.data()); + m_curString=""; + } +} + +//---------------------------------------------------------------------- +// 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); + printf("start programlisting\n"); +} + +void ProgramListingHandler::endProgramListing() +{ + printf("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; +} + +//---------------------------------------------------------------------- +// 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; + printf("formula id=`%s' text=`%s'\n",m_id.data(),m_text.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; + printf("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("image",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; + printf("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*/) +{ + printf("start index entry\n"); + m_parent->setDelegate(this); +} + +void IndexEntryHandler::endIndexEntry() +{ + printf("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); +} + +//---------------------------------------------------------------------- +// 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); +} + +//---------------------------------------------------------------------- +// TableHandler +//---------------------------------------------------------------------- + +TableHandler::TableHandler(IBaseHandler *parent) + : m_parent(parent) +{ + m_children.setAutoDelete(TRUE); + addEndHandler("table",this,&TableHandler::endTable); + addStartHandler("row",this,&TableHandler::startRow); +} + +TableHandler::~TableHandler() +{ +} + +void TableHandler::startTable(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + m_numColumns = attrib.value("cols").toInt(); + printf("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); +} + +//---------------------------------------------------------------------- +// ParagraphHandler +//---------------------------------------------------------------------- + +ParagraphHandler::ParagraphHandler(IBaseHandler *parent) + : m_parent(parent) +{ + m_children.setAutoDelete(TRUE); + + m_markupHandler = new MarkupHandler(m_children,m_curString); + setFallBackHandler(m_markupHandler); + + addEndHandler("para",this,&ParagraphHandler::endParagraph); + + addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList); + addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList); + addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList); + addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect); + addStartHandler("ref",this,&ParagraphHandler::startRef); + addStartHandler("variablelist",this,&ParagraphHandler::startVariableList); + addStartHandler("hruler",this,&ParagraphHandler::startHRuler); + addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak); + addStartHandler("ulink",this,&ParagraphHandler::startULink); + addStartHandler("email",this,&ParagraphHandler::startEMail); + addStartHandler("link",this,&ParagraphHandler::startLink); + addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing); + addStartHandler("formula",this,&ParagraphHandler::startFormula); + addStartHandler("image",this,&ParagraphHandler::startImage); + addStartHandler("dotfile",this,&ParagraphHandler::startDotFile); + addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry); + addStartHandler("table",this,&ParagraphHandler::startTable); +} + +ParagraphHandler::~ParagraphHandler() +{ + delete m_markupHandler; +} + +void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); + printf("para\n"); +} + +void ParagraphHandler::endParagraph() +{ + addTextNode(); + printf("end para\n"); + m_parent->setDelegate(0); +} + +void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib) +{ + addTextNode(); + ListHandler *listHandler = new ListHandler(ItemizedList,this); + listHandler->startList(attrib); + m_children.append(listHandler); +} + +void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib) +{ + addTextNode(); + ListHandler *listHandler = new ListHandler(OrderedList,this); + listHandler->startList(attrib); + m_children.append(listHandler); +} + +void ParagraphHandler::startParameterList(const QXmlAttributes& attrib) +{ + addTextNode(); + ParameterListHandler *parListHandler = new ParameterListHandler(this); + parListHandler->startParameterList(attrib); + m_children.append(parListHandler); +} + +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::addTextNode() +{ + if (!m_curString.isEmpty()) + { + m_children.append(new TextNode(m_curString,m_markupHandler->markup())); + printf("addTextNode() text=\"%s\" markup=%x\n", + m_curString.data(),m_markupHandler->markup()); + m_curString=""; + } +} + +IDocIterator *ParagraphHandler::contents() const +{ + return new ParagraphIterator(*this); +} + +//---------------------------------------------------------------------- +// DocSectionHandler +//---------------------------------------------------------------------- + +DocSectionHandler::DocSectionHandler(IBaseHandler *parent,int level) + : m_parent(parent), m_level(level) +{ + m_children.setAutoDelete(TRUE); + m_markupHandler = new MarkupHandler(m_children,m_curString); + setFallBackHandler(m_markupHandler); + addStartHandler("ref",this,&DocSectionHandler::startRef); + QString sectionKey; + sectionKey.sprintf("sect%d",level); + addEndHandler(sectionKey,this,&DocSectionHandler::endDocSection); +} + +DocSectionHandler::~DocSectionHandler() +{ + delete m_markupHandler; +} + +void DocSectionHandler::startDocSection(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + printf("Start docsection\n"); + m_id = attrib.value("id"); + m_curString=""; +} + +void DocSectionHandler::endDocSection() +{ + addTextNode(); + m_parent->setDelegate(0); + printf("End docsection\n"); +} + +void DocSectionHandler::addTextNode() +{ + if (!m_curString.isEmpty()) + { + m_children.append(new TextNode(m_curString,m_markupHandler->markup())); + printf("addTextNode() text=\"%s\" markup=%x\n", + m_curString.data(),m_markupHandler->markup()); + m_curString=""; + } +} + +void DocSectionHandler::startRef(const QXmlAttributes& attrib) +{ + RefHandler *ref = new RefHandler(this); + ref->startRef(attrib); + m_children.append(ref); +} + +IDocIterator *DocSectionHandler::title() const +{ + return new DocSectionIterator(*this); +} + +//---------------------------------------------------------------------- +// DocHandler +//---------------------------------------------------------------------- + +DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent) +{ + m_children.setAutoDelete(TRUE); + + addEndHandler("briefdescription",this,&DocHandler::endDoc); + addEndHandler("detaileddescription",this,&DocHandler::endDoc); + + addStartHandler("para",this,&DocHandler::startParagraph); + addStartHandler("sect1",this,&DocHandler::startSect1); + addStartHandler("sect2",this,&DocHandler::startSect2); + addStartHandler("sect3",this,&DocHandler::startSect3); + addStartHandler("title",this,&DocHandler::startTitle); +} + +DocHandler::~DocHandler() +{ +} + +void DocHandler::startDoc(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); + printf("start dochandler\n"); +} + +void DocHandler::endDoc() +{ + printf("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::startSect2(const QXmlAttributes& attrib) +{ + DocSectionHandler *secHandler = new DocSectionHandler(this,2); + secHandler->startDocSection(attrib); + m_children.append(secHandler); +} + +void DocHandler::startSect3(const QXmlAttributes& attrib) +{ + DocSectionHandler *secHandler = new DocSectionHandler(this,3); + 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); +} + +IDocIterator *DocHandler::contents() const +{ + return new DocIterator(*this); +} + diff --git a/addon/doxmlparser/src/dochandler.h b/addon/doxmlparser/src/dochandler.h new file mode 100644 index 0000000..3425288 --- /dev/null +++ b/addon/doxmlparser/src/dochandler.h @@ -0,0 +1,859 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include + +#include +#include "basehandler.h" +#include "baseiterator.h" + +class ParagraphHandler; + +//----------------------------------------------------------------------------- + + +/*! \brief Node representing a piece of text. + * + */ +class TextNode : public IDocText +{ + public: + TextNode(const QString &t,int markup) + : m_text(t), m_markup(markup) {} + virtual ~TextNode() {} + + // IDocText + virtual Kind kind() const { return Text; } + virtual QString text() const { return m_text; } + virtual int markup() const { return m_markup; } + + private: + QString m_text; + int m_markup; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a change in the markup style. + * + */ +class MarkupModifierNode : public IDocMarkupModifier +{ + public: + MarkupModifierNode(int markup,bool enabled) + : m_markup(markup), m_enabled(enabled) {} + virtual ~MarkupModifierNode() {} + + // IDocMarkupModifier + virtual Kind kind() const { return MarkupModifier; } + + private: + int m_markup; + bool m_enabled; +}; + + +//----------------------------------------------------------------------------- + +/*! \brief Handles markup commands in the XML input. + * + */ +class MarkupHandler : public BaseFallBackHandler +{ + public: + MarkupHandler(QList &children,QString &curString); + virtual ~MarkupHandler(); + int markup() const { return m_curMarkup; } + + 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(); + + + private: + void addTextNode(); + + QList &m_children; + QString &m_curString; + int m_curMarkup; +}; + + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a list item. + * + */ +class ListItemHandler : public IDocListItem, public BaseHandler +{ + 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 ListItem; } + + private: + IBaseHandler *m_parent; + QList m_children; +}; + + +//----------------------------------------------------------------------------- + +/*! \brief Node representing list of items. + * + */ +class ListHandler : public IDocList, public BaseHandler +{ + public: + ListHandler(Kind k,IBaseHandler *parent); + virtual ~ListHandler(); + virtual void startList(const QXmlAttributes& attrib); + virtual void endList(); + virtual void startListItem(const QXmlAttributes& attrib); + + // IDocList + virtual Kind kind() const { return m_kind; } + + private: + IBaseHandler *m_parent; + QList m_children; + Kind m_kind; +}; + + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a parameter. + * + */ +class ParameterHandler : public IDocParameter, + public BaseHandler +{ + public: + ParameterHandler(IBaseHandler *parent); + virtual ~ParameterHandler(); + virtual void startParameterName(const QXmlAttributes& attrib); + virtual void endParameterName(); + virtual void startParameterDescription(const QXmlAttributes& attrib); + virtual void endParameterDescription(); + virtual void startParagraph(const QXmlAttributes& attrib); + + // IDocParameter + virtual Kind kind() const { return Parameter; } + + private: + IBaseHandler *m_parent; + QString m_name; + ParagraphHandler *m_description; +}; + + +//----------------------------------------------------------------------------- + +/* \brief Node representing a parameter list. + * + */ +class ParameterListHandler : public IDocParameter, + public BaseHandler +{ + public: + enum Types { Param, RetVal, Exception }; + ParameterListHandler(IBaseHandler *parent); + virtual ~ParameterListHandler(); + virtual void startParameterList(const QXmlAttributes& attrib); + virtual void endParameterList(); + virtual void startParameterName(const QXmlAttributes& attrib); + virtual void startParameterDescription(const QXmlAttributes& attrib); + + // IDocParameterList + virtual Kind kind() const { return ParameterList; } + + private: + IBaseHandler *m_parent; + QList m_parameters; + ParameterHandler *m_curParam; + Types m_type; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a horizontal ruler + * + */ +class LineBreakHandler : public IDocLineBreak, public BaseHandler +{ + public: + LineBreakHandler(IBaseHandler *parent); + virtual ~LineBreakHandler(); + + void startLineBreak(const QXmlAttributes& attrib); + void endLineBreak(); + + // IDocLineBreak + virtual Kind kind() const { return LineBreak; } + + private: + IBaseHandler *m_parent; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a link to section + * + */ +class LinkHandler : public IDocLink, public BaseHandler +{ + public: + LinkHandler(IBaseHandler *parent); + virtual ~LinkHandler(); + + void startLink(const QXmlAttributes& attrib); + void endLink(); + + // IDocLink + virtual Kind kind() const { return Link; } + + private: + IBaseHandler *m_parent; + QString m_ref; + QString m_text; +}; + + +//----------------------------------------------------------------------------- + +/* \brief Node representing a link to an email address + * + */ +class EMailHandler : public IDocEMail, public BaseHandler +{ + public: + EMailHandler(IBaseHandler *parent); + virtual ~EMailHandler(); + + void startEMail(const QXmlAttributes& attrib); + void endEMail(); + + // IDocEMail + virtual Kind kind() const { return EMail; } + + private: + IBaseHandler *m_parent; + QString m_address; +}; + + +//----------------------------------------------------------------------------- + +/* \brief Node representing a link to an URL + * + */ +class ULinkHandler : public IDocULink, public BaseHandler +{ + public: + ULinkHandler(IBaseHandler *parent); + virtual ~ULinkHandler(); + + void startULink(const QXmlAttributes& attrib); + void endULink(); + + // IDocULink + virtual Kind kind() const { return ULink; } + + private: + IBaseHandler *m_parent; + QString m_url; + QString m_text; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a horizontal ruler + * + */ +class HRulerHandler : public IDocHRuler, public BaseHandler +{ + public: + HRulerHandler(IBaseHandler *parent); + virtual ~HRulerHandler(); + + void startHRuler(const QXmlAttributes& attrib); + void endHRuler(); + + // IDocHRuler + virtual Kind kind() const { return HRuler; } + + private: + IBaseHandler *m_parent; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a reference to another item + * + */ +class RefHandler : public IDocRef, public BaseHandler +{ + public: + RefHandler(IBaseHandler *parent); + virtual ~RefHandler(); + void startRef(const QXmlAttributes& attrib); + void endRef(); + + // IDocRef + virtual Kind kind() const { return Ref; } + + private: + IBaseHandler *m_parent; + QString m_refId; + QString m_anchor; + QString m_linkText; +}; + +//----------------------------------------------------------------------------- + +/* \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 IDocTitle, public BaseHandler +{ + 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 Title; } + virtual IDocIterator *title() const; + + private: + IBaseHandler *m_parent; + QList m_children; + MarkupHandler *m_markupHandler; +}; + +class TitleIterator : public BaseIterator +{ + public: + TitleIterator(const TitleHandler &handler) : + BaseIterator(handler.m_children) {} +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a simple section with an unnumbered header. + * + */ +// children: title, para +class SimpleSectHandler : public IDocSimpleSect, + public BaseHandler +{ + 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 + }; + 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 SimpleSect; } + + private: + IBaseHandler *m_parent; + ParagraphHandler *m_paragraph; + Types m_type; + TitleHandler *m_title; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing an named item of a VariableList. + * + */ +class VariableListEntryHandler : public IDocVariableListEntry, public BaseHandler +{ + 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 VariableListEntry; } + + private: + IBaseHandler *m_parent; + QString m_term; + ParagraphHandler *m_description; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a list of named items. + * + */ +// children: varlistentry, listitem +class VariableListHandler : public IDocVariableList, public BaseHandler +{ + 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 VariableList; } + + private: + IBaseHandler *m_parent; + QList m_entries; + VariableListEntryHandler *m_curEntry; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a highlighted text fragment. + * + */ +// children: - +class HighlightHandler : public IDocHighlight, public BaseHandler +{ + public: + HighlightHandler(IBaseHandler *parent); + virtual ~HighlightHandler(); + void startHighlight(const QXmlAttributes& attrib); + void endHighlight(); + + // IDocHighlight + virtual Kind kind() const { return Highlight; } + + private: + IBaseHandler *m_parent; + QString m_class; + QString m_text; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a line of code. + * + */ +// children: linenumber, highlight, anchor, ref +class CodeLineHandler : public IDocCodeLine, public BaseHandler +{ + 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 CodeLine; } + + private: + void addTextNode(); + + IBaseHandler *m_parent; + int m_lineNumber; + QString m_refId; + QList m_children; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a program listing + * + */ +// children: codeline, linenumber +class ProgramListingHandler : public IDocProgramListing, public BaseHandler +{ + 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 ProgramListing; } + + private: + IBaseHandler *m_parent; + QList m_children; + bool m_hasLineNumber; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a formula. + * + */ +// children: - +class FormulaHandler : public IDocFormula, public BaseHandler +{ + public: + FormulaHandler(IBaseHandler *parent); + virtual ~FormulaHandler(); + void startFormula(const QXmlAttributes& attrib); + void endFormula(); + + // IDocFormula + virtual Kind kind() const { return Formula; } + + private: + IBaseHandler *m_parent; + QString m_id; + QString m_text; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing an image. + * + */ +// children: - +class ImageHandler : public IDocImage, public BaseHandler +{ + public: + ImageHandler(IBaseHandler *parent); + virtual ~ImageHandler(); + void startImage(const QXmlAttributes& attrib); + void endImage(); + + // IDocImage + virtual Kind kind() const { return Image; } + + private: + IBaseHandler *m_parent; + QString m_name; + QString m_caption; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a dot file. + * + */ +// children: - +class DotFileHandler : public IDocDotFile, public BaseHandler +{ + public: + DotFileHandler(IBaseHandler *parent); + virtual ~DotFileHandler(); + void startDotFile(const QXmlAttributes& attrib); + void endDotFile(); + + // IDocDotFile + virtual Kind kind() const { return DotFile; } + + private: + IBaseHandler *m_parent; + QString m_name; + QString m_caption; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing an entry in the index. + * + */ +// children: - +class IndexEntryHandler : public IDocIndexEntry, public BaseHandler +{ + 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 IndexEntry; } + + private: + IBaseHandler *m_parent; + QString m_primary; + QString m_secondary; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing an entry in the table entry. + * + */ +// children: para +class EntryHandler : public IDocEntry, public BaseHandler +{ + public: + EntryHandler(IBaseHandler *parent); + virtual ~EntryHandler(); + void startEntry(const QXmlAttributes& attrib); + void endEntry(); + void startParagraph(const QXmlAttributes& attrib); + + // IDocEntry + virtual Kind kind() const { return Entry; } + + private: + IBaseHandler *m_parent; + QList m_children; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing an entry in the table row. + * + */ +// children: entry +class RowHandler : public IDocRow, public BaseHandler +{ + public: + RowHandler(IBaseHandler *parent); + virtual ~RowHandler(); + void startRow(const QXmlAttributes& attrib); + void endRow(); + void startEntry(const QXmlAttributes& attrib); + + // IDocRow + virtual Kind kind() const { return Row; } + + private: + IBaseHandler *m_parent; + QList m_children; +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing an entry in the table. + * + */ +// children: row +class TableHandler : public IDocTable, public BaseHandler +{ + public: + TableHandler(IBaseHandler *parent); + virtual ~TableHandler(); + void startTable(const QXmlAttributes& attrib); + void endTable(); + void startRow(const QXmlAttributes& attrib); + + // IDocTable + virtual Kind kind() const { return Table; } + + private: + IBaseHandler *m_parent; + QList m_children; + int m_numColumns; +}; + +//----------------------------------------------------------------------------- + +/*! \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 IDocPara, + public BaseHandler +{ + 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); + + ParagraphHandler(IBaseHandler *parent); + virtual ~ParagraphHandler(); + + // IDocPara + virtual Kind kind() const { return Para; } + virtual IDocIterator *contents() const; + + private: + void addTextNode(); + IBaseHandler *m_parent; + QList m_children; + MarkupHandler *m_markupHandler; +}; + +class ParagraphIterator : public BaseIterator +{ + public: + ParagraphIterator(const ParagraphHandler &handler) : + BaseIterator(handler.m_children) {} +}; + + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a section. + * + */ +// children: text, ref +// children handled by MarkupHandler: +// bold, computeroutput, emphasis, center, +// small, subscript, superscript. +class DocSectionHandler : public IDocSection, public BaseHandler +{ + friend class DocSectionIterator; + public: + DocSectionHandler(IBaseHandler *parent,int level); + virtual ~DocSectionHandler(); + virtual void startDocSection(const QXmlAttributes& attrib); + virtual void endDocSection(); + virtual void startRef(const QXmlAttributes& attrib); + void addTextNode(); + + // IDocSection + virtual Kind kind() const { return Section; } + virtual QString id() const { return m_id; } + virtual int level() const { return m_level; } + virtual IDocIterator *title() const; + + private: + IBaseHandler *m_parent; + QList m_children; + MarkupHandler *m_markupHandler; + QString m_id; + int m_level; +}; + +class DocSectionIterator : public BaseIterator +{ + public: + DocSectionIterator(const DocSectionHandler &handler) : + BaseIterator(handler.m_children) {} +}; + +//----------------------------------------------------------------------------- + +/*! \brief Node representing a documentation block. + * + */ +// children: para, title, sect1, sect2, sect3 +class DocHandler : public IDocRoot, public BaseHandler +{ + 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 startSect2(const QXmlAttributes& attrib); + virtual void startSect3(const QXmlAttributes& attrib); + virtual void startTitle(const QXmlAttributes& attrib); + + DocHandler(IBaseHandler *parent); + virtual ~DocHandler(); + + // IDocRoot + virtual Kind kind() const { return Root; } + virtual IDocIterator *contents() const; + + private: + IBaseHandler *m_parent; + QList m_children; +}; + +class DocIterator : public BaseIterator +{ + public: + DocIterator(const DocHandler &handler) : + BaseIterator(handler.m_children) {} +}; + +#endif diff --git a/addon/doxmlparser/src/doxmlintf.h b/addon/doxmlparser/src/doxmlintf.h new file mode 100644 index 0000000..ec2950c --- /dev/null +++ b/addon/doxmlparser/src/doxmlintf.h @@ -0,0 +1,422 @@ +#ifndef _DOXMLINTF_H +#define _DOXMLINTF_H + +#include + +class IMember; +class IDocIterator; + +class ILinkedText +{ + public: + enum Kind { Kind_Text, Kind_Ref }; + virtual Kind kind() const = 0; +}; + +class ILT_Text : public ILinkedText +{ + public: + virtual QString text() const = 0; +}; + +class ILT_Ref : public ILinkedText +{ + public: + virtual QString id() const = 0; + virtual QString external() const = 0; + virtual QString text() const = 0; +}; + +class ILinkedTextIterator +{ + public: + 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; +}; + +class IParam +{ + public: + virtual ILinkedTextIterator *type() const = 0; + virtual QString declarationName() const = 0; + virtual QString definitionName() const = 0; + virtual QString attrib() const = 0; + virtual QString arraySpecifier() const = 0; + virtual ILinkedTextIterator *defaultValue() const = 0; +}; + +class IParamIterator +{ + public: + 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 IMember *member() const = 0; + virtual QString memberName() const = 0; +}; + +class IMemberReferenceIterator +{ + public: + 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 IEnumValue +{ + public: + virtual QString name() const = 0; + virtual QString initializer() const = 0; +}; + +class IEnumValueIterator +{ + public: + virtual IEnumValue *toFirst() = 0; + virtual IEnumValue *toLast() = 0; + virtual IEnumValue *toNext() = 0; + virtual IEnumValue *toPrev() = 0; + virtual IEnumValue *current() const = 0; + virtual void release() = 0; +}; + +class IDoc +{ + public: + enum Kind + { + Para, // 0 -> IDocPara + Text, // 1 -> IDocText + MarkupModifier, // 2 -> IDocMarkupModifier + ItemizedList, // 3 -> IDocList + OrderedList, // 4 -> IDocList + ListItem, // 5 -> IDocListItem + ParameterList, // 6 -> IDocParameterList + Parameter, // 7 -> IDocParameter + SimpleSect, // 8 -> IDocSimpleSect + Title, // 9 -> IDocTitle + Ref, // 10 -> IDocRef + VariableList, // 11 -> IDocVariableList + VariableListEntry, // 12 -> IDocVariableListEntry + HRuler, // 13 -> IDocHRuler + LineBreak, // 14 -> IDocLineBreak + ULink, // 15 -> IDocULink + EMail, // 16 -> IDocEMail + Link, // 17 -> IDocLink + ProgramListing, // 18 -> IDocProgramListing + CodeLine, // 19 -> IDocCodeLine + Highlight, // 20 -> IDocHighlight + Anchor, // 21 -> IDocAnchor + Formula, // 22 -> IDocFormula + Image, // 23 -> IDocImage + DotFile, // 24 -> IDocDotFile + IndexEntry, // 25 -> IDocIndexEntry + Table, // 26 -> IDocTable + Row, // 27 -> IDocRow + Entry, // 28 -> IDocEntry + Section, // 29 -> IDocSection + Root // 30 -> IDocRoot + }; + virtual Kind kind() const = 0; +}; + +class IDocMarkup : public IDoc +{ + public: + enum Markup + { + Normal = 0x00, + Bold = 0x01, + Emphasis = 0x02, + ComputerOutput = 0x04, + Subscript = 0x08, + Superscript = 0x10, + SmallFont = 0x20, + Center = 0x40 + }; + +}; + +class IDocPara : public IDoc +{ + public: + virtual IDocIterator *contents() const = 0; +}; + +class IDocText : public IDocMarkup +{ + public: + virtual QString text() const = 0; + virtual int markup() const = 0; +}; + +class IDocMarkupModifier : public IDoc +{ +}; + +class IDocList : public IDoc +{ +}; + +class IDocListItem : public IDoc +{ +}; + +class IDocParameterList : public IDoc +{ +}; + +class IDocParameter : public IDoc +{ +}; + +class IDocSimpleSect : public IDoc +{ +}; + +class IDocTitle : public IDoc +{ + public: + virtual IDocIterator *title() const = 0; +}; + +class IDocRef : public IDoc +{ +}; + +class IDocVariableList : public IDoc +{ +}; + +class IDocVariableListEntry : public IDoc +{ +}; + +class IDocHRuler : public IDoc +{ +}; + +class IDocLineBreak : public IDoc +{ +}; + +class IDocULink : public IDoc +{ +}; + +class IDocEMail : public IDoc +{ +}; + +class IDocLink : public IDoc +{ +}; + +class IDocProgramListing : public IDoc +{ +}; + +class IDocCodeLine : public IDoc +{ +}; + +class IDocHighlight : public IDoc +{ +}; + +class IDocAnchor : public IDoc +{ +}; + +class IDocFormula : public IDoc +{ +}; + +class IDocImage : public IDoc +{ +}; + +class IDocDotFile : public IDoc +{ +}; + +class IDocIndexEntry : public IDoc +{ +}; + +class IDocTable : public IDoc +{ +}; + +class IDocRow : public IDoc +{ +}; + +class IDocEntry : public IDoc +{ +}; + +class IDocSection : public IDoc +{ + public: + virtual QString id() const = 0; + virtual int level() const = 0; + virtual IDocIterator *title() const = 0; +}; + +class IDocRoot : public IDoc +{ + public: + virtual IDocIterator *contents() const = 0; +}; + +class IDocIterator +{ + public: + 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 IMember +{ + public: + virtual QString kind() const = 0; + virtual QString id() const = 0; + virtual QString protection() const = 0; + virtual QString virtualness() const = 0; + virtual ILinkedTextIterator *type() const = 0; + virtual QString name() const = 0; + virtual bool isConst() const = 0; + virtual bool isVolatile() const = 0; + virtual IParamIterator *params() const = 0; + virtual ILinkedTextIterator *initializer() const = 0; + virtual ILinkedTextIterator *exceptions() const = 0; + virtual IMemberReferenceIterator *references() const = 0; + virtual IMemberReferenceIterator *referencedBy() const = 0; + virtual int bodyStart() const = 0; + virtual int bodyEnd() const = 0; + virtual QString definitionFile() const = 0; + virtual int definitionLine() const = 0; + virtual IMemberReference *reimplements() const = 0; + virtual IMemberReferenceIterator *reimplementedBy() const = 0; + virtual IEnumValueIterator *enumValues() const = 0; + virtual IDocRoot *briefDescription() const = 0; + virtual IDocRoot *detailedDescription() const = 0; +}; + +class IMemberIterator +{ + public: + 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 ISection +{ + public: + virtual QString kind() const = 0; + virtual IMemberIterator *members() const = 0; +}; + +class ISectionIterator +{ + public: + 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; +}; + +class ICompound +{ + public: + virtual QString name() const = 0; + virtual QString id() const = 0; + virtual QString kind() const = 0; + virtual ISectionIterator *sections() const = 0; + virtual IDocRoot *briefDescription() const = 0; + virtual IDocRoot *detailedDescription() const = 0; +}; + +class ICompoundIterator +{ + public: + virtual ICompound *toFirst() = 0; + virtual ICompound *toLast() = 0; + virtual ICompound *toNext() = 0; + virtual ICompound *toPrev() = 0; + virtual ICompound *current() const = 0; + virtual void release() = 0; +}; + +/*! Root node of the object model. */ +class IDoxygen +{ + public: + /*! 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 QString &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 QString &name) const = 0; + + /*! Returns an interface to a member given its id. + * @param id The member id. + */ + virtual IMember *memberById(const QString &id) const = 0; + + /*! Returns a list of all members with a certain name. + * @param name The name of the member. + */ + virtual IMemberIterator *memberByName(const QString &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; +}; + +/*! Factory method that creates an object model given an XML file generated + * by doxygen. + * @param xmlFileName The name of the XML to parse. + * @returns An iterface to the object model. + */ +IDoxygen *createObjectModelFromXML(const char *xmlFileName); + +#endif diff --git a/addon/doxmlparser/src/doxmlparser.pro.in b/addon/doxmlparser/src/doxmlparser.pro.in new file mode 100644 index 0000000..7724b47 --- /dev/null +++ b/addon/doxmlparser/src/doxmlparser.pro.in @@ -0,0 +1,23 @@ +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 +SOURCES = mainhandler.cpp \ + compoundhandler.cpp sectionhandler.cpp \ + memberhandler.cpp paramhandler.cpp \ + dochandler.cpp linkedtexthandler.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/addon/doxmlparser/src/linkedtexthandler.cpp b/addon/doxmlparser/src/linkedtexthandler.cpp new file mode 100644 index 0000000..b142188 --- /dev/null +++ b/addon/doxmlparser/src/linkedtexthandler.cpp @@ -0,0 +1,107 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 + +class LT_Text : public ILT_Text +{ + public: + LT_Text(const QString &text) : m_text(text) {} + virtual ~LT_Text() {} + + // ILT_Text + virtual QString text() const { return m_text; } + virtual Kind kind() const { return Kind_Text; } + private: + QString m_text; +}; + +class LT_Ref : 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; } + + // ILT_Ref + virtual QString text() const { return m_text; } + virtual QString id() const { return m_refId; } + virtual QString external() const { return m_extId; } + virtual Kind kind() const { return Kind_Ref; } + + private: + QString m_refId; + QString m_extId; + QString m_text; +}; + +LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent, + QList &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)); + printf("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)); + printf("LinkedTextHandler: add text `%s'\n",m_curString.data()); + m_curString=""; + } + ASSERT(m_ref==0); + m_ref = new LT_Ref; + m_ref->setRefId(attrib.value("idref")); + m_ref->setExtId(attrib.value("external")); +} + +void LinkedTextHandler::endRef() +{ + m_ref->setText(m_curString); + m_children.append(m_ref); + printf("LinkedTextHandler: add ref `%s'\n",m_ref->text().data()); + m_ref=0; +} + + diff --git a/addon/doxmlparser/src/linkedtexthandler.h b/addon/doxmlparser/src/linkedtexthandler.h new file mode 100644 index 0000000..0569b00 --- /dev/null +++ b/addon/doxmlparser/src/linkedtexthandler.h @@ -0,0 +1,46 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 LinkedTextIterator : public BaseIterator +{ + public: + LinkedTextIterator(const QList &list) : + BaseIterator(list) {} +}; + +class LinkedTextHandler : public BaseHandler +{ + public: + LinkedTextHandler(IBaseHandler *parent,QList &children); + virtual ~LinkedTextHandler(); + virtual void start(const char *endTag); + virtual void end(); + virtual void startRef(const QXmlAttributes& attrib); + virtual void endRef(); + + private: + IBaseHandler *m_parent; + QList &m_children; + LT_Ref *m_ref; +}; + +#endif diff --git a/addon/doxmlparser/src/mainhandler.cpp b/addon/doxmlparser/src/mainhandler.cpp new file mode 100644 index 0000000..7d0e682 --- /dev/null +++ b/addon/doxmlparser/src/mainhandler.cpp @@ -0,0 +1,126 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include "mainhandler.h" + +MainHandler::MainHandler() : m_compoundDict(10007), m_compoundNameDict(10007) +{ + m_compounds.setAutoDelete(TRUE); + addStartHandler("doxygen"); + addStartHandler("compounddef",this,&MainHandler::startCompound); + addEndHandler("doxygen"); + addEndHandler("compounddef"); +} + +MainHandler::~MainHandler() +{ + printf("MainHandler::~MainHandler()\n"); +} + +void MainHandler::startCompound(const QXmlAttributes& attrib) +{ + CompoundHandler *compHandler = new CompoundHandler(this); + compHandler->startCompound(attrib); + m_compounds.append(compHandler); +} + +void MainHandler::insertMemberById(const QString &id,IMember *h) +{ + m_memberDict.insert(id,h); +} + +void MainHandler::insertMemberByName(const QString &name,IMember *h) +{ + QList *ml = m_memberNameDict[name]; + if (ml) + { + ml->append(h); + } + else + { + ml = new QList; + ml->append(h); + m_memberNameDict.insert(name,ml); + } +} + +void MainHandler::initialize() +{ + QListIterator mci(m_compounds); + CompoundHandler *compHandler; + for (;(compHandler=(CompoundHandler *)mci.current());++mci) + { + compHandler->initialize(this); + m_compoundNameDict.insert(compHandler->name(),compHandler); + m_compoundDict.insert(compHandler->id(),compHandler); + } + + // for each member + QDictIterator< QList > mndi(m_memberNameDict); + QList *ml; + for (;(ml=mndi.current());++mndi) + { + QListIterator mli(*ml); + IMember *mem; + for (;(mem=mli.current());++mli) + { + ((MemberHandler*)mem)->initialize(this); + } + } + +} + +class ErrorHandler : public QXmlErrorHandler +{ + public: + virtual ~ErrorHandler() {} + bool warning( const QXmlParseException & ) + { + return FALSE; + } + bool error( const QXmlParseException & ) + { + return FALSE; + } + bool fatalError( const QXmlParseException &exception ) + { + fprintf(stderr,"Fatal error at line %d column %d: %s\n", + exception.lineNumber(),exception.columnNumber(), + exception.message().data()); + return FALSE; + } + QString errorString() { return ""; } + + private: + QString errorMsg; +}; + +IDoxygen *createObjectModelFromXML(const char * xmlFileName) +{ + QFile xmlFile(xmlFileName); + MainHandler * handler = new MainHandler; + ErrorHandler errorHandler; + QXmlInputSource source( xmlFile ); + QXmlSimpleReader reader; + reader.setContentHandler( handler ); + reader.setErrorHandler( &errorHandler ); + reader.parse( source ); + printf("<---------- initialize ----------->\n"); + handler->initialize(); + printf("<-------- end initialize --------->\n"); + return handler; +} + diff --git a/addon/doxmlparser/src/mainhandler.h b/addon/doxmlparser/src/mainhandler.h new file mode 100644 index 0000000..e466b6f --- /dev/null +++ b/addon/doxmlparser/src/mainhandler.h @@ -0,0 +1,68 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include "basehandler.h" +#include "compoundhandler.h" +#include +#include "memberhandler.h" + +class MainHandler : public IDoxygen, public BaseHandler +{ + public: + virtual void startCompound(const QXmlAttributes& attrib); + MainHandler(); + virtual ~MainHandler(); + + ICompoundIterator *compounds() const + { + return new CompoundIterator(m_compounds); + } + ICompound *compoundById(const QString &id) const + { + return m_compoundDict[id]; + } + virtual ICompound *compoundByName(const QString &name) const + { + return name.isEmpty() ? 0 : m_compoundNameDict[name]; + } + virtual IMember *memberById(const QString &id) const + { + return m_memberDict[id]; + } + virtual IMemberIterator *memberByName(const QString &name) const + { + QList *ml = m_memberNameDict[name]; + if (ml==0) return 0; + return new MemberIterator(*ml); + } + virtual void release() { delete this; } + void insertMemberById(const QString &id,IMember *h); + void insertMemberByName(const QString &name,IMember *h); + + void initialize(); + + private: + QList m_compounds; + QDict m_compoundDict; + QDict m_compoundNameDict; + QDict m_memberDict; + QDict > m_memberNameDict; +}; + +#endif diff --git a/addon/doxmlparser/src/memberhandler.cpp b/addon/doxmlparser/src/memberhandler.cpp new file mode 100644 index 0000000..f211f8e --- /dev/null +++ b/addon/doxmlparser/src/memberhandler.cpp @@ -0,0 +1,299 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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" + +//------------------------------------------------------------------------------ + +void MemberReference::initialize(MainHandler *mh) +{ + m_mainHandler = mh; +} + +IMember *MemberReference::member() const +{ + return m_mainHandler->memberById(m_memId); +} + +//------------------------------------------------------------------------------ + + +EnumValueHandler::EnumValueHandler(IBaseHandler *parent) : m_parent(parent) +{ + addEndHandler("enumvalue",this,&EnumValueHandler::endEnumValue); + + addStartHandler("name",this,&EnumValueHandler::startName); + addEndHandler("name",this,&EnumValueHandler::endName); + addStartHandler("initializer",this,&EnumValueHandler::startInitializer); + addEndHandler("initializer",this,&EnumValueHandler::endInitializer); +} + +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*/) +{ + m_curString=""; +} + +void EnumValueHandler::endInitializer() +{ + m_initializer = m_curString; +} + +//------------------------------------------------------------------------------ + +MemberHandler::MemberHandler(IBaseHandler *parent) + : m_parent(parent), m_brief(0), m_detailed(0) +{ + addEndHandler("memberdef",this,&MemberHandler::endMember); + + addStartHandler("type",this,&MemberHandler::startType); + addStartHandler("initializer",this,&MemberHandler::startInitializer); + addStartHandler("exception",this,&MemberHandler::startException); + addStartHandler("enumvalue",this,&MemberHandler::startEnumValue); + + addStartHandler("name"); + addEndHandler("name",this,&MemberHandler::endName); + + addStartHandler("param",this,&MemberHandler::startParam); + + addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc); + + addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc); + + addStartHandler("references",this,&MemberHandler::startReferences); + addEndHandler("references",this,&MemberHandler::endReferences); + + addStartHandler("referencedby",this,&MemberHandler::startReferencedBy); + addEndHandler("referencedby",this,&MemberHandler::endReferencedBy); + + addStartHandler("reimplements",this,&MemberHandler::startReimplements); + addEndHandler("reimplements",this,&MemberHandler::endReimplements); + + addStartHandler("reimplementedby",this,&MemberHandler::startReimplementedBy); + addEndHandler("reimplementedby",this,&MemberHandler::endReimplementedBy); + + addStartHandler("location",this,&MemberHandler::startLocation); + addEndHandler("location"); + + 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; +} + +MemberHandler::~MemberHandler() +{ + delete m_brief; + delete m_detailed; + delete m_linkedTextHandler; +} + +void MemberHandler::startMember(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + m_kind = attrib.value("kind"); + m_id = attrib.value("id"); + m_virtualness = attrib.value("virt"); + m_protection = attrib.value("prot"); + m_isConst = attrib.value("const")=="yes"; + m_isVolatile = attrib.value("volatile")=="yes"; + printf("member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n", + m_kind.data(),m_id.data(),m_protection.data(),m_virtualness.data()); +} + +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::startLocation(const QXmlAttributes& attrib) +{ + m_defFile = attrib.value("file"); + 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("id"); + 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("id"); + 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("id"); + 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("id"); + 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 &) +{ + printf("startType!\n"); + delete m_linkedTextHandler; + m_linkedTextHandler = new LinkedTextHandler(this,m_type); + m_linkedTextHandler->start("type"); +} + +void MemberHandler::startInitializer(const QXmlAttributes &) +{ + printf("startInitializer!\n"); + delete m_linkedTextHandler; + m_linkedTextHandler = new LinkedTextHandler(this,m_initializer); + m_linkedTextHandler->start("initializer"); +} + +void MemberHandler::startException(const QXmlAttributes &) +{ + printf("startException!\n"); + delete m_linkedTextHandler; + m_linkedTextHandler = new LinkedTextHandler(this,m_exception); + m_linkedTextHandler->start("exception"); +} + +void MemberHandler::endName() +{ + m_name = m_curString.stripWhiteSpace(); + printf("member name=`%s'\n",m_name.data()); +} + +void MemberHandler::startParam(const QXmlAttributes& attrib) +{ + ParamHandler *paramHandler = new ParamHandler(this); + paramHandler->startParam(attrib); + m_params.append(paramHandler); +} + +void MemberHandler::startEnumValue(const QXmlAttributes& attrib) +{ + EnumValueHandler *evh = new EnumValueHandler(this); + evh->startEnumValue(attrib); + m_enumValues.append(evh); +} + +void MemberHandler::initialize(MainHandler *mh) +{ + { + QListIterator mli(m_references); + MemberReference *mr; + for (;(mr=mli.current());++mli) + { + mr->initialize(mh); + } + } + { + QListIterator mli(m_referencedBy); + MemberReference *mr; + for (;(mr=mli.current());++mli) + { + mr->initialize(mh); + } + } + { + QListIterator mli(m_reimplementedBy); + MemberReference *mr; + for (;(mr=mli.current());++mli) + { + mr->initialize(mh); + } + } + if (m_reimplements) m_reimplements->initialize(mh); +} + diff --git a/addon/doxmlparser/src/memberhandler.h b/addon/doxmlparser/src/memberhandler.h new file mode 100644 index 0000000..b599e2f --- /dev/null +++ b/addon/doxmlparser/src/memberhandler.h @@ -0,0 +1,193 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include +#include + +#include "basehandler.h" +#include "baseiterator.h" +#include "paramhandler.h" +#include "linkedtexthandler.h" +#include "dochandler.h" + +class MainHandler; + +struct MemberReference : public IMemberReference +{ + virtual ~MemberReference() {} + virtual IMember *member() const; + virtual QString memberName() const { return m_name; } + void initialize(MainHandler *m); + + QString m_memId; + QString m_name; + MainHandler *m_mainHandler; +}; + +class MemberReferenceIterator : public BaseIterator +{ + public: + MemberReferenceIterator(const QList &list) : + BaseIterator(list) {} +}; + +class MemberIterator : public BaseIterator +{ + public: + MemberIterator(const QList &list) : + BaseIterator(list) {} +}; + +class EnumValueHandler : public IEnumValue, public BaseHandler +{ + public: + virtual void startName(const QXmlAttributes& attrib); + virtual void endName(); + virtual void startInitializer(const QXmlAttributes& attrib); + virtual void endInitializer(); + virtual void startEnumValue(const QXmlAttributes& attrib); + virtual void endEnumValue(); + + // IEnumValue + virtual QString name() const { return m_name; } + virtual QString initializer() const { return m_initializer; } + + void setName(const QString &name) { m_name=name; } + void setInitializer(const QString &init) { m_initializer=init; } + + virtual ~EnumValueHandler() {} + EnumValueHandler(IBaseHandler *parent); + + private: + QString m_name; + QString m_initializer; + IBaseHandler *m_parent; +}; + +class EnumValueIterator : public BaseIterator +{ + public: + EnumValueIterator(const QList &list) : + BaseIterator(list) {} +}; + + +class MemberHandler : public IMember, public BaseHandler +{ + public: + virtual void startMember(const QXmlAttributes& attrib); + virtual void endMember(); + virtual void startParam(const QXmlAttributes& attrib); + virtual void startType(const QXmlAttributes& attrib); + virtual void endName(); + virtual void startBriefDesc(const QXmlAttributes& attrib); + virtual void startDetailedDesc(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); + + MemberHandler(IBaseHandler *parent); + virtual ~MemberHandler(); + + // IMember implementation + virtual QString kind() const + { return m_kind; } + virtual QString id() const + { return m_id; } + virtual QString protection() const + { return m_protection; } + virtual QString virtualness() const + { return m_virtualness; } + virtual QString name() const + { return m_name; } + virtual bool isConst() const + { return m_isConst; } + virtual bool isVolatile() const + { return m_isVolatile; } + virtual ILinkedTextIterator *type() const + { return new LinkedTextIterator(m_type); } + virtual IParamIterator *params() const + { return new ParamIterator(m_params); } + virtual IMemberReferenceIterator *references() const + { return new MemberReferenceIterator(m_references); } + virtual IMemberReferenceIterator *referencedBy() const + { return new MemberReferenceIterator(m_referencedBy); } + virtual ILinkedTextIterator *initializer() const + { return new LinkedTextIterator(m_initializer); } + virtual ILinkedTextIterator *exceptions() const + { return new LinkedTextIterator(m_exception); } + virtual int bodyStart() const + { return m_bodyStart; } + virtual int bodyEnd() const + { return m_bodyEnd; } + virtual QString definitionFile() const + { return m_defFile; } + virtual int definitionLine() const + { return m_defLine; } + virtual IMemberReference *reimplements() const + { return m_reimplements; } + virtual IMemberReferenceIterator *reimplementedBy() const + { return new MemberReferenceIterator(m_reimplementedBy); } + virtual IEnumValueIterator *enumValues() const + { return new EnumValueIterator(m_enumValues); } + virtual IDocRoot *briefDescription() const + { return m_brief; } + virtual IDocRoot *detailedDescription() const + { return m_detailed; } + + void initialize(MainHandler *m); + + private: + IBaseHandler *m_parent; + QString m_kind; + QString m_id; + QString m_protection; + QString m_virtualness; + QList m_type; + QList m_initializer; + QList m_exception; + QString m_name; + DocHandler *m_brief; + DocHandler *m_detailed; + QList m_params; + QList m_references; + QList m_referencedBy; + MemberReference *m_reimplements; + QList m_reimplementedBy; + QString m_defFile; + int m_defLine; + int m_bodyStart; + int m_bodyEnd; + bool m_isConst; + bool m_isVolatile; + LinkedTextHandler *m_linkedTextHandler; + QList m_enumValues; +}; + +#endif diff --git a/addon/doxmlparser/src/paramhandler.cpp b/addon/doxmlparser/src/paramhandler.cpp new file mode 100644 index 0000000..0cf00e4 --- /dev/null +++ b/addon/doxmlparser/src/paramhandler.cpp @@ -0,0 +1,98 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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" + +ParamHandler::ParamHandler(IBaseHandler *parent) : 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("attrib"); + addEndHandler("attrib",this,&ParamHandler::endAttrib); + + addStartHandler("defval",this,&ParamHandler::startDefVal); + + m_linkedTextHandler = 0; +} + +ParamHandler::~ParamHandler() +{ +} + +void ParamHandler::startParam(const QXmlAttributes& /*attrib*/) +{ + m_parent->setDelegate(this); + printf("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"); + printf("param type\n"); +} + +void ParamHandler::endDeclName() +{ + m_declName = m_curString.stripWhiteSpace(); + printf("member declName=`%s'\n",m_declName.data()); +} + +void ParamHandler::endDefName() +{ + m_defName = m_curString.stripWhiteSpace(); + printf("member defName=`%s'\n",m_defName.data()); +} + +void ParamHandler::endAttrib() +{ + m_attrib = m_curString.stripWhiteSpace(); + printf("member attrib=`%s'\n",m_attrib.data()); +} + +void ParamHandler::endArray() +{ + m_array = m_curString.stripWhiteSpace(); + printf("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("type"); + printf("member defVal\n"); +} + + + diff --git a/addon/doxmlparser/src/paramhandler.h b/addon/doxmlparser/src/paramhandler.h new file mode 100644 index 0000000..6725a5e --- /dev/null +++ b/addon/doxmlparser/src/paramhandler.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include +#include + +#include "basehandler.h" +#include "baseiterator.h" +#include "linkedtexthandler.h" + +class ParamIterator : public BaseIterator +{ + public: + ParamIterator(const QList &list) : + BaseIterator(list) {} +}; + +class ParamHandler : public IParam, public BaseHandler +{ + 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); + + ParamHandler(IBaseHandler *parent); + virtual ~ParamHandler(); + + // IParam + virtual ILinkedTextIterator *type() const + { return new LinkedTextIterator(m_type); } + virtual QString declarationName() const { return m_declName; } + virtual QString definitionName() const { return m_defName; } + virtual QString attrib() const { return m_attrib; } + virtual QString arraySpecifier() const { return m_array; } + virtual ILinkedTextIterator *defaultValue() const + { return new LinkedTextIterator(m_defVal); } + + private: + IBaseHandler *m_parent; + QList m_type; + QString m_declName; + QString m_defName; + QString m_attrib; + QString m_array; + QList m_defVal; + LinkedTextHandler *m_linkedTextHandler; +}; + +#endif diff --git a/addon/doxmlparser/src/sectionhandler.cpp b/addon/doxmlparser/src/sectionhandler.cpp new file mode 100644 index 0000000..d1c7b1f --- /dev/null +++ b/addon/doxmlparser/src/sectionhandler.cpp @@ -0,0 +1,61 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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" + +SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent) +{ + m_members.setAutoDelete(TRUE); + addEndHandler("sectiondef",this,&SectionHandler::endSection); + addStartHandler("memberdef",this,&SectionHandler::startMember); +} + +SectionHandler::~SectionHandler() +{ +} + +void SectionHandler::startSection(const QXmlAttributes& attrib) +{ + m_parent->setDelegate(this); + m_kind = attrib.value("kind"); + printf("section kind=`%s'\n",m_kind.data()); +} + +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::initialize(MainHandler *m) +{ + QListIterator mli(m_members); + MemberHandler *mh; + for (;(mh=(MemberHandler *)mli.current());++mli) + { + m->insertMemberById(mh->id(),mh); + m->insertMemberByName(mh->name(),mh); + } +} + + diff --git a/addon/doxmlparser/src/sectionhandler.h b/addon/doxmlparser/src/sectionhandler.h new file mode 100644 index 0000000..234cce1 --- /dev/null +++ b/addon/doxmlparser/src/sectionhandler.h @@ -0,0 +1,62 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include +#include +#include + +#include "basehandler.h" +#include "memberhandler.h" + +class MainHandler; + + +class SectionIterator : + public BaseIterator +{ + public: + SectionIterator(const QList &list) : + BaseIterator(list) {} +}; + + +class SectionHandler : public ISection, public BaseHandler +{ + public: + virtual void startMember(const QXmlAttributes& attrib); + virtual void startSection(const QXmlAttributes& attrib); + virtual void endSection(); + + SectionHandler(IBaseHandler *parent); + virtual ~SectionHandler(); + + // ISection + virtual QString kind() const { return m_kind; } + virtual IMemberIterator *members() const + { return new MemberIterator(m_members); } + + void initialize(MainHandler *m); + + private: + IBaseHandler *m_parent; + QString m_kind; + QList m_members; +}; + +#endif diff --git a/addon/doxmlparser/test/Makefile.in b/addon/doxmlparser/test/Makefile.in new file mode 100644 index 0000000..1dfbd17 --- /dev/null +++ b/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/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp new file mode 100644 index 0000000..9af575a --- /dev/null +++ b/addon/doxmlparser/test/main.cpp @@ -0,0 +1,225 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2001 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 +#include + +QString linkedTextToString(ILinkedTextIterator *ti) +{ + QString result; + ILinkedText *lt=0; + for (ti->toFirst();(lt=ti->current());ti->toNext()) + { + switch (lt->kind()) + { + case ILinkedText::Kind_Text: + result+=dynamic_cast(lt)->text(); break; + case ILinkedText::Kind_Ref: + result+=dynamic_cast(lt)->text(); break; + } + } + return result; +} + +void DumpDoc(IDoc *doc) +{ + printf(" doc node kind=`%d'\n",doc->kind()); + switch (doc->kind()) + { + case IDoc::Para: + { + printf(" --- par --- \n"); + IDocPara *par = dynamic_cast(doc); + ASSERT(par!=0); + IDocIterator *di = par->contents(); + IDoc *pdoc; + for (di->toFirst();(pdoc=di->current());di->toNext()) + { + DumpDoc(pdoc); + } + di->release(); + printf(" --- end par --- \n"); + } + break; + case IDoc::Text: + { + IDocText *txt = dynamic_cast(doc); + ASSERT(txt!=0); + printf(" --- text `%s' markup=%d --- \n",txt->text().data(),txt->markup()); + } + break; + case IDoc::Title: + { + printf(" --- title --- \n"); + IDocTitle *t = dynamic_cast(doc); + ASSERT(t!=0); + IDocIterator *di = t->title(); + IDoc *pdoc; + for (di->toFirst();(pdoc=di->current());di->toNext()) + { + DumpDoc(pdoc); + } + printf(" --- end title --- \n"); + } + break; + case IDoc::Section: + { + IDocSection *sec = dynamic_cast(doc); + ASSERT(sec!=0); + printf(" --- section id=`%s' level=%d --- \n", + sec->id().data(),sec->level()); + IDocIterator *di = sec->title(); + IDoc *pdoc; + for (di->toFirst();(pdoc=di->current());di->toNext()) + { + DumpDoc(pdoc); + } + printf(" --- end section --- \n"); + } + break; + case IDoc::Root: + { + printf(" --- root --- \n"); + IDocRoot *root = dynamic_cast(doc); + ASSERT(root!=0); + IDocIterator *di = root->contents(); + IDoc *pdoc; + for (di->toFirst();(pdoc=di->current());di->toNext()) + { + DumpDoc(pdoc); + } + di->release(); + printf(" --- end root --- \n"); + } + break; + + default: + break; + } +} + +int main(int argc,char **argv) +{ + if (argc!=2) + { + printf("Usage: %s file.xml\n",argv[0]); + exit(1); + } + + IDoxygen *dox = createObjectModelFromXML(argv[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().data(),comp->id().data(),comp->kind().data()); + ISectionIterator *sli = comp->sections(); + ISection *sec; + for (sli->toFirst();(sec=sli->current());sli->toNext()) + { + printf(" Section kind=%s\n",sec->kind().data()); + IMemberIterator *mli = sec->members(); + IMember *mem; + for (mli->toFirst();(mem=mli->current());mli->toNext()) + { + ILinkedTextIterator *lti = mem->type(); + printf(" Member type=%s name=%s\n", + linkedTextToString(lti).data(),mem->name().data()); + lti->release(); + + IParamIterator *pli = mem->params(); + IParam *par; + for (pli->toFirst();(par=pli->current());pli->toNext()) + { + lti = par->type(); + QString parType = linkedTextToString(lti); + lti->release(); + lti = par->defaultValue(); + QString defVal = linkedTextToString(lti); + lti->release(); + printf(" Param type=%s name=%s defvalue=%s\n", + parType.data(), par->definitionName().data(),defVal.data()); + } + 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->memberName().data(),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->memberName().data(),memr->bodyStart()); + } + mri->release(); + + IEnumValueIterator *evi = mem->enumValues(); + IEnumValue *ev; + for (evi->toFirst();(ev=evi->current());evi->toNext()) + { + printf(" Enum value `%s' init=`%s'\n", + ev->name().data(),ev->initializer().data()); + } + evi->release(); + + IDoc *doc = mem->briefDescription(); + if (doc) + { + printf("===== brief description ==== \n"); + DumpDoc(doc); + } + + doc = mem->detailedDescription(); + if (doc) + { + printf("===== detailed description ==== \n"); + DumpDoc(doc); + } + } + mli->release(); + } + sli->release(); + + IDoc *doc = comp->briefDescription(); + if (doc) + { + printf("===== brief description ==== \n"); + DumpDoc(doc); + } + + doc = comp->detailedDescription(); + if (doc) + { + printf("===== detailed description ==== \n"); + DumpDoc(doc); + } + } + cli->release(); + printf("---------------------------\n"); + + dox->release(); + + return 0; +} + diff --git a/addon/doxmlparser/test/xmlparse.pro.in b/addon/doxmlparser/test/xmlparse.pro.in new file mode 100644 index 0000000..1dc095b --- /dev/null +++ b/addon/doxmlparser/test/xmlparse.pro.in @@ -0,0 +1,19 @@ +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 +unix:TARGETDEPS = ../lib/libdoxmlparser.a +win32:TARGETDEPS = ..\lib\doxmlparser.lib + diff --git a/addon/xmlparse/Doxyfile b/addon/xmlparse/Doxyfile deleted file mode 100644 index c711577..0000000 --- a/addon/xmlparse/Doxyfile +++ /dev/null @@ -1,161 +0,0 @@ -# Doxyfile 1.2.8-20010715 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = xmlparse -PROJECT_NUMBER = -OUTPUT_DIRECTORY = doc -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = NO -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = YES -INLINE_SOURCES = 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 -ENABLED_SECTIONS = -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -ALIASES = -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 = . -FILE_PATTERNS = *.h *.cpp -RECURSIVE = NO -EXCLUDE = -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# 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 = NO -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 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 = -#--------------------------------------------------------------------------- -# 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 -#--------------------------------------------------------------------------- -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_PATH = -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/addon/xmlparse/Makefile.in b/addon/xmlparse/Makefile.in deleted file mode 100644 index 5fe8421..0000000 --- a/addon/xmlparse/Makefile.in +++ /dev/null @@ -1,16 +0,0 @@ -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: - $(INSTTOOL) -d $(INSTALL)/bin - $(INSTTOOL) -m 755 ../../bin/xmlparse $(INSTALL)/bin - diff --git a/addon/xmlparse/basehandler.h b/addon/xmlparse/basehandler.h deleted file mode 100644 index 33b8831..0000000 --- a/addon/xmlparse/basehandler.h +++ /dev/null @@ -1,279 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -class IBaseHandler -{ - public: - virtual void setDelegate(QXmlDefaultHandler *delegate) = 0; - virtual QXmlDefaultHandler *delegate() const = 0; -}; - -class IFallBackHandler -{ - public: - virtual bool handleStartElement(const QString & name, - const QXmlAttributes & attrib) = 0; - virtual bool handleEndElement(const QString &name) = 0; -}; - -template 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; - }; - - typedef StartElementHandler StartElementHandlerT; - typedef EndElementHandler EndElementHandlerT; - - public: - 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 m_startHandlers; - QDict m_endHandlers; -}; - -template class BaseHandler : public IBaseHandler, - public QXmlDefaultHandler, - public ElementMapper -{ - public: - 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++; - printf("skipping start tag %s count=%d\n",name.data(),m_skipCount); - return TRUE; - } - - StartElementHandlerT *handler = m_startHandlers[name]; - if (handler) - { - (*handler)(attrib); - //printf("found start tag %s\n",name.data()); - } - else if (!m_fallBackHandler || - !m_fallBackHandler->handleStartElement(name,attrib) - ) - { - printf("found unexpected tag `%s', skipping until matching end tag\n",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--; - printf("skipping end tag %s count=%d\n",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 = 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); - } - - printf("Skipped unhandled entity %s\n",s.data()); - return TRUE; - } - - 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; - } - - protected: - QString m_curString; - QString m_skipUntil; - int m_skipCount; - QXmlDefaultHandler *m_delegateHandler; - IFallBackHandler *m_fallBackHandler; -}; - -template class BaseFallBackHandler : public ElementMapper, - public IFallBackHandler -{ - public: - BaseFallBackHandler() - { - } - virtual ~BaseFallBackHandler() - { - } - bool handleStartElement(const QString & name, - const QXmlAttributes & attrib) - { - StartElementHandlerT *handler = m_startHandlers[name]; - if (handler) - { - (*handler)(attrib); - return TRUE; - } - return FALSE; - } - bool handleEndElement(const QString &name) - { - EndElementHandlerT *handler = m_endHandlers[name]; - if (handler) - { - (*handler)(); - return TRUE; - } - return FALSE; - } -}; - - -#endif diff --git a/addon/xmlparse/compoundhandler.cpp b/addon/xmlparse/compoundhandler.cpp deleted file mode 100644 index 0b420bf..0000000 --- a/addon/xmlparse/compoundhandler.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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" - -CompoundHandler::CompoundHandler(IBaseHandler *parent) - : m_parent(parent), m_brief(0), m_detailed(0), m_programListing(0) -{ - m_superClasses.setAutoDelete(TRUE); - m_subClasses.setAutoDelete(TRUE); - m_sections.setAutoDelete(TRUE); - - addEndHandler("compounddef",this,&CompoundHandler::endCompound); - - addStartHandler("compoundname"); - addEndHandler("compoundname",this,&CompoundHandler::endCompoundName); - - addStartHandler("derivedcompoundref",this,&CompoundHandler::addSubClass); - addEndHandler("derivedcompoundref"); - - addStartHandler("basecompoundref",this,&CompoundHandler::addSuperClass); - addEndHandler("basecompoundref"); - - addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc); - - addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc); - - addStartHandler("sectiondef",this,&CompoundHandler::startSection); - - addStartHandler("location",this,&CompoundHandler::startLocation); - addEndHandler("location"); - - addStartHandler("programlisting",this,&CompoundHandler::startProgramListing); -} - -CompoundHandler::~CompoundHandler() -{ - delete m_brief; - delete m_detailed; - delete m_programListing; -} - -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::startCompound(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - m_id = attrib.value("id"); - m_kind = attrib.value("kind"); - printf("startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kind.data()); -} - -void CompoundHandler::startLocation(const QXmlAttributes& attrib) -{ - m_defFile = attrib.value("file"); - m_defLine = attrib.value("line").toInt(); -} - -void CompoundHandler::endCompound() -{ - printf("endCompound()\n"); - m_parent->setDelegate(0); -} - -void CompoundHandler::endCompoundName() -{ - m_name = m_curString.stripWhiteSpace(); - printf("Compound name `%s'\n",m_name.data()); -} - -void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) -{ - SuperClass *sc=new SuperClass( - attrib.value("idref"), - attrib.value("prot"), - attrib.value("virt") - ); - printf("super class id=`%s' prot=`%s' virt=`%s'\n", - sc->m_id.data(), - sc->m_protection.data(), - sc->m_virtualness.data()); - m_superClasses.append(sc); -} - -void CompoundHandler::addSubClass(const QXmlAttributes& attrib) -{ - SubClass *sc = new SubClass( - attrib.value("idref"), - attrib.value("prot"), - attrib.value("virt") - ); - printf("sub class id=`%s' prot=`%s' virt=`%s'\n", - sc->m_id.data(), - sc->m_protection.data(), - sc->m_virtualness.data()); - m_subClasses.append(sc); -} - -void CompoundHandler::initialize(MainHandler *m) -{ - QListIterator msi(m_sections); - SectionHandler *sec; - for (;(sec=(SectionHandler *)msi.current());++msi) - { - sec->initialize(m); - } -} - diff --git a/addon/xmlparse/compoundhandler.h b/addon/xmlparse/compoundhandler.h deleted file mode 100644 index 51508aa..0000000 --- a/addon/xmlparse/compoundhandler.h +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -#include "basehandler.h" -#include "sectionhandler.h" -#include "doxmlintf.h" - -class MainHandler; -class DocHandler; -class ProgramListingHandler; - -class CompoundHandler : public ICompound, public BaseHandler -{ - public: - virtual void startSection(const QXmlAttributes& attrib); - virtual void startCompound(const QXmlAttributes& attrib); - virtual void addSuperClass(const QXmlAttributes& attrib); - virtual void addSubClass(const QXmlAttributes& attrib); - 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); - - CompoundHandler(IBaseHandler *parent); - virtual ~CompoundHandler(); - - // ICompound - QString name() const { return m_name; } - QString id() const { return m_id; } - QString kind() const { return m_kind; } - QListIterator getSectionIterator() const { return m_sections; } - void initialize(MainHandler *m); - - private: - struct SuperClass - { - SuperClass(const QString &id,const QString &prot,const QString &virt) : - m_id(id),m_protection(prot),m_virtualness(virt) {} - - QString m_id; - QString m_protection; - QString m_virtualness; - }; - struct SubClass - { - SubClass(const QString &id,const QString &prot,const QString &virt) : - m_id(id),m_protection(prot),m_virtualness(virt) {} - - QString m_id; - QString m_protection; - QString m_virtualness; - }; - QList m_superClasses; - QList m_subClasses; - QList m_sections; - IBaseHandler *m_parent; - DocHandler *m_brief; - DocHandler *m_detailed; - ProgramListingHandler *m_programListing; - QString m_id; - QString m_kind; - QString m_name; - QString m_defFile; - int m_defLine; -}; - -#endif diff --git a/addon/xmlparse/dochandler.cpp b/addon/xmlparse/dochandler.cpp deleted file mode 100644 index 80df132..0000000 --- a/addon/xmlparse/dochandler.cpp +++ /dev/null @@ -1,1373 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 "dochandler.h" -#include - -class TypeNameMapper -{ - public: - TypeNameMapper() - { - m_typeNameMap.insert("see", SimpleSectHandler::See); - m_typeNameMap.insert("return", SimpleSectHandler::Return); - m_typeNameMap.insert("author", SimpleSectHandler::Author); - m_typeNameMap.insert("version", SimpleSectHandler::Version); - m_typeNameMap.insert("since", SimpleSectHandler::Since); - m_typeNameMap.insert("date", SimpleSectHandler::Date); - m_typeNameMap.insert("bug", SimpleSectHandler::Bug); - m_typeNameMap.insert("note", SimpleSectHandler::Note); - m_typeNameMap.insert("warning", SimpleSectHandler::Warning); - m_typeNameMap.insert("par", SimpleSectHandler::Par); - m_typeNameMap.insert("deprecated",SimpleSectHandler::Deprecated); - m_typeNameMap.insert("pre", SimpleSectHandler::Pre); - m_typeNameMap.insert("post", SimpleSectHandler::Post); - m_typeNameMap.insert("invariant", SimpleSectHandler::Invar); - m_typeNameMap.insert("remark", SimpleSectHandler::Remark); - m_typeNameMap.insert("attention", SimpleSectHandler::Attention); - m_typeNameMap.insert("todo", SimpleSectHandler::Todo); - m_typeNameMap.insert("test", SimpleSectHandler::Test); - m_typeNameMap.insert("rcs", SimpleSectHandler::RCS); - m_typeNameMap.insert("enumvalues",SimpleSectHandler::EnumValues); - m_typeNameMap.insert("examples", SimpleSectHandler::Examples); - } - SimpleSectHandler::Types stringToType(const QString &typeStr) - { - return m_typeNameMap[typeStr]; - } - private: - QMap m_typeNameMap; -}; - -static TypeNameMapper g_typeMapper; - - -//---------------------------------------------------------------------- -// MarkupHandler -//---------------------------------------------------------------------- - -MarkupHandler::MarkupHandler(QList &children,QString &curString) - : m_children(children), m_curString(curString), m_curMarkup(DocNode::Normal) -{ - 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); -} - -MarkupHandler::~MarkupHandler() -{ -} - -void MarkupHandler::addTextNode() -{ - if (!m_curString.isEmpty()) - { - m_children.append(new TextNode(m_curString,m_curMarkup)); - printf("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(DocNode::Bold,TRUE)); - m_curMarkup |= DocNode::Bold; -} - -void MarkupHandler::endBold() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Bold,FALSE)); - m_curMarkup &= ~DocNode::Bold; -} - -void MarkupHandler::startEmphasis(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Emphasis,TRUE)); - m_curMarkup |= DocNode::Emphasis; -} - -void MarkupHandler::endEmphasis() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Emphasis,FALSE)); - m_curMarkup &= ~DocNode::Emphasis; -} - -void MarkupHandler::startComputerOutput(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::ComputerOutput,TRUE)); - m_curMarkup |= DocNode::ComputerOutput; -} - -void MarkupHandler::endComputerOutput() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::ComputerOutput,FALSE)); - m_curMarkup &= ~DocNode::ComputerOutput; -} - -void MarkupHandler::startCenter(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Center,TRUE)); - m_curMarkup |= DocNode::Center; -} - -void MarkupHandler::endCenter() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Center,FALSE)); - m_curMarkup &= ~DocNode::Center; -} - -void MarkupHandler::startSmallFont(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::SmallFont,TRUE)); - m_curMarkup |= DocNode::SmallFont; -} - -void MarkupHandler::endSmallFont() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::SmallFont,FALSE)); - m_curMarkup &= ~DocNode::SmallFont; -} - -void MarkupHandler::startSubscript(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Subscript,TRUE)); - m_curMarkup |= DocNode::Subscript; -} - -void MarkupHandler::endSubscript() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Subscript,FALSE)); - m_curMarkup &= ~DocNode::Subscript; -} - -void MarkupHandler::startSuperscript(const QXmlAttributes & /*attrib*/) -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Superscript,TRUE)); - m_curMarkup |= DocNode::Superscript; -} - -void MarkupHandler::endSuperscript() -{ - addTextNode(); - m_children.append(new MarkupModifierNode(DocNode::Superscript,FALSE)); - m_curMarkup &= ~DocNode::Superscript; -} - -//---------------------------------------------------------------------- -// ListItemHandler -//---------------------------------------------------------------------- - -ListItemHandler::ListItemHandler(IBaseHandler *parent) - : DocNode(ListItem), 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); - printf("start list item handler\n"); -} - -void ListItemHandler::endListItem() -{ - printf("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); -} - -//---------------------------------------------------------------------- -// ListHandler -//---------------------------------------------------------------------- - -ListHandler::ListHandler(NodeKind k,IBaseHandler *parent) - : DocNode(k), m_parent(parent) -{ - m_children.setAutoDelete(TRUE); - const char *endListName=0; - switch(k) - { - case ItemizedList : endListName="itemizedlist"; break; - case OrderedList : endListName="orderedlist"; break; - default: ASSERT(0); - } - addEndHandler(endListName,this,&ListHandler::endList); - - addStartHandler("listitem",this,&ListHandler::startListItem); -} - -ListHandler::~ListHandler() -{ -} - -void ListHandler::startList(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); -} - -void ListHandler::endList() -{ - m_parent->setDelegate(0); -} - -void ListHandler::startListItem(const QXmlAttributes& attrib) -{ - ListItemHandler *liHandler = new ListItemHandler(this); - liHandler->startListItem(attrib); - m_children.append(liHandler); -} - -//---------------------------------------------------------------------- -// ParameterHandler -//---------------------------------------------------------------------- - -ParameterHandler::ParameterHandler(IBaseHandler *parent) : DocNode(Parameter), - m_parent(parent), m_description(0) -{ - addEndHandler("parametername",this,&ParameterHandler::endParameterName); - addEndHandler("parameterdescription",this,&ParameterHandler::endParameterDescription); - addStartHandler("para",this,&ParameterHandler::startParagraph); -} - -ParameterHandler::~ParameterHandler() -{ - delete m_description; -} - -void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); -} - -void ParameterHandler::endParameterName() -{ - m_name = m_curString; - printf("parameter %s\n",m_name.data()); - m_curString=""; - m_parent->setDelegate(0); -} - -void ParameterHandler::startParameterDescription(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); -} - -void ParameterHandler::endParameterDescription() -{ - m_parent->setDelegate(0); -} - -void ParameterHandler::startParagraph(const QXmlAttributes& attrib) -{ - ASSERT(m_description==0); - m_description = new ParagraphHandler(this); - m_description->startParagraph(attrib); -} - -//---------------------------------------------------------------------- -// ParameterListHandler -//---------------------------------------------------------------------- - -ParameterListHandler::ParameterListHandler(IBaseHandler *parent) - : DocNode(ParameterList), m_parent(parent) -{ - addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList); - addStartHandler("parametername",this,&ParameterListHandler::startParameterName); - addStartHandler("parameterdescription",this,&ParameterListHandler::startParameterDescription); - addStartHandler("title"); - addEndHandler("title"); - m_parameters.setAutoDelete(TRUE); - m_curParam=0; -} - -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 - { - printf("Error: invalid parameterlist type: %s\n",kind.data()); - } - printf("parameterlist kind=%s\n",kind.data()); - m_parent->setDelegate(this); -} - -void ParameterListHandler::endParameterList() -{ - m_parent->setDelegate(0); -} - -void ParameterListHandler::startParameterName(const QXmlAttributes& attrib) -{ - m_curParam = new ParameterHandler(this); - m_parameters.append(m_curParam); - m_curParam->startParameterName(attrib); -} - -void ParameterListHandler::startParameterDescription(const QXmlAttributes& attrib) -{ - ASSERT(m_curParam!=0); - m_curParam->startParameterDescription(attrib); -} - -//---------------------------------------------------------------------- -// LinkHandler -//---------------------------------------------------------------------- - -LinkHandler::LinkHandler(IBaseHandler *parent) - : DocNode(Link), m_parent(parent) -{ - addEndHandler("link",this,&LinkHandler::endLink); -} - -LinkHandler::~LinkHandler() -{ -} - -void LinkHandler::startLink(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - printf("Start link\n"); - m_ref = attrib.value("linkend"); - m_curString=""; -} - -void LinkHandler::endLink() -{ - m_text = m_curString; - m_curString=""; - m_parent->setDelegate(0); - printf("End link\n"); -} - -//---------------------------------------------------------------------- -// EMailHandler -//---------------------------------------------------------------------- - -EMailHandler::EMailHandler(IBaseHandler *parent) - : DocNode(EMail), m_parent(parent) -{ - addEndHandler("email",this,&EMailHandler::endEMail); -} - -EMailHandler::~EMailHandler() -{ -} - -void EMailHandler::startEMail(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("Start email\n"); - m_curString=""; -} - -void EMailHandler::endEMail() -{ - m_address = m_curString; - m_curString=""; - m_parent->setDelegate(0); - printf("End email\n"); -} - -//---------------------------------------------------------------------- -// ULinkHandler -//---------------------------------------------------------------------- - -ULinkHandler::ULinkHandler(IBaseHandler *parent) - : DocNode(ULink), m_parent(parent) -{ - addEndHandler("ulink",this,&ULinkHandler::endULink); -} - -ULinkHandler::~ULinkHandler() -{ -} - -void ULinkHandler::startULink(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - printf("Start ulink\n"); - m_url = attrib.value("url"); - m_curString=""; -} - -void ULinkHandler::endULink() -{ - m_text = m_curString; - m_curString=""; - m_parent->setDelegate(0); - printf("End ulink\n"); -} - -//---------------------------------------------------------------------- -// LineBreakHandler -//---------------------------------------------------------------------- - -LineBreakHandler::LineBreakHandler(IBaseHandler *parent) - : DocNode(LineBreak), m_parent(parent) -{ - addEndHandler("linebreak",this,&LineBreakHandler::endLineBreak); -} - -LineBreakHandler::~LineBreakHandler() -{ -} - -void LineBreakHandler::startLineBreak(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("Start linebreak\n"); -} - -void LineBreakHandler::endLineBreak() -{ - m_parent->setDelegate(0); - printf("End linebreak\n"); -} - -//---------------------------------------------------------------------- -// HRulerHandler -//---------------------------------------------------------------------- - -HRulerHandler::HRulerHandler(IBaseHandler *parent) - : DocNode(HRuler), m_parent(parent) -{ - addEndHandler("hruler",this,&HRulerHandler::endHRuler); -} - -HRulerHandler::~HRulerHandler() -{ -} - -void HRulerHandler::startHRuler(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("Start hruler\n"); -} - -void HRulerHandler::endHRuler() -{ - m_parent->setDelegate(0); - printf("End hruler\n"); -} - -//---------------------------------------------------------------------- -// RefHandler -//---------------------------------------------------------------------- - -RefHandler::RefHandler(IBaseHandler *parent) - : DocNode(Ref), m_parent(parent) -{ - addEndHandler("ref",this,&RefHandler::endRef); -} - -RefHandler::~RefHandler() -{ -} - -void RefHandler::startRef(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - m_refId = attrib.value("idref"); - m_anchor = attrib.value("anchor"); - printf("Start ref refId=%s anchor=%s\n",m_refId.data(),m_anchor.data()); - m_curString=""; -} - -void RefHandler::endRef() -{ - m_linkText = m_curString; - m_parent->setDelegate(0); - printf("End ref: text=`%s'\n",m_linkText.data()); -} - - -//---------------------------------------------------------------------- -// TitleHandler -//---------------------------------------------------------------------- - -TitleHandler::TitleHandler(IBaseHandler *parent) - : DocNode(Title), 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); - printf("Start title\n"); - m_curString=""; -} - -void TitleHandler::endTitle() -{ - addTextNode(); - m_parent->setDelegate(0); - printf("End title\n"); -} - -void TitleHandler::addTextNode() -{ - if (!m_curString.isEmpty()) - { - m_children.append(new TextNode(m_curString,m_markupHandler->markup())); - printf("addTextNode() text=\"%s\" markup=%x\n", - m_curString.data(),m_markupHandler->markup()); - m_curString=""; - } -} - -void TitleHandler::startRef(const QXmlAttributes& attrib) -{ - RefHandler *ref = new RefHandler(this); - ref->startRef(attrib); - m_children.append(ref); -} - -//---------------------------------------------------------------------- -// SimpleSectHandler -//---------------------------------------------------------------------- - -SimpleSectHandler::SimpleSectHandler(IBaseHandler *parent) - : DocNode(Para), 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_type = g_typeMapper.stringToType(attrib.value("kind")); - printf("start simple section %s\n",attrib.value("kind").data()); - m_parent->setDelegate(this); -} - -void SimpleSectHandler::endSimpleSect() -{ - printf("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) - : DocNode(VariableListEntry), m_parent(parent), m_description(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); - printf("start varlistentry\n"); -} - -void VariableListEntryHandler::endVarListEntry() -{ - m_parent->setDelegate(0); - printf("end varlistentry\n"); -} - -void VariableListEntryHandler::startListItem(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("start listitem\n"); -} - -void VariableListEntryHandler::endListItem() -{ - m_parent->setDelegate(0); - printf("end listitem\n"); -} - -void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/) -{ - m_curString=""; -} - -void VariableListEntryHandler::endTerm() -{ - m_term = m_curString; - printf("term=%s\n",m_term.data()); -} - -void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib) -{ - ASSERT(m_description==0); - m_description = new ParagraphHandler(this); - m_description->startParagraph(attrib); -} - - - -//---------------------------------------------------------------------- -// VariableListHandler -//---------------------------------------------------------------------- - -VariableListHandler::VariableListHandler(IBaseHandler *parent) - : DocNode(VariableList), 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); - printf("start variablelist\n"); -} - -void VariableListHandler::endVariableList() -{ - printf("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); -} - -//---------------------------------------------------------------------- -// HighlightHandler -//---------------------------------------------------------------------- - -HighlightHandler::HighlightHandler(IBaseHandler *parent) - : DocNode(Highlight), m_parent(parent) -{ - addEndHandler("highlight",this,&HighlightHandler::endHighlight); -} - -HighlightHandler::~HighlightHandler() -{ -} - -void HighlightHandler::startHighlight(const QXmlAttributes& attrib) -{ - m_class = attrib.value("class"); - m_curString=""; - m_parent->setDelegate(this); -} - -void HighlightHandler::endHighlight() -{ - m_text = m_curString; - printf("highlight class=`%s' text=`%s'\n",m_class.data(),m_text.data()); - m_parent->setDelegate(0); -} - -//---------------------------------------------------------------------- -// CodeLineHandler -//---------------------------------------------------------------------- - -CodeLineHandler::CodeLineHandler(IBaseHandler *parent) - : DocNode(CodeLine), 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); - printf("start codeline\n"); -} - -void CodeLineHandler::endCodeLine() -{ - addTextNode(); - printf("end codeline\n"); - m_parent->setDelegate(0); -} - -void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - printf("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,DocNode::Normal)); - printf("addTextNode() text=\"%s\"\n", - m_curString.data()); - m_curString=""; - } -} - -//---------------------------------------------------------------------- -// ProgramListingHandler -//---------------------------------------------------------------------- - -ProgramListingHandler::ProgramListingHandler(IBaseHandler *parent) - : DocNode(ProgramListing), 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); - printf("start programlisting\n"); -} - -void ProgramListingHandler::endProgramListing() -{ - printf("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; -} - -//---------------------------------------------------------------------- -// FormulaHandler -//---------------------------------------------------------------------- - -FormulaHandler::FormulaHandler(IBaseHandler *parent) - : DocNode(Formula), 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; - printf("formula id=`%s' text=`%s'\n",m_id.data(),m_text.data()); - m_parent->setDelegate(0); -} - -//---------------------------------------------------------------------- -// ImageHandler -//---------------------------------------------------------------------- - -ImageHandler::ImageHandler(IBaseHandler *parent) - : DocNode(Image), 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; - printf("image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data()); - m_parent->setDelegate(0); -} - -//---------------------------------------------------------------------- -// DotFileHandler -//---------------------------------------------------------------------- - -DotFileHandler::DotFileHandler(IBaseHandler *parent) - : DocNode(DotFile), m_parent(parent) -{ - addEndHandler("image",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; - printf("image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data()); - m_parent->setDelegate(0); -} - -//---------------------------------------------------------------------- -// IndexEntryHandler -//---------------------------------------------------------------------- - -IndexEntryHandler::IndexEntryHandler(IBaseHandler *parent) - : DocNode(IndexEntry), 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*/) -{ - printf("start index entry\n"); - m_parent->setDelegate(this); -} - -void IndexEntryHandler::endIndexEntry() -{ - printf("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) - : DocNode(Entry), 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); -} - -//---------------------------------------------------------------------- -// RowHandler -//---------------------------------------------------------------------- - -RowHandler::RowHandler(IBaseHandler *parent) - : DocNode(Row), 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); -} - -//---------------------------------------------------------------------- -// TableHandler -//---------------------------------------------------------------------- - -TableHandler::TableHandler(IBaseHandler *parent) - : DocNode(Table), m_parent(parent) -{ - m_children.setAutoDelete(TRUE); - addEndHandler("table",this,&TableHandler::endTable); - addStartHandler("row",this,&TableHandler::startRow); -} - -TableHandler::~TableHandler() -{ -} - -void TableHandler::startTable(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - m_numColumns = attrib.value("cols").toInt(); - printf("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); -} - -//---------------------------------------------------------------------- -// ParagraphHandler -//---------------------------------------------------------------------- - -ParagraphHandler::ParagraphHandler(IBaseHandler *parent) - : DocNode(Para), m_parent(parent) -{ - m_children.setAutoDelete(TRUE); - - m_markupHandler = new MarkupHandler(m_children,m_curString); - setFallBackHandler(m_markupHandler); - - addEndHandler("para",this,&ParagraphHandler::endParagraph); - - addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList); - addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList); - addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList); - addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect); - addStartHandler("ref",this,&ParagraphHandler::startRef); - addStartHandler("variablelist",this,&ParagraphHandler::startVariableList); - addStartHandler("hruler",this,&ParagraphHandler::startHRuler); - addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak); - addStartHandler("ulink",this,&ParagraphHandler::startULink); - addStartHandler("email",this,&ParagraphHandler::startEMail); - addStartHandler("link",this,&ParagraphHandler::startLink); - addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing); - addStartHandler("formula",this,&ParagraphHandler::startFormula); - addStartHandler("image",this,&ParagraphHandler::startImage); - addStartHandler("dotfile",this,&ParagraphHandler::startDotFile); - addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry); - addStartHandler("table",this,&ParagraphHandler::startTable); -} - -ParagraphHandler::~ParagraphHandler() -{ - delete m_markupHandler; -} - -void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("para\n"); -} - -void ParagraphHandler::endParagraph() -{ - addTextNode(); - printf("end para\n"); - m_parent->setDelegate(0); -} - -void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib) -{ - addTextNode(); - ListHandler *listHandler = new ListHandler(ItemizedList,this); - listHandler->startList(attrib); - m_children.append(listHandler); -} - -void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib) -{ - addTextNode(); - ListHandler *listHandler = new ListHandler(OrderedList,this); - listHandler->startList(attrib); - m_children.append(listHandler); -} - -void ParagraphHandler::startParameterList(const QXmlAttributes& attrib) -{ - addTextNode(); - ParameterListHandler *parListHandler = new ParameterListHandler(this); - parListHandler->startParameterList(attrib); - m_children.append(parListHandler); -} - -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::addTextNode() -{ - if (!m_curString.isEmpty()) - { - m_children.append(new TextNode(m_curString,m_markupHandler->markup())); - printf("addTextNode() text=\"%s\" markup=%x\n", - m_curString.data(),m_markupHandler->markup()); - m_curString=""; - } -} - -//---------------------------------------------------------------------- -// DocHandler -//---------------------------------------------------------------------- - -DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent) -{ - m_children.setAutoDelete(TRUE); - - addEndHandler("briefdescription",this,&DocHandler::endDoc); - addEndHandler("detaileddescription",this,&DocHandler::endDoc); - - addStartHandler("para",this,&DocHandler::startParagraph); -} - -DocHandler::~DocHandler() -{ -} - -void DocHandler::startDoc(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("start dochandler\n"); -} - -void DocHandler::endDoc() -{ - printf("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); -} - diff --git a/addon/xmlparse/dochandler.h b/addon/xmlparse/dochandler.h deleted file mode 100644 index 1c599ca..0000000 --- a/addon/xmlparse/dochandler.h +++ /dev/null @@ -1,749 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -#include "basehandler.h" - -class ParagraphHandler; - -//----------------------------------------------------------------------------- - -/*! \brief Node of a structured documentation tree. - * - */ -class DocNode -{ - public: - enum Markup - { - Normal = 0x00, - Bold = 0x01, - Emphasis = 0x02, - ComputerOutput = 0x04, - Subscript = 0x08, - Superscript = 0x10, - SmallFont = 0x20, - Center = 0x40 - }; - enum NodeKind - { - Para, - Text, - MarkupModifier, - ItemizedList, - OrderedList, - ListItem, - ParameterList, - Parameter, - SimpleSect, - Title, - Ref, - VariableList, - VariableListEntry, - HRuler, - LineBreak, - ULink, - EMail, - Link, - ProgramListing, - CodeLine, - Highlight, - Anchor, - Formula, - Image, - DotFile, - IndexEntry, - Table, - Row, - Entry - }; - DocNode(NodeKind k) : m_kind(k) {} - virtual ~DocNode() {} - - private: - NodeKind m_kind; -}; - -//----------------------------------------------------------------------------- - - -/*! \brief Node representing a piece of text. - * - */ -class TextNode : public DocNode -{ - public: - TextNode(const QString &t,int markup) - : DocNode(Text), m_text(t), m_markup(markup) {} - - private: - QString m_text; - int m_markup; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a change in the markup style. - * - */ -class MarkupModifierNode : public DocNode -{ - public: - MarkupModifierNode(int markup,bool enabled) - : DocNode(MarkupModifier), m_markup(markup), m_enabled(enabled) {} - - private: - int m_markup; - bool m_enabled; -}; - - -//----------------------------------------------------------------------------- - -/*! \brief Handles markup commands in the XML input. - * - */ -class MarkupHandler : public BaseFallBackHandler -{ - public: - MarkupHandler(QList &children,QString &curString); - virtual ~MarkupHandler(); - int markup() const { return m_curMarkup; } - - 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(); - - - private: - void addTextNode(); - - QList &m_children; - QString &m_curString; - int m_curMarkup; -}; - - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a list item. - * - */ -class ListItemHandler : public DocNode, public BaseHandler -{ - public: - ListItemHandler(IBaseHandler *parent); - virtual ~ListItemHandler(); - virtual void startListItem(const QXmlAttributes& attrib); - virtual void endListItem(); - virtual void startParagraph(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_children; -}; - - -//----------------------------------------------------------------------------- - -/*! \brief Node representing list of items. - * - */ -class ListHandler : public DocNode, public BaseHandler -{ - public: - ListHandler(NodeKind k,IBaseHandler *parent); - virtual ~ListHandler(); - virtual void startList(const QXmlAttributes& attrib); - virtual void endList(); - virtual void startListItem(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_children; -}; - - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a parameter. - * - */ -class ParameterHandler : public DocNode, - public BaseHandler -{ - public: - ParameterHandler(IBaseHandler *parent); - virtual ~ParameterHandler(); - virtual void startParameterName(const QXmlAttributes& attrib); - virtual void endParameterName(); - virtual void startParameterDescription(const QXmlAttributes& attrib); - virtual void endParameterDescription(); - virtual void startParagraph(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QString m_name; - ParagraphHandler *m_description; -}; - - -//----------------------------------------------------------------------------- - -/* \brief Node representing a parameter list. - * - */ -class ParameterListHandler : public DocNode, - public BaseHandler -{ - public: - enum Types { Param, RetVal, Exception }; - ParameterListHandler(IBaseHandler *parent); - virtual ~ParameterListHandler(); - virtual void startParameterList(const QXmlAttributes& attrib); - virtual void endParameterList(); - virtual void startParameterName(const QXmlAttributes& attrib); - virtual void startParameterDescription(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_parameters; - ParameterHandler *m_curParam; - Types m_type; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing a horizontal ruler - * - */ -class LineBreakHandler : public DocNode, public BaseHandler -{ - public: - LineBreakHandler(IBaseHandler *parent); - virtual ~LineBreakHandler(); - - void startLineBreak(const QXmlAttributes& attrib); - void endLineBreak(); - - private: - IBaseHandler *m_parent; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing a link to section - * - */ -class LinkHandler : public DocNode, public BaseHandler -{ - public: - LinkHandler(IBaseHandler *parent); - virtual ~LinkHandler(); - - void startLink(const QXmlAttributes& attrib); - void endLink(); - - private: - IBaseHandler *m_parent; - QString m_ref; - QString m_text; -}; - - -//----------------------------------------------------------------------------- - -/* \brief Node representing a link to an email address - * - */ -class EMailHandler : public DocNode, public BaseHandler -{ - public: - EMailHandler(IBaseHandler *parent); - virtual ~EMailHandler(); - - void startEMail(const QXmlAttributes& attrib); - void endEMail(); - - private: - IBaseHandler *m_parent; - QString m_address; -}; - - -//----------------------------------------------------------------------------- - -/* \brief Node representing a link to an URL - * - */ -class ULinkHandler : public DocNode, public BaseHandler -{ - public: - ULinkHandler(IBaseHandler *parent); - virtual ~ULinkHandler(); - - void startULink(const QXmlAttributes& attrib); - void endULink(); - - private: - IBaseHandler *m_parent; - QString m_url; - QString m_text; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing a horizontal ruler - * - */ -class HRulerHandler : public DocNode, public BaseHandler -{ - public: - HRulerHandler(IBaseHandler *parent); - virtual ~HRulerHandler(); - - void startHRuler(const QXmlAttributes& attrib); - void endHRuler(); - - private: - IBaseHandler *m_parent; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing a reference to another item - * - */ -class RefHandler : public DocNode, public BaseHandler -{ - public: - RefHandler(IBaseHandler *parent); - virtual ~RefHandler(); - void startRef(const QXmlAttributes& attrib); - void endRef(); - private: - IBaseHandler *m_parent; - QString m_refId; - QString m_anchor; - QString m_linkText; -}; - -//----------------------------------------------------------------------------- - -/* \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 DocNode, public BaseHandler -{ - public: - TitleHandler(IBaseHandler *parent); - virtual ~TitleHandler(); - virtual void startTitle(const QXmlAttributes& attrib); - virtual void endTitle(); - virtual void startRef(const QXmlAttributes& attrib); - void addTextNode(); - private: - IBaseHandler *m_parent; - QList m_children; - MarkupHandler *m_markupHandler; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing a simple section with an unnumbered header. - * - */ -// children: title, para -class SimpleSectHandler : public DocNode, - public BaseHandler -{ - 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 - }; - 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); - - private: - IBaseHandler *m_parent; - ParagraphHandler *m_paragraph; - Types m_type; - TitleHandler *m_title; -}; - -//----------------------------------------------------------------------------- - -/* \brief Node representing an named item of a VariableList. - * - */ -class VariableListEntryHandler : public DocNode, public BaseHandler -{ - 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(); - - private: - IBaseHandler *m_parent; - QString m_term; - ParagraphHandler *m_description; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a list of named items. - * - */ -// children: varlistentry, listitem -class VariableListHandler : public DocNode, public BaseHandler -{ - 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(); - - private: - IBaseHandler *m_parent; - QList m_entries; - VariableListEntryHandler *m_curEntry; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a highlighted text fragment. - * - */ -// children: - -class HighlightHandler : public DocNode, public BaseHandler -{ - public: - HighlightHandler(IBaseHandler *parent); - virtual ~HighlightHandler(); - void startHighlight(const QXmlAttributes& attrib); - void endHighlight(); - - private: - IBaseHandler *m_parent; - QString m_class; - QString m_text; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a line of code. - * - */ -// children: linenumber, highlight, anchor, ref -class CodeLineHandler : public DocNode, public BaseHandler -{ - 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(); - - private: - void addTextNode(); - - IBaseHandler *m_parent; - int m_lineNumber; - QString m_refId; - QList m_children; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a program listing - * - */ -// children: codeline, linenumber -class ProgramListingHandler : public DocNode, public BaseHandler -{ - 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(); - private: - IBaseHandler *m_parent; - QList m_children; - bool m_hasLineNumber; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a formula. - * - */ -// children: - -class FormulaHandler : public DocNode, public BaseHandler -{ - public: - FormulaHandler(IBaseHandler *parent); - virtual ~FormulaHandler(); - void startFormula(const QXmlAttributes& attrib); - void endFormula(); - - private: - IBaseHandler *m_parent; - QString m_id; - QString m_text; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing an image. - * - */ -// children: - -class ImageHandler : public DocNode, public BaseHandler -{ - public: - ImageHandler(IBaseHandler *parent); - virtual ~ImageHandler(); - void startImage(const QXmlAttributes& attrib); - void endImage(); - - private: - IBaseHandler *m_parent; - QString m_name; - QString m_caption; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a dot file. - * - */ -// children: - -class DotFileHandler : public DocNode, public BaseHandler -{ - public: - DotFileHandler(IBaseHandler *parent); - virtual ~DotFileHandler(); - void startDotFile(const QXmlAttributes& attrib); - void endDotFile(); - - private: - IBaseHandler *m_parent; - QString m_name; - QString m_caption; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing an entry in the index. - * - */ -// children: - -class IndexEntryHandler : public DocNode, public BaseHandler -{ - 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(); - - private: - IBaseHandler *m_parent; - QString m_primary; - QString m_secondary; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing an entry in the table entry. - * - */ -// children: para -class EntryHandler : public DocNode, public BaseHandler -{ - public: - EntryHandler(IBaseHandler *parent); - virtual ~EntryHandler(); - void startEntry(const QXmlAttributes& attrib); - void endEntry(); - void startParagraph(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_children; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing an entry in the table row. - * - */ -// children: entry -class RowHandler : public DocNode, public BaseHandler -{ - public: - RowHandler(IBaseHandler *parent); - virtual ~RowHandler(); - void startRow(const QXmlAttributes& attrib); - void endRow(); - void startEntry(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_children; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing an entry in the table. - * - */ -// children: row -class TableHandler : public DocNode, public BaseHandler -{ - public: - TableHandler(IBaseHandler *parent); - virtual ~TableHandler(); - void startTable(const QXmlAttributes& attrib); - void endTable(); - void startRow(const QXmlAttributes& attrib); - - private: - IBaseHandler *m_parent; - QList m_children; - int m_numColumns; -}; - -//----------------------------------------------------------------------------- - -/*! \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 DocNode, public BaseHandler -{ - 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); - - ParagraphHandler(IBaseHandler *parent); - virtual ~ParagraphHandler(); - - private: - void addTextNode(); - IBaseHandler *m_parent; - QList m_children; - MarkupHandler *m_markupHandler; -}; - -//----------------------------------------------------------------------------- - -/*! \brief Node representing a documentation block. - * - */ -// children: para -// TODO: title, sect1, sect2, sect3 -class DocHandler : public BaseHandler -{ - public: - virtual void startDoc(const QXmlAttributes& attrib); - virtual void endDoc(); - virtual void startParagraph(const QXmlAttributes& attrib); - - DocHandler(IBaseHandler *parent); - virtual ~DocHandler(); - - private: - IBaseHandler *m_parent; - QList m_children; -}; - -#endif diff --git a/addon/xmlparse/doxmlintf.h b/addon/xmlparse/doxmlintf.h deleted file mode 100644 index 1af6a60..0000000 --- a/addon/xmlparse/doxmlintf.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _DOXMLINTF_H -#define _DOXMLINTF_H - -#include -#include - -class IMember; - -class IParam -{ - public: - virtual QString type() const = 0; - virtual QString declarationName() const = 0; - virtual QString definitionName() const = 0; - virtual QString attrib() const = 0; - virtual QString arraySpecifier() const = 0; - virtual QString defaultValue() const = 0; -}; - -class IMemberReference -{ - public: - virtual IMember *getMember() const = 0; - virtual QString getMemberName() const = 0; - virtual int getLineNumber() const = 0; -}; - -class IMember -{ - public: - virtual QString kind() const = 0; - virtual QString id() const = 0; - virtual QString protection() const = 0; - virtual QString virtualness() const = 0; - virtual QString type() const = 0; - virtual QString name() const = 0; - virtual QListIterator getParamIterator() const = 0; -}; - -class ISection -{ - public: - virtual QString kind() const = 0; - virtual QListIterator getMemberIterator() const = 0; -}; - -class ICompound -{ - public: - virtual QString name() const = 0; - virtual QString id() const = 0; - virtual QString kind() const = 0; - virtual QListIterator getSectionIterator() const = 0; -}; - -/*! Root node of the object model. */ -class IDoxygen -{ - public: - /*! Returns an iterator that can be used to iterate over the list - * of compounds found in the project. - */ - virtual QListIterator getCompoundIterator() 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 *getCompoundById(const QString &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 *getCompoundByName(const QString &name) const = 0; - - virtual IMember *getMemberById(const QString &id) const = 0; - virtual QList *getMemberByName(const QString &name) const = 0; -}; - -/*! Factory method that creates an object model given an XML file generated - * by doxygen. - * @param xmlFileName The name of the XML to parse. - * @returns An iterface to the object model. - */ -IDoxygen *createObjectModelFromXML(const char *xmlFileName); - -#endif diff --git a/addon/xmlparse/main.cpp b/addon/xmlparse/main.cpp deleted file mode 100644 index 081b0d7..0000000 --- a/addon/xmlparse/main.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include "doxmlintf.h" - - -int main(int argc,char **argv) -{ - if (argc!=2) - { - printf("Usage: %s file.xml\n",argv[0]); - exit(1); - } - - IDoxygen *dox = createObjectModelFromXML(argv[1]); - - { - QListIterator cli(dox->getCompoundIterator()); - ICompound *comp; - printf("--- compound list ---------\n"); - for (cli.toFirst();(comp=cli.current());++cli) - { - printf("Compound name=%s id=%s kind=%s\n", - comp->name().data(),comp->id().data(),comp->kind().data()); - QListIterator sli(comp->getSectionIterator()); - ISection *sec; - for (sli.toFirst();(sec=sli.current());++sli) - { - printf(" Section kind=%s\n",sec->kind().data()); - QListIterator mli(sec->getMemberIterator()); - IMember *mem; - for (mli.toFirst();(mem=mli.current());++mli) - { - printf(" Member type=%s name=%s\n",mem->type().data(),mem->name().data()); - QListIterator pli(mem->getParamIterator()); - IParam *par; - for (pli.toFirst();(par=pli.current());++pli) - { - printf(" Param type=%s name=%s defvalue=%s\n", - par->type().data(),par->definitionName().data(),par->defaultValue().data()); - } - } - } - } - printf("---------------------------\n"); - - } - - delete dox; - - return 0; -} - diff --git a/addon/xmlparse/mainhandler.cpp b/addon/xmlparse/mainhandler.cpp deleted file mode 100644 index c32426f..0000000 --- a/addon/xmlparse/mainhandler.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include "mainhandler.h" - -MainHandler::MainHandler() : m_compoundDict(10007), m_compoundNameDict(10007) -{ - m_compounds.setAutoDelete(TRUE); - addStartHandler("doxygen"); - addStartHandler("compounddef",this,&MainHandler::startCompound); - addEndHandler("doxygen"); - addEndHandler("compounddef"); -} - -MainHandler::~MainHandler() -{ - printf("MainHandler::~MainHandler()\n"); -} - -void MainHandler::startCompound(const QXmlAttributes& attrib) -{ - CompoundHandler *compHandler = new CompoundHandler(this); - compHandler->startCompound(attrib); - m_compounds.append(compHandler); -} - -void MainHandler::insertMemberById(const QString &id,IMember *h) -{ - m_memberDict.insert(id,h); -} - -void MainHandler::insertMemberByName(const QString &name,IMember *h) -{ - QList *ml = m_memberNameDict[name]; - if (ml) - { - ml->append(h); - } - else - { - ml = new QList; - ml->append(h); - m_memberNameDict.insert(name,ml); - } -} - -void MainHandler::initialize() -{ - QListIterator mci(m_compounds); - CompoundHandler *compHandler; - for (;(compHandler=(CompoundHandler *)mci.current());++mci) - { - compHandler->initialize(this); - m_compoundNameDict.insert(compHandler->name(),compHandler); - m_compoundDict.insert(compHandler->id(),compHandler); - } - - // for each member - QDictIterator< QList > mndi(m_memberNameDict); - QList *ml; - for (;(ml=mndi.current());++mndi) - { - QListIterator mli(*ml); - IMember *mem; - for (;(mem=mli.current());++mli) - { - ((MemberHandler*)mem)->initialize(this); - } - } - -} - -class ErrorHandler : public QXmlErrorHandler -{ - public: - virtual ~ErrorHandler() {} - bool warning( const QXmlParseException & ) - { - return FALSE; - } - bool error( const QXmlParseException & ) - { - return FALSE; - } - bool fatalError( const QXmlParseException &exception ) - { - fprintf(stderr,"Fatal error at line %d column %d: %s\n", - exception.lineNumber(),exception.columnNumber(), - exception.message().data()); - return FALSE; - } - QString errorString() { return ""; } - - private: - QString errorMsg; -}; - -IDoxygen *createObjectModelFromXML(const char * xmlFileName) -{ - QFile xmlFile(xmlFileName); - MainHandler * handler = new MainHandler; - ErrorHandler errorHandler; - QXmlInputSource source( xmlFile ); - QXmlSimpleReader reader; - reader.setContentHandler( handler ); - reader.setErrorHandler( &errorHandler ); - reader.parse( source ); - handler->initialize(); - return handler; -} - diff --git a/addon/xmlparse/mainhandler.h b/addon/xmlparse/mainhandler.h deleted file mode 100644 index c5f945f..0000000 --- a/addon/xmlparse/mainhandler.h +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include "basehandler.h" -#include "compoundhandler.h" -#include "doxmlintf.h" - -class MainHandler : public IDoxygen, public BaseHandler -{ - public: - virtual void startCompound(const QXmlAttributes& attrib); - MainHandler(); - virtual ~MainHandler(); - - QListIterator getCompoundIterator() const - { - return m_compounds; - } - ICompound *getCompoundById(const QString &id) const - { - return m_compoundDict[id]; - } - virtual ICompound *getCompoundByName(const QString &name) const - { - return name.isEmpty() ? 0 : m_compoundNameDict[name]; - } - virtual IMember *getMemberById(const QString &id) const - { - return m_memberDict[id]; - } - virtual QList *getMemberByName(const QString &name) const - { - return m_memberNameDict[name]; - } - void insertMemberById(const QString &id,IMember *h); - void insertMemberByName(const QString &name,IMember *h); - - void initialize(); - - private: - QList m_compounds; - QDict m_compoundDict; - QDict m_compoundNameDict; - QDict m_memberDict; - QDict > m_memberNameDict; -}; - -#endif diff --git a/addon/xmlparse/memberhandler.cpp b/addon/xmlparse/memberhandler.cpp deleted file mode 100644 index 0fbf5c1..0000000 --- a/addon/xmlparse/memberhandler.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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" - -MemberHandler::MemberHandler(IBaseHandler *parent) - : m_parent(parent), m_brief(0), m_detailed(0) -{ - addEndHandler("memberdef",this,&MemberHandler::endMember); - - addStartHandler("type"); - addEndHandler("type",this,&MemberHandler::endType); - - addStartHandler("name"); - addEndHandler("name",this,&MemberHandler::endName); - - addStartHandler("param",this,&MemberHandler::startParam); - - addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc); - - addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc); - - 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_params.setAutoDelete(TRUE); - m_references.setAutoDelete(TRUE); - m_referencedBy.setAutoDelete(TRUE); - -} - -MemberHandler::~MemberHandler() -{ - delete m_brief; - delete m_detailed; -} - -void MemberHandler::startMember(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - m_kind = attrib.value("kind"); - m_id = attrib.value("id"); - m_protection = attrib.value("prot"); - m_virtualness = attrib.value("virtualness"); - printf("member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n", - m_kind.data(),m_id.data(),m_protection.data(),m_virtualness.data()); -} - -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::startLocation(const QXmlAttributes& attrib) -{ - m_defFile = attrib.value("file"); - m_defLine = attrib.value("line").toInt(); -} - -void MemberHandler::startReferences(const QXmlAttributes& attrib) -{ - MemberReference *mr = new MemberReference; - mr->m_memId = attrib.value("id"); - mr->m_line = attrib.value("line").toInt(); - 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("id"); - mr->m_line = attrib.value("line").toInt(); - m_referencedBy.append(mr); - m_curString=""; -} - -void MemberHandler::endReferencedBy() -{ - m_referencedBy.getLast()->m_name = m_curString; -} - -void MemberHandler::endMember() -{ - m_parent->setDelegate(0); -} - -void MemberHandler::endType() -{ - m_type = m_curString.stripWhiteSpace(); - printf("member type=`%s'\n",m_type.data()); -} - -void MemberHandler::endName() -{ - m_name = m_curString.stripWhiteSpace(); - printf("member name=`%s'\n",m_name.data()); -} - -void MemberHandler::startParam(const QXmlAttributes& attrib) -{ - ParamHandler *paramHandler = new ParamHandler(this); - paramHandler->startParam(attrib); - m_params.append(paramHandler); -} - -void MemberHandler::initialize(MainHandler *mh) -{ - QListIterator mli(m_references); - MemberReference *mr; - for (;(mr=mli.current());++mli) - { - mr->initialize(mh); - } -} - -void MemberHandler::MemberReference::initialize(MainHandler *mh) -{ - m_mainHandler = mh; -} - -IMember *MemberHandler::MemberReference::getMember() const -{ - return m_mainHandler->getMemberById(m_memId); -} diff --git a/addon/xmlparse/memberhandler.h b/addon/xmlparse/memberhandler.h deleted file mode 100644 index ccb4a57..0000000 --- a/addon/xmlparse/memberhandler.h +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -#include "basehandler.h" -#include "paramhandler.h" -#include "doxmlintf.h" - -class DocHandler; -class MainHandler; - -class MemberHandler : public IMember, public BaseHandler -{ - public: - virtual void startMember(const QXmlAttributes& attrib); - virtual void endMember(); - virtual void startParam(const QXmlAttributes& attrib); - virtual void endType(); - virtual void endName(); - virtual void startBriefDesc(const QXmlAttributes& attrib); - virtual void startDetailedDesc(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(); - - MemberHandler(IBaseHandler *parent); - virtual ~MemberHandler(); - - // IMember - virtual QString kind() const { return m_kind; } - virtual QString id() const { return m_id; } - virtual QString protection() const { return m_protection; } - virtual QString virtualness() const { return m_virtualness; } - virtual QString type() const { return m_type; } - virtual QString name() const { return m_name; } - virtual QListIterator getParamIterator() const { return m_params; } - - void initialize(MainHandler *m); - - private: - struct MemberReference : public IMemberReference - { - virtual ~MemberReference() {} - virtual IMember *getMember() const; - virtual QString getMemberName() const { return m_name; } - virtual int getLineNumber() const { return m_line; } - void initialize(MainHandler *m); - - QString m_memId; - QString m_name; - int m_line; - MainHandler *m_mainHandler; - }; - - IBaseHandler *m_parent; - QString m_kind; - QString m_id; - QString m_protection; - QString m_virtualness; - QString m_type; - QString m_name; - DocHandler *m_brief; - DocHandler *m_detailed; - QList m_params; - QList m_references; - QList m_referencedBy; - QString m_defFile; - int m_defLine; -}; - -#endif diff --git a/addon/xmlparse/paramhandler.cpp b/addon/xmlparse/paramhandler.cpp deleted file mode 100644 index a800195..0000000 --- a/addon/xmlparse/paramhandler.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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" - -ParamHandler::ParamHandler(IBaseHandler *parent) : m_parent(parent) -{ - addEndHandler("param",this,&ParamHandler::endParam); - - addStartHandler("type"); - addEndHandler("type",this,&ParamHandler::endType); - - addStartHandler("declname"); - addEndHandler("declname",this,&ParamHandler::endDeclName); - - addStartHandler("defname"); - addEndHandler("defname",this,&ParamHandler::endDefName); - - addStartHandler("array"); - addEndHandler("array",this,&ParamHandler::endArray); - - addStartHandler("attrib"); - addEndHandler("attrib",this,&ParamHandler::endAttrib); - - addStartHandler("defval"); - addEndHandler("defval",this,&ParamHandler::endDefVal); -} - -ParamHandler::~ParamHandler() -{ -} - -void ParamHandler::startParam(const QXmlAttributes& /*attrib*/) -{ - m_parent->setDelegate(this); - printf("param\n"); -} - -void ParamHandler::endParam() -{ - m_parent->setDelegate(0); -} - -void ParamHandler::endType() -{ - m_type = m_curString.stripWhiteSpace(); - printf("param type=`%s'\n",m_type.data()); -} - -void ParamHandler::endDeclName() -{ - m_declName = m_curString.stripWhiteSpace(); - printf("member declName=`%s'\n",m_declName.data()); -} - -void ParamHandler::endDefName() -{ - m_defName = m_curString.stripWhiteSpace(); - printf("member defName=`%s'\n",m_defName.data()); -} - -void ParamHandler::endAttrib() -{ - m_attrib = m_curString.stripWhiteSpace(); - printf("member attrib=`%s'\n",m_attrib.data()); -} - -void ParamHandler::endArray() -{ - m_array = m_curString.stripWhiteSpace(); - printf("member array=`%s'\n",m_array.data()); -} - -void ParamHandler::endDefVal() -{ - m_defVal = m_curString.stripWhiteSpace(); - printf("member defVal=`%s'\n",m_defVal.data()); -} - - - diff --git a/addon/xmlparse/paramhandler.h b/addon/xmlparse/paramhandler.h deleted file mode 100644 index 38e5e03..0000000 --- a/addon/xmlparse/paramhandler.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -#include "basehandler.h" -#include "doxmlintf.h" - -class ParamHandler : public IParam, public BaseHandler -{ - public: - virtual void startParam(const QXmlAttributes& attrib); - virtual void endParam(); - virtual void endType(); - virtual void endDeclName(); - virtual void endDefName(); - virtual void endAttrib(); - virtual void endArray(); - virtual void endDefVal(); - - ParamHandler(IBaseHandler *parent); - virtual ~ParamHandler(); - - // IParam - virtual QString type() const { return m_type; } - virtual QString declarationName() const { return m_declName; } - virtual QString definitionName() const { return m_defName; } - virtual QString attrib() const { return m_attrib; } - virtual QString arraySpecifier() const { return m_array; } - virtual QString defaultValue() const { return m_defVal; } - - private: - IBaseHandler *m_parent; - QString m_type; - QString m_declName; - QString m_defName; - QString m_attrib; - QString m_array; - QString m_defVal; -}; - -#endif diff --git a/addon/xmlparse/sectionhandler.cpp b/addon/xmlparse/sectionhandler.cpp deleted file mode 100644 index 0fc3446..0000000 --- a/addon/xmlparse/sectionhandler.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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" - -SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent) -{ - m_members.setAutoDelete(TRUE); - addEndHandler("sectiondef",this,&SectionHandler::endSection); - addStartHandler("memberdef",this,&SectionHandler::startMember); -} - -SectionHandler::~SectionHandler() -{ -} - -void SectionHandler::startSection(const QXmlAttributes& attrib) -{ - m_parent->setDelegate(this); - m_kind = attrib.value("kind"); - printf("section kind=`%s'\n",m_kind.data()); -} - -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::initialize(MainHandler *m) -{ - QListIterator mli(m_members); - MemberHandler *mh; - for (;(mh=(MemberHandler *)mli.current());++mli) - { - m->insertMemberById(mh->name(),mh); - m->insertMemberByName(mh->name(),mh); - } -} - - diff --git a/addon/xmlparse/sectionhandler.h b/addon/xmlparse/sectionhandler.h deleted file mode 100644 index 46cb422..0000000 --- a/addon/xmlparse/sectionhandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * - * $Id$ - * - * - * Copyright (C) 1997-2001 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 -#include -#include - -#include "basehandler.h" -#include "memberhandler.h" -#include "doxmlintf.h" - -class MainHandler; - -class SectionHandler : public ISection, public BaseHandler -{ - public: - virtual void startMember(const QXmlAttributes& attrib); - virtual void startSection(const QXmlAttributes& attrib); - virtual void endSection(); - - SectionHandler(IBaseHandler *parent); - virtual ~SectionHandler(); - - // ISection - virtual QString kind() const { return m_kind; } - virtual QListIterator getMemberIterator() const { return m_members; } - - void initialize(MainHandler *m); - - private: - IBaseHandler *m_parent; - QString m_kind; - QList m_members; -}; - -#endif diff --git a/addon/xmlparse/xmlparse.pro.in b/addon/xmlparse/xmlparse.pro.in deleted file mode 100644 index 9e3b6aa..0000000 --- a/addon/xmlparse/xmlparse.pro.in +++ /dev/null @@ -1,26 +0,0 @@ -TEMPLATE = app.t -CONFIG = console warn_on $extraopt -HEADERS = basehandler.h mainhandler.h \ - compoundhandler.h sectionhandler.h \ - memberhandler.h paramhandler.h \ - dochandler.h -SOURCES = main.cpp mainhandler.cpp \ - compoundhandler.cpp sectionhandler.cpp \ - memberhandler.cpp paramhandler.cpp \ - dochandler.cpp -DEPENDPATH = ../../src -unix:LIBS += -L../../lib -ldoxycfg -lqtools -win32:INCLUDEPATH += . -win32-mingw:LIBS += -L../../lib -ldoxycfg -lqtools -win32-msvc:LIBS += qtools.lib doxycfg.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 -INCLUDEPATH += ../../qtools ../../src -DESTDIR = -TARGET = xmlparse -unix:TARGETDEPS = ../../lib/libdoxycfg.a -win32:TARGETDEPS = ../../lib/doxycfg.lib -OBJECTS_DIR = obj - diff --git a/configure b/configure index e4453bc..5a5dc88 100755 --- a/configure +++ b/configure @@ -27,7 +27,7 @@ f_prefix=/usr f_insttool=NO f_english=NO f_wizard=NO -f_langs=nl,se,cz,fr,it,de,jp,es,fi,ru,hr,pl,pt,hu,kr,ro,si,cn,no,br,dk,sk,ua +f_langs=nl,se,cz,fr,it,de,jp,es,fi,ru,hr,pl,pt,hu,kr,ro,si,cn,no,br,dk,sk,ua,gr while test -n "$1"; do case $1 in @@ -409,7 +409,7 @@ TMAKE_CXXFLAGS += -DENGLISH_ONLY EOF fi -f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/xmlparse/Makefile.in" +f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in" for i in $f_inmakefiles ; do SRC=$i @@ -441,7 +441,7 @@ EOF echo " Created $DST from $SRC..." done -f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in src/doxysearch.pro.in addon/doxywizard/doxywizard.pro.in addon/xmlparse/xmlparse.pro.in" +f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in src/doxysearch.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in" for i in $f_inprofiles ; do SRC=$i @@ -467,7 +467,7 @@ echo -n " Generating src/lang_cfg.h..." echo $f_langs | $f_perl -e '@l=split(/,/,); chomp @l; @allowed=(NL,SE,CZ,FR,IT,DE,JP,ES,FI,RU,HR,PL,PT,HU,KR,RO,SI,CN,NO,BR, - DK,SK,UA); + DK,SK,UA,GR); foreach my $elem (@l){ $elem =~ tr/a-z/A-Z/; $r=0; diff --git a/doc/Makefile.win_make.in b/doc/Makefile.win_make.in index 3161b31..7951ed8 100644 --- a/doc/Makefile.win_make.in +++ b/doc/Makefile.win_make.in @@ -13,7 +13,7 @@ # input used in their production; they are not affected by this license. all: language FORCE - @xcopy /s /q /i ..\examples ..\html\examples + @xcopy /y /s /q /i ..\examples ..\html\examples set DOXYGEN_DOCDIR=. & \ set VERSION=$(VERSION) & \ $(DOXYGEN)\bin\doxygen diff --git a/doc/Makefile.win_nmake.in b/doc/Makefile.win_nmake.in index 05820b0..bef074a 100644 --- a/doc/Makefile.win_nmake.in +++ b/doc/Makefile.win_nmake.in @@ -13,7 +13,7 @@ # input used in their production; they are not affected by this license. all: language FORCE - @xcopy /s /q /i ..\examples ..\html\examples + @xcopy /y /s /q /i ..\examples ..\html\examples set DOXYGEN_DOCDIR=. set VERSION=$(VERSION) $(DOXYGEN)\bin\doxygen diff --git a/doc/config.doc b/doc/config.doc index b0fc9df..44c51b7 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -98,6 +98,7 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_ext_doc_paths EXT_DOC_PATHS
  • \refitem cfg_extra_packages EXTRA_PACKAGES
  • \refitem cfg_extract_all EXTRACT_ALL +
  • \refitem cfg_extract_local_classes EXTRACT_LOCAL_CLASSES
  • \refitem cfg_extract_private EXTRACT_PRIVATE
  • \refitem cfg_extract_static EXTRACT_STATIC
  • \refitem cfg_file_patterns FILE_PATTERNS @@ -132,6 +133,7 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_include_path INCLUDE_PATH
  • \refitem cfg_inherit_docs INHERIT_DOCS
  • \refitem cfg_inline_info INLINE_INFO +
  • \refitem cfg_inline_inherited_memb INLINE_INHERITED_MEMB
  • \refitem cfg_inline_sources INLINE_SOURCES
  • \refitem cfg_input INPUT
  • \refitem cfg_input_filter INPUT_FILTER @@ -228,8 +230,9 @@ followed by the descriptions of the tags grouped by category. documentation generated by doxygen is written. Doxygen will use this information to generate all constant output in the proper language. The default language is English, other supported languages are: - Dutch, French, Italian, Czech, Swedish, German, Finnish, Hungarian, Japanese, - Korean, Spanish, Russian, Croatian, Polish and Portuguese. + Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, + German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, + Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish. \anchor cfg_extract_all
    \c EXTRACT_ALL
    @@ -255,6 +258,14 @@ followed by the descriptions of the tags grouped by category. If the \c EXTRACT_STATIC tag is set to \c YES all static members of a file will be included in the documentation. +\anchor cfg_extract_local_classes +
    \c EXTRACT_LOCAL_CLASSES
    + \addindex EXTRACT_LOCAL_CLASSES + If the \c EXTRACT_LOCAL_CLASSES tag is set to \c YES classes (and structs) + defined locally in source files will be included in the documentation. + If set to NO only classes defined in header files are included. Does not + have any effect for Java sources. + \anchor cfg_hide_undoc_members
    \c HIDE_UNDOC_MEMBERS
    \addindex HIDE_UNDOC_MEMBERS @@ -299,6 +310,14 @@ followed by the descriptions of the tags grouped by category. doxygen will generate a detailed section even if there is only a brief description. +\anchor cfg_inline_inherited_memb +
    \c INLINE_INHERITED_MEMB
    +\addindex INLINE_INHERITED_MEMB + If the \c INLINE_INHERITED_MEMB tag is set to \c YES, doxygen will show all inherited + members of a class in the documentation of that class as if those members were + ordinary class members. Constructors, destructors and assignment operators of + the base classes will not be shown. + \anchor cfg_full_path_names
    \c FULL_PATH_NAMES
    \addindex FULL_PATH_NAMES diff --git a/doc/faq.doc b/doc/faq.doc index 1ed33dc..cf18fab 100644 --- a/doc/faq.doc +++ b/doc/faq.doc @@ -210,6 +210,17 @@ generator -> gen At the time I was looking into lex and yacc, where a lot of things start with "yy", so the "y" slipped in and made things pronouncable. +
  • What was the reason to develop doxygen? + +I once wrote a GUI widget based on the Qt library (it is still available at +http://qdbttabular.sourceforge.net/ and maintained by Sven Meyer). +Qt had nicely generated documentation (using an internal tool which +they didn't want to release) and I wrote similar docs by hand. +This was a nightmare to maintain, so I wanted a similar tool. I looked at +Doc++ but that just wasn't good enough (it didn't support signals and +slots and did have the Qt look and feel I have grown to like), +so I started to write my own tool... + \htmlonly diff --git a/doc/language.doc b/doc/language.doc index 59e9e0c..bc1a145 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -25,13 +25,13 @@ Doxygen has built-in support for multiple languages. This means that the text fragments that doxygen generates can be produced in languages other than English (the default) at configuration time. -Currently (version 1.2.12-20011125), 24 languages +Currently (version 1.2.13), 25 languages are supported (sorted alphabetically): Brazilian Portuguese, Chinese, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, -Hungarian, Italian, Japanese, Korean, Norwegian, -Polish, Portuguese, Romanian, Russian, Slovak, -Slovene, Spanish, Swedish, and Ukrainian. +Greek, Hungarian, Italian, Japanese, Korean, +Norwegian, Polish, Portuguese, Romanian, Russian, +Slovak, Slovene, Spanish, Swedish, and Ukrainian. The table of information related to the supported languages follows. It is sorted by language alphabetically. The Status column @@ -96,7 +96,7 @@ when the translator was updated. Finnish Olli Korhonen Olli.Korhonen@NOSPAM.ccc.fi - 1.0.0 + obsolete French @@ -111,6 +111,12 @@ when the translator was updated. up-to-date + Greek + Harry Kalogirou + harkal@NOSPAM.rainbow.cs.unipi.gr + 1.2.11 + + Hungarian Földvári György foldvari@NOSPAM.diatronltd.com @@ -118,8 +124,8 @@ when the translator was updated. Italian - Ahmed Aldo Faisal
    Alessandro Falappa - aaf23@NOSPAM.cam.ac.uk
    a.falappa@NOSPAM.flashnet.it + Alessandro Falappa
    Ahmed Aldo Faisal + alessandro@NOSPAM.falappa.net
    aaf23@NOSPAM.cam.ac.uk up-to-date @@ -186,7 +192,7 @@ when the translator was updated. Swedish XeT Erixon xet@NOSPAM.hem.passagen.se - 1.0.0 + obsolete Ukrainian @@ -220,17 +226,19 @@ when the translator was updated. \hline English & Dimitri van Heesch & {\tt dimitri@stack.nl} & up-to-date \\ \hline - Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & 1.0.0 \\ + Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & obsolete \\ \hline French & Xavier Outhier & {\tt xouthier@yahoo.fr} & up-to-date \\ \hline German & Jens Seidel & {\tt jensseidel@users.sf.net} & up-to-date \\ & Jens Breitenstein & {\tt Jens.Breitenstein@tlc.de} & \\ \hline + Greek & Harry Kalogirou & {\tt harkal@rainbow.cs.unipi.gr} & 1.2.11 \\ + \hline Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\ \hline - Italian & Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} & up-to-date \\ - & Alessandro Falappa & {\tt a.falappa@flashnet.it} & \\ + Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & up-to-date \\ + & Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} & \\ \hline Japanese & Kenji Nagamatsu & {\tt naga@joyful.club.ne.jp} & 1.2.5 \\ \hline @@ -252,7 +260,7 @@ when the translator was updated. \hline Spanish & Francisco Oltra Thennet & {\tt foltra@puc.cl} & 1.2.7 \\ \hline - Swedish & XeT Erixon & {\tt xet@hem.passagen.se} & 1.0.0 \\ + Swedish & XeT Erixon & {\tt xet@hem.passagen.se} & obsolete \\ \hline Ukrainian & Olexij Tkatchenko & {\tt olexij.tkatchenko@gmx.de} & 1.2.11 \\ \hline @@ -523,5 +531,22 @@ translator adapter base class. The reason is that the adapter classes implement also obsolete methods. Another reason is that some of the methods could become obsolete from some newer adapter on. +The really obsolete language translators may lead to too much +complicated adapters. Because of that, doxygen developers may decide +to derive such translators from the \c TranslatorEnglish class, which +is by definition always up-to-date. + +When doing so, all the missing methods will be replaced by the +English translation. This means that not-implemented methods will +always return the English result. Such translators are marked using +word \c obsolete. You should read it really obsolete. No +guess about the last update can be done. + +Often, it is possible to construct better result from the obsolete +methods. Because of that, the translator adapter classes should be +used if possible. On the other hand, implementation of adapters for +really obsolete translators brings too much maintenance and +run-time overhead. + */ diff --git a/doc/language.tpl b/doc/language.tpl index 3982278..d000bb6 100644 --- a/doc/language.tpl +++ b/doc/language.tpl @@ -296,5 +296,22 @@ translator adapter base class. The reason is that the adapter classes implement also obsolete methods. Another reason is that some of the methods could become obsolete from some newer adapter on. +The really obsolete language translators may lead to too much +complicated adapters. Because of that, doxygen developers may decide +to derive such translators from the \c TranslatorEnglish class, which +is by definition always up-to-date. + +When doing so, all the missing methods will be replaced by the +English translation. This means that not-implemented methods will +always return the English result. Such translators are marked using +word \c obsolete. You should read it really obsolete. No +guess about the last update can be done. + +Often, it is possible to construct better result from the obsolete +methods. Because of that, the translator adapter classes should be +used if possible. On the other hand, implementation of adapters for +really obsolete translators brings too much maintenance and +run-time overhead. + */ diff --git a/doc/maintainers.txt b/doc/maintainers.txt index f4fc5a4..c3eb204 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -33,6 +33,9 @@ German Jens Seidel: jensseidel@users.sf.net Jens Breitenstein: Jens.Breitenstein@tlc.de +Greek +Harry Kalogirou: harkal@rainbow.cs.unipi.gr + Hungarian Földvári György: foldvari@diatronltd.com diff --git a/doc/translator.pl b/doc/translator.pl index 58477af..1bba346 100644 --- a/doc/translator.pl +++ b/doc/translator.pl @@ -87,6 +87,14 @@ # like "almost up-to-date" any more. The script was simplified # to reflect the changes. # +# 2001/11/26 +# - Information about version of doxygen added to the top +# of the translator report (the ASCII file). +# - TranslatorEnglish can be used to solve really obsolete translators +# to make adapter classes simpler. Such translators are marked +# as "obsolete" in the status (i.e. no guessing when it was last updated). +# The translator report include the notice about that situation. +# ################################################################ use 5.005; @@ -527,7 +535,12 @@ xxxTABLE_FOOTxxx {$1.$2.$3}x; } - if ($i == 0) { $status = '?'; } + if ($i == 0) { + $i = $status =~ s{^TranslatorEnglish$} + {obsolete}x; + } + + if ($i == 0) { $status = 'strange'; } ##}}} @@ -890,11 +903,15 @@ print STDERR "\n\n"; # Loop through the list of expected methods and collect # the missing (new) methods. Do this only when it derives # from Translator or TranslatorAdapter classes (i.e. ignore - # any unusual kind of TranslatorXxxx implementation). #{{{ + # any unusual kind of TranslatorXxxx implementation). + # Accept also deriving from TranslatorEnglish, that can + # be done by doxygen developers to solve problems with + # some really outdated translators. #{{{ # my @missing_methods = (); - if ($base =~ m/^Translator(Adapter.*)?$/) { + if ($base =~ m/^Translator(Adapter.*)?$/ + || $base =~ m/^TranslatorEnglish$/) { foreach my $method (@expected) { # Get the stripped version of the prototype. @@ -921,15 +938,34 @@ print STDERR "\n\n"; $output .= "\n\n\n"; $output .= $class . " ($base)\n" . '-' x length($class) . "\n"; - if ($base !~ m/^Translator(Adapter.*)?$/) { - $output .= "\nThis is the unusual implementation of the " - . "translator. Its class is derived\n" + if ($base =~ m/^TranslatorEnglish$/) { + $output .= "\nThis translator is implemented via deriving " + . "from the English translator.\n" + . "This should be done only in the case when " + . "the language maintainer\n" + . "or the doxygen " + . "developers need to update some really old-dated " + . "translator.\n" + . "Otherwise, deriving from " + . "the translator adapter classes should be used\n" + . "for obsolete translators. " + . "If you still want some texts to be in English\n" + . "copy the sources of the English translator.\n\n" + . "The obsolete and missing method lists (below) " + . "reflect what have to be done\n" + . "to derive " + . "directly from the Translator class " + . "(i.e. to reach up-to-date status).\n"; + } + elsif ($base !~ m/^Translator(Adapter.*)?$/) { + $output .= "\nThis is some unusual implementation of the " + . "translator class. It is derived\n" . "from the $base base class. The usual translator" . "class derives\n" . "or from the Translator class or from some " . "TranslatorAdapter_x_x_x classes.\n" . "Because of that, nothing can be guessed about " - . "missing methods.\n"; + . "missing or obsolete methods.\n"; } if (@missing_methods) { @@ -951,24 +987,34 @@ print STDERR "\n\n"; } - # Generate the textual output file. + # Generate the ASCII output file. # my $fout = "$docdir/$ftranslatortxt"; - # Open it first. + # Open it first, and output the version information. #{{{ # open(FOUT, "> $fout") or die "\nError when open > $fout: $!"; + print FOUT "(version $doxversion)\n\n"; + ##}}} + # List the supported languages. #{{{ # my @all_translators = keys %cb; print FOUT "Doxygen supports the following (" . @all_translators . ") languages (sorted alphabetically):\n\n"; - - foreach (sort grep { s/^Translator(\w+)\b.*$/$1/ } @all_translators) { - print FOUT " $_\n"; - } + + my @languages = sort + grep { s/^Translator(\w+)\b.*$/$1/ } + @all_translators; + + my $languages = join(", ", @languages); + $languages =~ s{((\w+,\s){5})}{$1\n}g; + $languages =~ s{Brazilian}{Brazilian Portuguese}; + $languages =~ s{(,\s+)(\w+)$}{$1and $2.}s; + + print FOUT "$languages\n"; ##}}} # If there are up-to-date translators, list them. #{{{ @@ -1019,11 +1065,35 @@ print STDERR "\n\n"; } ##}}} + # If there are translators derived from TranslatorEnglish, list them + # and name them as obsolete. #{{{ + # + @list = sort grep { $cb{$_} =~ m/^TranslatorEnglish$/ } keys %cb; + + if (@list) { + print FOUT "\n" .'-' x 70 . "\n"; + print FOUT "The following translator classes are implemented " + . "via deriving\n" + . "from the English translator. This should be done only " + . "in the case\n" + . "when the language maintainer or the doxygen " + . "developers need to update\n" + . "some really outdated translator. Otherwise, deriving " + . "from\n" + . "the translator adapter classes should be prefered " + . "for obsolete translators.\n" + . "See details below in the report.\n\n"; + + foreach (@list) { print FOUT " $_\t($cb{$_})\n"; } + } + ##}}} + # If there are other translators, list them. #{{{ # @list = sort grep { $cb{$_} !~ m/^Translator$/ } - grep { $cb{$_} !~ m/^TranslatorAdapter_/ } + grep { $cb{$_} !~ m/^TranslatorAdapter_/ } + grep { $cb{$_} !~ m/^TranslatorEnglish$/ } keys %cb; if (@list) { @@ -1031,12 +1101,16 @@ print STDERR "\n\n"; print FOUT "The following translator classes are somehow different\n" . "(sorted alphabetically). This means that they " . "do not derive from\n" - . "the Translator class, nor from some of the adapter classes.\n\n"; - + . "the Translator class, nor from some of the adapter " + . "classes,\n" + . "nor from the TranslatorEnglish. Nothing can be guessed " + . "about the methods.\n\n"; + foreach (@list) { print FOUT " $_\t($cb{$_})\n"; } } ##}}} + # List the methods that are expected to be implemented. #{{{ # print FOUT "\n\n" .'-' x 70 . "\n"; @@ -1059,7 +1133,7 @@ print STDERR "\n\n"; } ##}}} - # Close the output file + # Close the ASCII output file # close FOUT; diff --git a/examples/example.tag b/examples/example.tag index 84ef9ed..167a545 100644 --- a/examples/example.tag +++ b/examples/example.tag @@ -1,3 +1,4 @@ + Test diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 404e4fb..b386153 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,5 +1,5 @@ Name: doxygen -Version: 1.2.12_20011209 +Version: 1.2.13 Summary: documentation system for C, C++ and IDL Release: 4 Source: doxygen-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 4b35855..eb46b38 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -87,23 +87,24 @@ ClassDef::ClassDef( memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); m_innerClasses = new ClassSDict(17); - //int i=name().findRev("::"); // TODO: broken if A is the class name - //if (i==-1) - //{ - // m_scopelessName=name(); - //} - //else - //{ - // m_scopelessName=name().right(name().length()-i-2); - //} m_subGrouping=TRUE; - //m_isTemplBaseClass=-1; m_templateInstances = 0; m_templateMaster =0; m_templBaseClassNames = 0; m_artificial = FALSE; m_isAbstract = FALSE; m_isStatic = FALSE; + m_membersMerged = FALSE; + + if (((QCString)defFileName).right(5)!=".java" && + guessSection(defFileName)==Entry::SOURCE_SEC) + { + m_isLocal=TRUE; + } + else + { + m_isLocal=FALSE; + } } // destroy the class definition @@ -181,7 +182,10 @@ void ClassDef::addMembersToMemberGroup() } // adds new member definition to the class -void ClassDef::insertMember(MemberDef *md) +void ClassDef::internalInsertMember(MemberDef *md, + Protection prot, + bool addToAllList + ) { //printf("adding %s::%s\n",name().data(),md->name().data()); if (!isReference()) @@ -190,7 +194,7 @@ void ClassDef::insertMember(MemberDef *md) /* insert member in the declaration section */ /********************************************/ if (md->isRelated() && - (Config_getBool("EXTRACT_PRIVATE") || md->protection()!=Private)) + (Config_getBool("EXTRACT_PRIVATE") || prot!=Private)) { related.append(md); md->setSectionList(&related); @@ -217,7 +221,7 @@ void ClassDef::insertMember(MemberDef *md) md->setSectionList(&properties); break; case MemberDef::Slot: // Qt specific - switch (md->protection()) + switch (prot) { case Protected: proSlots.append(md); @@ -238,7 +242,7 @@ void ClassDef::insertMember(MemberDef *md) { if (md->isVariable()) { - switch (md->protection()) + switch (prot) { case Protected: proStaticAttribs.append(md); @@ -256,7 +260,7 @@ void ClassDef::insertMember(MemberDef *md) } else // function { - switch (md->protection()) + switch (prot) { case Protected: proStaticMembers.append(md); @@ -277,7 +281,7 @@ void ClassDef::insertMember(MemberDef *md) { if (md->isVariable()) { - switch (md->protection()) + switch (prot) { case Protected: proAttribs.append(md); @@ -295,7 +299,7 @@ void ClassDef::insertMember(MemberDef *md) } else if (md->isTypedef() || md->isEnumerate() || md->isEnumValue()) { - switch (md->protection()) + switch (prot) { case Protected: proTypes.append(md); @@ -313,7 +317,7 @@ void ClassDef::insertMember(MemberDef *md) } else // member function { - switch (md->protection()) + switch (prot) { case Protected: proMembers.append(md); @@ -338,7 +342,7 @@ void ClassDef::insertMember(MemberDef *md) /* insert member in the detailed documentation section */ /*******************************************************/ if ((md->isRelated() && - (Config_getBool("EXTRACT_PRIVATE") || md->protection()!=Private) + (Config_getBool("EXTRACT_PRIVATE") || prot!=Private) ) || md->isFriend() ) { @@ -365,7 +369,7 @@ void ClassDef::insertMember(MemberDef *md) functionMembers.append(md); break; case MemberDef::Slot: - switch (md->protection()) + switch (prot) { case Protected: if (Config_getBool("SORT_MEMBER_DOCS")) @@ -391,7 +395,7 @@ void ClassDef::insertMember(MemberDef *md) } break; default: // any of the other members - if (md->protection()!=Private || Config_getBool("EXTRACT_PRIVATE")) + if (prot!=Private || Config_getBool("EXTRACT_PRIVATE")) { switch (md->memberType()) { @@ -458,21 +462,28 @@ void ClassDef::insertMember(MemberDef *md) m_isAbstract=TRUE; } - MemberInfo *mi = new MemberInfo((MemberDef *)md, - md->protection(),md->virtualness(),FALSE); - MemberNameInfo *mni=0; - if ((mni=m_allMemberNameInfoSDict->find(md->name()))) - { - mni->append(mi); - } - else + if (addToAllList) { - mni = new MemberNameInfo(md->name()); - mni->append(mi); - m_allMemberNameInfoSDict->inSort(mni->memberName(),mni); + MemberInfo *mi = new MemberInfo((MemberDef *)md, + prot,md->virtualness(),FALSE); + MemberNameInfo *mni=0; + if ((mni=m_allMemberNameInfoSDict->find(md->name()))) + { + mni->append(mi); + } + else + { + mni = new MemberNameInfo(md->name()); + mni->append(mi); + m_allMemberNameInfoSDict->append(mni->memberName(),mni); + } } } +void ClassDef::insertMember(MemberDef *md) +{ + internalInsertMember(md,md->protection(),TRUE); +} //void ClassDef::computeMemberGroups() //{ @@ -498,29 +509,30 @@ void ClassDef::insertMember(MemberDef *md) // compute the anchors for all members void ClassDef::computeAnchors() { - setAnchors('a',&pubMembers); - setAnchors('b',&proMembers); - setAnchors('c',&priMembers); - setAnchors('d',&pubStaticMembers); - setAnchors('e',&proStaticMembers); - setAnchors('f',&priStaticMembers); - setAnchors('g',&pubSlots); - setAnchors('h',&proSlots); - setAnchors('i',&priSlots); - setAnchors('j',&signals); - setAnchors('k',&related); - setAnchors('l',&friends); - setAnchors('m',&pubAttribs); - setAnchors('n',&proAttribs); - setAnchors('o',&priAttribs); - setAnchors('p',&pubStaticAttribs); - setAnchors('q',&proStaticAttribs); - setAnchors('r',&priStaticAttribs); - setAnchors('s',&pubTypes); - setAnchors('t',&proTypes); - setAnchors('u',&priTypes); - setAnchors('v',&dcopMethods); - setAnchors('w',&properties); + ClassDef *context = Config_getBool("INLINE_INHERITED_MEMB") ? this : 0; + setAnchors(context,'a',&pubMembers); + setAnchors(context,'b',&proMembers); + setAnchors(context,'c',&priMembers); + setAnchors(context,'d',&pubStaticMembers); + setAnchors(context,'e',&proStaticMembers); + setAnchors(context,'f',&priStaticMembers); + setAnchors(context,'g',&pubSlots); + setAnchors(context,'h',&proSlots); + setAnchors(context,'i',&priSlots); + setAnchors(context,'j',&signals); + setAnchors(context,'k',&related); + setAnchors(context,'l',&friends); + setAnchors(context,'m',&pubAttribs); + setAnchors(context,'n',&proAttribs); + setAnchors(context,'o',&priAttribs); + setAnchors(context,'p',&pubStaticAttribs); + setAnchors(context,'q',&proStaticAttribs); + setAnchors(context,'r',&priStaticAttribs); + setAnchors(context,'s',&pubTypes); + setAnchors(context,'t',&proTypes); + setAnchors(context,'u',&priTypes); + setAnchors(context,'v',&dcopMethods); + setAnchors(context,'w',&properties); } void ClassDef::distributeMemberGroupDocumentation() @@ -967,7 +979,9 @@ void ClassDef::writeDocumentation(OutputList &ol) // write link to list of all members (HTML only) if (m_allMemberNameInfoSDict->count()>0 && - !Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + !Config_getBool("OPTIMIZE_OUTPUT_FOR_C") + /* && !Config_getBool("INLINE_INHERITED_MEMB") */ + ) { ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(m_memListFileName,0); @@ -1213,7 +1227,9 @@ void ClassDef::writeDocumentationForInnerClasses(OutputList &ol) ClassDef *innerCd; for (cli.toFirst();(innerCd=cli.current());++cli) { - if (innerCd->isLinkableInProject() && innerCd->templateMaster()==0) + if (innerCd->isLinkableInProject() && innerCd->templateMaster()==0 && + (innerCd->protection()!=Private || Config_getBool("EXTRACT_PRIVATE")) + ) { msg("Generating docs for nested compound %s...\n",innerCd->name().data()); innerCd->writeDocumentation(ol); @@ -1568,6 +1584,7 @@ bool ClassDef::isLinkableInProject() const !m_artificial && name().find('@')==-1 && /* anonymous compound */ (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && /* private */ + (!m_isLocal || Config_getBool("EXTRACT_LOCAL_CLASSES")) && /* local */ hasDocumentation() && /* documented */ !isReference() && /* not an external reference */ (!m_isStatic || Config_getBool("EXTRACT_STATIC")); @@ -1637,6 +1654,17 @@ bool ClassDef::isBaseClass(ClassDef *bcd) } //---------------------------------------------------------------------------- + +static bool isStandardFunc(MemberDef *md) +{ + ClassDef *cd=md->getClassDef(); + if (cd->templateMaster()) cd=cd->templateMaster(); + return md->name()=="operator=" || // assignment operator + md->name()==cd->localName() || // constructor + (md->name().find('~')!=-1 && + md->name().find("operator")==-1); // destructor +} + /*! * recusively merges the `all members' lists of a class base * with that of this class. Must only be called for classes without @@ -1645,19 +1673,22 @@ bool ClassDef::isBaseClass(ClassDef *bcd) void ClassDef::mergeMembers() { + if (m_membersMerged) return; + m_membersMerged=TRUE; + //printf(" mergeMembers for %s\n",name().data()); + bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB" ); BaseClassListIterator bcli(*baseClasses()); BaseClassDef *bcd; for ( ; (bcd=bcli.current()) ; ++bcli ) { ClassDef *bClass=bcd->classDef; - + // merge the members in the base class of this inheritance branch first bClass->mergeMembers(); - MemberNameInfoSDict *srcMnd = bClass->memberNameInfoSDict(); - MemberNameInfoSDict *dstMnd = memberNameInfoSDict(); - //MemberNameInfoList *dstMnl = memberNameInfoList(); - + MemberNameInfoSDict *srcMnd = bClass->m_allMemberNameInfoSDict; + MemberNameInfoSDict *dstMnd = m_allMemberNameInfoSDict; + MemberNameInfoSDict::Iterator srcMnili(*srcMnd); MemberNameInfo *srcMni; for ( ; (srcMni=srcMnili.current()) ; ++srcMnili) @@ -1687,24 +1718,26 @@ void ClassDef::mergeMembers() if (srcMd!=dstMd) // different members { ClassDef *dstCd = dstMd->getClassDef(); - //printf("Is %s a base class of %s?\n",srcCd->name(),dstCd->name()); + //printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data()); if (srcCd==dstCd || dstCd->isBaseClass(srcCd)) // member is in the same or a base class { found=matchArguments(srcMd->argumentList(), - dstMd->argumentList() - ); - //ambigue = ambigue || !found; + dstMd->argumentList()); + //printf(" Yes, matching (%s<->%s): %d\n", + // argListToString(srcMd->argumentList()).data(), + // argListToString(dstMd->argumentList()).data(), + // found); hidden = hidden || !found; } else // member is in a non base class => multiple inheritance - // using the same base class. + // using the same base class. { //printf("$$ Existing member %s %s add scope %s\n", // dstMi->ambiguityResolutionScope.data(), // dstMd->name().data(), // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) dstMi->ambiguityResolutionScope.prepend(scope); @@ -1722,7 +1755,7 @@ void ClassDef::mergeMembers() found=TRUE; } else // member can be reached via multiple paths in the - // inheritance tree + // inheritance tree { //printf("$$ Existing member %s %s add scope %s\n", // dstMi->ambiguityResolutionScope.data(), @@ -1731,7 +1764,9 @@ void ClassDef::mergeMembers() QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) + { dstMi->ambiguityResolutionScope.prepend(scope); + } ambigue=TRUE; } } @@ -1748,6 +1783,14 @@ void ClassDef::mergeMembers() // this case is shown anyway. if (!found && srcMd->protection()!=Private) { + if (inlineInheritedMembers) + { + if (!isStandardFunc(srcMd)) + { + //printf(" insertMember `%s'\n",srcMd->name().data()); + internalInsertMember(srcMd,bcd->prot,FALSE); + } + } Specifier virt=srcMi->virt; if (srcMi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; MemberInfo *newMi = new MemberInfo(srcMd,bcd->prot,virt,TRUE); @@ -1761,8 +1804,10 @@ void ClassDef::mergeMembers() QCString scope=bClass->name()+"::"; if (scope!=srcMi->ambiguityResolutionScope.left(scope.length())) + { newMi->ambiguityResolutionScope= scope+srcMi->ambiguityResolutionScope.copy(); + } } if (hidden) { @@ -1777,7 +1822,6 @@ void ClassDef::mergeMembers() newMi->ambiguityResolutionScope=srcMi->ambigClass->name()+"::"; } } - //printf("Adding!\n"); dstMni->append(newMi); } } @@ -1786,8 +1830,9 @@ void ClassDef::mergeMembers() { // create a deep copy of the list (only the MemberInfo's will be // copied, not the actual MemberDef's) - MemberNameInfo *newMni = new MemberNameInfo(srcMni->memberName()); - + MemberNameInfo *newMni = 0; + newMni = new MemberNameInfo(srcMni->memberName()); + // copy the member(s) from the base to the sub class MemberNameInfoIterator mnii(*srcMni); MemberInfo *mi; @@ -1805,12 +1850,20 @@ void ClassDef::mergeMembers() //printf("%s::%s: prot=%d bcd->prot=%d result=%d\n", // name().data(),mi->memberDef->name().data(),mi->prot, // bcd->prot,prot); - + if (mi->prot!=Private) { Specifier virt=mi->virt; if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; - + + if (inlineInheritedMembers) + { + if (!isStandardFunc(mi->memberDef)) + { + //printf(" insertMember `%s'\n",mi->memberDef->name().data()); + internalInsertMember(mi->memberDef,prot,FALSE); + } + } //printf("Adding!\n"); MemberInfo *newMi=new MemberInfo(mi->memberDef,prot,virt,TRUE); newMi->scopePath=bClass->name()+"::"+mi->scopePath; @@ -1819,13 +1872,13 @@ void ClassDef::mergeMembers() newMni->append(newMi); } } - + // add it to the dictionary - //dstMnl->append(newMni); dstMnd->append(newMni->memberName(),newMni); } } } + //printf(" end mergeMembers\n"); } //---------------------------------------------------------------------------- diff --git a/src/classdef.h b/src/classdef.h index d294601..507a915 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -311,6 +311,8 @@ class ClassDef : public Definition /*! \} Interal API */ private: + void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList); + /*! file name that forms the base for the output file containing the * class documentation. For compatibility with Qt (e.g. links via tag * files) this name cannot be derived from the class name directly. @@ -408,6 +410,12 @@ class ClassDef : public Definition /*! Is the class part of an unnamed namespace? */ bool m_isStatic; + + /*! TRUE if classes members are merged with those of the base classes. */ + bool m_membersMerged; + + /*! TRUE if the class is defined in a source file rather than a header file. */ + bool m_isLocal; }; /*! \brief Class that contains information about a usage relation. diff --git a/src/code.l b/src/code.l index acd258d..23762ff 100644 --- a/src/code.l +++ b/src/code.l @@ -1107,14 +1107,12 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" g_code->codify(yytext); } {ID} { - //g_ccd.name=yytext; g_curClassName=yytext; addType(); generateClassOrGlobalLink(*g_code,yytext); BEGIN( ClassVar ); } "=" { - g_code->codify(yytext); unput(*yytext); BEGIN( Body ); } @@ -1124,7 +1122,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" g_theVarContext.addVariable(g_type,g_name); generateClassOrGlobalLink(*g_code,yytext); } -[ \t\n]*":"[ \t\n]* { +[ \t\n]*":"[ \t\n]* { codifyLines(yytext); g_curClassBases.clear(); BEGIN( Bases ); diff --git a/src/config.l b/src/config.l index 98b61aa..3a1918d 100644 --- a/src/config.l +++ b/src/config.l @@ -711,7 +711,7 @@ static void substEnvVarsInStrList(QStrList &sl) // search for a "word" for (i=0;iaddValue("Brazilian"); +#endif +#ifdef LANG_CN ce->addValue("Chinese"); +#endif +#ifdef LANG_HR ce->addValue("Croatian"); +#endif +#ifdef LANG_CZ ce->addValue("Czech"); +#endif +#ifdef LANG_DK ce->addValue("Danish"); +#endif +#ifdef LANG_NL ce->addValue("Dutch"); +#endif ce->addValue("English"); +#ifdef LANG_FI ce->addValue("Finnish"); +#endif +#ifdef LANG_FR ce->addValue("French"); +#endif +#ifdef LANG_DE ce->addValue("German"); +#endif +#ifdef LANG_GR + ce->addValue("Greek"); +#endif +#ifdef LANG_HU ce->addValue("Hungarian"); +#endif +#ifdef LANG_IT ce->addValue("Italian"); +#endif +#ifdef LANG_JP ce->addValue("Japanese"); +#endif +#ifdef LANG_KR ce->addValue("Korean"); +#endif +#ifdef LANG_NO ce->addValue("Norwegian"); +#endif +#ifdef LANG_PL ce->addValue("Polish"); +#endif +#ifdef LANG_PT ce->addValue("Portuguese"); +#endif +#ifdef LANG_RO ce->addValue("Romanian"); +#endif +#ifdef LANG_RU ce->addValue("Russian"); +#endif +#ifdef LANG_SK ce->addValue("Slovak"); +#endif +#ifdef LANG_SI ce->addValue("Slovene"); +#endif +#ifdef LANG_ES ce->addValue("Spanish"); +#endif +#ifdef LANG_SE ce->addValue("Swedish"); +#endif +#ifdef LANG_UA ce->addValue("Ukrainian"); +#endif cb = addBool( "EXTRACT_ALL", "If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n" @@ -1262,6 +1320,13 @@ void Config::create() FALSE ); cb = addBool( + "EXTRACT_LOCAL_CLASSES", + "If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n" + "defined locally in source files will be included in the documentation. \n" + "If set to NO only classes defined in header files are included. \n", + TRUE + ); + cb = addBool( "HIDE_UNDOC_MEMBERS", "If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n" "undocumented members of documented classes, files or namespaces. \n" @@ -1302,6 +1367,14 @@ void Config::create() FALSE ); cb = addBool( + "INLINE_INHERITED_MEMB", + "If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited \n" + "members of a class in the documentation of that class as if those members were \n" + "ordinary class members. Constructors, destructors and assignment operators of \n" + "the base classes will not be shown. \n", + FALSE + ); + cb = addBool( "FULL_PATH_NAMES", "If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n" "path before files name in the file list and in the header files. If set \n" diff --git a/src/defargs.l b/src/defargs.l index 3fa6e65..c238123 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -196,8 +196,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* g_argRoundCount++; *g_copyArgValue += *yytext; } -")" { - *g_copyArgValue += *yytext; +")"({B}*{ID})* { + *g_copyArgValue += yytext; if (g_argRoundCount>0) { g_argRoundCount--; @@ -251,6 +251,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* [,)>] { g_curArgTypeName=removeRedundantWhiteSpace(g_curArgTypeName); g_curArgDefValue=g_curArgDefValue.stripWhiteSpace(); + //printf("curArgType=`%s' curArgDefVal=`%s'\n",g_curArgTypeName.data(),g_curArgDefValue.data()); int l=g_curArgTypeName.length(); if (l>0) { diff --git a/src/doc.l b/src/doc.l index e5a2453..3d7b7af 100644 --- a/src/doc.l +++ b/src/doc.l @@ -1002,21 +1002,25 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) outDoc->docify(getenv(envvar)); } {CMD}"htmlonly"/[^a-z_A-Z0-9] { + outDoc->startHtmlOnly(); outDoc->pushGeneratorState(); outDoc->disableAllBut(OutputGenerator::Html); BEGIN(DocHtmlScan); } {CMD}"endhtmlonly"/[^a-z_A-Z0-9] { outDoc->popGeneratorState(); + outDoc->endHtmlOnly(); BEGIN(DocScan); } {CMD}"latexonly"/[^a-z_A-Z0-9] { + outDoc->startLatexOnly(); outDoc->pushGeneratorState(); outDoc->disableAllBut(OutputGenerator::Latex); BEGIN(DocLatexScan); } {CMD}"endlatexonly"/[^a-z_A-Z0-9] { outDoc->popGeneratorState(); + outDoc->endLatexOnly(); BEGIN(DocScan); } "//"|"/*"|"*/" { diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 83c640e..c4fb21a 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -555,215 +555,214 @@ static void buildClassList(Entry *root) { // this should not be called warn(root->fileName,root->startLine, - "Warning: invalid class name found!" + "Warning: invalid class name found!" ); + goto error; } - else - { - Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data()); + Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data()); - fullName=stripAnonymousNamespaceScope(fullName); - fullName=stripTemplateSpecifiersFromScope(fullName); - - Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data()); + fullName=stripAnonymousNamespaceScope(fullName); + fullName=stripTemplateSpecifiersFromScope(fullName); - bool ambig; - ClassDef *cd; - //printf("findFileDef(%s)\n",root->fileName.data()); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data()); - if ((cd=getClass(fullName))) - { - Debug::print(Debug::Classes,0," Existing class!\n",fullName.data()); - //if (cd->templateArguments()==0) - //{ - // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); - // cd->setTemplateArguments(tArgList); - //} - if (!root->doc.isEmpty() || !root->brief.isEmpty() || - (root->bodyLine!=-1 && Config_getBool("SOURCE_BROWSER")) - ) - // block contains something that ends up in the docs - { - if (!root->doc.isEmpty() && !cd->documentation().isEmpty()) - { - warn( - root->fileName,root->startLine, - "Warning: class %s already has a detailed description. " - "Skipping the one found here.", - fullName.data() - ); - } - else if (!root->doc.isEmpty()) - { - cd->setDocumentation(root->doc); - } - if (!root->brief.isEmpty() && !cd->briefDescription().isEmpty()) - { - warn( - root->fileName,root->startLine, - "Warning: class %s already has a brief description\n" - " skipping the one found here.", - fullName.data() - ); - } - else if (!root->brief.isEmpty()) - { - cd->setBriefDescription(root->brief); - } - if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1) - { - cd->setBodySegment(root->bodyLine,root->endBodyLine); - cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); - } - cd->addSectionsToDefinition(root->anchors); - cd->setName(fullName); // change name to match docs - } - cd->setFileDef(fd); - if (cd->hasDocumentation()) + bool ambig; + ClassDef *cd; + //printf("findFileDef(%s)\n",root->fileName.data()); + FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + + if ((cd=getClass(fullName))) + { + Debug::print(Debug::Classes,0," Existing class!\n",fullName.data()); + //if (cd->templateArguments()==0) + //{ + // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); + // cd->setTemplateArguments(tArgList); + //} + if (!root->doc.isEmpty() || !root->brief.isEmpty() || + (root->bodyLine!=-1 && Config_getBool("SOURCE_BROWSER")) + ) + // block contains something that ends up in the docs + { + if (!root->doc.isEmpty() && !cd->documentation().isEmpty()) { - addIncludeFile(cd,fd,root); + warn( + root->fileName,root->startLine, + "Warning: class %s already has a detailed description. " + "Skipping the one found here.", + fullName.data() + ); } - addNamespace(root,cd); - if (fd && (root->section & Entry::COMPOUND_MASK)) + else if (!root->doc.isEmpty()) { - //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n", - // cd->name().data(), - // fd->name().data(), - // root->fileName.data() - // ); - fd->insertClass(cd); + cd->setDocumentation(root->doc); } - addClassToGroups(root,cd); - cd->setRefItems(root->todoId,root->testId,root->bugId); - if (!root->subGrouping) cd->setSubGrouping(FALSE); - - if (cd->templateArguments()==0) + if (!root->brief.isEmpty() && !cd->briefDescription().isEmpty()) { - // this happens if a template class declared with @class is found - // before the actual definition. - ArgumentList *tArgList = - getTemplateArgumentsFromName(fullName,root->tArgLists); - cd->setTemplateArguments(tArgList); + warn( + root->fileName,root->startLine, + "Warning: class %s already has a brief description\n" + " skipping the one found here.", + fullName.data() + ); } - } - else // new class - { - - ClassDef::CompoundType sec=ClassDef::Class; - switch(root->section) + else if (!root->brief.isEmpty()) { - case Entry::UNION_SEC: - case Entry::UNIONDOC_SEC: - sec=ClassDef::Union; break; - case Entry::STRUCT_SEC: - case Entry::STRUCTDOC_SEC: - sec=ClassDef::Struct; break; - case Entry::INTERFACE_SEC: - case Entry::INTERFACEDOC_SEC: - sec=ClassDef::Interface; break; - case Entry::EXCEPTION_SEC: - case Entry::EXCEPTIONDOC_SEC: - sec=ClassDef::Exception; break; + cd->setBriefDescription(root->brief); } - Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)! #tArgLists=%d\n", - fullName.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1); - QCString className; - QCString namespaceName; - extractNamespaceName(fullName,className,namespaceName); - - //printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data()); - - QCString tagName; - QCString refFileName; - if (root->tagInfo) + if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1) { - tagName = root->tagInfo->tagName; - refFileName = root->tagInfo->fileName; + cd->setBodySegment(root->bodyLine,root->endBodyLine); + cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); } - ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec, - tagName,refFileName); - cd->setDocumentation(root->doc); // copy docs to definition - cd->setBriefDescription(root->brief); - //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data()); - + cd->addSectionsToDefinition(root->anchors); + cd->setName(fullName); // change name to match docs + } + cd->setFileDef(fd); + if (cd->hasDocumentation()) + { + addIncludeFile(cd,fd,root); + } + addNamespace(root,cd); + if (fd && (root->section & Entry::COMPOUND_MASK)) + { + //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n", + // cd->name().data(), + // fd->name().data(), + // root->fileName.data() + // ); + fd->insertClass(cd); + } + addClassToGroups(root,cd); + cd->setRefItems(root->todoId,root->testId,root->bugId); + if (!root->subGrouping) cd->setSubGrouping(FALSE); + if (cd->templateArguments()==0) + { + // this happens if a template class declared with @class is found + // before the actual definition. ArgumentList *tArgList = - getTemplateArgumentsFromName(fullName,root->tArgLists); - //printf("class %s template args=%s\n",fullName.data(), - // tArgList ? tempArgListToString(tArgList).data() : ""); + getTemplateArgumentsFromName(fullName,root->tArgLists); cd->setTemplateArguments(tArgList); - cd->setProtection(root->protection); - cd->addSectionsToDefinition(root->anchors); - cd->setIsStatic(root->stat); + } + } + else // new class + { - // file definition containing the class cd - cd->setBodySegment(root->bodyLine,root->endBodyLine); - cd->setBodyDef(fd); - if (!root->subGrouping) cd->setSubGrouping(FALSE); + ClassDef::CompoundType sec=ClassDef::Class; + switch(root->section) + { + case Entry::UNION_SEC: + case Entry::UNIONDOC_SEC: + sec=ClassDef::Union; break; + case Entry::STRUCT_SEC: + case Entry::STRUCTDOC_SEC: + sec=ClassDef::Struct; break; + case Entry::INTERFACE_SEC: + case Entry::INTERFACEDOC_SEC: + sec=ClassDef::Interface; break; + case Entry::EXCEPTION_SEC: + case Entry::EXCEPTIONDOC_SEC: + sec=ClassDef::Exception; break; + } + Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)! #tArgLists=%d\n", + fullName.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1); + QCString className; + QCString namespaceName; + extractNamespaceName(fullName,className,namespaceName); - addClassToGroups(root,cd); - cd->setRefItems(root->todoId,root->testId,root->bugId); + //printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data()); - // see if the class is found inside a namespace - bool found=addNamespace(root,cd); + QCString tagName; + QCString refFileName; + if (root->tagInfo) + { + tagName = root->tagInfo->tagName; + refFileName = root->tagInfo->fileName; + } + ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec, + tagName,refFileName); + cd->setDocumentation(root->doc); // copy docs to definition + cd->setBriefDescription(root->brief); + //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data()); - cd->setFileDef(fd); - if (cd->hasDocumentation()) - { - addIncludeFile(cd,fd,root); - } - - // namespace is part of the class name - if (!found && !namespaceName.isEmpty()) - { - NamespaceDef *nd = getResolvedNamespace(namespaceName); - if (nd) - { - cd->setNamespace(nd); - nd->insertClass(cd); - found=TRUE; - } - } - - // if the class is not in a namespace then we insert - // it in the file definition - if (!found && fd && (root->section & Entry::COMPOUND_MASK)) - { - //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n", - // cd->name().data(), - // fd->name().data(), - // root->fileName.data() - // ); - fd->insertClass(cd); - } - - // the empty string test is needed for extract all case - cd->setBriefDescription(root->brief); - cd->insertUsedFile(root->fileName); - // add class to the list - //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); - Doxygen::classSDict.append(fullName,cd); + ArgumentList *tArgList = + getTemplateArgumentsFromName(fullName,root->tArgLists); + //printf("class %s template args=%s\n",fullName.data(), + // tArgList ? tempArgListToString(tArgList).data() : ""); + cd->setTemplateArguments(tArgList); + cd->setProtection(root->protection); + cd->addSectionsToDefinition(root->anchors); + cd->setIsStatic(root->stat); - // also add class to the correct structural context - Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName); - if (d==0) - { - //warn(root->fileName,root->startLine, - // "Warning: Internal inconsistency: scope for class %s not " - // "found!\n",fullName.data() - // ); - } - else + // file definition containing the class cd + cd->setBodySegment(root->bodyLine,root->endBodyLine); + cd->setBodyDef(fd); + if (!root->subGrouping) cd->setSubGrouping(FALSE); + + addClassToGroups(root,cd); + cd->setRefItems(root->todoId,root->testId,root->bugId); + + // see if the class is found inside a namespace + bool found=addNamespace(root,cd); + + cd->setFileDef(fd); + if (cd->hasDocumentation()) + { + addIncludeFile(cd,fd,root); + } + + // namespace is part of the class name + if (!found && !namespaceName.isEmpty()) + { + NamespaceDef *nd = getResolvedNamespace(namespaceName); + if (nd) { - //printf("****** adding %s to scope %s\n",cd->name().data(),d->name().data()); - d->addInnerCompound(cd); - cd->setOuterScope(d); + cd->setNamespace(nd); + nd->insertClass(cd); + found=TRUE; } } + + // if the class is not in a namespace then we insert + // it in the file definition + if (!found && fd && (root->section & Entry::COMPOUND_MASK)) + { + //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n", + // cd->name().data(), + // fd->name().data(), + // root->fileName.data() + // ); + fd->insertClass(cd); + } + + // the empty string test is needed for extract all case + cd->setBriefDescription(root->brief); + cd->insertUsedFile(root->fileName); + + // add class to the list + //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); + Doxygen::classSDict.append(fullName,cd); + + // also add class to the correct structural context + Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName); + if (d==0) + { + //warn(root->fileName,root->startLine, + // "Warning: Internal inconsistency: scope for class %s not " + // "found!\n",fullName.data() + // ); + } + else + { + //printf("****** adding %s to scope %s\n",cd->name().data(),d->name().data()); + d->addInnerCompound(cd); + cd->setOuterScope(d); + } } } +error: EntryListIterator eli(*root->sublist); Entry *e; for (;(e=eli.current());++eli) @@ -1847,7 +1846,7 @@ static void buildFunctionList(Entry *root) //printf("match!\n"); // see if we need to create a new member found=(nd && rnd && nsName==rnsName) || // members are in the same namespace - ((fd!=0 && // no external reference and + ((nd==0 && rnd==0 && fd!=0 && // no external reference and fd->absFilePath()==root->fileName // prototype in the same file ) ); @@ -2167,6 +2166,11 @@ static void transferFunctionDocumentation() } mdec->mergeMemberSpecifiers(mdef->getMemberSpecifiers()); mdef->mergeMemberSpecifiers(mdec->getMemberSpecifiers()); + + int todoId = QMAX(mdec->todoId(),mdef->todoId()); + int testId = QMAX(mdec->testId(),mdef->testId()); + int bugId = QMAX(mdec->bugId() ,mdef->bugId() ); + mdec->setRefItems(todoId,testId,bugId); } } } @@ -4775,6 +4779,7 @@ static void buildCompleteMemberLists() cd->subClasses()->count()==0 && // is a root of the hierarchy cd->baseClasses()->count()>0) // and has at least one base class { + //printf("*** merging members for %s\n",cd->name().data()); cd->mergeMembers(); } } @@ -6954,8 +6959,8 @@ void parseInput() msg("Determining which enums are documented\n"); findDocumentedEnumValues(); - msg("Computing member references...\n"); - computeMemberReferences(); + //msg("Computing member references...\n"); + //computeMemberReferences(); msg("Computing member relations...\n"); computeMemberRelations(); @@ -6975,6 +6980,9 @@ void parseInput() msg("Building full member lists recursively...\n"); buildCompleteMemberLists(); + msg("Computing member references...\n"); + computeMemberReferences(); + if (Config_getBool("INHERIT_DOCS")) { msg("Inheriting documentation...\n"); diff --git a/src/filedef.cpp b/src/filedef.cpp index 620c8a9..144f8c6 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -84,7 +84,7 @@ FileDef::~FileDef() /*! Compute the HTML anchor names for all members in the class */ void FileDef::computeAnchors() { - setAnchors('a',&allMemberList); + setAnchors(0,'a',&allMemberList); } void FileDef::distributeMemberGroupDocumentation() diff --git a/src/groupdef.cpp b/src/groupdef.cpp index f879d60..7e2a54f 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -343,7 +343,7 @@ int GroupDef::countMembers() const /*! Compute the HTML anchor names for all members in the class */ void GroupDef::computeAnchors() { - setAnchors('a',allMemberList); + setAnchors(0,'a',allMemberList); } void GroupDef::writeDocumentation(OutputList &ol) diff --git a/src/htmlgen.h b/src/htmlgen.h index 75c2a00..387065e 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -249,6 +249,11 @@ class HtmlGenerator : public OutputGenerator void startFontClass(const char *s) { t << ""; } void endFontClass() { t << ""; } + void startHtmlOnly() {} + void endHtmlOnly() {} + void startLatexOnly() {} + void endLatexOnly() {} + private: QCString lastTitle; QCString lastFile; diff --git a/src/lang_cfg.h b/src/lang_cfg.h index 581905b..4e6639b 100644 --- a/src/lang_cfg.h +++ b/src/lang_cfg.h @@ -21,3 +21,4 @@ #define LANG_DK #define LANG_SK #define LANG_UA +#define LANG_GR diff --git a/src/language.cpp b/src/language.cpp index 33da153..5f27716 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -91,6 +91,12 @@ #ifdef LANG_UA #include "translator_ua.h" #endif +#ifdef LANG_GR +#include "translator_gr.h" +#endif +//#ifdef LANG_JS +//#include "translator_js.h" +//#endif #endif #define L_EQUAL(a) !stricmp(langName,a) @@ -242,6 +248,16 @@ bool setTranslator(const char *langName) theTranslator=new TranslatorUkrainian; } #endif +#ifdef LANG_GR + else if (L_EQUAL("greek")) + { + theTranslator=new TranslatorGreek; + } +#endif +// else if (L_EQUAL("japanese-sjis")) +// { +// theTranslator=new TranslatorJapaneseSjis; +// } #endif else // use the default language (i.e. english) { diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 0f24f6e..49469de 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -272,8 +272,9 @@ static void writeDefaultHeaderPart1(QTextStream &t) t << "\\makeindex\n" "\\setcounter{tocdepth}{1}\n" "\\setlength{\\footrulewidth}{0.4pt}\n" - "\\begin{document}\n" - "\\begin{titlepage}\n" + "\\begin{document}\n"; + if (theTranslator->idLanguage()=="greek") t << "\\selectlanguage{greek}\n"; + t << "\\begin{titlepage}\n" "\\vspace*{7cm}\n" "\\begin{center}\n" "{\\Large "; @@ -1380,13 +1381,15 @@ void LatexGenerator::latin2ToLatex(unsigned char c) //void LatexGenerator::docifyStatic(QTextStream &t,const char *str) void LatexGenerator::docify(const char *str) { - static bool isCzech = theTranslator->idLanguage()=="czech"; - static bool isJapanese = theTranslator->idLanguage()=="japanese"; - static bool isKorean = theTranslator->idLanguage()=="korean"; - static bool isRussian = theTranslator->idLanguage()=="russian"; - static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; - static bool isChinese = theTranslator->idLanguage()=="chinese"; - static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; + static bool isCzech = theTranslator->idLanguage()=="czech"; + static bool isJapanese = theTranslator->idLanguage()=="japanese"; + static bool isJapaneseSjis = theTranslator->idLanguage()=="japanese-sjis"; + static bool isKorean = theTranslator->idLanguage()=="korean"; + static bool isRussian = theTranslator->idLanguage()=="russian"; + static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; + static bool isChinese = theTranslator->idLanguage()=="chinese"; + static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; + static bool isGreek = theTranslator->idLanguage()=="greek"; if (str) { const unsigned char *p=(const unsigned char *)str; @@ -1452,7 +1455,7 @@ void LatexGenerator::docify(const char *str) default: // Some languages uses wide characters - if (isJapanese || isKorean || isChinese) + if (isJapanese || isJapaneseSjis || isKorean || isChinese) { if (c>=128) { @@ -1494,6 +1497,17 @@ void LatexGenerator::docify(const char *str) t << (char)c; } } + else if (isGreek) + { + if (c<128) + { + t << "\\textlatin{" << (char)c << "}"; + } + else + { + t << (char)c; + } + } else // language is other than Czech, Russian or Japanese { switch(c) diff --git a/src/latexgen.h b/src/latexgen.h index 51947c2..5d5eab8 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -255,6 +255,11 @@ class LatexGenerator : public OutputGenerator void startFontClass(const char *) {} void endFontClass() {} + + void startHtmlOnly() {} + void endHtmlOnly() {} + void startLatexOnly() {} + void endLatexOnly() {} private: void latin2ToLatex(unsigned char); diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index 6b73443..14914f9 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -76,6 +76,7 @@ HEADERS = bufstr.h \ translator_es.h \ translator_fi.h \ translator_fr.h \ + translator_gr.h \ translator_hr.h \ translator_hu.h \ translator_it.h \ diff --git a/src/mangen.cpp b/src/mangen.cpp index 9c06dc0..3864ee7 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -143,6 +143,7 @@ void ManGenerator::startFile(const char *,const char *manName, void ManGenerator::endFile() { + t << endl; endPlainFile(); } diff --git a/src/mangen.h b/src/mangen.h index ea944be..2b95de9 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -237,6 +237,11 @@ class ManGenerator : public OutputGenerator void startFontClass(const char *) {} void endFontClass() {} + void startHtmlOnly() {} + void endHtmlOnly() {} + void startLatexOnly() {} + void endLatexOnly() {} + private: bool firstCol; bool paragraph; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index edcf1e7..baa1452 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -129,6 +129,7 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, } if ((vp=a->type.find(re))!=-1) // argument type is a function pointer { + //printf("a->type=`%s' a->name=`%s'\n",a->type.data(),a->name.data()); QCString n=a->type.left(vp); if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); linkifyText(TextGeneratorOLImpl(ol),scopeName,md->name(),n); @@ -367,10 +368,7 @@ void MemberDef::setReimplements(MemberDef *md) { m_templateMaster->setReimplements(md); } - else - { - redefines=md; - } + redefines=md; } void MemberDef::insertReimplementedBy(MemberDef *md) @@ -379,11 +377,8 @@ void MemberDef::insertReimplementedBy(MemberDef *md) { m_templateMaster->insertReimplementedBy(md); } - else - { - if (redefinedBy==0) redefinedBy = new MemberList; - redefinedBy->inSort(md); - } + if (redefinedBy==0) redefinedBy = new MemberList; + redefinedBy->inSort(md); } void MemberDef::insertEnumField(MemberDef *md) @@ -491,6 +486,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() if (ltype.left(7)=="friend ") ltype=ltype.right(ltype.length()-7); static QRegExp r("@[0-9]+"); int l,i=r.match(ltype,0,&l); + //printf("ltype=`%s' i=%d\n",ltype.data(),i); // search for the last anonymous scope in the member type ClassDef *annoClassDef=0; if (i!=-1) // found anonymous scope in type @@ -498,10 +494,9 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() int il=i-1,ir=i+l; // extract anonymous scope while (il>=0 && (isId(ltype.at(il)) || ltype.at(il)==':' || ltype.at(il)=='@')) il--; - if (il>0) il++; + if (il>0) il++; else if (il<0) il=0; while (ir<(int)ltype.length() && (isId(ltype.at(ir)) || ltype.at(ir)==':' || ltype.at(ir)=='@')) ir++; - //QCString annName = ltype.mid(i,l); QCString annName = ltype.mid(il,ir-il); // if inside a class or namespace try to prepend the scope name @@ -745,7 +740,7 @@ void MemberDef::writeDeclaration(OutputList &ol, } // write name - if (!name().isEmpty() && name().at(0)!='@') + if (!name().isEmpty() && name().at(0)!='@') // hide annonymous stuff { //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable()); if (isLinkable()) @@ -764,7 +759,9 @@ void MemberDef::writeDeclaration(OutputList &ol, else { //printf("writeLink %s->%d\n",name.data(),hasDocumentation()); - writeLink(ol,cd,nd,fd,gd); + ClassDef *rcd = cd; + if (isReference() && classDef) rcd = classDef; + writeLink(ol,rcd,nd,fd,gd); } } else if (isDocumentedFriendClass()) @@ -903,7 +900,7 @@ bool MemberDef::isDetailedSectionVisible(bool inGroup) const { bool groupFilter = getGroupDef()==0 || inGroup; - bool visible = isDetailedSectionLinkable() && groupFilter; + bool visible = isDetailedSectionLinkable() && groupFilter && !isReference(); //printf("MemberDef::isDetailedSectionVisible() %d\n",visible); return visible; } @@ -1102,7 +1099,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, isFriend() || isRelated() || isExplicit() || isMutable() || (isInline() && Config_getBool("INLINE_INFO")) || isSignal() || isSlot() || - isStatic() + isStatic() || (classDef && classDef!=container) ) { // write the member specifier list @@ -1126,6 +1123,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (isSignal()) sl.append("signal"); if (isSlot()) sl.append("slot"); } + if (classDef && classDef!=container) sl.append("inherited"); const char *s=sl.first(); while (s) { @@ -1165,22 +1163,29 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, parseCode(ol,scopeName,init,FALSE,0); ol.endCodeFragment(); } + + QCString brief = m_templateMaster ? + m_templateMaster->briefDescription() : briefDescription(); + QCString detailed = m_templateMaster ? + m_templateMaster->documentation() : documentation(); + ArgumentList *docArgList = m_templateMaster ? + m_templateMaster->argList : argList; /* write brief description */ - if (!briefDescription().isEmpty() && + if (!brief.isEmpty() && (Config_getBool("REPEAT_BRIEF") /* || (!Config_getBool("BRIEF_MEMBER_DESC") && documentation().isEmpty())*/ ) /* || !annMemb */ ) { - parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),briefDescription()); + parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),brief); ol.newParagraph(); } /* write detailed description */ - if (!documentation().isEmpty()) + if (!detailed.isEmpty()) { - parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),documentation()+"\n"); + parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),detailed+"\n"); ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::RTF); ol.newParagraph(); @@ -1190,7 +1195,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, //printf("***** argList=%p name=%s docs=%s hasDocs=%d\n", // argList, // argList?argList->hasDocumentation():-1); - if (argList && argList->hasDocumentation()) + if (docArgList && docArgList->hasDocumentation()) { //printf("***** argumentList is documented\n"); ol.startParamList(BaseOutputDocInterface::Param); @@ -1198,7 +1203,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.endDescTitle(); ol.writeDescItem(); ol.startDescTable(); - ArgumentListIterator ali(*argList); + ArgumentListIterator ali(*docArgList); Argument *a; for (ali.toFirst();(a=ali.current());++ali) { @@ -1293,21 +1298,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ClassDef *bcd=0; if (bmd && (bcd=bmd->getClassDef())) { -#if 0 - if (lvirt!=Normal) // search for virtual member of the deepest base class - { - MemberDef *lastBmd=bmd; - while (lastBmd) - { - ClassDef *lastBcd = lastBmd->getClassDef(); - if (lastBmd->virtualness()!=Normal && - lastBmd->isLinkable() && - lastBcd->isLinkable() - ) { bmd=lastBmd; bcd=lastBcd; } - lastBmd=lastBmd->reimplements(); - } - } -#endif // write class that contains a member that is reimplemented by this one if (bcd->isLinkable()) { @@ -1543,6 +1533,11 @@ QCString MemberDef::getScopeString() const return result; } +void MemberDef::setAnchor(const char *a) +{ + anc=a; +} + QCString MemberDef::anchor() const { if (m_templateMaster) return m_templateMaster->anchor(); @@ -1601,6 +1596,9 @@ MemberDef *MemberDef::createTemplateInstanceMember( actArg->type = substituteTemplateArgumentsInString(actArg->type,formalArgs,actualArgs); actualArgList->append(actArg); } + actualArgList->constSpecifier = argList->constSpecifier; + actualArgList->volatileSpecifier = argList->volatileSpecifier; + actualArgList->pureSpecifier = argList->pureSpecifier; } MemberDef *imd = new MemberDef( @@ -1613,7 +1611,11 @@ MemberDef *MemberDef::createTemplateInstanceMember( ); imd->argList = actualArgList; imd->def = substituteTemplateArgumentsInString(def,formalArgs,actualArgs); + imd->setBodyDef(getBodyDef()); + imd->setBodySegment(getStartBodyLine(),getEndBodyLine()); + // TODO: init other member variables (if needed). + // TODO: reimplemented info return imd; } @@ -1663,6 +1665,7 @@ void MemberDef::addListReference(Definition *d) memName.prepend(pd->name()+"::"); } } + //printf("*** addListReference %s todo=%d test=%d bug=%d\n",name().data(),todoId(),testId(),bugId()); addRefItem(todoId(),testId(),bugId(),memLabel, d->getOutputFileBase()+":"+anchor(),memName,argsString()); } diff --git a/src/memberdef.h b/src/memberdef.h index 44fac2d..df4b794 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -135,7 +135,7 @@ class MemberDef : public Definition void setMemberType(MemberType t) { mtype=t; } void setDefinition(const char *d) { def=d; } void setFileDef(FileDef *fd) { fileDef=fd; } - void setAnchor(const char *a) { anc=a; } + void setAnchor(const char *a); void setProtection(Protection p) { prot=p; } void setMemberSpecifiers(int s) { memSpec=s; } void mergeMemberSpecifiers(int s) { memSpec|=s; } diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 1f5dffd..469ad0d 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -84,7 +84,7 @@ void MemberGroup::insertMember(MemberDef *md) void MemberGroup::setAnchors() { - ::setAnchors('z',memberList,grpId); + ::setAnchors(0,'z',memberList,grpId); } void MemberGroup::writeDeclarations(OutputList &ol, diff --git a/src/memberlist.cpp b/src/memberlist.cpp index af318e3..fdffc33 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -373,54 +373,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, } case MemberDef::Friend: { -#if 0 - //printf("Writing friend `%s'\n",md->name().data()); - QCString type=md->typeString(); - //printf("Friend: type=%s name=%s\n",type.data(),md->name().data()); - bool isFriendClass = type=="friend class"; - if (!isFriendClass) - { -#endif - if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); -#if 0 - } - else // isFriendClass - // friend is undocumented as a member but it is a class, - // so generate a link to the class if that is documented. - { - ClassDef *cd=getClass(md->name()); - if (md->hasDocumentation()) // friend is documented - { - if (first) ol.startMemberList(),first=FALSE; - ol.startMemberItem(0); - ol.docify("class "); - ol.insertMemberAlign(); - ol.writeObjectLink(0,0,md->anchor(),md->name()); - ol.endMemberItem(FALSE); - } - else if (cd && cd->isLinkable()) // class is documented - { - if (first) ol.startMemberList(),first=FALSE; - ol.startMemberItem(0); - ol.docify("class "); - ol.insertMemberAlign(); - ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); - ol.endMemberItem(FALSE); - } - else if (!Config_getBool("HIDE_UNDOC_MEMBERS")) // no documentation - { - if (first) ol.startMemberList(),first=FALSE; - ol.startMemberItem(0); - ol.docify("class "); - ol.insertMemberAlign(); - ol.startBold(); - ol.docify(md->name()); - ol.endBold(); - ol.endMemberItem(FALSE); - } - } -#endif + if (first) ol.startMemberList(),first=FALSE; + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); break; } case MemberDef::EnumValue: diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 25b6bad..89584ba 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -167,7 +167,7 @@ void NamespaceDef::insertMember(MemberDef *md) void NamespaceDef::computeAnchors() { - setAnchors('a',&allMemberList); + setAnchors(0,'a',&allMemberList); } void NamespaceDef::writeDocumentation(OutputList &ol) diff --git a/src/outputgen.h b/src/outputgen.h index 1e061e6..3d6bfae 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -257,6 +257,11 @@ class BaseOutputDocInterface virtual void startFontClass(const char *) = 0; virtual void endFontClass() = 0; + virtual void startHtmlOnly() = 0; + virtual void endHtmlOnly() = 0; + virtual void startLatexOnly() = 0; + virtual void endLatexOnly() = 0; + /*! Writes an ASCII string to the output. This function should keep * spaces visible, should break lines at a newline and should convert * tabs to the right number of spaces. diff --git a/src/outputlist.h b/src/outputlist.h index 8f3152a..88f3cb4 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -434,6 +434,15 @@ class OutputList : public OutputDocInterface void endFontClass() { forall(&OutputGenerator::endFontClass); } + void startHtmlOnly() + { forall(&OutputGenerator::startHtmlOnly); } + void endHtmlOnly() + { forall(&OutputGenerator::endHtmlOnly); } + void startLatexOnly() + { forall(&OutputGenerator::startLatexOnly); } + void endLatexOnly() + { forall(&OutputGenerator::endLatexOnly); } + #if 0 void startPlainFile(const char *name) { forall(&OutputGenerator::startPlainFile,name); } diff --git a/src/rtfgen.h b/src/rtfgen.h index 980aea6..0f967b6 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -240,6 +240,11 @@ class RTFGenerator : public OutputGenerator void startFontClass(const char *) {} void endFontClass() {} + void startHtmlOnly() {} + void endHtmlOnly() {} + void startLatexOnly() {} + void endLatexOnly() {} + static bool preProcessFileInplace(const char *path,const char *name); private: diff --git a/src/scanner.l b/src/scanner.l index 5615224..6371b71 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -920,6 +920,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) current->name = current->name.simplifyWhiteSpace(); BEGIN( FindMembers ) ; } +";" { // can occur when importing members + unput(';'); + BEGIN( FindMembers ) ; + } [^(] { lineCount(); current->name += *yytext ; @@ -1093,6 +1097,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) BEGIN( ReadFuncArgType ) ; } } +">"{BN}*/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance + lineCount(); + current->name+='>'; + BEGIN(FindMembers); + } ">"{BN}*/"::" { lineCount(); current->name+='>'; @@ -2033,24 +2042,58 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } /* a special comment */ ("/*"[*!]|"//"[/!])("<"?) { - fullArgString+=yytext; - lastCopyArgChar=0; - if (yytext[1]=='/') - BEGIN( CopyArgCommentLine ); + if (currentArgumentContext==DefineEnd) + { + // for defines we interpret a comment + // as documentation for the define + int i;for (i=yyleng-1;i>=0;i--) + { + unput(yytext[i]); + } + stringToArgumentList(fullArgString,current->argList); + BEGIN( currentArgumentContext ); + } else - BEGIN( CopyArgComment ); + { + // for functions we interpret a comment + // as documentation for the argument + fullArgString+=yytext; + lastCopyArgChar=0; + if (yytext[1]=='/') + BEGIN( CopyArgCommentLine ); + else + BEGIN( CopyArgComment ); + } } /* `)' followed by a special comment */ ")"{BN}*("/*"[*!]|"//"[/!])"<" { lineCount(); - lastCopyArgChar=*yytext; - QCString text=&yytext[1]; - text=text.stripWhiteSpace(); - fullArgString+=text; - if (text.find("//")!=-1) - BEGIN( CopyArgCommentLine ); + if (currentArgumentContext==DefineEnd) + { + // for defines we interpret a comment + // as documentation for the define + int i;for (i=yyleng-1;i>0;i--) + { + unput(yytext[i]); + } + *copyArgString+=*yytext; + fullArgString+=*yytext; + stringToArgumentList(fullArgString,current->argList); + BEGIN( currentArgumentContext ); + } else - BEGIN( CopyArgComment ); + { + // for functions we interpret a comment + // as documentation for the last argument + lastCopyArgChar=*yytext; + QCString text=&yytext[1]; + text=text.stripWhiteSpace(); + fullArgString+=text; + if (text.find("//")!=-1) + BEGIN( CopyArgCommentLine ); + else + BEGIN( CopyArgComment ); + } } [^\n\*]+ { fullArgString+=yytext; } "*/" { fullArgString+=yytext; diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 207d977..5f35a6d 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -32,6 +32,7 @@ #include "doxygen.h" #include "util.h" #include "message.h" +#include "defargs.h" //#include "reflist.h" /*! Container for member specific info that can be read from a tagfile */ @@ -859,6 +860,11 @@ void TagFileParser::buildMemberList(Entry *ce,QList &members) me->type = tmi->type; me->name = tmi->name; me->args = tmi->arglist; + if (!me->args.isEmpty()) + { + me->argList = new ArgumentList; + stringToArgumentList(me->args,me->argList); + } me->protection = tmi->prot; me->virt = tmi->virt; me->stat = tmi->isStatic; diff --git a/src/translator_adapter.h b/src/translator_adapter.h index 136cc75..a103405 100644 --- a/src/translator_adapter.h +++ b/src/translator_adapter.h @@ -267,252 +267,4 @@ class TranslatorAdapter_1_2_1 : public TranslatorAdapter_1_2_2 { return english.trDCOPMethods(); } }; -/*! \brief Translator adapter class for release 1.2.0 - * - * Translator adapter for dealing with translator changes since - * release 1.2.0 - */ -class TranslatorAdapter_1_2_0 : public TranslatorAdapter_1_2_1 -{ - public: - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.2.0"); } - - virtual QCString trTest() - { return english.trTest(); } - - virtual QCString trTestList() - { return english.trTestList(); } - -}; - -/*! \brief Translator adapter class for release 1.1.5 - * - * Translator adapter for dealing with translator changes since - * release 1.1.5 - */ -class TranslatorAdapter_1_1_5 : public TranslatorAdapter_1_2_0 -{ - public: - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.1.5"); } - - virtual QCString trLegendTitle() - { return english.trLegendTitle(); } - - virtual QCString trLegendDocs() - { return english.trLegendDocs(); } - - virtual QCString trLegend() - { return english.trLegend(); } -}; - -/*! \brief Translator adapter class for release 1.1.4 - * - * Translator adapter for dealing with translator changes since - * release 1.1.4 - */ -class TranslatorAdapter_1_1_4 : public TranslatorAdapter_1_1_5 -{ - public: - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.1.4"); } - - virtual QCString trReferencedBy() - { return english.trReferencedBy(); } - - virtual QCString trRemarks() - { return english.trRemarks(); } - - virtual QCString trAttention() - { return english.trAttention(); } - - virtual QCString trInclByDepGraph() - { return english.trInclByDepGraph(); } - - virtual QCString trSince() - { return english.trSince(); } -}; - -/*! \brief Translator adapter class for release 1.1.3 - * - * Translator adapter for dealing with translator changes since - * release 1.1.3 - */ -class TranslatorAdapter_1_1_3 : public TranslatorAdapter_1_1_4 -{ - public: - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.1.3"); } - - virtual QCString trTodo() - { return english.trTodo(); } - - virtual QCString trTodoList() - { return english.trTodoList(); } -}; - -/*! \brief Translator adapter class for release 1.1.0 - * - * Translator adapter for dealing with translator changes since - * release 1.1.0 - */ -class TranslatorAdapter_1_1_0 : public TranslatorAdapter_1_1_3 -{ - public: - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.1.0"); } - - virtual QCString trNote() - { return english.trNote(); } - - virtual QCString trPublicTypes() - { return english.trPublicTypes(); } - - virtual QCString trPublicAttribs() - { return english.trPublicAttribs(); } - - virtual QCString trStaticPublicAttribs() - { return english.trStaticPublicAttribs(); } - - virtual QCString trProtectedTypes() - { return english.trProtectedTypes(); } - - virtual QCString trProtectedAttribs() - { return english.trProtectedAttribs(); } - - virtual QCString trStaticProtectedAttribs() - { return english.trStaticProtectedAttribs(); } - - virtual QCString trPrivateTypes() - { return english.trPrivateTypes(); } - - virtual QCString trPrivateAttribs() - { return english.trPrivateAttribs(); } - - virtual QCString trStaticPrivateAttribs() - { return english.trStaticPrivateAttribs(); } - - virtual QCString trEnumerationValueDocumentation() - { return english.trEnumerationValueDocumentation(); } -}; - -/*! \brief Translator adapter class for release 1.0.0 - * - * Translator adapter for dealing with translator changes since - * release 1.0.0 - */ -class TranslatorAdapter_1_0_0 : public TranslatorAdapter_1_1_0 -{ - virtual QCString updateNeededMessage() - { return createUpdateNeededMessage(idLanguage(),"release 1.0.0"); } - - virtual QCString trIncludingInheritedMembers() - { return english.trIncludingInheritedMembers(); } - - virtual QCString trFuncProtos() - { return english.trFuncProtos(); } - - virtual QCString trNamespaces() - { return english.trNamespaces(); } - - virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, - bool single) - { return english.trGeneratedFromFiles(compType, single); } - - virtual QCString trAlphabeticalList() - { return english.trAlphabeticalList(); } - - virtual QCString trReturnValues() - { return english.trReturnValues(); } - - virtual QCString trMainPage() - { return english.trMainPage(); } - - virtual QCString trPageAbbreviation() - { return english.trPageAbbreviation(); } - - virtual QCString trSources() - { return english.trSources(); } - - virtual QCString trStaticProtectedMembers() - { return english.trStaticProtectedMembers(); } - - virtual QCString trDefinedAtLineInSourceFile() - { return english.trDefinedAtLineInSourceFile(); } - - virtual QCString trDefinedInSourceFile() - { return english.trDefinedInSourceFile(); } - - virtual QCString trDeprecated() - { return english.trDeprecated(); } - - virtual QCString trCollaborationDiagram(const char *clName) - { return english.trCollaborationDiagram(clName); } - - virtual QCString trInclDepGraph(const char *fName) - { return english.trInclDepGraph(fName); } - - virtual QCString trConstructorDocumentation() - { return english.trConstructorDocumentation(); } - - virtual QCString trGotoSourceCode() - { return english.trGotoSourceCode(); } - - virtual QCString trGotoDocumentation() - { return english.trGotoDocumentation(); } - - virtual QCString trPrecondition() - { return english.trPrecondition(); } - - virtual QCString trPostcondition() - { return english.trPostcondition(); } - - virtual QCString trInvariant() - { return english.trInvariant(); } - - virtual QCString trInitialValue() - { return english.trInitialValue(); } - - virtual QCString trCode() - { return english.trCode(); } - - virtual QCString trGraphicalHierarchy() - { return english.trGraphicalHierarchy(); } - - virtual QCString trGotoGraphicalHierarchy() - { return english.trGotoGraphicalHierarchy(); } - - virtual QCString trGotoTextualHierarchy() - { return english.trGotoTextualHierarchy(); } - - virtual QCString trPageIndex() - { return english.trPageIndex(); } - - virtual QCString trReimplementedForInternalReasons() - { return english.trReimplementedForInternalReasons(); } - - virtual QCString trClassHierarchyDescription() - { return english.trClassHierarchyDescription(); } - - virtual QCString trNoDescriptionAvailable() - { return english.trNoDescriptionAvailable(); } - - virtual QCString trEnumerationValues() - { return english.trEnumerationValues(); } - - virtual QCString trFunctionPrototypeDocumentation() - { return english.trFunctionPrototypeDocumentation(); } - - virtual QCString trEnumerationTypeDocumentation() - { return english.trEnumerationTypeDocumentation(); } - - virtual QCString trFunctionDocumentation() - { return english.trFunctionDocumentation(); } - - virtual QCString trRelatedFunctionDocumentation() - { return english.trRelatedFunctionDocumentation(); } - -}; - #endif diff --git a/src/translator_fi.h b/src/translator_fi.h index fc39795..ba836a0 100644 --- a/src/translator_fi.h +++ b/src/translator_fi.h @@ -27,58 +27,67 @@ Olli Korhonen olla vakiintuneessa kδytφssδ. * Tehtδvδδ: - - Termien kokoaminen listaksi ja suomennosten jδrkevyyden tarkastelu. (lista on jo melko kattava) - Author = Tekijδ - Class = Luokka - Compound = Kooste ? - Data = Data - Documentation = Dokumentaatio - Defines = Mδδrittelyt ? - Description = Selite - Detailed = Yksityiskohtainen - diagram = kaavio - Enum = Enumeraatio ? - Exceptions = Poikkeukset - File = Tiedosto - Friends = Ystδvδt ? - Functions = Funktiot - Hierarchical = Hierarkinen - Index = Indeksi - Inherits = Perii - Member = Jδsen - Module = Moduli - Namespace = Nimiavaruus ? - Parameters = Parametrit - Private = Yksityinen - Protected = Suojattu - Prototypes = Prototyypit - Public = Julkinen - Reference Manual= Kδsikirja - Reimplemented = Uudelleen toteutettu - Related = Liittyvδ - Signals = Signaali - Slots = ? - Static = Staattinen - Struct = ? - Typedef = Tyyppimδδrittely - Union = ? - Variables = Muuttujat - - Taivutusmuotojen virheettφmyyden tarkastelu prepositioiden korvauskohdissa. - - Sanasta sanaan kδδnnφskohtien mielekkyyden tarkastelu valmiista dokumentista. - - umlaut vastineiden kδyttφ scandien kohdalla. + - Termien kokoaminen listaksi ja suomennosten jδrkevyyden tarkastelu. (lista on jo melko kattava) + Author = Tekijδ + Class = Luokka + Compound = Kooste ? + Data = Data + Documentation = Dokumentaatio + Defines = Mδδrittelyt ? + Description = Selite + Detailed = Yksityiskohtainen + diagram = kaavio + Enum = Enumeraatio ? + Exceptions = Poikkeukset + File = Tiedosto + Friends = Ystδvδt ? + Functions = Funktiot + Hierarchical = Hierarkinen + Index = Indeksi + Inherits = Perii + Member = Jδsen + Module = Moduli + Namespace = Nimiavaruus ? + Parameters = Parametrit + Private = Yksityinen + Protected = Suojattu + Prototypes = Prototyypit + Public = Julkinen + Reference Manual= Kδsikirja + Reimplemented = Uudelleen toteutettu + Related = Liittyvδ + Signals = Signaali + Slots = ? + Static = Staattinen + Struct = ? + Typedef = Tyyppimδδrittely + Union = ? + Variables = Muuttujat + - Taivutusmuotojen virheettφmyyden tarkastelu prepositioiden korvauskohdissa. + - Sanasta sanaan kδδnnφskohtien mielekkyyden tarkastelu valmiista dokumentista. + - umlaut vastineiden kδyttφ scandien kohdalla. positiiviset kommentit otetaan ilolla vastaan. =================================================================================== */ -#ifndef TRANSLATOR_SF_H -#define TRANSLATOR_SF_H +#ifndef TRANSLATOR_FI_H +#define TRANSLATOR_FI_H -#include "translator_adapter.h" - -class TranslatorFinnish : public TranslatorAdapter_1_0_0 +class TranslatorFinnish : public TranslatorEnglish { public: + /*! This method is used to generate a warning message to signal + * the user that the translation of his/her language of choice + * needs updating. + */ + virtual QCString updateNeededMessage() + { + return "Warning: The Finnish translator is really obsolete.\n" + "It was not updated since version 1.0.0. As a result,\n" + "some sentences may appear in English.\n\n"; + } + QCString idLanguage() { return "finnish"; } QCString latexBabelPackage() @@ -119,7 +128,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_0_0 { // here s is one of " Class", " Struct" or " Union" // single is true implies a single file QCString result=(QCString)"Tδmδn "+s+ // "The documentation for this"+s+ - " dokumentaatio on generoitu ";// " was generated from the following file"; + " dokumentaatio on generoitu ";// " was generated from the following file"; if (single) result+="seuraavasta tiedostosta:"; else @@ -379,7 +388,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_0_0 QCString trGeneratedAt(const char *date,const char *projName) { - // funktio on hiukan vaikea kδδntδδ prepositioihin sidotun rakenteen vuoksi. + // funktio on hiukan vaikea kδδntδδ prepositioihin sidotun rakenteen vuoksi. QCString result=(QCString)"Generoitu "+date; // "Generated at " if (projName) result+=(QCString)" projektille "+projName; // " for " result+=(QCString)" tekijδ: "; // " by" diff --git a/src/translator_gr.h b/src/translator_gr.h new file mode 100644 index 0000000..ba07ac7 --- /dev/null +++ b/src/translator_gr.h @@ -0,0 +1,1334 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2001 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. + * + */ + +/* + * 15 Dec 2001 : Translation to greek by + * Harry Kalogirou + */ + +#ifndef TRANSLATOR_GR_H +#define TRANSLATOR_GR_H + +class TranslatorGreek : public TranslatorAdapter_1_2_11 +{ + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ + virtual QCString idLanguage() + { return "greek"; } + virtual QCString latexBabelPackage() + { + return "greek"; + } + virtual QCString latexLanguageSupportCommand() + { + return "\\usepackage[greek,english]{babel}\n\\usepackage[iso-8859-7]{inputenc}\n"; + } + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { + return "iso-8859-7"; + } + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return "Σχετικές συναρτήσεις"; } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return "(Σημειώστε ότι αυτές δεν είναι συναρτήσεις μέλη.)"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return "Λεπτομερή Περιγραφή"; } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return "Τεκμηρίωση Μελών Typedef"; } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return "Τεκμηρίωση Απαριθμήσεων Μελών"; } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return "Τεκμηρίωση Συναρτήσεων Μελών"; } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Τεκμηρίωση Πεδίων"; + } + else + { + return "Τεκμηρίωση Δεδομένων Μελών"; + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return "Περισσότερα..."; } + + /*! put in the class documentation */ + virtual QCString trListOfAllMembers() + { return "Λίστα όλων των μελών."; } + + /*! used as the title of the "list of all members" page of a class */ + virtual QCString trMemberList() + { return "Λίστα μελών"; } + + /*! this is the first part of a sentence that is followed by a class name */ + virtual QCString trThisIsTheListOfAllMembers() + { return "Ακολουθεί η πλήρης λίστα των μελών της"; } + + /*! this is the remainder of the sentence after the class name */ + virtual QCString trIncludingInheritedMembers() + { return ", περιλαμβανομένων όλων των κληρονομημένων μελών."; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result="Δημιουργήθηκε αυτόματα από το Doxygen"; + if (s) result+=(QCString)" για "+s; + result+=" από τον πηγαίο κώδικα."; + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return "όνομα απαρύθμισης"; } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return "τιμή απαρύθμισης"; } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return "ορισμένο στο "; } + + // quick reference sections + + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \\group command). + */ + virtual QCString trModules() + { return "Κομμάτια"; } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return "Ιεραρχία Κλάσεων"; } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Δομές Δεδομένων"; + } + else + { + return "Λίστα Συσσωματωμάτων"; + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return "Λίστα Αρχείων"; } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return "Αρχεία Κεφαλίδας"; } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Πεδία Δεδομένων"; + } + else + { + return "Μέλη Συσσωματώματα"; + } + } + + /*! This is put above each page as a link to all members of files. */ + virtual QCString trFileMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Καθολικοί ορισμοί"; + } + else + { + return "Μέλη Αρχείων"; + } + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + { return "Σχετικές Σελίδες"; } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return "Παραδείγματα"; } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return "Αναζήτηση"; } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return "Αυτή η λίστα κληρονομηκότητας είναι μερικώς ταξινομημένη, " + "αλλά όχι πλήρως, αλφαβητικά:"; + } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result="Ακολουθεί μια λίστα όλων των "; + if (!extractAll) result+="τεκμηριωμένων "; + result+="αρχείων με σύντομες περιγραφές:"; + return result; + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Ακολουθούνε οι δομές δεδομένων με σύντομες περιγραφές:"; + } + else + { + return "Ακολουθούνε οι κλάσεις, οι δομές, " + "τα σώματα και οι διαπροσωπίες με σύντομες περιγραφές:"; + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result="Ακολουθεί η λίστα όλων των "; + if (!extractAll) + { + result+="τεκμηριωμένων "; + } + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="πεδίων δομών και σωμάτων "; + } + else + { + result+="κλάσεων"; + } + result+=" με συνδέσμους "; + if (extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="στην τεκμηρίωση των δομών/ενώσεων για κάθε πεδίο:"; + } + else + { + result+="στην τεκμηρίωση των κλάσεων για κάθε πεδίο:"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="στις δομές/ενώσεις που ανήκουν:"; + } + else + { + result+="στις κλάσεις που ανήκουν:"; + } + } + return result; + } + + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="Ακολουθεί η λίστα όλων των "; + if (!extractAll) result+="τεκμηριωμένων "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="συναρτήσεων, μεταβλητών, ορισμών, απαριθμήσεων, και ορισμών τύπων"; + } + else + { + result+="μελών αρχείων"; + } + result+=" με συνδέσμους "; + if (extractAll) + result+="στα αρχεία που ανήκουν:"; + else + result+="στην τεκμηρίωση:"; + return result; + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return "Ακολουθούνε τα αρχεία κεφαλίδας που απαρτίζουν το API:"; } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return "Ακολουθεί η λίστα με τα παραδείγματα:"; } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return "Ακολουθεί η λίστα όλων των σχετικών σελίδων τεκμηρίωσης:"; } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return "Ακολουθεί η λίστα όλων των μονάδων:"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return "Δεν υπάρχει περιγραφή διαθέσιμη"; } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return "Τεκμηρίωση"; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return "Ευρετήριο μονάδων"; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return "Ιεραρχικό Ευρετήριο"; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Ευρετήριο δομών δεδομένων"; + } + else + { + return "Συμπαγές Ευρετήριο"; + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return "Ευρετήτιο Αρχείων"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return "Τεκμηρίωση Μονάδων"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Τεκμηρίωση Δομών Δεδομένων"; + } + else + { + return "Τεκμηρίωση Κλάσεων"; + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return "Τεκμηρίωση Αρχείων"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return "Τεκμηρίωση Παραδειγμάτων"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return "Τεκμηρίωση Σελίδων"; } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return "Ενχειρίδιο Αναφοράς"; } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return "Ορισμοί"; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return "Πρωτοτυπήσεις Συναρτήσεων"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return "Ορισμοί Τύπων"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return "Απαριθμήσεις"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return "Συναρτήσεις"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return "Μεταβλητές"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return "Τιμές Απαριθμήσεων"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return "Τεκμηρίωση Ορισμών"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return "Τεκμηρίωση Πρωτοτυπήσεων των Συναρτήσεων"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return "Τεκμηρίωση Ορισμών Τύπων"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return "Τεκμηρίωση Απαριθμήσεων"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Τεκμηρίωση Τιμών των Απαριθμήσεων"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return "Τεκμηρίωση Συναρτήσεων"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return "Τεκμηρίωση Μεταβλητών"; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Δομές Δεδομένων"; + } + else + { + return "Συσσωματώματα"; + } + } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Δημιουργήθηκε στις "+date; + if (projName) result+=(QCString)" για "+projName; + result+=(QCString)" από"; + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return "γραμμένο από τον "; + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return (QCString)"Διάγραμμα κληρονομικότητας για την "+clName+":"; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return "Μόνο για εσωτερική χρήση."; } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + { return "Επαναυλοποιημένη για εσωτερικούς λόγους, το API δεν επιρεάζεται."; } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return "Προειδοποίηση"; } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return "Προβλήματα και περιορισμοί"; } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return "Έκδοση"; } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return "Ημ/νια"; } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return "Επιστρέφει"; } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return "Κοιτάξτε επίσης "; } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return "Παράμετροι"; } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return "Εξαίρεση"; } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return "Δημιουργήθηκε από "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return "Λίστα Χώρων Ονομάτων"; } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Ακολουθέι η λίστα όλων των "; + if (!extractAll) result+="τεκμηριωμένων "; + result+="χώρων ονομάτων με σύντομες περιγραφές:"; + return result; + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return "Φίλοι"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return "Τεκμηρίωση Φίλικών και Συσχετιζόμενων Συναρτήσεων"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result=(QCString)clName+" "; + result+=" Αναφορά"; + switch(compType) + { + case ClassDef::Class: result+=" Κλάσης"; break; + case ClassDef::Struct: result+=" Δομής"; break; + case ClassDef::Union: result+=" Ένωσης"; break; + case ClassDef::Interface: result+=" Διαπροσωπίας"; break; + case ClassDef::Exception: result+=" Εξαίρεσης"; break; + } + if (isTemplate) result+=" Template"; + + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result=fileName; + result+=" Αναφορά Αρχείου"; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" Αναφορά Χώρου Ονομάτων"; + return result; + } + + virtual QCString trPublicMembers() + { return "Δημόσιες Μέθοδοι"; } + virtual QCString trPublicSlots() + { return "Δημόσια Slots"; } + virtual QCString trSignals() + { return "Σήματα"; } + virtual QCString trStaticPublicMembers() + { return "Στατικές Δημόσιες Μέδοδοι"; } + virtual QCString trProtectedMembers() + { return "Προστατευμένες Μέδοδοι"; } + virtual QCString trProtectedSlots() + { return "Προστατευμένα Slots"; } + virtual QCString trStaticProtectedMembers() + { return "Στατικές Προστατευμένες Μέδοδοι"; } + virtual QCString trPrivateMembers() + { return "Ιδιοτικές Μέδοδοι"; } + virtual QCString trPrivateSlots() + { return "Ιδιοτικά Slots"; } + virtual QCString trStaticPrivateMembers() + { return "Στατικές Ιδιοτικές Μέδοδοι"; } + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i