From 6b444111ecfe47a3f94293c3959cf197e3415735 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 19 Mar 2021 14:12:20 +1100 Subject: Add Platform::Supports for SupportsFeature API. --- cocoa/PlatCocoa.h | 1 + cocoa/PlatCocoa.mm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 0117fcc15..18d339536 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -79,6 +79,7 @@ public: CGContextRef GetContext() { return gc; } void Release() noexcept override; + int Supports(int feature) noexcept override; bool Initialised() override; void PenColour(ColourDesired fore) override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 2f8778d11..33c24397f 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -319,6 +319,10 @@ void GetPositions(CTLineRef line, std::vector &positions) { positions.begin(), std::plus()); } +const int SupportsCocoa[] = { + SC_SUPPORTS_LINE_DRAWS_FINAL, +}; + } //----------------- SurfaceImpl -------------------------------------------------------------------- @@ -452,6 +456,16 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID //-------------------------------------------------------------------------------------------------- +int SurfaceImpl::Supports(int feature) noexcept { + for (const int f : SupportsCocoa) { + if (f == feature) + return 1; + } + return 0; +} + +//-------------------------------------------------------------------------------------------------- + void SurfaceImpl::PenColour(ColourDesired fore) { if (gc) { ColourDesired colour(fore.AsInteger()); -- cgit v1.2.3