From c8235ba0e0292f209a8233613669e2cff8de80da Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 22 May 2021 08:18:01 +1000 Subject: Rename ColourAlpha to ColourRGBA to avoid clashes when a ColourAlpha typedef will be published in externally visible header. --- gtk/PlatGTK.cxx | 44 +++++++++++++++++++++--------------------- gtk/ScintillaGTK.cxx | 8 ++++---- gtk/ScintillaGTKAccessible.cxx | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 07a6f5539..db1afc170 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -146,7 +146,7 @@ class SurfaceImpl : public Surface { PangoLayout *layout = nullptr; Converter conv; int characterSet = -1; - void PenColourAlpha(ColourAlpha fore) noexcept; + void PenColourAlpha(ColourRGBA fore) noexcept; void SetConverter(int characterSet_); void CairoRectangle(PRectangle rc) noexcept; public: @@ -190,17 +190,17 @@ public: std::unique_ptr Layout(const IScreenLine *screenLine) override; - void DrawTextBase(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore); - void DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override; - void DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override; - void DrawTextTransparent(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore) override; + void DrawTextBase(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore); + void DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore, ColourRGBA back) override; + void DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore, ColourRGBA back) override; + void DrawTextTransparent(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore) override; void MeasureWidths(const Font *font_, std::string_view text, XYPOSITION *positions) override; XYPOSITION WidthText(const Font *font_, std::string_view text) override; - void DrawTextBaseUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore); - void DrawTextNoClipUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override; - void DrawTextClippedUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override; - void DrawTextTransparentUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore) override; + void DrawTextBaseUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore); + void DrawTextNoClipUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore, ColourRGBA back) override; + void DrawTextClippedUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore, ColourRGBA back) override; + void DrawTextTransparentUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourRGBA fore) override; void MeasureWidthsUTF8(const Font *font_, std::string_view text, XYPOSITION *positions) override; XYPOSITION WidthTextUTF8(const Font *font_, std::string_view text) override; @@ -276,7 +276,7 @@ const char *CharacterSetID(int characterSet) noexcept { } } -void SurfaceImpl::PenColourAlpha(ColourAlpha fore) noexcept { +void SurfaceImpl::PenColourAlpha(ColourRGBA fore) noexcept { if (context) { cairo_set_source_rgba(context, fore.GetRedComponent(), @@ -767,7 +767,7 @@ size_t MultiByteLenFromIconv(const Converter &conv, const char *s, size_t len) n } void SurfaceImpl::DrawTextBase(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, - ColourAlpha fore) { + ColourRGBA fore) { if (context) { PenColourAlpha(fore); const XYPOSITION xText = rc.left; @@ -793,20 +793,20 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, const Font *font_, XYPOSITION ybas } void SurfaceImpl::DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, ColourAlpha back) { + ColourRGBA fore, ColourRGBA back) { FillRectangleAligned(rc, back); DrawTextBase(rc, font_, ybase, text, fore); } // On GTK+, exactly same as DrawTextNoClip void SurfaceImpl::DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, ColourAlpha back) { + ColourRGBA fore, ColourRGBA back) { FillRectangleAligned(rc, back); DrawTextBase(rc, font_, ybase, text, fore); } void SurfaceImpl::DrawTextTransparent(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, - ColourAlpha fore) { + ColourRGBA fore) { // Avoid drawing spaces in transparent mode for (size_t i=0; i(tr); timers[tr].scintilla = this; } - vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourAlpha(0, 0, 0xff)); - vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourAlpha(0, 0, 0xff)); - vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourAlpha(0, 0, 0xff)); - vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourAlpha(0, 0, 0xff)); + vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourRGBA(0, 0, 0xff)); + vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourRGBA(0, 0, 0xff)); + vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourRGBA(0, 0, 0xff)); + vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourRGBA(0, 0, 0xff)); fontOptionsPrevious = FontOptions(PWidget(wText)); } diff --git a/gtk/ScintillaGTKAccessible.cxx b/gtk/ScintillaGTKAccessible.cxx index e8bf2af77..25490277b 100644 --- a/gtk/ScintillaGTKAccessible.cxx +++ b/gtk/ScintillaGTKAccessible.cxx @@ -524,7 +524,7 @@ static AtkAttributeSet *AddTextIntAttribute(AtkAttributeSet *attributes, AtkText return AddTextAttribute(attributes, attr, g_strdup(atk_text_attribute_get_value(attr, i))); } -static AtkAttributeSet *AddTextColorAttribute(AtkAttributeSet *attributes, AtkTextAttribute attr, ColourAlpha colour) { +static AtkAttributeSet *AddTextColorAttribute(AtkAttributeSet *attributes, AtkTextAttribute attr, ColourRGBA colour) { return AddTextAttribute(attributes, attr, g_strdup_printf("%u,%u,%u", colour.GetRed() * 257, colour.GetGreen() * 257, colour.GetBlue() * 257)); } -- cgit v1.2.3