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
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ROWPAINTER_H
|
|
|
|
#define ROWPAINTER_H
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2003-04-01 10:10:28 +00:00
|
|
|
#include "RowList.h"
|
2003-02-26 17:04:10 +00:00
|
|
|
#include "LString.h"
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
|
|
class LyXText;
|
|
|
|
class BufferView;
|
|
|
|
class Paragraph;
|
|
|
|
class Painter;
|
|
|
|
class LyXFont;
|
|
|
|
class VSpace;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A class used for painting an individual row of text.
|
|
|
|
*/
|
|
|
|
class RowPainter {
|
|
|
|
public:
|
|
|
|
/// initialise painter
|
2003-04-01 10:10:28 +00:00
|
|
|
RowPainter(BufferView const & bv, LyXText const & text, RowList::iterator rit);
|
2003-02-26 17:04:10 +00:00
|
|
|
|
2003-03-22 17:26:03 +00:00
|
|
|
/// paint the row.
|
|
|
|
void paint(int y_offset, int x_offset, int y);
|
2003-02-26 17:04:10 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// paint various parts
|
2003-03-17 01:34:36 +00:00
|
|
|
void paintBackground();
|
2003-02-26 17:04:10 +00:00
|
|
|
void paintSelection();
|
|
|
|
void paintAppendix();
|
|
|
|
void paintDepthBar();
|
|
|
|
void paintChangeBar();
|
|
|
|
void paintFirst();
|
|
|
|
void paintLast();
|
|
|
|
void paintForeignMark(float const orig_x, LyXFont const & orig_font);
|
|
|
|
void paintHebrewComposeChar(lyx::pos_type & vpos);
|
|
|
|
void paintArabicComposeChar(lyx::pos_type & vpos);
|
|
|
|
void paintChars(lyx::pos_type & vpos, bool hebrew, bool arabic);
|
|
|
|
int paintPageBreak(string const & label, int y);
|
2003-03-13 19:55:39 +00:00
|
|
|
int paintAppendixStart(int y);
|
2003-02-26 17:04:10 +00:00
|
|
|
int paintLengthMarker(string const & prefix, VSpace const & vsp, int start);
|
2003-03-22 17:26:03 +00:00
|
|
|
void paintText();
|
|
|
|
void paintFromPos(lyx::pos_type & vpos);
|
|
|
|
void paintInset(lyx::pos_type const pos);
|
2003-02-26 17:04:10 +00:00
|
|
|
|
|
|
|
/// return left margin
|
|
|
|
int leftMargin() const;
|
|
|
|
|
|
|
|
/// return the font at the given pos
|
|
|
|
LyXFont const getFont(lyx::pos_type pos) const;
|
|
|
|
|
|
|
|
/// return the label font for this row
|
|
|
|
LyXFont const getLabelFont() const;
|
|
|
|
|
|
|
|
char const transformChar(char c, lyx::pos_type pos) const;
|
|
|
|
|
|
|
|
/// return pixel width for the given pos
|
|
|
|
int singleWidth(lyx::pos_type pos) const;
|
|
|
|
int singleWidth(lyx::pos_type pos, char c) const;
|
|
|
|
|
|
|
|
/// bufferview to paint on
|
|
|
|
BufferView const & bv_;
|
|
|
|
|
|
|
|
/// Painter to use
|
|
|
|
Painter & pain_;
|
|
|
|
|
|
|
|
/// LyXText for the row
|
|
|
|
LyXText const & text_;
|
|
|
|
|
|
|
|
/// The row to paint
|
2003-04-01 10:10:28 +00:00
|
|
|
RowList::iterator row_;
|
2003-02-26 17:04:10 +00:00
|
|
|
|
|
|
|
/// Row's paragraph
|
|
|
|
Paragraph const & par_;
|
|
|
|
|
|
|
|
// Looks ugly - is
|
|
|
|
int xo_;
|
|
|
|
int yo_;
|
|
|
|
float x_;
|
|
|
|
int y_;
|
|
|
|
int width_;
|
|
|
|
float separator_;
|
|
|
|
float hfill_;
|
|
|
|
float label_hfill_;
|
|
|
|
};
|
|
|
|
|
|
|
|
/// return the pixel height of a space marker before/after a par
|
|
|
|
int getLengthMarkerHeight(BufferView const & bv, VSpace const & vsp);
|
|
|
|
|
|
|
|
#endif // ROWPAINTER_H
|