diff options
author | Neil <nyamatongwe@gmail.com> | 2021-04-05 19:34:13 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-04-05 19:34:13 +1000 |
commit | 0f1f537fd035be38e7f93cba998dc75aaf90763d (patch) | |
tree | f82f3a863b01635873186180382a40872d9feecb /src/PositionCache.h | |
parent | bada09f1e1634ac00eed3f23c4f748b1897de96a (diff) | |
download | scintilla-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.h | 20 |
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; |