Loading src/context.cpp +302 −271 Original line number Original line Diff line number Diff line Loading @@ -666,6 +666,18 @@ class TranslateContext::Private : public PropertyMapper static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool extractAll = Config_getBool("EXTRACT_ALL"); return theTranslator->trNamespaceMemberDescription(extractAll); return theTranslator->trNamespaceMemberDescription(extractAll); } } TemplateVariant classHierarchyDescription() const { return theTranslator->trClassHierarchyDescription(); } TemplateVariant gotoGraphicalHierarchy() const { return theTranslator->trGotoGraphicalHierarchy(); } TemplateVariant gotoTextualHierarchy() const { return theTranslator->trGotoTextualHierarchy(); } TemplateVariant classMembersDescription() const TemplateVariant classMembersDescription() const { { static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool extractAll = Config_getBool("EXTRACT_ALL"); Loading Loading @@ -1012,6 +1024,12 @@ class TranslateContext::Private : public PropertyMapper addProperty("macros", this,&Private::macros); addProperty("macros", this,&Private::macros); //%% string namespaceMembersDescription //%% string namespaceMembersDescription addProperty("namespaceMembersDescription",this,&Private::namespaceMembersDescription); addProperty("namespaceMembersDescription",this,&Private::namespaceMembersDescription); //%% string classHierarchyDescription addProperty("classHierarchyDescription",this,&Private::classHierarchyDescription); //%% string gotoGraphicalHierarchy addProperty("gotoGraphicalHierarchy",this,&Private::gotoGraphicalHierarchy); //%% string gotoTextualHierarchy addProperty("gotoTextualHierarchy",this,&Private::gotoTextualHierarchy); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); Loading Loading @@ -4822,194 +4840,74 @@ TemplateVariant ClassIndexContext::get(const char *n) const //------------------------------------------------------------------------ //------------------------------------------------------------------------ //%% struct ClassInheritanceNode: node in inheritance tree static int computeMaxDepth(const TemplateListIntf *list) //%% { class ClassInheritanceNodeContext::Private : public PropertyMapper { public: Private(ClassDef *cd) : m_classDef(cd) { //%% bool is_leaf_node: true if this node does not have any children addProperty("is_leaf_node",this,&Private::isLeafNode); //%% ClassInheritance children: list of nested classes/namespaces addProperty("children",this,&Private::children); //%% Class class: class info addProperty("class",this,&Private::getClass); } void addChildren(const BaseClassList *bcl,bool hideSuper) { { if (bcl==0) return; int maxDepth=0; BaseClassListIterator bcli(*bcl); if (list) BaseClassDef *bcd; for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) { { ClassDef *cd=bcd->classDef; TemplateListIntf::ConstIterator *it = list->createIterator(); if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { { continue; const TemplateStructIntf *s = v.toStruct(); TemplateVariant child = s->get("children"); int d = computeMaxDepth(child.toList())+1; if (d>maxDepth) maxDepth=d; } } delete it; bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { b=hasVisibleRoot(cd->subClasses()); } } else return maxDepth; { b=hasVisibleRoot(cd->baseClasses()); } } if (cd->isVisibleInHierarchy() && b) // hasVisibleRoot(cd->baseClasses())) static int computeNumNodesAtLevel(const TemplateStructIntf *s,int level,int maxLevel) { bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd); ClassInheritanceNodeContext *tnc = new ClassInheritanceNodeContext(cd); m_children.append(tnc); if (hasChildren) { { //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited); int num=0; bool wasVisited=cd->visited; if (level<maxLevel) cd->visited=TRUE; if (cd->getLanguage()==SrcLangExt_VHDL) { { tnc->addChildren(cd->baseClasses(),wasVisited); num++; } TemplateVariant child = s->get("children"); else if (child.toList()) { { tnc->addChildren(cd->subClasses(),wasVisited); TemplateListIntf::ConstIterator *it = child.toList()->createIterator(); } TemplateVariant v; } for (it->toFirst();it->current(v);it->toNext()) } } } TemplateVariant isLeafNode() const { { return m_children.isEmpty(); num+=computeNumNodesAtLevel(v.toStruct(),level+1,maxLevel); } } TemplateVariant children() const delete it; { return TemplateVariant(&m_children); } } TemplateVariant getClass() const { if (!m_cache.classContext) { m_cache.classContext.reset(ClassContext::alloc(m_classDef)); } } return m_cache.classContext.get(); return num; } } private: ClassDef *m_classDef; GenericNodeListContext m_children; struct Cachable { SharedPtr<ClassContext> classContext; }; mutable Cachable m_cache; }; //%% } ClassInheritanceNodeContext::ClassInheritanceNodeContext(ClassDef *cd) : RefCountedContext("ClassInheritanceNodeContext") static int computePreferredDepth(const TemplateListIntf *list,int maxDepth) { { p = new Private(cd); int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); } int preferredDepth=1; if (preferredNumEntries>0) ClassInheritanceNodeContext::~ClassInheritanceNodeContext() { { delete p; int depth = maxDepth; } for (int i=1;i<=depth;i++) TemplateVariant ClassInheritanceNodeContext::get(const char *n) const { { return p->get(n); int num=0; } TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; void ClassInheritanceNodeContext::addChildren(const BaseClassList *bcl,bool hideSuper) for (it->toFirst();it->current(v);it->toNext()) { { p->addChildren(bcl,hideSuper); num+=computeNumNodesAtLevel(v.toStruct(),0,i); } } delete it; //------------------------------------------------------------------------ if (num<=preferredNumEntries) //%% list ClassInheritance[ClassInheritanceNode]: list of classes class ClassInheritanceContext::Private : public GenericNodeListContext { public: void addClasses(const ClassSDict &classSDict) { ClassSDict::Iterator cli(classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { { continue; preferredDepth=i; } b=!hasVisibleRoot(cd->subClasses()); } } else else { { b=!hasVisibleRoot(cd->baseClasses()); break; } if (b) { if (cd->isVisibleInHierarchy()) // should it be visible { // new root level class ClassInheritanceNodeContext *tnc = ClassInheritanceNodeContext::alloc(cd); append(tnc); bool hasChildren = !cd->visited && classHasVisibleChildren(cd); if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren) { tnc->addChildren(cd->baseClasses(),cd->visited); cd->visited=TRUE; } else if (hasChildren) { tnc->addChildren(cd->subClasses(),cd->visited); cd->visited=TRUE; } } } } } }; ClassInheritanceContext::ClassInheritanceContext() : RefCountedContext("ClassInheritanceContext") { p = new Private; initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); p->addClasses(*Doxygen::classSDict); p->addClasses(*Doxygen::hiddenClasses); } ClassInheritanceContext::~ClassInheritanceContext() { delete p; } } // TemplateListIntf int ClassInheritanceContext::count() const { return (int)p->count(); } } TemplateVariant ClassInheritanceContext::at(int index) const { TemplateVariant result; if (index>=0 && index<count()) { result = p->at(index); } } return result; return preferredDepth; } TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const { return p->createIterator(); } } //------------------------------------------------------------------------ //------------------------------------------------------------------------ Loading @@ -5019,13 +4917,27 @@ TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const class ClassHierarchyContext::Private : public PropertyMapper class ClassHierarchyContext::Private : public PropertyMapper { { public: public: TemplateVariant tree() const Private() { if (!m_cache.classTree) { { m_cache.classTree.reset(ClassInheritanceContext::alloc()); m_classTree.reset(NestingContext::alloc(0,0)); initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); m_classTree->addClassHierarchy(*Doxygen::classSDict,TRUE); m_classTree->addClassHierarchy(*Doxygen::hiddenClasses,TRUE); //%% ClassInheritance tree addProperty("tree", this,&Private::tree); addProperty("fileName", this,&Private::fileName); addProperty("relPath", this,&Private::relPath); addProperty("highlight", this,&Private::highlight); addProperty("subhighlight", this,&Private::subhighlight); addProperty("title", this,&Private::title); addProperty("preferredDepth", this,&Private::preferredDepth); addProperty("maxDepth", this,&Private::maxDepth); addProperty("diagrams", this,&Private::diagrams); } } return m_cache.classTree.get(); TemplateVariant tree() const { return m_classTree.get(); } } TemplateVariant fileName() const TemplateVariant fileName() const { { Loading @@ -5043,6 +4955,34 @@ class ClassHierarchyContext::Private : public PropertyMapper { { return "classhierarchy"; return "classhierarchy"; } } DotGfxHierarchyTable *getHierarchy() const { if (!m_cache.hierarchy) { m_cache.hierarchy.reset(new DotGfxHierarchyTable()); } return m_cache.hierarchy.get(); } TemplateVariant diagrams() const { if (!m_cache.diagrams) { TemplateList *diagrams = TemplateList::alloc(); DotGfxHierarchyTable *hierarchy = getHierarchy(); if (hierarchy->subGraphs()) { int id=0; QListIterator<DotNode> li(*hierarchy->subGraphs()); DotNode *n; for (li.toFirst();(n=li.current());++li) { diagrams->append(InheritanceGraphContext::alloc(hierarchy,n,id++)); } } m_cache.diagrams.reset(diagrams); } return m_cache.diagrams.get(); } TemplateVariant title() const TemplateVariant title() const { { static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); Loading @@ -5055,20 +4995,36 @@ class ClassHierarchyContext::Private : public PropertyMapper return theTranslator->trClassHierarchy(); return theTranslator->trClassHierarchy(); } } } } Private() TemplateVariant maxDepth() const { { //%% ClassInheritance tree if (!m_cache.maxDepthComputed) addProperty("tree",this,&Private::tree); { addProperty("fileName",this,&Private::fileName); m_cache.maxDepth = computeMaxDepth(m_classTree.get()); addProperty("relPath",this,&Private::relPath); m_cache.maxDepthComputed=TRUE; addProperty("highlight",this,&Private::highlight); } addProperty("subhighlight",this,&Private::subhighlight); return m_cache.maxDepth; addProperty("title",this,&Private::title); } TemplateVariant preferredDepth() const { if (!m_cache.preferredDepthComputed) { m_cache.preferredDepth = computePreferredDepth(m_classTree.get(),maxDepth().toInt()); m_cache.preferredDepthComputed=TRUE; } return m_cache.preferredDepth; } } private: private: SharedPtr<NestingContext> m_classTree; struct Cachable struct Cachable { { SharedPtr<ClassInheritanceContext> classTree; Cachable() : maxDepth(0), maxDepthComputed(FALSE), preferredDepth(0), preferredDepthComputed(FALSE), hierarchy(0) {} int maxDepth; bool maxDepthComputed; int preferredDepth; bool preferredDepthComputed; SharedPtr<TemplateList> diagrams; ScopedPtr<DotGfxHierarchyTable> hierarchy; }; }; mutable Cachable m_cache; mutable Cachable m_cache; }; }; Loading Loading @@ -5097,7 +5053,7 @@ class NestingNodeContext::Private : public PropertyMapper { { public: public: Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, Definition *d,int index,int level,bool addCls) Definition *d,int index,int level,bool addCls,bool inherit, bool hideSuper) : m_parent(parent), m_def(d), m_level(level), m_index(index) : m_parent(parent), m_def(d), m_level(level), m_index(index) { { m_children.reset(NestingContext::alloc(thisNode,level+1)); m_children.reset(NestingContext::alloc(thisNode,level+1)); Loading Loading @@ -5131,7 +5087,7 @@ class NestingNodeContext::Private : public PropertyMapper addProperty("fileName",this,&Private::fileName); addProperty("fileName",this,&Private::fileName); addNamespaces(addCls); addNamespaces(addCls); addClasses(); addClasses(inherit,hideSuper); addDirFiles(); addDirFiles(); addPages(); addPages(); addModules(); addModules(); Loading Loading @@ -5283,14 +5239,36 @@ class NestingNodeContext::Private : public PropertyMapper return m_def->getOutputFileBase(); return m_def->getOutputFileBase(); } } void addClasses() //------------------------------------------------------------------ void addClasses(bool inherit, bool hideSuper) { { ClassDef *cd = m_def->definitionType()==Definition::TypeClass ? (ClassDef*)m_def : 0; ClassDef *cd = m_def->definitionType()==Definition::TypeClass ? (ClassDef*)m_def : 0; if (inherit) { bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd); if (hasChildren) { bool wasVisited=cd->visited; cd->visited=TRUE; if (cd->getLanguage()==SrcLangExt_VHDL) { m_children->addDerivedClasses(cd->baseClasses(),wasVisited); } else { m_children->addDerivedClasses(cd->subClasses(),wasVisited); } } } else { if (cd && cd->getClassSDict()) if (cd && cd->getClassSDict()) { { m_children->addClasses(*cd->getClassSDict(),FALSE); m_children->addClasses(*cd->getClassSDict(),FALSE); } } } } } void addNamespaces(bool addClasses) void addNamespaces(bool addClasses) { { NamespaceDef *nd = m_def->definitionType()==Definition::TypeNamespace ? (NamespaceDef*)m_def : 0; NamespaceDef *nd = m_def->definitionType()==Definition::TypeNamespace ? (NamespaceDef*)m_def : 0; Loading Loading @@ -5352,9 +5330,10 @@ class NestingNodeContext::Private : public PropertyMapper //%% } //%% } NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, Definition *d,int index,int level,bool addClass) : RefCountedContext("NestingNodeContext") Definition *d,int index,int level,bool addClass,bool inherit,bool hideSuper) : RefCountedContext("NestingNodeContext") { { p = new Private(parent,this,d,index,level,addClass); p = new Private(parent,this,d,index,level,addClass,inherit,hideSuper); } } NestingNodeContext::~NestingNodeContext() NestingNodeContext::~NestingNodeContext() Loading Loading @@ -5394,7 +5373,7 @@ class NestingContext::Private : public GenericNodeListContext bool isLinkable = nd->isLinkableInProject(); bool isLinkable = nd->isLinkableInProject(); if (isLinkable || hasChildren) if (isLinkable || hasChildren) { { NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,nd,m_index,m_level,addClasses); NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,nd,m_index,m_level,addClasses,FALSE,FALSE); append(nnc); append(nnc); m_index++; m_index++; } } Loading Loading @@ -5423,7 +5402,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (classVisibleInIndex(cd) && cd->templateMaster()==0) if (classVisibleInIndex(cd) && cd->templateMaster()==0) { { NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE); NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,FALSE,FALSE); append(nnc); append(nnc); m_index++; m_index++; } } Loading @@ -5438,7 +5417,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (dd->getOuterScope()==Doxygen::globalScope) if (dd->getOuterScope()==Doxygen::globalScope) { { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5449,7 +5428,7 @@ class NestingContext::Private : public GenericNodeListContext DirDef *dd; DirDef *dd; for (li.toFirst();(dd=li.current());++li) for (li.toFirst();(dd=li.current());++li) { { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5465,7 +5444,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (fd->getDirDef()==0) // top level file if (fd->getDirDef()==0) // top level file { { append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5477,7 +5456,7 @@ class NestingContext::Private : public GenericNodeListContext FileDef *fd; FileDef *fd; for (li.toFirst();(fd=li.current());++li) for (li.toFirst();(fd=li.current());++li) { { append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5491,7 +5470,7 @@ class NestingContext::Private : public GenericNodeListContext pd->getOuterScope()==0 || pd->getOuterScope()==0 || pd->getOuterScope()->definitionType()!=Definition::TypePage) pd->getOuterScope()->definitionType()!=Definition::TypePage) { { append(NestingNodeContext::alloc(m_parent,pd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,pd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5507,7 +5486,7 @@ class NestingContext::Private : public GenericNodeListContext (!gd->isReference() || externalGroups) (!gd->isReference() || externalGroups) ) ) { { append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5520,11 +5499,74 @@ class NestingContext::Private : public GenericNodeListContext { { if (gd->isVisible()) if (gd->isVisible()) { { append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } } } void addDerivedClasses(const BaseClassList *bcl,bool hideSuper) { if (bcl==0) return; BaseClassListIterator bcli(*bcl); BaseClassDef *bcd; for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) { ClassDef *cd=bcd->classDef; if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { continue; } bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { b=hasVisibleRoot(cd->subClasses()); } else { b=hasVisibleRoot(cd->baseClasses()); } if (cd->isVisibleInHierarchy() && b) { NestingNodeContext *tnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,TRUE,hideSuper); append(tnc); m_index++; } } } void addClassHierarchy(const ClassSDict &classSDict,bool) { ClassSDict::Iterator cli(classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { continue; } b=!hasVisibleRoot(cd->subClasses()); } else { b=!hasVisibleRoot(cd->baseClasses()); } if (b) { if (cd->isVisibleInHierarchy()) // should it be visible { // new root level class NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,TRUE,cd->visited); append(nnc); m_index++; } } } } private: private: const NestingNodeContext *m_parent; const NestingNodeContext *m_parent; int m_level; int m_level; Loading Loading @@ -5602,78 +5644,17 @@ void NestingContext::addModules(const GroupList &modules) p->addModules(modules); p->addModules(modules); } } //------------------------------------------------------------------------ void NestingContext::addClassHierarchy(const ClassSDict &classSDict,bool rootOnly) static int computeMaxDepth(const TemplateListIntf *list) { int maxDepth=0; if (list) { TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { const TemplateStructIntf *s = v.toStruct(); TemplateVariant child = s->get("children"); int d = computeMaxDepth(child.toList())+1; if (d>maxDepth) maxDepth=d; } delete it; } return maxDepth; } static int computeNumNodesAtLevel(const TemplateStructIntf *s,int level,int maxLevel) { { int num=0; p->addClassHierarchy(classSDict,rootOnly); if (level<maxLevel) { num++; TemplateVariant child = s->get("children"); if (child.toList()) { TemplateListIntf::ConstIterator *it = child.toList()->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { num+=computeNumNodesAtLevel(v.toStruct(),level+1,maxLevel); } delete it; } } return num; } } static int computePreferredDepth(const TemplateListIntf *list,int maxDepth) void NestingContext::addDerivedClasses(const BaseClassList *bcl,bool hideSuper) { int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); int preferredDepth=1; if (preferredNumEntries>0) { int depth = maxDepth; for (int i=1;i<=depth;i++) { { int num=0; p->addDerivedClasses(bcl,hideSuper); TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { num+=computeNumNodesAtLevel(v.toStruct(),0,i); } delete it; if (num<=preferredNumEntries) { preferredDepth=i; } else { break; } } } return preferredDepth; } } //------------------------------------------------------------------------ //%% struct ClassTree: Class nesting relations //%% struct ClassTree: Class nesting relations //%% { //%% { Loading Loading @@ -7049,6 +7030,56 @@ TemplateVariant NamespaceMembersIndexContext::get(const char *name) const return p->get(name); return p->get(name); } } //------------------------------------------------------------------------ //%% struct InheritanceGraph: a connected graph reprenting part of the overall interitance tree //%% { class InheritanceGraphContext::Private : public PropertyMapper { public: Private(DotGfxHierarchyTable *hierarchy,DotNode *n,int id) : m_hierarchy(hierarchy), m_node(n), m_id(id) { addProperty("graph",this,&Private::graph); } TemplateVariant graph() const { QGString result; static bool haveDot = Config_getBool("HAVE_DOT"); static bool graphicalHierarchy = Config_getBool("GRAPHICAL_HIERARCHY"); if (haveDot && graphicalHierarchy) { FTextStream t(&result); m_hierarchy->createGraph(m_node,t, /*GOF_BITMAP, EOF_Html,*/ g_globals.outputDir, g_globals.outputDir+portable_pathSeparator()+"inherits"+Doxygen::htmlFileExtension, m_id); } return TemplateVariant(result.data(),TRUE); } private: DotGfxHierarchyTable *m_hierarchy; DotNode *m_node; int m_id; }; InheritanceGraphContext::InheritanceGraphContext(DotGfxHierarchyTable *hierarchy,DotNode *n,int id) : RefCountedContext("InheritanceGraphContext") { p = new Private(hierarchy,n,id); } InheritanceGraphContext::~InheritanceGraphContext() { delete p; } TemplateVariant InheritanceGraphContext::get(const char *name) const { return p->get(name); } //------------------------------------------------------------------------ //------------------------------------------------------------------------ Loading Loading @@ -8086,7 +8117,7 @@ class HtmlSpaceless : public TemplateSpacelessIntf { { m_insideString='\0'; m_insideString='\0'; } } else // start of string else if (m_insideString=='\0') // start of string { { m_insideString=c; m_insideString=c; } } Loading @@ -8111,8 +8142,8 @@ class HtmlSpaceless : public TemplateSpacelessIntf } } } } result+='\0'; result+='\0'; //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%d removeSpaces=%d\n",s.data(),result.data(), //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%c (%d) removeSpaces=%d\n",s.data(),result.data(), // m_insideTag,m_insideString,m_removeSpaces); // m_insideTag,m_insideString,m_insideString,m_removeSpaces); return result.data(); return result.data(); } } private: private: Loading Loading
src/context.cpp +302 −271 Original line number Original line Diff line number Diff line Loading @@ -666,6 +666,18 @@ class TranslateContext::Private : public PropertyMapper static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool extractAll = Config_getBool("EXTRACT_ALL"); return theTranslator->trNamespaceMemberDescription(extractAll); return theTranslator->trNamespaceMemberDescription(extractAll); } } TemplateVariant classHierarchyDescription() const { return theTranslator->trClassHierarchyDescription(); } TemplateVariant gotoGraphicalHierarchy() const { return theTranslator->trGotoGraphicalHierarchy(); } TemplateVariant gotoTextualHierarchy() const { return theTranslator->trGotoTextualHierarchy(); } TemplateVariant classMembersDescription() const TemplateVariant classMembersDescription() const { { static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool extractAll = Config_getBool("EXTRACT_ALL"); Loading Loading @@ -1012,6 +1024,12 @@ class TranslateContext::Private : public PropertyMapper addProperty("macros", this,&Private::macros); addProperty("macros", this,&Private::macros); //%% string namespaceMembersDescription //%% string namespaceMembersDescription addProperty("namespaceMembersDescription",this,&Private::namespaceMembersDescription); addProperty("namespaceMembersDescription",this,&Private::namespaceMembersDescription); //%% string classHierarchyDescription addProperty("classHierarchyDescription",this,&Private::classHierarchyDescription); //%% string gotoGraphicalHierarchy addProperty("gotoGraphicalHierarchy",this,&Private::gotoGraphicalHierarchy); //%% string gotoTextualHierarchy addProperty("gotoTextualHierarchy",this,&Private::gotoTextualHierarchy); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); Loading Loading @@ -4822,194 +4840,74 @@ TemplateVariant ClassIndexContext::get(const char *n) const //------------------------------------------------------------------------ //------------------------------------------------------------------------ //%% struct ClassInheritanceNode: node in inheritance tree static int computeMaxDepth(const TemplateListIntf *list) //%% { class ClassInheritanceNodeContext::Private : public PropertyMapper { public: Private(ClassDef *cd) : m_classDef(cd) { //%% bool is_leaf_node: true if this node does not have any children addProperty("is_leaf_node",this,&Private::isLeafNode); //%% ClassInheritance children: list of nested classes/namespaces addProperty("children",this,&Private::children); //%% Class class: class info addProperty("class",this,&Private::getClass); } void addChildren(const BaseClassList *bcl,bool hideSuper) { { if (bcl==0) return; int maxDepth=0; BaseClassListIterator bcli(*bcl); if (list) BaseClassDef *bcd; for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) { { ClassDef *cd=bcd->classDef; TemplateListIntf::ConstIterator *it = list->createIterator(); if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { { continue; const TemplateStructIntf *s = v.toStruct(); TemplateVariant child = s->get("children"); int d = computeMaxDepth(child.toList())+1; if (d>maxDepth) maxDepth=d; } } delete it; bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { b=hasVisibleRoot(cd->subClasses()); } } else return maxDepth; { b=hasVisibleRoot(cd->baseClasses()); } } if (cd->isVisibleInHierarchy() && b) // hasVisibleRoot(cd->baseClasses())) static int computeNumNodesAtLevel(const TemplateStructIntf *s,int level,int maxLevel) { bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd); ClassInheritanceNodeContext *tnc = new ClassInheritanceNodeContext(cd); m_children.append(tnc); if (hasChildren) { { //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited); int num=0; bool wasVisited=cd->visited; if (level<maxLevel) cd->visited=TRUE; if (cd->getLanguage()==SrcLangExt_VHDL) { { tnc->addChildren(cd->baseClasses(),wasVisited); num++; } TemplateVariant child = s->get("children"); else if (child.toList()) { { tnc->addChildren(cd->subClasses(),wasVisited); TemplateListIntf::ConstIterator *it = child.toList()->createIterator(); } TemplateVariant v; } for (it->toFirst();it->current(v);it->toNext()) } } } TemplateVariant isLeafNode() const { { return m_children.isEmpty(); num+=computeNumNodesAtLevel(v.toStruct(),level+1,maxLevel); } } TemplateVariant children() const delete it; { return TemplateVariant(&m_children); } } TemplateVariant getClass() const { if (!m_cache.classContext) { m_cache.classContext.reset(ClassContext::alloc(m_classDef)); } } return m_cache.classContext.get(); return num; } } private: ClassDef *m_classDef; GenericNodeListContext m_children; struct Cachable { SharedPtr<ClassContext> classContext; }; mutable Cachable m_cache; }; //%% } ClassInheritanceNodeContext::ClassInheritanceNodeContext(ClassDef *cd) : RefCountedContext("ClassInheritanceNodeContext") static int computePreferredDepth(const TemplateListIntf *list,int maxDepth) { { p = new Private(cd); int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); } int preferredDepth=1; if (preferredNumEntries>0) ClassInheritanceNodeContext::~ClassInheritanceNodeContext() { { delete p; int depth = maxDepth; } for (int i=1;i<=depth;i++) TemplateVariant ClassInheritanceNodeContext::get(const char *n) const { { return p->get(n); int num=0; } TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; void ClassInheritanceNodeContext::addChildren(const BaseClassList *bcl,bool hideSuper) for (it->toFirst();it->current(v);it->toNext()) { { p->addChildren(bcl,hideSuper); num+=computeNumNodesAtLevel(v.toStruct(),0,i); } } delete it; //------------------------------------------------------------------------ if (num<=preferredNumEntries) //%% list ClassInheritance[ClassInheritanceNode]: list of classes class ClassInheritanceContext::Private : public GenericNodeListContext { public: void addClasses(const ClassSDict &classSDict) { ClassSDict::Iterator cli(classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { { continue; preferredDepth=i; } b=!hasVisibleRoot(cd->subClasses()); } } else else { { b=!hasVisibleRoot(cd->baseClasses()); break; } if (b) { if (cd->isVisibleInHierarchy()) // should it be visible { // new root level class ClassInheritanceNodeContext *tnc = ClassInheritanceNodeContext::alloc(cd); append(tnc); bool hasChildren = !cd->visited && classHasVisibleChildren(cd); if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren) { tnc->addChildren(cd->baseClasses(),cd->visited); cd->visited=TRUE; } else if (hasChildren) { tnc->addChildren(cd->subClasses(),cd->visited); cd->visited=TRUE; } } } } } }; ClassInheritanceContext::ClassInheritanceContext() : RefCountedContext("ClassInheritanceContext") { p = new Private; initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); p->addClasses(*Doxygen::classSDict); p->addClasses(*Doxygen::hiddenClasses); } ClassInheritanceContext::~ClassInheritanceContext() { delete p; } } // TemplateListIntf int ClassInheritanceContext::count() const { return (int)p->count(); } } TemplateVariant ClassInheritanceContext::at(int index) const { TemplateVariant result; if (index>=0 && index<count()) { result = p->at(index); } } return result; return preferredDepth; } TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const { return p->createIterator(); } } //------------------------------------------------------------------------ //------------------------------------------------------------------------ Loading @@ -5019,13 +4917,27 @@ TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const class ClassHierarchyContext::Private : public PropertyMapper class ClassHierarchyContext::Private : public PropertyMapper { { public: public: TemplateVariant tree() const Private() { if (!m_cache.classTree) { { m_cache.classTree.reset(ClassInheritanceContext::alloc()); m_classTree.reset(NestingContext::alloc(0,0)); initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); m_classTree->addClassHierarchy(*Doxygen::classSDict,TRUE); m_classTree->addClassHierarchy(*Doxygen::hiddenClasses,TRUE); //%% ClassInheritance tree addProperty("tree", this,&Private::tree); addProperty("fileName", this,&Private::fileName); addProperty("relPath", this,&Private::relPath); addProperty("highlight", this,&Private::highlight); addProperty("subhighlight", this,&Private::subhighlight); addProperty("title", this,&Private::title); addProperty("preferredDepth", this,&Private::preferredDepth); addProperty("maxDepth", this,&Private::maxDepth); addProperty("diagrams", this,&Private::diagrams); } } return m_cache.classTree.get(); TemplateVariant tree() const { return m_classTree.get(); } } TemplateVariant fileName() const TemplateVariant fileName() const { { Loading @@ -5043,6 +4955,34 @@ class ClassHierarchyContext::Private : public PropertyMapper { { return "classhierarchy"; return "classhierarchy"; } } DotGfxHierarchyTable *getHierarchy() const { if (!m_cache.hierarchy) { m_cache.hierarchy.reset(new DotGfxHierarchyTable()); } return m_cache.hierarchy.get(); } TemplateVariant diagrams() const { if (!m_cache.diagrams) { TemplateList *diagrams = TemplateList::alloc(); DotGfxHierarchyTable *hierarchy = getHierarchy(); if (hierarchy->subGraphs()) { int id=0; QListIterator<DotNode> li(*hierarchy->subGraphs()); DotNode *n; for (li.toFirst();(n=li.current());++li) { diagrams->append(InheritanceGraphContext::alloc(hierarchy,n,id++)); } } m_cache.diagrams.reset(diagrams); } return m_cache.diagrams.get(); } TemplateVariant title() const TemplateVariant title() const { { static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); Loading @@ -5055,20 +4995,36 @@ class ClassHierarchyContext::Private : public PropertyMapper return theTranslator->trClassHierarchy(); return theTranslator->trClassHierarchy(); } } } } Private() TemplateVariant maxDepth() const { { //%% ClassInheritance tree if (!m_cache.maxDepthComputed) addProperty("tree",this,&Private::tree); { addProperty("fileName",this,&Private::fileName); m_cache.maxDepth = computeMaxDepth(m_classTree.get()); addProperty("relPath",this,&Private::relPath); m_cache.maxDepthComputed=TRUE; addProperty("highlight",this,&Private::highlight); } addProperty("subhighlight",this,&Private::subhighlight); return m_cache.maxDepth; addProperty("title",this,&Private::title); } TemplateVariant preferredDepth() const { if (!m_cache.preferredDepthComputed) { m_cache.preferredDepth = computePreferredDepth(m_classTree.get(),maxDepth().toInt()); m_cache.preferredDepthComputed=TRUE; } return m_cache.preferredDepth; } } private: private: SharedPtr<NestingContext> m_classTree; struct Cachable struct Cachable { { SharedPtr<ClassInheritanceContext> classTree; Cachable() : maxDepth(0), maxDepthComputed(FALSE), preferredDepth(0), preferredDepthComputed(FALSE), hierarchy(0) {} int maxDepth; bool maxDepthComputed; int preferredDepth; bool preferredDepthComputed; SharedPtr<TemplateList> diagrams; ScopedPtr<DotGfxHierarchyTable> hierarchy; }; }; mutable Cachable m_cache; mutable Cachable m_cache; }; }; Loading Loading @@ -5097,7 +5053,7 @@ class NestingNodeContext::Private : public PropertyMapper { { public: public: Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, Definition *d,int index,int level,bool addCls) Definition *d,int index,int level,bool addCls,bool inherit, bool hideSuper) : m_parent(parent), m_def(d), m_level(level), m_index(index) : m_parent(parent), m_def(d), m_level(level), m_index(index) { { m_children.reset(NestingContext::alloc(thisNode,level+1)); m_children.reset(NestingContext::alloc(thisNode,level+1)); Loading Loading @@ -5131,7 +5087,7 @@ class NestingNodeContext::Private : public PropertyMapper addProperty("fileName",this,&Private::fileName); addProperty("fileName",this,&Private::fileName); addNamespaces(addCls); addNamespaces(addCls); addClasses(); addClasses(inherit,hideSuper); addDirFiles(); addDirFiles(); addPages(); addPages(); addModules(); addModules(); Loading Loading @@ -5283,14 +5239,36 @@ class NestingNodeContext::Private : public PropertyMapper return m_def->getOutputFileBase(); return m_def->getOutputFileBase(); } } void addClasses() //------------------------------------------------------------------ void addClasses(bool inherit, bool hideSuper) { { ClassDef *cd = m_def->definitionType()==Definition::TypeClass ? (ClassDef*)m_def : 0; ClassDef *cd = m_def->definitionType()==Definition::TypeClass ? (ClassDef*)m_def : 0; if (inherit) { bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd); if (hasChildren) { bool wasVisited=cd->visited; cd->visited=TRUE; if (cd->getLanguage()==SrcLangExt_VHDL) { m_children->addDerivedClasses(cd->baseClasses(),wasVisited); } else { m_children->addDerivedClasses(cd->subClasses(),wasVisited); } } } else { if (cd && cd->getClassSDict()) if (cd && cd->getClassSDict()) { { m_children->addClasses(*cd->getClassSDict(),FALSE); m_children->addClasses(*cd->getClassSDict(),FALSE); } } } } } void addNamespaces(bool addClasses) void addNamespaces(bool addClasses) { { NamespaceDef *nd = m_def->definitionType()==Definition::TypeNamespace ? (NamespaceDef*)m_def : 0; NamespaceDef *nd = m_def->definitionType()==Definition::TypeNamespace ? (NamespaceDef*)m_def : 0; Loading Loading @@ -5352,9 +5330,10 @@ class NestingNodeContext::Private : public PropertyMapper //%% } //%% } NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, Definition *d,int index,int level,bool addClass) : RefCountedContext("NestingNodeContext") Definition *d,int index,int level,bool addClass,bool inherit,bool hideSuper) : RefCountedContext("NestingNodeContext") { { p = new Private(parent,this,d,index,level,addClass); p = new Private(parent,this,d,index,level,addClass,inherit,hideSuper); } } NestingNodeContext::~NestingNodeContext() NestingNodeContext::~NestingNodeContext() Loading Loading @@ -5394,7 +5373,7 @@ class NestingContext::Private : public GenericNodeListContext bool isLinkable = nd->isLinkableInProject(); bool isLinkable = nd->isLinkableInProject(); if (isLinkable || hasChildren) if (isLinkable || hasChildren) { { NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,nd,m_index,m_level,addClasses); NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,nd,m_index,m_level,addClasses,FALSE,FALSE); append(nnc); append(nnc); m_index++; m_index++; } } Loading Loading @@ -5423,7 +5402,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (classVisibleInIndex(cd) && cd->templateMaster()==0) if (classVisibleInIndex(cd) && cd->templateMaster()==0) { { NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE); NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,FALSE,FALSE); append(nnc); append(nnc); m_index++; m_index++; } } Loading @@ -5438,7 +5417,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (dd->getOuterScope()==Doxygen::globalScope) if (dd->getOuterScope()==Doxygen::globalScope) { { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5449,7 +5428,7 @@ class NestingContext::Private : public GenericNodeListContext DirDef *dd; DirDef *dd; for (li.toFirst();(dd=li.current());++li) for (li.toFirst();(dd=li.current());++li) { { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5465,7 +5444,7 @@ class NestingContext::Private : public GenericNodeListContext { { if (fd->getDirDef()==0) // top level file if (fd->getDirDef()==0) // top level file { { append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5477,7 +5456,7 @@ class NestingContext::Private : public GenericNodeListContext FileDef *fd; FileDef *fd; for (li.toFirst();(fd=li.current());++li) for (li.toFirst();(fd=li.current());++li) { { append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5491,7 +5470,7 @@ class NestingContext::Private : public GenericNodeListContext pd->getOuterScope()==0 || pd->getOuterScope()==0 || pd->getOuterScope()->definitionType()!=Definition::TypePage) pd->getOuterScope()->definitionType()!=Definition::TypePage) { { append(NestingNodeContext::alloc(m_parent,pd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,pd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5507,7 +5486,7 @@ class NestingContext::Private : public GenericNodeListContext (!gd->isReference() || externalGroups) (!gd->isReference() || externalGroups) ) ) { { append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } Loading @@ -5520,11 +5499,74 @@ class NestingContext::Private : public GenericNodeListContext { { if (gd->isVisible()) if (gd->isVisible()) { { append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE)); append(NestingNodeContext::alloc(m_parent,gd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; m_index++; } } } } } } void addDerivedClasses(const BaseClassList *bcl,bool hideSuper) { if (bcl==0) return; BaseClassListIterator bcli(*bcl); BaseClassDef *bcd; for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) { ClassDef *cd=bcd->classDef; if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { continue; } bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { b=hasVisibleRoot(cd->subClasses()); } else { b=hasVisibleRoot(cd->baseClasses()); } if (cd->isVisibleInHierarchy() && b) { NestingNodeContext *tnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,TRUE,hideSuper); append(tnc); m_index++; } } } void addClassHierarchy(const ClassSDict &classSDict,bool) { ClassSDict::Iterator cli(classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { bool b; if (cd->getLanguage()==SrcLangExt_VHDL) { if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { continue; } b=!hasVisibleRoot(cd->subClasses()); } else { b=!hasVisibleRoot(cd->baseClasses()); } if (b) { if (cd->isVisibleInHierarchy()) // should it be visible { // new root level class NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,cd,m_index,m_level,TRUE,TRUE,cd->visited); append(nnc); m_index++; } } } } private: private: const NestingNodeContext *m_parent; const NestingNodeContext *m_parent; int m_level; int m_level; Loading Loading @@ -5602,78 +5644,17 @@ void NestingContext::addModules(const GroupList &modules) p->addModules(modules); p->addModules(modules); } } //------------------------------------------------------------------------ void NestingContext::addClassHierarchy(const ClassSDict &classSDict,bool rootOnly) static int computeMaxDepth(const TemplateListIntf *list) { int maxDepth=0; if (list) { TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { const TemplateStructIntf *s = v.toStruct(); TemplateVariant child = s->get("children"); int d = computeMaxDepth(child.toList())+1; if (d>maxDepth) maxDepth=d; } delete it; } return maxDepth; } static int computeNumNodesAtLevel(const TemplateStructIntf *s,int level,int maxLevel) { { int num=0; p->addClassHierarchy(classSDict,rootOnly); if (level<maxLevel) { num++; TemplateVariant child = s->get("children"); if (child.toList()) { TemplateListIntf::ConstIterator *it = child.toList()->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { num+=computeNumNodesAtLevel(v.toStruct(),level+1,maxLevel); } delete it; } } return num; } } static int computePreferredDepth(const TemplateListIntf *list,int maxDepth) void NestingContext::addDerivedClasses(const BaseClassList *bcl,bool hideSuper) { int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); int preferredDepth=1; if (preferredNumEntries>0) { int depth = maxDepth; for (int i=1;i<=depth;i++) { { int num=0; p->addDerivedClasses(bcl,hideSuper); TemplateListIntf::ConstIterator *it = list->createIterator(); TemplateVariant v; for (it->toFirst();it->current(v);it->toNext()) { num+=computeNumNodesAtLevel(v.toStruct(),0,i); } delete it; if (num<=preferredNumEntries) { preferredDepth=i; } else { break; } } } return preferredDepth; } } //------------------------------------------------------------------------ //%% struct ClassTree: Class nesting relations //%% struct ClassTree: Class nesting relations //%% { //%% { Loading Loading @@ -7049,6 +7030,56 @@ TemplateVariant NamespaceMembersIndexContext::get(const char *name) const return p->get(name); return p->get(name); } } //------------------------------------------------------------------------ //%% struct InheritanceGraph: a connected graph reprenting part of the overall interitance tree //%% { class InheritanceGraphContext::Private : public PropertyMapper { public: Private(DotGfxHierarchyTable *hierarchy,DotNode *n,int id) : m_hierarchy(hierarchy), m_node(n), m_id(id) { addProperty("graph",this,&Private::graph); } TemplateVariant graph() const { QGString result; static bool haveDot = Config_getBool("HAVE_DOT"); static bool graphicalHierarchy = Config_getBool("GRAPHICAL_HIERARCHY"); if (haveDot && graphicalHierarchy) { FTextStream t(&result); m_hierarchy->createGraph(m_node,t, /*GOF_BITMAP, EOF_Html,*/ g_globals.outputDir, g_globals.outputDir+portable_pathSeparator()+"inherits"+Doxygen::htmlFileExtension, m_id); } return TemplateVariant(result.data(),TRUE); } private: DotGfxHierarchyTable *m_hierarchy; DotNode *m_node; int m_id; }; InheritanceGraphContext::InheritanceGraphContext(DotGfxHierarchyTable *hierarchy,DotNode *n,int id) : RefCountedContext("InheritanceGraphContext") { p = new Private(hierarchy,n,id); } InheritanceGraphContext::~InheritanceGraphContext() { delete p; } TemplateVariant InheritanceGraphContext::get(const char *name) const { return p->get(name); } //------------------------------------------------------------------------ //------------------------------------------------------------------------ Loading Loading @@ -8086,7 +8117,7 @@ class HtmlSpaceless : public TemplateSpacelessIntf { { m_insideString='\0'; m_insideString='\0'; } } else // start of string else if (m_insideString=='\0') // start of string { { m_insideString=c; m_insideString=c; } } Loading @@ -8111,8 +8142,8 @@ class HtmlSpaceless : public TemplateSpacelessIntf } } } } result+='\0'; result+='\0'; //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%d removeSpaces=%d\n",s.data(),result.data(), //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%c (%d) removeSpaces=%d\n",s.data(),result.data(), // m_insideTag,m_insideString,m_removeSpaces); // m_insideTag,m_insideString,m_insideString,m_removeSpaces); return result.data(); return result.data(); } } private: private: Loading