diff options
author | nyamatongwe <unknown> | 2003-09-18 12:24:16 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-09-18 12:24:16 +0000 |
commit | 8b01a8c965414fa2ed7a86ced041bc515df31e82 (patch) | |
tree | 1d298eb03c468b2a0b4fe6068ccc6598b3995442 | |
parent | 2494178d6e891a824f870a940770e68a8860dd56 (diff) | |
download | scintilla-mirror-8b01a8c965414fa2ed7a86ced041bc515df31e82.tar.gz |
Safe parts of idle time wrapping.
-rw-r--r-- | src/Editor.cxx | 6 | ||||
-rw-r--r-- | src/Editor.h | 15 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index b75a62ec6..470b30ea3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -35,6 +35,9 @@ active(false), on(false), period(500) {} Timer::Timer() : ticking(false), ticksToWait(0), tickerID(0) {} +Idler::Idler() : +state(false), idlerID(0) {} + LineLayout::LineLayout(int maxLineLength_) : lineStarts(0), lenLineStarts(0), @@ -375,6 +378,7 @@ Editor::Editor() { wrapState = eWrapNone; wrapWidth = LineLayout::wrapWidthInfinite; docLineLastWrapped = -1; + docLastLineToWrap = -1; hsStart = -1; hsEnd = -1; @@ -387,6 +391,7 @@ Editor::~Editor() { pdoc->Release(); pdoc = 0; DropGraphics(); + /* SetIdle(false) must be called in a platform independent way */ delete pixmapLine; delete pixmapSelMargin; delete pixmapSelPattern; @@ -395,6 +400,7 @@ Editor::~Editor() { } void Editor::Finalise() { + SetIdle(false); CancelModes(); } diff --git a/src/Editor.h b/src/Editor.h index bd4669192..d0dfcccc1 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -33,6 +33,16 @@ public: /** */ +class Idler { +public: + bool state; + IdlerID idlerID; + + Idler(); +}; + +/** + */ class LineLayout { private: friend class LineLayoutCache; @@ -208,6 +218,8 @@ protected: // ScintillaBase subclass needs access to much of Editor Timer autoScrollTimer; enum { autoScrollDelay = 200 }; + Idler idler; + Point lastClick; unsigned int lastClickTime; int dwellDelay; @@ -273,6 +285,7 @@ protected: // ScintillaBase subclass needs access to much of Editor enum { eWrapNone, eWrapWord } wrapState; int wrapWidth; int docLineLastWrapped; + int docLastLineToWrap; Document *pdoc; @@ -451,7 +464,9 @@ protected: // ScintillaBase subclass needs access to much of Editor void ButtonUp(Point pt, unsigned int curTime, bool ctrl); void Tick(); + bool Idle(); virtual void SetTicking(bool on) = 0; + virtual void SetIdle(bool on) = 0; virtual void SetMouseCapture(bool on) = 0; virtual bool HaveMouseCapture() = 0; void SetFocusState(bool focusState); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 0d1993462..410f8711b 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -195,6 +195,7 @@ class ScintillaWin : sptr_t HandleComposition(uptr_t wParam, sptr_t lParam); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual void SetTicking(bool on); + virtual void SetIdle(bool) {} virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); virtual void ScrollText(int linesToMove); |