aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PerLine.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-05-24 19:31:06 +1000
committerNeil <nyamatongwe@gmail.com>2021-05-24 19:31:06 +1000
commit92290868cf9753d2df0d494cb44e2ff62a570b58 (patch)
tree001e6cfce84372a03997de3138d630751ee8d38a /src/PerLine.cxx
parentee1886079d0a5cd350ee8e3379be347943ba93ae (diff)
downloadscintilla-mirror-92290868cf9753d2df0d494cb44e2ff62a570b58.tar.gz
Define C++ version of the Scintilla API in ScintillaTypes.h, ScintillaMessages.h
and ScintillaStructures.h using scoped enumerations. Use these headers instead of Scintilla.h internally. External definitions go in the Scintilla namespace and internal definitio0ns in Scintilla::Internal.
Diffstat (limited to 'src/PerLine.cxx')
-rw-r--r--src/PerLine.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/PerLine.cxx b/src/PerLine.cxx
index 91621a4b4..068d5d0a5 100644
--- a/src/PerLine.cxx
+++ b/src/PerLine.cxx
@@ -17,18 +17,19 @@
#include <algorithm>
#include <memory>
+#include "ScintillaTypes.h"
+
#include "Debugging.h"
#include "Geometry.h"
#include "Platform.h"
-#include "Scintilla.h"
#include "Position.h"
#include "SplitVector.h"
#include "Partitioning.h"
#include "CellBuffer.h"
#include "PerLine.h"
-using namespace Scintilla;
+using namespace Scintilla::Internal;
MarkerHandleSet::MarkerHandleSet() {
}
@@ -227,14 +228,14 @@ void LineLevels::Init() {
void LineLevels::InsertLine(Sci::Line line) {
if (levels.Length()) {
- const int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE;
+ const int level = (line < levels.Length()) ? levels[line] : static_cast<int>(Scintilla::FoldLevel::Base);
levels.Insert(line, level);
}
}
void LineLevels::InsertLines(Sci::Line line, Sci::Line lines) {
if (levels.Length()) {
- const int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE;
+ const int level = (line < levels.Length()) ? levels[line] : static_cast<int>(Scintilla::FoldLevel::Base);
levels.InsertValue(line, lines, level);
}
}
@@ -243,17 +244,17 @@ void LineLevels::RemoveLine(Sci::Line line) {
if (levels.Length()) {
// Move up following lines but merge header flag from this line
// to line before to avoid a temporary disappearance causing expansion.
- int firstHeader = levels[line] & SC_FOLDLEVELHEADERFLAG;
+ int firstHeader = levels[line] & static_cast<int>(Scintilla::FoldLevel::HeaderFlag);
levels.Delete(line);
if (line == levels.Length()-1) // Last line loses the header flag
- levels[line-1] &= ~SC_FOLDLEVELHEADERFLAG;
+ levels[line-1] &= ~static_cast<int>(Scintilla::FoldLevel::HeaderFlag);
else if (line > 0)
levels[line-1] |= firstHeader;
}
}
void LineLevels::ExpandLevels(Sci::Line sizeNew) {
- levels.InsertValue(levels.Length(), sizeNew - levels.Length(), SC_FOLDLEVELBASE);
+ levels.InsertValue(levels.Length(), sizeNew - levels.Length(), static_cast<int>(Scintilla::FoldLevel::Base));
}
void LineLevels::ClearLevels() {
@@ -278,7 +279,7 @@ int LineLevels::GetLevel(Sci::Line line) const noexcept {
if (levels.Length() && (line >= 0) && (line < levels.Length())) {
return levels[line];
} else {
- return SC_FOLDLEVELBASE;
+ return static_cast<int>(Scintilla::FoldLevel::Base);
}
}