// Scintilla source code edit control /** @file ViewStyle.h ** Store information on how the document is to be viewed. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef VIEWSTYLE_H #define VIEWSTYLE_H namespace Scintilla { /** */ class MarginStyle { public: int style; ColourAlpha back; int width; int mask; bool sensitive; int cursor; MarginStyle(int style_= SC_MARGIN_SYMBOL, int width_=0, int mask_=0) noexcept; }; /** */ class FontRealised : public FontMeasurements { public: std::shared_ptr font; FontRealised() noexcept; // FontRealised objects can not be copied. FontRealised(const FontRealised &) = delete; FontRealised(FontRealised &&) = delete; FontRealised &operator=(const FontRealised &) = delete; FontRealised &operator=(FontRealised &&) = delete; virtual ~FontRealised(); void Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs, const char *localeName); }; enum class IndentView {none, real, lookForward, lookBoth}; enum class WhiteSpace {invisible=0, visibleAlways=1, visibleAfterIndent=2, visibleOnlyInIndent=3}; enum class TabDrawMode {longArrow=0, strikeOut=1}; typedef std::map> FontMap; enum class WrapMode { none, word, character, whitespace }; inline std::optional OptionalColour(uptr_t wParam, sptr_t lParam) { if (wParam) { return ColourAlpha::FromRGB(static_cast(lParam)); } else { return {}; } } struct ForeBackColours { std::optional fore; std::optional back; }; struct SelectionAppearance { // Colours of main selection ForeBackColours colours; // Colours of additional (non-main) selections ColourAlpha additionalForeground; ColourAlpha additionalBackground; // Background colour on X when not primary selection ColourAlpha background2; // Translucency. SC_ALPHA_NOALPHA: draw selection background beneath text int alpha; // Translucency of additional selections int additionalAlpha; // Draw selection past line end characters up to right border bool eolFilled; }; struct CaretLineAppearance { // Colour of caret line ColourAlpha background; // Whether to show the caret line bool show; // Also show when non-focused bool alwaysShow; // Translucency. SC_ALPHA_NOALPHA: draw selection background beneath text int alpha; // Non-0: draw a rectangle around line instead of filling line. Value is pixel width of frame int frame; }; struct CaretAppearance { // Colour of caret ColourAlpha colour; // Colour of additional (non-main) carets ColourAlpha additionalColour; // Line, block, over-strike bar ... int style; // Width in pixels int width; }; struct WrapAppearance { // No wrapping, word, character, whitespace appearance WrapMode state; // Show indication of wrap at line end, line start, or in margin int visualFlags; // Show indication near margin or near text int visualFlagsLocation; // How much indentation to show wrapping int visualStartIndent; // SC_WRAPINDENT_FIXED, _SAME, _INDENT, _DEEPINDENT int indentMode; }; struct EdgeProperties { int column = 0; ColourAlpha colour; EdgeProperties(int column_ = 0, ColourAlpha colour_ = ColourAlpha::FromRGB(0)) noexcept : column(column_), colour(colour_) { } EdgeProperties(uptr_t wParam, sptr_t lParam) noexcept : column(static_cast(wParam)), colour(ColourAlpha::FromRGB(static_cast(lParam))) { } }; /** */ class ViewStyle { UniqueStringSet fontNames; FontMap fonts; public: std::vector