]> git.lyx.org Git - lyx.git/blobdiff - src/coordcache.h
and this
[lyx.git] / src / coordcache.h
index ac89bd251e7bd8d06f1df2924653dd8750394be9..adabc671bf50fa1a678017f8384965123b3a4d9d 100644 (file)
@@ -9,12 +9,17 @@
 
 #include <map>
 
+
+// All positions cached in this cache are only valid between subsequent
+// updated. (x,y) == (0,0) is the upper left screen corner, x increases
+// to the right, y increases downwords.
+
 void lyxbreaker(void const * data, const char * hint, int size);
 
 struct Point {
        Point()
                : x_(0), y_(0)
-       {}      
+       {}
 
        Point(int x, int y) : x_(x), y_(y)
        {
@@ -22,7 +27,7 @@ struct Point {
                BOOST_ASSERT(x <  4000);
                BOOST_ASSERT(y > -3000);
                BOOST_ASSERT(y <  4000);
-       }       
+       }
 
        int x_, y_;
 };
@@ -63,6 +68,12 @@ public:
                return data_.find(thing) != data_.end();
        }
 
+//     T * find(int x, int y) const
+//     {
+//             T *
+//             cache_type iter
+//     }
+
 private:
        friend class CoordCache;
 
@@ -74,7 +85,8 @@ private:
                }
        }
 
-       std::map<T const *, Point> data_;
+       typedef std::map<T const *, Point> cache_type;
+       cache_type data_;
 };