remove paperHeight() and paperWidth() in Painter and inherited classes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15589 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-10-28 09:36:22 +00:00
parent 56be946751
commit 54bdecdb48
8 changed files with 6 additions and 66 deletions

View File

@ -463,7 +463,6 @@ src_frontends_files = Split('''
Toolbars.C
WorkArea.C
guiapi.C
nullpainter.C
''')

View File

@ -45,5 +45,4 @@ libfrontends_la_SOURCES = \
guiapi.C \
key_state.h \
mouse_state.h \
nullpainter.C \
nullpainter.h

View File

@ -68,11 +68,6 @@ public:
/// end painting
////virtual void end() {}
/// return the width of the work area in pixels
virtual int paperWidth() const = 0;
/// return the height of the work area in pixels
virtual int paperHeight() const = 0;
/// draw a line from point to point
virtual void line(
int x1, int y1,

View File

@ -1,30 +0,0 @@
/**
* \file nullpainter.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Alfredo Braunstein
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "nullpainter.h"
#include "LColor.h"
#include <limits>
namespace lyx {
namespace frontend {
int NullPainter::paperHeight() const
{
return std::numeric_limits<int>::max();
}
} // namespace frontend
} // namespace lyx

View File

@ -31,11 +31,6 @@ public:
/// end painting
void end() {}
///
int paperWidth() const { return 0; }
///
int paperHeight() const;
///
void line(int, int, int, int, LColor_color,
line_style = line_solid, line_width = line_thin) {}

View File

@ -52,18 +52,6 @@ QLPainter::~QLPainter()
}
int QLPainter::paperWidth() const
{
return qwa_->width();
}
int QLPainter::paperHeight() const
{
return qwa_->height();
}
void QLPainter::setQPainterPen(LColor_color col,
Painter::line_style ls, Painter::line_width lw)
{

View File

@ -32,11 +32,6 @@ class GuiWorkArea;
*/
class QLPainter : public QPainter, public Painter {
public:
/// return the width of the work area in pixels
virtual int paperWidth() const;
/// return the height of the work area in pixels
virtual int paperHeight() const;
/// draw a line from point to point
virtual void line(
int x1, int y1,

View File

@ -278,7 +278,8 @@ void MathArray::metrics(MetricsInfo & mi) const
void MathArray::draw(PainterInfo & pi, int x, int y) const
{
//lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
setXY(*pi.base.bv, x, y);
BufferView & bv = *pi.base.bv;
setXY(bv, x, y);
if (empty()) {
pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
@ -287,16 +288,15 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
// don't draw outside the workarea
if (y + descent() <= 0
|| y - ascent() >= pi.pain.paperHeight()
|| y - ascent() >= bv.workHeight()
|| x + width() <= 0
|| x >= pi.pain.paperWidth())
|| x >= bv. workWidth())
return;
//BufferView & bv = *pi.base.bv;
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom const & at = operator[](i);
#if 0
Buffer const & buf = *bv.buffer();
Buffer const & buf = bv.buffer();
// special macro handling
MathMacro const * mac = at->asMacro();
if (mac && buf.hasMacro(mac->name())) {
@ -312,8 +312,7 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
}
}
#endif
//BufferView & bv = *pi.base.bv;
pi.base.bv->coordCache().insets().add(at.nucleus(), x, y);
bv.coordCache().insets().add(at.nucleus(), x, y);
at->drawSelection(pi, x, y);
at->draw(pi, x, y);
x += at->width();