From 92290868cf9753d2df0d494cb44e2ff62a570b58 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 24 May 2021 19:31:06 +1000 Subject: Define C++ version of the Scintilla API in ScintillaTypes.h, ScintillaMessages.h and ScintillaStructures.h using scoped enumerations. Use these headers instead of Scintilla.h internally. External definitions go in the Scintilla namespace and internal definitio0ns in Scintilla::Internal. --- cocoa/PlatCocoa.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'cocoa/PlatCocoa.h') diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 29c908baa..bcd9d87b3 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -17,26 +17,28 @@ #include +#include "ScintillaTypes.h" +#include "ScintillaMessages.h" + #include "Debugging.h" #include "Geometry.h" #include "Platform.h" -#include "Scintilla.h" #include "QuartzTextLayout.h" -NSRect PRectangleToNSRect(const Scintilla::PRectangle &rc); -Scintilla::PRectangle NSRectToPRectangle(NSRect &rc); -CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet); +NSRect PRectangleToNSRect(const Scintilla::Internal::PRectangle &rc); +Scintilla::Internal::PRectangle NSRectToPRectangle(NSRect &rc); +CFStringEncoding EncodingFromCharacterSet(bool unicode, Scintilla::CharacterSet characterSet); @interface ScintillaContextMenu : NSMenu { - Scintilla::ScintillaCocoa *owner; + Scintilla::Internal::ScintillaCocoa *owner; } - (void) handleCommand: (NSMenuItem *) sender; -- (void) setOwner: (Scintilla::ScintillaCocoa *) newOwner; +- (void) setOwner: (Scintilla::Internal::ScintillaCocoa *) newOwner; @end -namespace Scintilla { +namespace Scintilla::Internal { // A class to do the actual text rendering for us using Quartz 2D. class SurfaceImpl : public Surface { @@ -84,7 +86,7 @@ public: void SetMode(SurfaceMode mode) override; void Release() noexcept override; - int Supports(int feature) noexcept override; + int SupportsFeature(Scintilla::Supports feature) noexcept override; bool Initialised() override; /** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */ @@ -96,7 +98,7 @@ public: int DeviceHeightFont(int points) override; void LineDraw(Point start, Point end, Stroke stroke) override; void PolyLine(const Point *pts, size_t npts, Stroke stroke) override; - void Polygon(const Scintilla::Point *pts, size_t npts, FillStroke fillStroke) override; + void Polygon(const Scintilla::Internal::Point *pts, size_t npts, FillStroke fillStroke) override; void RectangleDraw(PRectangle rc, FillStroke fillStroke) override; void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, Fill fill) override; @@ -108,7 +110,7 @@ public: void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) override; void Ellipse(PRectangle rc, FillStroke fillStroke) override; void Stadium(PRectangle rc, FillStroke fillStroke, Ends ends) override; - void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource) override; + void Copy(PRectangle rc, Scintilla::Internal::Point from, Surface &surfaceSource) override; std::unique_ptr Layout(const IScreenLine *screenLine) override; void DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore, -- cgit v1.2.3