// Scintilla source code edit control /** @file ViewStyle.cxx ** Store information on how the document is to be viewed. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include "Platform.h" #include "Scintilla.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "ViewStyle.h" MarginStyle::MarginStyle() : symbol(false), width(16), mask(0xffffffff), sensitive(false) { } // A list of the fontnames - avoids wasting space in each style FontNames::FontNames() { max = 0; } FontNames::~FontNames() { Clear(); } void FontNames::Clear() { for (int i=0;i 0) maskInLine &= ~ms[margin].mask; } zoomLevel = 0; viewWhitespace = wsInvisible; viewIndentationGuides = false; viewEOL = false; showMarkedLines = true; extraFontFlag = false; } void ViewStyle::RefreshColourPalette(Palette &pal, bool want) { unsigned int i; for (i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) { pal.WantFind(styles[i].fore, want); pal.WantFind(styles[i].back, want); } for (i=0;i<(sizeof(indicators)/sizeof(indicators[0]));i++) { pal.WantFind(indicators[i].fore, want); } for (i=0;i<(sizeof(markers)/sizeof(markers[0]));i++) { markers[i].RefreshColourPalette(pal, want); } pal.WantFind(selforeground, want); pal.WantFind(selbackground, want); pal.WantFind(selbackground2, want); pal.WantFind(foldmarginColour, want); pal.WantFind(foldmarginHighlightColour, want); pal.WantFind(whitespaceForeground, want); pal.WantFind(whitespaceBackground, want); pal.WantFind(selbar, want); pal.WantFind(selbarlight, want); pal.WantFind(caretcolour, want); pal.WantFind(caretLineBackground, want); pal.WantFind(edgecolour, want); pal.WantFind(hotspotForeground, want); pal.WantFind(hotspotBackground, want); } void ViewStyle::Refresh(Surface &surface) { selbar.desired = Platform::Chrome(); selbarlight.desired = Platform::ChromeHighlight(); styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag); maxAscent = styles[STYLE_DEFAULT].ascent; maxDescent = styles[STYLE_DEFAULT].descent; someStylesProtected = false; for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) { if (i != STYLE_DEFAULT) { styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT], extraFontFlag); if (maxAscent < styles[i].ascent) maxAscent = styles[i].ascent; if (maxDescent < styles[i].descent) maxDescent = styles[i].descent; } if (styles[i].IsProtected()) { someStylesProtected = true; } } lineHeight = maxAscent + maxDescent; aveCharWidth = styles[STYLE_DEFAULT].aveCharWidth; spaceWidth = styles[STYLE_DEFAULT].spaceWidth; fixedColumnWidth = leftMarginWidth; symbolMargin = false; maskInLine = 0xffffffff; for (int margin=0; margin < margins; margin++) { fixedColumnWidth += ms[margin].width; symbolMargin = symbolMargin || ms[margin].symbol; if (ms[margin].width > 0) maskInLine &= ~ms[margin].mask; } } void ViewStyle::ResetDefaultStyle() { styles[STYLE_DEFAULT].Clear(ColHTTP/1.1 200 OK Connection: keep-alive Connection: keep-alive Connection: keep-alive Content-Disposition: inline; filename="ViewStyle.cxx" Content-Disposition: inline; filename="ViewStyle.cxx" Content-Disposition: inline; filename="ViewStyle.cxx" Content-Length: 8911 Content-Length: 8911 Content-Length: 8911 Content-Security-Policy: default-src 'none' Content-Security-Policy: default-src 'none' Content-Security-Policy: default-src 'none' Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8 Date: Sat, 18 Oct 2025 02:33:14 UTC ETag: "c52f1e47287a51a1a1ed45acf8a2f54500332a0e" ETag: "c52f1e47287a51a1a1ed45acf8a2f54500332a0e" ETag