aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditBase/PlatQt.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 /qt/ScintillaEditBase/PlatQt.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 'qt/ScintillaEditBase/PlatQt.h')
-rw-r--r--qt/ScintillaEditBase/PlatQt.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h
index 63364a3d7..2860e1397 100644
--- a/qt/ScintillaEditBase/PlatQt.h
+++ b/qt/ScintillaEditBase/PlatQt.h
@@ -113,20 +113,20 @@ public:
std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) override;
- void DrawTextNoClip(PRectangle rc, Font &font, XYPOSITION ybase,
+ 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,
+ 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,
+ void DrawTextTransparent(PRectangle rc, const Font *font, XYPOSITION ybase,
std::string_view text, ColourDesired fore) override;
- void MeasureWidths(Font &font, std::string_view text,
+ void MeasureWidths(const 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;
+ 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;
@@ -136,8 +136,8 @@ public:
void SetBidiR2L(bool bidiR2L_) override;
void BrushColour(ColourDesired back);
- void SetCodec(const Font &font);
- void SetFont(const Font &font);
+ void SetCodec(const Font *font);
+ void SetFont(const Font *font);
QPaintDevice *GetPaintDevice();
void SetPainter(QPainter *painter);