]> git.lyx.org Git - lyx.git/blobdiff - src/coordcache.h
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / coordcache.h
index adabc671bf50fa1a678017f8384965123b3a4d9d..3a70e6d78dbe7a653c1e2cf262912bf5ec42bd2e 100644 (file)
@@ -1,9 +1,12 @@
 #ifndef COORDCACHE_H
 #define COORDCACHE_H
 
-#include "mathed/math_data.h"
-#include "insets/insetbase.h"
-#include "lyxtext.h"
+class InsetBase;
+class LyXText;
+class MathArray;
+class Paragraph;
+
+#include "support/types.h"
 
 #include <boost/assert.hpp>
 
 // to the right, y increases downwords.
 
 void lyxbreaker(void const * data, const char * hint, int size);
+void lyxaborter(int x, int y);
 
-struct Point {
+class Point {
+public:
        Point()
                : x_(0), y_(0)
        {}
@@ -79,10 +84,8 @@ private:
 
        void check(T const * thing, char const * hint) const
        {
-               if (!has(thing)) {
+               if (!has(thing))
                        lyxbreaker(thing, hint, data_.size());
-                       BOOST_ASSERT(false);
-               }
        }
 
        typedef std::map<T const *, Point> cache_type;
@@ -93,9 +96,17 @@ private:
 class CoordCache {
 public:
        void clear();
+       Point get(LyXText const *, lyx::pit_type);
 
        CoordCacheBase<MathArray> arrays_;
+       
+       // all insets
        CoordCacheBase<InsetBase> insets_;
+
+       // paragraph grouped by owning text
+       typedef std::map<lyx::pit_type, Point> InnerParPosCache;
+       typedef std::map<LyXText const *, InnerParPosCache> ParPosCache;
+       ParPosCache pars_;
 };
 
 extern CoordCache theCoords;