diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commentscan.l | 32 | ||||
-rw-r--r-- | src/context.cpp | 40 | ||||
-rw-r--r-- | src/definition.cpp | 10 | ||||
-rw-r--r-- | src/doxygen.cpp | 33 | ||||
-rw-r--r-- | src/entry.cpp | 6 | ||||
-rw-r--r-- | src/entry.h | 2 | ||||
-rw-r--r-- | src/marshal.cpp | 4 | ||||
-rw-r--r-- | src/memberdef.cpp | 35 | ||||
-rw-r--r-- | src/memberdef.h | 6 | ||||
-rw-r--r-- | src/util.cpp | 7 | ||||
-rw-r--r-- | src/vhdldocgen.cpp | 4 |
11 files changed, 162 insertions, 17 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 1d84917..e317a86 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -107,6 +107,10 @@ static bool handleCallgraph(const QCString &, const QCStringList &); static bool handleHideCallgraph(const QCString &, const QCStringList &); static bool handleCallergraph(const QCString &, const QCStringList &); static bool handleHideCallergraph(const QCString &, const QCStringList &); +static bool handleReferencedByRelation(const QCString &, const QCStringList &); +static bool handleHideReferencedByRelation(const QCString &, const QCStringList &); +static bool handleReferencesRelation(const QCString &, const QCStringList &); +static bool handleHideReferencesRelation(const QCString &, const QCStringList &); static bool handleInternal(const QCString &, const QCStringList &); static bool handleLineBr(const QCString &, const QCStringList &); static bool handleStatic(const QCString &, const QCStringList &); @@ -214,6 +218,10 @@ static DocCmdMap docCmdMap[] = { "hidecallgraph", &handleHideCallgraph, FALSE }, { "callergraph", &handleCallergraph, FALSE }, { "hidecallergraph", &handleHideCallergraph, FALSE }, + { "showrefby", &handleReferencedByRelation, FALSE }, + { "hiderefby", &handleHideReferencedByRelation, FALSE }, + { "showrefs", &handleReferencesRelation, FALSE }, + { "hiderefs", &handleHideReferencesRelation, FALSE }, { "internal", &handleInternal, TRUE }, { "_linebr", &handleLineBr, FALSE }, { "static", &handleStatic, FALSE }, @@ -2835,6 +2843,30 @@ static bool handleHideCallergraph(const QCString &, const QCStringList &) return FALSE; } +static bool handleReferencedByRelation(const QCString &, const QCStringList &) +{ + current->referencedByRelation = TRUE; // ON + return FALSE; +} + +static bool handleHideReferencedByRelation(const QCString &, const QCStringList &) +{ + current->referencedByRelation = FALSE; // OFF + return FALSE; +} + +static bool handleReferencesRelation(const QCString &, const QCStringList &) +{ + current->referencesRelation = TRUE; // ON + return FALSE; +} + +static bool handleHideReferencesRelation(const QCString &, const QCStringList &) +{ + current->referencesRelation = FALSE; // OFF + return FALSE; +} + static bool handleInternal(const QCString &, const QCStringList &) { if (!Config_getBool(INTERNAL_DOCS)) diff --git a/src/context.cpp b/src/context.cpp index 33e7dcf..12c8c34 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -856,6 +856,14 @@ class TranslateContext::Private { return theTranslator->trCallerGraph(); } + TemplateVariant referencedByRelation() const + { + return theTranslator->trReferencedBy(); + } + TemplateVariant referencesRelation() const + { + return theTranslator->trReferences(); + } TemplateVariant inheritedFrom() const { return theTranslator->trInheritedFrom("@0","@1"); @@ -1112,6 +1120,10 @@ class TranslateContext::Private s_inst.addProperty("callGraph", &Private::callGraph); //%% string callerGraph s_inst.addProperty("callerGraph", &Private::callerGraph); + //%% string referencedByRelation + s_inst.addProperty("referencedByRelation", &Private::referencedByRelation); + //%% string referencesRelation + s_inst.addProperty("referencesRelation", &Private::referencesRelation); //%% markerstring inheritedFrom s_inst.addProperty("inheritedFrom", &Private::inheritedFrom); //%% string addtionalInheritedMembers @@ -3994,6 +4006,10 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> s_inst.addProperty("callGraph", &Private::callGraph); s_inst.addProperty("hasCallerGraph", &Private::hasCallerGraph); s_inst.addProperty("callerGraph", &Private::callerGraph); + s_inst.addProperty("hasReferencedByRelation", &Private::hasReferencedByRelation); + s_inst.addProperty("referencedByRelation", &Private::referencedByRelation); + s_inst.addProperty("hasReferencesRelation", &Private::hasReferencesRelation); + s_inst.addProperty("referencesRelation", &Private::referencesRelation); s_inst.addProperty("fieldType", &Private::fieldType); s_inst.addProperty("type", &Private::type); s_inst.addProperty("detailsVisibleFor", &Private::detailsVisibleFor); @@ -4918,6 +4934,10 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } return TemplateVariant(FALSE); } + TemplateVariant hasReferencedByRelation() const + { + return TemplateVariant(m_memberDef->hasReferencedByRelation()); + } TemplateVariant callGraph() const { if (hasCallGraph().toBool()) @@ -4958,6 +4978,14 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> return TemplateVariant(""); } } + TemplateVariant referencedByRelation() const + { + if (hasReferencedByRelation().toBool()) + { + err("context.cpp: output format not yet supported"); + } + return TemplateVariant(""); + } DotCallGraph *getCallerGraph() const { Cachable &cache = getCache(); @@ -4978,6 +5006,10 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } return TemplateVariant(FALSE); } + TemplateVariant hasReferencesRelation() const + { + return TemplateVariant(m_memberDef->hasReferencesRelation()); + } TemplateVariant callerGraph() const { if (hasCallerGraph().toBool()) @@ -5018,6 +5050,14 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> return TemplateVariant(""); } } + TemplateVariant referencesRelation() const + { + if (hasReferencesRelation().toBool()) + { + err("context.cpp: output format not yet supported"); + } + return TemplateVariant(""); + } TemplateVariant type() const { return m_memberDef->typeString(); diff --git a/src/definition.cpp b/src/definition.cpp index 0bd216b..936565d 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1446,18 +1446,12 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, void Definition::writeSourceReffedBy(OutputList &ol,const char *scopeName) { - if (Config_getBool(REFERENCED_BY_RELATION)) - { - _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE); - } + _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE); } void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) { - if (Config_getBool(REFERENCES_RELATION)) - { - _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); - } + _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); } bool Definition::hasDocumentation() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 3d1c3ab..511795f 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2188,6 +2188,8 @@ static void findUsingDeclImports(EntryNav *rootNav) newMd->setDefinition(md->definition()); newMd->enableCallGraph(root->callGraph); newMd->enableCallerGraph(root->callerGraph); + newMd->enableReferencedByRelation(root->referencedByRelation); + newMd->enableReferencesRelation(root->referencesRelation); newMd->setBitfields(md->bitfieldString()); newMd->addSectionsToDefinition(root->anchors); newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine()); @@ -2384,6 +2386,8 @@ static MemberDef *addVariableToClass( md->setWriteAccessor(root->write); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setHidden(root->hidden); md->setArtificial(root->artificial); md->setLanguage(root->lang); @@ -2621,6 +2625,8 @@ static MemberDef *addVariableToFile( md->setId(root->id); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setExplicitExternal(root->explicitExternal); //md->setOuterScope(fd); if (!root->explicitExternal) @@ -3134,6 +3140,8 @@ static void addInterfaceOrServiceToServiceOrSingleton( md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); Debug::print(Debug::Functions,0, " Interface Member:\n" @@ -3386,6 +3394,8 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd, md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); Debug::print(Debug::Functions,0, " Func Member:\n" @@ -3653,6 +3663,8 @@ static void buildFunctionList(EntryNav *rootNav) md->enableCallGraph(md->hasCallGraph() || root->callGraph); md->enableCallerGraph(md->hasCallerGraph() || root->callerGraph); + md->enableReferencedByRelation(md->hasReferencedByRelation() || root->referencedByRelation); + md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation); // merge ingroup specifiers if (md->getGroupDef()==0 && root->groups->getFirst()!=0) @@ -3772,6 +3784,8 @@ static void buildFunctionList(EntryNav *rootNav) md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); //if (root->mGrpId!=-1) //{ // md->setMemberGroup(memberGroupDict[root->mGrpId]); @@ -3923,8 +3937,13 @@ static void findFriends() mmd->enableCallGraph(mmd->hasCallGraph() || fmd->hasCallGraph()); mmd->enableCallerGraph(mmd->hasCallerGraph() || fmd->hasCallerGraph()); + mmd->enableReferencedByRelation(mmd->hasReferencedByRelation() || fmd->hasReferencedByRelation()); + mmd->enableReferencesRelation(mmd->hasReferencesRelation() || fmd->hasReferencesRelation()); + fmd->enableCallGraph(mmd->hasCallGraph() || fmd->hasCallGraph()); fmd->enableCallerGraph(mmd->hasCallerGraph() || fmd->hasCallerGraph()); + fmd->enableReferencedByRelation(mmd->hasReferencedByRelation() || fmd->hasReferencedByRelation()); + fmd->enableReferencesRelation(mmd->hasReferencesRelation() || fmd->hasReferencesRelation()); } } } @@ -5324,6 +5343,8 @@ static void addMemberDocs(EntryNav *rootNav, md->setDefinition(fDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); ClassDef *cd=md->getClassDef(); NamespaceDef *nd=md->getNamespaceDef(); QCString fullName; @@ -5416,6 +5437,8 @@ static void addMemberDocs(EntryNav *rootNav, md->enableCallGraph(md->hasCallGraph() || root->callGraph); md->enableCallerGraph(md->hasCallerGraph() || root->callerGraph); + md->enableReferencedByRelation(md->hasReferencedByRelation() || root->referencedByRelation); + md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation); md->mergeMemberSpecifiers(root->spec); md->addSectionsToDefinition(root->anchors); @@ -6448,6 +6471,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -6513,6 +6538,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); QCString doc=getOverloadDocs(); doc+="<p>"; doc+=root->doc; @@ -6717,6 +6744,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); md->setDocsForDefinition(!root->proto); @@ -6789,6 +6818,8 @@ localObjCMethod: md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -7131,6 +7162,8 @@ static void findEnums(EntryNav *rootNav) md->setMemberGroupId(root->mGrpId); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); //printf("%s::setRefItems(%d)\n",md->name().data(),root->sli?root->sli->count():-1); md->setRefItems(root->sli); //printf("found enum %s nd=%p\n",md->name().data(),nd); diff --git a/src/entry.cpp b/src/entry.cpp index a0460da..4332186 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -79,6 +79,8 @@ Entry::Entry(const Entry &e) subGrouping = e.subGrouping; callGraph = e.callGraph; callerGraph = e.callerGraph; + referencedByRelation = e.referencedByRelation; + referencesRelation = e.referencesRelation; virt = e.virt; args = e.args; bitfields = e.bitfields; @@ -219,6 +221,8 @@ void Entry::reset() { static bool entryCallGraph = Config_getBool(CALL_GRAPH); static bool entryCallerGraph = Config_getBool(CALLER_GRAPH); + static bool entryReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION); + static bool entryReferencesRelation = Config_getBool(REFERENCES_RELATION); //printf("Entry::reset()\n"); name.resize(0); type.resize(0); @@ -250,6 +254,8 @@ void Entry::reset() mGrpId = -1; callGraph = entryCallGraph; callerGraph = entryCallerGraph; + referencedByRelation = entryReferencedByRelation; + referencesRelation = entryReferencesRelation; section = EMPTY_SEC; mtype = Method; virt = Normal; diff --git a/src/entry.h b/src/entry.h index 739b128..8187e03 100644 --- a/src/entry.h +++ b/src/entry.h @@ -249,6 +249,8 @@ class Entry bool subGrouping; //!< automatically group class members? bool callGraph; //!< do we need to draw the call graph? bool callerGraph; //!< do we need to draw the caller graph? + bool referencedByRelation;//!< do we need to show the referenced by relation? + bool referencesRelation; //!< do we need to show the references relation? Specifier virt; //!< virtualness of the entry QCString args; //!< member argument string QCString bitfields; //!< member's bit fields diff --git a/src/marshal.cpp b/src/marshal.cpp index f0ed2e8..25a9a89 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -370,6 +370,8 @@ void marshalEntry(StorageIntf *s,Entry *e) marshalBool(s,e->subGrouping); marshalBool(s,e->callGraph); marshalBool(s,e->callerGraph); + marshalBool(s,e->referencedByRelation); + marshalBool(s,e->referencesRelation); marshalInt(s,(int)e->virt); marshalQCString(s,e->args); marshalQCString(s,e->bitfields); @@ -780,6 +782,8 @@ Entry * unmarshalEntry(StorageIntf *s) e->subGrouping = unmarshalBool(s); e->callGraph = unmarshalBool(s); e->callerGraph = unmarshalBool(s); + e->referencedByRelation = unmarshalBool(s); + e->referencesRelation = unmarshalBool(s); e->virt = (Specifier)unmarshalInt(s); e->args = unmarshalQCString(s); e->bitfields = unmarshalQCString(s); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 1cedc7f..8f57802 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -584,6 +584,8 @@ class MemberDefImpl bool annUsed; bool hasCallGraph; bool hasCallerGraph; + bool hasReferencedByRelation; + bool hasReferencesRelation; bool explExt; // member was explicitly declared external bool tspec; // member is a template specialization bool groupHasDocs; // true if the entry that caused the grouping was documented @@ -647,6 +649,8 @@ void MemberDefImpl::init(Definition *def, defTmpArgLists=0; hasCallGraph = FALSE; hasCallerGraph = FALSE; + hasReferencedByRelation = FALSE; + hasReferencesRelation = FALSE; initLines=0; type=t; if (mt==MemberType_Typedef) type.stripPrefix("typedef "); @@ -2984,9 +2988,9 @@ void MemberDef::writeDocumentation(MemberList *ml, _writeExamples(ol); _writeTypeConstraints(ol); writeSourceDef(ol,cname); - writeSourceRefs(ol,cname); - writeSourceReffedBy(ol,cname); writeInlineCode(ol,cname); + if (hasReferencesRelation()) writeSourceRefs(ol,cname); + if (hasReferencedByRelation()) writeSourceReffedBy(ol,cname); _writeCallGraph(ol); _writeCallerGraph(ol); @@ -3960,6 +3964,18 @@ void MemberDef::enableCallerGraph(bool e) if (e) Doxygen::parseSourcesNeeded = TRUE; } +void MemberDef::enableReferencedByRelation(bool e) +{ + m_impl->hasReferencedByRelation=e; + if (e) Doxygen::parseSourcesNeeded = TRUE; +} + +void MemberDef::enableReferencesRelation(bool e) +{ + m_impl->hasReferencesRelation=e; + if (e) Doxygen::parseSourcesNeeded = TRUE; +} + #if 0 bool MemberDef::protectionVisible() const { @@ -4592,6 +4608,16 @@ bool MemberDef::hasCallerGraph() const return m_impl->hasCallerGraph; } +bool MemberDef::hasReferencedByRelation() const +{ + return m_impl->hasReferencedByRelation; +} + +bool MemberDef::hasReferencesRelation() const +{ + return m_impl->hasReferencesRelation; +} + MemberDef *MemberDef::templateMaster() const { return m_impl->templateMaster; @@ -5104,6 +5130,11 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef) mdef->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph()); mdec->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph()); mdec->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph()); + + mdef->enableReferencedByRelation(mdec->hasReferencedByRelation() || mdef->hasReferencedByRelation()); + mdef->enableCallerGraph(mdec->hasReferencesRelation() || mdef->hasReferencesRelation()); + mdec->enableReferencedByRelation(mdec->hasReferencedByRelation() || mdef->hasReferencedByRelation()); + mdec->enableCallerGraph(mdec->hasReferencesRelation() || mdef->hasReferencesRelation()); } } } diff --git a/src/memberdef.h b/src/memberdef.h index bf7ea9a..e9524c6 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -237,6 +237,9 @@ class MemberDef : public Definition bool hasCallGraph() const; bool hasCallerGraph() const; bool visibleMemberGroup(bool hideNoHeader); + // refrenced related members + bool hasReferencesRelation() const; + bool hasReferencedByRelation() const; MemberDef *templateMaster() const; QCString getScopeString() const; @@ -349,6 +352,9 @@ class MemberDef : public Definition void enableCallGraph(bool e); void enableCallerGraph(bool e); + void enableReferencedByRelation(bool e); + void enableReferencesRelation(bool e); + void setTemplateMaster(MemberDef *mt); void addListReference(Definition *d); void setDocsForDefinition(bool b); diff --git a/src/util.cpp b/src/util.cpp index 144b6a7..5d72a9d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8526,12 +8526,9 @@ bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile) void addDocCrossReference(MemberDef *src,MemberDef *dst) { - static bool referencedByRelation = Config_getBool(REFERENCED_BY_RELATION); - static bool referencesRelation = Config_getBool(REFERENCES_RELATION); - //printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data()); if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types - if ((referencedByRelation || dst->hasCallerGraph()) && + if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) && src->showInCallGraph() ) { @@ -8547,7 +8544,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst) mdDecl->addSourceReferencedBy(src); } } - if ((referencesRelation || src->hasCallGraph()) && + if ((src->hasReferencesRelation() || src->hasCallGraph()) && src->showInCallGraph() ) { diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 373e6de..f603ddd 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -2466,8 +2466,8 @@ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) if (cname.isEmpty()) return; mdef->writeSourceDef(ol,cname); - mdef->writeSourceRefs(ol,cname); - mdef->writeSourceReffedBy(ol,cname); + if (mdef->hasReferencesRelation()) mdef->writeSourceRefs(ol,cname); + if (mdef->hasReferencedByRelation()) mdef->writeSourceReffedBy(ol,cname); } |