]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
Some more changes for updating text-insets.
[lyx.git] / src / insets / insettext.h
index 7174d2a55e9901d4565ecafbebb889fd3eaf25ef..223b34ede153db528872a1d1681847b569954042 100644 (file)
@@ -37,8 +37,6 @@ class LyXScreen;
  */
 class InsetText : public UpdatableInset {
 public:
-    ///
-    enum { TEXT_TO_INSET_OFFSET = 2 };
     ///
     enum UpdateCodes {
        NONE = 0,
@@ -46,7 +44,15 @@ public:
        FULL,
        CURSOR_PAR,
        CURSOR,
-       SELECTION
+       SELECTION,
+       DRAW_FRAME,
+       CLEAR_FRAME
+    };
+    ///
+    enum DrawFrame {
+       NEVER = 0,
+       LOCKED,
+       ALWAYS
     };
     ///
     explicit
@@ -130,36 +136,38 @@ public:
     ///
     void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
     ///
+    int getMaxWidth(Painter &, UpdatableInset const *) const;
+    ///
     void init(InsetText const * ins = 0);
     ///
+    void WriteParagraphData(Buffer const *, std::ostream &) const;
+    ///
     void SetParagraphData(LyXParagraph *);
     ///
     void SetAutoBreakRows(bool);
     ///
-    void SetDrawLockedFrame(bool);
+    void SetDrawFrame(BufferView *, DrawFrame);
     ///
-    void SetFrameColor(LColor::color);
+    void SetFrameColor(BufferView *, LColor::color);
     ///
-    LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const;
+//    LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const;
     ///
     LyXText * getLyXText(BufferView *) const;
     void deleteLyXText(BufferView *);
 
     LyXParagraph * par;
+    ///
+    mutable UpdateCodes need_update;
 
 protected:
     ///
     void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty);
-    ///
-    void WriteParagraphData(Buffer const *, std::ostream &) const;
-    ///
-    virtual int getMaxTextWidth(Painter &, UpdatableInset const *) const;
 
     mutable int drawTextXOffset;
     mutable int drawTextYOffset;
     ///
     bool autoBreakRows;
-    bool drawLockedFrame;
+    DrawFrame drawFrame;
     ///
     LColor::color frame_color;
 
@@ -187,6 +195,7 @@ private:
     ///
     string getText(int);
     ///
+    bool checkAndActivateInset(BufferView * bv, bool behind);
     bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
                               int button = 0);
     ///
@@ -196,10 +205,10 @@ private:
     LyXParagraph * cpar(BufferView *) const;
     Row * crow(BufferView *) const;
 
-       /// This instead of a macro
-       LyXText * TEXT(BufferView * bv) const {
-               return getLyXText(bv);
-       }
+    /// This instead of a macro
+    LyXText * TEXT(BufferView * bv) const {
+       return getLyXText(bv);
+    }
        
     /* Private structures and variables */
     ///
@@ -212,6 +221,8 @@ private:
     mutable int last_height;
     mutable int top_y;
     ///
+    LyXParagraph * inset_par;
+    ///
     int inset_pos;
     ///
     mutable int inset_x;
@@ -224,8 +235,6 @@ private:
     ///
     mutable float xpos;
     ///
-    mutable UpdateCodes need_update;
-    ///
     UpdatableInset * the_locking_inset;
     ///
     LyXParagraph * old_par;