浏览该文件的文档.
51 #define RTF_LatexToc(lvl,nest,nxt,pos,twps) \
54 "\\s"#nest"\\li"#pos"\\sa"#twps"\\sb"#twps"\\widctlpar\\tqr\\tldot\\tx8640\\adjustright \\fs20\\cgrid ",\
55 "\\sbasedon0 \\snext"#nxt" LatexTOC "#lvl \
58 #define RTF_ListBullet(lvl,nest,nxt,pos,lvl2) \
60 "\\s"#nest"\\fi-360\\li"#pos"\\widctlpar\\jclisttab\\tx"#pos"{\\*\\pn \\pnlvlbody\\ilvl0\\ls"#lvl2"\\pnrnot0\\pndec }\\ls1\\adjustright \\fs20\\cgrid ", \
61 "\\sbasedon0 \\snext"#nxt" \\sautoupd List Bullet "#lvl \
64 #define RTF_ListEnum(lvl,nest,nxt,pos) \
66 "\\s"#nest"\\fi-360\\li"#pos"\\widctlpar\\fs20\\cgrid ", \
67 "\\sbasedon0 \\snext"#nxt" \\sautoupd List Enum "#lvl \
70 #define RTF_CodeExample(lvl,nest,nxt,pos) \
71 { "CodeExample"#lvl, \
72 "\\s"#nest"\\li"#pos"\\widctlpar\\adjustright \\shading1000\\cbpat8 \\f2\\fs16\\cgrid ", \
73 "\\sbasedon0 \\snext"#nxt" Code Example "#lvl \
76 #define RTF_ListContinue(lvl,nest,nxt,pos) \
77 { "ListContinue"#lvl, \
78 "\\s"#nest"\\li"#pos"\\sa60\\sb30\\qj\\widctlpar\\qj\\adjustright \\fs20\\cgrid ", \
79 "\\sbasedon0 \\snext"#nxt" List Continue "#lvl \
82 #define RTF_DescContinue(lvl,nest,nxt,pos) \
83 { "DescContinue"#lvl, \
84 "\\s"#nest"\\li"#pos"\\widctlpar\\ql\\adjustright \\fs20\\cgrid ", \
85 "\\sbasedon0 \\snext"#nxt" DescContinue "#lvl \
91 "\\s1\\sb240\\sa60\\keepn\\widctlpar\\adjustright \\b\\f1\\fs36\\kerning36\\cgrid ",
92 "\\sbasedon0 \\snext0 heading 1"
95 "\\s2\\sb240\\sa60\\keepn\\widctlpar\\adjustright \\b\\f1\\fs28\\kerning28\\cgrid ",
96 "\\sbasedon0 \\snext0 heading 2"
99 "\\s3\\sb240\\sa60\\keepn\\widctlpar\\adjustright \\b\\f1\\cgrid ",
100 "\\sbasedon0 \\snext0 heading 3"
103 "\\s4\\sb240\\sa60\\keepn\\widctlpar\\adjustright \\b\\f1\\fs20\\cgrid ",
104 "\\sbasedon0 \\snext0 heading 4;}{\\*\\cs10 \\additive Default Paragraph Font"
107 "\\s5\\sb90\\sa30\\keepn\\widctlpar\\adjustright \\b\\f1\\fs20\\cgrid ",
108 "\\sbasedon0 \\snext0 heading 5;}{\\*\\cs10 \\additive Default Paragraph Font"
111 "\\s15\\qc\\sb240\\sa60\\widctlpar\\outlinelevel0\\adjustright \\b\\f1\\fs32\\kerning28\\cgrid ",
112 "\\sbasedon0 \\snext15 Title"
115 "\\s16\\qc\\sa60\\widctlpar\\outlinelevel1\\adjustright \\f1\\cgrid ",
116 "\\sbasedon0 \\snext16 Subtitle"
119 "\\s17\\sa60\\sb30\\widctlpar\\qj \\fs22\\cgrid ",
120 "\\sbasedon0 \\snext17 BodyText"
123 "\\s18\\widctlpar\\fs22\\cgrid ",
124 "\\sbasedon0 \\snext18 DenseText"
127 "\\s28\\widctlpar\\tqc\\tx4320\\tqr\\tx8640\\adjustright \\fs20\\cgrid ",
128 "\\sbasedon0 \\snext28 header"
131 "\\s29\\widctlpar\\tqc\\tx4320\\tqr\\tx8640\\qr\\adjustright \\fs20\\cgrid ",
132 "\\sbasedon0 \\snext29 footer"
135 "\\s30\\li360\\sa60\\sb120\\keepn\\widctlpar\\adjustright \\b\\f1\\fs20\\cgrid ",
136 "\\sbasedon0 \\snext30 GroupHeader"
257 err(
"Style sheet '%s' contains no '\\s' clause.\n{%s}", styleName.c_str(), command.c_str());
262 size_t index = command.find(
"\\sbasedon");
263 if (
index!=std::string::npos)
275 std::ifstream file(name.
str());
278 err(
"Can't open RTF style sheet file %s. Using defaults.",
qPrint(name));
281 msg(
"Loading RTF style sheet %s...\n",
qPrint(name));
285 for (std::string line ; getline(file,line) ; )
287 if (line.empty() || line[0]==
'#')
continue;
288 static const reg::Ex assignment_splitter(R
"(\s*=\s*)");
292 std::string key =
match.prefix().str();
293 std::string value =
match.suffix().str();
294 auto it = map.find(key);
302 warn(name,lineNr,
"Unknown style sheet name %s ignored.",key.
data());
307 warn(name,lineNr,
"Assignment of style sheet name expected line='%s'!",line.c_str());
317 std::ifstream file(name.
str());
320 err(
"Can't open RTF extensions file %s. Using defaults.",
qPrint(name));
323 msg(
"Loading RTF extensions %s...\n",
qPrint(name));
327 for (std::string line ; getline(file,line) ; )
329 if (line.empty() || line[0]==
'#')
continue;
330 static const reg::Ex assignment_splitter(R
"(\s*=\s*)");
334 std::string key =
match.prefix().str();
335 std::string value =
match.suffix().str();
343 warn(name,lineNr,
"Ignoring unknown extension key '%s'...",key.c_str());
348 warn(name,lineNr,
"Assignment of style sheet name expected!");
#define RTF_ListEnum(lvl, nest, nxt, pos)
#define RTF_LatexToc(lvl, nest, nxt, pos, twps)
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
#define RTF_ListContinue(lvl, nest, nxt, pos)
#define RTF_DescContinue(lvl, nest, nxt, pos)
void err(const char *fmt,...)
void warn(const QCString &file, int line, const char *fmt,...)
const char * definition() const
static const reg::Ex s_clause(R"(\\s(\d+)\s*)")
static std::map< std::string, QCString & > g_styleMap
std::map< std::string, StyleData > StyleDataMap
void loadExtensions(const QCString &name)
void loadStylesheet(const QCString &name, StyleDataMap &map)
QCString rtf_documentType
Object representing the matching results.
bool setStyle(const std::string &command, const std::string &styleName)
QCString rtf_logoFilename
Class representing a regular expression.
void msg(const char *fmt,...)
const char * qPrint(const char *s)
Rtf_Style_Default rtf_Style_Default[]
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
#define RTF_ListBullet(lvl, nest, nxt, pos, lvl2)
#define RTF_CodeExample(lvl, nest, nxt, pos)
bool search(const std::string &str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
const char * reference() const
This is an alternative implementation of QCString.