diff options
| -rw-r--r-- | cocoa/ScintillaCocoa.h | 1 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 9 | ||||
| -rw-r--r-- | gtk/ScintillaGTK.cxx | 7 | ||||
| -rw-r--r-- | gtk/ScintillaGTK.h | 1 | ||||
| -rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.cpp | 8 | ||||
| -rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.h | 1 | ||||
| -rw-r--r-- | src/Editor.cxx | 119 | ||||
| -rw-r--r-- | src/Editor.h | 3 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 8 | 
9 files changed, 22 insertions, 135 deletions
| diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h index 9149a6ede..7573d85fd 100644 --- a/cocoa/ScintillaCocoa.h +++ b/cocoa/ScintillaCocoa.h @@ -150,7 +150,6 @@ public:  	sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;  	void TickFor(TickReason reason) override; -	bool FineTickerAvailable() override;  	bool FineTickerRunning(TickReason reason) override;  	void FineTickerStart(TickReason reason, int millis, int tolerance) override;  	void FineTickerCancel(TickReason reason) override; diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index c849b39a1..9f7a4cbf8 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -897,15 +897,6 @@ void ScintillaCocoa::TickFor(TickReason reason) {  //--------------------------------------------------------------------------------------------------  /** - * Report that this Editor subclass has a working implementation of FineTickerStart. - */ -bool ScintillaCocoa::FineTickerAvailable() { -	return true; -} - -//-------------------------------------------------------------------------------------------------- - -/**   * Is a particular timer currently running?   */  bool ScintillaCocoa::FineTickerRunning(TickReason reason) { diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 3def49966..67177bb1c 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -884,13 +884,6 @@ sptr_t ScintillaGTK::DefWndProc(unsigned int, uptr_t, sptr_t) {  	return 0;  } -/** -* Report that this Editor subclass has a working implementation of FineTickerStart. -*/ -bool ScintillaGTK::FineTickerAvailable() { -	return true; -} -  bool ScintillaGTK::FineTickerRunning(TickReason reason) {  	return timers[reason].timer != 0;  } diff --git a/gtk/ScintillaGTK.h b/gtk/ScintillaGTK.h index a20f3bcd4..40ed39ecd 100644 --- a/gtk/ScintillaGTK.h +++ b/gtk/ScintillaGTK.h @@ -100,7 +100,6 @@ private:  		TimeThunk() : reason(tickCaret), scintilla(NULL), timer(0) {}  	};  	TimeThunk timers[tickDwell+1]; -	bool FineTickerAvailable() override;  	bool FineTickerRunning(TickReason reason) override;  	void FineTickerStart(TickReason reason, int millis, int tolerance) override;  	void FineTickerCancel(TickReason reason) override; diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index cab44ea86..54e5ccbde 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -401,14 +401,6 @@ void ScintillaQt::NotifyParent(SCNotification scn)  	emit notifyParent(scn);  } -/** -* Report that this Editor subclass has a working implementation of FineTickerStart. -*/ -bool ScintillaQt::FineTickerAvailable() -{ -	return true; -} -  bool ScintillaQt::FineTickerRunning(TickReason reason)  {  	return timers[reason] != 0; diff --git a/qt/ScintillaEditBase/ScintillaQt.h b/qt/ScintillaEditBase/ScintillaQt.h index 2aceb1e00..e4471572b 100644 --- a/qt/ScintillaEditBase/ScintillaQt.h +++ b/qt/ScintillaEditBase/ScintillaQt.h @@ -121,7 +121,6 @@ private:  	void NotifyFocus(bool focus) override;  	void NotifyParent(SCNotification scn) override;  	int timers[tickDwell+1]; -	bool FineTickerAvailable() override;  	bool FineTickerRunning(TickReason reason) override;  	void FineTickerStart(TickReason reason, int millis, int tolerance) override;  	void FineTickerCancel(TickReason reason) override; diff --git a/src/Editor.cxx b/src/Editor.cxx index 82c63dfb8..9020a7051 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1393,28 +1393,20 @@ void Editor::ShowCaretAtCurrentPosition() {  	if (hasFocus) {  		caret.active = true;  		caret.on = true; -		if (FineTickerAvailable()) { -			FineTickerCancel(tickCaret); -			if (caret.period > 0) -				FineTickerStart(tickCaret, caret.period, caret.period/10); -		} else { -			SetTicking(true); -		} +		FineTickerCancel(tickCaret); +		if (caret.period > 0) +			FineTickerStart(tickCaret, caret.period, caret.period/10);  	} else {  		caret.active = false;  		caret.on = false; -		if (FineTickerAvailable()) { -			FineTickerCancel(tickCaret); -		} +		FineTickerCancel(tickCaret);  	}  	InvalidateCaret();  }  void Editor::DropCaret() {  	caret.active = false; -	if (FineTickerAvailable()) { -		FineTickerCancel(tickCaret); -	} +	FineTickerCancel(tickCaret);  	InvalidateCaret();  } @@ -1422,11 +1414,9 @@ void Editor::CaretSetPeriod(int period) {  	if (caret.period != period) {  		caret.period = period;  		caret.on = true; -		if (FineTickerAvailable()) { -			FineTickerCancel(tickCaret); -			if ((caret.active) && (caret.period > 0)) -				FineTickerStart(tickCaret, caret.period, caret.period/10); -		} +		FineTickerCancel(tickCaret); +		if ((caret.active) && (caret.period > 0)) +			FineTickerStart(tickCaret, caret.period, caret.period/10);  		InvalidateCaret();  	}  } @@ -1762,11 +1752,9 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {  	view.PaintText(surfaceWindow, *this, rcArea, rcClient, vs);  	if (horizontalScrollBarVisible && trackLineWidth && (view.lineWidthMaxSeen > scrollWidth)) { -		if (FineTickerAvailable()) { -			scrollWidth = view.lineWidthMaxSeen; -			if (!FineTickerRunning(tickWiden)) { -				FineTickerStart(tickWiden, 50, 5); -			} +		scrollWidth = view.lineWidthMaxSeen; +		if (!FineTickerRunning(tickWiden)) { +			FineTickerStart(tickWiden, 50, 5);  		}  	} @@ -4160,13 +4148,9 @@ void Editor::SetDragPosition(SelectionPosition newPos) {  	}  	if (!(posDrag == newPos)) {  		caret.on = true; -		if (FineTickerAvailable()) { -			FineTickerCancel(tickCaret); -			if ((caret.active) && (caret.period > 0) && (newPos.Position() < 0)) -				FineTickerStart(tickCaret, caret.period, caret.period/10); -		} else { -			SetTicking(true); -		} +		FineTickerCancel(tickCaret); +		if ((caret.active) && (caret.period > 0) && (newPos.Position() < 0)) +			FineTickerStart(tickCaret, caret.period, caret.period/10);  		InvalidateCaret();  		posDrag = newPos;  		InvalidateCaret(); @@ -4390,12 +4374,7 @@ void Editor::DwellEnd(bool mouseMoved) {  		dwelling = false;  		NotifyDwelling(ptMouseLast, dwelling);  	} -	if (FineTickerAvailable()) { -		FineTickerCancel(tickDwell); -		if (mouseMoved && (dwellDelay < SC_TIME_FOREVER)) { -			//FineTickerStart(tickDwell, dwellDelay, dwellDelay/10); -		} -	} +	FineTickerCancel(tickDwell);  }  void Editor::MouseLeave() { @@ -4444,9 +4423,7 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifie  	if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick, doubleClickCloseThreshold)) {  		//Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);  		SetMouseCapture(true); -		if (FineTickerAvailable()) { -			FineTickerStart(tickScroll, 100, 10); -		} +		FineTickerStart(tickScroll, 100, 10);  		if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))  			SetEmptySelection(newPos.Position());  		bool doubleClick = false; @@ -4544,9 +4521,7 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifie  			SetDragPosition(SelectionPosition(Sci::invalidPosition));  			SetMouseCapture(true); -			if (FineTickerAvailable()) { -				FineTickerStart(tickScroll, 100, 10); -			} +			FineTickerStart(tickScroll, 100, 10);  		} else {  			if (PointIsHotspot(pt)) {  				NotifyHotSpotClicked(newCharPos.Position(), modifiers); @@ -4559,9 +4534,7 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifie  					inDragDrop = ddNone;  			}  			SetMouseCapture(true); -			if (FineTickerAvailable()) { -				FineTickerStart(tickScroll, 100, 10); -			} +			FineTickerStart(tickScroll, 100, 10);  			if (inDragDrop != ddInitial) {  				SetDragPosition(SelectionPosition(Sci::invalidPosition));  				if (!shift) { @@ -4683,9 +4656,7 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {  	if (inDragDrop == ddInitial) {  		if (DragThreshold(ptMouseLast, pt)) {  			SetMouseCapture(false); -			if (FineTickerAvailable()) { -				FineTickerCancel(tickScroll); -			} +			FineTickerCancel(tickScroll);  			SetDragPosition(movePos);  			CopySelectionRange(&drag);  			StartDrag(); @@ -4697,7 +4668,7 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {  	PRectangle rcClient = GetClientRectangle();  	Point ptOrigin = GetVisibleOriginInMain();  	rcClient.Move(0, -ptOrigin.y); -	if (FineTickerAvailable() && (dwellDelay < SC_TIME_FOREVER) && rcClient.Contains(pt)) { +	if ((dwellDelay < SC_TIME_FOREVER) && rcClient.Contains(pt)) {  		FineTickerStart(tickDwell, dwellDelay, dwellDelay/10);  	}  	//Platform::DebugPrintf("Move %d %d\n", pt.x, pt.y); @@ -4737,7 +4708,7 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {  					// the selection for a fancier definition of "word" (for  					// example, in Perl it is useful to include the leading  					// '$', '%' or '@' on variables for word selection). In this -					// the ButtonMove() called via Tick() for auto-scrolling +					// the ButtonMove() called via TickFor() for auto-scrolling  					// could result in the fancier word selection adjustment  					// being unmade.  				} else { @@ -4826,9 +4797,7 @@ void Editor::ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers  		}  		ptMouseLast = pt;  		SetMouseCapture(false); -		if (FineTickerAvailable()) { -			FineTickerCancel(tickScroll); -		} +		FineTickerCancel(tickScroll);  		NotifyIndicatorClick(false, newPos.Position(), 0);  		if (inDragDrop == ddDragging) {  			SelectionPosition selStart = SelectionStart(); @@ -4888,39 +4857,6 @@ void Editor::ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers  	}  } -// Called frequently to perform background UI including -// caret blinking and automatic scrolling. -void Editor::Tick() { -	if (HaveMouseCapture()) { -		// Auto scroll -		ButtonMoveWithModifiers(ptMouseLast, 0, 0); -	} -	if (caret.period > 0) { -		timer.ticksToWait -= timer.tickSize; -		if (timer.ticksToWait <= 0) { -			caret.on = !caret.on; -			timer.ticksToWait = caret.period; -			if (caret.active) { -				InvalidateCaret(); -			} -		} -	} -	if (horizontalScrollBarVisible && trackLineWidth && (view.lineWidthMaxSeen > scrollWidth)) { -		scrollWidth = view.lineWidthMaxSeen; -		SetScrollBars(); -	} -	if ((dwellDelay < SC_TIME_FOREVER) && -	        (ticksToDwell > 0) && -	        (!HaveMouseCapture()) && -	        (ptMouseLast.y >= 0)) { -		ticksToDwell -= timer.tickSize; -		if (ticksToDwell <= 0) { -			dwelling = true; -			NotifyDwelling(ptMouseLast, dwelling); -		} -	} -} -  bool Editor::Idle() {  	bool needWrap = Wrapping() && wrapPending.NeedsWrap(); @@ -4943,13 +4879,6 @@ bool Editor::Idle() {  	return !idleDone;  } -void Editor::SetTicking(bool) { -	// SetTicking is deprecated. In the past it was pure virtual and was overridden in each -	// derived platform class but fine grained timers should now be implemented. -	// Either way, execution should not arrive here so assert failure. -	assert(false); -} -  void Editor::TickFor(TickReason reason) {  	switch (reason) {  		case tickCaret: @@ -4980,10 +4909,6 @@ void Editor::TickFor(TickReason reason) {  	}  } -bool Editor::FineTickerAvailable() { -	return false; -} -  // FineTickerStart is be overridden by subclasses that support fine ticking so  // this method should never be called.  bool Editor::FineTickerRunning(TickReason) { diff --git a/src/Editor.h b/src/Editor.h index 8adcff769..93f953859 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -506,12 +506,9 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	void ButtonMoveWithModifiers(Point pt, unsigned int curTime, int modifiers);  	void ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers); -	void Tick();  	bool Idle(); -	virtual void SetTicking(bool on);  	enum TickReason { tickCaret, tickScroll, tickWiden, tickDwell, tickPlatform };  	virtual void TickFor(TickReason reason); -	virtual bool FineTickerAvailable();  	virtual bool FineTickerRunning(TickReason reason);  	virtual void FineTickerStart(TickReason reason, int millis, int tolerance);  	virtual void FineTickerCancel(TickReason reason); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index d35e418a9..74116acea 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -328,7 +328,6 @@ class ScintillaWin :  	sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;  	bool SetIdle(bool on) override;  	UINT_PTR timers[tickDwell+1]; -	bool FineTickerAvailable() override;  	bool FineTickerRunning(TickReason reason) override;  	void FineTickerStart(TickReason reason, int millis, int tolerance) override;  	void FineTickerCancel(TickReason reason) override; @@ -1780,13 +1779,6 @@ sptr_t ScintillaWin::DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPa  	return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);  } -/** -* Report that this Editor subclass has a working implementation of FineTickerStart. -*/ -bool ScintillaWin::FineTickerAvailable() { -	return true; -} -  bool ScintillaWin::FineTickerRunning(TickReason reason) {  	return timers[reason] != 0;  } | 
