Orb/Doxygen/src/latexgen.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.
   349        "    \\setlength{\\leftmargin}{\\labelwidth}%\n"
   349        "    \\setlength{\\leftmargin}{\\labelwidth}%\n"
   350        "    \\setlength{\\parsep}{0pt}%\n"
   350        "    \\setlength{\\parsep}{0pt}%\n"
   351        "    \\setlength{\\itemsep}{-4pt}%\n"
   351        "    \\setlength{\\itemsep}{-4pt}%\n"
   352        "    \\renewcommand{\\makelabel}{\\entrylabel}%\n"
   352        "    \\renewcommand{\\makelabel}{\\entrylabel}%\n"
   353        "  }%\n"
   353        "  }%\n"
   354        "  \\item[#1:]%\n"
   354        "  \\item[#1]%\n"
   355        "}{%\n"
   355        "}{%\n"
   356        "  \\end{list}%\n"
   356        "  \\end{list}%\n"
   357        "}\n\n";
   357        "}\n\n";
   358   t << "%---------- Commands used by doxygen LaTeX output generator ----------\n\n";
   358   t << "%---------- Commands used by doxygen LaTeX output generator ----------\n\n";
   359   t << "% Used by <pre> ... </pre>\n"
   359   t << "% Used by <pre> ... </pre>\n"
   502        "}{%\n"
   502        "}{%\n"
   503        "  \\end{DoxyDesc}%\n"
   503        "  \\end{DoxyDesc}%\n"
   504        "}\n\n";
   504        "}\n\n";
   505   t << "% Used by @internal\n"
   505   t << "% Used by @internal\n"
   506        "\\newenvironment{DoxyInternal}[1]{%\n"
   506        "\\newenvironment{DoxyInternal}[1]{%\n"
   507        "  \\begin{DoxyDesc}{#1}%\n"
   507        "  \\paragraph*{#1}%\n"
   508        "}{%\n"
   508        "}{%\n"
   509        "  \\end{DoxyDesc}%\n"
       
   510        "}\n\n";
   509        "}\n\n";
   511   t << "% Used by @par and @paragraph\n"
   510   t << "% Used by @par and @paragraph\n"
   512        "\\newenvironment{DoxyParagraph}[1]{%\n"
   511        "\\newenvironment{DoxyParagraph}[1]{%\n"
   513        "  \\begin{list}{}%\n"
   512        "  \\begin{list}{}%\n"
   514        "  {%\n"
   513        "  {%\n"
   646   QCString &projectName = Config_getString("PROJECT_NAME");
   645   QCString &projectName = Config_getString("PROJECT_NAME");
   647 
   646 
   648   t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName );
   647   t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName );
   649   t << " doxygen";
   648   t << " doxygen";
   650   //t << " " << theTranslator->trWrittenBy() << " ";
   649   //t << " " << theTranslator->trWrittenBy() << " ";
   651   //t << "Dimitri van Heesch \\copyright~1997-2008";
   650   //t << "Dimitri van Heesch \\copyright~1997-2010";
   652   writeDefaultStyleSheetPart2(t);
   651   writeDefaultStyleSheetPart2(t);
   653   t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName );
   652   t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName );
   654   t << " doxygen";
   653   t << " doxygen";
   655   //t << " << theTranslator->trWrittenBy() << " ";
   654   //t << " << theTranslator->trWrittenBy() << " ";
   656   //t << "Dimitri van Heesch \\copyright~1997-2008";
   655   //t << "Dimitri van Heesch \\copyright~1997-2010";
   657   writeDefaultStyleSheetPart3(t);
   656   writeDefaultStyleSheetPart3(t);
   658 }
   657 }
   659 
   658 
   660 void LatexGenerator::startFile(const char *name,const char *,const char *)
   659 void LatexGenerator::startFile(const char *name,const char *,const char *)
   661 {
   660 {
   913         }
   912         }
   914         for (;(gd=gli.current());++gli)
   913         for (;(gd=gli.current());++gli)
   915         {
   914         {
   916           if (!gd->isReference())
   915           if (!gd->isReference())
   917           {
   916           {
   918             if (compactLatex) t << "\\input"; else t << "\\include";
   917             //if (compactLatex) t << "\\input"; else t << "\\include";
       
   918             t << "\\input"; 
   919             t << "{" << gd->getOutputFileBase() << "}\n";
   919             t << "{" << gd->getOutputFileBase() << "}\n";
   920           }
   920           }
   921         }
   921         }
   922       }
   922       }
   923       break;
   923       break;
   936         }
   936         }
   937         for (;(dd=dli.current());++dli)
   937         for (;(dd=dli.current());++dli)
   938         {
   938         {
   939           if (dd->isLinkableInProject())
   939           if (dd->isLinkableInProject())
   940           {
   940           {
   941             if (compactLatex) t << "\\input"; else t << "\\include";
   941             //if (compactLatex) t << "\\input"; else t << "\\include";
       
   942             t << "\\input"; 
   942             t << "{" << dd->getOutputFileBase() << "}\n";
   943             t << "{" << dd->getOutputFileBase() << "}\n";
   943           }
   944           }
   944         }
   945         }
   945       }
   946       }
   946       break;
   947       break;
   959         }
   960         }
   960         while ((nd=nli.current()))
   961         while ((nd=nli.current()))
   961         {
   962         {
   962           if (nd->isLinkableInProject())
   963           if (nd->isLinkableInProject())
   963           {
   964           {
   964             if (compactLatex) t << "\\input"; else t << "\\include";
   965             //if (compactLatex) t << "\\input"; else t << "\\include";
       
   966             t << "\\input"; 
   965             t << "{" << nd->getOutputFileBase() << "}\n";
   967             t << "{" << nd->getOutputFileBase() << "}\n";
   966           }
   968           }
   967           ++nli;
   969           ++nli;
   968         }
   970         }
   969       }
   971       }
   983         }
   985         }
   984         for (;(cd=cli.current());++cli)
   986         for (;(cd=cli.current());++cli)
   985         {
   987         {
   986           if (cd->isLinkableInProject() && cd->templateMaster()==0)
   988           if (cd->isLinkableInProject() && cd->templateMaster()==0)
   987           {
   989           {
   988             if (compactLatex) t << "\\input"; else t << "\\include";
   990             //if (compactLatex) t << "\\input"; else t << "\\include";
       
   991             t << "\\input"; 
   989             t << "{" << cd->getOutputFileBase() << "}\n";
   992             t << "{" << cd->getOutputFileBase() << "}\n";
   990           } 
   993           } 
   991         }
   994         }
   992       }
   995       }
   993       break;
   996       break;
  1005               if (isFirst)
  1008               if (isFirst)
  1006               {
  1009               {
  1007                 t << "}\n\\input{" << fd->getOutputFileBase() << "}\n";
  1010                 t << "}\n\\input{" << fd->getOutputFileBase() << "}\n";
  1008                 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
  1011                 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
  1009                 {
  1012                 {
  1010                   t << "\\include{" << fd->getSourceFileBase() << "}\n";
  1013                   //t << "\\include{" << fd->getSourceFileBase() << "}\n";
       
  1014                   t << "\\input{" << fd->getSourceFileBase() << "}\n";
  1011                 }
  1015                 }
  1012                 isFirst=FALSE;
  1016                 isFirst=FALSE;
  1013               }
  1017               }
  1014               else
  1018               else
  1015               {
  1019               {
  1016                 if (compactLatex) t << "\\input" ; else t << "\\include";
  1020                 //if (compactLatex) t << "\\input" ; else t << "\\include";
       
  1021                 t << "\\input" ; 
  1017                 t << "{" << fd->getOutputFileBase() << "}\n";
  1022                 t << "{" << fd->getOutputFileBase() << "}\n";
  1018                 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
  1023                 if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
  1019                 {
  1024                 {
  1020                   t << "\\include{" << fd->getSourceFileBase() << "}\n";
  1025                   //t << "\\include{" << fd->getSourceFileBase() << "}\n";
       
  1026                   t << "\\input{" << fd->getSourceFileBase() << "}\n";
  1021                 }
  1027                 }
  1022               }
  1028               }
  1023             }
  1029             }
  1024             fd=fn->next();
  1030             fd=fn->next();
  1025           }
  1031           }
  1036         {
  1042         {
  1037           t << "\\input{" << pd->getOutputFileBase() << "}\n";
  1043           t << "\\input{" << pd->getOutputFileBase() << "}\n";
  1038         }
  1044         }
  1039         for (++pdi;(pd=pdi.current());++pdi)
  1045         for (++pdi;(pd=pdi.current());++pdi)
  1040         {
  1046         {
  1041           if (compactLatex) t << "\\input" ; else t << "\\include";
  1047           //if (compactLatex) t << "\\input" ; else t << "\\include";
       
  1048           t << "\\input"; 
  1042           t << "{" << pd->getOutputFileBase() << "}\n";
  1049           t << "{" << pd->getOutputFileBase() << "}\n";
  1043         }
  1050         }
  1044       }
  1051       }
  1045       break;
  1052       break;
  1046     case isPageDocumentation:
  1053     case isPageDocumentation:
  1076 }
  1083 }
  1077 
  1084 
  1078 void LatexGenerator::writePageLink(const char *name, bool first)
  1085 void LatexGenerator::writePageLink(const char *name, bool first)
  1079 {
  1086 {
  1080   bool &compactLatex = Config_getBool("COMPACT_LATEX");
  1087   bool &compactLatex = Config_getBool("COMPACT_LATEX");
  1081   if (compactLatex || first) t << "\\input" ; else t << "\\include";
  1088   // next is remove for bug615957
       
  1089   //if (compactLatex || first) t << "\\input" ; else t << "\\include";
       
  1090   t << "\\input" ; 
  1082   t << "{" << name << "}\n";
  1091   t << "{" << name << "}\n";
  1083 }
  1092 }
  1084 
  1093 
  1085 
  1094 
  1086 void LatexGenerator::writeStyleInfo(int part)
  1095 void LatexGenerator::writeStyleInfo(int part)
  1098     case 3:
  1107     case 3:
  1099       t << " Doxygen ";
  1108       t << " Doxygen ";
  1100       break;
  1109       break;
  1101     case 2:
  1110     case 2:
  1102       {
  1111       {
  1103         //t << " Dimitri van Heesch \\copyright~1997-2008";
  1112         //t << " Dimitri van Heesch \\copyright~1997-2010";
  1104         t << "}]{}\n";
  1113         t << "}]{}\n";
  1105         writeDefaultStyleSheetPart2(t);
  1114         writeDefaultStyleSheetPart2(t);
  1106       }
  1115       }
  1107       break;
  1116       break;
  1108     case 4:
  1117     case 4:
  1109       {
  1118       {
  1110         //t << " Dimitri van Heesch \\copyright~1997-2008";
  1119         //t << " Dimitri van Heesch \\copyright~1997-2010";
  1111         writeDefaultStyleSheetPart3(t);
  1120         writeDefaultStyleSheetPart3(t);
  1112         endPlainFile();
  1121         endPlainFile();
  1113       }
  1122       }
  1114       break;
  1123       break;
  1115   }
  1124   }
  1125   t << endl << endl;
  1134   t << endl << endl;
  1126 }
  1135 }
  1127 
  1136 
  1128 void LatexGenerator::endParagraph()
  1137 void LatexGenerator::endParagraph()
  1129 {
  1138 {
       
  1139   t << endl << endl;
  1130 }
  1140 }
  1131 
  1141 
  1132 void LatexGenerator::writeString(const char *text)
  1142 void LatexGenerator::writeString(const char *text)
  1133 {
  1143 {
  1134   t << text;
  1144   t << text;
  1378 {
  1388 {
  1379   disableLinks=FALSE;
  1389   disableLinks=FALSE;
  1380   t << "}" << endl;
  1390   t << "}" << endl;
  1381 }
  1391 }
  1382 
  1392 
  1383 void LatexGenerator::startMemberHeader()
  1393 void LatexGenerator::startMemberHeader(const char *)
  1384 {
  1394 {
  1385   if (Config_getBool("COMPACT_LATEX")) 
  1395   if (Config_getBool("COMPACT_LATEX")) 
  1386   {
  1396   {
  1387     t << "\\subsubsection*{"; 
  1397     t << "\\subsubsection*{"; 
  1388   }
  1398   }
  1810   t << endl;
  1820   t << endl;
  1811 }
  1821 }
  1812 
  1822 
  1813 void LatexGenerator::startDotGraph() 
  1823 void LatexGenerator::startDotGraph() 
  1814 {
  1824 {
       
  1825   newParagraph();
  1815 }
  1826 }
  1816 
  1827 
  1817 void LatexGenerator::endDotGraph(const DotClassGraph &g) 
  1828 void LatexGenerator::endDotGraph(const DotClassGraph &g) 
  1818 {
  1829 {
  1819   g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),relPath);
  1830   g.writeGraph(t,EPS,Config_getString("LATEX_OUTPUT"),relPath);