mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-28 14:58:36 +00:00
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:
parent
56be946751
commit
54bdecdb48
@ -463,7 +463,6 @@ src_frontends_files = Split('''
|
|||||||
Toolbars.C
|
Toolbars.C
|
||||||
WorkArea.C
|
WorkArea.C
|
||||||
guiapi.C
|
guiapi.C
|
||||||
nullpainter.C
|
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,5 +45,4 @@ libfrontends_la_SOURCES = \
|
|||||||
guiapi.C \
|
guiapi.C \
|
||||||
key_state.h \
|
key_state.h \
|
||||||
mouse_state.h \
|
mouse_state.h \
|
||||||
nullpainter.C \
|
|
||||||
nullpainter.h
|
nullpainter.h
|
||||||
|
@ -68,11 +68,6 @@ public:
|
|||||||
/// end painting
|
/// end painting
|
||||||
////virtual void end() {}
|
////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
|
/// draw a line from point to point
|
||||||
virtual void line(
|
virtual void line(
|
||||||
int x1, int y1,
|
int x1, int y1,
|
||||||
|
@ -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
|
|
@ -31,11 +31,6 @@ public:
|
|||||||
/// end painting
|
/// end painting
|
||||||
void end() {}
|
void end() {}
|
||||||
|
|
||||||
///
|
|
||||||
int paperWidth() const { return 0; }
|
|
||||||
///
|
|
||||||
int paperHeight() const;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
void line(int, int, int, int, LColor_color,
|
void line(int, int, int, int, LColor_color,
|
||||||
line_style = line_solid, line_width = line_thin) {}
|
line_style = line_solid, line_width = line_thin) {}
|
||||||
|
@ -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,
|
void QLPainter::setQPainterPen(LColor_color col,
|
||||||
Painter::line_style ls, Painter::line_width lw)
|
Painter::line_style ls, Painter::line_width lw)
|
||||||
{
|
{
|
||||||
|
@ -32,11 +32,6 @@ class GuiWorkArea;
|
|||||||
*/
|
*/
|
||||||
class QLPainter : public QPainter, public Painter {
|
class QLPainter : public QPainter, public Painter {
|
||||||
public:
|
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
|
/// draw a line from point to point
|
||||||
virtual void line(
|
virtual void line(
|
||||||
int x1, int y1,
|
int x1, int y1,
|
||||||
|
@ -278,7 +278,8 @@ void MathArray::metrics(MetricsInfo & mi) const
|
|||||||
void MathArray::draw(PainterInfo & pi, int x, int y) const
|
void MathArray::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
|
//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()) {
|
if (empty()) {
|
||||||
pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
|
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
|
// don't draw outside the workarea
|
||||||
if (y + descent() <= 0
|
if (y + descent() <= 0
|
||||||
|| y - ascent() >= pi.pain.paperHeight()
|
|| y - ascent() >= bv.workHeight()
|
||||||
|| x + width() <= 0
|
|| x + width() <= 0
|
||||||
|| x >= pi.pain.paperWidth())
|
|| x >= bv. workWidth())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//BufferView & bv = *pi.base.bv;
|
|
||||||
for (size_t i = 0, n = size(); i != n; ++i) {
|
for (size_t i = 0, n = size(); i != n; ++i) {
|
||||||
MathAtom const & at = operator[](i);
|
MathAtom const & at = operator[](i);
|
||||||
#if 0
|
#if 0
|
||||||
Buffer const & buf = *bv.buffer();
|
Buffer const & buf = bv.buffer();
|
||||||
// special macro handling
|
// special macro handling
|
||||||
MathMacro const * mac = at->asMacro();
|
MathMacro const * mac = at->asMacro();
|
||||||
if (mac && buf.hasMacro(mac->name())) {
|
if (mac && buf.hasMacro(mac->name())) {
|
||||||
@ -312,8 +312,7 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//BufferView & bv = *pi.base.bv;
|
bv.coordCache().insets().add(at.nucleus(), x, y);
|
||||||
pi.base.bv->coordCache().insets().add(at.nucleus(), x, y);
|
|
||||||
at->drawSelection(pi, x, y);
|
at->drawSelection(pi, x, y);
|
||||||
at->draw(pi, x, y);
|
at->draw(pi, x, y);
|
||||||
x += at->width();
|
x += at->width();
|
||||||
|
Loading…
Reference in New Issue
Block a user