Doxygen
latexdocvisitor.cpp 文件参考
#include <algorithm>
#include "htmlattrib.h"
#include "latexdocvisitor.h"
#include "latexgen.h"
#include "docparser.h"
#include "language.h"
#include "doxygen.h"
#include "outputgen.h"
#include "dot.h"
#include "util.h"
#include "message.h"
#include "parserintf.h"
#include "msc.h"
#include "dia.h"
#include "cite.h"
#include "filedef.h"
#include "config.h"
#include "htmlentity.h"
#include "emoji.h"
#include "plantuml.h"
#include "fileinfo.h"
+ latexdocvisitor.cpp 的引用(Include)关系图:

浏览源代码.

函数

static const char * getSectionName (int level)
 
static void visitPreStart (TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage=FALSE)
 
static void visitPostEnd (TextStream &t, bool hasCaption, bool inlineImage=FALSE)
 
static void visitCaption (LatexDocVisitor *parent, const DocNodeList &children)
 
static bool classEqualsReflist (const DocNode *n)
 
static bool listIsNested (const DocNode *n)
 
static bool tableIsNested (const DocNode *n)
 
static void writeStartTableCommand (TextStream &t, const DocNode *n, int cols)
 
static void writeEndTableCommand (TextStream &t, const DocNode *n)
 

变量

const int maxLevels =5
 
static const char * secLabels [maxLevels]
 

函数说明

◆ classEqualsReflist()

static bool classEqualsReflist ( const DocNode n)
static

在文件 latexdocvisitor.cpp1055 行定义.

1056 {
1057  if (n->kind()==DocNode::Kind_HtmlDescList)
1058  {
1059  HtmlAttribList attrs = ((DocHtmlDescList *)n)->attribs();
1060  auto it = std::find_if(attrs.begin(),attrs.end(),
1061  [](const auto &att) { return att.name=="class"; });
1062  if (it!=attrs.end() && it->value == "reflist") return true;
1063  }
1064  return false;
1065 }

引用了 DocNode::kind() , 以及 DocNode::Kind_HtmlDescList.

被这些函数引用 listIsNested(), LatexDocVisitor::visitPost() , 以及 LatexDocVisitor::visitPre().

◆ getSectionName()

static const char* getSectionName ( int  level)
static

在文件 latexdocvisitor.cpp46 行定义.

47 {
48  static bool compactLatex = Config_getBool(COMPACT_LATEX);
49  int l = level;
50  if (compactLatex) l++;
51  if (Doxygen::insideMainPage) l--;
52  return secLabels[std::min(maxLevels-1,l)];
53 }

引用了 Config_getBool, Doxygen::insideMainPage, maxLevels , 以及 secLabels.

被这些函数引用 LatexDocVisitor::visitPre().

◆ listIsNested()

static bool listIsNested ( const DocNode n)
static

在文件 latexdocvisitor.cpp1068 行定义.

1069 {
1070  bool isNested=false;
1071  if (n)
1072  {
1073  if (classEqualsReflist(n)) return false;
1074  n = n->parent();
1075  }
1076  while (n && !isNested)
1077  {
1078  if (n->kind()==DocNode::Kind_HtmlDescList)
1079  {
1080  isNested = !classEqualsReflist(n);
1081  }
1082  n = n->parent();
1083  }
1084  return isNested;
1085 }

引用了 classEqualsReflist(), DocNode::kind(), DocNode::Kind_HtmlDescList , 以及 DocNode::parent().

被这些函数引用 LatexDocVisitor::visitPre().

◆ tableIsNested()

static bool tableIsNested ( const DocNode n)
static

在文件 latexdocvisitor.cpp1138 行定义.

1139 {
1140  bool isNested=FALSE;
1141  while (n && !isNested)
1142  {
1143  isNested = n->kind()==DocNode::Kind_HtmlTable || n->kind()==DocNode::Kind_ParamSect;
1144  n = n->parent();
1145  }
1146  return isNested;
1147 }

引用了 FALSE, DocNode::kind(), DocNode::Kind_HtmlTable, DocNode::Kind_ParamSect , 以及 DocNode::parent().

被这些函数引用 LatexDocVisitor::visitPost(), LatexDocVisitor::visitPre(), writeEndTableCommand() , 以及 writeStartTableCommand().

◆ visitCaption()

static void visitCaption ( LatexDocVisitor parent,
const DocNodeList children 
)
static

在文件 latexdocvisitor.cpp146 行定义.

147 {
148  for (const auto &n : children) n->accept(parent);
149 }

被这些函数引用 LatexDocVisitor::visit(), LatexDocVisitor::visitPre(), LatexDocVisitor::writeDiaFile(), LatexDocVisitor::writeMscFile() , 以及 LatexDocVisitor::writePlantUMLFile().

◆ visitPostEnd()

static void visitPostEnd ( TextStream t,
bool  hasCaption,
bool  inlineImage = FALSE 
)
static

在文件 latexdocvisitor.cpp125 行定义.

126 {
127  if (inlineImage)
128  {
129  t << "\n\\end{DoxyInlineImage}\n";
130  }
131  else
132  {
133  t << "}\n"; // end mbox or caption
134  if (hasCaption)
135  {
136  t << "\\end{DoxyImage}\n";
137  }
138  else
139  {
140  t << "\\end{DoxyImageNoCaption}\n";
141  }
142  }
143 }

被这些函数引用 LatexDocVisitor::endDiaFile(), LatexDocVisitor::endDotFile(), LatexDocVisitor::endMscFile(), LatexDocVisitor::visitPost(), LatexDocVisitor::writeDiaFile(), LatexDocVisitor::writeMscFile() , 以及 LatexDocVisitor::writePlantUMLFile().

◆ visitPreStart()

static void visitPreStart ( TextStream t,
bool  hasCaption,
QCString  name,
QCString  width,
QCString  height,
bool  inlineImage = FALSE 
)
static

在文件 latexdocvisitor.cpp55 行定义.

56 {
57  if (inlineImage)
58  {
59  t << "\n\\begin{DoxyInlineImage}\n";
60  }
61  else
62  {
63  if (hasCaption)
64  {
65  t << "\n\\begin{DoxyImage}\n";
66  }
67  else
68  {
69  t << "\n\\begin{DoxyImageNoCaption}\n"
70  " \\mbox{";
71  }
72  }
73 
74  t << "\\includegraphics";
75  if (!width.isEmpty() || !height.isEmpty())
76  {
77  t << "[";
78  }
79  if (!width.isEmpty())
80  {
81  t << "width=" << width;
82  }
83  if (!width.isEmpty() && !height.isEmpty())
84  {
85  t << ",";
86  }
87  if (!height.isEmpty())
88  {
89  t << "height=" << height;
90  }
91  if (width.isEmpty() && height.isEmpty())
92  {
93  /* default setting */
94  if (inlineImage)
95  {
96  t << "[height=\\baselineskip,keepaspectratio=true]";
97  }
98  else
99  {
100  t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
101  }
102  }
103  else
104  {
105  t << "]";
106  }
107 
108  t << "{" << name << "}";
109 
110  if (hasCaption)
111  {
112  if (!inlineImage)
113  {
114  t << "\n\\doxyfigcaption{";
115  }
116  else
117  {
118  t << "%"; // to catch the caption
119  }
120  }
121 }

引用了 QCString::isEmpty().

被这些函数引用 LatexDocVisitor::startDiaFile(), LatexDocVisitor::startDotFile(), LatexDocVisitor::startMscFile(), LatexDocVisitor::visitPre(), LatexDocVisitor::writeDiaFile(), LatexDocVisitor::writeMscFile() , 以及 LatexDocVisitor::writePlantUMLFile().

◆ writeEndTableCommand()

static void writeEndTableCommand ( TextStream t,
const DocNode n 
)
static

在文件 latexdocvisitor.cpp1162 行定义.

1163 {
1164  if (tableIsNested(n))
1165  {
1166  t << "\\end{tabularx}}\n";
1167  }
1168  else
1169  {
1170  t << "\\end{longtabu}\n";
1171  }
1172  //return isNested ? "TabularNC" : "TabularC";
1173 }

引用了 tableIsNested().

被这些函数引用 LatexDocVisitor::visitPost().

◆ writeStartTableCommand()

static void writeStartTableCommand ( TextStream t,
const DocNode n,
int  cols 
)
static

在文件 latexdocvisitor.cpp1149 行定义.

1150 {
1151  if (tableIsNested(n))
1152  {
1153  t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1154  }
1155  else
1156  {
1157  t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1158  }
1159  //return isNested ? "TabularNC" : "TabularC";
1160 }

引用了 tableIsNested().

被这些函数引用 LatexDocVisitor::visitPre().

变量说明

◆ maxLevels

const int maxLevels =5

在文件 latexdocvisitor.cpp42 行定义.

被这些函数引用 getSectionName().

◆ secLabels

const char* secLabels[maxLevels]
static
初始值:
=
{ "doxysection","doxysubsection","doxysubsubsection","doxyparagraph","doxysubparagraph" }

在文件 latexdocvisitor.cpp43 行定义.

被这些函数引用 getSectionName().

HtmlAttribList
Class representing a list of HTML attributes.
Definition: htmlattrib.h:30
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocNode::Kind_HtmlDescList
@ Kind_HtmlDescList
Definition: docparser.h:118
classEqualsReflist
static bool classEqualsReflist(const DocNode *n)
Definition: latexdocvisitor.cpp:1055
DocHtmlDescList
Node representing a Html description list
Definition: docparser.h:987
secLabels
static const char * secLabels[maxLevels]
Definition: latexdocvisitor.cpp:43
DocNode::kind
virtual Kind kind() const =0
maxLevels
const int maxLevels
Definition: latexdocvisitor.cpp:42
DocNode::Kind_ParamSect
@ Kind_ParamSect
Definition: docparser.h:143
tableIsNested
static bool tableIsNested(const DocNode *n)
Definition: latexdocvisitor.cpp:1138
DocNode::Kind_HtmlTable
@ Kind_HtmlTable
Definition: docparser.h:121
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
Doxygen::insideMainPage
static bool insideMainPage
Definition: doxygen.h:84
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
FALSE
#define FALSE
Definition: qcstring.h:33