From 2813306346e4087679915c2b30f1be4949f0228a Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 20 Mar 2021 12:10:14 +1100 Subject: Use SurfaceMode struct as a way to inform Surface of modes like code page and bidirectional options in an extensible way instead of adding a call for each element. --- src/Platform.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/Platform.h b/src/Platform.h index 568c571cc..3afa24c92 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -162,6 +162,17 @@ public: virtual std::vector FindRangeIntervals(size_t start, size_t end) = 0; }; +/** + * Parameters for surfaces. + */ +struct SurfaceMode { + int codePage = 0; + bool bidiR2L = false; + SurfaceMode() = default; + explicit SurfaceMode(int codePage_, bool bidiR2L_) noexcept : codePage(codePage_), bidiR2L(bidiR2L_) { + } +}; + /** * A surface abstracts a place to draw. */ @@ -179,6 +190,8 @@ public: virtual void Init(SurfaceID sid, WindowID wid)=0; virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0; + virtual void SetMode(SurfaceMode mode)=0; + enum class Ends { semiCircles = 0x0, leftFlat = 0x1, -- cgit v1.2.3