2003-04-09 21:34:31 +00:00
|
|
|
// -*- C++ -*-
|
2003-02-26 17:04:10 +00:00
|
|
|
/**
|
|
|
|
* \file rowpainter.h
|
|
|
|
* 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"
|
|
|
|
|
2004-04-07 20:20:15 +00:00
|
|
|
#include "support/types.h"
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2007-08-28 08:57:13 +00:00
|
|
|
class Bidi;
|
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 Row;
|
|
|
|
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,
|
|
|
|
pit_type pit, Row const & row, Bidi & bidi, int x, int y);
|
|
|
|
|
|
|
|
/// paint various parts
|
|
|
|
/// FIXME: transfer to TextMetrics
|
|
|
|
void paintAppendix();
|
|
|
|
void paintDepthBar();
|
|
|
|
void paintChangeBar();
|
|
|
|
void paintFirst();
|
|
|
|
void paintLast();
|
|
|
|
void paintText();
|
2007-08-30 13:19:24 +00:00
|
|
|
void paintOnlyInsets();
|
2010-11-25 13:16:30 +00:00
|
|
|
void paintSelection();
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
private:
|
2007-10-29 08:52:13 +00:00
|
|
|
void paintForeignMark(double orig_x, Language const * lang, int desc = 0);
|
2010-12-13 16:18:37 +00:00
|
|
|
void paintMisspelledMark(double orig_x, bool changed);
|
2007-10-28 18:51:54 +00:00
|
|
|
void paintHebrewComposeChar(pos_type & vpos, FontInfo const & font);
|
|
|
|
void paintArabicComposeChar(pos_type & vpos, FontInfo const & font);
|
|
|
|
void paintChars(pos_type & vpos, FontInfo const & font,
|
2007-08-28 08:57:13 +00:00
|
|
|
bool hebrew, bool arabic);
|
|
|
|
int paintAppendixStart(int y);
|
2010-10-04 18:18:37 +00:00
|
|
|
void paintFromPos(pos_type & vpos, bool changed);
|
2007-08-30 13:19:24 +00:00
|
|
|
void paintInset(Inset const * inset, pos_type const pos);
|
2008-02-22 15:26:52 +00:00
|
|
|
void paintInlineCompletion(Font const & font);
|
2010-12-13 16:18:37 +00:00
|
|
|
|
2007-08-28 08:57:13 +00:00
|
|
|
/// return left margin
|
|
|
|
int leftMargin() const;
|
|
|
|
|
|
|
|
/// 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
|
|
|
|
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_;
|
|
|
|
TextMetrics & text_metrics_;
|
|
|
|
ParagraphList const & pars_;
|
|
|
|
|
|
|
|
/// The row to paint
|
|
|
|
Row const & row_;
|
|
|
|
|
|
|
|
/// Row's paragraph
|
|
|
|
pit_type const pit_;
|
|
|
|
Paragraph const & par_;
|
|
|
|
ParagraphMetrics const & pm_;
|
|
|
|
|
|
|
|
/// bidi cache, comes from outside the rowpainter because
|
|
|
|
/// rowpainters are normally created in a for loop and there only
|
|
|
|
/// one of them is active at a time.
|
|
|
|
Bidi & bidi_;
|
|
|
|
|
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_;
|
2011-02-20 07:50:28 +00:00
|
|
|
float solid_line_thickness_;
|
|
|
|
int solid_line_offset_;
|
|
|
|
float dotted_line_thickness_;
|
|
|
|
int dotted_line_offset_;
|
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
|