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
|
|
|
|
|
2015-07-18 23:22:10 +00:00
|
|
|
#include "Row.h"
|
2009-02-09 21:14:23 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2003-12-15 11:36:19 +00:00
|
|
|
class PainterInfo;
|
2007-08-28 08:57:13 +00:00
|
|
|
class Paragraph;
|
|
|
|
class Text;
|
|
|
|
class TextMetrics;
|
2003-02-26 17:04:10 +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,
|
2016-05-18 07:39:47 +00:00
|
|
|
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;
|
2016-05-17 13:00:09 +00:00
|
|
|
void paintLast() const;
|
2007-08-28 08:57:13 +00:00
|
|
|
void paintText();
|
2007-08-30 13:19:24 +00:00
|
|
|
void paintOnlyInsets();
|
2015-06-29 14:12:11 +00:00
|
|
|
void paintSelection() const;
|
2021-02-26 18:05:35 +00:00
|
|
|
void paintBookmark(int num) const;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
private:
|
2018-05-06 17:48:21 +00:00
|
|
|
void paintLanguageMarkings(Row::Element const & e) const;
|
2016-05-17 13:00:09 +00:00
|
|
|
void paintForeignMark(Row::Element const & e) const;
|
2018-05-06 17:48:21 +00:00
|
|
|
void paintNoSpellingMark(Row::Element const & e) const;
|
2016-05-17 13:00:09 +00:00
|
|
|
void paintStringAndSel(Row::Element const & e) const;
|
2018-09-20 09:31:23 +00:00
|
|
|
void paintTextDecoration(Row::Element const & e) const;
|
2016-05-17 13:00:09 +00:00
|
|
|
void paintMisspelledMark(Row::Element const & e) const;
|
|
|
|
void paintChange(Row::Element const & e) const;
|
2015-10-12 09:55:38 +00:00
|
|
|
void paintAppendixStart(int y) const;
|
2016-05-17 13:00:09 +00:00
|
|
|
void paintInset(Row::Element const & e) const;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
2018-01-16 13:04:05 +00:00
|
|
|
/// return the label font for this row (end label when \c end is true)
|
|
|
|
FontInfo labelFont(bool end) 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_;
|
2016-12-07 11:16:41 +00:00
|
|
|
TextMetrics const & tm_;
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
/// The row to paint
|
|
|
|
Row const & row_;
|
|
|
|
|
|
|
|
/// Row's paragraph
|
|
|
|
Paragraph const & par_;
|
|
|
|
|
|
|
|
// Looks ugly - is
|
|
|
|
double const xo_;
|
|
|
|
int const yo_; // current baseline
|
|
|
|
double x_;
|
|
|
|
};
|
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
|