aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/Platform.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-06-02 08:37:47 +1000
committerNeil <nyamatongwe@gmail.com>2018-06-02 08:37:47 +1000
commit2e003602f29edff5d38137472edee82fab9f5376 (patch)
treeefcd2d4466c2bb894d5354d0652e986fdfcbea22 /include/Platform.h
parente67783d907b0ae186d794b205cf89c645fe50270 (diff)
downloadscintilla-mirror-2e003602f29edff5d38137472edee82fab9f5376.tar.gz
Define IScreenLineLayout as the main interface for implementing bidirectional
features by platform code. Implement IScreenLineLayout for Win32 / DirectWrite as ScreenLineLayout.
Diffstat (limited to 'include/Platform.h')
-rw-r--r--include/Platform.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/Platform.h b/include/Platform.h
index 30f05d88a..a70a00b78 100644
--- a/include/Platform.h
+++ b/include/Platform.h
@@ -336,6 +336,14 @@ struct Interval {
XYPOSITION right;
};
+class IScreenLineLayout {
+public:
+ virtual ~IScreenLineLayout() = default;
+ virtual size_t PositionFromX(XYPOSITION xDistance, bool charPosition) = 0;
+ virtual XYPOSITION XFromPosition(size_t caretPosition) = 0;
+ virtual std::vector<Interval> FindRangeIntervals(size_t start, size_t end) = 0;
+};
+
/**
* A surface abstracts a place to draw.
*/
@@ -373,9 +381,7 @@ public:
virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;
- virtual size_t PositionFromX(const IScreenLine *screenLine, XYPOSITION xDistance, bool charPosition)=0;
- virtual XYPOSITION XFromPosition(const IScreenLine *screenLine, size_t caretPosition)=0;
- virtual std::vector<Interval> FindRangeIntervals(const IScreenLine *screenLine, size_t start, size_t end)=0;
+ virtual std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) = 0;
virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore, ColourDesired back) = 0;
virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore, ColourDesired back) = 0;