summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-11-18 14:00:59 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2018-11-18 14:23:28 (GMT)
commitf0cc0f5da51faddd490c2cf358614b4ab70cc8ac (patch)
treed88c647365010677b4c4f6353e0e03e0daea6f33 /src
parent8ff99363c2f6b3226fe5b57f38ae1d4805dca22c (diff)
downloadDoxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.zip
Doxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.tar.gz
Doxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.tar.bz2
Minor restructuring
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp380
-rw-r--r--src/classdef.h4
-rw-r--r--src/code.l43
-rw-r--r--src/context.cpp4
-rw-r--r--src/filedef.cpp36
-rw-r--r--src/ftvhelp.cpp73
-rw-r--r--src/htmlgen.cpp46
-rw-r--r--src/index.cpp11
-rw-r--r--src/index.h5
-rw-r--r--src/layout.h1
-rw-r--r--src/namespacedef.cpp22
-rw-r--r--src/perlmodgen.cpp31
-rw-r--r--src/scanner.l74
-rw-r--r--src/searchindex.cpp10
-rw-r--r--src/types.h16
-rw-r--r--src/util.cpp14
16 files changed, 378 insertions, 392 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 944cd8c..77d9e05 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -1375,202 +1375,200 @@ QCString ClassDef::includeStatement() const
}
}
-void ClassDef::writeIncludeFiles(OutputList &ol)
+void ClassDef::writeIncludeFilesForSlice(OutputList &ol)
{
- if (m_impl->incInfo /*&& Config_getBool(SHOW_INCLUDE_FILES)*/)
+ if (m_impl->incInfo)
{
- SrcLangExt lang = getLanguage();
- if (lang==SrcLangExt_Slice)
+ QCString nm;
+ QStrList paths = Config_getList(STRIP_FROM_PATH);
+ if (!paths.isEmpty() && m_impl->incInfo->fileDef)
{
- QCString nm;
- QStrList paths = Config_getList(STRIP_FROM_PATH);
- if (!paths.isEmpty() && m_impl->incInfo->fileDef)
+ QCString abs = m_impl->incInfo->fileDef->absFilePath();
+ const char *s = paths.first();
+ QCString potential;
+ unsigned int length = 0;
+ while (s)
{
- QCString abs = m_impl->incInfo->fileDef->absFilePath();
- const char *s = paths.first();
- QCString potential;
- unsigned int length = 0;
- while (s)
+ QFileInfo info(s);
+ if (info.exists())
{
- QFileInfo info(s);
- if (info.exists())
+ QString prefix = info.absFilePath();
+ if (prefix.at(prefix.length() - 1) != '/')
{
- QString prefix = info.absFilePath();
- if (prefix.at(prefix.length() - 1) != '/')
- {
- prefix += '/';
- }
-
- if (prefix.length() > length &&
- qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
- {
- length = prefix.length();
- potential = abs.right(abs.length() - prefix.length());
- }
- s = paths.next();
+ prefix += '/';
}
- }
- if (length > 0)
- {
- nm = potential;
+ if (prefix.length() > length &&
+ qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
+ {
+ length = prefix.length();
+ potential = abs.right(abs.length() - prefix.length());
+ }
+ s = paths.next();
}
}
- if (nm.isEmpty())
+ if (length > 0)
{
- nm = m_impl->incInfo->includeName.data();
+ nm = potential;
}
+ }
- ol.startParagraph();
- ol.docify("Defined in ");
- ol.startTypewriter();
- ol.docify("<");
- if (m_impl->incInfo->fileDef)
- {
- ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
- }
- else
+ if (nm.isEmpty())
+ {
+ nm = m_impl->incInfo->includeName.data();
+ }
+
+ ol.startParagraph();
+ ol.docify(theTranslator->trDefinedIn()+" ");
+ ol.startTypewriter();
+ ol.docify("<");
+ if (m_impl->incInfo->fileDef)
+ {
+ ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
+ }
+ else
+ {
+ ol.docify(nm);
+ }
+ ol.docify(">");
+ ol.endTypewriter();
+ ol.endParagraph();
+ }
+
+ // Write a summary of the Slice definition including metadata.
+ ol.startParagraph();
+ ol.startTypewriter();
+ if (!m_impl->metaData.isEmpty())
+ {
+ ol.docify(m_impl->metaData);
+ ol.lineBreak();
+ }
+ if (m_impl->spec & Entry::Local)
+ {
+ ol.docify("local ");
+ }
+ if (m_impl->spec & Entry::Interface)
+ {
+ ol.docify("interface ");
+ }
+ else if (m_impl->spec & Entry::Struct)
+ {
+ ol.docify("struct ");
+ }
+ else if (m_impl->spec & Entry::Exception)
+ {
+ ol.docify("exception ");
+ }
+ else
+ {
+ ol.docify("class ");
+ }
+ ol.docify(stripScope(name()));
+ if (m_impl->inherits)
+ {
+ if (m_impl->spec & (Entry::Interface|Entry::Exception))
+ {
+ ol.docify(" extends ");
+ BaseClassListIterator it(*m_impl->inherits);
+ BaseClassDef *ibcd;
+ for (;(ibcd=it.current());++it)
{
- ol.docify(nm);
+ ClassDef *icd = ibcd->classDef;
+ ol.docify(icd->name());
+ if (!it.atLast())
+ {
+ ol.docify(", ");
+ }
}
- ol.docify(">");
- ol.endTypewriter();
- ol.endParagraph();
}
else
{
- QCString nm=m_impl->incInfo->includeName.isEmpty() ?
- (m_impl->incInfo->fileDef ?
- m_impl->incInfo->fileDef->docName().data() : ""
- ) :
- m_impl->incInfo->includeName.data();
- if (!nm.isEmpty())
+ // Must be a class.
+ bool implements = false;
+ BaseClassListIterator it(*m_impl->inherits);
+ BaseClassDef *ibcd;
+ for (;(ibcd=it.current());++it)
{
- ol.startParagraph();
- ol.startTypewriter();
- ol.docify(includeStatement());
- bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
- if (m_impl->incInfo->local || isIDLorJava)
- ol.docify("\"");
- else
- ol.docify("<");
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- ol.docify(nm);
- ol.disableAllBut(OutputGenerator::Html);
- ol.enable(OutputGenerator::Html);
- if (m_impl->incInfo->fileDef)
+ ClassDef *icd = ibcd->classDef;
+ if (icd->m_impl->spec & Entry::Interface)
{
- ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
+ implements = true;
}
else
{
- ol.docify(nm);
+ ol.docify(" extends ");
+ ol.docify(icd->name());
}
- ol.popGeneratorState();
- if (m_impl->incInfo->local || isIDLorJava)
- ol.docify("\"");
- else
- ol.docify(">");
- if (isIDLorJava)
- ol.docify(";");
- ol.endTypewriter();
- ol.endParagraph();
- }
- }
-
- // Write a summary of the Slice definition including metadata.
- if (lang == SrcLangExt_Slice)
- {
- ol.startParagraph();
- ol.startTypewriter();
- if (!m_impl->metaData.isEmpty())
- {
- ol.docify(m_impl->metaData);
- ol.lineBreak();
- }
- if (m_impl->spec & Entry::Local)
- {
- ol.docify("local ");
- }
- if (m_impl->spec & Entry::Interface)
- {
- ol.docify("interface ");
}
- else if (m_impl->spec & Entry::Struct)
+ if (implements)
{
- ol.docify("struct ");
- }
- else if (m_impl->spec & Entry::Exception)
- {
- ol.docify("exception ");
- }
- else
- {
- ol.docify("class ");
- }
- ol.docify(stripScope(name()));
- if (m_impl->inherits)
- {
- if (m_impl->spec & (Entry::Interface|Entry::Exception))
+ ol.docify(" implements ");
+ bool first = true;
+ for (ibcd=it.toFirst();(ibcd=it.current());++it)
{
- ol.docify(" extends ");
- BaseClassListIterator it(*m_impl->inherits);
- BaseClassDef *ibcd;
- for (;(ibcd=it.current());++it)
+ ClassDef *icd = ibcd->classDef;
+ if (icd->m_impl->spec & Entry::Interface)
{
- ClassDef *icd = ibcd->classDef;
- ol.docify(icd->name());
- if (!it.atLast())
+ if (!first)
{
ol.docify(", ");
}
- }
- }
- else
- {
- // Must be a class.
- bool implements = false;
- BaseClassListIterator it(*m_impl->inherits);
- BaseClassDef *ibcd;
- for (;(ibcd=it.current());++it)
- {
- ClassDef *icd = ibcd->classDef;
- if (icd->m_impl->spec & Entry::Interface)
- {
- implements = true;
- }
else
{
- ol.docify(" extends ");
- ol.docify(icd->name());
- }
- }
- if (implements)
- {
- ol.docify(" implements ");
- bool first = true;
- for (ibcd=it.toFirst();(ibcd=it.current());++it)
- {
- ClassDef *icd = ibcd->classDef;
- if (icd->m_impl->spec & Entry::Interface)
- {
- if (!first)
- {
- ol.docify(", ");
- }
- else
- {
- first = false;
- }
- ol.docify(icd->name());
- }
+ first = false;
}
+ ol.docify(icd->name());
}
}
}
- ol.docify(" { ... }");
+ }
+ }
+ ol.docify(" { ... }");
+ ol.endTypewriter();
+ ol.endParagraph();
+}
+
+void ClassDef::writeIncludeFiles(OutputList &ol)
+{
+ if (m_impl->incInfo /*&& Config_getBool(SHOW_INCLUDE_FILES)*/)
+ {
+ SrcLangExt lang = getLanguage();
+ QCString nm=m_impl->incInfo->includeName.isEmpty() ?
+ (m_impl->incInfo->fileDef ?
+ m_impl->incInfo->fileDef->docName().data() : ""
+ ) :
+ m_impl->incInfo->includeName.data();
+ if (!nm.isEmpty())
+ {
+ ol.startParagraph();
+ ol.startTypewriter();
+ ol.docify(includeStatement());
+ bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
+ if (m_impl->incInfo->local || isIDLorJava)
+ ol.docify("\"");
+ else
+ ol.docify("<");
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+ ol.docify(nm);
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.enable(OutputGenerator::Html);
+ if (m_impl->incInfo->fileDef)
+ {
+ ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
+ }
+ else
+ {
+ ol.docify(nm);
+ }
+ ol.popGeneratorState();
+ if (m_impl->incInfo->local || isIDLorJava)
+ ol.docify("\"");
+ else
+ ol.docify(">");
+ if (isIDLorJava)
+ ol.docify(";");
ol.endTypewriter();
ol.endParagraph();
}
@@ -2054,24 +2052,24 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
{
if (sliceOpt)
{
- if (isInterface())
+ if (compoundType()==Interface)
{
ol.startMemberHeader("interfaces");
}
- else if (isStruct())
+ else if (compoundType()==Struct)
{
ol.startMemberHeader("structs");
}
- else if (isException())
+ else if (compoundType()==Exception)
{
ol.startMemberHeader("exceptions");
}
- else
+ else // compoundType==Class
{
ol.startMemberHeader("nested-classes");
}
}
- else
+ else // non-Slice optimization: single header for class/struct/..
{
ol.startMemberHeader("nested-classes");
}
@@ -2207,7 +2205,14 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page
writeBriefDescription(ol,exampleFlag);
break;
case LayoutDocEntry::ClassIncludes:
- writeIncludeFiles(ol);
+ if (lang==SrcLangExt_Slice)
+ {
+ writeIncludeFilesForSlice(ol);
+ }
+ else
+ {
+ writeIncludeFiles(ol);
+ }
break;
case LayoutDocEntry::ClassInheritanceGraph:
writeInheritanceGraph(ol);
@@ -2365,15 +2370,15 @@ void ClassDef::writeDocumentation(OutputList &ol)
HighlightedItem hli;
if (sliceOpt)
{
- if (isInterface())
+ if (compoundType()==Interface)
{
hli = HLI_InterfaceVisible;
}
- else if (isStruct())
+ else if (compoundType()==Struct)
{
hli = HLI_StructVisible;
}
- else if (isException())
+ else if (compoundType()==Exception)
{
hli = HLI_ExceptionVisible;
}
@@ -2524,15 +2529,15 @@ void ClassDef::writeMemberList(OutputList &ol)
HighlightedItem hli;
if (sliceOpt)
{
- if (isInterface())
+ if (compoundType()==Interface)
{
hli = HLI_InterfaceVisible;
}
- else if (isStruct())
+ else if (compoundType()==Struct)
{
hli = HLI_StructVisible;
}
- else if (isException())
+ else if (compoundType()==Exception)
{
hli = HLI_ExceptionVisible;
}
@@ -3802,21 +3807,19 @@ QCString ClassDef::compoundTypeString() const
}
else
{
- QCString type;
switch (m_impl->compType)
{
- case Class: type += isJavaEnum() ? "enum" : "class"; break;
- case Struct: type += "struct"; break;
- case Union: type += "union"; break;
- case Interface: type += getLanguage()==SrcLangExt_ObjC ? "class" : "interface"; break;
- case Protocol: type += "protocol"; break;
- case Category: type += "category"; break;
- case Exception: type += "exception"; break;
- case Service: type += "service"; break;
- case Singleton: type += "singleton"; break;
+ case Class: return isJavaEnum() ? "enum" : "class";
+ case Struct: return "struct";
+ case Union: return "union";
+ case Interface: return getLanguage()==SrcLangExt_ObjC ? "class" : "interface";
+ case Protocol: return "protocol";
+ case Category: return "category";
+ case Exception: return "exception";
+ case Service: return "service";
+ case Singleton: return "singleton";
default: return "unknown";
}
- return type;
}
}
@@ -5001,21 +5004,6 @@ bool ClassDef::subGrouping() const
return m_impl->subGrouping;
}
-bool ClassDef::isInterface() const
-{
- return m_impl->compType == Interface;
-}
-
-bool ClassDef::isStruct() const
-{
- return m_impl->compType == Struct;
-}
-
-bool ClassDef::isException() const
-{
- return m_impl->compType == Exception;
-}
-
bool ClassDef::isSliceLocal() const
{
return m_impl->spec&Entry::Local;
diff --git a/src/classdef.h b/src/classdef.h
index caa2750..14f9fc8 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -336,9 +336,6 @@ class ClassDef : public Definition
QCString getMemberListFileName() const;
bool subGrouping() const;
- bool isInterface() const;
- bool isStruct() const;
- bool isException() const;
bool isSliceLocal() const;
//-----------------------------------------------------------------------------------
@@ -435,6 +432,7 @@ class ClassDef : public Definition
void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag,
const QCString &title,const QCString &anchor=QCString());
void writeIncludeFiles(OutputList &ol);
+ void writeIncludeFilesForSlice(OutputList &ol);
//void writeAllMembersLink(OutputList &ol);
void writeInheritanceGraph(OutputList &ol);
void writeCollaborationGraph(OutputList &ol);
diff --git a/src/code.l b/src/code.l
index 053b6b5..558c439 100644
--- a/src/code.l
+++ b/src/code.l
@@ -122,6 +122,7 @@ static bool g_insideJava;
static bool g_insideCS;
static bool g_insidePHP;
static bool g_insideProtocolList;
+static bool g_insideSlice;
static bool g_lexInit = FALSE;
@@ -1834,7 +1835,8 @@ KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@int
KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC})
FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally")
FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try")
-TYPEKW ("bool"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr"|"LocalObject"|"Object"|"Value")
+TYPEKW ("bool"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
+TYPEKWSL ("LocalObject"|"Object"|"Value")
CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast")
CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
@@ -2542,6 +2544,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
addType();
g_name+=yytext;
}
+<Body,TemplDecl,ObjCMethod>{TYPEKWSL}/{B}* {
+ if (!g_insideSlice)
+ {
+ REJECT;
+ }
+ else
+ {
+ startFontClass("keywordtype");
+ g_code->codify(yytext);
+ endFontClass();
+ addType();
+ g_name+=yytext;
+ }
+ }
<Body>"generic"/{B}*"<"[^\n\/\-\.\{\"\>]*">"{B}* {
startFontClass("keyword");
g_code->codify(yytext);
@@ -3013,6 +3029,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_code->codify(yytext);
endFontClass();
}
+<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKWSL}/([^a-z_A-Z0-9]) {
+ if (!g_insideSlice)
+ {
+ REJECT;
+ }
+ else
+ {
+ addParmType();
+ g_parmName=yytext;
+ startFontClass("keywordtype");
+ g_code->codify(yytext);
+ endFontClass();
+ }
+ }
<MemberCall2,FuncCall>{FLOWKW}/([^a-z_A-Z0-9]) {
addParmType();
g_parmName=yytext;
@@ -3759,11 +3789,12 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
cleanupSourceDef = TRUE;
}
- g_insideObjC = lang==SrcLangExt_ObjC;
- g_insideJava = lang==SrcLangExt_Java;
- g_insideCS = lang==SrcLangExt_CSharp;
- g_insidePHP = lang==SrcLangExt_PHP;
- g_insideCpp = lang==SrcLangExt_Cpp;
+ g_insideObjC = lang==SrcLangExt_ObjC;
+ g_insideJava = lang==SrcLangExt_Java;
+ g_insideCS = lang==SrcLangExt_CSharp;
+ g_insidePHP = lang==SrcLangExt_PHP;
+ g_insideCpp = lang==SrcLangExt_Cpp;
+ g_insideSlice = lang==SrcLangExt_Slice;
if (g_sourceFileDef)
{
setCurrentDoc("l00001");
diff --git a/src/context.cpp b/src/context.cpp
index 40fa6ef..405d0b5 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -2751,7 +2751,9 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
ClassDef *cd;
for (sdi.toFirst();(cd=sdi.current());++sdi)
{
- if (sliceOpt && (cd->isStruct() || cd->isInterface() || cd->isException()))
+ if (sliceOpt && (cd->compoundType()==ClassDef::Struct ||
+ cd->compoundType()==ClassDef::Interface ||
+ cd->compoundType()==ClassDef::Exception))
{
continue; // These types appear in their own sections.
}
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 6e14e2f..f9f68d1 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -1265,41 +1265,27 @@ void FileDef::insertClass(ClassDef *cd)
{
if (cd->isHidden()) return;
- ClassSDict *d;
+ ClassSDict *d=0;
+ ClassSDict **dd=&m_classSDict;
if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
{
- if (cd->isInterface())
+ if (cd->compoundType()==ClassDef::Interface)
{
- if (m_interfaceSDict==0)
- m_interfaceSDict = new ClassSDict(17);
- d = m_interfaceSDict;
+ dd = &m_interfaceSDict;
}
- else if (cd->isStruct())
+ else if (cd->compoundType()==ClassDef::Struct)
{
- if (m_structSDict==0)
- m_structSDict = new ClassSDict(17);
- d = m_structSDict;
+ dd = &m_structSDict;
}
- else if (cd->isException())
+ else if (cd->compoundType()==ClassDef::Exception)
{
- if (m_exceptionSDict==0)
- m_exceptionSDict = new ClassSDict(17);
- d = m_exceptionSDict;
- }
- else
- {
- if (m_classSDict==0)
- m_classSDict = new ClassSDict(17);
- d = m_classSDict;
+ dd = &m_exceptionSDict;
}
}
- else
- {
- if (m_classSDict==0)
- m_classSDict = new ClassSDict(17);
- d = m_classSDict;
- }
+
+ if (*dd==0) *dd = new ClassSDict(17);
+ d = *dd;
if (Config_getBool(SORT_BRIEF_DOCS))
{
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index a13d45f..73ac775 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -332,6 +332,27 @@ static void generateBriefDoc(FTextStream &t,Definition *def)
}
}
+static char compoundIcon(ClassDef *cd)
+{
+ char icon='C';
+ if (cd->getLanguage() == SrcLangExt_Slice)
+ {
+ if (cd->compoundType()==ClassDef::Interface)
+ {
+ icon='I';
+ }
+ else if (cd->compoundType()==ClassDef::Struct)
+ {
+ icon='S';
+ }
+ else if (cd->compoundType()==ClassDef::Exception)
+ {
+ icon='E';
+ }
+ }
+ return icon;
+}
+
void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index)
{
QListIterator<FTVNode> nli(nl);
@@ -371,30 +392,8 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- if (n->def->getLanguage() == SrcLangExt_Slice)
- {
- ClassDef *cd = dynamic_cast<ClassDef*>(n->def);
- if (cd->isInterface())
- {
- t << "<span class=\"icona\"><span class=\"icon\">I</span></span>";
- }
- else if (cd->isStruct())
- {
- t << "<span class=\"icona\"><span class=\"icon\">S</span></span>";
- }
- else if (cd->isException())
- {
- t << "<span class=\"icona\"><span class=\"icon\">E</span></span>";
- }
- else
- {
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
- }
- }
- else
- {
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
- }
+ char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def));
+ t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
else
{
@@ -449,30 +448,8 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- if (n->def->getLanguage() == SrcLangExt_Slice)
- {
- ClassDef *cd = dynamic_cast<ClassDef*>(n->def);
- if (cd->isInterface())
- {
- t << "<span class=\"icona\"><span class=\"icon\">I</span></span>";
- }
- else if (cd->isStruct())
- {
- t << "<span class=\"icona\"><span class=\"icon\">S</span></span>";
- }
- else if (cd->isException())
- {
- t << "<span class=\"icona\"><span class=\"icon\">E</span></span>";
- }
- else
- {
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
- }
- }
- else
- {
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
- }
+ char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def));
+ t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
else
{
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 8de836d..581f3f2 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -2039,24 +2039,34 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
switch (kind)
{
- case LayoutNavEntry::MainPage: return TRUE;
- case LayoutNavEntry::User: return TRUE;
- case LayoutNavEntry::UserGroup: return TRUE;
- case LayoutNavEntry::Pages: return indexedPages>0;
- case LayoutNavEntry::Modules: return documentedGroups>0;
- case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
- case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
- case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
- case LayoutNavEntry::Classes: return annotatedClasses>0;
- case LayoutNavEntry::ClassList: return annotatedClasses>0;
- case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
- case LayoutNavEntry::ClassHierarchy: return hierarchyClasses>0;
- case LayoutNavEntry::ClassMembers: return documentedClassMembers[CMHL_All]>0;
- case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
- case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
- case LayoutNavEntry::FileGlobals: return documentedFileMembers[FMHL_All]>0;
- //case LayoutNavEntry::Dirs: return documentedDirs>0;
- case LayoutNavEntry::Examples: return Doxygen::exampleSDict->count()>0;
+ case LayoutNavEntry::MainPage: return TRUE;
+ case LayoutNavEntry::User: return TRUE;
+ case LayoutNavEntry::UserGroup: return TRUE;
+ case LayoutNavEntry::Pages: return indexedPages>0;
+ case LayoutNavEntry::Modules: return documentedGroups>0;
+ case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
+ case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
+ case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
+ case LayoutNavEntry::Classes: return annotatedClasses>0;
+ case LayoutNavEntry::ClassList: return annotatedClasses>0;
+ case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
+ case LayoutNavEntry::ClassHierarchy: return hierarchyClasses>0;
+ case LayoutNavEntry::ClassMembers: return documentedClassMembers[CMHL_All]>0;
+ case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
+ case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
+ case LayoutNavEntry::FileGlobals: return documentedFileMembers[FMHL_All]>0;
+ case LayoutNavEntry::Examples: return Doxygen::exampleSDict->count()>0;
+ case LayoutNavEntry::Interfaces: return annotatedInterfaces>0;
+ case LayoutNavEntry::InterfaceList: return annotatedInterfaces>0;
+ case LayoutNavEntry::InterfaceIndex: return annotatedInterfaces>0;
+ case LayoutNavEntry::InterfaceHierarchy: return hierarchyInterfaces>0;
+ case LayoutNavEntry::Structs: return annotatedStructs>0;
+ case LayoutNavEntry::StructList: return annotatedStructs>0;
+ case LayoutNavEntry::StructIndex: return annotatedStructs>0;
+ case LayoutNavEntry::Exceptions: return annotatedExceptions>0;
+ case LayoutNavEntry::ExceptionList: return annotatedExceptions>0;
+ case LayoutNavEntry::ExceptionIndex: return annotatedExceptions>0;
+ case LayoutNavEntry::ExceptionHierarchy: return hierarchyExceptions>0;
case LayoutNavEntry::None: // should never happen, means not properly initialized
assert(kind != LayoutNavEntry::None);
return FALSE;
diff --git a/src/index.cpp b/src/index.cpp
index ff3ceb9..8ce48db 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1694,7 +1694,7 @@ static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,showClasses,addToIndex,ct);
if (showClasses)
{
- ClassSDict *d;
+ ClassSDict *d = nd->getClassSDict();
if (sliceOpt)
{
if (ct == ClassDef::Interface)
@@ -1709,14 +1709,6 @@ static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
{
d = nd->getExceptionSDict();
}
- else
- {
- d = nd->getClassSDict();
- }
- }
- else
- {
- d = nd->getClassSDict();
}
writeClassTree(d,ftv,addToIndex,FALSE,ct);
}
@@ -5153,7 +5145,6 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
case LayoutNavEntry::FileGlobals: return documentedFileMembers[FMHL_All]>0;
- //case LayoutNavEntry::Dirs: return documentedDirs>0;
case LayoutNavEntry::Examples: return Doxygen::exampleSDict->count()>0;
case LayoutNavEntry::None: // should never happen, means not properly initialized
assert(kind != LayoutNavEntry::None);
diff --git a/src/index.h b/src/index.h
index 63dd494..f3e0241 100644
--- a/src/index.h
+++ b/src/index.h
@@ -272,7 +272,12 @@ void writeIndexHierarchy(OutputList &ol);
void countDataStructures();
extern int annotatedClasses;
+extern int annotatedInterfaces;
+extern int annotatedStructs;
+extern int annotatedExceptions;
extern int hierarchyClasses;
+extern int hierarchyInterfaces;
+extern int hierarchyExceptions;
extern int documentedFiles;
extern int documentedGroups;
extern int documentedNamespaces;
diff --git a/src/layout.h b/src/layout.h
index a23fd2f..b25aa4e 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -146,7 +146,6 @@ struct LayoutNavEntry
Files,
FileList,
FileGlobals,
- //Dirs,
Examples,
User,
UserGroup
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index 520b0ca..bc8bb47 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -170,28 +170,34 @@ void NamespaceDef::addInnerCompound(Definition *d)
void NamespaceDef::insertClass(ClassDef *cd)
{
- ClassSDict *d;
+ ClassSDict *d = classSDict;
if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
{
- if (cd->isInterface())
+ if (cd->compoundType()==ClassDef::Interface)
+ {
d = interfaceSDict;
- else if (cd->isStruct())
+ }
+ else if (cd->compoundType()==ClassDef::Struct)
+ {
d = structSDict;
- else if (cd->isException())
+ }
+ else if (cd->compoundType()==ClassDef::Exception)
+ {
d = exceptionSDict;
- else
- d = classSDict;
+ }
}
- else
- d = classSDict;
if (d->find(cd->name())==0)
{
if (Config_getBool(SORT_BRIEF_DOCS))
+ {
d->inSort(cd->name(),cd);
+ }
else
+ {
d->append(cd->name(),cd);
+ }
}
}
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index bd52810..044efff 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -1577,21 +1577,22 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
bool isFunc=FALSE;
switch (md->memberType())
{
- case MemberType_Define: memType="define"; break;
- case MemberType_EnumValue: memType="enumvalue"; break;
- case MemberType_Property: memType="property"; break;
- case MemberType_Variable: memType="variable"; break;
- case MemberType_Typedef: memType="typedef"; break;
- case MemberType_Enumeration: memType="enum"; break;
- case MemberType_Function: memType="function"; isFunc=TRUE; break;
- case MemberType_Signal: memType="signal"; isFunc=TRUE; break;
- //case MemberType_Prototype: memType="prototype"; isFunc=TRUE; break;
- case MemberType_Friend: memType="friend"; isFunc=TRUE; break;
- case MemberType_DCOP: memType="dcop"; isFunc=TRUE; break;
- case MemberType_Slot: memType="slot"; isFunc=TRUE; break;
- case MemberType_Event: memType="event"; break;
- case MemberType_Interface: memType="interface"; break;
- case MemberType_Service: memType="service"; break;
+ case MemberType_Define: memType="define"; break;
+ case MemberType_EnumValue: memType="enumvalue"; break;
+ case MemberType_Property: memType="property"; break;
+ case MemberType_Variable: memType="variable"; break;
+ case MemberType_Typedef: memType="typedef"; break;
+ case MemberType_Enumeration: memType="enum"; break;
+ case MemberType_Function: memType="function"; isFunc=TRUE; break;
+ case MemberType_Signal: memType="signal"; isFunc=TRUE; break;
+ case MemberType_Friend: memType="friend"; isFunc=TRUE; break;
+ case MemberType_DCOP: memType="dcop"; isFunc=TRUE; break;
+ case MemberType_Slot: memType="slot"; isFunc=TRUE; break;
+ case MemberType_Event: memType="event"; break;
+ case MemberType_Interface: memType="interface"; break;
+ case MemberType_Service: memType="service"; break;
+ case MemberType_Sequence: memType="sequence"; break;
+ case MemberType_Dictionary: memType="dictionary"; break;
}
m_output.openHash()
diff --git a/src/scanner.l b/src/scanner.l
index 1642fec..a0b4e83 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -6414,64 +6414,64 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
/* ---- Slice-specific rules ------ */
-<SliceSequence>{SCOPENAME} {
- if (current->spec&Entry::Local)
- {
- current->type = "local ";
- }
- current->type += "sequence<";
- current->type += yytext;
- current->type += ">";
+<SliceSequence>{SCOPENAME} {
+ if (current->spec&Entry::Local)
+ {
+ current->type = "local ";
+ }
+ current->type += "sequence<";
+ current->type += yytext;
+ current->type += ">";
}
<SliceSequence>{BN}*">"{BN}* {
- lineCount();
- BEGIN(SliceSequenceName);
+ lineCount();
+ BEGIN(SliceSequenceName);
}
<SliceSequenceName>{ID}{BN}* {
- lineCount();
- current->name = yytext ;
- current->name = current->name.stripWhiteSpace();
+ lineCount();
+ current->name = yytext ;
+ current->name = current->name.stripWhiteSpace();
}
<SliceSequenceName>";" {
- current->section = Entry::VARIABLE_SEC;
- current_root->addSubEntry(current);
- current = new Entry;
- initEntry();
- BEGIN(FindMembers);
+ current->section = Entry::VARIABLE_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry;
+ initEntry();
+ BEGIN(FindMembers);
}
<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
- lineCount();
- if (current->spec&Entry::Local)
- {
- current->type = "local ";
- }
- current->type += "dictionary<";
- current->type += yytext;
- current->type += ">";
- current->type = current->type.simplifyWhiteSpace();
+ lineCount();
+ if (current->spec&Entry::Local)
+ {
+ current->type = "local ";
+ }
+ current->type += "dictionary<";
+ current->type += yytext;
+ current->type += ">";
+ current->type = current->type.simplifyWhiteSpace();
}
<SliceDictionary>{BN}*">"{BN}* {
- lineCount();
- BEGIN(SliceDictionaryName);
+ lineCount();
+ BEGIN(SliceDictionaryName);
}
<SliceDictionaryName>{ID}{BN}* {
- lineCount();
- current->name = yytext ;
- current->name = current->name.stripWhiteSpace();
+ lineCount();
+ current->name = yytext ;
+ current->name = current->name.stripWhiteSpace();
}
<SliceDictionaryName>";" {
- current->section = Entry::VARIABLE_SEC;
- current_root->addSubEntry(current);
- current = new Entry;
- initEntry();
- BEGIN(FindMembers);
+ current->section = Entry::VARIABLE_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry;
+ initEntry();
+ BEGIN(FindMembers);
}
/**********************************************************************************/
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 74aa138..e0d4acc 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -795,24 +795,24 @@ void createJavascriptSearchIndex()
g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,cd);
if (sliceOpt)
{
- if (cd->isInterface())
+ if (cd->compoundType()==ClassDef::Interface)
{
g_searchIndexInfo[SEARCH_INDEX_INTERFACES].symbolList.append(letter,cd);
}
- else if (cd->isStruct())
+ else if (cd->compoundType()==ClassDef::Struct)
{
g_searchIndexInfo[SEARCH_INDEX_STRUCTS].symbolList.append(letter,cd);
}
- else if (cd->isException())
+ else if (cd->compoundType()==ClassDef::Exception)
{
g_searchIndexInfo[SEARCH_INDEX_EXCEPTIONS].symbolList.append(letter,cd);
}
- else
+ else // cd->compoundType()==ClassDef::Class
{
g_searchIndexInfo[SEARCH_INDEX_CLASSES].symbolList.append(letter,cd);
}
}
- else
+ else // non slice optimisation: group all types under classes
{
g_searchIndexInfo[SEARCH_INDEX_CLASSES].symbolList.append(letter,cd);
}
diff --git a/src/types.h b/src/types.h
index 78bc1e7..4d305b6 100644
--- a/src/types.h
+++ b/src/types.h
@@ -197,16 +197,16 @@ enum MemberListType
MemberListType_decSequenceMembers = 74 + MemberListType_declarationLists,
MemberListType_docSequenceMembers = 75 + MemberListType_documentationLists,
MemberListType_decDictionaryMembers = 76 + MemberListType_declarationLists,
- MemberListType_docDictionaryMembers = 77 + MemberListType_documentationLists,
+ MemberListType_docDictionaryMembers = 77 + MemberListType_documentationLists
};
-enum MemberType
-{
+enum MemberType
+{
MemberType_Define,
- MemberType_Function,
- MemberType_Variable,
- MemberType_Typedef,
- MemberType_Enumeration,
+ MemberType_Function,
+ MemberType_Variable,
+ MemberType_Typedef,
+ MemberType_Enumeration,
MemberType_EnumValue,
MemberType_Signal,
MemberType_Slot,
@@ -217,7 +217,7 @@ enum MemberType
MemberType_Interface,
MemberType_Service,
MemberType_Sequence,
- MemberType_Dictionary,
+ MemberType_Dictionary
};
enum FortranFormat
diff --git a/src/util.cpp b/src/util.cpp
index 76691d1..819903c 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -8655,7 +8655,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl
}
if (includeClasses)
{
- ClassSDict *d;
+ ClassSDict *d = nd->getClassSDict();
if (filterClasses)
{
if (ct == ClassDef::Interface)
@@ -8670,14 +8670,6 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl
{
d = nd->getExceptionSDict();
}
- else
- {
- d = nd->getClassSDict();
- }
- }
- else
- {
- d = nd->getClassSDict();
}
if (d)
@@ -8686,8 +8678,8 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
- if (cd->isLinkableInProject() && cd->templateMaster()==0)
- {
+ if (cd->isLinkableInProject() && cd->templateMaster()==0)
+ {
return TRUE;
}
}