2009-04-25 01:35:41 +02:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file ViewStyle.h
|
|
|
|
** Store information on how the document is to be viewed.
|
|
|
|
**/
|
|
|
|
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
|
|
|
#ifndef VIEWSTYLE_H
|
|
|
|
#define VIEWSTYLE_H
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
namespace Scintilla {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class MarginStyle {
|
|
|
|
public:
|
|
|
|
int style;
|
|
|
|
int width;
|
|
|
|
int mask;
|
|
|
|
bool sensitive;
|
2011-03-22 01:16:49 +01:00
|
|
|
int cursor;
|
2009-04-25 01:35:41 +02:00
|
|
|
MarginStyle();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class FontNames {
|
|
|
|
private:
|
|
|
|
char **names;
|
|
|
|
int size;
|
|
|
|
int max;
|
|
|
|
|
|
|
|
public:
|
|
|
|
FontNames();
|
|
|
|
~FontNames();
|
|
|
|
void Clear();
|
|
|
|
const char *Save(const char *name);
|
|
|
|
};
|
|
|
|
|
|
|
|
enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth};
|
|
|
|
|
|
|
|
enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class ViewStyle {
|
|
|
|
public:
|
|
|
|
FontNames fontNames;
|
|
|
|
size_t stylesSize;
|
|
|
|
Style *styles;
|
|
|
|
LineMarker markers[MARKER_MAX + 1];
|
|
|
|
Indicator indicators[INDIC_MAX + 1];
|
|
|
|
int lineHeight;
|
|
|
|
unsigned int maxAscent;
|
|
|
|
unsigned int maxDescent;
|
|
|
|
unsigned int aveCharWidth;
|
|
|
|
unsigned int spaceWidth;
|
|
|
|
bool selforeset;
|
|
|
|
ColourPair selforeground;
|
2009-08-23 04:24:48 +02:00
|
|
|
ColourPair selAdditionalForeground;
|
2009-04-25 01:35:41 +02:00
|
|
|
bool selbackset;
|
|
|
|
ColourPair selbackground;
|
2009-08-23 04:24:48 +02:00
|
|
|
ColourPair selAdditionalBackground;
|
2009-04-25 01:35:41 +02:00
|
|
|
ColourPair selbackground2;
|
|
|
|
int selAlpha;
|
2009-08-23 04:24:48 +02:00
|
|
|
int selAdditionalAlpha;
|
2009-04-25 01:35:41 +02:00
|
|
|
bool selEOLFilled;
|
|
|
|
bool whitespaceForegroundSet;
|
|
|
|
ColourPair whitespaceForeground;
|
|
|
|
bool whitespaceBackgroundSet;
|
|
|
|
ColourPair whitespaceBackground;
|
|
|
|
ColourPair selbar;
|
|
|
|
ColourPair selbarlight;
|
|
|
|
bool foldmarginColourSet;
|
|
|
|
ColourPair foldmarginColour;
|
|
|
|
bool foldmarginHighlightColourSet;
|
|
|
|
ColourPair foldmarginHighlightColour;
|
|
|
|
bool hotspotForegroundSet;
|
|
|
|
ColourPair hotspotForeground;
|
|
|
|
bool hotspotBackgroundSet;
|
|
|
|
ColourPair hotspotBackground;
|
|
|
|
bool hotspotUnderline;
|
|
|
|
bool hotspotSingleLine;
|
|
|
|
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
|
|
|
|
enum { margins=5 };
|
|
|
|
int leftMarginWidth; ///< Spacing margin on left of text
|
|
|
|
int rightMarginWidth; ///< Spacing margin on left of text
|
|
|
|
bool symbolMargin;
|
|
|
|
int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
|
|
|
|
MarginStyle ms[margins];
|
|
|
|
int fixedColumnWidth;
|
|
|
|
int zoomLevel;
|
|
|
|
WhiteSpaceVisibility viewWhitespace;
|
2010-07-13 00:19:51 +02:00
|
|
|
int whitespaceSize;
|
2009-04-25 01:35:41 +02:00
|
|
|
IndentView viewIndentationGuides;
|
|
|
|
bool viewEOL;
|
|
|
|
bool showMarkedLines;
|
|
|
|
ColourPair caretcolour;
|
2009-08-23 04:24:48 +02:00
|
|
|
ColourPair additionalCaretColour;
|
2009-04-25 01:35:41 +02:00
|
|
|
bool showCaretLineBackground;
|
2010-07-13 00:19:51 +02:00
|
|
|
bool showCaretLineBackgroundAlways;
|
2009-04-25 01:35:41 +02:00
|
|
|
ColourPair caretLineBackground;
|
|
|
|
int caretLineAlpha;
|
|
|
|
ColourPair edgecolour;
|
|
|
|
int edgeState;
|
|
|
|
int caretStyle;
|
|
|
|
int caretWidth;
|
|
|
|
bool someStylesProtected;
|
2011-03-22 01:16:49 +01:00
|
|
|
bool someStylesForceCase;
|
2010-07-13 00:19:51 +02:00
|
|
|
int extraFontFlag;
|
2009-06-24 21:09:31 +02:00
|
|
|
int extraAscent;
|
|
|
|
int extraDescent;
|
|
|
|
int marginStyleOffset;
|
|
|
|
int annotationVisible;
|
|
|
|
int annotationStyleOffset;
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
ViewStyle();
|
|
|
|
ViewStyle(const ViewStyle &source);
|
|
|
|
~ViewStyle();
|
|
|
|
void Init(size_t stylesSize_=64);
|
|
|
|
void RefreshColourPalette(Palette &pal, bool want);
|
|
|
|
void Refresh(Surface &surface);
|
|
|
|
void AllocStyles(size_t sizeNew);
|
|
|
|
void EnsureStyle(size_t index);
|
|
|
|
void ResetDefaultStyle();
|
|
|
|
void ClearStyles();
|
|
|
|
void SetStyleFontName(int styleIndex, const char *name);
|
|
|
|
bool ProtectionActive() const;
|
2009-06-24 21:09:31 +02:00
|
|
|
bool ValidStyle(size_t styleIndex) const;
|
2009-04-25 01:35:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|