aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-04-05 19:34:13 +1000
committerNeil <nyamatongwe@gmail.com>2021-04-05 19:34:13 +1000
commit0f1f537fd035be38e7f93cba998dc75aaf90763d (patch)
treef82f3a863b01635873186180382a40872d9feecb /src/PositionCache.h
parentbada09f1e1634ac00eed3f23c4f748b1897de96a (diff)
downloadscintilla-mirror-0f1f537fd035be38e7f93cba998dc75aaf90763d.tar.gz
Extract unnamed caching enum as LineLayoutCache::Cache and change to enum class.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r--src/PositionCache.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h
index 5a3ec9bfd..e86b2bd51 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -149,7 +149,15 @@ struct ScreenLine : public IScreenLine {
/**
*/
class LineLayoutCache {
- int level;
+public:
+ enum class Cache {
+ none = SC_CACHE_NONE,
+ caret = SC_CACHE_CARET,
+ page = SC_CACHE_PAGE,
+ document = SC_CACHE_DOCUMENT
+ };
+private:
+ Cache level;
std::vector<std::unique_ptr<LineLayout>>cache;
bool allInvalidated;
int styleClock;
@@ -165,15 +173,9 @@ public:
void operator=(LineLayoutCache &&) = delete;
virtual ~LineLayoutCache();
void Deallocate() noexcept;
- enum {
- llcNone=SC_CACHE_NONE,
- llcCaret=SC_CACHE_CARET,
- llcPage=SC_CACHE_PAGE,
- llcDocument=SC_CACHE_DOCUMENT
- };
void Invalidate(LineLayout::ValidLevel validity_) noexcept;
- void SetLevel(int level_) noexcept;
- int GetLevel() const noexcept { return level; }
+ void SetLevel(Cache level_) noexcept;
+ Cache GetLevel() const noexcept { return level; }
LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_,
Sci::Line linesOnScreen, Sci::Line linesInDoc);
void Dispose(LineLayout *ll) noexcept;