]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
remove lowercase, better layout handling and some variable renameing
[lyx.git] / src / insets / insettext.h
index 0a7a0f99ddc0f77bdb4db23662e44f219717bff6..91fe8da05baba4fe2d5e2dd1b6ea2cafcb2b2887 100644 (file)
 #include "LColor.h"
 #include "paragraph.h"
 #include "lyxcursor.h"
+
 #include <boost/smart_ptr.hpp>
 
 class Painter;
 class BufferView;
 class Buffer;
+class BufferParams;
 class LyXCursor;
 class LyXText;
 class LyXScreen;
@@ -72,7 +74,7 @@ public:
                ALWAYS
        };
        ///
-       InsetText();
+       InsetText(BufferParams const &);
        ///
        explicit
        InsetText(InsetText const &, bool same_id = false);
@@ -99,7 +101,7 @@ public:
        ///
        void draw(BufferView *, LyXFont const &, int , float &, bool) const;
        ///
-       void update(BufferView *, LyXFont const &, bool =false);
+       void update(BufferView *, LyXFont const &, bool = false);
        ///
        void setUpdateStatus(BufferView *, int what) const;
        ///
@@ -122,7 +124,7 @@ public:
        ///
        bool updateInsetInInset(BufferView *, Inset *);
        ///
-       void insetButtonRelease(BufferView *, int, int, int);
+       bool insetButtonRelease(BufferView *, int, int, int);
        ///
        void insetButtonPress(BufferView *, int, int, int);
        ///
@@ -152,7 +154,7 @@ public:
        ///
        void toggleInsetCursor(BufferView *);
        ///
-       void showInsetCursor(BufferView *, bool show=true);
+       void showInsetCursor(BufferView *, bool show = true);
        ///
        void hideInsetCursor(BufferView *);
        ///
@@ -201,19 +203,19 @@ public:
        ///
        bool nodraw() const;
        ///
-       int scroll(bool recursive=true) const;
+       int scroll(bool recursive = true) const;
        ///
-       void scroll(BufferView *bv, float sx) const {
+       void scroll(BufferView * bv, float sx) const {
                UpdatableInset::scroll(bv, sx);
        }
        ///
-       void scroll(BufferView *bv, int offset) const {
+       void scroll(BufferView * bv, int offset) const {
                UpdatableInset::scroll(bv, offset);
        }
        ///
-       void selectAll(BufferView *bv);
+       void selectAll(BufferView * bv);
        ///
-       void clearSelection(BufferView *bv);
+       void clearSelection(BufferView * bv);
        ///
        Paragraph * getParFromID(int id) const;
        ///
@@ -230,17 +232,23 @@ public:
        void paragraph(Paragraph *);
        ///
        bool allowSpellcheck() { return true; }
-       string const selectNextWordToSpellcheck(BufferView *, float & value) const;
+       ///
+       string const selectNextWordToSpellcheck(BufferView *,
+                                               float & value) const;
        void selectSelectedWord(BufferView *);
+       ///
        void toggleSelection(BufferView *, bool kill_selection);
        ///
        bool searchForward(BufferView *, string const &,
-                          bool const & = true, bool const & = false);
+                          bool = true, bool = false);
+       ///
        bool searchBackward(BufferView *, string const &,
-                           bool const & = true, bool const & = false);
+                           bool = true, bool = false);
        ///
        bool checkInsertChar(LyXFont &);
        ///
+       void getDrawFont(LyXFont &) const;
+       ///
        //
        // Public structures and variables
        ///
@@ -250,6 +258,8 @@ protected:
        ///
        void updateLocal(BufferView *, int what, bool mark_dirty) const;
        ///
+       void lockInset(BufferView *, UpdatableInset *);
+       ///
        mutable int drawTextXOffset;
        ///
        mutable int drawTextYOffset;
@@ -261,14 +271,17 @@ protected:
        LColor::color frame_color;
 
 private:
+       ///
        struct InnerCache {
+               ///
                InnerCache(boost::shared_ptr<LyXText>);
-
+               ///
                boost::shared_ptr<LyXText> text;
+               ///
                bool remove;
        };
        ///
-       typedef std::map<BufferView *, struct InnerCache > Cache;
+       typedef std::map<BufferView *, InnerCache> Cache;
        ///
        typedef Cache::value_type value_type;
        ///
@@ -323,9 +336,12 @@ private:
        void clearInset(BufferView *, int baseline, bool & cleared) const;
        ///
        void saveLyXTextState(LyXText *) const;
+       ///
        void restoreLyXTextState(BufferView *, LyXText *) const;
        ///
        void reinitLyXText() const;
+       ///
+       void collapseParagraphs(BufferParams const & bparams) const;
        
        /* Private structures and variables */
        ///
@@ -339,10 +355,6 @@ private:
        ///
        mutable int insetWidth;
        ///
-       mutable int last_width;
-       ///
-       mutable int last_height;
-       ///
        mutable int top_y;
        ///
        Paragraph * inset_par;
@@ -375,7 +387,7 @@ private:
        ///
        mutable boost::shared_ptr<LyXText> cached_text;
        ///
-       mutable struct save_state {
+       struct save_state {
                Paragraph * lpar;
                Paragraph * selstartpar;
                Paragraph * selendpar;
@@ -388,7 +400,10 @@ private:
                bool selection;
                bool mark_set;
                bool refresh;
-       } sstate;
+       };
+       ///
+       mutable save_state sstate;
+       
        ///
        // this is needed globally so we know that we're using it actually and
        // so the LyXText-Cache is not erased until used!
@@ -405,5 +420,10 @@ private:
        mutable BufferView * do_resize;
        mutable bool do_reinit;
        mutable bool in_insetAllowed;
+       ///
+       // these are used to check for mouse movement in Motion selection code
+       ///
+       int mouse_x;
+       int mouse_y;
 };
 #endif