⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtfgen.cpp

📁 doxygen(一个自动从源代码生成文档的工具)的源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
void RTFGenerator::endDescription()   {   DBG_RTF(t << "{\\comment (endDescription)}"    << endl)  t << "}";  newParagraph();}void RTFGenerator::startDescItem(){   newParagraph();  DBG_RTF(t << "{\\comment (startDescItem)}"    << endl)  t << "{\\b ";}void RTFGenerator::endDescItem(){   DBG_RTF(t << "{\\comment (endDescItem)}"    << endl)  t << "}" << endl;  newParagraph();}void RTFGenerator::startMemberDescription() {   DBG_RTF(t << "{\\comment (startMemberDescription)}"    << endl)  t << "{" << endl;  incrementIndentLevel();  t << Rtf_Style_Reset << Rtf_CList_DepthStyle();  startEmphasis();}void RTFGenerator::endMemberDescription(){   DBG_RTF(t << "{\\comment (endMemberDescription)}"    << endl)  endEmphasis();  newParagraph();  decrementIndentLevel();  t << "\\par}" << endl;}void RTFGenerator::startDescList(SectionTypes)     {   DBG_RTF(t << "{\\comment (startDescList)}"    << endl)  t << "{"; // ends at endDescList  t << "{"; // ends at endDescTitle  startBold();  newParagraph();}void RTFGenerator::endDescTitle()      {   DBG_RTF(t << "{\\comment (endDescTitle) }"    << endl)  endBold();  t << "}";  newParagraph();  incrementIndentLevel();  t << Rtf_Style_Reset << Rtf_DList_DepthStyle();}void RTFGenerator::writeDescItem(){  DBG_RTF(t << "{\\comment (writeDescItem) }"    << endl)}void RTFGenerator::endDescList()       {  DBG_RTF(t << "{\\comment (endDescList)}"    << endl)  newParagraph();  decrementIndentLevel();  m_omitParagraph = TRUE;  t << "}";}void RTFGenerator::startParamList(ParamListTypes)     {   DBG_RTF(t << "{\\comment (startParamList)}"    << endl)  t << "{"; // ends at endParamList  t << "{"; // ends at endDescTitle  startBold();  newParagraph();}void RTFGenerator::endParamList()       {  DBG_RTF(t << "{\\comment (endParamList)}"    << endl)  newParagraph();  decrementIndentLevel();  m_omitParagraph = TRUE;  t << "}";}void RTFGenerator::startSection(const char *,const char *title,bool sub){  DBG_RTF(t << "{\\comment (startSection)}"    << endl)  t << "{";  t<< Rtf_Style_Reset;  if (sub)  {    // set style    t << Rtf_Style["Heading3"]->reference;    // make table of contents entry    t << "{\\tc\\tcl3 \\v ";    docify(title);    t << "}" << endl;  }  else  {    // set style    t << Rtf_Style["Heading2"]->reference;    // make table of contents entry    t << "{\\tc\\tcl2 \\v ";    docify(title);    t << "}" << endl;  }}void RTFGenerator::endSection(const char *lab,bool){  newParagraph();  // make bookmark  writeAnchor(0,lab);  t << "}";}void RTFGenerator::writeSectionRef(const char *ref,const char *,                                   const char *lab,const char *title){  if (ref)  {    docify(title);  }  else  {    startBold();    docify(title);    endBold();    t << " (";    docify(theTranslator->trPageAbbreviation());    WriteRTFReference(lab);    t << ")" << endl;  }}void RTFGenerator::writeSectionRefItem(const char *,const char *lab,    const char *title){  docify(title);  t << "\\tab";  WriteRTFReference(lab);  t << endl;}//void RTFGenerator::writeSectionRefAnchor(const char *name,const char *lab,//    const char *title)//{//  writeSectionRef(name,lab,title);//}void RTFGenerator::docify(const char *str){  if (str)  {    const unsigned char *p=(const unsigned char *)str;    unsigned char c;    unsigned char pc='\0';    while (*p)    {      c=*p++;      switch(c)      {        case '{':  t << "\\{";            break;        case '}':  t << "\\}";            break;        case '\\': t << "\\\\";	          break;        default:             {             // see if we can insert an hyphenation hint            //if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-";            t << (char)c;              }      }      pc = c;      m_omitParagraph = FALSE;    }  }}void RTFGenerator::codify(const char *str){  // note that RTF does not have a "verbatim", so "\n" means  // nothing... add a "newParagraph()";  //static char spaces[]="        ";  if (str)  {     const char *p=str;    char c;    int spacesToNextTabStop;    while (*p)    {      c=*p++;      switch(c)      {        case '\t':  spacesToNextTabStop = Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE"));                    t << spaces.left(spacesToNextTabStop);                     col+=spacesToNextTabStop;                    break;         case '\n':  newParagraph();                    t << '\n'; col=0;                    break;        case '{':   t << "\\{"; col++;          break;        case '}':   t << "\\}"; col++;          break;        case '\\':  t << "\\\\"; col++;         break;        default:    t << c;    col++;           break;      }    }  }}void RTFGenerator::writeChar(char c){  char cs[2];  cs[0]=c;  cs[1]=0;  docify(cs);}void RTFGenerator::startClassDiagram(){}void RTFGenerator::endClassDiagram(ClassDiagram &d,    const char *fileName,const char *){  newParagraph();  // create a gif file  d.writeImage(t,dir,fileName,FALSE);  // display the file  t << "{" << endl;  t << Rtf_Style_Reset << endl;  t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";  t << fileName << ".gif";  t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;  t << "}" << endl;}void RTFGenerator::writeFormula(const char *,const char *text){  t << text;}void RTFGenerator::startMemberItem(int) {   DBG_RTF(t <<"{\\comment startMemberItem }" << endl)  t << Rtf_Style_Reset << Rtf_BList_DepthStyle() << endl; // set style to apropriate depth}void RTFGenerator::endMemberItem(bool) {  DBG_RTF(t <<"{\\comment endMemberItem }" << endl)  newParagraph();}void RTFGenerator::writeAnchor(const char *fileName,const char *name) {   t << "{\\bkmkstart ";  if (fileName) t << formatBmkStr(fileName);  if (fileName && name) t << "_";  if (name) t << formatBmkStr(name);  t << "}" << endl;  t << "{\\bkmkend " << formatBmkStr(name) << "}" << endl;}void RTFGenerator::WriteRTFReference(const char *label){  t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";  t << formatBmkStr(label);  t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";}void RTFGenerator::startCodeFragment() {   t << "{" << endl;  newParagraph();  t << Rtf_Style_Reset << Rtf_Code_DepthStyle();  //styleStack.push(Rtf_Style_CodeExample);}void RTFGenerator::endCodeFragment(){   newParagraph();  //styleStack.pop();  //printf("RTFGenerator::endCodeFrament() top=%s\n",styleStack.top());  //t << Rtf_Style_Reset << styleStack.top() << endl;  DBG_RTF(t << "{\\comment (endCodeFragment) }"    << endl)  t << "}" << endl;  m_omitParagraph = TRUE;}void RTFGenerator::writeNonBreakableSpace(int) {  t << "\\~ ";}void RTFGenerator::startMemberList()  {  t << endl;  DBG_RTF(t << "{\\comment (startMemberList) }"    << endl)  t << "{" << endl;#ifdef DELETEDCODE  if (!insideTabbing)    t << "\\begin{CompactItemize}" << endl; #endif}void RTFGenerator::endMemberList()    {  DBG_RTF(t << "{\\comment (endMemberList) }"    << endl)  t << "}" << endl;#ifdef DELETEDCODE  if (!insideTabbing)    t << "\\end{CompactItemize}"   << endl; #endif}void RTFGenerator::startImage(const char *name,const char *,bool){  newParagraph();  t << "{" << endl;  t << Rtf_Style_Reset << endl;  t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";  t << name;  t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;  t << "}" << endl;}void RTFGenerator::endImage(bool){  // not yet implemented}void RTFGenerator::startDotFile(const char *name,bool){  QCString baseName=name;  int i;  if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)  {    baseName=baseName.right(baseName.length()-i-1);   }  QCString outName = Config_getString("RTF_OUTPUT")+#ifdef _WIN32    "\\"#else    "/"#endif    +baseName;  writeDotGraphFromFile(name,outName,GIF);  newParagraph();  t << "{" << endl;  t << Rtf_Style_Reset << endl;  t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";  t << outName;  t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;  t << "}" << endl;}void RTFGenerator::endDotFile(bool){  // not yet implemented}void RTFGenerator::startDescTable()  {   DBG_RTF(t << "{\\comment (startDescTable) }"    << endl)  //t << "{" << endl;  //incrementIndentLevel();  //t << Rtf_Style_Reset << Rtf_CList_DepthStyle();}void RTFGenerator::endDescTable()    {   //decrementIndentLevel();  DBG_RTF(t << "{\\comment (endDescTable)}"      << endl)  //t << "}" << endl;  //t << Rtf_Style_Reset << styleStack.top();}void RTFGenerator::startDescTableTitle(){  //t << Rtf_BList_DepthStyle() << endl;  DBG_RTF(t << "{\\comment (startDescTableTitle) }"    << endl)  startBold();  startEmphasis();}void RTFGenerator::endDescTableTitle(){  DBG_RTF(t << "{\\comment (endDescTableTitle) }"    << endl)  endEmphasis();  endBold();  t << "  ";}void RTFGenerator::startDescTableData() {  DBG_RTF(t << "{\\comment (startDescTableData) }"    << endl)  m_omitParagraph=FALSE;}void RTFGenerator::endDescTableData() {  DBG_RTF(t << "{\\comment (endDescTableData) }"    << endl)  newParagraph();  m_omitParagraph=TRUE;}// a style for list formatted as a "bulleted list"void RTFGenerator::incrementIndentLevel(){  m_listLevel++;  if (m_listLevel>indentLevels-1)   {    warn_cont("Warning: Maximum indent level (%d) exceeded while generating RTF output!\n",indentLevels);     m_listLevel=indentLevels-1;  }}void RTFGenerator::decrementIndentLevel(){  m_listLevel--;  if (m_listLevel<0)   {    warn_cont("Warning: Negative indent level while generating RTF output!\n");    m_listLevel=0;  }}// a style for list formatted with "list continue" styleconst char * RTFGenerator::Rtf_CList_DepthStyle(){  QCString n=makeIndexName("ListContinue",m_listLevel);  return Rtf_Style[n]->reference;}// a style for list formatted as a "latext style" table of contentsconst char * RTFGenerator::Rtf_LCList_DepthStyle(){  QCString n=makeIndexName("LatexTOC",m_listLevel);  return Rtf_Style[n]->reference;}// a style for list formatted as a "bullet" style const char * RTFGenerator::Rtf_BList_DepthStyle(){  QCString n=makeIndexName("ListBullet",m_listLevel);  return Rtf_Style[n]->reference;}// a style for list formatted as a "enumeration" style const char * RTFGenerator::Rtf_EList_DepthStyle(){  QCString n=makeIndexName("ListEnum",m_listLevel);  return Rtf_Style[n]->reference;}const char * RTFGenerator::Rtf_DList_DepthStyle(){  QCString n=makeIndexName("DescContinue",m_listLevel);  return Rtf_Style[n]->reference;}const char * RTFGenerator::Rtf_Code_DepthStyle(){  QCString n=makeIndexName("CodeExample",m_listLevel);  ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -