aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/PlatCocoa.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-17 14:58:11 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-17 14:58:11 +1100
commit1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4 (patch)
treef25f7353ad23c041da607b07b5ddd247214ba90c /cocoa/PlatCocoa.h
parent7fbe52f835688967a6079582ed8839cb55d0f9ea (diff)
downloadscintilla-mirror-1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4.tar.gz
Change Font to an interface and stop using FontID. Fonts are shared and
reference counted using std::shared_ptr. This optimizes memory and reduces potential for allocation bugs.
Diffstat (limited to 'cocoa/PlatCocoa.h')
-rw-r--r--cocoa/PlatCocoa.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h
index c19ac8bca..f140295c5 100644
--- a/cocoa/PlatCocoa.h
+++ b/cocoa/PlatCocoa.h
@@ -101,18 +101,18 @@ public:
void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) override;
void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource) override;
std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) override;
- void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
+ void DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
ColourDesired back) override;
- void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
+ void DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
ColourDesired back) override;
- void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore) override;
- void MeasureWidths(Font &font_, std::string_view text, XYPOSITION *positions) override;
- XYPOSITION WidthText(Font &font_, std::string_view text) override;
- XYPOSITION Ascent(Font &font_) override;
- XYPOSITION Descent(Font &font_) override;
- XYPOSITION InternalLeading(Font &font_) override;
- XYPOSITION Height(Font &font_) override;
- XYPOSITION AverageCharWidth(Font &font_) override;
+ void DrawTextTransparent(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourDesired fore) override;
+ void MeasureWidths(const Font *font_, std::string_view text, XYPOSITION *positions) override;
+ XYPOSITION WidthText(const Font *font_, std::string_view text) override;
+ XYPOSITION Ascent(const Font *font_) override;
+ XYPOSITION Descent(const Font *font_) override;
+ XYPOSITION InternalLeading(const Font *font_) override;
+ XYPOSITION Height(const Font *font_) override;
+ XYPOSITION AverageCharWidth(const Font *font_) override;
void SetClip(PRectangle rc) override;
void FlushCachedState() override;