if ((line >= lenLineStarts) && (line != 0)) {
int newMaxLines = line + 20;
int *newLineStarts = new int[newMaxLines];
- if (!newLineStarts)
+ if (!newLineStarts)
return;
for (int i=0; i<newMaxLines; i++) {
if (i < lenLineStarts)
lineStarts[line] = start;
}
-void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
+void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
char bracesMatchStyle, int xHighlight) {
if (rangeLine.ContainsCharacter(braces[0])) {
int braceOffset = braces[0] - rangeLine.start;
xHighlightGuide = 0;
}
-LineLayoutCache::LineLayoutCache() :
- level(0), length(0), size(0), cache(0),
+LineLayoutCache::LineLayoutCache() :
+ level(0), length(0), size(0), cache(0),
allInvalidated(false), styleClock(-1) {
Allocate(0);
}
}
}
-LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
+LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
int linesOnScreen, int linesInDoc) {
AllocateForLevel(linesOnScreen, linesInDoc);
if (styleClock != styleClock_) {
else
goodTopLine += cs.GetHeight(lineDocTop);
double durWrap = et.Duration(true);
- Platform::DebugPrintf("Wrap:%9.6g \n", durWrap);
+ //Platform::DebugPrintf("Wrap:%9.6g \n", durWrap);
}
}
if (wrapOccurred) {
int posLineStart = pdoc->LineStart(lineNumber);
int posLineEnd = pdoc->LineStart(lineNumber + 1);
int lineCaret = pdoc->LineFromPosition(currentPos);
- return llc.Retrieve(lineNumber, lineCaret,
+ return llc.Retrieve(lineNumber, lineCaret,
posLineEnd - posLineStart, pdoc->GetStyleClock(),
LinesOnScreen() + 1, pdoc->LinesTotal());
}
} else {
ll->edgeColumn = -1;
}
-
+
int posLineEnd = pdoc->LineStart(line + 1);
Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font;
char styleByte = 0;
ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character
ll->styles[numCharsInLine] = styleByte; // For eolFilled
ll->indicators[numCharsInLine] = 0;
-
+
// Layout the line, determining the position of each character,
// with an extra element at the end for the end of the line.
int startseg = 0; // Start of the current segment, in char. number
ll->positions[0] = 0;
unsigned int tabWidth = vstyle.spaceWidth * pdoc->tabInChars;
bool lastSegItalics = false;
-
+
for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) {
if ((ll->styles[charInLine] != ll->styles[charInLine + 1]) ||
IsControlCharacter(ll->chars[charInLine]) || IsControlCharacter(ll->chars[charInLine + 1])) {
//Platform::DebugPrintf("Abandoning paint\n");
if (wrapState != eWrapNone) {
if (paintAbandonedByStyling) {
- // Styling has spilled over a line end, such as occurs by starting a multiline
+ // Styling has spilled over a line end, such as occurs by starting a multiline
// comment. The width of subsequent text may have changed, so rewrap.
NeedWrapping(cs.DocFromDisplay(topLine));
}
ll->selEnd = -1;
ll->containsCaret = false;
}
-
+
PRectangle rcLine = rcClient;
rcLine.top = ypos;
rcLine.bottom = ypos + vs.lineHeight;
// Highlight the current braces if any
ll->SetBracesHighlight(rangeLine, braces, static_cast<char>(bracesMatchStyle),
highlightGuideColumn * vs.spaceWidth);
-
+
// Draw the line
DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine);
//durPaint += et.Duration(true);
-
+
// Restore the precvious styles for the brace highlights in case layout is in cache.
ll->RestoreBracesHighlight(rangeLine, braces);
surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated);
}
}
-
+
// Draw the Caret
if (lineDoc == lineCaret) {
int offset = Platform::Minimum(posCaret - rangeLine.start, ll->maxLineLength);
}
}
}
-
+
if (bufferedDraw) {
Point from(vs.fixedColumnWidth, 0);
PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen,
}
//durCopy += et.Duration(true);
}
-
+
if (!bufferedDraw) {
ypos += vs.lineHeight;
}
}
}
//Platform::DebugPrintf(
- //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
+ //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
//durLayout, durPaint, durLayout / durPaint, durCopy, etWhole.Duration());
NotifyPainted();
}
SetLastXChosen();
if (treatAsDBCS) {
- NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
+ NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
static_cast<unsigned char>(s[1]));
} else {
int byte = static_cast<unsigned char>(s[0]);
if ((line >= lenLineStarts) && (line != 0)) {
int newMaxLines = line + 20;
int *newLineStarts = new int[newMaxLines];
- if (!newLineStarts)
+ if (!newLineStarts)
return;
for (int i=0; i<newMaxLines; i++) {
if (i < lenLineStarts)
lineStarts[line] = start;
}
-void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
+void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
char bracesMatchStyle, int xHighlight) {
if (rangeLine.ContainsCharacter(braces[0])) {
int braceOffset = braces[0] - rangeLine.start;
xHighlightGuide = 0;
}
-LineLayoutCache::LineLayoutCache() :
- level(0), length(0), size(0), cache(0),
+LineLayoutCache::LineLayoutCache() :
+ level(0), length(0), size(0), cache(0),
allInvalidated(false), styleClock(-1) {
Allocate(0);
}
}
}
-LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
+LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
int linesOnScreen, int linesInDoc) {
AllocateForLevel(linesOnScreen, linesInDoc);
if (styleClock != styleClock_) {
else
goodTopLine += cs.GetHeight(lineDocTop);
double durWrap = et.Duration(true);
- Platform::DebugPrintf("Wrap:%9.6g \n", durWrap);
+ //Platform::DebugPrintf("Wrap:%9.6g \n", durWrap);
}
}
if (wrapOccurred) {
int posLineStart = pdoc->LineStart(lineNumber);
int posLineEnd = pdoc->LineStart(lineNumber + 1);
int lineCaret = pdoc->LineFromPosition(currentPos);
- return llc.Retrieve(lineNumber, lineCaret,
+ return llc.Retrieve(lineNumber, lineCaret,
posLineEnd - posLineStart, pdoc->GetStyleClock(),
LinesOnScreen() + 1, pdoc->LinesTotal());
}
} else {
ll->edgeColumn = -1;
}
-
+
int posLineEnd = pdoc->LineStart(line + 1);
Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font;
char styleByte = 0;
ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character
ll->styles[numCharsInLine] = styleByte; // For eolFilled
ll->indicators[numCharsInLine] = 0;
-
+
// Layout the line, determining the position of each character,
// with an extra element at the end for the end of the line.
int startseg = 0; // Start of the current segment, in char. number
ll->positions[0] = 0;
unsigned int tabWidth = vstyle.spaceWidth * pdoc->tabInChars;
bool lastSegItalics = false;
-
+
for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) {
if ((ll->styles[charInLine] != ll->styles[charInLine + 1]) ||
IsControlCharacter(ll->chars[charInLine]) || IsControlCharacter(ll->chars[charInLine + 1])) {
//Platform::DebugPrintf("Abandoning paint\n");
if (wrapState != eWrapNone) {
if (paintAbandonedByStyling) {
- // Styling has spilled over a line end, such as occurs by starting a multiline
+ // Styling has spilled over a line end, such as occurs by starting a multiline
// comment. The width of subsequent text may have changed, so rewrap.
NeedWrapping(cs.DocFromDisplay(topLine));
}
ll->selEnd = -1;
ll->containsCaret = false;
}
-
+
PRectangle rcLine = rcClient;
rcLine.top = ypos;
rcLine.bottom = ypos + vs.lineHeight;
// Highlight the current braces if any
ll->SetBracesHighlight(rangeLine, braces, static_cast<char>(bracesMatchStyle),
highlightGuideColumn * vs.spaceWidth);
-
+
// Draw the line
DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine);
//durPaint += et.Duration(true);
-
+
// Restore the precvious styles for the brace highlights in case layout is in cache.
ll->RestoreBracesHighlight(rangeLine, braces);
surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated);
}
}
-
+
// Draw the Caret
if (lineDoc == lineCaret) {
int offset = Platform::Minimum(posCaret - rangeLine.start, ll->maxLineLength);
}
}
}
-
+
if (bufferedDraw) {
Point from(vs.fixedColumnWidth, 0);
PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen,
}
//durCopy += et.Duration(true);
}
-
+
if (!bufferedDraw) {
ypos += vs.lineHeight;
}
}
}
//Platform::DebugPrintf(
- //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
+ //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
//durLayout, durPaint, durLayout / durPaint, durCopy, etWhole.Duration());
NotifyPainted();
}
SetLastXChosen();
if (treatAsDBCS) {
- NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
+ NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
static_cast<unsigned char>(s[1]));
} else {
int byte = static_cast<unsigned char>(s[0]);