diff options
author | Neil <nyamatongwe@gmail.com> | 2018-05-23 16:59:41 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-05-23 16:59:41 +1000 |
commit | 071602224b06d3bc65b8eda49ec8f589ccf66159 (patch) | |
tree | c7e84825e23691624609d1b8d7200eeab41fd41e /src/PositionCache.h | |
parent | 7ee2a70c18f899a4845621622241adc578b0400c (diff) | |
download | scintilla-mirror-071602224b06d3bc65b8eda49ec8f589ccf66159.tar.gz |
Implement bidirectional mode bidiL2R for DirectDraw on Win32.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 7f50c4dec..512ec13f5 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -40,6 +40,13 @@ enum PointEnd { peSubLineEnd = 0x2 }; +class BidiData { +public: + std::vector<FontAlias> stylesFonts; + std::vector<XYPOSITION> widthReprs; + void Resize(size_t maxLineLength_); +}; + /** */ class LineLayout { @@ -66,6 +73,8 @@ public: std::unique_ptr<XYPOSITION[]> positions; char bracePreviousStyles[2]; + std::unique_ptr<BidiData> bidiData; + // Hotspot support Range hotspot; @@ -82,13 +91,16 @@ public: void operator=(LineLayout &&) = delete; virtual ~LineLayout(); void Resize(int maxLineLength_); + void EnsureBidiData(); void Free(); void Invalidate(validLevel validity_); int LineStart(int line) const; + int LineLength(int line) const; enum class Scope { visibleOnly, includeEnd }; int LineLastVisible(int line, Scope scope) const; Range SubLineRange(int subLine, Scope scope) const; bool InLine(int offset, int line) const; + int SubLineFromPosition(int posInLine, PointEnd pe) const; void SetLineStart(int line, int start); void SetBracesHighlight(Range rangeLine, const Sci::Position braces[], char bracesMatchStyle, int xHighlight, bool ignoreStyle); @@ -99,6 +111,30 @@ public: int EndLineStyle() const; }; +struct ScreenLine : public IScreenLine { + const LineLayout *ll; + size_t start; + size_t len; + XYPOSITION width; + XYPOSITION height; + int ctrlCharPadding; + XYPOSITION tabWidth; + int tabWidthMinimumPixels; + + ScreenLine(const LineLayout *ll_, int subLine, const ViewStyle &vs, XYPOSITION width_, int tabWidthMinimumPixels_); + virtual ~ScreenLine(); + + std::string_view Text() const override; + size_t Length() const override; + size_t RepresentationCount() const override; + XYPOSITION Width() const override; + XYPOSITION Height() const override; + XYPOSITION TabWidth() const override; + XYPOSITION TabWidthMinimumPixels() const override; + const Font *FontOfPosition(size_t position) const override; + XYPOSITION RepresentationWidth(size_t position) const override; +}; + /** */ class LineLayoutCache { |