コード例 #1
0
ファイル: diagram.cpp プロジェクト: dnjsflagh1/code
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=\"" << tooltip << "\" ";
    }
    t << "alt=\"" << convertToXML(cd->displayName()); 
    t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
    t << (x+w) << "," << (y+h) << "\"/>" << endl;
  }
}
コード例 #2
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]";
        }
    }
}
コード例 #3
0
ファイル: msc.cpp プロジェクト: AndreMiras/doxygen
static bool convertMapFile(FTextStream &t,const char *mapName,const QCString relPath,
                           const QCString &context)
{
  QFile f(mapName);
  if (!f.open(IO_ReadOnly))
  {
    err("failed to open map file %s for inclusion in the docs!\n"
        "If you installed Graphviz/dot after a previous failing run, \n"
        "try deleting the output directory and rerun doxygen.\n",mapName);
    return FALSE;
  }
  const int maxLineLen=1024;
  char buf[maxLineLen];
  char url[maxLineLen];
  char ref[maxLineLen];
  int x1,y1,x2,y2;
  while (!f.atEnd())
  {
    bool isRef = FALSE;
    int numBytes = f.readLine(buf,maxLineLen);
    buf[numBytes-1]='\0';
    //printf("ReadLine `%s'\n",buf);
    if (qstrncmp(buf,"rect",4)==0)
    {
      // obtain the url and the coordinates in the order used by graphviz-1.5
      sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);

      if (qstrcmp(url,"\\ref")==0 || qstrcmp(url,"@ref")==0)
      {
        isRef = TRUE;
        sscanf(buf,"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
      }

      // sanity checks
      if (y2<y1) { int temp=y2; y2=y1; y1=temp; }
      if (x2<x1) { int temp=x2; x2=x1; x1=temp; }

      t << "<area href=\"";

      if ( isRef )
      {
        // handle doxygen \ref tag URL reference
        DocRef *df = new DocRef( (DocNode*) 0, url, context );
        t << externalRef(relPath,df->ref(),TRUE);
        if (!df->file().isEmpty()) t << df->file() << Doxygen::htmlFileExtension;
        if (!df->anchor().isEmpty()) t << "#" << df->anchor();
        delete df;
      }
      else
      {
        t << url;
      }
      t << "\" shape=\"rect\" coords=\""
        << x1 << "," << y1 << "," << x2 << "," << y2 << "\""
        << " alt=\"\"/>" << endl;
    }
  }

  return TRUE;
}
コード例 #4
0
void HtmlDocVisitor::startLink(const QCString &ref,const QCString &file,
                               const QCString &relPath,const QCString &anchor,
                               const QCString &tooltip)
{
  if (!ref.isEmpty()) // link to entity imported via tag file
  {
    m_t << "<a class=\"elRef\" ";
    m_t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
  }
  else // local link
  {
    m_t << "<a class=\"el\" ";
  }
  m_t << "href=\"";
  m_t << externalRef(relPath,ref,TRUE);
  if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension;
  if (!anchor.isEmpty()) m_t << "#" << anchor;
  m_t << "\"";
  if (!tooltip.isEmpty()) m_t << " title=\"" << tooltip << "\"";
  m_t << ">";
}
コード例 #5
0
ファイル: ftvhelp.cpp プロジェクト: LianYangCn/doxygen
static void generateJSLink(FTextStream &t,FTVNode *n)
{
    if (n->file.isEmpty()) // no link
    {
        t << "\"" << convertToJSString(n->name) << "\", null, ";
    }
    else // link into other page
    {
        t << "\"" << convertToJSString(n->name) << "\", \"";
        t << externalRef("",n->ref,TRUE);
        t << node2URL(n);
        t << "\", ";
    }
}
コード例 #6
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]";
      }
   }
}