]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtext.h
Small fix.
[lyx.git] / src / lyxtext.h
index 8de309592cee36c7b4d7be789a0733a6ed9af1e2..1a0d5c4cfaf785c6829b047b3bd2575489a5fa4d 100644 (file)
 #include "lyxcursor.h"
 #include "lyxparagraph.h"
 #include "layout.h"
-#include "insets/insettext.h"
 
 class Buffer;
 class BufferParams;
 class Row;
 class BufferView;
+class InsetText;
 
 
 /**
@@ -41,14 +41,9 @@ public:
                ///
                NEED_MORE_REFRESH,
                ///
-               NEED_VERY_LITTLE_REFRESH
-       };
-
-       enum Letter_Form {
-               FORM_ISOLATED,
-               FORM_INITIAL,
-               FORM_MEDIAL,
-               FORM_FINAL
+               NEED_VERY_LITTLE_REFRESH,
+               ///
+               CHANGED_IN_DRAW
        };
 
        /// Constructor
@@ -63,15 +58,18 @@ public:
        mutable int number_of_rows;
        ///
        mutable long height;
-       mutable long width;
+       mutable unsigned int width;
        /// the current font settings
        mutable LyXFont current_font;
        /// the current font
        mutable LyXFont real_current_font;
-
+       /// first visible pixel-row is set from LyXScreen!!!
+       unsigned long first;
        ///
-       //      void owner(BufferView *);
-       
+       BufferView * bv_owner;
+       ///
+       InsetText * inset_owner;
+
        ///
        LyXFont GetFont(Buffer const *, LyXParagraph * par,
                        LyXParagraph::size_type pos) const;
@@ -151,8 +149,10 @@ public:
            Returns true if something was broken. */
         bool FullRebreak(BufferView *);
 
+#ifndef NEW_INSETS
        ///
        LyXParagraph::footnote_flag GetFootnoteFlag(int row);
+#endif
        ///
        Row * need_break_row;
        ///
@@ -189,6 +189,7 @@ public:
         */
        Row * GetRow(LyXParagraph * par,
                     LyXParagraph::size_type pos, long & y) const;
+
        /** returns the height of a default row, needed  for scrollbar
         */
        int DefaultHeight() const;
@@ -224,7 +225,7 @@ public:
        LyXCursor toggle_end_cursor;
    
        /// need the selection cursor:
-       void SetSelection(BufferView *);
+       void SetSelection();
        ///
        void ClearSelection() const;
        ///
@@ -268,7 +269,8 @@ public:
 
        ///
        void SetCursorFromCoordinates(BufferView *, int x, long y) const;
-       void SetCursorFromCoordinates(BufferView *, LyXCursor &, int x, long y) const;
+       void SetCursorFromCoordinates(BufferView *, LyXCursor &,
+                                     int x, long y) const;
        ///
        void CursorUp(BufferView *) const;
        ///
@@ -325,8 +327,9 @@ public:
          solution but faster.
         */
        void GetVisibleRow(BufferView *, int y_offset, int x_offset,
-                          Row * row_ptr, long y);
+                          Row * row_ptr, long y, bool cleared=false);
 
+#ifndef NEW_INSETS
        /* footnotes: */
        ///
        void ToggleFootnote(BufferView *);
@@ -348,10 +351,11 @@ public:
                                       LyXParagraph::footnote_kind kind);
        ///
        void MeltFootnoteEnvironment(BufferView *);
+#endif
        ///
        void CutSelection(BufferView *, bool = true);
        ///
-       void CopySelection(Buffer const *);
+       void CopySelection(BufferView *);
        ///
        void PasteSelection(BufferView *);
        ///
@@ -423,8 +427,8 @@ public:
 
        /* for the greater insets */
   
-       /// returns 0 if inset wasn't found
-       int UpdateInset(BufferView *, Inset * inset);
+       /// returns false if inset wasn't found
+       bool UpdateInset(BufferView *, Inset *);
        ///
        void CheckParagraph(BufferView *, LyXParagraph * par,
                            LyXParagraph::size_type pos);
@@ -499,8 +503,6 @@ public:
        ///
        int workWidth(BufferView *) const;
        ///
-       //      Buffer * buffer() const;
-       ///
        void ComputeBidiTables(Buffer const *, Row * row) const;
 
        /// Maps positions in the visual string to positions in logical string.
@@ -538,10 +540,6 @@ private:
        ///
        void init();
        ///
-       BufferView * bv_owner;
-       ///
-       InsetText * inset_owner;
-       ///
        mutable Row * firstrow;
        ///
        mutable Row * lastrow;
@@ -607,7 +605,7 @@ private:
        ///
        void draw(BufferView *, Row const * row,
                  LyXParagraph::size_type & pos,
-                 int offset, float & x);
+                 int offset, float & x, bool cleared);
 
        /// get the next breakpoint in a given paragraph
        LyXParagraph::size_type NextBreakPoint(BufferView *, Row const * row,
@@ -673,9 +671,6 @@ private:
        ///
        mutable bool bidi_same_direction;
 
-       ///
-       unsigned char TransformChar(unsigned char c, Letter_Form form) const;
-
        ///
        unsigned char TransformChar(unsigned char c, LyXParagraph * par,
                                LyXParagraph::size_type pos) const;