aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/EditView.cxx22
-rw-r--r--src/Editor.cxx8
-rw-r--r--src/ViewStyle.cxx14
-rw-r--r--src/ViewStyle.h8
4 files changed, 26 insertions, 26 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index c1722a047..b3b107cff 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -286,7 +286,7 @@ static void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid,
}
// Draw the arrow head if needed
- if (vsDraw.tabDrawMode == tdLongArrow) {
+ if (vsDraw.tabDrawMode == TabDrawMode::longArrow) {
XYPOSITION ydiff = std::floor(rcTab.Height() / 2.0f);
XYPOSITION xhead = rightStroke - ydiff;
if (xhead <= rcTab.left) {
@@ -1720,7 +1720,7 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi
} else {
// Normal text display
surface->FillRectangleAligned(rcSegment, Fill(textBack));
- if (vsDraw.viewWhitespace != wsInvisible) {
+ if (vsDraw.viewWhitespace != WhiteSpace::invisible) {
for (int cpos = 0; cpos <= i - ts.start; cpos++) {
if (ll->chars[cpos + ts.start] == ' ') {
if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation)) {
@@ -1961,7 +1961,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
textBack = vsDraw.whitespaceColours.back;
surface->FillRectangleAligned(rcSegment, Fill(textBack));
}
- if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ if (inIndentation && vsDraw.viewIndentationGuides == IndentView::real) {
for (int indentCount = static_cast<int>((ll->positions[i] + epsilon) / indentWidth);
indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
indentCount++) {
@@ -1972,7 +1972,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
}
}
}
- if (vsDraw.viewWhitespace != wsInvisible) {
+ if (vsDraw.viewWhitespace != WhiteSpace::invisible) {
if (vsDraw.WhiteSpaceVisible(inIndentation)) {
if (vsDraw.whitespaceColours.fore.isSet)
textFore = vsDraw.whitespaceColours.fore;
@@ -2013,11 +2013,11 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
rcSegment.top + vsDraw.maxAscent, text, textFore, textBack);
}
}
- if (vsDraw.viewWhitespace != wsInvisible ||
- (inIndentation && vsDraw.viewIndentationGuides != ivNone)) {
+ if (vsDraw.viewWhitespace != WhiteSpace::invisible ||
+ (inIndentation && vsDraw.viewIndentationGuides != IndentView::none)) {
for (int cpos = 0; cpos <= i - ts.start; cpos++) {
if (ll->chars[cpos + ts.start] == ' ') {
- if (vsDraw.viewWhitespace != wsInvisible) {
+ if (vsDraw.viewWhitespace != WhiteSpace::invisible) {
if (vsDraw.whitespaceColours.fore.isSet)
textFore = vsDraw.whitespaceColours.fore;
if (vsDraw.WhiteSpaceVisible(inIndentation)) {
@@ -2039,7 +2039,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
surface->FillRectangleAligned(rcDot, Fill(textFore));
}
}
- if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ if (inIndentation && vsDraw.viewIndentationGuides == IndentView::real) {
for (int indentCount = static_cast<int>((ll->positions[cpos + ts.start] + epsilon) / indentWidth);
indentCount <= (ll->positions[cpos + ts.start + 1] - epsilon) / indentWidth;
indentCount++) {
@@ -2078,7 +2078,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
void EditView::DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
Sci::Line line, Sci::Line lineVisible, PRectangle rcLine, int xStart, int subLine) {
- if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth)
+ if ((vsDraw.viewIndentationGuides == IndentView::lookForward || vsDraw.viewIndentationGuides == IndentView::lookBoth)
&& (subLine == 0)) {
const Sci::Position posLineStart = model.pdoc->LineStart(line);
int indentSpace = model.pdoc->GetLineIndentation(line);
@@ -2099,7 +2099,7 @@ void EditView::DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &mode
// Level is one more level than parent
indentLastWithText += model.pdoc->IndentSize();
}
- if (vsDraw.viewIndentationGuides == ivLookForward) {
+ if (vsDraw.viewIndentationGuides == IndentView::lookForward) {
// In viLookForward mode, previous line only used if it is a fold header
if (isFoldHeader) {
indentSpace = std::max(indentSpace, indentLastWithText);
@@ -2502,7 +2502,7 @@ Sci::Position EditView::FormatRange(bool draw, const Sci_RangeToFormat *pfr, Sur
vsPrint.zoomLevel = printParameters.magnification;
// Don't show indentation guides
// If this ever gets changed, cached pixmap would need to be recreated if technology != SC_TECHNOLOGY_DEFAULT
- vsPrint.viewIndentationGuides = ivNone;
+ vsPrint.viewIndentationGuides = IndentView::none;
// Don't show the selection when printing
vsPrint.selColours.back.isSet = false;
vsPrint.selColours.fore.isSet = false;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index fa356fe15..4f1add2c3 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6459,15 +6459,15 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->MarkerNumberFromLine(static_cast<Sci::Line>(wParam), static_cast<int>(lParam));
case SCI_GETVIEWWS:
- return vs.viewWhitespace;
+ return static_cast<sptr_t>(vs.viewWhitespace);
case SCI_SETVIEWWS:
- vs.viewWhitespace = static_cast<WhiteSpaceVisibility>(wParam);
+ vs.viewWhitespace = static_cast<WhiteSpace>(wParam);
Redraw();
break;
case SCI_GETTABDRAWMODE:
- return vs.tabDrawMode;
+ return static_cast<sptr_t>(vs.tabDrawMode);
case SCI_SETTABDRAWMODE:
vs.tabDrawMode = static_cast<TabDrawMode>(wParam);
@@ -6864,7 +6864,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_GETINDENTATIONGUIDES:
- return vs.viewIndentationGuides;
+ return static_cast<sptr_t>(vs.viewIndentationGuides);
case SCI_SETHIGHLIGHTGUIDE:
if ((highlightGuideColumn != static_cast<int>(wParam)) || (wParam > 0)) {
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index 6aa459895..f553f4205 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -256,10 +256,10 @@ void ViewStyle::Init(size_t stylesSize_) {
CalculateMarginWidthAndMask();
textStart = marginInside ? fixedColumnWidth : leftMarginWidth;
zoomLevel = 0;
- viewWhitespace = wsInvisible;
- tabDrawMode = tdLongArrow;
+ viewWhitespace = WhiteSpace::invisible;
+ tabDrawMode = TabDrawMode::longArrow;
whitespaceSize = 1;
- viewIndentationGuides = ivNone;
+ viewIndentationGuides = IndentView::none;
viewEOL = false;
extraFontFlag = 0;
extraAscent = 0;
@@ -491,13 +491,13 @@ bool ViewStyle::SelectionBackgroundDrawn() const noexcept {
}
bool ViewStyle::WhitespaceBackgroundDrawn() const noexcept {
- return (viewWhitespace != wsInvisible) && (whitespaceColours.back.isSet);
+ return (viewWhitespace != WhiteSpace::invisible) && (whitespaceColours.back.isSet);
}
bool ViewStyle::WhiteSpaceVisible(bool inIndent) const noexcept {
- return (!inIndent && viewWhitespace == wsVisibleAfterIndent) ||
- (inIndent && viewWhitespace == wsVisibleOnlyInIndent) ||
- viewWhitespace == wsVisibleAlways;
+ return (!inIndent && viewWhitespace == WhiteSpace::visibleAfterIndent) ||
+ (inIndent && viewWhitespace == WhiteSpace::visibleOnlyInIndent) ||
+ viewWhitespace == WhiteSpace::visibleAlways;
}
ColourDesired ViewStyle::WrapColour() const noexcept {
diff --git a/src/ViewStyle.h b/src/ViewStyle.h
index d33feb485..7f50804c2 100644
--- a/src/ViewStyle.h
+++ b/src/ViewStyle.h
@@ -40,11 +40,11 @@ public:
void Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs);
};
-enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth};
+enum class IndentView {none, real, lookForward, lookBoth};
-enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2, wsVisibleOnlyInIndent=3};
+enum class WhiteSpace {invisible=0, visibleAlways=1, visibleAfterIndent=2, visibleOnlyInIndent=3};
-enum TabDrawMode {tdLongArrow=0, tdStrikeOut=1};
+enum class TabDrawMode {longArrow=0, strikeOut=1};
typedef std::map<FontSpecification, std::unique_ptr<FontRealised>> FontMap;
@@ -123,7 +123,7 @@ public:
bool marginInside; ///< true: margin included in text view, false: separate views
int textStart; ///< Starting x position of text within the view
int zoomLevel;
- WhiteSpaceVisibility viewWhitespace;
+ WhiteSpace viewWhitespace;
TabDrawMode tabDrawMode;
int whitespaceSize;
IndentView viewIndentationGuides;