geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

MarginView.cxx
Go to the documentation of this file.
1// Scintilla source code edit control
2/** @file MarginView.cxx
3 ** Defines the appearance of the editor margin.
4 **/
5// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
6// The License.txt file describes the conditions under which this software may be distributed.
7
8#include <cstddef>
9#include <cstdlib>
10#include <cassert>
11#include <cstring>
12#include <cstdio>
13#include <cmath>
14
15#include <stdexcept>
16#include <string>
17#include <vector>
18#include <map>
19#include <algorithm>
20#include <memory>
21
22#include "Platform.h"
23
24#include "ILoader.h"
25#include "ILexer.h"
26#include "Scintilla.h"
27
28#include "CharacterCategory.h"
29#include "Position.h"
30#include "IntegerRectangle.h"
31#include "UniqueString.h"
32#include "SplitVector.h"
33#include "Partitioning.h"
34#include "RunStyles.h"
35#include "ContractionState.h"
36#include "CellBuffer.h"
37#include "KeyMap.h"
38#include "Indicator.h"
39#include "LineMarker.h"
40#include "Style.h"
41#include "ViewStyle.h"
42#include "CharClassify.h"
43#include "Decoration.h"
44#include "CaseFolder.h"
45#include "Document.h"
46#include "UniConversion.h"
47#include "Selection.h"
48#include "PositionCache.h"
49#include "EditModel.h"
50#include "MarginView.h"
51#include "EditView.h"
52
53using namespace Scintilla;
54
55namespace Scintilla {
56
57void DrawWrapMarker(Surface *surface, PRectangle rcPlace,
58 bool isEndMarker, ColourDesired wrapColour) {
59 surface->PenColour(wrapColour);
60
61 const IntegerRectangle ircPlace(rcPlace);
62
63 enum { xa = 1 }; // gap before start
64 const int w = ircPlace.Width() - xa - 1;
65
66 const bool xStraight = isEndMarker; // x-mirrored symbol for start marker
67
68 const int x0 = xStraight ? ircPlace.left : ircPlace.right - 1;
69 const int y0 = ircPlace.top;
70
71 const int dy = ircPlace.Height() / 5;
72 const int y = ircPlace.Height() / 2 + dy;
73
74 struct Relative {
75 Surface *surface;
76 int xBase;
77 int xDir;
78 int yBase;
79 int yDir;
80 void MoveTo(int xRelative, int yRelative) {
81 surface->MoveTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
82 }
83 void LineTo(int xRelative, int yRelative) {
84 surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
85 }
86 };
87 Relative rel = { surface, x0, xStraight ? 1 : -1, y0, 1 };
88
89 // arrow head
90 rel.MoveTo(xa, y);
91 rel.LineTo(xa + 2 * w / 3, y - dy);
92 rel.MoveTo(xa, y);
93 rel.LineTo(xa + 2 * w / 3, y + dy);
94
95 // arrow body
96 rel.MoveTo(xa, y);
97 rel.LineTo(xa + w, y);
98 rel.LineTo(xa + w, y - 2 * dy);
99 rel.LineTo(xa - 1, // on windows lineto is exclusive endpoint, perhaps GTK not...
100 y - 2 * dy);
101}
102
105 customDrawWrapMarker = nullptr;
106}
107
108void MarginView::DropGraphics(bool freeObjects) {
109 if (freeObjects) {
110 pixmapSelMargin.reset();
111 pixmapSelPattern.reset();
113 } else {
114 if (pixmapSelMargin)
115 pixmapSelMargin->Release();
117 pixmapSelPattern->Release();
119 pixmapSelPatternOffset1->Release();
120 }
121}
122
124 if (!pixmapSelMargin)
126 if (!pixmapSelPattern)
130}
131
132void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw) {
133 if (!pixmapSelPattern->Initialised()) {
134 const int patternSize = 8;
135 pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow, wid);
136 pixmapSelPatternOffset1->InitPixMap(patternSize, patternSize, surfaceWindow, wid);
137 // This complex procedure is to reproduce the checkerboard dithered pattern used by windows
138 // for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half
139 // way between the chrome colour and the chrome highlight colour making a nice transition
140 // between the window chrome and the content area. And it works in low colour depths.
141 const PRectangle rcPattern = PRectangle::FromInts(0, 0, patternSize, patternSize);
142
143 // Initialize default colours based on the chrome colour scheme. Typically the highlight is white.
144 ColourDesired colourFMFill = vsDraw.selbar;
145 ColourDesired colourFMStripes = vsDraw.selbarlight;
146
147 if (!(vsDraw.selbarlight == ColourDesired(0xff, 0xff, 0xff))) {
148 // User has chosen an unusual chrome colour scheme so just use the highlight edge colour.
149 // (Typically, the highlight colour is white.)
150 colourFMFill = vsDraw.selbarlight;
151 }
152
153 if (vsDraw.foldmarginColour.isSet) {
154 // override default fold margin colour
155 colourFMFill = vsDraw.foldmarginColour;
156 }
157 if (vsDraw.foldmarginHighlightColour.isSet) {
158 // override default fold margin highlight colour
159 colourFMStripes = vsDraw.foldmarginHighlightColour;
160 }
161
162 pixmapSelPattern->FillRectangle(rcPattern, colourFMFill);
163 pixmapSelPatternOffset1->FillRectangle(rcPattern, colourFMStripes);
164 for (int y = 0; y < patternSize; y++) {
165 for (int x = y % 2; x < patternSize; x += 2) {
166 const PRectangle rcPixel = PRectangle::FromInts(x, y, x + 1, y + 1);
167 pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes);
168 pixmapSelPatternOffset1->FillRectangle(rcPixel, colourFMFill);
169 }
170 }
171 }
172}
173
174static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) noexcept {
175 if (vs.markers[markerCheck].markType == SC_MARK_EMPTY)
176 return markerDefault;
177 return markerCheck;
178}
179
180void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin,
181 const EditModel &model, const ViewStyle &vs) {
182
183 PRectangle rcSelMargin = rcMargin;
184 rcSelMargin.right = rcMargin.left;
185 if (rcSelMargin.bottom < rc.bottom)
186 rcSelMargin.bottom = rc.bottom;
187
188 const Point ptOrigin = model.GetVisibleOriginInMain();
189 FontAlias fontLineNumber = vs.styles[STYLE_LINENUMBER].font;
190 for (size_t margin = 0; margin < vs.ms.size(); margin++) {
191 if (vs.ms[margin].width > 0) {
192
193 rcSelMargin.left = rcSelMargin.right;
194 rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width;
195
196 if (vs.ms[margin].style != SC_MARGIN_NUMBER) {
197 if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
198 // Required because of special way brush is created for selection margin
199 // Ensure patterns line up when scrolling with separate margin view
200 // by choosing correctly aligned variant.
201 const bool invertPhase = static_cast<int>(ptOrigin.y) & 1;
202 surface->FillRectangle(rcSelMargin,
203 invertPhase ? *pixmapSelPattern : *pixmapSelPatternOffset1);
204 } else {
205 ColourDesired colour;
206 switch (vs.ms[margin].style) {
207 case SC_MARGIN_BACK:
208 colour = vs.styles[STYLE_DEFAULT].back;
209 break;
210 case SC_MARGIN_FORE:
211 colour = vs.styles[STYLE_DEFAULT].fore;
212 break;
213 case SC_MARGIN_COLOUR:
214 colour = vs.ms[margin].back;
215 break;
216 default:
217 colour = vs.styles[STYLE_LINENUMBER].back;
218 break;
219 }
220 surface->FillRectangle(rcSelMargin, colour);
221 }
222 } else {
223 surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back);
224 }
225
226 const int lineStartPaint = static_cast<int>(rcMargin.top + ptOrigin.y) / vs.lineHeight;
227 Sci::Line visibleLine = model.TopLineOfMain() + lineStartPaint;
228 Sci::Position yposScreen = lineStartPaint * vs.lineHeight - static_cast<Sci::Position>(ptOrigin.y);
229 // Work out whether the top line is whitespace located after a
230 // lessening of fold level which implies a 'fold tail' but which should not
231 // be displayed until the last of a sequence of whitespace.
232 bool needWhiteClosure = false;
233 if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
234 const int level = model.pdoc->GetLevel(model.pcs->DocFromDisplay(visibleLine));
235 if (level & SC_FOLDLEVELWHITEFLAG) {
236 Sci::Line lineBack = model.pcs->DocFromDisplay(visibleLine);
237 int levelPrev = level;
238 while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) {
239 lineBack--;
240 levelPrev = model.pdoc->GetLevel(lineBack);
241 }
242 if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
243 if (LevelNumber(level) < LevelNumber(levelPrev))
244 needWhiteClosure = true;
245 }
246 }
248 const Sci::Line lastLine = model.pcs->DocFromDisplay(topLine + model.LinesOnScreen()) + 1;
250 model.pdoc->SciLineFromPosition(model.sel.MainCaret()), lastLine);
251 }
252 }
253
254 // Old code does not know about new markers needed to distinguish all cases
255 const int folderOpenMid = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEROPENMID,
257 const int folderEnd = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEREND,
259
260 while ((visibleLine < model.pcs->LinesDisplayed()) && yposScreen < rc.bottom) {
261
262 PLATFORM_ASSERT(visibleLine < model.pcs->LinesDisplayed());
263 const Sci::Line lineDoc = model.pcs->DocFromDisplay(visibleLine);
264 PLATFORM_ASSERT(model.pcs->GetVisible(lineDoc));
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;
269
270 int marks = model.pdoc->GetMark(lineDoc);
271 if (!firstSubLine)
272 marks = 0;
273
274 bool headWithTail = false;
275
276 if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
277 // Decide which fold indicator should be displayed
278 const int level = model.pdoc->GetLevel(lineDoc);
279 const int levelNext = model.pdoc->GetLevel(lineDoc + 1);
280 const int levelNum = LevelNumber(level);
281 const int levelNextNum = LevelNumber(levelNext);
282 if (level & SC_FOLDLEVELHEADERFLAG) {
283 if (firstSubLine) {
284 if (levelNum < levelNextNum) {
285 if (model.pcs->GetExpanded(lineDoc)) {
286 if (levelNum == SC_FOLDLEVELBASE)
287 marks |= 1 << SC_MARKNUM_FOLDEROPEN;
288 else
289 marks |= 1 << folderOpenMid;
290 } else {
291 if (levelNum == SC_FOLDLEVELBASE)
292 marks |= 1 << SC_MARKNUM_FOLDER;
293 else
294 marks |= 1 << folderEnd;
295 }
296 } else if (levelNum > SC_FOLDLEVELBASE) {
297 marks |= 1 << SC_MARKNUM_FOLDERSUB;
298 }
299 } else {
300 if (levelNum < levelNextNum) {
301 if (model.pcs->GetExpanded(lineDoc)) {
302 marks |= 1 << SC_MARKNUM_FOLDERSUB;
303 } else if (levelNum > SC_FOLDLEVELBASE) {
304 marks |= 1 << SC_MARKNUM_FOLDERSUB;
305 }
306 } else if (levelNum > SC_FOLDLEVELBASE) {
307 marks |= 1 << SC_MARKNUM_FOLDERSUB;
308 }
309 }
310 needWhiteClosure = false;
311 const Sci::Line firstFollowupLine = model.pcs->DocFromDisplay(model.pcs->DisplayFromDoc(lineDoc + 1));
312 const int firstFollowupLineLevel = model.pdoc->GetLevel(firstFollowupLine);
313 const int secondFollowupLineLevelNum = LevelNumber(model.pdoc->GetLevel(firstFollowupLine + 1));
314 if (!model.pcs->GetExpanded(lineDoc)) {
315 if ((firstFollowupLineLevel & SC_FOLDLEVELWHITEFLAG) &&
316 (levelNum > secondFollowupLineLevelNum))
317 needWhiteClosure = true;
318
319 if (highlightDelimiter.IsFoldBlockHighlighted(firstFollowupLine))
320 headWithTail = true;
321 }
322 } else if (level & SC_FOLDLEVELWHITEFLAG) {
323 if (needWhiteClosure) {
324 if (levelNext & SC_FOLDLEVELWHITEFLAG) {
325 marks |= 1 << SC_MARKNUM_FOLDERSUB;
326 } else if (levelNextNum > SC_FOLDLEVELBASE) {
327 marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
328 needWhiteClosure = false;
329 } else {
330 marks |= 1 << SC_MARKNUM_FOLDERTAIL;
331 needWhiteClosure = false;
332 }
333 } else if (levelNum > SC_FOLDLEVELBASE) {
334 if (levelNextNum < levelNum) {
335 if (levelNextNum > SC_FOLDLEVELBASE) {
336 marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
337 } else {
338 marks |= 1 << SC_MARKNUM_FOLDERTAIL;
339 }
340 } else {
341 marks |= 1 << SC_MARKNUM_FOLDERSUB;
342 }
343 }
344 } else if (levelNum > SC_FOLDLEVELBASE) {
345 if (levelNextNum < levelNum) {
346 needWhiteClosure = false;
347 if (levelNext & SC_FOLDLEVELWHITEFLAG) {
348 marks |= 1 << SC_MARKNUM_FOLDERSUB;
349 needWhiteClosure = true;
350 } else if (lastSubLine) {
351 if (levelNextNum > SC_FOLDLEVELBASE) {
352 marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
353 } else {
354 marks |= 1 << SC_MARKNUM_FOLDERTAIL;
355 }
356 } else {
357 marks |= 1 << SC_MARKNUM_FOLDERSUB;
358 }
359 } else {
360 marks |= 1 << SC_MARKNUM_FOLDERSUB;
361 }
362 }
363 }
364
365 marks &= vs.ms[margin].mask;
366
367 PRectangle rcMarker(
368 rcSelMargin.left,
369 static_cast<XYPOSITION>(yposScreen),
370 rcSelMargin.right,
371 static_cast<XYPOSITION>(yposScreen + vs.lineHeight));
372 if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
373 if (firstSubLine) {
374 std::string sNumber;
375 if (lineDoc >= 0) {
376 sNumber = std::to_string(lineDoc + 1);
377 }
379 char number[100] = "";
381 const int lev = model.pdoc->GetLevel(lineDoc);
382 sprintf(number, "%c%c %03X %03X",
383 (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
384 (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
385 LevelNumber(lev),
386 lev >> 16
387 );
388 } else {
389 const int state = model.pdoc->GetLineState(lineDoc);
390 sprintf(number, "%0X", state);
391 }
392 sNumber = number;
393 }
394 PRectangle rcNumber = rcMarker;
395 // Right justify
396 const XYPOSITION width = surface->WidthText(fontLineNumber, sNumber.c_str(), static_cast<int>(sNumber.length()));
397 const XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding;
398 rcNumber.left = xpos;
399 DrawTextNoClipPhase(surface, rcNumber, vs.styles[STYLE_LINENUMBER],
400 rcNumber.top + vs.maxAscent, sNumber.c_str(), static_cast<int>(sNumber.length()), drawAll);
402 PRectangle rcWrapMarker = rcMarker;
403 rcWrapMarker.right -= wrapMarkerPaddingRight;
404 rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth;
406 DrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
407 } else {
408 customDrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
409 }
410 }
411 } else if (vs.ms[margin].style == SC_MARGIN_TEXT || vs.ms[margin].style == SC_MARGIN_RTEXT) {
412 const StyledText stMargin = model.pdoc->MarginStyledText(lineDoc);
413 if (stMargin.text && ValidStyledText(vs, vs.marginStyleOffset, stMargin)) {
414 if (firstSubLine) {
415 surface->FillRectangle(rcMarker,
416 vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
417 PRectangle rcText = rcMarker;
418 if (vs.ms[margin].style == SC_MARGIN_RTEXT) {
419 const int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);
420 rcText.left = rcText.right - width - 3;
421 }
422 DrawStyledText(surface, vs, vs.marginStyleOffset, rcText,
423 stMargin, 0, stMargin.length, drawAll);
424 } else {
425 // if we're displaying annotation lines, colour the margin to match the associated document line
426 const int annotationLines = model.pdoc->AnnotationLines(lineDoc);
427 if (annotationLines && (visibleLine > lastVisibleLine - annotationLines)) {
428 surface->FillRectangle(rcMarker, vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
429 }
430 }
431 }
432 }
433
434 if (marks) {
435 for (int markBit = 0; (markBit < 32) && marks; markBit++) {
436 if (marks & 1) {
438 if ((vs.ms[margin].mask & SC_MASK_FOLDERS) && highlightDelimiter.IsFoldBlockHighlighted(lineDoc)) {
441 } else if (highlightDelimiter.IsHeadOfFoldBlock(lineDoc)) {
442 if (firstSubLine) {
444 } else {
445 if (model.pcs->GetExpanded(lineDoc) || headWithTail) {
447 } else {
449 }
450 }
451 } else if (highlightDelimiter.IsTailOfFoldBlock(lineDoc)) {
453 }
454 }
455 vs.markers[markBit].Draw(surface, rcMarker, fontLineNumber, part, vs.ms[margin].style);
456 }
457 marks >>= 1;
458 }
459 }
460
461 visibleLine++;
462 yposScreen += vs.lineHeight;
463 }
464 }
465 }
466
467 PRectangle rcBlankMargin = rcMargin;
468 rcBlankMargin.left = rcSelMargin.right;
469 surface->FillRectangle(rcBlankMargin, vs.styles[STYLE_DEFAULT].back);
470}
471
472}
473
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.
Interface to platform facilities.
#define PLATFORM_ASSERT(c)
Definition: Platform.h:544
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
Definition: Scintilla.h:153
#define SC_MARK_EMPTY
Definition: Scintilla.h:124
#define SC_MARKNUM_FOLDER
Definition: Scintilla.h:158
#define SC_MARKNUM_FOLDERTAIL
Definition: Scintilla.h:156
#define SC_MARGIN_TEXT
Definition: Scintilla.h:180
#define SC_MARGIN_NUMBER
Definition: Scintilla.h:177
#define SC_MARGIN_RTEXT
Definition: Scintilla.h:181
#define SC_MARKNUM_FOLDERMIDTAIL
Definition: Scintilla.h:155
#define SC_MARKNUM_FOLDEROPEN
Definition: Scintilla.h:159
#define SC_FOLDFLAG_LEVELNUMBERS
Definition: Scintilla.h:534
#define SC_MARGIN_BACK
Definition: Scintilla.h:178
#define STYLE_DEFAULT
Definition: Scintilla.h:197
#define SC_FOLDLEVELWHITEFLAG
Definition: Scintilla.h:495
#define SC_FOLDLEVELBASE
Definition: Scintilla.h:494
#define SC_FOLDFLAG_LINESTATE
Definition: Scintilla.h:535
#define SC_MARKNUM_FOLDEROPENMID
Definition: Scintilla.h:154
#define SC_MARGIN_FORE
Definition: Scintilla.h:179
#define SC_MARGIN_COLOUR
Definition: Scintilla.h:182
#define SC_FOLDLEVELHEADERFLAG
Definition: Scintilla.h:496
#define SC_MASK_FOLDERS
Definition: Scintilla.h:160
#define SC_MARKNUM_FOLDERSUB
Definition: Scintilla.h:157
#define SC_WRAPVISUALFLAG_MARGIN
Definition: Scintilla.h:563
#define STYLE_LINENUMBER
Definition: Scintilla.h:198
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
Definition: Document.cxx:441
int SCI_METHOD GetLineState(Sci_Position line) const override
Definition: Document.cxx:2306
int AnnotationLines(Sci::Line line) const noexcept
Definition: Document.cxx:2386
int SCI_METHOD GetLevel(Sci_Position line) const override
Definition: Document.cxx:491
StyledText MarginStyledText(Sci::Line line) const noexcept
Definition: Document.cxx:2320
int GetMark(Sci::Line line) const noexcept
Definition: Document.cxx:325
void GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine)
Definition: Document.cxx:548
virtual Sci::Line TopLineOfMain() const =0
virtual Sci::Line LinesOnScreen() const =0
Document * pdoc
Definition: EditModel.h:53
std::unique_ptr< IContractionState > pcs
Definition: EditModel.h:45
virtual Point GetVisibleOriginInMain() const =0
bool IsBodyOfFoldBlock(Sci::Line line) const noexcept
Definition: Document.h:152
bool IsHeadOfFoldBlock(Sci::Line line) const noexcept
Definition: Document.h:148
bool IsFoldBlockHighlighted(Sci::Line line) const noexcept
Definition: Document.h:144
bool IsTailOfFoldBlock(Sci::Line line) const noexcept
Definition: Document.h:156
void AllocateGraphics(const ViewStyle &vsDraw)
Definition: MarginView.cxx:123
DrawWrapMarkerFn customDrawWrapMarker
Some platforms, notably PLAT_CURSES, do not support Scintilla's native DrawWrapMarker function for dr...
Definition: MarginView.h:33
std::unique_ptr< Surface > pixmapSelMargin
Definition: MarginView.h:22
std::unique_ptr< Surface > pixmapSelPattern
Definition: MarginView.h:23
void DropGraphics(bool freeObjects)
Definition: MarginView.cxx:108
std::unique_ptr< Surface > pixmapSelPatternOffset1
Definition: MarginView.h:24
void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw)
Definition: MarginView.cxx:132
void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, const EditModel &model, const ViewStyle &vs)
Definition: MarginView.cxx:180
HighlightDelimiter highlightDelimiter
Definition: MarginView.h:26
A geometric rectangle class.
Definition: Platform.h:131
static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept
Definition: Platform.h:142
XYPOSITION right
Definition: Platform.h:135
XYPOSITION bottom
Definition: Platform.h:136
A geometric point class.
Definition: Platform.h:99
XYPOSITION y
Definition: Platform.h:102
Sci::Position MainCaret() const noexcept
Definition: Selection.cxx:204
A surface abstracts a place to draw.
Definition: Platform.h:340
static Surface * Allocate(int technology)
Definition: PlatGTK.cxx:964
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
Definition: ViewStyle.h:112
std::vector< Style > styles
Definition: ViewStyle.h:84
std::vector< LineMarker > markers
Definition: ViewStyle.h:86
unsigned int maxAscent
Definition: ViewStyle.h:94
ColourDesired selbar
Definition: ViewStyle.h:109
std::vector< MarginStyle > ms
Definition: ViewStyle.h:121
ColourDesired selbarlight
Definition: ViewStyle.h:110
ColourOptional foldmarginColour
Definition: ViewStyle.h:111
ptrdiff_t Position
Definition: Position.h:19
ptrdiff_t Line
Definition: Position.h:20
Styling buffer using one element for each run rather than using a filled buffer.
Definition: Converter.h:9
static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) noexcept
Definition: MarginView.cxx:174
void DrawTextNoClipPhase(Surface *surface, PRectangle rc, const Style &style, XYPOSITION ybase, const char *s, int len, DrawPhase phase)
Definition: EditView.cxx:119
float XYPOSITION
Definition: Platform.h:81
bool ValidStyledText(const ViewStyle &vs, size_t styleOffset, const StyledText &st) noexcept
Definition: EditView.cxx:69
void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText, const StyledText &st, size_t start, size_t length, DrawPhase phase)
Definition: EditView.cxx:135
@ drawAll
Definition: EditView.h:33
void * WindowID
Definition: Platform.h:89
int WidestLineWidth(Surface *surface, const ViewStyle &vs, int styleOffset, const StyledText &st)
Definition: EditView.cxx:99
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour)
Definition: MarginView.cxx:57
constexpr int LevelNumber(int level) noexcept
Definition: Document.h:167
int Width() const noexcept
int Height() const noexcept
size_t StyleAt(size_t i) const noexcept
Definition: Document.h:122
const char * text
Definition: Document.h:107