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
|
2004-11-30 01:59:49 +00:00
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>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
|
|
|
|
|
|
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;
|
2004-11-30 01:59:49 +00:00
|
|
|
|
class ViewMetricsInfo;
|
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();
|
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);
|
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);
|
|
|
|
|
void paintFromPos(pos_type & vpos);
|
2007-08-30 13:19:24 +00:00
|
|
|
|
void paintInset(Inset const * inset, pos_type const pos);
|
|
|
|
|
void paintHfill(pos_type const pos, pos_type const body_pos);
|
2007-08-28 08:57:13 +00:00
|
|
|
|
|
|
|
|
|
/// return left margin
|
|
|
|
|
int leftMargin() const;
|
|
|
|
|
|
|
|
|
|
/// return the label font for this row
|
2007-10-28 18:51:54 +00:00
|
|
|
|
FontInfo const getLabelFont() 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_;
|
|
|
|
|
|
|
|
|
|
/// is row erased? (change tracking)
|
|
|
|
|
bool erased_;
|
|
|
|
|
|
|
|
|
|
// Looks ugly - is
|
|
|
|
|
double const xo_;
|
|
|
|
|
int const yo_; // current baseline
|
|
|
|
|
double x_;
|
|
|
|
|
int width_;
|
|
|
|
|
};
|
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
|