Exemplo n.º 1
0
static void writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line)
{
  Definition *d = fd ? fd->getSourceDefinition(line) : 0;
  if (d && d->isLinkable())
  {
    g_currentDefinition=d;
    g_currentLine=line;
    MemberDef *md = fd->getSourceMember(line);
    if (md && md->isLinkable())  // link to member
    {
      if (g_currentMemberDef!=md) // new member, start search for body
      {
        g_searchForBody=TRUE;
        g_insideBody=FALSE;
        g_bracketCount=0;
      }
      g_currentMemberDef=md;
      ol.writeLineNumber(md->getReference(),
                         md->getOutputFileBase(),
                         md->anchor(),
                         line);
    }
    else // link to compound
    {
      g_currentMemberDef=0;
      ol.writeLineNumber(d->getReference(),
                         d->getOutputFileBase(),
                         d->anchor(),
                         line);
    }
  }
  else // no link
  {
    ol.writeLineNumber(0,0,0,line);
  }

  // set search page target
  if (Doxygen::searchIndex)
  {
    QCString lineAnchor;
    lineAnchor.sprintf("l%05d",line);
    ol.setCurrentDoc(fd,lineAnchor,TRUE);
  }

  //printf("writeLineNumber(%d) g_searchForBody=%d\n",line,g_searchForBody);
}
Exemplo n.º 2
0
void TooltipManager::writeTooltips(CodeOutputInterface &ol)
{
  QDictIterator<Definition> di(p->tooltipInfo);
  Definition *d;
  for (di.toFirst();(d=di.current());++di)
  {
    DocLinkInfo docInfo;
    docInfo.name   = d->qualifiedName();
    docInfo.ref    = d->getReference();
    docInfo.url    = d->getOutputFileBase();
    docInfo.anchor = d->anchor();
    SourceLinkInfo defInfo;
    if (d->getBodyDef() && d->getStartBodyLine()!=-1)
    {
      defInfo.file    = d->getBodyDef()->name();
      defInfo.line    = d->getStartBodyLine();
      defInfo.url     = d->getSourceFileBase();
      defInfo.anchor  = d->getSourceAnchor();
    }
    SourceLinkInfo declInfo; // TODO: fill in...
    QCString decl;
    if (d->definitionType()==Definition::TypeMember)
    {
      MemberDef *md = (MemberDef*)d;
      decl = md->declaration();
      if (!decl.isEmpty() && decl.at(0)=='@') // hide enum values
      {
        decl.resize(0);
      }
    }
    ol.writeTooltip(di.currentKey(),                 // id
                    docInfo,                         // symName
                    decl,                            // decl
                    d->briefDescriptionAsTooltip(),  // desc
                    defInfo,
                    declInfo
                   );
  }
}