summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-03-25 18:42:56 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-03-25 18:42:56 (GMT)
commit238c63a16c820818ba71ae256f3f50eed2a94cf2 (patch)
treeac946941d432585f18f08ee563fec2f48faae1de /src
parentf630007a569f8342ada7b2ecf06692353ddbce3c (diff)
downloadDoxygen-238c63a16c820818ba71ae256f3f50eed2a94cf2.zip
Doxygen-238c63a16c820818ba71ae256f3f50eed2a94cf2.tar.gz
Doxygen-238c63a16c820818ba71ae256f3f50eed2a94cf2.tar.bz2
Release-1.5.5-20080325
Diffstat (limited to 'src')
-rw-r--r--src/cmdmapper.cpp2
-rw-r--r--src/cmdmapper.h4
-rw-r--r--src/code.l6
-rw-r--r--src/commentscan.l3
-rw-r--r--src/config.l37
-rw-r--r--src/definition.cpp2
-rw-r--r--src/docparser.cpp84
-rw-r--r--src/docparser.h9
-rw-r--r--src/dot.cpp10
-rw-r--r--src/doxygen.cpp4
-rw-r--r--src/util.cpp4
11 files changed, 134 insertions, 31 deletions
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp
index 4ad3b38..4dc385d 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -31,6 +31,8 @@ CommandMap cmdMap[] =
{ "c", CMD_CODE },
{ "code", CMD_STARTCODE },
{ "copydoc", CMD_COPYDOC },
+ { "copybrief", CMD_COPYBRIEF },
+ { "copydetails", CMD_COPYDETAILS },
{ "date", CMD_DATE },
{ "dontinclude", CMD_DONTINCLUDE },
{ "dotfile", CMD_DOTFILE },
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index 95ba3e1..65451dc 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -110,7 +110,9 @@ enum CommandType
CMD_ENDMANONLY = 76,
CMD_INCWITHLINES = 77,
CMD_INHERITDOC = 78,
- CMD_TPARAM = 79 | SIMPLESECT_BIT
+ CMD_TPARAM = 79 | SIMPLESECT_BIT,
+ CMD_COPYBRIEF = 80,
+ CMD_COPYDETAILS = 81
};
enum HtmlTagType
diff --git a/src/code.l b/src/code.l
index 20a5fa4..7a44298 100644
--- a/src/code.l
+++ b/src/code.l
@@ -410,7 +410,8 @@ static void popScope()
static void setCurrentDoc(const QCString &name,const QCString &base,const QCString &anchor="")
{
- static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
+ static bool searchEngineEnabled=Config_getBool("SEARCHENGINE") &&
+ Config_getBool("SOURCE_BROWSER");
if (searchEngineEnabled)
{
Doxygen::searchIndex->setCurrentDoc(name,base,anchor);
@@ -419,7 +420,8 @@ static void setCurrentDoc(const QCString &name,const QCString &base,const QCStri
static void addToSearchIndex(const char *text)
{
- static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
+ static bool searchEngineEnabled=Config_getBool("SEARCHENGINE") &&
+ Config_getBool("SOURCE_BROWSER");
if (searchEngineEnabled)
{
Doxygen::searchIndex->addWord(text,FALSE);
diff --git a/src/commentscan.l b/src/commentscan.l
index 18bb9a5..87c9080 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -201,6 +201,9 @@ static DocCmdMap docCmdMap[] =
{ "attention", 0, TRUE },
{ "author", 0, TRUE },
{ "authors", 0, TRUE },
+ { "copydoc", 0, TRUE },
+ { "copybrief", 0, TRUE },
+ { "copydetails", 0, TRUE },
{ "date", 0, TRUE },
{ "dotfile", 0, TRUE },
{ "htmlinclude", 0, TRUE },
diff --git a/src/config.l b/src/config.l
index 7d61563..7f116c2 100644
--- a/src/config.l
+++ b/src/config.l
@@ -1250,14 +1250,22 @@ void Config::check()
if (Config_getBool("HAVE_DOT"))
{
- QCString curFontPath = portable_getenv("DOTFONTPATH");
- QCString newFontPath = ".";
- if (!curFontPath.isEmpty())
+ QCString curFontPath = Config_getString("DOT_FONTPATH");
+ if (curFontPath.isEmpty())
+ {
+ portable_getenv("DOTFONTPATH");
+ QCString newFontPath = ".";
+ if (!curFontPath.isEmpty())
+ {
+ newFontPath+=portable_pathListSeparator();
+ newFontPath+=curFontPath;
+ }
+ portable_setenv("DOTFONTPATH",newFontPath);
+ }
+ else
{
- newFontPath+=portable_pathListSeparator();
- newFontPath+=curFontPath;
+ portable_setenv("DOTFONTPATH",curFontPath);
}
- portable_setenv("DOTFONTPATH",newFontPath);
}
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
@@ -2933,6 +2941,23 @@ void Config::create()
"have no effect if this option is set to NO (the default) \n",
FALSE
);
+ cs = addString( "DOT_FONTNAME",
+ "By default doxygen will write a font called FreeSans.ttf to the output \n"
+ "directory and reference it in all dot files that doxygen generates. This \n"
+ "font does not include all possible unicode characters however, so when you need \n"
+ "these (or just want a differently looking font) you can specify the font name \n"
+ "using DOT_FONTNAME. You need need to make sure dot is able to find the font, \n"
+ "which can be done by putting it in a standard location or by setting the \n"
+ "DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory \n"
+ "containing the font. \n"
+ );
+ cs->setDefaultValue("FreeSans");
+ cs = addString( "DOT_FONTPATH",
+ "By default doxygen will tell dot to use the output directory to look for the \n"
+ "FreeSans.ttf font (which doxygen will put there itself). If you specify a \n"
+ "different font using DOT_FONTNAME you can set the path where dot \n"
+ "can find it using this tag. \n"
+ );
cb = addBool(
"CLASS_GRAPH",
"If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n"
diff --git a/src/definition.cpp b/src/definition.cpp
index 2eab6a9..ac8e044 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -1020,7 +1020,7 @@ QCString Definition::qualifiedName() const
if (m_impl->outerScope->name()=="<globalScope>")
{
- m_impl->qualifiedName = m_impl->localName.copy();
+ m_impl->qualifiedName = m_impl->localName;
}
else
{
diff --git a/src/docparser.cpp b/src/docparser.cpp
index aecc4d1..77def03 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -81,8 +81,8 @@ static QString g_relPath;
static bool g_hasParamCommand;
static bool g_hasReturnCommand;
-static MemberDef * g_memberDef;
static QDict<void> g_paramsFound;
+static MemberDef * g_memberDef;
static bool g_isExample;
static QCString g_exampleName;
static SectionDict * g_sectionDict;
@@ -125,7 +125,7 @@ static QStack<DocParserContext> g_parserStack;
//---------------------------------------------------------------------------
-static void docParserPushContext()
+static void docParserPushContext(bool saveParamInfo=TRUE)
{
//QCString indent;
//indent.fill(' ',g_parserStack.count()*2+2);
@@ -143,10 +143,14 @@ static void docParserPushContext()
ctx->fileName = g_fileName;
ctx->relPath = g_relPath;
- ctx->hasParamCommand = g_hasParamCommand;
- ctx->hasReturnCommand = g_hasReturnCommand;
+ if (saveParamInfo)
+ {
+ ctx->hasParamCommand = g_hasParamCommand;
+ ctx->hasReturnCommand = g_hasReturnCommand;
+ ctx->paramsFound = g_paramsFound;
+ }
+
ctx->memberDef = g_memberDef;
- ctx->paramsFound = g_paramsFound;
ctx->isExample = g_isExample;
ctx->exampleName = g_exampleName;
ctx->sectionDict = g_sectionDict;
@@ -1744,7 +1748,13 @@ void DocCopy::parse()
{
if (g_copyStack.findRef(def)==-1) // definition not parsed earlier
{
- docParserPushContext();
+ bool hasParamCommand = g_hasParamCommand;
+ bool hasReturnCommand = g_hasReturnCommand;
+ QDict<void> paramsFound = g_paramsFound;
+ //printf("..1 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
+ // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
+
+ docParserPushContext(FALSE);
if (def->definitionType()==Definition::TypeMember && def->getOuterScope())
{
g_context=def->getOuterScope()->name();
@@ -1760,14 +1770,49 @@ void DocCopy::parse()
// handle them in all cases.
//printf("doc='%s'\n",doc.data());
//printf("brief='%s'\n",brief.data());
- brief+='\n';
- doc+='\n';
- internalValidatingParseDoc(this,m_children,brief);
- internalValidatingParseDoc(this,m_children,doc);
+ if (m_copyBrief)
+ {
+ brief+='\n';
+ internalValidatingParseDoc(this,m_children,brief);
+
+ //printf("..2 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
+ // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
+ hasParamCommand = hasParamCommand || g_hasParamCommand;
+ hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
+ QDictIterator<void> it(g_paramsFound);
+ void *item;
+ for (;(item=it.current());++it)
+ {
+ paramsFound.insert(it.currentKey(),it.current());
+ }
+ }
+ if (m_copyDetails)
+ {
+ doc+='\n';
+ internalValidatingParseDoc(this,m_children,doc);
+
+ //printf("..3 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
+ // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
+ hasParamCommand = hasParamCommand || g_hasParamCommand;
+ hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
+ QDictIterator<void> it(g_paramsFound);
+ void *item;
+ for (;(item=it.current());++it)
+ {
+ paramsFound.insert(it.currentKey(),it.current());
+ }
+ }
g_copyStack.remove(def);
ASSERT(g_styleStack.isEmpty());
ASSERT(g_nodeStack.isEmpty());
docParserPopContext(TRUE);
+
+ g_hasParamCommand = hasParamCommand;
+ g_hasReturnCommand = hasReturnCommand;
+ g_paramsFound = paramsFound;
+
+ //printf("..4 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
+ // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
}
else // oops, recursion
{
@@ -4437,7 +4482,8 @@ int DocPara::handleCommand(const QString &cmdName)
{
DBG(("handleCommand(%s)\n",cmdName.data()));
int retval = RetVal_OK;
- switch (Mappers::cmdMapper->map(cmdName))
+ int cmdId = Mappers::cmdMapper->map(cmdName);
+ switch (cmdId)
{
case CMD_UNKNOWN:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data());
@@ -4702,7 +4748,9 @@ int DocPara::handleCommand(const QString &cmdName)
case CMD_INTERNAL:
retval = RetVal_Internal;
break;
- case CMD_COPYDOC:
+ case CMD_COPYDOC: // fall through
+ case CMD_COPYBRIEF: // fall through
+ case CMD_COPYDETAILS:
{
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
@@ -4724,7 +4772,9 @@ int DocPara::handleCommand(const QString &cmdName)
tokToString(tok),cmdName.data());
break;
}
- DocCopy *cpy = new DocCopy(this,g_token->name);
+ DocCopy *cpy = new DocCopy(this,g_token->name,
+ cmdId==CMD_COPYDOC || cmdId==CMD_COPYBRIEF,
+ cmdId==CMD_COPYDOC || cmdId==CMD_COPYDETAILS);
m_children.append(cpy);
cpy->parse();
}
@@ -5983,8 +6033,9 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
bool isExample, const char *exampleName,
bool singleLine, bool linkFromIndex)
{
- //printf("validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"<none>",
- // md?md->name().data():"<none>");
+ //printf("validatingParseDoc(%s,%s)=[%s]\n",ctx?ctx->name().data():"<none>",
+ // md?md->name().data():"<none>",
+ // input);
//printf("========== validating %s at line %d\n",fileName,startLine);
//printf("---------------- input --------------------\n%s\n----------- end input -------------------\n",input);
//g_token = new TokenInfo;
@@ -6145,6 +6196,9 @@ DocNode *validatingParseDoc(const char *fileName,int startLine,
// restore original parser state
docParserPopContext();
+ //printf("end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"<none>",
+ // md?md->name().data():"<none>");
+
return root;
}
diff --git a/src/docparser.h b/src/docparser.h
index 478f1b9..82d04e4 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -500,12 +500,13 @@ class DocIndexEntry : public DocNode
//-----------------------------------------------------------------------
-/*! @brief Node representing a entry in the index. */
+/*! @brief Node representing a copy of documentation block. */
class DocCopy : public CompAccept<DocCopy>, public DocNode
{
public:
- DocCopy(DocNode *parent,const QString &link)
- : m_parent(parent), m_link(link) { }
+ DocCopy(DocNode *parent,const QString &link,bool copyBrief,bool copyDetails)
+ : m_parent(parent), m_link(link),
+ m_copyBrief(copyBrief), m_copyDetails(copyDetails) { }
Kind kind() const { return Kind_IndexEntry; }
QString link() const { return m_link; }
DocNode *parent() const { return m_parent; }
@@ -515,6 +516,8 @@ class DocCopy : public CompAccept<DocCopy>, public DocNode
private:
DocNode *m_parent;
QString m_link;
+ bool m_copyBrief;
+ bool m_copyDetails;
};
/*! @brief Node representing an auto List */
diff --git a/src/dot.cpp b/src/dot.cpp
index c745ef6..0b736b1 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -43,7 +43,8 @@
#define MAP_CMD "cmap"
-#define FONTNAME "FreeSans"
+//#define FONTNAME "FreeSans"
+#define FONTNAME getDotFontName()
//--------------------------------------------------------------------
@@ -76,6 +77,13 @@ static const char *edgeStyleMap[] =
"dashed" // usage
};
+static QCString getDotFontName()
+{
+ static QCString dotFontName = Config_getString("DOT_FONTNAME");
+ if (dotFontName.isEmpty()) dotFontName="FreeSans";
+ return dotFontName;
+}
+
static void writeGraphHeader(QTextStream &t)
{
t << "digraph G" << endl;
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index c6633ed..f759c98 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -874,7 +874,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name,int level)
else if (nd==0 && cd==0) // scope is not known!
{
// introduce bogus namespace
- //printf("adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data());
+ //printf("++ adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data());
nd=new NamespaceDef(
"[generated]",1,fullScope);
@@ -1409,6 +1409,7 @@ static void buildNamespaceList(EntryNav *rootNav)
tagName=rootNav->tagInfo()->tagName;
tagFileName=rootNav->tagInfo()->fileName;
}
+ //printf("++ new namespace %d\n",fullName.data());
NamespaceDef *nd=new NamespaceDef(root->fileName,root->startLine,fullName,tagName,tagFileName);
nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
@@ -1576,6 +1577,7 @@ static void findUsingDirectives(EntryNav *rootNav)
}
else // unknown namespace, but add it anyway.
{
+ //printf("++ new unknown namespace %s\n",name.data());
NamespaceDef *nd=new NamespaceDef(root->fileName,root->startLine,name);
nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
diff --git a/src/util.cpp b/src/util.cpp
index db5eb08..a1281f9 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -4944,7 +4944,8 @@ QCString stripScope(const char *name)
count=1;
//printf("pos < = %d\n",p);
p--;
- while (p>=0)
+ bool foundMatch=false;
+ while (p>=0 && !foundMatch)
{
c=result.at(p--);
switch (c)
@@ -4962,6 +4963,7 @@ QCString stripScope(const char *name)
}
}
count--;
+ foundMatch = count==0;
break;
default:
//printf("c=%c count=%d\n",c,count);