X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsettext.h;h=54ee58bec7f553e06ea28ea003eaf37bd17b6ad8;hb=65ec1c0437fd53ac6cff0b329f1563d91e481b6e;hp=2a35a2c06358c58c0b59f7f5d330a125841b7bbc;hpb=cd6e293ed7c588748fe0cf5927f46dc5e9ae6e35;p=lyx.git diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 2a35a2c063..54ee58bec7 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -24,6 +24,7 @@ #include "LColor.h" #include "paragraph.h" #include "lyxcursor.h" + #include class Painter; @@ -99,7 +100,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 +123,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 +153,7 @@ public: /// void toggleInsetCursor(BufferView *); /// - void showInsetCursor(BufferView *, bool show=true); + void showInsetCursor(BufferView *, bool show = true); /// void hideInsetCursor(BufferView *); /// @@ -176,7 +177,7 @@ public: /// void writeParagraphData(Buffer const *, std::ostream &) const; /// - void setParagraphData(Paragraph *); + void setParagraphData(Paragraph *, bool same_id = false); /// void setText(string const &); /// @@ -201,19 +202,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,14 +231,18 @@ 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 &); /// @@ -250,6 +255,8 @@ protected: /// void updateLocal(BufferView *, int what, bool mark_dirty) const; /// + void lockInset(BufferView *, UpdatableInset *); + /// mutable int drawTextXOffset; /// mutable int drawTextYOffset; @@ -261,14 +268,17 @@ protected: LColor::color frame_color; private: + /// struct InnerCache { + /// InnerCache(boost::shared_ptr); - + /// boost::shared_ptr text; + /// bool remove; }; /// - typedef std::map Cache; + typedef std::map Cache; /// typedef Cache::value_type value_type; /// @@ -308,7 +318,7 @@ private: /// int cy(BufferView *) const; /// - Paragraph::pos_type cpos(BufferView *) const; + lyx::pos_type cpos(BufferView *) const; /// Paragraph * cpar(BufferView *) const; /// @@ -320,12 +330,15 @@ private: /// void clearFrame(Painter &, bool cleared) const; /// - void clearInset(Painter &, int baseline, bool & cleared) const; + 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,15 +352,11 @@ private: /// mutable int insetWidth; /// - mutable int last_width; - /// - mutable int last_height; - /// mutable int top_y; /// Paragraph * inset_par; /// - Paragraph::pos_type inset_pos; + lyx::pos_type inset_pos; /// bool inset_boundary; /// @@ -375,20 +384,23 @@ private: /// mutable boost::shared_ptr cached_text; /// - mutable struct save_state { + struct save_state { Paragraph * lpar; Paragraph * selstartpar; Paragraph * selendpar; - Paragraph::pos_type pos; - Paragraph::pos_type selstartpos; - Paragraph::pos_type selendpos; + lyx::pos_type pos; + lyx::pos_type selstartpos; + lyx::pos_type selendpos; bool boundary; bool selstartboundary; bool selendboundary; 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! @@ -404,5 +416,11 @@ private: bool in_update; /* as update is not reentrant! */ 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