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 bool 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');
50 bool const changed = dim_ != dim;
56 int InsetNewline::latex(Buffer const &, odocstream &,
57 OutputParams const &) const
59 lyxerr << "Eek, calling InsetNewline::latex !" << endl;
64 int InsetNewline::plaintext(Buffer const &, odocstream & os,
65 OutputParams const &) const
72 int InsetNewline::docbook(Buffer const &, odocstream & os,
73 OutputParams const &) const
80 void InsetNewline::draw(PainterInfo & pi, int x, int y) const
82 frontend::FontMetrics const & fm = theFontMetrics(pi.base.font);
83 int const wid = fm.width('n');
84 int const asc = fm.maxAscent();
89 yp[0] = int(y - 0.875 * asc * 0.75);
90 yp[1] = int(y - 0.500 * asc * 0.75);
91 yp[2] = int(y - 0.125 * asc * 0.75);
94 xp[0] = int(x + wid * 0.375);
96 xp[2] = int(x + wid * 0.375);
98 xp[0] = int(x + wid * 0.625);
100 xp[2] = int(x + wid * 0.625);
103 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
105 yp[0] = int(y - 0.500 * asc * 0.75);
106 yp[1] = int(y - 0.500 * asc * 0.75);
107 yp[2] = int(y - asc * 0.75);
111 xp[1] = int(x + wid);
112 xp[2] = int(x + wid);
114 xp[0] = int(x + wid);
119 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
123 bool InsetNewline::isSpace() const