Commit 784a67d2 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Added rudimentary support for django like template system for output creation.

parent 74815268
...@@ -916,9 +916,15 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ...@@ -916,9 +916,15 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
} }
} }
bool ClassDef::hasBriefDescription() const
{
static bool briefMemberDesc = Config_getBool("BRIEF_MEMBER_DESC");
return !briefDescription().isEmpty() && briefMemberDesc;
}
void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag) void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
{ {
if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (hasBriefDescription())
{ {
ol.startParagraph(); ol.startParagraph();
ol.generateDoc(briefFile(),briefLine(),this,0, ol.generateDoc(briefFile(),briefLine(),this,0,
...@@ -929,10 +935,7 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag) ...@@ -929,10 +935,7 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
ol.enable(OutputGenerator::RTF); ol.enable(OutputGenerator::RTF);
ol.popGeneratorState(); ol.popGeneratorState();
if (Config_getBool("REPEAT_BRIEF") || if (hasDetailedDescription() || exampleFlag)
!documentation().isEmpty() ||
exampleFlag
)
{ {
writeMoreLink(ol,anchor()); writeMoreLink(ol,anchor());
} }
...@@ -990,14 +993,20 @@ void ClassDef::writeDetailedDocumentationBody(OutputList &ol) ...@@ -990,14 +993,20 @@ void ClassDef::writeDetailedDocumentationBody(OutputList &ol)
ol.endTextBlock(); ol.endTextBlock();
} }
bool ClassDef::hasDetailedDescription() const
{
static bool repeatBrief = Config_getBool("REPEAT_BRIEF");
static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
return ((!briefDescription().isEmpty() && repeatBrief) ||
!documentation().isEmpty() ||
(sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()));
}
// write the detailed description for this class // write the detailed description for this class
void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag, void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag,
const QCString &title,const QCString &anchor) const QCString &title,const QCString &anchor)
{ {
if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || if (hasDetailedDescription() || exampleFlag)
!documentation().isEmpty() ||
(Config_getBool("SOURCE_BROWSER") && getStartBodyLine()!=-1 && getBodyDef()) ||
exampleFlag)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
...@@ -1990,12 +1999,8 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page ...@@ -1990,12 +1999,8 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page
ol.endContents(); ol.endContents();
} }
// write all documentation for this class QCString ClassDef::title() const
void ClassDef::writeDocumentation(OutputList &ol)
{ {
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
//static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
//static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
QCString pageTitle; QCString pageTitle;
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
...@@ -2027,6 +2032,16 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -2027,6 +2032,16 @@ void ClassDef::writeDocumentation(OutputList &ol)
m_impl->compType == Interface && getLanguage()==SrcLangExt_ObjC ? Class : m_impl->compType, m_impl->compType == Interface && getLanguage()==SrcLangExt_ObjC ? Class : m_impl->compType,
m_impl->tempArgs != 0); m_impl->tempArgs != 0);
} }
return pageTitle;
}
// write all documentation for this class
void ClassDef::writeDocumentation(OutputList &ol)
{
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
//static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
//static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
QCString pageTitle = title();
startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView);
if (!generateTreeView) if (!generateTreeView)
...@@ -4723,4 +4738,8 @@ bool ClassDef::isExtension() const ...@@ -4723,4 +4738,8 @@ bool ClassDef::isExtension() const
return b; return b;
} }
const ClassSDict *ClassDef::innerClasses() const
{
return m_impl->innerClasses;
}
...@@ -125,6 +125,12 @@ class ClassDef : public Definition ...@@ -125,6 +125,12 @@ class ClassDef : public Definition
/** returns TRUE if this class has documentation */ /** returns TRUE if this class has documentation */
bool hasDocumentation() const; bool hasDocumentation() const;
/** returns TRUE if this class has a brief description */
bool hasBriefDescription() const;
/** returns TRUE if this class has a non-empty detailed description */
bool hasDetailedDescription() const;
/** Returns the name as it is appears in the documentation */ /** Returns the name as it is appears in the documentation */
QCString displayName(bool includeScope=TRUE) const; QCString displayName(bool includeScope=TRUE) const;
...@@ -301,6 +307,8 @@ class ClassDef : public Definition ...@@ -301,6 +307,8 @@ class ClassDef : public Definition
bool isJavaEnum() const; bool isJavaEnum() const;
bool isGeneric() const; bool isGeneric() const;
const ClassSDict *innerClasses() const;
QCString title() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// --- setters ---- // --- setters ----
......
This diff is collapsed.
This diff is collapsed.
...@@ -1815,7 +1815,7 @@ int Definition::getEndBodyLine() const ...@@ -1815,7 +1815,7 @@ int Definition::getEndBodyLine() const
return m_impl->body ? m_impl->body->endLine : -1; return m_impl->body ? m_impl->body->endLine : -1;
} }
FileDef *Definition::getBodyDef() FileDef *Definition::getBodyDef() const
{ {
return m_impl->body ? m_impl->body->fileDef : 0; return m_impl->body ? m_impl->body->fileDef : 0;
} }
......
...@@ -243,7 +243,7 @@ class Definition : public DefinitionIntf ...@@ -243,7 +243,7 @@ class Definition : public DefinitionIntf
/*! Returns the file in which the body of this item is located or 0 if no /*! Returns the file in which the body of this item is located or 0 if no
* body is available. * body is available.
*/ */
FileDef *getBodyDef(); FileDef *getBodyDef() const;
/** Returns the programming language this definition was written in. */ /** Returns the programming language this definition was written in. */
SrcLangExt getLanguage() const; SrcLangExt getLanguage() const;
......
...@@ -329,12 +329,16 @@ void DirDef::endMemberDeclarations(OutputList &ol) ...@@ -329,12 +329,16 @@ void DirDef::endMemberDeclarations(OutputList &ol)
ol.endMemberSections(); ol.endMemberSections();
} }
QCString DirDef::shortTitle() const
{
return theTranslator->trDirReference(m_shortName);
}
void DirDef::writeDocumentation(OutputList &ol) void DirDef::writeDocumentation(OutputList &ol)
{ {
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
ol.pushGeneratorState(); ol.pushGeneratorState();
QCString shortTitle=theTranslator->trDirReference(m_shortName);
QCString title=theTranslator->trDirReference(m_dispName); QCString title=theTranslator->trDirReference(m_dispName);
startFile(ol,getOutputFileBase(),name(),title,HLI_None,!generateTreeView); startFile(ol,getOutputFileBase(),name(),title,HLI_None,!generateTreeView);
...@@ -348,7 +352,7 @@ void DirDef::writeDocumentation(OutputList &ol) ...@@ -348,7 +352,7 @@ void DirDef::writeDocumentation(OutputList &ol)
startTitle(ol,getOutputFileBase()); startTitle(ol,getOutputFileBase());
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
ol.parseText(shortTitle); ol.parseText(shortTitle());
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
ol.parseText(title); ol.parseText(title);
......
...@@ -66,6 +66,7 @@ class DirDef : public Definition ...@@ -66,6 +66,7 @@ class DirDef : public Definition
const QDict<UsedDir> *usedDirs() const { return m_usedDirs; } const QDict<UsedDir> *usedDirs() const { return m_usedDirs; }
bool isParentOf(DirDef *dir) const; bool isParentOf(DirDef *dir) const;
bool depGraphIsTrivial() const; bool depGraphIsTrivial() const;
QCString shortTitle() const;
// generate output // generate output
void writeDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol);
......
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
#include "docsets.h" #include "docsets.h"
#include "formula.h" #include "formula.h"
#include "settings.h" #include "settings.h"
#include "context.h"
#define RECURSE_ENTRYTREE(func,var) \ #define RECURSE_ENTRYTREE(func,var) \
do { if (var->children()) { \ do { if (var->children()) { \
...@@ -177,6 +178,7 @@ static QDict<FileDef> g_usingDeclarations(1009); // used classes ...@@ -177,6 +178,7 @@ static QDict<FileDef> g_usingDeclarations(1009); // used classes
static FileStorage *g_storage = 0; static FileStorage *g_storage = 0;
static bool g_successfulRun = FALSE; static bool g_successfulRun = FALSE;
static bool g_dumpSymbolMap = FALSE; static bool g_dumpSymbolMap = FALSE;
static bool g_useOutputTemplate = FALSE;
void clearAll() void clearAll()
{ {
...@@ -10230,6 +10232,12 @@ void readConfiguration(int argc, char **argv) ...@@ -10230,6 +10232,12 @@ void readConfiguration(int argc, char **argv)
setvbuf(stdout,NULL,_IONBF,0); setvbuf(stdout,NULL,_IONBF,0);
Doxygen::outputToWizard=TRUE; Doxygen::outputToWizard=TRUE;
break; break;
case 'T':
msg("Warning: this option activates output generation via Django like template files. "
"This option is scheduled for doxygen 2.0, is currently incomplete and highly experimental! "
"Only use if you are a doxygen developer\n");
g_useOutputTemplate=TRUE;
break;
case 'h': case 'h':
case '?': case '?':
usage(argv[0]); usage(argv[0]);
...@@ -11310,6 +11318,17 @@ void generateOutput() ...@@ -11310,6 +11318,17 @@ void generateOutput()
g_s.end(); g_s.end();
} }
if (Config_getBool("SORT_GROUP_NAMES"))
{
Doxygen::groupSDict->sort();
GroupSDict::Iterator gli(*Doxygen::groupSDict);
GroupDef *gd;
for (gli.toFirst();(gd=gli.current());++gli)
{
gd->sortSubGroups();
}
}
writeMainPageTagFileData(); writeMainPageTagFileData();
if (g_outputList->count()>0) if (g_outputList->count()>0)
...@@ -11475,6 +11494,8 @@ void generateOutput() ...@@ -11475,6 +11494,8 @@ void generateOutput()
msg("finished...\n"); msg("finished...\n");
} }
if (g_useOutputTemplate) generateOutputViaTemplate();
/************************************************************************** /**************************************************************************
* Start cleaning up * * Start cleaning up *
**************************************************************************/ **************************************************************************/
......
...@@ -1794,3 +1794,9 @@ void FileDef::getAllIncludeFilesRecursively(QStrList &incFiles) const ...@@ -1794,3 +1794,9 @@ void FileDef::getAllIncludeFilesRecursively(QStrList &incFiles) const
QDict<void> includes(257); QDict<void> includes(257);
::getAllIncludeFilesRecursively(&includes,this,incFiles); ::getAllIncludeFilesRecursively(&includes,this,incFiles);
} }
QCString FileDef::title() const
{
return theTranslator->trFileReference(name());
}
...@@ -132,6 +132,8 @@ class FileDef : public Definition ...@@ -132,6 +132,8 @@ class FileDef : public Definition
NamespaceSDict *getNamespaceSDict() const { return m_namespaceSDict; } NamespaceSDict *getNamespaceSDict() const { return m_namespaceSDict; }
ClassSDict *getClassSDict() const { return m_classSDict; } ClassSDict *getClassSDict() const { return m_classSDict; }
QCString title() const;
//--------------------------------- //---------------------------------
void addSourceRef(int line,Definition *d,MemberDef *md); void addSourceRef(int line,Definition *d,MemberDef *md);
......
File mode changed from 100755 to 100644
...@@ -48,14 +48,14 @@ class FTextStream ...@@ -48,14 +48,14 @@ class FTextStream
inline FTextStream &FTextStream::operator<<( char c) inline FTextStream &FTextStream::operator<<( char c)
{ {
m_dev->putch(c); if (m_dev) m_dev->putch(c);
return *this; return *this;
} }
inline FTextStream &FTextStream::operator<<( const char* s) inline FTextStream &FTextStream::operator<<( const char* s)
{ {
uint len = qstrlen( s ); uint len = qstrlen( s );
m_dev->writeBlock( s, len ); if (m_dev) m_dev->writeBlock( s, len );
return *this; return *this;
} }
......
...@@ -414,38 +414,11 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part, ...@@ -414,38 +414,11 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
} }
} }
//----------------------------------------------------------------------------
static bool classHasVisibleChildren(ClassDef *cd)
{
BaseClassList *bcl;
if (cd->getLanguage()==SrcLangExt_VHDL) // reverse baseClass/subClass relation
{
if (cd->baseClasses()==0) return FALSE;
bcl=cd->baseClasses();
}
else
{
if (cd->subClasses()==0) return FALSE;
bcl=cd->subClasses();
}
BaseClassListIterator bcli(*bcl);
for ( ; bcli.current() ; ++bcli)
{
if (bcli.current()->classDef->isVisibleInHierarchy())
{
return TRUE;
}
}
return FALSE;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/*! Generates HTML Help tree of classes */ /*! Generates HTML Help tree of classes */
static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex) static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
{ {
if (bcl==0) return; if (bcl==0) return;
BaseClassListIterator bcli(*bcl); BaseClassListIterator bcli(*bcl);
...@@ -562,14 +535,6 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int ...@@ -562,14 +535,6 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static bool classVisibleInIndex(ClassDef *cd)
{
static bool allExternals = Config_getBool("ALLEXTERNALS");
return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
}
//----------------------------------------------------------------------------
static bool dirHasVisibleChildren(DirDef *dd) static bool dirHasVisibleChildren(DirDef *dd)
{ {
if (dd->hasDocumentation()) return TRUE; if (dd->hasDocumentation()) return TRUE;
...@@ -1409,39 +1374,6 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO ...@@ -1409,39 +1374,6 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
} }
} }
static bool containsVisibleChild(NamespaceDef *nd,bool includeClasses)
{
if (nd->getNamespaceSDict())
{
NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict());
NamespaceDef *cnd;
for (cnli.toFirst();(cnd=cnli.current());++cnli)
{
if (cnd->isLinkable() && cnd->localName().find('@')==-1)
{
return TRUE;
}
else if (containsVisibleChild(cnd,includeClasses))
{
return TRUE;
}
}
}
if (includeClasses && nd->getClassSDict())
{
ClassSDict::Iterator cli(*nd->getClassSDict());
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
return TRUE;
}
}
}
return FALSE;
}
static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv, static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
bool rootOnly,bool showClasses,bool addToIndex) bool rootOnly,bool showClasses,bool addToIndex)
{ {
...@@ -1455,7 +1387,7 @@ static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv, ...@@ -1455,7 +1387,7 @@ static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
(!rootOnly || nd->getOuterScope()==Doxygen::globalScope)) (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
{ {
bool hasChildren = containsVisibleChild(nd,showClasses); bool hasChildren = namespaceHasVisibleChild(nd,showClasses);
bool isLinkable = nd->isLinkableInProject(); bool isLinkable = nd->isLinkableInProject();
QCString ref; QCString ref;
...@@ -3562,7 +3494,6 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ...@@ -3562,7 +3494,6 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp*
if (gd->getSubGroups()->count()>0) if (gd->getSubGroups()->count()>0)
{ {
startIndexHierarchy(ol,level+1); startIndexHierarchy(ol,level+1);
if (Config_getBool("SORT_GROUP_NAMES")) gd->sortSubGroups();
QListIterator<GroupDef> gli(*gd->getSubGroups()); QListIterator<GroupDef> gli(*gd->getSubGroups());
GroupDef *subgd = 0; GroupDef *subgd = 0;
for (gli.toFirst();(subgd=gli.current());++gli) for (gli.toFirst();(subgd=gli.current());++gli)
...@@ -3596,10 +3527,6 @@ static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) ...@@ -3596,10 +3527,6 @@ static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
} }
startIndexHierarchy(ol,0); startIndexHierarchy(ol,0);
if (Config_getBool("SORT_GROUP_NAMES"))
{
Doxygen::groupSDict->sort();
}
GroupSDict::Iterator gli(*Doxygen::groupSDict); GroupSDict::Iterator gli(*Doxygen::groupSDict);
GroupDef *gd; GroupDef *gd;
for (gli.toFirst();(gd=gli.current());++gli) for (gli.toFirst();(gd=gli.current());++gli)
......
...@@ -30,6 +30,7 @@ HEADERS = arguments.h \ ...@@ -30,6 +30,7 @@ HEADERS = arguments.h \
compound.xsd.h \ compound.xsd.h \
condparser.h \ condparser.h \
config.h \ config.h \
context.h \
constexp.h \ constexp.h \
cppvalue.h \ cppvalue.h \
debug.h \ debug.h \
...@@ -129,6 +130,7 @@ HEADERS = arguments.h \ ...@@ -129,6 +130,7 @@ HEADERS = arguments.h \
store.h \ store.h \
tagreader.h \ tagreader.h \
tclscanner.h \ tclscanner.h \
template.h \
textdocvisitor.h \ textdocvisitor.h \
tooltip.h \ tooltip.h \
translator.h \ translator.h \
...@@ -155,6 +157,7 @@ SOURCES = arguments.cpp \ ...@@ -155,6 +157,7 @@ SOURCES = arguments.cpp \
commentcnv.cpp \ commentcnv.cpp \
commentscan.cpp \ commentscan.cpp \
condparser.cpp \ condparser.cpp \
context.cpp \
cppvalue.cpp \ cppvalue.cpp \
dbusxmlscanner.cpp \ dbusxmlscanner.cpp \
debug.cpp \ debug.cpp \
...@@ -224,6 +227,7 @@ SOURCES = arguments.cpp \ ...@@ -224,6 +227,7 @@ SOURCES = arguments.cpp \
store.cpp \ store.cpp \
tagreader.cpp \ tagreader.cpp \
tclscanner.cpp \ tclscanner.cpp \
template.cpp \
textdocvisitor.cpp \ textdocvisitor.cpp \
tooltip.cpp \ tooltip.cpp \
util.cpp \ util.cpp \
...@@ -239,8 +243,8 @@ SOURCES = arguments.cpp \ ...@@ -239,8 +243,8 @@ SOURCES = arguments.cpp \
win32:TMAKE_CXXFLAGS += -DQT_NODLL win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-msvc:TMAKE_CXXFLAGS += -Zm200 win32-msvc:TMAKE_CXXFLAGS += -Zm200
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti win32-g++:TMAKE_CXXFLAGS += -fno-exceptions
linux-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti linux-g++:TMAKE_CXXFLAGS += -fno-exceptions
INCLUDEPATH += ../qtools INCLUDEPATH += ../qtools
#INCLUDEPATH += ../libpng #INCLUDEPATH += ../libpng
INCLUDEPATH += ../libmd5 INCLUDEPATH += ../libmd5
......
...@@ -460,27 +460,8 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -460,27 +460,8 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
//static bool outputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); //static bool outputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
//static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); //static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
SrcLangExt lang = getLanguage();
QCString pageTitle; QCString pageTitle = title();
if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
{
pageTitle = theTranslator->trPackage(displayName());
}
else if (lang==SrcLangExt_Fortran)
{
pageTitle = theTranslator->trModuleReference(displayName());
}
else if (lang==SrcLangExt_IDL)
{
pageTitle = isConstantGroup()
? theTranslator->trConstantGroupReference(displayName())
: theTranslator->trModuleReference(displayName());
}
else
{
pageTitle = theTranslator->trNamespaceReference(displayName());
}
startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_NamespaceVisible,!generateTreeView); startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_NamespaceVisible,!generateTreeView);
if (!generateTreeView) if (!generateTreeView)
...@@ -522,6 +503,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -522,6 +503,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
//---------------------------------------- start flexible part ------------------------------- //---------------------------------------- start flexible part -------------------------------
SrcLangExt lang = getLanguage();
QListIterator<LayoutDocEntry> eli( QListIterator<LayoutDocEntry> eli(
LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
LayoutDocEntry *lde; LayoutDocEntry *lde;
...@@ -1096,3 +1078,27 @@ MemberDef * NamespaceDef::getMemberByName(const QCString &n) const ...@@ -1096,3 +1078,27 @@ MemberDef * NamespaceDef::getMemberByName(const QCString &n) const
return md; return md;
} }
QCString NamespaceDef::title() const
{
SrcLangExt lang = getLanguage();
QCString pageTitle;
if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
{
pageTitle = theTranslator->trPackage(displayName());
}
else if (lang==SrcLangExt_Fortran)
{
pageTitle = theTranslator->trModuleReference(displayName());
}
else if (lang==SrcLangExt_IDL)
{
pageTitle = isConstantGroup()
? theTranslator->trConstantGroupReference(displayName())
: theTranslator->trModuleReference(displayName());
}
else
{
pageTitle = theTranslator->trNamespaceReference(displayName());
}
return pageTitle;
}
...@@ -92,6 +92,8 @@ class NamespaceDef : public Definition ...@@ -92,6 +92,8 @@ class NamespaceDef : public Definition
/*! Returns the namespaces contained in this namespace */ /*! Returns the namespaces contained in this namespace */
NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; }
QCString title() const;
bool visited; bool visited;
private: private:
......
This diff is collapsed.
This diff is collapsed.
...@@ -5076,6 +5076,34 @@ static void initBaseClassHierarchy(BaseClassList *bcl) ...@@ -5076,6 +5076,34 @@ static void initBaseClassHierarchy(BaseClassList *bcl)
cd->visited=FALSE; cd->visited=FALSE;
} }
} }
//----------------------------------------------------------------------------
bool classHasVisibleChildren(ClassDef *cd)
{
BaseClassList *bcl;
if (cd->getLanguage()==SrcLangExt_VHDL) // reverse baseClass/subClass relation
{
if (cd->baseClasses()==0) return FALSE;
bcl=cd->baseClasses();
}
else
{
if (cd->subClasses()==0) return FALSE;
bcl=cd->subClasses();
}
BaseClassListIterator bcli(*bcl);
for ( ; bcli.current() ; ++bcli)
{
if (bcli.current()->classDef->isVisibleInHierarchy())
{
return TRUE;
}
}
return FALSE;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -7988,3 +8016,44 @@ uint getUtf8CodeToUpper( const QCString& s, int idx ) ...@@ -7988,3 +8016,44 @@ uint getUtf8CodeToUpper( const QCString& s, int idx )
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses)
{
if (nd->getNamespaceSDict())
{
NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict());
NamespaceDef *cnd;
for (cnli.toFirst();(cnd=cnli.current());++cnli)
{
if (cnd->isLinkable() && cnd->localName().find('@')==-1)
{
return TRUE;
}
else if (namespaceHasVisibleChild(cnd,includeClasses))
{
return TRUE;
}
}
}
if (includeClasses && nd->getClassSDict())
{
ClassSDict::Iterator cli(*nd->getClassSDict());
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
return TRUE;
}
}
}
return FALSE;
}
//----------------------------------------------------------------------------
bool classVisibleInIndex(ClassDef *cd)
{
static bool allExternals = Config_getBool("ALLEXTERNALS");
return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
}
...@@ -257,6 +257,9 @@ QCString replaceAnonymousScopes(const QCString &s,const char *replacement=0); ...@@ -257,6 +257,9 @@ QCString replaceAnonymousScopes(const QCString &s,const char *replacement=0);
void initClassHierarchy(ClassSDict *cl); void initClassHierarchy(ClassSDict *cl);
bool hasVisibleRoot(BaseClassList *bcl); bool hasVisibleRoot(BaseClassList *bcl);
bool classHasVisibleChildren(ClassDef *cd);
bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses);
bool classVisibleInIndex(ClassDef *cd);
int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level=0); int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level=0);
Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection prot=Public,int level=0); Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection prot=Public,int level=0);
...@@ -443,5 +446,7 @@ uint getUtf8Code( const QCString& s, int idx ); ...@@ -443,5 +446,7 @@ uint getUtf8Code( const QCString& s, int idx );
uint getUtf8CodeToLower( const QCString& s, int idx ); uint getUtf8CodeToLower( const QCString& s, int idx );
uint getUtf8CodeToUpper( const QCString& s, int idx ); uint getUtf8CodeToUpper( const QCString& s, int idx );
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment