X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fcoordcache.h;h=dba9b89fd4d283a2a27c7c31e9ecf2dac1a4c379;hb=52eb91c94fb70d58dceef430659c8781de2eccda;hp=1b87794afd46bc893ed45fea29c90875ac6ad791;hpb=e035d673ffd941c2c3332fbc3eb09c1d1daca531;p=lyx.git diff --git a/src/coordcache.h b/src/coordcache.h index 1b87794afd..dba9b89fd4 100644 --- a/src/coordcache.h +++ b/src/coordcache.h @@ -14,19 +14,17 @@ // It seems that MacOSX define the check macro. #undef check -class InsetBase; -class LyXText; -class MathArray; -class Paragraph; - #include "support/types.h" -#include - #include namespace lyx { +class InsetBase; +class LyXText; +class MathArray; +class Paragraph; + void lyxbreaker(void const * data, const char * hint, int size); class Point { @@ -35,14 +33,7 @@ public: : x_(0), y_(0) {} - Point(int x, int y) - : x_(x), y_(y) - { - BOOST_ASSERT(x > -1000000); - BOOST_ASSERT(x < 1000000); - BOOST_ASSERT(y > -1000000); - BOOST_ASSERT(y < 1000000); - } + Point(int x, int y); int x_, y_; }; @@ -54,6 +45,11 @@ public: data_.clear(); } + bool const empty() const + { + return data_.empty(); + } + void add(T const * thing, int x, int y) { data_[thing] = Point(x, y); @@ -99,6 +95,9 @@ private: typedef std::map cache_type; cache_type data_; + +public: + cache_type const & getData() const { return data_; } }; /** @@ -108,16 +107,16 @@ private: * updates. (x,y) == (0,0) is the upper left screen corner, x increases * to the right, y increases downwords. * The cache is built in BufferView::updateMetrics which is called - * from BufferView::Pimpl::update. The individual points are added + * from BufferView::update. The individual points are added * while we paint them. See for instance paintPar in RowPainter.C. */ class CoordCache { public: void clear(); - Point get(LyXText const *, lyx::pit_type); + Point get(LyXText const *, pit_type) const; /// A map from paragraph index number to screen point - typedef std::map InnerParPosCache; + typedef std::map InnerParPosCache; /// A map from a LyXText to the map of paragraphs to screen points typedef std::map ParPosCache; /// A map from a CursorSlice to screen points