QCString Definition::pathFragment() const { makeResident(); QCString result; if (m_impl->outerScope && m_impl->outerScope!=Doxygen::globalScope) { result = m_impl->outerScope->pathFragment(); } if (isLinkable()) { if (!result.isEmpty()) result+="/"; if (definitionType()==Definition::TypeGroup && ((const GroupDef*)this)->groupTitle()) { result+=((const GroupDef*)this)->groupTitle(); } else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty()) { result+=((const PageDef*)this)->title(); } else { result+=m_impl->localName; } } else { result+=m_impl->localName; } return result; }
void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList) { if (!anchorList) return; makeResident(); //printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count()); SectionInfo *si=anchorList->first(); while (si) { //printf("Add section `%s' to definition `%s'\n", // si->label.data(),name().data()); SectionInfo *gsi=Doxygen::sectionDict.find(si->label); if (gsi==0) { gsi = new SectionInfo(*si); Doxygen::sectionDict.insert(si->label,gsi); } if (m_impl->sectionDict==0) { m_impl->sectionDict = new SectionDict(17); } if (m_impl->sectionDict->find(gsi->label)==0) { m_impl->sectionDict->insert(gsi->label,gsi); gsi->definition = this; } si=anchorList->next(); } }
QCString Definition::briefDescriptionAsTooltip() const { makeResident(); if (m_impl->brief) { if (m_impl->brief->tooltip.isEmpty() && !m_impl->brief->doc.isEmpty()) { static bool reentering=FALSE; if (!reentering) { MemberDef *md = definitionType()==TypeMember ? (MemberDef*)this : 0; const Definition *scope = definitionType()==TypeMember ? getOuterScope() : this; reentering=TRUE; // prevent requests for tooltips while parsing a tooltip m_impl->brief->tooltip = parseCommentAsText( scope,md, m_impl->brief->doc, m_impl->brief->file, m_impl->brief->line); reentering=FALSE; } } return m_impl->brief->tooltip; } return QCString(""); }
void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) { makeResident(); if (Config_getBool("REFERENCES_RELATION")) { _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); } }
void Definition::setBodySegment(int bls,int ble) { //printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data()); makeResident(); if (m_impl->body==0) m_impl->body = new BodyInfo; m_impl->body->startLine=bls; m_impl->body->endLine=ble; }
bool Definition::hasUserDocumentation() const { makeResident(); bool hasDocs = (m_impl->details && !m_impl->details->doc.isEmpty()) || (m_impl->brief && !m_impl->brief->doc.isEmpty()) || (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()); return hasDocs; }
void Definition::setOuterScope(Definition *d) { makeResident(); if (m_impl->outerScope!=d) { m_impl->qualifiedName.resize(0); // flush cached scope name m_impl->outerScope = d; } m_impl->hidden = m_impl->hidden || d->isHidden(); }
QCString Definition::convertNameToFile(const char *name,bool allowDots) const { makeResident(); if (!m_impl->ref.isEmpty()) { return name; } else { return ::convertNameToFile(name,allowDots); } }
QCString Definition::qualifiedName() const { static int count=0; count++; makeResident(); if (!m_impl->qualifiedName.isEmpty()) { count--; return m_impl->qualifiedName; } #if 0 if (count>20) { printf("Definition::qualifiedName() Infinite recursion detected! Type=%d\n",definitionType()); printf("Trace:\n"); Definition *d = (Definition *)this; for (int i=0;d && i<20;i++) { printf(" %s\n",d->name().data()); d = d->getOuterScope(); } } #endif //printf("start %s::qualifiedName() localName=%s\n",name().data(),m_impl->localName.data()); if (m_impl->outerScope==0) { if (m_impl->localName=="<globalScope>") { count--; return ""; } else { count--; return m_impl->localName; } } if (m_impl->outerScope->name()=="<globalScope>") { m_impl->qualifiedName = m_impl->localName; } else { m_impl->qualifiedName = m_impl->outerScope->qualifiedName()+"::"+m_impl->localName; } //printf("end %s::qualifiedName()=%s\n",name().data(),m_impl->qualifiedName.data()); count--; return m_impl->qualifiedName; };
bool Definition::hasDocumentation() const { static bool extractAll = Config_getBool("EXTRACT_ALL"); //static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); makeResident(); bool hasDocs = (m_impl->details && !m_impl->details->doc.isEmpty()) || // has detailed docs (m_impl->brief && !m_impl->brief->doc.isEmpty()) || // has brief description (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()) || // has inbody docs extractAll //|| // extract everything // (sourceBrowser && m_impl->body && // m_impl->body->startLine!=-1 && m_impl->body->fileDef) ; // link to definition return hasDocs; }
int Definition::_getXRefListId(const char *listName) const { makeResident(); if (m_impl->xrefListItems) { QListIterator<ListItemInfo> slii(*m_impl->xrefListItems); ListItemInfo *lii; for (slii.toFirst();(lii=slii.current());++slii) { if (strcmp(lii->type,listName)==0) { return lii->itemId; } } } return -1; }
void Definition::setRefItems(const QList<ListItemInfo> *sli) { //printf("%s::setRefItems()\n",name().data()); if (sli) { makeResident(); // deep copy the list if (m_impl->xrefListItems==0) { m_impl->xrefListItems=new QList<ListItemInfo>; m_impl->xrefListItems->setAutoDelete(TRUE); } QListIterator<ListItemInfo> slii(*sli); ListItemInfo *lii; for (slii.toFirst();(lii=slii.current());++slii) { m_impl->xrefListItems->append(new ListItemInfo(*lii)); } } }
/*! Write code of this definition into the documentation */ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) { makeResident(); ol.pushGeneratorState(); //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), // m_startBodyLine,m_endBodyLine,m_bodyDef); if (Config_getBool("INLINE_SOURCES") && m_impl->body && m_impl->body->startLine!=-1 && m_impl->body->endLine>=m_impl->body->startLine && m_impl->body->fileDef) { QCString codeFragment; int actualStart=m_impl->body->startLine,actualEnd=m_impl->body->endLine; if (readCodeFragment(m_impl->body->fileDef->absFilePath(), actualStart,actualEnd,codeFragment) ) { //printf("Adding code fragement '%s' ext='%s'\n", // codeFragment.data(),m_impl->defFileExt.data()); ParserInterface *pIntf = Doxygen::parserManager->getParser(m_impl->defFileExt); pIntf->resetCodeParserState(); //printf("Read:\n`%s'\n\n",codeFragment.data()); MemberDef *thisMd = 0; if (definitionType()==TypeMember) thisMd = (MemberDef *)this; ol.startCodeFragment(); pIntf->parseCode(ol, // codeOutIntf scopeName, // scope codeFragment, // input FALSE, // isExample 0, // exampleName m_impl->body->fileDef, // fileDef actualStart, // startLine actualEnd, // endLine TRUE, // inlineFragment thisMd, // memberDef FALSE // show line numbers ); ol.endCodeFragment(); } } ol.popGeneratorState(); }
void Definition::writeDocAnchorsToTagFile() { makeResident(); if (!Config_getString("GENERATE_TAGFILE").isEmpty() && m_impl->sectionDict) { //printf("%s: writeDocAnchorsToTagFile(%d)\n",name().data(),m_sectionDict->count()); QDictIterator<SectionInfo> sdi(*m_impl->sectionDict); SectionInfo *si; for (;(si=sdi.current());++sdi) { if (!si->generated) { //printf("write an entry!\n"); if (definitionType()==TypeMember) Doxygen::tagFile << " "; Doxygen::tagFile << " <docanchor file=\"" << si->fileName << "\">" << si->label << "</docanchor>" << endl; } } } }
void Definition::writePathFragment(OutputList &ol) const { makeResident(); if (m_impl->outerScope && m_impl->outerScope!=Doxygen::globalScope) { m_impl->outerScope->writePathFragment(ol); } ol.writeString(" <li class=\"navelem\">"); if (isLinkable()) { if (definitionType()==Definition::TypeGroup && ((const GroupDef*)this)->groupTitle()) { ol.writeObjectLink(getReference(),getOutputFileBase(),0,((const GroupDef*)this)->groupTitle()); } else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty()) { ol.writeObjectLink(getReference(),getOutputFileBase(),0,((const PageDef*)this)->title()); } else if (definitionType()==Definition::TypeClass) { QCString name = m_impl->localName; if (name.right(2)=="-p" || name.right(2)=="-g") { name = name.left(name.length()-2); } ol.writeObjectLink(getReference(),getOutputFileBase(),0,name); } else { ol.writeObjectLink(getReference(),getOutputFileBase(),0,m_impl->localName); } } else { ol.startBold(); ol.docify(m_impl->localName); ol.endBold(); } ol.writeString(" </li>\n"); }
void Definition::addSourceReferences(MemberDef *md) { if (md) { QCString name = md->name(); QCString scope = md->getScopeString(); makeResident(); if (!scope.isEmpty()) { name.prepend(scope+"::"); } if (m_impl->sourceRefsDict==0) { m_impl->sourceRefsDict = new MemberSDict; } if (m_impl->sourceRefsDict->find(name)==0) { m_impl->sourceRefsDict->append(name,md); } } }
void Definition::mergeRefItems(Definition *d) { //printf("%s::mergeRefItems()\n",name().data()); LockingPtr< QList<ListItemInfo> > xrefList = d->xrefListItems(); if (xrefList!=0) { makeResident(); // deep copy the list if (m_impl->xrefListItems==0) { m_impl->xrefListItems=new QList<ListItemInfo>; m_impl->xrefListItems->setAutoDelete(TRUE); } QListIterator<ListItemInfo> slii(*xrefList); ListItemInfo *lii; for (slii.toFirst();(lii=slii.current());++slii) { if (_getXRefListId(lii->type)==-1) { m_impl->xrefListItems->append(new ListItemInfo(*lii)); } } } }
LockingPtr<GroupList> Definition::partOfGroups() const { makeResident(); return LockingPtr<GroupList>(this,m_impl->partOfGroups); }
/*! Write a reference to the source code defining this definition */ void Definition::writeSourceDef(OutputList &ol,const char *) { static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE"); makeResident(); ol.pushGeneratorState(); //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); if (sourceBrowser && m_impl->body && m_impl->body->startLine!=-1 && m_impl->body->fileDef) { QCString refText = theTranslator->trDefinedAtLineInSourceFile(); int lineMarkerPos = refText.find("@0"); int fileMarkerPos = refText.find("@1"); if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. { QCString lineStr,anchorStr; lineStr.sprintf("%d",m_impl->body->startLine); anchorStr.sprintf(Htags::useHtags ? "L%d" : "l%05d",m_impl->body->startLine); ol.startParagraph(); if (lineMarkerPos<fileMarkerPos) // line marker before file marker { // write text left from linePos marker ol.parseText(refText.left(lineMarkerPos)); ol.pushGeneratorState(); ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); if (!latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write line link (HTML, LaTeX optionally) ol.writeObjectLink(0,m_impl->body->fileDef->getSourceFileBase(), anchorStr,lineStr); ol.enableAll(); ol.disable(OutputGenerator::Html); if (latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write normal text (Man/RTF, Latex optionally) ol.docify(lineStr); ol.popGeneratorState(); // write text between markers ol.parseText(refText.mid(lineMarkerPos+2, fileMarkerPos-lineMarkerPos-2)); ol.pushGeneratorState(); ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); if (!latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write line link (HTML, LaTeX optionally) ol.writeObjectLink(0,m_impl->body->fileDef->getSourceFileBase(), 0,m_impl->body->fileDef->name()); ol.enableAll(); ol.disable(OutputGenerator::Html); if (latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write normal text (Man/RTF, Latex optionally) ol.docify(m_impl->body->fileDef->name()); ol.popGeneratorState(); // write text right from file marker ol.parseText(refText.right( refText.length()-fileMarkerPos-2)); } else // file marker before line marker { // write text left from file marker ol.parseText(refText.left(fileMarkerPos)); ol.pushGeneratorState(); ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); if (!latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write file link (HTML only) ol.writeObjectLink(0,m_impl->body->fileDef->getSourceFileBase(), 0,m_impl->body->fileDef->name()); ol.enableAll(); ol.disable(OutputGenerator::Html); if (latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write normal text (Latex/Man only) ol.docify(m_impl->body->fileDef->name()); ol.popGeneratorState(); // write text between markers ol.parseText(refText.mid(fileMarkerPos+2, lineMarkerPos-fileMarkerPos-2)); ol.pushGeneratorState(); ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); if (!latexSourceCode) { ol.disable(OutputGenerator::Latex); } ol.disableAllBut(OutputGenerator::Html); // write line link (HTML only) ol.writeObjectLink(0,m_impl->body->fileDef->getSourceFileBase(), anchorStr,lineStr); ol.enableAll(); ol.disable(OutputGenerator::Html); if (latexSourceCode) { ol.disable(OutputGenerator::Latex); } // write normal text (Latex/Man only) ol.docify(lineStr); ol.popGeneratorState(); // write text right from linePos marker ol.parseText(refText.right( refText.length()-lineMarkerPos-2)); } ol.endParagraph(); } else { err("error: translation error: invalid markers in trDefinedInSourceFile()\n"); } } ol.popGeneratorState(); }
void Definition::setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine) { if (d==0) return; makeResident(); _setInbodyDocumentation(d,inbodyFile,inbodyLine); }
void Definition::setBriefDescription(const char *b,const char *briefFile,int briefLine) { if (b==0) return; makeResident(); _setBriefDescription(b,briefFile,briefLine); }
void Definition::setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace) { if (d==0) return; makeResident(); _setDocumentation(d,docFile,docLine,stripWhiteSpace,FALSE); }
void Definition::setLocalName(const QCString name) { makeResident(); m_impl->localName=name; }
void Definition::setArtificial(bool b) { makeResident(); m_impl->isArtificial = b; }
void Definition::setHidden(bool b) { makeResident(); m_impl->hidden = m_impl->hidden || b; }
void Definition::setReference(const char *r) { makeResident(); m_impl->ref=r; }
LockingPtr<MemberSDict> Definition::getReferencedByMembers() const { makeResident(); return LockingPtr<MemberSDict>(this,m_impl->sourceRefByDict); }
void Definition::setBodyDef(FileDef *fd) { makeResident(); if (m_impl->body==0) m_impl->body = new BodyInfo; m_impl->body->fileDef=fd; }
Definition *Definition::getOuterScope() const { makeResident(); return m_impl->outerScope; }
Image2D::Image2D(std::string const &path) : AbstractTexture(GL_TEXTURE_2D, true, true) { ImageLoader il(path); GLsizei levels = log2(std::max(il.width(), il.height())) + 1; glTextureStorage2D(mId, levels, il.internalFormat(), il.width(), il.height()); glTextureSubImage2D(mId, 0, 0, 0, il.width(), il.height(), il.format(), GL_UNSIGNED_BYTE, il.data()); glGenerateTextureMipmap(mId); makeResident(); }