3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "insetnewline.h"
18 #include "metricsinfo.h"
19 #include "paragraph.h"
20 #include "paragraph_funcs.h"
22 #include "frontends/FontMetrics.h"
23 #include "frontends/Painter.h"
32 void InsetNewline::read(Buffer const &, LyXLex &)
38 void InsetNewline::write(Buffer const &, ostream & os) const
40 os << "\n\\newline\n";
44 void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
46 frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
47 dim.asc = fm.maxAscent();
48 dim.des = fm.maxDescent();
49 dim.wid = fm.width('n');
54 int InsetNewline::latex(Buffer const &, odocstream &,
55 OutputParams const &) const
57 lyxerr << "Eek, calling InsetNewline::latex !" << endl;
62 int InsetNewline::plaintext(Buffer const &, odocstream & os,
63 OutputParams const &) const
70 int InsetNewline::docbook(Buffer const &, odocstream & os,
71 OutputParams const &) const
78 void InsetNewline::draw(PainterInfo & pi, int x, int y) const
80 frontend::FontMetrics const & fm = theFontMetrics(pi.base.font);
81 int const wid = fm.width('n');
82 int const asc = fm.maxAscent();
87 yp[0] = int(y - 0.875 * asc * 0.75);
88 yp[1] = int(y - 0.500 * asc * 0.75);
89 yp[2] = int(y - 0.125 * asc * 0.75);
92 xp[0] = int(x + wid * 0.375);
94 xp[2] = int(x + wid * 0.375);
96 xp[0] = int(x + wid * 0.625);
98 xp[2] = int(x + wid * 0.625);
101 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
103 yp[0] = int(y - 0.500 * asc * 0.75);
104 yp[1] = int(y - 0.500 * asc * 0.75);
105 yp[2] = int(y - asc * 0.75);
109 xp[1] = int(x + wid);
110 xp[2] = int(x + wid);
112 xp[0] = int(x + wid);
117 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
121 bool InsetNewline::isSpace() const