64 const int w = ircPlace.
Width() - xa - 1;
66 const bool xStraight = isEndMarker;
68 const int x0 = xStraight ? ircPlace.
left : ircPlace.
right - 1;
69 const int y0 = ircPlace.
top;
71 const int dy = ircPlace.
Height() / 5;
72 const int y = ircPlace.
Height() / 2 + dy;
80 void MoveTo(
int xRelative,
int yRelative) {
81 surface->
MoveTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
83 void LineTo(
int xRelative,
int yRelative) {
84 surface->
LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
87 Relative rel = { surface, x0, xStraight ? 1 : -1, y0, 1 };
91 rel.LineTo(xa + 2 * w / 3, y - dy);
93 rel.LineTo(xa + 2 * w / 3, y + dy);
97 rel.LineTo(xa + w, y);
98 rel.LineTo(xa + w, y - 2 * dy);
134 const int patternSize = 8;
164 for (
int y = 0; y < patternSize; y++) {
165 for (
int x = y % 2; x < patternSize; x += 2) {
176 return markerDefault;
190 for (
size_t margin = 0; margin < vs.
ms.size(); margin++) {
191 if (vs.
ms[margin].width > 0) {
194 rcSelMargin.
right = rcSelMargin.
left + vs.
ms[margin].width;
201 const bool invertPhase =
static_cast<int>(ptOrigin.
y) & 1;
206 switch (vs.
ms[margin].style) {
214 colour = vs.
ms[margin].back;
226 const int lineStartPaint =
static_cast<int>(rcMargin.
top + ptOrigin.
y) / vs.
lineHeight;
232 bool needWhiteClosure =
false;
234 const int level = model.
pdoc->
GetLevel(model.
pcs->DocFromDisplay(visibleLine));
236 Sci::Line lineBack = model.
pcs->DocFromDisplay(visibleLine);
237 int levelPrev = level;
244 needWhiteClosure =
true;
260 while ((visibleLine < model.pcs->LinesDisplayed()) && yposScreen < rc.
bottom) {
263 const Sci::Line lineDoc = model.
pcs->DocFromDisplay(visibleLine);
265 const Sci::Line firstVisibleLine = model.
pcs->DisplayFromDoc(lineDoc);
266 const Sci::Line lastVisibleLine = model.
pcs->DisplayLastFromDoc(lineDoc);
267 const bool firstSubLine = visibleLine == firstVisibleLine;
268 const bool lastSubLine = visibleLine == lastVisibleLine;
274 bool headWithTail =
false;
279 const int levelNext = model.
pdoc->
GetLevel(lineDoc + 1);
284 if (levelNum < levelNextNum) {
285 if (model.
pcs->GetExpanded(lineDoc)) {
289 marks |= 1 << folderOpenMid;
294 marks |= 1 << folderEnd;
300 if (levelNum < levelNextNum) {
301 if (model.
pcs->GetExpanded(lineDoc)) {
310 needWhiteClosure =
false;
311 const Sci::Line firstFollowupLine = model.
pcs->DocFromDisplay(model.
pcs->DisplayFromDoc(lineDoc + 1));
312 const int firstFollowupLineLevel = model.
pdoc->
GetLevel(firstFollowupLine);
314 if (!model.
pcs->GetExpanded(lineDoc)) {
316 (levelNum > secondFollowupLineLevelNum))
317 needWhiteClosure =
true;
323 if (needWhiteClosure) {
328 needWhiteClosure =
false;
331 needWhiteClosure =
false;
334 if (levelNextNum < levelNum) {
345 if (levelNextNum < levelNum) {
346 needWhiteClosure =
false;
349 needWhiteClosure =
true;
350 }
else if (lastSubLine) {
365 marks &= vs.
ms[margin].mask;
376 sNumber = std::to_string(lineDoc + 1);
379 char number[100] =
"";
382 sprintf(number,
"%c%c %03X %03X",
390 sprintf(number,
"%0X", state);
396 const XYPOSITION width = surface->
WidthText(fontLineNumber, sNumber.c_str(),
static_cast<int>(sNumber.length()));
398 rcNumber.
left = xpos;
400 rcNumber.
top + vs.
maxAscent, sNumber.c_str(),
static_cast<int>(sNumber.length()),
drawAll);
427 if (annotationLines && (visibleLine > lastVisibleLine - annotationLines)) {
435 for (
int markBit = 0; (markBit < 32) && marks; markBit++) {
445 if (model.
pcs->GetExpanded(lineDoc) || headWithTail) {
455 vs.
markers[markBit].Draw(surface, rcMarker, fontLineNumber, part, vs.
ms[margin].style);
Classes for case folding.
Manages the text of the document.
Character classifications used by Document and RESearch.
Returns the Unicode general category of a character.
Manages visibility of lines for folding and wrapping.
Visual elements added over text.
Text document that handles notifications, DBCS, styling, words and end of line.
Defines the editor state that must be visible to EditorView.
Defines the appearance of the main text area of the editor window.
Interface between Scintilla and lexers.
Interface for loading into a Scintilla document from a background thread.
Defines the style of indicators which are text decorations such as underlining.
A rectangle with integer coordinates.
Defines a mapping between keystrokes and commands.
Defines the look of a line marker in the margin .
Defines the appearance of the editor margin.
Data structure used to partition an interval.
Classes for caching layout information.
Defines global type name Position in the Sci internal namespace.
Data structure used to store sparse styles.
Interface to the edit control.
#define SC_MARKNUM_FOLDEREND
#define SC_MARKNUM_FOLDER
#define SC_MARKNUM_FOLDERTAIL
#define SC_MARKNUM_FOLDERMIDTAIL
#define SC_MARKNUM_FOLDEROPEN
#define SC_FOLDFLAG_LEVELNUMBERS
#define SC_FOLDLEVELWHITEFLAG
#define SC_FOLDFLAG_LINESTATE
#define SC_MARKNUM_FOLDEROPENMID
#define SC_FOLDLEVELHEADERFLAG
#define SC_MARKNUM_FOLDERSUB
#define SC_WRAPVISUALFLAG_MARGIN
Classes maintaining the selection.
Main data structure for holding arrays that handle insertions and deletions efficiently.
Defines the font and colour style for a class of text.
Functions to handle UTF-8 and UTF-16 strings.
Define UniqueString, a unique_ptr based string type for storage in containers and an allocator for Un...
Store information on how the document is to be viewed.
Sci::Line SciLineFromPosition(Sci::Position pos) const noexcept
int SCI_METHOD GetLineState(Sci_Position line) const override
int AnnotationLines(Sci::Line line) const noexcept
int SCI_METHOD GetLevel(Sci_Position line) const override
StyledText MarginStyledText(Sci::Line line) const noexcept
int GetMark(Sci::Line line) const noexcept
void GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine)
virtual Sci::Line TopLineOfMain() const =0
virtual Sci::Line LinesOnScreen() const =0
std::unique_ptr< IContractionState > pcs
virtual Point GetVisibleOriginInMain() const =0
bool IsBodyOfFoldBlock(Sci::Line line) const noexcept
bool IsHeadOfFoldBlock(Sci::Line line) const noexcept
bool IsFoldBlockHighlighted(Sci::Line line) const noexcept
bool IsTailOfFoldBlock(Sci::Line line) const noexcept
void AllocateGraphics(const ViewStyle &vsDraw)
DrawWrapMarkerFn customDrawWrapMarker
Some platforms, notably PLAT_CURSES, do not support Scintilla's native DrawWrapMarker function for dr...
std::unique_ptr< Surface > pixmapSelMargin
std::unique_ptr< Surface > pixmapSelPattern
void DropGraphics(bool freeObjects)
std::unique_ptr< Surface > pixmapSelPatternOffset1
void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw)
void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, const EditModel &model, const ViewStyle &vs)
HighlightDelimiter highlightDelimiter
int wrapMarkerPaddingRight
A geometric rectangle class.
static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept
Sci::Position MainCaret() const noexcept
A surface abstracts a place to draw.
static Surface * Allocate(int technology)
virtual void PenColour(ColourDesired fore)=0
virtual void MoveTo(int x_, int y_)=0
virtual void LineTo(int x_, int y_)=0
virtual void FillRectangle(PRectangle rc, ColourDesired back)=0
virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0
ColourOptional foldmarginHighlightColour
std::vector< Style > styles
std::vector< LineMarker > markers
std::vector< MarginStyle > ms
ColourDesired selbarlight
ColourOptional foldmarginColour
Styling buffer using one element for each run rather than using a filled buffer.
static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) noexcept
void DrawTextNoClipPhase(Surface *surface, PRectangle rc, const Style &style, XYPOSITION ybase, const char *s, int len, DrawPhase phase)
bool ValidStyledText(const ViewStyle &vs, size_t styleOffset, const StyledText &st) noexcept
void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText, const StyledText &st, size_t start, size_t length, DrawPhase phase)
int WidestLineWidth(Surface *surface, const ViewStyle &vs, int styleOffset, const StyledText &st)
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour)
constexpr int LevelNumber(int level) noexcept
int Width() const noexcept
int Height() const noexcept
size_t StyleAt(size_t i) const noexcept