]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtext.h
more cursor dispatch
[lyx.git] / src / lyxtext.h
index 880f9002c21314677a8cbb2936206e768de115fb..1555db6af0d4a22efba4311f4dcb194debd8c7ad 100644 (file)
@@ -48,12 +48,11 @@ class VSpace;
 /// This class encapsulates the main text data and operations in LyX
 class LyXText {
 public:
-       /// Constructor
+       /// constructor
        LyXText(BufferView *, bool ininset);
        ///
        void init(BufferView *);
 
-
        /// update y coordinate cache of all paragraphs
        void updateParPositions();
        ///
@@ -102,7 +101,6 @@ public:
                            ParagraphList::iterator end);
        /// rebreaks the given par
        void redoParagraph(ParagraphList::iterator pit);
-
        /// rebreaks the cursor par
        void redoParagraph();
 
@@ -112,11 +110,9 @@ public:
        ///
        std::string getStringToIndex();
 
-       /** insert a character, moves all the following breaks in the
-         same Paragraph one to the right and make a little rebreak
-         */
+       /// insert a character at cursor position
        void insertChar(char c);
-       ///
+       /// insert an inset at cursor position
        void insertInset(InsetBase * inset);
 
        /// a full rebreak of the whole text
@@ -128,13 +124,11 @@ public:
 
        /// try to handle that request
        DispatchResult dispatch(LCursor & cur, FuncRequest const & cmd);
-
+       /// access to out BufferView. This should go...
        BufferView * bv();
-
+       /// access to out BufferView. This should go...
        BufferView * bv() const;
 
-       friend class LyXScreen;
-
        /// returns an iterator pointing to a cursor paragraph
        ParagraphList::iterator getPar(CursorSlice const & cursor) const;
        ///
@@ -167,12 +161,9 @@ public:
        void getWord(CursorSlice & from, CursorSlice & to, lyx::word_location const);
        /// just selects the word the cursor is in
        void selectWord(lyx::word_location loc);
-       /// returns the inset at cursor (if it exists), 0 otherwise
-       InsetBase * getInset() const;
 
        /// accept selected change
        void acceptChange();
-
        /// reject selected change
        void rejectChange();
 
@@ -199,6 +190,8 @@ public:
        ///
        void setCursorFromCoordinates(CursorSlice &, int x, int y);
        ///
+       void edit(LCursor & cur, int x, int y);
+       ///
        void cursorUp(bool selecting = false);
        ///
        void cursorDown(bool selecting = false);
@@ -271,7 +264,6 @@ public:
         * characters to the right. No safety checks.
         */
        void setSelectionRange(lyx::pos_type length);
-
        /** simple replacing. The font of the first selected character
          is used
          */
@@ -323,20 +315,10 @@ public:
         * the cursor and when creating a visible row */
        void prepareToPrint(ParagraphList::iterator pit, Row & row) const;
 
-       //
-       // special owner functions
-       ///
+       /// access to our paragraphs
        ParagraphList & paragraphs() const;
-
        /// return true if this is owned by an inset.
        bool isInInset() const;
-
-       ///
-       ParagraphList::iterator firstPar() const;
-       ///
-       ParagraphList::iterator lastPar() const;
-       ///
-       ParagraphList::iterator endPar() const;
        
        /// return first row of text
        RowList::iterator firstRow() const;
@@ -392,22 +374,16 @@ public:
        ///
        int descent() const;
        ///
-       int cursorX() const;
-       ///
-       int cursorY() const;
-       ///
        int cursorX(CursorSlice const & cursor) const;
        ///
        int cursorY(CursorSlice const & cursor) const;
 
-       /// the topmost cursor slice
+       /// the current cursor slice
        CursorSlice & cursor();
-       /// the topmost cursor slice
+       /// the current cursor slice
        CursorSlice const & cursor() const;
-       /// access to the selection anchor
-       CursorSlice & anchor();
-       /// access to the selection anchor
-       CursorSlice const & anchor() const;
+
+       friend class LyXScreen;
 
 public:
        ///
@@ -475,16 +451,10 @@ private:
        /// sets row.end to the pos value *after* which a row should break.
        /// for example, the pos after which isNewLine(pos) == true
        void rowBreakPoint(ParagraphList::iterator pit, Row & row) const;
-
        /// sets row.witdh to the minimum space a row needs on the screen in pixel
        void fill(ParagraphList::iterator pit, Row & row, int workwidth) const;
-
-       /**
-        * returns the minimum space a manual label needs on the
-        * screen in pixels
-        */
+       /// the minimum space a manual label needs on the screen in pixels
        int labelFill(ParagraphList::iterator pit, Row const & row) const;
-
        /// FIXME
        int labelEnd(ParagraphList::iterator pit) const;
 
@@ -497,7 +467,7 @@ private:
 };
 
 /// return the default height of a row in pixels, considering font zoom
-extern int defaultRowHeight();
+int defaultRowHeight();
 
 ///
 std::string expandLabel(LyXTextClass const & textclass,