コード例 #1
0
ファイル: ftvhelp.cpp プロジェクト: LianYangCn/doxygen
void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
{
    //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
    //    n->ref.data(),n->file.data(),n->anchor.data());
    if (n->file.isEmpty()) // no link
    {
        t << "<b>" << convertToHtml(n->name) << "</b>";
    }
    else // link into other frame
    {
        if (!n->ref.isEmpty()) // link to entity imported via tag file
        {
            t << "<a class=\"elRef\" ";
            t << externalLinkTarget() << externalRef("",n->ref,FALSE);
        }
        else // local link
        {
            t << "<a class=\"el\" ";
        }
        t << "href=\"";
        t << externalRef("",n->ref,TRUE);
        t << node2URL(n);
        if (m_topLevelIndex)
            t << "\" target=\"basefrm\">";
        else
            t << "\" target=\"_self\">";
        t << convertToHtml(n->name);
        t << "</a>";
        if (!n->ref.isEmpty())
        {
            t << "&#160;[external]";
        }
    }
}
コード例 #2
0
ファイル: htmlgen.cpp プロジェクト: ceefour/aphrodox
static void writePageFooter(QTextStream &t,const QCString &lastTitle,
                            const QCString relPath)
{
  if (g_footer.isEmpty())
  {
    t << "<hr size=\"1\"><address style=\"align: right;\"><small>";
    t << theTranslator->trGeneratedAt(
        dateToString(TRUE),
        Config_getString("PROJECT_NAME")
        );
    t << "&nbsp;" << endl << "<a href=\"http://www.doxygen.org/index.html\">";
    t << endl << "<img src=\"" << relPath << "doxygen.png\" alt=\"doxygen\" " 
      << "align=\"middle\" border=\"0\">" << "</a> " << versionString << " ";
    t << "</small></address>";
    if (Debug::isFlagSet(Debug::Validate))
    {
      t << "<p><a href=\"http://validator.w3.org/check/referer\">"
           "<img border=\"0\" src=\"http://www.w3.org/Icons/valid-html401\""
           " height=\"31\" width=\"88\" alt=\"This page is Valid HTML 4.01 "
           "Transitional!\"></a><a href=\"http://jigsaw.w3.org/css-validator/\">"
           "<img style=\"border:0;width:88px;height:31px\" "
           "src=\"http://jigsaw.w3.org/css-validator/images/vcss\" "
           "alt=\"This page uses valid CSS!\"></a></p>";
    }
    t << "\n</body>\n</html>\n";
  }
  else
  {
    t << substituteKeywords(g_footer,convertToHtml(lastTitle),relPath);
  }
}
コード例 #3
0
ファイル: htmlgen.cpp プロジェクト: ceefour/aphrodox
static void writeDefaultHeaderFile(QTextStream &t, const char *title,
                                   const char *relPath,bool usePathCmd)
{
  QString relPathStr;
  if (usePathCmd) 
    relPathStr="$relpath$";
  else
    relPathStr=relPath;

  t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
    "<html><head>" 
    "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=" 
         << theTranslator->idLanguageCharset() << "\">\n"
    "<title>"; 
  t << convertToHtml(title);
  t << "</title>\n";
  t << "<link ";
  t << "href=\"";
  if (Config_getString("HTML_STYLESHEET").isEmpty())
  {
    t << relPathStr << "doxygen.css";
  }
  else
  {
    QCString cssname=Config_getString("HTML_STYLESHEET");
    QFileInfo cssfi(cssname);
    if (!cssfi.exists())
    {
      err("Error: user specified HTML style sheet file does not exist!\n");
    }
    t << relPathStr << cssfi.fileName();
  }
  t << "\" rel=\"stylesheet\" type=\"text/css\">\n"
    "</head><body>\n";
}
コード例 #4
0
ファイル: diagram.cpp プロジェクト: Beachy13/doxygen
static void writeMapArea(FTextStream &t,ClassDef *cd,QCString relPath,
                         int x,int y,int w,int h)
{
  if (cd->isLinkable())
  {
    QCString ref=cd->getReference();
    t << "<area ";
    if (!ref.isEmpty()) 
    {
      t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
    }
    t << "href=\"";
    t << externalRef(relPath,ref,TRUE);
    t << cd->getOutputFileBase() << Doxygen::htmlFileExtension;
    if (!cd->anchor().isEmpty())
    {
      t << "#" << cd->anchor();
    }
    t << "\" ";
    QCString tooltip = cd->briefDescriptionAsTooltip();
    if (!tooltip.isEmpty())
    {
      t << "title=\"" << convertToHtml(tooltip) << "\" ";
    }
    t << "alt=\"" << convertToXML(cd->displayName()); 
    t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
    t << (x+w) << "," << (y+h) << "\"/>" << endl;
  }
}
コード例 #5
0
ファイル: ftvhelp.cpp プロジェクト: terceiro/doxyparse
void FTVHelp::generateLink(QTextStream &t,FTVNode *n)
{
  QCString *dest;
  //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
  //    n->ref.data(),n->file.data(),n->anchor.data());
  if (n->file.isEmpty()) // no link
  {
    t << "<b>" << convertToHtml(n->name) << "</b>";
  }
  else // link into other frame
  {
    if (!n->ref.isEmpty()) // link to entity imported via tag file
    {
      t << "<a class=\"elRef\" ";
      t << "doxygen=\"" << n->ref << ":";
      if ((dest=Doxygen::tagDestinationDict[n->ref])) t << *dest << "/";
      t << "\" ";
    }
    else // local link
    {
      t << "<a class=\"el\" ";
    }
    t << "href=\"";
    if (!n->ref.isEmpty())
    {
      if ((dest=Doxygen::tagDestinationDict[n->ref])) t << *dest << "/";
    }
    t << n->file << Doxygen::htmlFileExtension;
    if (!n->anchor.isEmpty()) t << "#" << n->anchor;
    if (m_topLevelIndex)
      t << "\" target=\"basefrm\">";
    else
      t << "\" target=\"_self\">";
    t << convertToHtml(n->name);
    t << "</a>";
    if (!n->ref.isEmpty())
    {
      t << "&nbsp;[external]";
    }
  }
}
コード例 #6
0
ファイル: htmlhelp.cpp プロジェクト: CodeMining/doxygen
/*! Add an list item to the contents file.
 *  \param isDir boolean indicating if this is a dir or file entry
 *  \param name the name of the item.
 *  \param ref  the URL of to the item.
 *  \param file the file in which the item is defined.
 *  \param anchor the anchor of the item.
 *  \param separateIndex not used.
 *  \param addToNavIndex not used.
 *  \param def not used.
 */
void HtmlHelp::addContentsItem(bool isDir,
                               const char *name,
                               const char * /*ref*/, 
                               const char *file,
                               const char *anchor,
                               bool /* separateIndex */,
                               bool /* addToNavIndex */,
                               Definition * /* def */)
{
  // If we're using a binary toc then folders cannot have links. 
  // Tried this and I didn't see any problems, when not using
  // the resetting of file and anchor the TOC works better
  // (prev / next button)
  //if(Config_getBool(BINARY_TOC) && isDir) 
  //{
    //file = 0;
    //anchor = 0;
  //}
  int i; for (i=0;i<dc;i++) cts << "  ";
  cts << "<LI><OBJECT type=\"text/sitemap\">";
  cts << "<param name=\"Name\" value=\"" << convertToHtml(recode(name),TRUE) << "\">";
  if (file)      // made file optional param - KPW
  {
    if (file && (file[0]=='!' || file[0]=='^')) // special markers for user defined URLs
    {
      cts << "<param name=\"";
      if (file[0]=='^') cts << "URL"; else cts << "Local";
      cts << "\" value=\"";
      cts << &file[1];
    }
    else
    {
      cts << "<param name=\"Local\" value=\"";
      cts << file << Doxygen::htmlFileExtension;
      if (anchor) cts << "#" << anchor;  
    }
    cts << "\">";
  }
  cts << "<param name=\"ImageNumber\" value=\"";
  if (isDir)  // added - KPW
  {
    cts << (int)BOOK_CLOSED ;
  }
  else
  {
    cts << (int)TEXT;
  }
  cts << "\">";
  cts << "</OBJECT>\n";
}
コード例 #7
0
void FTVHelp::generateLink(QTextStream &t, FTVNode *n)
{
   if (n->file.isEmpty()) { 
      // no link
      t << "<b>" << convertToHtml(n->name) << "</b>";

   } else { 
      // link into other frame

      if (!n->ref.isEmpty()) { 
         // link to entity imported via tag file
         t << "<a class=\"elRef\" ";
         t << externalLinkTarget() << externalRef("", n->ref, false);

      } else { 
         // local link
         t << "<a class=\"el\" ";
      }

      t << "href=\"";
      t << externalRef("", n->ref, true);
      t << node2URL(n);

      if (m_topLevelIndex) {
         t << "\" target=\"basefrm\">";
      } else {
         t << "\" target=\"_self\">";
      }

      t << convertToHtml(n->name);
      t << "</a>";

      if (! n->ref.isEmpty()) {
         t << "&#160;[external]";
      }
   }
}
コード例 #8
0
void HtmlDocVisitor::visit(DocFormula *f)
{
  if (m_hide) return;
  bool bDisplay = !f->isInline();
  if (bDisplay) 
  {
    forceEndParagraph(f);
    m_t << "<p class=\"formulaDsp\">" << endl;
  }

  if (Config_getBool("USE_MATHJAX"))
  {
    QCString text = f->text();
    bool closeInline = FALSE;
    if (!bDisplay && !text.isEmpty() && text.at(0)=='$' && 
                      text.at(text.length()-1)=='$')
    {
      closeInline=TRUE;
      text = text.mid(1,text.length()-2);
      m_t << "\\(";
    }
    m_t << convertToHtml(text);
    if (closeInline)
    {
      m_t << "\\)";
    }
  }
  else
  {
    m_t << "<img class=\"formula" 
      << (bDisplay ? "Dsp" : "Inl");
    m_t << "\" alt=\"";
    filterQuotedCdataAttr(f->text());
    m_t << "\"";
    /// @todo cache image dimensions on formula generation and give height/width
    /// for faster preloading and better rendering of the page
    m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>";

  }
  if (bDisplay)
  {
    m_t << endl << "</p>" << endl;
    forceStartParagraph(f);
  }
}
コード例 #9
0
ファイル: namespacedef.cpp プロジェクト: LianYangCn/doxygen
void NamespaceDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const
{
    static bool createSubDirs=Config_getBool("CREATE_SUBDIRS");

    ol.writeString("      <div class=\"navtab\">\n");
    ol.writeString("        <table>\n");

    MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
    if (allMemberList)
    {
        MemberListIterator mli(*allMemberList);
        MemberDef *md;
        for (mli.toFirst(); (md=mli.current()); ++mli)
        {
            if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
            {
                ol.writeString("          <tr><td class=\"navtab\">");
                if (md->isLinkableInProject())
                {
                    if (md==currentMd) // selected item => highlight
                    {
                        ol.writeString("<a class=\"qindexHL\" ");
                    }
                    else
                    {
                        ol.writeString("<a class=\"qindex\" ");
                    }
                    ol.writeString("href=\"");
                    if (createSubDirs) ol.writeString("../../");
                    ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor());
                    ol.writeString("\">");
                    ol.writeString(convertToHtml(md->localName()));
                    ol.writeString("</a>");
                }
                ol.writeString("</td></tr>\n");
            }
        }
    }

    ol.writeString("        </table>\n");
    ol.writeString("      </div>\n");
}
コード例 #10
0
ファイル: htmlgen.cpp プロジェクト: ceefour/aphrodox
void HtmlGenerator::startFile(const char *name,const char *,
                              const char *title)
{
  //printf("HtmlGenerator::startFile(%s)\n",name);
  QCString fileName=name;
  lastTitle=title;
  relPath = relativePathToRoot(fileName);

  if (fileName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension) 
  {
    fileName+=Doxygen::htmlFileExtension;
  }
  startPlainFile(fileName);
  if (Config_getBool("GENERATE_HTMLHELP"))
  {
    HtmlHelp::getInstance()->addIndexFile(fileName);
  }
  
  QCString dispTitle = title;
  QCString projName = Config_getString("PROJECT_NAME");
  if (!projName.isEmpty())
  {
    dispTitle.prepend(projName+": ");
  }
 
  lastFile = fileName;
  if (g_header.isEmpty()) 
  {
    writeDefaultHeaderFile(t,dispTitle,relPath,FALSE);
  }
  else
  {
    t << substituteKeywords(g_header,convertToHtml(dispTitle),relPath);
  }
  t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " 
    << versionString << " -->" << endl;
}