diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/config.l | 15 | ||||
-rw-r--r-- | src/docparser.cpp | 127 | ||||
-rw-r--r-- | src/docparser.h | 1 | ||||
-rw-r--r-- | src/doxygen.cpp | 23 | ||||
-rw-r--r-- | src/entry.h | 16 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 14 | ||||
-rw-r--r-- | src/htmlhelp.cpp | 6 | ||||
-rw-r--r-- | src/libdoxygen.t | 3 | ||||
-rw-r--r-- | src/outputgen.h | 14 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 928 | ||||
-rw-r--r-- | src/perlmodgen.h | 5 | ||||
-rw-r--r-- | src/translator_es.h | 2 | ||||
-rw-r--r-- | src/translator_fr.h | 20 | ||||
-rw-r--r-- | src/translator_hu.h | 2 | ||||
-rw-r--r-- | src/translator_it.h | 2 | ||||
-rw-r--r-- | src/translator_jp.h | 2 | ||||
-rw-r--r-- | src/translator_pl.h | 2 | ||||
-rw-r--r-- | src/translator_pt.h | 2 | ||||
-rw-r--r-- | src/translator_ro.h | 2 | ||||
-rw-r--r-- | src/util.cpp | 7 | ||||
-rw-r--r-- | src/xmlgen.cpp | 21 |
22 files changed, 1035 insertions, 181 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index f52fa9d..4dda18e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -51,7 +51,7 @@ clean: Makefile.libdoxygen Makefile.doxygen Makefile.doxytag Makefile.doxysearch $(MAKE) -f Makefile.doxysearch clean distclean: clean - -$(RM) scanner.cpp doc.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \ + -$(RM) scanner.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \ ce_parse.cpp ce_parse.h doxytag.cpp tag.cpp \ declinfo.cpp defargs.cpp commentcnv.cpp doctokenizer.cpp diff --git a/src/config.l b/src/config.l index fd1d117..ab77a02 100644 --- a/src/config.l +++ b/src/config.l @@ -1580,7 +1580,7 @@ void Config::create() cb = addBool( "GENERATE_DEPRECATEDLIST", "The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n" - "disable (NO) the deprecated list. This list is created by putting " + "disable (NO) the deprecated list. This list is created by putting \n" "\\deprecated commands in the documentation.\n", TRUE ); @@ -1986,7 +1986,7 @@ void Config::create() cs->addDependency("GENERATE_LATEX"); cs = addString( "LATEX_CMD_NAME", - "The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be " + "The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n" "invoked. If left blank `latex' will be used as the default command name. \n" ); cs->setDefaultValue("latex"); @@ -2202,6 +2202,15 @@ void Config::create() "moment. \n", FALSE ); + cb = addBool( + "PERLMOD_LATEX", + "If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n" + "the necessary Makefile rules, Perl scripts and LaTeX code to be able \n" + "to generate PDF and DVI output from the Perl module output.\n", + FALSE + ); + cb->addDependency("GENERATE_PERLMOD"); + //----------------------------------------------------------------------------------------------- addInfo( "Preprocessor","Configuration options related to the preprocessor "); //----------------------------------------------------------------------------------------------- @@ -2263,7 +2272,7 @@ void Config::create() cl->addDependency("ENABLE_PREPROCESSING"); cl = addList( "EXPAND_AS_DEFINED", - "If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then \n" + "If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n" "this tag can be used to specify a list of macro names that should be expanded. \n" "The macro definition that is found in the sources will be used. \n" "Use the PREDEFINED tag if you want to use a different macro definition. \n" diff --git a/src/docparser.cpp b/src/docparser.cpp index 097b30d..a5f07f5 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -46,6 +46,8 @@ //--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- + // global variables during a call to validatingParseDoc static bool g_hasParamCommand; static MemberDef * g_memberDef; @@ -112,6 +114,104 @@ static void docParserPopContext() //--------------------------------------------------------------------------- +/*! search for an image in the imageNameDict and if found + * copies the image to the output directory (which is the + * html directory if type==0 or the latex directory if type==1) + */ +static QCString findAndCopyImage(const char *fileName,DocImage::Type type) +{ + QCString result; + bool ambig; + FileDef *fd; + //printf("Search for %s\n",fileName); + if ((fd=findFileDef(Doxygen::imageNameDict,fileName,ambig))) + { + QFile inImage(QString(fd->absFilePath().data())); + if (inImage.open(IO_ReadOnly)) + { + result = fileName; + int i; + if ((i=result.findRev('/'))!=-1 || (i=result.findRev('\\'))!=-1) + { + result.right(result.length()-i-1); + } + QCString outputDir; + switch(type) + { + case DocImage::Html: + if (!Config_getBool("GENERATE_HTML")) return result; + outputDir = Config_getString("HTML_OUTPUT"); + break; + case DocImage::Latex: + if (!Config_getBool("GENERATE_LATEX")) return result; + outputDir = Config_getString("LATEX_OUTPUT"); + break; + case DocImage::Rtf: + if (!Config_getBool("GENERATE_RTF")) return result; + outputDir = Config_getString("RTF_OUTPUT"); + break; + } + QCString outputFile = outputDir+"/"+result; + QFile outImage(QString(outputFile.data())); + if (outImage.open(IO_WriteOnly)) // copy the image + { + char *buffer = new char[inImage.size()]; + inImage.readBlock(buffer,inImage.size()); + outImage.writeBlock(buffer,inImage.size()); + outImage.flush(); + delete buffer; + } + else + { + warn(g_fileName,doctokenizerYYlineno, + "Warning: could not write output image %s",outputFile.data()); + } + } + else + { + warn(g_fileName,doctokenizerYYlineno, + "Warning: could not open image %s",fileName); + } + + if (type==DocImage::Latex && Config_getBool("USE_PDFLATEX") && + fd->name().right(4)==".eps" + ) + { // we have an .eps image in pdflatex mode => convert it to a pdf. + QCString outputDir = Config_getString("LATEX_OUTPUT"); + QCString baseName = fd->name().left(fd->name().length()-4); + QCString epstopdfArgs(4096); + epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"", + outputDir.data(), baseName.data(), + outputDir.data(), baseName.data()); + if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) + { + err("Error: Problems running epstopdf. Check your TeX installation!\n"); + } + return baseName; + } + } + else if (ambig) + { + QCString text; + text.sprintf("Warning: image file name %s is ambigious.\n",fileName); + text+="Possible candidates:\n"; + text+=showFileDefMatches(Doxygen::imageNameDict,fileName); + warn(g_fileName,doctokenizerYYlineno,text); + } + else + { + result=fileName; + if (result.left(5)!="http:" && result.left(6)!="https:") + { + warn(g_fileName,doctokenizerYYlineno, + "Warning: image file %s is not found in IMAGE_PATH: " + "assuming external image.",fileName + ); + } + } + return result; +} + static void checkArgumentName(const QString &name,bool isParam) { if (g_memberDef==0) return; // not a member @@ -583,6 +683,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,TRUE)); int retval=handleStyleArgument(parent,children,tokenName); children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,FALSE)); + children.append(new DocWhiteSpace(parent," ")); if (retval==TK_NEWPARA) goto handlepara; } break; @@ -591,6 +692,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,TRUE)); int retval=handleStyleArgument(parent,children,tokenName); children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,FALSE)); + children.append(new DocWhiteSpace(parent," ")); if (retval==TK_NEWPARA) goto handlepara; } break; @@ -599,6 +701,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,TRUE)); int retval=handleStyleArgument(parent,children,tokenName); children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,FALSE)); + children.append(new DocWhiteSpace(parent," ")); if (retval==TK_NEWPARA) goto handlepara; } break; @@ -1406,6 +1509,10 @@ DocRef::DocRef(DocNode *parent,const QString &target) : m_file = compound->getOutputFileBase(); m_ref = compound->getReference(); } + else + { + err("%s:%d: Internal error: resolveLink successful but no compound found!\n",__FILE__,__LINE__); + } } else // oops, bogus target { @@ -1456,6 +1563,11 @@ DocLink::DocLink(DocNode *parent,const QString &target) : Definition *compound; PageInfo *page; QCString anchor; + m_refText = target; + if (!m_refText.isEmpty() && m_refText.at(0)=='#') + { + m_refText = m_refText.right(m_refText.length()-1); + } if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock, &compound,&page,anchor)) { @@ -1548,6 +1660,14 @@ QString DocLink::parse(bool isJavaLink) } endlink: + if (isJavaLink) + { + if (m_children.isEmpty()) // no link text + { + m_children.append(new DocWord(this,m_refText)); + } + } + handlePendingStyleCommands(this,m_children); DBG(("DocLink::parse() end\n")); DocNode *n=g_nodeStack.pop(); @@ -2671,7 +2791,7 @@ int DocParamList::parse(const QString &cmdName) } else if (m_type==DocParamSect::RetVal) { - g_hasParamCommand=TRUE; + //g_hasParamCommand=TRUE; checkArgumentName(g_token->name,FALSE); } m_params.append(g_token->name); @@ -2876,7 +2996,7 @@ void DocPara::handleImage(const QString &cmdName) return; } doctokenizerYYsetStatePara(); - DocImage *img = new DocImage(this,g_token->name,t); + DocImage *img = new DocImage(this,findAndCopyImage(g_token->name,t),t); m_children.append(img); img->parse(); } @@ -3043,16 +3163,19 @@ int DocPara::handleCommand(const QString &cmdName) m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,FALSE)); + m_children.append(new DocWhiteSpace(this," ")); break; case CMD_BOLD: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,FALSE)); + m_children.append(new DocWhiteSpace(this," ")); break; case CMD_CODE: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,FALSE)); + m_children.append(new DocWhiteSpace(this," ")); break; case CMD_BSLASH: m_children.append(new DocSymbol(this,DocSymbol::BSlash)); diff --git a/src/docparser.h b/src/docparser.h index 1a79812..1c78ada4 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -586,6 +586,7 @@ class DocLink : public CompAccept<DocLink>, public DocNode QString m_file; QString m_ref; QString m_anchor; + QString m_refText; }; /*! @brief Node representing a reference to some item */ diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 8874917..22b12e5 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1482,11 +1482,20 @@ static bool isVarWithConstructor(Entry *root) bool result=FALSE; bool typeIsClass; Definition *ctx = 0; + FileDef *fd = 0; + bool ambig; if (root->parent && root->parent->section&Entry::COMPOUND_MASK) { // inside a class result=FALSE; goto done; } + else if ((fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig)) && + fd->name().right(2)==".c" + ) + { // inside a .c file + result=FALSE; + goto done; + } if (root->type.isEmpty()) { result=FALSE; @@ -1534,7 +1543,7 @@ static bool isVarWithConstructor(Entry *root) //printf("resType=%s\n",resType.data()); if (resType=="int" || resType=="long" || resType=="float" || resType=="double" || resType=="char" || resType=="signed" || - resType=="const" || resType=="unsigned") + resType=="const" || resType=="unsigned" || resType=="void") { result=FALSE; // type keyword -> function prototype goto done; @@ -3450,9 +3459,11 @@ static void computeClassRelations() if ((cd==0 || (!cd->hasDocumentation() && !cd->isReference())) && bName.right(2)!="::") { - if (!root->name.isEmpty() && root->name[0]!='@' && - (guessSection(root->fileName)==Entry::HEADER_SEC || Config_getBool("EXTRACT_LOCAL_CLASSES")) && - (root->protection!=Private || Config_getBool("EXTRACT_PRIVATE")) + if (!root->name.isEmpty() && root->name[0]!='@' && // normal name + (guessSection(root->fileName)==Entry::HEADER_SEC || + Config_getBool("EXTRACT_LOCAL_CLASSES")) && // not defined in source file + (root->protection!=Private || Config_getBool("EXTRACT_PRIVATE")) && // hidden by protection + !Config_getBool("HIDE_UNDOC_CLASSES") // undocumented class are visible ) warn_undoc( root->fileName,root->startLine, @@ -7175,6 +7186,10 @@ void readConfiguration(int argc, char **argv) /* Set the global html file extension. */ Doxygen::htmlFileExtension = Config_getString("HTML_FILE_EXTENSION"); + /* Perlmod wants to know the path to the config file.*/ + QFileInfo configFileInfo(configName); + setPerlModDoxyfile(configFileInfo.absFilePath()); + /* init the special lists */ Doxygen::specialLists->setAutoDelete(TRUE); Doxygen::specialLists->insert("todo", diff --git a/src/entry.h b/src/entry.h index ba926d7..c619d48 100644 --- a/src/entry.h +++ b/src/entry.h @@ -133,14 +133,14 @@ struct Grouping { GROUPING_LOWEST, GROUPING_AUTO_WEAK = - GROUPING_LOWEST, //!< membership in group was defined via @weakgroup @{ @} - GROUPING_AUTO_ADD, //!< membership in group was defined via @add[to]group @{ @} - GROUPING_AUTO_DEF, //!< membership in group was defined via @defgroup @{ @} + GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup \@{ \@} + GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group \@{ \@} + GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup \@{ \@} GROUPING_AUTO_HIGHEST = - GROUPING_AUTO_DEF, - GROUPING_INGROUP, //!< membership in group was defined by @ingroup + GROUPING_AUTO_DEF, + GROUPING_INGROUP, //!< membership in group was defined by \@ingroup GROUPING_HIGHEST = - GROUPING_INGROUP + GROUPING_INGROUP }; static const char *getGroupPriName( GroupPri_t priority ) @@ -265,8 +265,8 @@ class Entry QList<ArgumentList> *tArgLists; //!< template argument declarations QCString program; //!< the program text QCString initializer; //!< initial value (for variables) - QCString includeFile; //!< include file (2 arg of \class, must be unique) - QCString includeName; //!< include name (3 arg of \class) + QCString includeFile; //!< include file (2 arg of \\class, must be unique) + QCString includeName; //!< include name (3 arg of \\class) QCString doc; //!< documentation block (partly parsed) int docLine; //!< line number at which the documentation was found QCString docFile; //!< file in which the documentation was found diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 3269aeb..b9ef2d6 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -133,25 +133,25 @@ void HtmlDocVisitor::visit(DocStyleChange *s) switch (s->style()) { case DocStyleChange::Bold: - if (s->enable()) m_t << "<b>"; else m_t << "</b> "; + if (s->enable()) m_t << "<b>"; else m_t << "</b>"; break; case DocStyleChange::Italic: - if (s->enable()) m_t << "<em>"; else m_t << "</em> "; + if (s->enable()) m_t << "<em>"; else m_t << "</em>"; break; case DocStyleChange::Code: - if (s->enable()) m_t << "<code>"; else m_t << "</code> "; + if (s->enable()) m_t << "<code>"; else m_t << "</code>"; break; case DocStyleChange::Subscript: - if (s->enable()) m_t << "<sub>"; else m_t << "</sub> "; + if (s->enable()) m_t << "<sub>"; else m_t << "</sub>"; break; case DocStyleChange::Superscript: - if (s->enable()) m_t << "<sup>"; else m_t << "</sup> "; + if (s->enable()) m_t << "<sup>"; else m_t << "</sup>"; break; case DocStyleChange::Center: - if (s->enable()) m_t << "<center>"; else m_t << "</center> "; + if (s->enable()) m_t << "<center>"; else m_t << "</center>"; break; case DocStyleChange::Small: - if (s->enable()) m_t << "<small>"; else m_t << "</small> "; + if (s->enable()) m_t << "<small>"; else m_t << "</small>"; break; } } diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 33fdf40..027c0d8 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -337,13 +337,13 @@ void HtmlHelp::initialize() s_languageDict.insert("dutch", new QCString("0x413 Dutch")); s_languageDict.insert("finnish", new QCString("0x40B Finnish")); s_languageDict.insert("french", new QCString("0x40C French")); - s_languageDict.insert("german", new QCString("0x40C German")); + s_languageDict.insert("german", new QCString("0x407 German")); s_languageDict.insert("greece", new QCString("0x408 Greece")); s_languageDict.insert("hungarian",new QCString("0x40E Hungarian")); s_languageDict.insert("italian", new QCString("0x410 Italian")); s_languageDict.insert("norwegian",new QCString("0x814 Norwegian")); - s_languageDict.insert("polish", new QCString("0x815 Polish")); - s_languageDict.insert("portugese",new QCString("0x815 Portuguese(Portugal)")); + s_languageDict.insert("polish", new QCString("0x415 Polish")); + s_languageDict.insert("portugese",new QCString("0x816 Portuguese(Portugal)")); s_languageDict.insert("brazil", new QCString("0x416 Portuguese(Brazil)")); s_languageDict.insert("russian", new QCString("0x419 Russian")); s_languageDict.insert("spanish", new QCString("0x40A Spannish(Traditional Sort)")); diff --git a/src/libdoxygen.t b/src/libdoxygen.t index 6b6b32e..ae86907 100644 --- a/src/libdoxygen.t +++ b/src/libdoxygen.t @@ -59,9 +59,6 @@ sub GenerateDep { #$ GenerateDep("defargs.cpp","defargs.l"); $(LEX) -PdefargsYY -t defargs.l >defargs.cpp -#$ GenerateDep("doc.cpp","doc.l"); - $(LEX) -PdocYY -t doc.l >doc.cpp - #$ GenerateDep("doctokenizer.cpp","doctokenizer.l"); $(LEX) -PdoctokenizerYY -t doctokenizer.l >doctokenizer.cpp diff --git a/src/outputgen.h b/src/outputgen.h index b82c0af..f25bd8b 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -90,17 +90,17 @@ class BaseOutputDocInterface : public BaseCodeDocInterface const QCString &,bool) {} virtual void parseText(const QCString &) {} - /*! Start of a bullet list: e.g. \c <ul> in html. writeListItem() is + /*! Start of a bullet list: e.g. \c \<ul\> in html. writeListItem() is * Used for the bullet items. */ virtual void startItemList() = 0; /*! Writes a list item for a bullet or enumerated - * list: e.g. \c <li> in html + * list: e.g. \c \<li\> in html */ virtual void writeListItem() = 0; - /*! Ends a bullet list: e.g. \c </ul> in html */ + /*! Ends a bullet list: e.g. \c \</ul\> in html */ virtual void endItemList() = 0; /*! Writes an ASCII string to the output. Converts characters that have @@ -184,19 +184,19 @@ class BaseOutputDocInterface : public BaseCodeDocInterface /*! Writes a horizontal ruler to the output */ virtual void writeRuler() = 0; - /*! Starts a description list: e.g. \c <dl> in HTML + /*! Starts a description list: e.g. \c \<dl\> in HTML * Items are surrounded by startDescItem() and endDescItem() */ virtual void startDescription() = 0; - /*! Ends a description list: e.g. \c </dl> in HTML */ + /*! Ends a description list: e.g. \c \</dl\> in HTML */ virtual void endDescription() = 0; - /*! Starts an item of a description list: e.g. \c <dt> in HTML. */ + /*! Starts an item of a description list: e.g. \c \<dt\> in HTML. */ virtual void startDescItem() = 0; /*! Ends an item of a description list and starts the - * description itself: e.g. \c <dd> in HTML. + * description itself: e.g. \c \<dd\> in HTML. */ virtual void endDescItem() = 0; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 377488b..596aa0b 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -102,9 +102,11 @@ class PerlModOutput { public: - PerlModOutput(PerlModOutputStream *os) : m_stream(os), m_indentation(0) { m_spaces[0] = 0; } + PerlModOutput() : m_stream(0), m_indentation(0) { m_spaces[0] = 0; } virtual ~PerlModOutput() { } + inline void setPerlModOutputStream(PerlModOutputStream *os) { m_stream = os; } + inline PerlModOutput &openSave() { iopenSave(); return *this; } inline PerlModOutput &closeSave(QString &s) { icloseSave(s); return *this; } @@ -479,8 +481,9 @@ void PerlModDocVisitor::visit(DocSymbol *sy) case DocSymbol::BSlash: s = "\\\\"; break; case DocSymbol::Copy: s = "(c)"; break; case DocSymbol::Apos: s = "\\\'"; break; - default: + case DocSymbol::Unknown: err("Error: unknown symbol found\n"); + break; } enterText(); if (c != 0) @@ -509,8 +512,6 @@ void PerlModDocVisitor::visit(DocStyleChange *s) case DocStyleChange::Superscript: break; // superscript case DocStyleChange::Center: break; // center case DocStyleChange::Small: break; // small - default: - err("Error: unknown style found.\n"); } } @@ -618,7 +619,7 @@ void PerlModDocVisitor::visitPre(DocAutoList *l) openItem(l->isEnumList() ? "ordered_list" : "itemized_list"); openSubBlock("content"); } -void PerlModDocVisitor::visitPost(DocAutoList *) { closeSubBlock(); } +void PerlModDocVisitor::visitPost(DocAutoList *) { closeSubBlock(); closeItem(); } void PerlModDocVisitor::visitPre(DocAutoListItem *) { openSubBlock(); } void PerlModDocVisitor::visitPost(DocAutoListItem *) { closeSubBlock(); } @@ -644,7 +645,7 @@ void PerlModDocVisitor::visitPost(DocRoot *) void PerlModDocVisitor::visitPre(DocSimpleSect *s) { leaveText(); - const char *type; + const char *type = 0; switch (s->type()) { case DocSimpleSect::See: type = "see"; break; @@ -662,7 +663,9 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Remark: type = "remark"; break; case DocSimpleSect::Attention: type = "attention"; break; case DocSimpleSect::User: type = "par"; break; - default: type = "illegal"; break; + case DocSimpleSect::Unknown: + err("Error: unknown simple section found\n"); + break; } m_output.openSave().openList(type); } @@ -995,7 +998,9 @@ void PerlModDocVisitor::visitPre(DocParamSect *s) case DocParamSect::Param: type = "params"; break; case DocParamSect::RetVal: type = "retvals"; break; case DocParamSect::Exception: type = "exceptions"; break; - default: ASSERT(0); + case DocParamSect::Unknown: + err("Error: unknown parameter section found\n"); + break; } m_output.openSave().openList(type); } @@ -1103,13 +1108,15 @@ static void addTemplateArgumentList(ArgumentList *al,PerlModOutput &output,const output.closeList(); } -//static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) -//{ -// ClassDef *cd = md->getClassDef(); -// const char *cname = cd ? cd->name().data() : 0; -// if (md->templateArguments()) // function template prefix -// addTemplateArgumentList(md->templateArguments(),output,cname); -//} +#if 0 +static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) +{ + ClassDef *cd = md->getClassDef(); + const char *cname = cd ? cd->name().data() : 0; + if (md->templateArguments()) // function template prefix + addTemplateArgumentList(md->templateArguments(),output,cname); +} +#endif static void addTemplateList(ClassDef *cd,PerlModOutput &output) { @@ -1161,7 +1168,59 @@ static const char *getVirtualnessName(Specifier virt) return 0; } -static void generatePerlModForMember(MemberDef *md,PerlModOutput &output,Definition *) +static QString pathDoxyfile; +static QString pathDoxyExec; + +void setPerlModDoxyfile(const QString &qs) +{ + pathDoxyfile = qs; + pathDoxyExec = QDir::currentDirPath(); +} + +class PerlModGenerator +{ +public: + + PerlModOutput output; + + QString pathDoxyModelPM; + QString pathDoxyDocsTex; + QString pathDoxyFormatTex; + QString pathDoxyLatexTex; + QString pathDoxyLatexDVI; + QString pathDoxyLatexPDF; + QString pathDoxyTemplateTex; + QString pathDoxyDocsPM; + QString pathDoxyLatexPL; + QString pathDoxyLatexTemplatePL; + QString pathDoxyRules; + QString pathMakefile; + + void generatePerlModForMember(MemberDef *md,Definition *); + void generatePerlModSection(Definition *d, + MemberList *ml,const char *name,const char *header=0); + void addListOfAllMembers(ClassDef *cd, PerlModOutput &output); + void generatePerlModForClass(ClassDef *cd, PerlModOutput &output); + void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output); + void generatePerlModForFile(FileDef *fd, PerlModOutput &output); + void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output); + void generatePerlModForPage(PageInfo *pi, PerlModOutput &output); + + bool createOutputFile(QFile &f, const char *s); + bool createOutputDir(QDir &perlModDir); + bool generateDoxyLatexTex(); + bool generateDoxyFormatTex(); + bool generateDoxyModelPM(); + bool generateDoxyLatexPL(); + bool generateDoxyLatexTemplatePL(); + bool generateDoxyRules(); + bool generateMakefile(); + bool generatePerlModOutput(); + + void generate(); +}; + +void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) { // + declaration/definition arg lists @@ -1184,7 +1243,6 @@ static void generatePerlModForMember(MemberDef *md,PerlModOutput &output,Definit case MemberDef::Define: memType="define"; break; case MemberDef::EnumValue: ASSERT(0); break; case MemberDef::Property: memType="property"; break; - case MemberDef::Event: memType="event"; break; case MemberDef::Variable: memType="variable"; break; case MemberDef::Typedef: memType="typedef"; break; case MemberDef::Enumeration: memType="enum"; break; @@ -1194,6 +1252,7 @@ static void generatePerlModForMember(MemberDef *md,PerlModOutput &output,Definit case MemberDef::Friend: memType="friend"; isFunc=TRUE; break; case MemberDef::DCOP: memType="dcop"; isFunc=TRUE; break; case MemberDef::Slot: memType="slot"; isFunc=TRUE; break; + case MemberDef::Event: memType="event"; break; } QCString scopeName; @@ -1324,8 +1383,8 @@ static void generatePerlModForMember(MemberDef *md,PerlModOutput &output,Definit output.closeHash(); } -static void generatePerlModSection(Definition *d,PerlModOutput &output, - MemberList *ml,const char *name,const char *header=0) +void PerlModGenerator::generatePerlModSection(Definition *d, + MemberList *ml,const char *name,const char *header) { if (ml->count()==0) return; // empty list @@ -1339,13 +1398,13 @@ static void generatePerlModSection(Definition *d,PerlModOutput &output, MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { - generatePerlModForMember(md,output,d); + generatePerlModForMember(md,d); } output.closeList() .closeHash(); } -static void addListOfAllMembers(ClassDef *cd, PerlModOutput &output) +void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output) { output.openList("all_members"); MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); @@ -1376,7 +1435,7 @@ static void addListOfAllMembers(ClassDef *cd, PerlModOutput &output) output.closeList(); } -static void generatePerlModForClass(ClassDef *cd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &output) { // + brief description // + detailed description @@ -1465,31 +1524,31 @@ static void generatePerlModForClass(ClassDef *cd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlModSection(cd,output,mg->members(),"user_defined",mg->header()); - - generatePerlModSection(cd,output,&cd->pubTypes,"public_typedefs"); - generatePerlModSection(cd,output,&cd->pubMethods,"public_methods"); - generatePerlModSection(cd,output,&cd->pubAttribs,"public_members"); - generatePerlModSection(cd,output,&cd->pubSlots,"public_slots"); - generatePerlModSection(cd,output,&cd->signals,"signals"); - generatePerlModSection(cd,output,&cd->dcopMethods,"dcop_methods"); - generatePerlModSection(cd,output,&cd->properties,"properties"); - generatePerlModSection(cd,output,&cd->pubStaticMethods,"public_static_methods"); - generatePerlModSection(cd,output,&cd->pubStaticAttribs,"public_static_members"); - generatePerlModSection(cd,output,&cd->proTypes,"protected_typedefs"); - generatePerlModSection(cd,output,&cd->proMethods,"protected_methods"); - generatePerlModSection(cd,output,&cd->proAttribs,"protected_members"); - generatePerlModSection(cd,output,&cd->proSlots,"protected_slots"); - generatePerlModSection(cd,output,&cd->proStaticMethods,"protected_static_methods"); - generatePerlModSection(cd,output,&cd->proStaticAttribs,"protected_static_members"); - generatePerlModSection(cd,output,&cd->priTypes,"private_typedefs"); - generatePerlModSection(cd,output,&cd->priMethods,"private_methods"); - generatePerlModSection(cd,output,&cd->priAttribs,"private_members"); - generatePerlModSection(cd,output,&cd->priSlots,"private_slots"); - generatePerlModSection(cd,output,&cd->priStaticMethods,"private_static_methods"); - generatePerlModSection(cd,output,&cd->priStaticAttribs,"private_static_members"); - generatePerlModSection(cd,output,&cd->friends,"friend_methods"); - generatePerlModSection(cd,output,&cd->related,"related_methods"); + generatePerlModSection(cd,mg->members(),"user_defined",mg->header()); + + generatePerlModSection(cd,&cd->pubTypes,"public_typedefs"); + generatePerlModSection(cd,&cd->pubMethods,"public_methods"); + generatePerlModSection(cd,&cd->pubAttribs,"public_members"); + generatePerlModSection(cd,&cd->pubSlots,"public_slots"); + generatePerlModSection(cd,&cd->signals,"signals"); + generatePerlModSection(cd,&cd->dcopMethods,"dcop_methods"); + generatePerlModSection(cd,&cd->properties,"properties"); + generatePerlModSection(cd,&cd->pubStaticMethods,"public_static_methods"); + generatePerlModSection(cd,&cd->pubStaticAttribs,"public_static_members"); + generatePerlModSection(cd,&cd->proTypes,"protected_typedefs"); + generatePerlModSection(cd,&cd->proMethods,"protected_methods"); + generatePerlModSection(cd,&cd->proAttribs,"protected_members"); + generatePerlModSection(cd,&cd->proSlots,"protected_slots"); + generatePerlModSection(cd,&cd->proStaticMethods,"protected_static_methods"); + generatePerlModSection(cd,&cd->proStaticAttribs,"protected_static_members"); + generatePerlModSection(cd,&cd->priTypes,"private_typedefs"); + generatePerlModSection(cd,&cd->priMethods,"private_methods"); + generatePerlModSection(cd,&cd->priAttribs,"private_members"); + generatePerlModSection(cd,&cd->priSlots,"private_slots"); + generatePerlModSection(cd,&cd->priStaticMethods,"private_static_methods"); + generatePerlModSection(cd,&cd->priStaticAttribs,"private_static_members"); + generatePerlModSection(cd,&cd->friends,"friend_methods"); + generatePerlModSection(cd,&cd->related,"related_methods"); addPerlModDocBlock(output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription()); addPerlModDocBlock(output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation()); @@ -1523,7 +1582,7 @@ static void generatePerlModForClass(ClassDef *cd, PerlModOutput &output) output.closeHash(); } -static void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) { // + contained class definitions // + contained namespace definitions @@ -1568,14 +1627,14 @@ static void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlModSection(nd,output,mg->members(),"user-defined",mg->header()); + generatePerlModSection(nd,mg->members(),"user-defined",mg->header()); - generatePerlModSection(nd,output,&nd->decDefineMembers,"defines"); - generatePerlModSection(nd,output,&nd->decProtoMembers,"prototypes"); - generatePerlModSection(nd,output,&nd->decTypedefMembers,"typedefs"); - generatePerlModSection(nd,output,&nd->decEnumMembers,"enums"); - generatePerlModSection(nd,output,&nd->decFuncMembers,"functions"); - generatePerlModSection(nd,output,&nd->decVarMembers,"variables"); + generatePerlModSection(nd,&nd->decDefineMembers,"defines"); + generatePerlModSection(nd,&nd->decProtoMembers,"prototypes"); + generatePerlModSection(nd,&nd->decTypedefMembers,"typedefs"); + generatePerlModSection(nd,&nd->decEnumMembers,"enums"); + generatePerlModSection(nd,&nd->decFuncMembers,"functions"); + generatePerlModSection(nd,&nd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription()); addPerlModDocBlock(output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation()); @@ -1583,7 +1642,7 @@ static void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) output.closeHash(); } -static void generatePerlModForFile(FileDef *fd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output) { // + includes files // + includedby files @@ -1633,12 +1692,12 @@ static void generatePerlModForFile(FileDef *fd, PerlModOutput &output) } output.closeList(); - generatePerlModSection(fd,output,&fd->decDefineMembers,"defines"); - generatePerlModSection(fd,output,&fd->decProtoMembers,"prototypes"); - generatePerlModSection(fd,output,&fd->decTypedefMembers,"typedefs"); - generatePerlModSection(fd,output,&fd->decEnumMembers,"enums"); - generatePerlModSection(fd,output,&fd->decFuncMembers,"functions"); - generatePerlModSection(fd,output,&fd->decVarMembers,"variables"); + generatePerlModSection(fd,&fd->decDefineMembers,"defines"); + generatePerlModSection(fd,&fd->decProtoMembers,"prototypes"); + generatePerlModSection(fd,&fd->decTypedefMembers,"typedefs"); + generatePerlModSection(fd,&fd->decEnumMembers,"enums"); + generatePerlModSection(fd,&fd->decFuncMembers,"functions"); + generatePerlModSection(fd,&fd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); addPerlModDocBlock(output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); @@ -1646,7 +1705,7 @@ static void generatePerlModForFile(FileDef *fd, PerlModOutput &output) output.closeHash(); } -static void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) { // + members // + member groups @@ -1734,14 +1793,14 @@ static void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlModSection(gd,output,mg->members(),"user-defined",mg->header()); + generatePerlModSection(gd,mg->members(),"user-defined",mg->header()); - generatePerlModSection(gd,output,&gd->decDefineMembers,"defines"); - generatePerlModSection(gd,output,&gd->decProtoMembers,"prototypes"); - generatePerlModSection(gd,output,&gd->decTypedefMembers,"typedefs"); - generatePerlModSection(gd,output,&gd->decEnumMembers,"enums"); - generatePerlModSection(gd,output,&gd->decFuncMembers,"functions"); - generatePerlModSection(gd,output,&gd->decVarMembers,"variables"); + generatePerlModSection(gd,&gd->decDefineMembers,"defines"); + generatePerlModSection(gd,&gd->decProtoMembers,"prototypes"); + generatePerlModSection(gd,&gd->decTypedefMembers,"typedefs"); + generatePerlModSection(gd,&gd->decEnumMembers,"enums"); + generatePerlModSection(gd,&gd->decFuncMembers,"functions"); + generatePerlModSection(gd,&gd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription()); addPerlModDocBlock(output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation()); @@ -1749,7 +1808,7 @@ static void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) output.closeHash(); } -static void generatePerlModForPage(PageInfo *pi, PerlModOutput &output) +void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &output) { // + name // + title @@ -1767,16 +1826,76 @@ static void generatePerlModForPage(PageInfo *pi, PerlModOutput &output) addPerlModDocBlock(output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc); } -void generatePerlMod() +bool PerlModGenerator::generatePerlModOutput() { - // + classes - // + namespaces - // + files - // - packages - // + groups - // + related pages - // - examples + QFile outputFile; + if (!createOutputFile(outputFile, pathDoxyDocsPM)) + return false; + + QTextStream outputTextStream(&outputFile); + PerlModOutputStream outputStream(&outputTextStream); + output.setPerlModOutputStream(&outputStream); + output.add("$doxydocs =\n").openHash(); + + output.openList("classes"); + ClassSDict::Iterator cli(Doxygen::classSDict); + ClassDef *cd; + for (cli.toFirst();(cd=cli.current());++cli) + generatePerlModForClass(cd,output); + output.closeList(); + + output.openList("namespaces"); + NamespaceSDict::Iterator nli(Doxygen::namespaceSDict); + NamespaceDef *nd; + for (nli.toFirst();(nd=nli.current());++nli) + generatePerlModForNamespace(nd,output); + output.closeList(); + + output.openList("files"); + FileNameListIterator fnli(Doxygen::inputNameList); + FileName *fn; + for (;(fn=fnli.current());++fnli) + { + FileNameIterator fni(*fn); + FileDef *fd; + for (;(fd=fni.current());++fni) + generatePerlModForFile(fd,output); + } + output.closeList(); + + output.openList("groups"); + GroupSDict::Iterator gli(Doxygen::groupSDict); + GroupDef *gd; + for (;(gd=gli.current());++gli) + generatePerlModForGroup(gd,output); + output.closeList(); + + output.openList("pages"); + PageSDict::Iterator pdi(*Doxygen::pageSDict); + PageInfo *pi=0; + for (pdi.toFirst();(pi=pdi.current());++pdi) + generatePerlModForPage(pi,output); + if (Doxygen::mainPage) + generatePerlModForPage(Doxygen::mainPage,output); + output.closeList(); + + output.closeHash().add(";\n1;\n"); + return true; +} + +bool PerlModGenerator::createOutputFile(QFile &f, const char *s) +{ + f.setName(s); + if (!f.open(IO_WriteOnly)) + { + err("Cannot open file %s for writing!\n", s); + return false; + } + return true; +} +bool PerlModGenerator::createOutputDir(QDir &perlModDir) +{ QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY"); if (outputDirectory.isEmpty()) { @@ -1811,75 +1930,620 @@ void generatePerlMod() if (!dir.mkdir(outputDirectory)) { err("Cannot create directory %s\n",outputDirectory.data()); - return; + return false; } } - QDir perlmodDir(outputDirectory+"/perlmod"); - if (!perlmodDir.exists() && !perlmodDir.mkdir(outputDirectory+"/perlmod")) + perlModDir.setPath(outputDirectory+"/perlmod"); + if (!perlModDir.exists() && !perlModDir.mkdir(outputDirectory+"/perlmod")) { err("Could not create perlmod directory in %s\n",outputDirectory.data()); - return; + return false; + } + return true; +} + +bool PerlModGenerator::generateDoxyModelPM() +{ + QFile doxyModelPM; + if (!createOutputFile(doxyModelPM, pathDoxyModelPM)) + return false; + + QTextStream doxyModelPMStream(&doxyModelPM); + doxyModelPMStream << + "sub memberlist($) {\n" + " my $prefix = $_[0];\n" + " return\n" + "\t[ \"hash\", $prefix . \"s\",\n" + "\t {\n" + "\t members =>\n" + "\t [ \"list\", $prefix . \"List\",\n" + "\t\t[ \"hash\", $prefix,\n" + "\t\t {\n" + "\t\t kind => [ \"string\", $prefix . \"Kind\" ],\n" + "\t\t name => [ \"string\", $prefix . \"Name\" ],\n" + "\t\t static => [ \"string\", $prefix . \"Static\" ],\n" + "\t\t virtualness => [ \"string\", $prefix . \"Virtualness\" ],\n" + "\t\t protection => [ \"string\", $prefix . \"Protection\" ],\n" + "\t\t type => [ \"string\", $prefix . \"Type\" ],\n" + "\t\t parameters =>\n" + "\t\t [ \"list\", $prefix . \"Params\",\n" + "\t\t\t[ \"hash\", $prefix . \"Param\",\n" + "\t\t\t {\n" + "\t\t\t declaration_name => [ \"string\", $prefix . \"ParamName\" ],\n" + "\t\t\t type => [ \"string\", $prefix . \"ParamType\" ],\n" + "\t\t\t },\n" + "\t\t\t],\n" + "\t\t ],\n" + "\t\t detailed =>\n" + "\t\t [ \"hash\", $prefix . \"Detailed\",\n" + "\t\t\t{\n" + "\t\t\t doc => [ \"doc\", $prefix . \"DetailedDoc\" ],\n" + "\t\t\t return => [ \"doc\", $prefix . \"Return\" ],\n" + "\t\t\t see => [ \"doc\", $prefix . \"See\" ],\n" + "\t\t\t params =>\n" + "\t\t\t [ \"list\", $prefix . \"PDBlocks\",\n" + "\t\t\t [ \"hash\", $prefix . \"PDBlock\",\n" + "\t\t\t\t{\n" + "\t\t\t\t parameters =>\n" + "\t\t\t\t [ \"list\", $prefix . \"PDParams\",\n" + "\t\t\t\t [ \"hash\", $prefix . \"PDParam\",\n" + "\t\t\t\t\t{\n" + "\t\t\t\t\t name => [ \"string\", $prefix . \"PDParamName\" ],\n" + "\t\t\t\t\t},\n" + "\t\t\t\t ],\n" + "\t\t\t\t ],\n" + "\t\t\t\t doc => [ \"doc\", $prefix . \"PDDoc\" ],\n" + "\t\t\t\t},\n" + "\t\t\t ],\n" + "\t\t\t ],\n" + "\t\t\t},\n" + "\t\t ],\n" + "\t\t },\n" + "\t\t],\n" + "\t ],\n" + "\t },\n" + "\t];\n" + "}\n" + "\n" + "$doxymodel =\n" + " [ \"hash\", \"Root\",\n" + " {\n" + "\tfiles =>\n" + "\t [ \"list\", \"Files\",\n" + "\t [ \"hash\", \"File\",\n" + "\t {\n" + "\t\tname => [ \"string\", \"FileName\" ],\n" + "\t\ttypedefs => memberlist(\"FileTypedef\"),\n" + "\t\tvariables => memberlist(\"FileVariable\"),\n" + "\t\tfunctions => memberlist(\"FileFunction\"),\n" + "\t\tdetailed =>\n" + "\t\t [ \"hash\", \"FileDetailed\",\n" + "\t\t {\n" + "\t\t doc => [ \"doc\", \"FileDetailedDoc\" ],\n" + "\t\t },\n" + "\t\t ],\n" + "\t },\n" + "\t ],\n" + "\t ],\n" + "\tclasses =>\n" + "\t [ \"list\", \"Classes\",\n" + "\t [ \"hash\", \"Class\",\n" + "\t {\n" + "\t\tname => [ \"string\", \"ClassName\" ],\n" + "\t\tpublic_typedefs => memberlist(\"ClassPublicTypedef\"),\n" + "\t\tpublic_methods => memberlist(\"ClassPublicMethod\"),\n" + "\t\tpublic_members => memberlist(\"ClassPublicMember\"),\n" + "\t\tprotected_typedefs => memberlist(\"ClassProtectedTypedef\"),\n" + "\t\tprotected_methods => memberlist(\"ClassProtectedMethod\"),\n" + "\t\tprotected_members => memberlist(\"ClassProtectedMember\"),\n" + "\t\tprivate_typedefs => memberlist(\"ClassPrivateTypedef\"),\n" + "\t\tprivate_methods => memberlist(\"ClassPrivateMethod\"),\n" + "\t\tprivate_members => memberlist(\"ClassPrivateMember\"),\n" + "\t\tdetailed =>\n" + "\t\t [ \"hash\", \"ClassDetailed\",\n" + "\t\t {\n" + "\t\t doc => [ \"doc\", \"ClassDetailedDoc\" ],\n" + " \t\t },\n" + "\t\t ],\n" + "\t },\n" + "\t ],\n" + "\t ],\n" + " },\n" + " ];\n" + "\n" + "1;\n"; + + return true; +} + +bool PerlModGenerator::generateDoxyRules() +{ + QFile doxyRules; + if (!createOutputFile(doxyRules, pathDoxyRules)) + return false; + + bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); + + QTextStream doxyRulesStream(&doxyRules); + doxyRulesStream << + "DOXYEXECPATH = " << pathDoxyExec << "\n" + "DOXYFILE = " << pathDoxyfile << "\n" + "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" + "DOXYMODEL_PM = " << pathDoxyModelPM << "\n" + "DOXYRULES = " << pathDoxyRules << "\n"; + if (perlmodLatex) + doxyRulesStream << + "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" + "DOXYLATEXTEMPLATE_PL = " << pathDoxyLatexTemplatePL << "\n" + "DOXYTEMPLATE_TEX = " << pathDoxyTemplateTex << "\n" + "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" + "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" + "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" + "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" + "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n"; + + doxyRulesStream << + "\n" + ".PHONY: clean-perlmod\n" + "clean-perlmod:\n" + "\trm -f $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; + if (perlmodLatex) + doxyRulesStream << + " \\\n" + "\t$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" + "\t$(DOXYDOCS_TEX) $(DOXYTEMPLATE_TEX) \\\n" + "\t$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX) \\\n" + "\t$(DOXYLATEX_PDF) $(DOXYLATEX_DVI) \\\n" + "\t$(addprefix $(DOXYLATEX_TEX:tex=),out aux log)"; + doxyRulesStream << "\n\n"; + + doxyRulesStream << + "$(DOXYRULES) $(DOXYMAKEFILE) $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; + if (perlmodLatex) { + doxyRulesStream << + " \\\n" + "$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" + "$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX)"; + } + doxyRulesStream << + ": $(DOXYFILE)\n" + "\tcd $(DOXYEXECPATH) ; doxygen \"$<\"\n"; + + if (perlmodLatex) { + doxyRulesStream << + "\n" + "$(DOXYDOCS_TEX): $(DOXYLATEX_PL) $(DOXYDOCS_PM)\n" + "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" + "\n" + "$(DOXYTEMPLATE_TEX): $(DOXYLATEXTEMPLATE_PL) $(DOXYMODEL_PM)\n" + "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" + "\n" + "$(DOXYLATEX_PDF) $(DOXYLATEX_DVI): $(DOXYLATEX_TEX) $(DOXYFORMAT_TEX) $(DOXYTEMPLATE_TEX) $(DOXYDOCS_TEX)\n" + "\n" + "$(DOXYLATEX_PDF): $(DOXYLATEX_TEX)\n" + "\tpdflatex -interaction=nonstopmode \"$<\"\n" + "\n" + "$(DOXYLATEX_DVI): $(DOXYLATEX_TEX)\n" + "\tlatex -interaction=nonstopmode \"$<\"\n"; } - QCString fileName=outputDirectory+"/perlmod/DoxyDocs.pm"; - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; + return true; +} + +bool PerlModGenerator::generateMakefile() +{ + QFile makefile; + if (!createOutputFile(makefile, pathMakefile)) + return false; + + bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); + + QTextStream makefileStream(&makefile); + makefileStream << + ".PHONY: default clean" << (perlmodLatex ? " pdf" : "") << "\n" + "default: " << (perlmodLatex ? "pdf" : "clean") << "\n" + "\n" + "include " << pathDoxyRules << "\n" + "\n" + "clean: clean-perlmod\n"; + + if (perlmodLatex) { + makefileStream << + "pdf: $(DOXYLATEX_PDF)\n" + "dvi: $(DOXYLATEX_DVI)\n"; } - - QTextStream t(&f); - PerlModOutputStream os(&t); - PerlModOutput output(&os); - output.add("$doxydocs =\n").openHash(); - - output.openList("classes"); - ClassSDict::Iterator cli(Doxygen::classSDict); - ClassDef *cd; - for (cli.toFirst();(cd=cli.current());++cli) - generatePerlModForClass(cd,output); - output.closeList(); - output.openList("namespaces"); - NamespaceSDict::Iterator nli(Doxygen::namespaceSDict); - NamespaceDef *nd; - for (nli.toFirst();(nd=nli.current());++nli) - generatePerlModForNamespace(nd,output); - output.closeList(); + return true; +} + +bool PerlModGenerator::generateDoxyLatexTemplatePL() +{ + QFile doxyLatexTemplatePL; + if (!createOutputFile(doxyLatexTemplatePL, pathDoxyLatexTemplatePL)) + return false; + + QTextStream doxyLatexTemplatePLStream(&doxyLatexTemplatePL); + doxyLatexTemplatePLStream << + "use DoxyModel;\n" + "\n" + "sub template($) {\n" + "\tmy $model = $_[0];\n" + "\tmy ($type, $name) = @$model[0, 1];\n" + "\tif ($type eq \"string\") {\n" + "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" + "\t} elsif ($type eq \"doc\") {\n" + "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" + "\t} elsif ($type eq \"hash\") {\n" + "\t\tmy ($key, $value);\n" + "\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" + "\t\t\tmy $subname = $$submodel[1];\n" + "\t\t\tprint \"\\\\def\\\\\" . $subname . \"Empty{}%\\n\";\n" + "\t\t\tprint \"\\\\def\\\\field\" . $subname . \"Empty{\\\\\" . $subname . \"Empty}%\\n\";\n" + "\t\t\ttemplate($submodel);\n" + "\t\t}\n" + "\t\tprint \"\\\\def\\\\\" . $name . \"{}%\\n\";\n" + "\t} elsif ($type eq \"list\") {\n" + "\t\ttemplate($$model[2]);\n" + "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" + "\t\tprint \"\\\\def\\\\\" . $name . \"Sep{}%\\n\";\n" + "\t}\n" + "}\n" + "\n" + "template($doxymodel);\n"; + + return true; +} + +bool PerlModGenerator::generateDoxyLatexPL() +{ + QFile doxyLatexPL; + if (!createOutputFile(doxyLatexPL, pathDoxyLatexPL)) + return false; + + QTextStream doxyLatexPLStream(&doxyLatexPL); + doxyLatexPLStream << + "use DoxyModel;\n" + "use DoxyDocs;\n" + "\n" + "sub latex_quote($) {\n" + "\tmy $text = $_[0];\n" + "\t$text =~ s/\\\\/\\\\textbackslash /g;\n" + "\t$text =~ s/~/\\\\textasciitilde /g;\n" + "\t$text =~ s/</\\\\textasciiless /g;\n" + "\t$text =~ s/>/\\\\textasciigreater /g;\n" + "\t$text =~ s/\\\\^/\\\\textasciicircum /g;\n" + "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n" + "\tprint $text;\n" + "}\n" + "\n" + "sub generate_doc($) {\n" + "\tmy $doc = $_[0];\n" + "\tfor my $item (@$doc) {\n" + "\t\tmy $type = $$item{type};\n" + "\t\tif ($type eq \"text\") {\n" + "\t\t\tlatex_quote($$item{content});\n" + "\t\t} elsif ($type eq \"para\") {\n" + "\t\t\tgenerate_doc($$item{content});\n" + "#\t\t\tprint \"\\\\par\\n\";\n" + "\t\t} elsif ($type eq \"bold\") {\n" + "\t\t\tprint \"\\\\textbf{\";\n" + "\t\t\tgenerate_doc($$item{content});\n" + "\t\t\tprint \"}\";\n" + "\t\t} elsif ($type eq \"emphasis\") {\n" + "\t\t\tprint \"\\\\textit{\";\n" + "\t\t\tgenerate_doc($$item{content});\n" + "\t\t\tprint \"}\";\n" + "\t\t} elsif ($type eq \"url\") {\n" + "\t\t\tlatex_quote($$item{content});\n" + "\t\t}\n" + "\t}\n" + "}\n" + "\n" + "sub generate($$) {\n" + "\tmy ($item, $model) = @_;\n" + "\tmy ($type, $name) = @$model[0, 1];\n" + "\tif ($type eq \"string\") {\n" + "\t\tprint \"\\\\\" . $name . \"{\";\n" + "\t\tlatex_quote($item);\n" + "\t\tprint \"}\";\n" + "\t} elsif ($type eq \"doc\") {\n" + "\t\tif (@$item) {\n" + "\t\t\tprint \"\\\\\" . $name . \"{\";\n" + "\t\t\tgenerate_doc($item);\n" + "\t\t\tprint \"}%\\n\";\n" + "\t\t} else {\n" + "\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" + "\t\t}\n" + "\t} elsif ($type eq \"hash\") {\n" + "\t\tmy ($key, $value);\n" + "\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" + "\t\t\tmy $subname = $$submodel[1];\n" + "\t\t\tprint \"\\\\def\\\\field\" . $subname . \"{\";\n" + "\t\t\tif ($$item{$key}) {\n" + "\t\t\t\tgenerate($$item{$key}, $submodel);\n" + "\t\t\t} else {\n" + "\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n" + "\t\t\t}\n" + "\t\t\tprint \"}%\\n\";\n" + "\t\t}\n" + "\t\tprint \"\\\\\" . $name . \"%\\n\";\n" + "\t} elsif ($type eq \"list\") {\n" + "\t\tmy $index = 0;\n" + "\t\tif (@$item) {\n" + "\t\t\tprint \"\\\\\" . $name . \"{%\\n\";\n" + "\t\t\tfor my $subitem (@$item) {\n" + "\t\t\t\tif ($index) {\n" + "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n" + "\t\t\t\t}\n" + "\t\t\t\tgenerate($subitem, $$model[2]);\n" + "\t\t\t\t$index++;\n" + "\t\t\t}\n" + "\t\t\tprint \"}%\\n\";\n" + "\t\t} else {\n" + "\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" + "\t\t}\n" + "\t}\n" + "}\n" + "\n" + "generate($doxydocs, $doxymodel);\n"; + + return true; +} + +bool PerlModGenerator::generateDoxyFormatTex() +{ + QFile doxyFormatTex; + if (!createOutputFile(doxyFormatTex, pathDoxyFormatTex)) + return false; + + QTextStream doxyFormatTexStream(&doxyFormatTex); + doxyFormatTexStream << + "\\input{" << pathDoxyTemplateTex << "}\n" + "\n" + "\\newbox\\BoxA\n" + "\\dimendef\\DimenA=151\\relax\n" + "\\dimendef\\DimenB=152\\relax\n" + "\\countdef\\ZoneDepth=151\\relax\n" + "\n" + "\\def\\Ifxcscs#1#2{%\n" + "\\expandafter\\let\\expandafter\\Ifxcscsa\\csname#1\\endcsname%\n" + "\\expandafter\\let\\expandafter\\Ifxcscsb\\csname#2\\endcsname%\n" + "\\ifx\\Ifxcscsa\\Ifxcscsb}%\n" + "\n" + "\\def\\Cs#1{\\csname#1\\endcsname}%\n" + "\\def\\Defcs#1{\\expandafter\\def\\csname#1\\endcsname}%\n" + "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}%\n" + "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}%\n" + "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}%\n" + "\n" + "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax%\n" + "\\raggedright#1\\vskip 0.5mm\\relax} }}%\n" + "\n" + "\\def\\Zone#1#2#3{%\n" + "\\Defcs{#1}{\n" + "\\advance\\ZoneDepth1\\relax%\n" + "\\Letcs{Mode\\number\\ZoneDepth}0%\n" + "\\Letcs{Present\\number\\ZoneDepth}0%\n" + "#2%\n" + "\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n" + "\\advance\\ZoneDepth-1\\relax%\n" + "\\Letcs{Present\\number\\ZoneDepth}1%\n" + "\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n" + "\\advance\\ZoneDepth1\\relax%\n" + "\\Letcs{Mode\\number\\ZoneDepth}1%\n" + "#3%\n" + "\\advance\\ZoneDepth-1\\relax\\fi%\n" + "\\advance\\ZoneDepth1\\relax\\fi%\n" + "\\advance\\ZoneDepth-1\\relax}}%\n" + "\n" + "\\def\\Member#1#2{%\n" + "\\Defcs{Test#1}{\\Cs{field#1Detailed}%\n" + "\\Ifxcscs{field#1DetailedDoc}{field#1DetailedDocEmpty}\\else\\Letcs{Present#1}1\\fi}\n" + "\\Defcs{#1}{\\Letcs{Present#1}0%\n" + "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1%\n" + "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}%\n" + "%\n" + "\\def\\TypedefMemberList#1#2{%\n" + "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" + "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" + "\\Defcs{#1See}##1{\\See{##1}}%\n" + "%\n" + "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" + "\\Member{#1}{\\Frame{typedef \\Cs{field#1Type} \\Cs{field#1Name}}%\n" + "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n" + "\n" + "\\def\\VariableMemberList#1#2{%\n" + "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" + "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" + "\\Defcs{#1See}##1{\\See{##1}}%\n" + "%\n" + "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" + "\\Member{#1}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}}%\n" + "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n" + "\n" + "\\def\\FunctionMemberList#1#2{%\n" + "\\Defcs{#1PDParamName}##1{\\textit{##1}}%\n" + "\\Defcs{#1PDParam}{\\Cs{field#1PDParamName}}%\n" + "\\Defcs{#1PDParamsSep}{, }%\n" + "\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n" + "%\n" + "\\Defcs{#1PDBlocks}##1{%\n" + "\\Heading{Parameters:}\\vskip 1.5mm\\relax%\n" + "\\DimenA0pt\\relax%\n" + "\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n" + "\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n" + "##1%\n" + "\\advance\\DimenA3mm\\relax\n" + "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax%\n" + "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax%\n" + "\\Cs{field#1PDParams}}\\hfill%\n" + "\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n" + "##1}%\n" + "%\n" + "\\Defcs{#1ParamName}##1{\\textit{##1}}%\n" + "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}%\n" + "\\Defcs{#1ParamsSep}{, }%\n" + "%\n" + "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" + "\\Defcs{#1See}##1{\\See{##1}}%\n" + "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}%\n" + "\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n" + "%\n" + "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" + "\\Member{#1}{\n" + "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}%\n" + "\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n" + "\n" + "\\TypedefMemberList{FileTypedef}{Typedefs}%\n" + "\\VariableMemberList{FileVariable}{Variables}%\n" + "\\FunctionMemberList{FileFunction}{Functions}%\n" + "\n" + "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}%\n" + "\n" + "\\def\\TestFile{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}%\n" + "\\Zone{File}{\\TestFile}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\TestFile}%\n" + "\n" + "\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n" + "\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n" + "\\TypedefMemberList{ClassPrivateTypedef}{Private Typedefs}\n" + "\\VariableMemberList{ClassPublicMember}{Public Members}\n" + "\\VariableMemberList{ClassProtectedMember}{Protected Members}\n" + "\\VariableMemberList{ClassPrivateMember}{Private Members}\n" + "\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n" + "\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n" + "\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n" + "\n" + "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}%\n" + "\n" + "\\def\\TestClass{%\n" + "\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods%\n" + "\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods%\n" + "\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}%\n" + "\n" + "\\Zone{Class}{\\TestClass}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\TestClass}%\n" + "\n" + "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}%\n" + "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}%\n" + "\n" + "\\newlength{\\oldparskip}%\n" + "\\newlength{\\oldparindent}%\n" + "\\newlength{\\oldfboxrule}%\n" + "\n" + "\\ZoneDepth0%\n" + "\\Letcs{Mode0}1%\n" + "\n" + "\\def\\EmitDoxyDocs{%\n" + "\\setlength{\\oldparskip}{\\parskip}%\n" + "\\setlength{\\oldparindent}{\\parindent}%\n" + "\\setlength{\\oldfboxrule}{\\fboxrule}%\n" + "\\setlength{\\parskip}{0cm}%\n" + "\\setlength{\\parindent}{0cm}%\n" + "\\setlength{\\fboxrule}{1pt}%\n" + "\\AllFiles\\AllClasses%\n" + "\\setlength{\\parskip}{\\oldparskip}%\n" + "\\setlength{\\parindent}{\\oldparindent}%\n" + "\\setlength{\\fboxrule}{\\oldfboxrule}}\n"; + + return true; +} + +bool PerlModGenerator::generateDoxyLatexTex() +{ + QFile doxyLatexTex; + if (!createOutputFile(doxyLatexTex, pathDoxyLatexTex)) + return false; + + QTextStream doxyLatexTexStream(&doxyLatexTex); + doxyLatexTexStream << + "\\documentclass[a4paper,12pt]{article}\n" + "\\usepackage[latin1]{inputenc}\n" + "\\usepackage[none]{hyphenat}\n" + "\\usepackage[T1]{fontenc}\n" + "\\usepackage{hyperref}\n" + "\\usepackage{times}\n" + "\n" + "\\input{doxyformat}\n" + "\n" + "\\begin{document}\n" + "\\input{" << pathDoxyDocsTex << "}\n" + "\\EmitDoxyDocs\n" + "\\end{document}\n"; + + return true; +} + +void PerlModGenerator::generate() +{ + // + classes + // + namespaces + // + files + // - packages + // + groups + // + related pages + // - examples - output.openList("files"); - FileNameListIterator fnli(Doxygen::inputNameList); - FileName *fn; - for (;(fn=fnli.current());++fnli) - { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) - generatePerlModForFile(fd,output); + QDir perlModDir; + if (!createOutputDir(perlModDir)) + return; + + bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); + + pathDoxyDocsPM = perlModDir.absPath() + "/DoxyDocs.pm"; + pathDoxyModelPM = perlModDir.absPath() + "/DoxyModel.pm"; + pathMakefile = perlModDir.absPath() + "/Makefile"; + pathDoxyRules = perlModDir.absPath() + "/doxyrules.make"; + + if (perlmodLatex) { + pathDoxyTemplateTex = perlModDir.absPath() + "/doxytemplate.tex"; + pathDoxyFormatTex = perlModDir.absPath() + "/doxyformat.tex"; + pathDoxyLatexTex = perlModDir.absPath() + "/doxylatex.tex"; + pathDoxyLatexDVI = perlModDir.absPath() + "/doxylatex.dvi"; + pathDoxyLatexPDF = perlModDir.absPath() + "/doxylatex.pdf"; + pathDoxyDocsTex = perlModDir.absPath() + "/doxydocs.tex"; + pathDoxyLatexPL = perlModDir.absPath() + "/doxylatex.pl"; + pathDoxyLatexTemplatePL = perlModDir.absPath() + "/doxylatex-template.pl"; } - output.closeList(); - output.openList("groups"); - GroupSDict::Iterator gli(Doxygen::groupSDict); - GroupDef *gd; - for (;(gd=gli.current());++gli) - generatePerlModForGroup(gd,output); - output.closeList(); + if (!(generatePerlModOutput() + && generateDoxyModelPM() + && generateMakefile() + && generateDoxyRules())) + return; - output.openList("pages"); - PageSDict::Iterator pdi(*Doxygen::pageSDict); - PageInfo *pi=0; - for (pdi.toFirst();(pi=pdi.current());++pdi) - generatePerlModForPage(pi,output); - if (Doxygen::mainPage) - generatePerlModForPage(Doxygen::mainPage,output); - output.closeList(); + if (perlmodLatex) { + if (!(generateDoxyLatexTemplatePL() + && generateDoxyLatexPL() + && generateDoxyLatexTex() + && generateDoxyFormatTex())) + return; + } +} - output.closeHash().add(";\n1;\n"); +void generatePerlMod() +{ + PerlModGenerator pmg; + pmg.generate(); } // Local Variables: // c-basic-offset: 2 // End: + +/* This elisp function for XEmacs makes Control-Z transform + the text in the region into a valid C string. + + (global-set-key '(control z) (lambda () (interactive) + (save-excursion + (if (< (mark) (point)) (exchange-point-and-mark)) + (let ((start (point)) (replacers + '(("\\\\" "\\\\\\\\") + ("\"" "\\\\\"") + ("\t" "\\\\t") + ("^.*$" "\"\\&\\\\n\"")))) + (while replacers + (while (re-search-forward (caar replacers) (mark) t) + (replace-match (cadar replacers) t)) + (goto-char start) + (setq replacers (cdr replacers))))))) +*/ diff --git a/src/perlmodgen.h b/src/perlmodgen.h index a60042b..ec8c623 100644 --- a/src/perlmodgen.h +++ b/src/perlmodgen.h @@ -15,6 +15,9 @@ #ifndef PERLMODGEN_H #define PERLMODGEN_H -void generatePerlMod(); +class QString; + +extern void setPerlModDoxyfile(const QString &); +extern void generatePerlMod(); #endif diff --git a/src/translator_es.h b/src/translator_es.h index f5b5d72..41b5acd 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -138,7 +138,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7 // 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). + * compounds or files (see the \\group command). */ virtual QCString trModules() { return "Módulos"; } diff --git a/src/translator_fr.h b/src/translator_fr.h index 79645eb..c956de5 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -39,6 +39,8 @@ * -------------+------------------------------------------------------------ * 2002-09-24 | Update for new since 1.2.17 * -------------+------------------------------------------------------------ + * 2002-10-22 | Update for new since 1.2.18 + * -------------+------------------------------------------------------------ */ #ifndef TRANSLATOR_FR_H #define TRANSLATOR_FR_H @@ -146,7 +148,7 @@ class TranslatorFrench : public TranslatorAdapter_1_2_17 // 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). + * compounds or files (see the \\group command). */ QCString trModules() { return "Modules"; } @@ -1282,6 +1284,22 @@ class TranslatorFrench : public TranslatorAdapter_1_2_17 return "Liste obsolète"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return "Evènements"; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return "Documentation des évènements"; + } }; #endif diff --git a/src/translator_hu.h b/src/translator_hu.h index 2a0797c..ff3ba87 100644 --- a/src/translator_hu.h +++ b/src/translator_hu.h @@ -127,7 +127,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_2_1 // 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). + * compounds or files (see the \\group command). */ QCString trModules() { return "Modulok"; } diff --git a/src/translator_it.h b/src/translator_it.h index fffee07..98604f2 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -180,7 +180,7 @@ class TranslatorItalian : public TranslatorAdapter_1_2_18 // 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). + * compounds or files (see the \\group command). */ QCString trModules() { return "Moduli"; } diff --git a/src/translator_jp.h b/src/translator_jp.h index c3debfb..f1a788d 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -172,7 +172,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_2_18 // 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). + * compounds or files (see the \\group command). */ virtual QCString trModules() { return decode("¥â¥¸¥å¡¼¥ë"); } diff --git a/src/translator_pl.h b/src/translator_pl.h index 3754594..9dced0d 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -144,7 +144,7 @@ class TranslatorPolish : public TranslatorAdapter_1_2_17 // 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). + * compounds or files (see the \\group command). */ QCString trModules() { return "Modu³y"; } diff --git a/src/translator_pt.h b/src/translator_pt.h index eb05d0c..ff0bade 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -158,7 +158,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_2_18 // 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). + * compounds or files (see the \\group command). */ QCString trModules() { return "Módulos"; } diff --git a/src/translator_ro.h b/src/translator_ro.h index 07c2bd9..22209de 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -167,7 +167,7 @@ class TranslatorRomanian: public TranslatorAdapter_1_2_16 // 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). + * compounds or files (see the \\group command). */ virtual QCString trModules() { return "Module"; } diff --git a/src/util.cpp b/src/util.cpp index a265a15..2141530 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2570,6 +2570,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, linkText=linkText.right(linkText.length()-2); } } + //printf("generateLink linkText=%s\n",linkText.data()); if (resolveLink(clName,lr,inSeeBlock,&compound,&pageInfo,anchor)) { if (pageInfo) // link to page @@ -2596,6 +2597,10 @@ bool generateLink(OutputDocInterface &od,const char *clName, writePageRef(od,compound->getOutputFileBase(),anchor); } } + else + { + err("%s:%d: Internal error: resolveLink successful but no compound found!\n",__FILE__,__LINE__); + } return TRUE; } else // link could not be found @@ -3267,7 +3272,7 @@ QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists) * that make up specialized classes. The switch \a parentOnly * determines whether or not a template "at the end" of a scope * should be considered, e.g. with \a parentOnly is \c TRUE, A<T>::B<S> will - * try to strip <T> and not <S>, while \a parentOnly is \c FALSE will + * try to strip \<T\> and not \<S\>, while \a parentOnly is \c FALSE will * strip both unless A<T> or B<S> are specialized template classes. */ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 80054c8..b148133 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -573,6 +573,13 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),a->defval); t << "</defval>" << endl; } + if (defArg && defArg->hasDocumentation()) + { + t << " <briefdescription>"; + writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(), + scopeName,md,defArg->docs); + t << "</briefdescription>" << endl; + } t << " </param>" << endl; if (defArg) ++defAli; } @@ -610,7 +617,19 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De MemberDef *emd; for (emli.toFirst();(emd=emli.current());++emli) { - t << " <enumvalue>" << endl; + ti << " <member refid=\"" << emd->getOutputFileBase() + << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>" + << convertToXML(emd->name()) << "</name></member>" << endl; + + t << " <enumvalue id=\"" << emd->getOutputFileBase() << "_1" + << emd->anchor() << "\" prot=\""; + switch (emd->protection()) + { + case Public: t << "public"; break; + case Protected: t << "protected"; break; + case Private: t << "private"; break; + } + t << "\">" << endl; t << " <name>"; writeXMLString(t,emd->name()); t << "</name>" << endl; |