2003-04-09 21:34:31 +00:00
|
|
|
// -*- C++ -*-
|
2003-02-26 17:04:10 +00:00
|
|
|
/**
|
2014-07-25 19:55:08 +00:00
|
|
|
* \file RowPainter.h
|
2003-02-26 17:04:10 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author various
|
|
|
|
* \author John Levon
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-02-26 17:04:10 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-02-26 17:04:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ROWPAINTER_H
|
|
|
|
#define ROWPAINTER_H
|
|
|
|
|
2009-02-09 21:14:23 +00:00
|
|
|
#include "Changes.h"
|
2015-07-18 23:22:10 +00:00
|
|
|
#include "Row.h"
|
2009-02-09 21:14:23 +00:00
|
|
|
|
2004-04-07 20:20:15 +00:00
|
|
|
#include "support/types.h"
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2003-02-26 17:04:10 +00:00
|
|
|
class BufferView;
|
2007-08-28 08:57:13 +00:00
|
|
|
class Font;
|
2007-10-28 18:51:54 +00:00
|
|
|
class FontInfo;
|
2007-08-30 13:19:24 +00:00
|
|
|
class Inset;
|
2007-10-29 08:52:13 +00:00
|
|
|
class Language;
|
2003-12-15 11:36:19 +00:00
|
|
|
class PainterInfo;
|
2007-08-28 08:57:13 +00:00
|
|
|
class Paragraph;
|
|
|
|
class ParagraphList;
|
|
|
|
class ParagraphMetrics;
|
|
|
|
class Text;
|
|
|
|
class TextMetrics;
|
2003-02-26 17:04:10 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace frontend { class Painter; }
|
2003-08-19 16:46:47 +00:00
|
|
|
|
2007-08-28 08:57:13 +00:00
|
|
|
/**
|
|
|
|
* A class used for painting an individual row of text.
|
|
|
|
* FIXME: get rid of that class.
|
|
|
|
*/
|
|
|
|
class RowPainter {
|
|
|
|
public:
|
|
|
|
/// initialise and run painter
|
|
|
|
RowPainter(PainterInfo & pi, Text const & text,
|
2013-10-11 14:12:20 +00:00
|
|
|
pit_type pit, Row const & row, int x, int y);
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
/// paint various parts
|
|
|
|
/// FIXME: transfer to TextMetrics
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintAppendix() const;
|
|
|
|
void paintDepthBar() const;
|
|
|
|
void paintChangeBar() const;
|
|
|
|
void paintTooLargeMarks(bool const left, bool const right) const;
|
|
|
|
void paintFirst() const;
|
2007-08-28 08:57:13 +00:00
|
|
|
void paintLast();
|
|
|
|
void paintText();
|
2007-08-30 13:19:24 +00:00
|
|
|
void paintOnlyInsets();
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintSelection() const;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
private:
|
2015-07-16 21:10:44 +00:00
|
|
|
void paintSeparator(double width, Font const & font);
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintForeignMark(double orig_x, Language const * lang, int desc = 0) const;
|
2015-07-18 23:22:10 +00:00
|
|
|
void paintStringAndSel(Row::Element const & e);
|
|
|
|
void paintMisspelledMark(double orig_x, Row::Element const & e) const;
|
2015-07-16 21:18:55 +00:00
|
|
|
void paintChange(double orig_x , Font const & font, Change const & change) const;
|
2015-10-12 09:55:38 +00:00
|
|
|
void paintAppendixStart(int y) const;
|
2015-07-16 21:34:33 +00:00
|
|
|
void paintInset(Inset const * inset, Font const & font,
|
|
|
|
Change const & change, pos_type const pos);
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
/// return the label font for this row
|
2008-02-27 23:03:26 +00:00
|
|
|
FontInfo labelFont() const;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
2011-10-30 09:16:30 +00:00
|
|
|
///
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintLabel() const;
|
2011-10-30 09:16:30 +00:00
|
|
|
///
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintTopLevelLabel() const;
|
2011-10-30 09:16:30 +00:00
|
|
|
|
|
|
|
|
2007-08-30 13:53:02 +00:00
|
|
|
/// contains painting related information.
|
|
|
|
PainterInfo & pi_;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
/// Text for the row
|
|
|
|
Text const & text_;
|
2015-06-29 14:12:11 +00:00
|
|
|
TextMetrics const & text_metrics_;
|
2007-08-28 08:57:13 +00:00
|
|
|
ParagraphList const & pars_;
|
|
|
|
|
|
|
|
/// The row to paint
|
|
|
|
Row const & row_;
|
|
|
|
|
|
|
|
/// Row's paragraph
|
|
|
|
pit_type const pit_;
|
|
|
|
Paragraph const & par_;
|
|
|
|
ParagraphMetrics const & pm_;
|
|
|
|
|
2009-02-09 21:14:23 +00:00
|
|
|
/// row changed? (change tracking)
|
|
|
|
Change const change_;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
// Looks ugly - is
|
|
|
|
double const xo_;
|
|
|
|
int const yo_; // current baseline
|
|
|
|
double x_;
|
|
|
|
int width_;
|
2015-07-14 15:42:45 +00:00
|
|
|
int solid_line_thickness_;
|
2011-02-20 07:50:28 +00:00
|
|
|
int solid_line_offset_;
|
2015-07-14 15:42:45 +00:00
|
|
|
int dotted_line_thickness_;
|
2007-08-28 08:57:13 +00:00
|
|
|
};
|
2003-08-19 16:46:47 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
2004-08-14 15:55:22 +00:00
|
|
|
|
2003-02-26 17:04:10 +00:00
|
|
|
#endif // ROWPAINTER_H
|