From e0a7bf7ec16650044b6024ab15d04e75393516a3 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 9 Aug 2013 16:11:28 +1000 Subject: Structure colour settings into ColourOptional and ForeBackColours types. --- src/ViewStyle.h | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'src/ViewStyle.h') diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 22e8a8f5a..0222af591 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -58,6 +58,20 @@ typedef std::map FontMap; enum WrapMode { eWrapNone, eWrapWord, eWrapChar }; +class ColourOptional : public ColourDesired { +public: + bool isSet; + ColourOptional(ColourDesired colour_=ColourDesired(0,0,0), bool isSet_=false) : ColourDesired(colour_), isSet(isSet_) { + } + ColourOptional(uptr_t wParam, sptr_t lParam) : ColourDesired(lParam), isSet(wParam != 0) { + } +}; + +struct ForeBackColours { + ColourOptional fore; + ColourOptional back; +}; + /** */ class ViewStyle { @@ -76,32 +90,21 @@ public: XYPOSITION aveCharWidth; XYPOSITION spaceWidth; XYPOSITION tabWidth; - bool selforeset; - ColourDesired selforeground; + ForeBackColours selColours; ColourDesired selAdditionalForeground; - bool selbackset; - ColourDesired selbackground; ColourDesired selAdditionalBackground; - ColourDesired selbackground2; + ColourDesired selBackground2; int selAlpha; int selAdditionalAlpha; bool selEOLFilled; - bool whitespaceForegroundSet; - ColourDesired whitespaceForeground; - bool whitespaceBackgroundSet; - ColourDesired whitespaceBackground; + ForeBackColours whitespaceColours; int controlCharSymbol; XYPOSITION controlCharWidth; ColourDesired selbar; ColourDesired selbarlight; - bool foldmarginColourSet; - ColourDesired foldmarginColour; - bool foldmarginHighlightColourSet; - ColourDesired foldmarginHighlightColour; - bool hotspotForegroundSet; - ColourDesired hotspotForeground; - bool hotspotBackgroundSet; - ColourDesired hotspotBackground; + ColourOptional foldmarginColour; + ColourOptional foldmarginHighlightColour; + ForeBackColours hotspotColours; bool hotspotUnderline; bool hotspotSingleLine; /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin -- cgit v1.2.3