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"
15 #include "BufferView.h"
19 #include "metricsinfo.h"
20 #include "paragraph.h"
21 #include "paragraph_funcs.h"
23 #include "frontends/font_metrics.h"
24 #include "frontends/Painter.h"
30 void InsetNewline::read(Buffer const &, LyXLex &)
36 void InsetNewline::write(Buffer const &, ostream & os) const
38 os << "\n\\newline\n";
42 void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
44 LyXFont & font = mi.base.font;
45 dim.asc = font_metrics::maxAscent(font);
46 dim.des = font_metrics::maxDescent(font);
47 dim.wid = font_metrics::width('n', font);
52 int InsetNewline::latex(Buffer const &, ostream &,
53 OutputParams const &) const
55 lyxerr << "Eek, calling InsetNewline::latex !" << endl;
60 int InsetNewline::plaintext(Buffer const &, ostream & os,
61 OutputParams const &) const
68 int InsetNewline::linuxdoc(Buffer const &, std::ostream & os,
69 OutputParams const &) const
76 int InsetNewline::docbook(Buffer const &, std::ostream & os,
77 OutputParams const &) const
84 void InsetNewline::draw(PainterInfo & pi, int x, int y) const
86 int const wid = font_metrics::width('n', pi.base.font);
87 int const asc = font_metrics::maxAscent(pi.base.font);
92 yp[0] = int(y - 0.875 * asc * 0.75);
93 yp[1] = int(y - 0.500 * asc * 0.75);
94 yp[2] = int(y - 0.125 * asc * 0.75);
97 xp[0] = int(x + wid * 0.375);
99 xp[2] = int(x + wid * 0.375);
101 xp[0] = int(x + wid * 0.625);
102 xp[1] = int(x + wid);
103 xp[2] = int(x + wid * 0.625);
106 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
108 yp[0] = int(y - 0.500 * asc * 0.75);
109 yp[1] = int(y - 0.500 * asc * 0.75);
110 yp[2] = int(y - asc * 0.75);
114 xp[1] = int(x + wid);
115 xp[2] = int(x + wid);
117 xp[0] = int(x + wid);
122 pi.pain.lines(xp, yp, 3, LColor::eolmarker);
126 bool InsetNewline::isSpace() const