aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Editor.cxx73
-rw-r--r--src/Editor.h3
-rw-r--r--win32/scintilla_vc6.mak25
3 files changed, 62 insertions, 39 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 0c540d513..8f5918bd1 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1793,6 +1793,42 @@ void Editor::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight,
highlight ? *pixmapIndentGuideHighlight : *pixmapIndentGuide);
}
+void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
+ int line, int lineEnd, int xStart, int subLine, int subLineStart,
+ bool overrideBackground, ColourAllocated background) {
+
+ int styleMask = pdoc->stylingBitsMask;
+ PRectangle rcSegment = rcLine;
+
+ // Fill in a PRectangle representing the end of line characters
+ int xEol = ll->positions[lineEnd] - subLineStart;
+ rcSegment.left = xEol + xStart;
+ rcSegment.right = xEol + vsDraw.aveCharWidth + xStart;
+ int posLineEnd = pdoc->LineStart(line + 1);
+ bool eolInSelection = (subLine == (ll->lines-1)) &&
+ (posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd);
+ if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1)) {
+ if (primarySelection)
+ surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
+ else
+ surface->FillRectangle(rcSegment, vsDraw.selbackground2.allocated);
+ } else if (overrideBackground) {
+ surface->FillRectangle(rcSegment, background);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
+ }
+
+ rcSegment.left = xEol + vsDraw.aveCharWidth + xStart;
+ rcSegment.right = rcLine.right;
+ if (overrideBackground) {
+ surface->FillRectangle(rcSegment, background);
+ } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated);
+ }
+}
+
void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine) {
@@ -1848,7 +1884,6 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
indentWidth = pdoc->tabInChars * vsDraw.spaceWidth;
int posLineStart = pdoc->LineStart(line);
- int posLineEnd = pdoc->LineStart(line + 1);
int startseg = ll->LineStart(subLine);
int subLineStart = ll->positions[startseg];
@@ -1911,6 +1946,12 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
startseg = i + 1;
}
}
+
+ if (twoPhaseDraw) {
+ DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd,
+ xStart, subLine, subLineStart, overrideBackground, background);
+ }
+
inIndentation = subLine == 0; // Do not handle indentation except on first subline.
startseg = ll->LineStart(subLine);
// Foreground drawing loop
@@ -2077,33 +2118,9 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
// End of the drawing of the current line
- int styleMask = pdoc->stylingBitsMask;
-
- // Fill in a PRectangle representing the end of line characters
- int xEol = ll->positions[lineEnd] - subLineStart;
- rcSegment.left = xEol + xStart;
- rcSegment.right = xEol + vsDraw.aveCharWidth + xStart;
- bool eolInSelection = (subLine == (ll->lines-1)) &&
- (posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd);
- if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1)) {
- if (primarySelection)
- surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
- else
- surface->FillRectangle(rcSegment, vsDraw.selbackground2.allocated);
- } else if (overrideBackground) {
- surface->FillRectangle(rcSegment, background);
- } else {
- surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
- }
-
- rcSegment.left = xEol + vsDraw.aveCharWidth + xStart;
- rcSegment.right = rcLine.right;
- if (overrideBackground) {
- surface->FillRectangle(rcSegment, background);
- } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
- surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
- } else {
- surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated);
+ if (!twoPhaseDraw) {
+ DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd,
+ xStart, subLine, subLineStart, overrideBackground, background);
}
if (vsDraw.edgeState == EDGE_LINE) {
diff --git a/src/Editor.h b/src/Editor.h
index ed5cc6612..6304f078a 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -353,6 +353,9 @@ protected: // ScintillaBase subclass needs access to much of Editor
int width=LineLayout::wrapWidthInfinite);
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, int styleMain, int i, LineLayout *ll);
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
+ void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
+ int line, int lineEnd, int xStart, int subLine, int subLineStart,
+ bool overrideBackground, ColourAllocated background);
void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine=0);
void Paint(Surface *surfaceWindow, PRectangle rcArea);
diff --git a/win32/scintilla_vc6.mak b/win32/scintilla_vc6.mak
index 270d0ce2b..bcd1c4352 100644
--- a/win32/scintilla_vc6.mak
+++ b/win32/scintilla_vc6.mak
@@ -105,7 +105,8 @@ SOBJS=\
$(DIR_O)\ScintillaWin.obj \
$(DIR_O)\Style.obj \
$(DIR_O)\UniConversion.obj \
- $(DIR_O)\ViewStyle.obj
+ $(DIR_O)\ViewStyle.obj \
+ $(DIR_O)\XPM.obj
#++Autogenerated -- run src/LexGen.py to regenerate
#**LEXOBJS=\\\n\(\t$(DIR_O)\\\*.obj \\\n\)
@@ -157,6 +158,7 @@ LOBJS=\
$(DIR_O)\StyleContext.obj \
$(DIR_O)\UniConversion.obj \
$(DIR_O)\ViewStyle.obj \
+ $(DIR_O)\XPM.obj \
$(LEXOBJS)
$(DIR_O)\ScintRes.res : ScintRes.rc
@@ -224,7 +226,7 @@ $(DIR_O)\Editor.obj: ../src/Editor.cxx ../include/Platform.h \
../include/Scintilla.h ../src/ContractionState.h ../src/SVector.h \
../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
- ../src/Document.h ../src/Editor.h
+ ../src/Document.h ../src/Editor.h ../src/XPM.h
$(DIR_O)\ExternalLexer.obj: ExternalLexer.cxx ../include/Platform.h \
../include/SciLexer.h ../include/PropSet.h ../include/SString.h \
../include/Accessor.h ../src/DocumentAccessor.h ../include/KeyWords.h \
@@ -288,9 +290,9 @@ $(DIR_O)\LexVB.obj: ..\src\LexVB.cxx $(LEX_HEADERS)
#--Autogenerated -- end of automatically generated section
$(DIR_O)\LineMarker.obj: ../src/LineMarker.cxx ../include/Platform.h \
- ../include/Scintilla.h ../src/LineMarker.h
+ ../include/Scintilla.h ../src/LineMarker.h ../src/XPM.h
$(DIR_O)\PlatWin.obj: PlatWin.cxx ../include/Platform.h PlatformRes.h \
- ../src/UniConversion.h
+ ../src/UniConversion.h ../src/XPM.h
$(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h
$(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/RESearch.h
@@ -300,23 +302,23 @@ $(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/Document.h ../src/Editor.h \
- ../src/ScintillaBase.h
+ ../src/ScintillaBase.h ../src/XPM.h
$(DIR_O)\ScintillaBaseL.obj: ..\src\ScintillaBase.cxx ..\include\Platform.h ..\include\Scintilla.h ..\include\SciLexer.h \
..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \
..\src\LineMarker.h ..\src\Style.h ..\src\AutoComplete.h ..\src\ViewStyle.h ..\src\Document.h ..\src\Editor.h \
- ..\src\ScintillaBase.h ..\include\PropSet.h \
- ..\include\SString.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\include\KeyWords.h
+ ..\src\ScintillaBase.h ..\include\PropSet.h ..\include\SString.h ..\include\Accessor.h \
+ ..\src\DocumentAccessor.h ..\include\KeyWords.h ../src/XPM.h
$(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \
../src/SVector.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/Document.h \
- ../src/Editor.h ../src/ScintillaBase.h ../src/UniConversion.h
+ ../src/Editor.h ../src/ScintillaBase.h ../src/UniConversion.h ../src/XPM.h
$(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Scintilla.h ..\include\SciLexer.h \
..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \
..\src\LineMarker.h ..\src\Style.h ..\src\AutoComplete.h ..\src\ViewStyle.h ..\src\Document.h ..\src\Editor.h \
..\src\ScintillaBase.h ..\include\PropSet.h \
- ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h ..\src\UniConversion.h
+ ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h ..\src\UniConversion.h ../src/XPM.h
$(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Scintilla.h \
..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \
..\src\LineMarker.h ..\src\Style.h ..\src\AutoComplete.h ..\src\ViewStyle.h ..\src\Document.h ..\src\Editor.h \
@@ -329,7 +331,8 @@ $(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \
$(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h
$(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Indicator.h ../src/LineMarker.h \
- ../src/Style.h ../src/ViewStyle.h
+ ../src/Style.h ../src/ViewStyle.h ../src/XPM.h
$(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
- ../include/WindowAccessor.h ../include/Scintilla.h \ No newline at end of file
+ ../include/WindowAccessor.h ../include/Scintilla.h
+$(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h