]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.h
whichFont down to 5.3%
[lyx.git] / src / BufferView_pimpl.h
index 5f43f3334ccc1a7a1ccfcd81acab8e86f7245dd4..09fb00d93551073932d23ef8514d1c452bcd43e3 100644 (file)
@@ -10,6 +10,7 @@
 #include "commandtags.h"
 #include "frontends/Timeout.h"
 #include "WorkArea.h"
+#include "box.h"
 #include "insets/insetspecialchar.h"
 #include "support/types.h"
 
@@ -23,8 +24,6 @@ class LyXScreen;
 
 ///
 struct BufferView::Pimpl : public SigC::Object {
-       /// position in a paragraph
-       typedef lyx::pos_type pos_type;
        ///
        Pimpl(BufferView * i, LyXView * o,
              int xpos, int ypos, int width, int height);
@@ -56,9 +55,12 @@ struct BufferView::Pimpl : public SigC::Object {
        void updateScrollbar();
        ///
        void scrollCB(double value);
-       ///
-       Inset * checkInsetHit(LyXText *, int & x, int & y,
-                             unsigned int button);
+       /**
+        * Returns an inset if inset was hit, or 0 if not.
+        *
+        * If hit, the coordinates are changed relative to the inset.
+        */
+       Inset * checkInsetHit(LyXText *, int & x, int & y);
        /// 
        int scrollUp(long time);
        ///
@@ -76,6 +78,10 @@ struct BufferView::Pimpl : public SigC::Object {
        ///
        void tripleClick(int x, int y, unsigned int button);
        ///
+       void selectionRequested();
+       ///
+       void selectionLost();
+       ///
        void enterView();
        ///
        void leaveView();
@@ -128,6 +134,17 @@ struct BufferView::Pimpl : public SigC::Object {
        ///
        bool Dispatch(kb_action action, string const & argument);
 private:
+       /**
+        * Return the on-screen dimensions of the inset at the cursor.
+        * Pre-condition: the cursor must be at an inset.
+        */
+       Box insetDimensions(LyXText const & text, LyXCursor const & cursor) const;
+       /**
+        * check if the given co-ordinates are inside an inset at the given cursor,
+        * if one exists. If so, the inset is returned, and the co-ordinates are
+        * made relative. Otherwise, 0 is returned.
+        */
+       Inset * checkInset(LyXText const & text, LyXCursor const & cursor, int & x, int & y) const; 
        ///
        friend class BufferView;
        /// open and lock an updatable inset
@@ -178,11 +195,11 @@ private:
                /// Cursor paragraph Id
                int par_id;
                /// Cursor position
-               pos_type par_pos;
+               lyx::pos_type par_pos;
                ///
                Position() : par_id(0), par_pos(0) {}
                ///
-               Position(string const & f, int id, pos_type pos)
+               Position(string const & f, int id, lyx::pos_type pos)
                        : filename(f), par_id(id), par_pos(pos) {}
        };
        ///