* BufferView, BufferView::pimpl:
- metrics_info_: private variable holding ViewMetricsInfo
- viewMetricsInfo(): accessor function
- updateMetrics(): renamed from metrics(), sets metrics_info_
- update(): change to use updateMetrics()
* frontends/WorkArea:
- redraw(): get the ViewMetricsInfo through accessor to BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14331
a592a061-630c-0410-9148-
cb99ea01b6c8
#include "texrow.h"
#include "undo.h"
#include "WordLangTuple.h"
#include "texrow.h"
#include "undo.h"
#include "WordLangTuple.h"
+#include "metricsinfo.h"
#include "frontends/Alert.h"
#include "frontends/Clipboard.h"
#include "frontends/Alert.h"
#include "frontends/Clipboard.h"
{
return pimpl_->offset_ref_;
}
{
return pimpl_->offset_ref_;
}
+
+
+ViewMetricsInfo const & BufferView::viewMetricsInfo()
+{
+ return pimpl_->viewMetricsInfo();
+}
class LyXText;
class LyXView;
class ParIterator;
class LyXText;
class LyXView;
class ParIterator;
namespace Update {
enum flags {
namespace Update {
enum flags {
void putSelectionAt(DocIterator const & cur,
int length, bool backwards);
void putSelectionAt(DocIterator const & cur,
int length, bool backwards);
+ ///
+ ViewMetricsInfo const & viewMetricsInfo();
private:
///
class Pimpl;
private:
///
class Pimpl;
+ViewMetricsInfo const & BufferView::Pimpl::viewMetricsInfo()
+{
+ return metrics_info_;
+}
+
+
void BufferView::Pimpl::update(Update::flags flags)
{
lyxerr[Debug::DEBUG]
void BufferView::Pimpl::update(Update::flags flags)
{
lyxerr[Debug::DEBUG]
theCoords.startUpdating();
// First drawing step
theCoords.startUpdating();
// First drawing step
- ViewMetricsInfo vi = metrics(flags & Update::SinglePar);
+ updateMetrics(flags & Update::SinglePar);
bool forceupdate(flags & (Update::Force | Update::SinglePar));
if ((flags & Update::FitCursor) && fitCursor()) {
forceupdate = true;
bool forceupdate(flags & (Update::Force | Update::SinglePar));
if ((flags & Update::FitCursor) && fitCursor()) {
forceupdate = true;
}
if ((flags & Update::MultiParSel) && multiParSel()) {
forceupdate = true;
}
if ((flags & Update::MultiParSel) && multiParSel()) {
forceupdate = true;
}
if (forceupdate) {
// Second drawing step
}
if (forceupdate) {
// Second drawing step
- owner_->workArea()->redraw(*bv_, vi);
+ owner_->workArea()->redraw(*bv_);
} else {
// Abort updating of the coord
// cache - just restore the old one
} else {
// Abort updating of the coord
// cache - just restore the old one
-ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
+void BufferView::Pimpl::updateMetrics(bool singlepar)
{
// Remove old position cache
theCoords.clear();
{
// Remove old position cache
theCoords.clear();
<< "size: " << size
<< endl;
<< "size: " << size
<< endl;
- return ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
+ metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
#include "BufferView.h"
#include "cursor.h"
#include "errorlist.h"
#include "BufferView.h"
#include "cursor.h"
#include "errorlist.h"
+#include "metricsinfo.h"
#include "frontends/LyXKeySym.h"
#include "frontends/Timeout.h"
#include "frontends/LyXKeySym.h"
#include "frontends/Timeout.h"
+ ///
+ ViewMetricsInfo const & viewMetricsInfo();
///
friend class BufferView;
///
friend class BufferView;
+ ///
+ ViewMetricsInfo metrics_info_;
+ ///
+ void updateMetrics(bool singlepar = false);
+
///
BufferView * bv_;
///
///
BufferView * bv_;
///
lyx::pit_type anchor_ref_;
///
int offset_ref_;
lyx::pit_type anchor_ref_;
///
int offset_ref_;
- ///
- ViewMetricsInfo metrics(bool singlepar = false);
};
#endif // BUFFERVIEW_PIMPL_H
};
#endif // BUFFERVIEW_PIMPL_H
-void WorkArea::redraw(BufferView & bv, ViewMetricsInfo const & vi)
+void WorkArea::redraw(BufferView & bv)
+ ViewMetricsInfo const & vi = bv.viewMetricsInfo();
getPainter().start();
paintText(*buffer_view_, vi);
lyxerr[Debug::DEBUG] << "Redraw screen" << endl;
getPainter().start();
paintText(*buffer_view_, vi);
lyxerr[Debug::DEBUG] << "Redraw screen" << endl;
#include "frontends/LyXKeySym.h"
class BufferView;
#include "frontends/LyXKeySym.h"
class BufferView;
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
/// redraw the screen, without using existing pixmap
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
/// redraw the screen, without using existing pixmap
- virtual void redraw(BufferView & bv, ViewMetricsInfo const & vi);
+ virtual void redraw(BufferView & bv);
/// grey out (no buffer)
void greyOut();
/// grey out (no buffer)
void greyOut();
class ViewMetricsInfo
{
public:
class ViewMetricsInfo
{
public:
+ ViewMetricsInfo()
+ : p1(0), p2(0), y1(0), y2(0),
+ singlepar(false), size(0) {}
ViewMetricsInfo(lyx::pit_type p1, lyx::pit_type p2, int y1, int y2,
ViewMetricsInfo(lyx::pit_type p1, lyx::pit_type p2, int y1, int y2,
- bool singlepar, lyx::pit_type size) : p1(p1), p2(p2),
- y1(y1), y2(y2), singlepar(singlepar), size(size) {}
+ bool singlepar, lyx::pit_type size)
+ : p1(p1), p2(p2), y1(y1), y2(y2),
+ singlepar(singlepar), size(size) {}
lyx::pit_type p1;
lyx::pit_type p2;
int y1;
lyx::pit_type p1;
lyx::pit_type p2;
int y1;