Orb/Doxygen/src/filedef.cpp
changeset 4 468f4c8d3d5b
parent 0 42188c7ea2d9
equal deleted inserted replaced
3:d8fccb2cd802 4:468f4c8d3d5b
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  * 
     3  * 
     4  *
     4  *
     5  * Copyright (C) 1997-2008 by Dimitri van Heesch.
     5  * Copyright (C) 1997-2010 by Dimitri van Heesch.
     6  *
     6  *
     7  * Permission to use, copy, modify, and distribute this software and its
     7  * Permission to use, copy, modify, and distribute this software and its
     8  * documentation under the terms of the GNU General Public License is hereby 
     8  * documentation under the terms of the GNU General Public License is hereby 
     9  * granted. No representations are made about the suitability of this software 
     9  * granted. No representations are made about the suitability of this software 
    10  * for any purpose. It is provided "as is" without express or implied warranty.
    10  * for any purpose. It is provided "as is" without express or implied warranty.
    91   if (Config_getBool("FULL_PATH_NAMES"))
    91   if (Config_getBool("FULL_PATH_NAMES"))
    92   {
    92   {
    93     docname.prepend(stripFromPath(path.copy()));
    93     docname.prepend(stripFromPath(path.copy()));
    94   }
    94   }
    95   m_isJava          = name().right(5)==".java";
    95   m_isJava          = name().right(5)==".java";
       
    96   m_isCSharp        = name().right(5)==".cs";
    96   memberGroupSDict = 0;
    97   memberGroupSDict = 0;
    97   acquireFileVersion();
    98   acquireFileVersion();
    98   m_subGrouping=Config_getBool("SUBGROUPING");
    99   m_subGrouping=Config_getBool("SUBGROUPING");
    99 }
   100 }
   100 
   101 
   454   ol.endGroupHeader();
   455   ol.endGroupHeader();
   455   ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME")));
   456   ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME")));
   456   ol.popGeneratorState();
   457   ol.popGeneratorState();
   457 }
   458 }
   458 
   459 
       
   460 void FileDef::writeSummaryLinks(OutputList &ol)
       
   461 {
       
   462   ol.pushGeneratorState();
       
   463   ol.disableAllBut(OutputGenerator::Html);
       
   464   QListIterator<LayoutDocEntry> eli(
       
   465       LayoutDocManager::instance().docEntries(LayoutDocManager::File));
       
   466   LayoutDocEntry *lde;
       
   467   bool first=TRUE;
       
   468   for (eli.toFirst();(lde=eli.current());++eli)
       
   469   {
       
   470     if ((lde->kind()==LayoutDocEntry::FileClasses && classSDict && classSDict->declVisible()) || 
       
   471         (lde->kind()==LayoutDocEntry::FileNamespaces && namespaceSDict && namespaceSDict->declVisible())
       
   472        )
       
   473     {
       
   474       LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
       
   475       QCString label = lde->kind()==LayoutDocEntry::FileClasses ? "nested-classes" : "namespaces";
       
   476       writeSummaryLink(ol,label,ls->title,first);
       
   477     }
       
   478     else if (lde->kind()==LayoutDocEntry::MemberDecl)
       
   479     {
       
   480       LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
       
   481       MemberList * ml = getMemberList(lmd->type);
       
   482       if (ml && ml->declVisible())
       
   483       {
       
   484         writeSummaryLink(ol,ml->listTypeAsString(),lmd->title,first);
       
   485       }
       
   486     }
       
   487   }
       
   488   if (!first)
       
   489   {
       
   490     ol.writeString("  </div>\n");
       
   491   }
       
   492   ol.popGeneratorState();
       
   493 }
       
   494 
   459 /*! Write the documentation page for this file to the file of output
   495 /*! Write the documentation page for this file to the file of output
   460     generators \a ol. 
   496     generators \a ol. 
   461 */
   497 */
   462 void FileDef::writeDocumentation(OutputList &ol)
   498 void FileDef::writeDocumentation(OutputList &ol)
   463 {
   499 {
   482   if (Config_getBool("SHOW_DIRECTORIES") && getDirDef())
   518   if (Config_getBool("SHOW_DIRECTORIES") && getDirDef())
   483   {
   519   {
   484     startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_FileVisible,TRUE);
   520     startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_FileVisible,TRUE);
   485     getDirDef()->writeNavigationPath(ol);
   521     getDirDef()->writeNavigationPath(ol);
   486     ol.endQuickIndices();
   522     ol.endQuickIndices();
   487     ol.startContents();
       
   488     QCString pageTitleShort=theTranslator->trFileReference(name());
   523     QCString pageTitleShort=theTranslator->trFileReference(name());
   489     startTitle(ol,getOutputFileBase());
   524     startTitle(ol,getOutputFileBase(),this);
   490     ol.pushGeneratorState();
   525     ol.pushGeneratorState();
   491       ol.disableAllBut(OutputGenerator::Html);
   526       ol.disableAllBut(OutputGenerator::Html);
   492       ol.parseText(pageTitleShort); // Html only
   527       ol.parseText(pageTitleShort); // Html only
   493       ol.enableAll();
   528       ol.enableAll();
   494       ol.disable(OutputGenerator::Html);
   529       ol.disable(OutputGenerator::Html);
   498     endTitle(ol,getOutputFileBase(),title);
   533     endTitle(ol,getOutputFileBase(),title);
   499   }
   534   }
   500   else
   535   else
   501   {
   536   {
   502     startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_FileVisible);
   537     startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_FileVisible);
   503     startTitle(ol,getOutputFileBase());
   538     startTitle(ol,getOutputFileBase(),this);
   504     ol.parseText(pageTitle);
   539     ol.parseText(pageTitle);
   505     addGroupListToTitle(ol,this);
   540     addGroupListToTitle(ol,this);
   506     endTitle(ol,getOutputFileBase(),title);
   541     endTitle(ol,getOutputFileBase(),title);
   507   }
   542   }
       
   543 
       
   544   ol.startContents();
       
   545 
   508   if (!fileVersion.isEmpty())
   546   if (!fileVersion.isEmpty())
   509   {
   547   {
   510     ol.disableAllBut(OutputGenerator::Html);
   548     ol.disableAllBut(OutputGenerator::Html);
   511     ol.startProjectNumber();
   549     ol.startProjectNumber();
   512     ol.docify(versionTitle);
   550     ol.docify(versionTitle);
   723   if (Config_getBool("SHOW_DIRECTORIES") && getDirDef())
   761   if (Config_getBool("SHOW_DIRECTORIES") && getDirDef())
   724   {
   762   {
   725     startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,TRUE);
   763     startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,TRUE);
   726     getDirDef()->writeNavigationPath(ol);
   764     getDirDef()->writeNavigationPath(ol);
   727     ol.endQuickIndices();
   765     ol.endQuickIndices();
   728     ol.startContents();
       
   729     startTitle(ol,getOutputFileBase());
   766     startTitle(ol,getOutputFileBase());
   730     ol.parseText(name());
   767     ol.parseText(name());
   731     endTitle(ol,getOutputFileBase(),title);
   768     endTitle(ol,getOutputFileBase(),title);
   732   }
   769   }
   733   else
   770   else
   735     startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,TRUE);
   772     startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,TRUE);
   736     startTitle(ol,getSourceFileBase());
   773     startTitle(ol,getSourceFileBase());
   737     ol.parseText(title);
   774     ol.parseText(title);
   738     endTitle(ol,getSourceFileBase(),0);
   775     endTitle(ol,getSourceFileBase(),0);
   739   }
   776   }
       
   777 
       
   778   ol.startContents();
   740 
   779 
   741   if (isLinkable())
   780   if (isLinkable())
   742   {
   781   {
   743     if (latexSourceCode) ol.disable(OutputGenerator::Latex);
   782     if (latexSourceCode) ol.disable(OutputGenerator::Latex);
   744     ol.startTextLink(getOutputFileBase(),0);
   783     ol.startTextLink(getOutputFileBase(),0);
   753   pIntf->parseCode(ol,0,
   792   pIntf->parseCode(ol,0,
   754             fileToString(absFilePath(),filterSourceFiles),
   793             fileToString(absFilePath(),filterSourceFiles),
   755             FALSE,0,this
   794             FALSE,0,this
   756            );
   795            );
   757   ol.endCodeFragment();
   796   ol.endCodeFragment();
       
   797   ol.endContents();
   758   endFile(ol);
   798   endFile(ol);
   759   ol.enableAll();
   799   ol.enableAll();
   760 }
   800 }
   761 
   801 
   762 void FileDef::parseSource()
   802 void FileDef::parseSource()
  1548 {
  1588 {
  1549   static bool showFiles = Config_getBool("SHOW_FILES");
  1589   static bool showFiles = Config_getBool("SHOW_FILES");
  1550   return hasDocumentation() && !isReference() && showFiles;
  1590   return hasDocumentation() && !isReference() && showFiles;
  1551 }
  1591 }
  1552 
  1592 
       
  1593 bool FileDef::includes(FileDef *incFile,QDict<FileDef> *includedFiles) const
       
  1594 {
       
  1595   if (incFile==this) return TRUE;
       
  1596   //printf("%s::includes(%s)\n",name().data(),incFile->name().data());
       
  1597   includedFiles->insert(absFilePath(),this);
       
  1598   if (includeList)
       
  1599   {
       
  1600     QListIterator<IncludeInfo> ili(*includeList);
       
  1601     IncludeInfo *ii;
       
  1602     for (;(ii=ili.current());++ili)
       
  1603     {
       
  1604       if (ii->fileDef && 
       
  1605           includedFiles->find(ii->fileDef->absFilePath())==0 &&
       
  1606           ii->fileDef->includes(incFile,includedFiles)) return TRUE;
       
  1607     }
       
  1608   }
       
  1609   return FALSE;
       
  1610 }
       
  1611 
       
  1612