diff options
-rw-r--r-- | gtk/ScintillaGTK.cxx | 10 | ||||
-rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.cpp | 2 | ||||
-rw-r--r-- | src/EditView.cxx | 8 | ||||
-rw-r--r-- | src/EditView.h | 4 | ||||
-rw-r--r-- | src/Editor.cxx | 38 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 4 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 4 |
7 files changed, 28 insertions, 42 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 2363aa080..a8b34e01b 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1681,7 +1681,7 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) { Point pt; pt.x = int(event->x); pt.y = int(event->y); - PRectangle rcClient = view.ViewRectangle(); + PRectangle rcClient = GetClientRectangle(); //Platform::DebugPrintf("Press %0d,%0d in %0d,%0d %0d,%0d\n", // pt.x, pt.y, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); if ((pt.x > rcClient.right) || (pt.y > rcClient.bottom)) { @@ -2501,7 +2501,7 @@ gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) { paintState = painting; repaintFullWindow = false; - rcPaint = view.ViewRectangle(); + rcPaint = GetClientRectangle(); PLATFORM_ASSERT(rgnUpdate == NULL); rgnUpdate = cairo_copy_clip_rectangle_list(cr); @@ -2518,7 +2518,7 @@ gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) { rcPaint.top = y1; rcPaint.right = x2; rcPaint.bottom = y2; - PRectangle rcClient = view.ViewRectangle(); + PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); std::unique_ptr<Surface> surfaceWindow(Surface::Allocate(SC_TECHNOLOGY_DEFAULT)); surfaceWindow->Init(cr, PWidget(wText)); @@ -2553,7 +2553,7 @@ gboolean ScintillaGTK::DrawThis(cairo_t *cr) { // if both scrollbars are visible, paint the little square on the bottom right corner if (verticalScrollBarVisible && horizontalScrollBarVisible && !Wrapping()) { GtkStyleContext *styleContext = gtk_widget_get_style_context(PWidget(wMain)); - PRectangle rc = view.ViewRectangle(); + PRectangle rc = GetClientRectangle(); gtk_style_context_save(styleContext); gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_SCROLLBARS_JUNCTION); @@ -2605,7 +2605,7 @@ gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *os PLATFORM_ASSERT(rgnUpdate == NULL); rgnUpdate = gdk_region_copy(ose->region); - PRectangle rcClient = view.ViewRectangle(); + PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); std::unique_ptr<Surface> surfaceWindow(Surface::Allocate(SC_TECHNOLOGY_DEFAULT)); cairo_t *cr = gdk_cairo_create(PWindow(wText)); diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index e6664c305..9209a7b65 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -696,7 +696,7 @@ void ScintillaQt::PartialPaint(const PRectangle &rect) { rcPaint = rect; paintState = painting; - PRectangle rcClient = view.ViewRectangle(); + PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); AutoSurface surface(this); diff --git a/src/EditView.cxx b/src/EditView.cxx index 2bb107e0b..37a6a9f9e 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -190,14 +190,6 @@ EditView::EditView() { EditView::~EditView() { } -PRectangle EditView::ViewRectangle() const { - return rectangleView; -} - -void EditView::SetViewRectangle(PRectangle rectangle) { - rectangleView = rectangle; -} - bool EditView::SetTwoPhaseDraw(bool twoPhaseDraw) { const PhasesDraw phasesDrawNew = twoPhaseDraw ? phasesTwo : phasesOne; const bool redraw = phasesDraw != phasesDrawNew; diff --git a/src/EditView.h b/src/EditView.h index 5e7a6d29a..8a194236d 100644 --- a/src/EditView.h +++ b/src/EditView.h @@ -47,7 +47,6 @@ typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid); */ class EditView { public: - PRectangle rectangleView; PrintParameters printParameters; std::unique_ptr<PerLine> ldTabstops; int tabWidthMinimumPixels; @@ -94,9 +93,6 @@ public: void operator=(const EditView &) = delete; virtual ~EditView(); - PRectangle ViewRectangle() const; - void SetViewRectangle(PRectangle rectangle); - bool SetTwoPhaseDraw(bool twoPhaseDraw); bool SetPhasesDraw(int phases); bool LinesOverlap() const; diff --git a/src/Editor.cxx b/src/Editor.cxx index 05756f6f1..80e32d1ae 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -310,18 +310,18 @@ PRectangle Editor::GetClientRectangle() const { } PRectangle Editor::GetClientDrawingRectangle() { - return view.ViewRectangle(); + return GetClientRectangle(); } PRectangle Editor::GetTextRectangle() const { - PRectangle rc = view.ViewRectangle(); + PRectangle rc = GetClientRectangle(); rc.left += vs.textStart; rc.right -= vs.rightMarginWidth; return rc; } Sci::Line Editor::LinesOnScreen() const { - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); const int htClient = static_cast<int>(rcClient.bottom - rcClient.top); //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); return htClient / vs.lineHeight; @@ -453,7 +453,7 @@ void Editor::RedrawRect(PRectangle rc) { //Platform::DebugPrintf("Redraw %0d,%0d - %0d,%0d\n", rc.left, rc.top, rc.right, rc.bottom); // Clip the redraw rectangle into the client area - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); if (rc.top < rcClient.top) rc.top = rcClient.top; if (rc.bottom > rcClient.bottom) @@ -474,7 +474,7 @@ void Editor::DiscardOverdraw() { void Editor::Redraw() { //Platform::DebugPrintf("Redraw all\n"); - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); wMain.InvalidateRectangle(rcClient); if (wMargin.GetID()) wMargin.InvalidateAll(); @@ -492,7 +492,7 @@ void Editor::RedrawSelMargin(Sci::Line line, bool allAfter) { Redraw(); return; } - PRectangle rcMarkers = view.ViewRectangle(); + PRectangle rcMarkers = GetClientRectangle(); if (!markersInText) { // Normal case: just draw the margin rcMarkers.right = rcMarkers.left + vs.fixedColumnWidth; @@ -946,7 +946,7 @@ void Editor::ScrollTo(Sci::Line line, bool moveThumb) { SetTopLine(topLineNew); // Optimize by styling the view as this will invalidate any needed area // which could abort the initial paint if discovered later. - StyleAreaBounded(view.ViewRectangle(), true); + StyleAreaBounded(GetClientRectangle(), true); #ifndef UNDER_CE // Perform redraw rather than scroll if many lines would be redrawn anyway. if (performBlit) { @@ -977,7 +977,7 @@ void Editor::HorizontalScrollTo(int xPos) { xOffset = xPos; ContainerNeedsUpdate(SC_UPDATE_H_SCROLL); SetHorizontalScrollPos(); - RedrawRect(view.ViewRectangle()); + RedrawRect(GetClientRectangle()); } } @@ -988,7 +988,7 @@ void Editor::VerticalCentreCaret() { const Sci::Line newTop = lineDisplay - (LinesOnScreen() / 2); if (topLine != newTop) { SetTopLine(newTop > 0 ? newTop : 0); - RedrawRect(view.ViewRectangle()); + RedrawRect(GetClientRectangle()); } } @@ -1543,7 +1543,7 @@ bool Editor::WrapLines(WrapScope ws) { if (lineToWrap < lineToWrapEnd) { - PRectangle rcTextArea = view.ViewRectangle(); + PRectangle rcTextArea = GetClientRectangle(); rcTextArea.left = static_cast<XYPOSITION>(vs.textStart); rcTextArea.right -= vs.rightMarginWidth; wrapWidth = static_cast<int>(rcTextArea.Width()); @@ -1655,7 +1655,7 @@ void Editor::PaintSelMargin(Surface *surfaceWindow, PRectangle &rc) { return; } - PRectangle rcMargin = view.ViewRectangle(); + PRectangle rcMargin = GetClientRectangle(); const Point ptOrigin = GetVisibleOriginInMain(); rcMargin.Move(0, -ptOrigin.y); rcMargin.left = 0; @@ -1688,7 +1688,7 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) { view.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs); marginView.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs); if (view.bufferedDraw) { - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); if (!view.pixmapLine->Initialised()) { view.pixmapLine->InitPixMap(static_cast<int>(rcClient.Width()), vs.lineHeight, @@ -1715,7 +1715,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { StyleAreaBounded(rcArea, false); - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); //Platform::DebugPrintf("Client: (%3d,%3d) ... (%3d,%3d) %d\n", // rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); @@ -1839,10 +1839,8 @@ void Editor::SetScrollBars() { void Editor::ChangeSize() { DropGraphics(false); SetScrollBars(); - const PRectangle rectangleClientArea = GetClientRectangle(); - view.SetViewRectangle(rectangleClientArea); if (Wrapping()) { - PRectangle rcTextArea = rectangleClientArea; + PRectangle rcTextArea = GetClientRectangle(); rcTextArea.left = static_cast<XYPOSITION>(vs.textStart); rcTextArea.right -= vs.rightMarginWidth; if (wrapWidth != rcTextArea.Width()) { @@ -4363,7 +4361,7 @@ bool Editor::PointInSelection(Point pt) { bool Editor::PointInSelMargin(Point pt) const { // Really means: "Point in a margin" if (vs.fixedColumnWidth > 0) { // There is a margin - PRectangle rcSelMargin = view.ViewRectangle(); + PRectangle rcSelMargin = GetClientRectangle(); rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart - vs.leftMarginWidth); rcSelMargin.left = static_cast<XYPOSITION>(vs.textStart - vs.fixedColumnWidth); const Point ptOrigin = GetVisibleOriginInMain(); @@ -4746,7 +4744,7 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) { } ptMouseLast = pt; - PRectangle rcClient = view.ViewRectangle(); + PRectangle rcClient = GetClientRectangle(); const Point ptOrigin = GetVisibleOriginInMain(); rcClient.Move(0, -ptOrigin.y); if ((dwellDelay < SC_TIME_FOREVER) && rcClient.Contains(pt)) { @@ -5096,7 +5094,7 @@ void Editor::StyleAreaBounded(PRectangle rcArea, bool scrolling) { } void Editor::IdleStyling() { - const Sci::Position posAfterArea = PositionAfterArea(view.ViewRectangle()); + const Sci::Position posAfterArea = PositionAfterArea(GetClientRectangle()); const Sci::Position endGoal = (idleStyling >= SC_IDLESTYLING_AFTERVISIBLE) ? static_cast<Sci::Position>(pdoc->Length()) : posAfterArea; const Sci::Position posAfterMax = PositionAfterMaxStyling(endGoal, false); @@ -5134,7 +5132,7 @@ bool Editor::PaintContainsMargin() { // never contains margin. return false; } - PRectangle rcSelMargin = view.ViewRectangle(); + PRectangle rcSelMargin = GetClientRectangle(); rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart); return PaintContains(rcSelMargin); } diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index da569d490..febc4f11f 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -261,7 +261,7 @@ void ScintillaBase::AutoCompleteStart(Sci::Position lenEntered, const char *list ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(), lenEntered, vs.lineHeight, IsUnicodeMode(), technology); - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); Point pt = LocationFromPosition(sel.MainCaret() - lenEntered); PRectangle rcPopupBounds = wMain.GetMonitorRect(pt); if (rcPopupBounds.Height() == 0) @@ -477,7 +477,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) { wMain); // If the call-tip window would be out of the client // space - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); const int offset = vs.lineHeight + static_cast<int>(rc.Height()); // adjust so it displays above the text. if (rc.bottom > rcClient.bottom && rc.Height() < rcClient.Height()) { diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 71c1867d7..0b340a747 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -834,7 +834,7 @@ sptr_t ScintillaWin::WndPaint(uptr_t wParam) { ::BeginPaint(MainHWND(), pps); } rcPaint = PRectangle::FromInts(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom); - const PRectangle rcClient = view.ViewRectangle(); + const PRectangle rcClient = GetClientRectangle(); paintingAllText = BoundsContains(rcPaint, hRgnUpdate, rcClient); if (technology == SC_TECHNOLOGY_DEFAULT) { AutoSurface surfaceWindow(pps->hdc, this); @@ -2927,7 +2927,7 @@ void ScintillaWin::FullPaint() { */ void ScintillaWin::FullPaintDC(HDC hdc) { paintState = painting; - rcPaint = view.ViewRectangle(); + rcPaint = GetClientRectangle(); paintingAllText = true; if (technology == SC_TECHNOLOGY_DEFAULT) { AutoSurface surfaceWindow(hdc, this); |