]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettabular.h
Some more changes for updating text-insets.
[lyx.git] / src / insets / insettabular.h
index 4175f2376ff5b8e39a2600e770561eb3093ca0ec..2cb39167ee47836390876e6f2d50b79dd1d8b69e 100644 (file)
@@ -61,6 +61,15 @@ class Buffer;
 
 class InsetTabular : public UpdatableInset {
 public:
+    ///
+    enum UpdateCodes {
+       NONE = 0,
+       INIT,
+       FULL,
+       CELL,
+       CURSOR,
+       SELECTION
+    };
     ///
     InsetTabular(Buffer *, int rows=1, int columns=1);
     ///
@@ -80,15 +89,19 @@ public:
     ///
     int width(Painter &, LyXFont const & f) const;
     ///
-    void draw(Painter & pain, const LyXFont &, int , float &) const;
+    void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+    ///
+    void update(BufferView *, LyXFont const &, bool =false);
     ///
     const char * EditMessage() const;
     ///
     void Edit(BufferView *, int x, int y, unsigned int);
     ///
+    bool doClearArea() const { return !locked; };
+    ///
     void InsetUnlock(BufferView *);
     ///
-    void UpdateLocal(BufferView *, bool flag = true);
+    void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty);
     ///
     bool LockInsetInInset(BufferView *, UpdatableInset *);
     ///
@@ -128,7 +141,7 @@ public:
     ///
     Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
     ///
-    void GetCursorPos(int & x, int & y) const;
+    void GetCursorPos(BufferView *, int & x, int & y) const;
     ///
     void ToggleInsetCursor(BufferView *);
     ///
@@ -148,7 +161,7 @@ public:
     LyXTabular * tabular;
 
 private:
-    void calculate_width_of_cells(Painter &, LyXFont const &) const;
+    bool calculate_dimensions_of_cells(BufferView *, LyXFont const &, bool =false) const;
     ///
     void DrawCellLines(Painter &, int x, int baseline, int row, int cell)
            const;
@@ -162,8 +175,6 @@ private:
     ///
     void setPos(Painter &, int x, int y) const;
     ///
-    bool SetCellDimensions(Painter & pain, int cell, int row);
-    ///
     UpdatableInset::RESULT moveRight(BufferView *, bool lock=true);
     UpdatableInset::RESULT moveLeft(BufferView *, bool lock=true);
     UpdatableInset::RESULT moveUp(BufferView *);
@@ -187,7 +198,7 @@ private:
     ///
     int GetMaxWidthOfCell(Painter &, int cell) const;
     ///
-    void recomputeTextInsets(Painter &, const LyXFont &) const;
+    void recomputeTextInsets(BufferView *, const LyXFont &) const;
 
     ///
     /// Private structures and variables
@@ -210,10 +221,8 @@ private:
        oldcell,
         actcol,
         actrow;
-    bool
-        locked,
-        no_selection;
-    mutable bool
-        init_inset;
+    bool no_selection;
+    mutable bool locked;
+    mutable UpdateCodes need_update;
 };
 #endif