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)  

LineMarker.cxx
Go to the documentation of this file.
1// Scintilla source code edit control
2/** @file LineMarker.cxx
3 ** Defines the look of a line marker in the margin.
4 **/
5// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
6// The License.txt file describes the conditions under which this software may be distributed.
7
8#include <cstring>
9#include <cmath>
10
11#include <stdexcept>
12#include <vector>
13#include <map>
14#include <algorithm>
15#include <memory>
16
17#include "Platform.h"
18
19#include "Scintilla.h"
20
21#include "IntegerRectangle.h"
22#include "XPM.h"
23#include "LineMarker.h"
24
25using namespace Scintilla;
26
27LineMarker::LineMarker(const LineMarker &other) {
28 // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
29 markType = other.markType;
30 fore = other.fore;
31 back = other.back;
33 alpha = other.alpha;
34 if (other.pxpm)
35 pxpm = Sci::make_unique<XPM>(*other.pxpm);
36 else
37 pxpm = nullptr;
38 if (other.image)
39 image = Sci::make_unique<RGBAImage>(*other.image);
40 else
41 image = nullptr;
42 customDraw = other.customDraw;
43}
44
46 // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
47 if (this != &other) {
48 markType = other.markType;
49 fore = other.fore;
50 back = other.back;
52 alpha = other.alpha;
53 if (other.pxpm)
54 pxpm = Sci::make_unique<XPM>(*other.pxpm);
55 else
56 pxpm = nullptr;
57 if (other.image)
58 image = Sci::make_unique<RGBAImage>(*other.image);
59 else
60 image = nullptr;
61 customDraw = other.customDraw;
62 }
63 return *this;
64}
65
66void LineMarker::SetXPM(const char *textForm) {
67 pxpm = Sci::make_unique<XPM>(textForm);
69}
70
71void LineMarker::SetXPM(const char *const *linesForm) {
72 pxpm = Sci::make_unique<XPM>(linesForm);
74}
75
76void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) {
77 image = Sci::make_unique<RGBAImage>(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage);
79}
80
81static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
83 centreX - armSize,
84 centreY - armSize,
85 centreX + armSize + 1,
86 centreY + armSize + 1);
87 surface->RectangleDraw(rc, back, fore);
88}
89
90static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
91 const PRectangle rcCircle = PRectangle::FromInts(
92 centreX - armSize,
93 centreY - armSize,
94 centreX + armSize + 1,
95 centreY + armSize + 1);
96 surface->Ellipse(rcCircle, back, fore);
97}
98
99static void DrawPlus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
100 const PRectangle rcV = PRectangle::FromInts(centreX, centreY - armSize + 2, centreX + 1, centreY + armSize - 2 + 1);
101 surface->FillRectangle(rcV, fore);
102 const PRectangle rcH = PRectangle::FromInts(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY + 1);
103 surface->FillRectangle(rcH, fore);
104}
105
106static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
107 const PRectangle rcH = PRectangle::FromInts(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY + 1);
108 surface->FillRectangle(rcH, fore);
109}
110
111void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, FoldPart part, int marginStyle) const {
112 if (customDraw) {
113 customDraw(surface, rcWhole, fontForCharacter, static_cast<int>(part), marginStyle, this);
114 return;
115 }
116
117 ColourDesired colourHead = back;
118 ColourDesired colourBody = back;
119 ColourDesired colourTail = back;
120
121 switch (part) {
122 case FoldPart::head:
124 colourHead = backSelected;
125 colourTail = backSelected;
126 break;
127 case FoldPart::body:
128 colourHead = backSelected;
129 colourBody = backSelected;
130 break;
131 case FoldPart::tail:
132 colourBody = backSelected;
133 colourTail = backSelected;
134 break;
135 default:
136 // FoldPart::undefined
137 break;
138 }
139
140 if ((markType == SC_MARK_PIXMAP) && (pxpm)) {
141 pxpm->Draw(surface, rcWhole);
142 return;
143 }
144 if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
145 // Make rectangle just large enough to fit image centred on centre of rcWhole
146 PRectangle rcImage;
147 rcImage.top = ((rcWhole.top + rcWhole.bottom) - image->GetScaledHeight()) / 2;
148 rcImage.bottom = rcImage.top + image->GetScaledHeight();
149 rcImage.left = ((rcWhole.left + rcWhole.right) - image->GetScaledWidth()) / 2;
150 rcImage.right = rcImage.left + image->GetScaledWidth();
151 surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
152 return;
153 }
154
155 const IntegerRectangle ircWhole(rcWhole);
156 // Restrict most shapes a bit
157 const PRectangle rc(rcWhole.left, rcWhole.top + 1, rcWhole.right, rcWhole.bottom - 1);
158 // Ensure does not go beyond edge
159 const int minDim = std::min(ircWhole.Width(), ircWhole.Height() - 2) - 1;
160 int centreX = (ircWhole.right + ircWhole.left) / 2;
161 const int centreY = (ircWhole.bottom + ircWhole.top) / 2;
162 const int dimOn2 = minDim / 2;
163 const int dimOn4 = minDim / 4;
164 const int blobSize = dimOn2 - 1;
165 const int armSize = dimOn2 - 2;
166 if (marginStyle == SC_MARGIN_NUMBER || marginStyle == SC_MARGIN_TEXT || marginStyle == SC_MARGIN_RTEXT) {
167 // On textual margins move marker to the left to try to avoid overlapping the text
168 centreX = ircWhole.left + dimOn2 + 1;
169 }
170
171 switch (markType) {
172 case SC_MARK_ROUNDRECT: {
173 PRectangle rcRounded = rc;
174 rcRounded.left = rc.left + 1;
175 rcRounded.right = rc.right - 1;
176 surface->RoundedRectangle(rcRounded, fore, back);
177 }
178 break;
179
180 case SC_MARK_CIRCLE: {
181 const PRectangle rcCircle = PRectangle::FromInts(
182 centreX - dimOn2,
183 centreY - dimOn2,
184 centreX + dimOn2,
185 centreY + dimOn2);
186 surface->Ellipse(rcCircle, fore, back);
187 }
188 break;
189
190 case SC_MARK_ARROW: {
191 Point pts[] = {
192 Point::FromInts(centreX - dimOn4, centreY - dimOn2),
193 Point::FromInts(centreX - dimOn4, centreY + dimOn2),
194 Point::FromInts(centreX + dimOn2 - dimOn4, centreY),
195 };
196 surface->Polygon(pts, Sci::size(pts), fore, back);
197 }
198 break;
199
200 case SC_MARK_ARROWDOWN: {
201 Point pts[] = {
202 Point::FromInts(centreX - dimOn2, centreY - dimOn4),
203 Point::FromInts(centreX + dimOn2, centreY - dimOn4),
204 Point::FromInts(centreX, centreY + dimOn2 - dimOn4),
205 };
206 surface->Polygon(pts, Sci::size(pts), fore, back);
207 }
208 break;
209
210 case SC_MARK_PLUS: {
211 Point pts[] = {
212 Point::FromInts(centreX - armSize, centreY - 1),
213 Point::FromInts(centreX - 1, centreY - 1),
214 Point::FromInts(centreX - 1, centreY - armSize),
215 Point::FromInts(centreX + 1, centreY - armSize),
216 Point::FromInts(centreX + 1, centreY - 1),
217 Point::FromInts(centreX + armSize, centreY - 1),
218 Point::FromInts(centreX + armSize, centreY + 1),
219 Point::FromInts(centreX + 1, centreY + 1),
220 Point::FromInts(centreX + 1, centreY + armSize),
221 Point::FromInts(centreX - 1, centreY + armSize),
222 Point::FromInts(centreX - 1, centreY + 1),
223 Point::FromInts(centreX - armSize, centreY + 1),
224 };
225 surface->Polygon(pts, Sci::size(pts), fore, back);
226 }
227 break;
228
229 case SC_MARK_MINUS: {
230 Point pts[] = {
231 Point::FromInts(centreX - armSize, centreY - 1),
232 Point::FromInts(centreX + armSize, centreY - 1),
233 Point::FromInts(centreX + armSize, centreY + 1),
234 Point::FromInts(centreX - armSize, centreY + 1),
235 };
236 surface->Polygon(pts, Sci::size(pts), fore, back);
237 }
238 break;
239
240 case SC_MARK_SMALLRECT: {
241 PRectangle rcSmall;
242 rcSmall.left = rc.left + 1;
243 rcSmall.top = rc.top + 2;
244 rcSmall.right = rc.right - 1;
245 rcSmall.bottom = rc.bottom - 2;
246 surface->RectangleDraw(rcSmall, fore, back);
247 }
248 break;
249
250 case SC_MARK_EMPTY:
254 // An invisible marker so don't draw anything
255 break;
256
257 case SC_MARK_VLINE: {
258 surface->PenColour(colourBody);
259 surface->MoveTo(centreX, ircWhole.top);
260 surface->LineTo(centreX, ircWhole.bottom);
261 }
262 break;
263
264 case SC_MARK_LCORNER: {
265 surface->PenColour(colourTail);
266 surface->MoveTo(centreX, ircWhole.top);
267 surface->LineTo(centreX, centreY);
268 surface->LineTo(ircWhole.right - 1, centreY);
269 }
270 break;
271
272 case SC_MARK_TCORNER: {
273 surface->PenColour(colourTail);
274 surface->MoveTo(centreX, centreY);
275 surface->LineTo(ircWhole.right - 1, centreY);
276
277 surface->PenColour(colourBody);
278 surface->MoveTo(centreX, ircWhole.top);
279 surface->LineTo(centreX, centreY + 1);
280
281 surface->PenColour(colourHead);
282 surface->LineTo(centreX, ircWhole.bottom);
283 }
284 break;
285
287 surface->PenColour(colourTail);
288 surface->MoveTo(centreX, ircWhole.top);
289 surface->LineTo(centreX, centreY - 3);
290 surface->LineTo(centreX + 3, centreY);
291 surface->LineTo(ircWhole.right - 1, centreY);
292 }
293 break;
294
296 surface->PenColour(colourTail);
297 surface->MoveTo(centreX, centreY - 3);
298 surface->LineTo(centreX + 3, centreY);
299 surface->LineTo(ircWhole.right - 1, centreY);
300
301 surface->PenColour(colourBody);
302 surface->MoveTo(centreX, ircWhole.top);
303 surface->LineTo(centreX, centreY - 2);
304
305 surface->PenColour(colourHead);
306 surface->LineTo(centreX, ircWhole.bottom);
307 }
308 break;
309
310 case SC_MARK_BOXPLUS: {
311 DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
312 DrawPlus(surface, centreX, centreY, blobSize, colourTail);
313 }
314 break;
315
317 if (part == FoldPart::headWithTail)
318 surface->PenColour(colourTail);
319 else
320 surface->PenColour(colourBody);
321 surface->MoveTo(centreX, centreY + blobSize);
322 surface->LineTo(centreX, ircWhole.bottom);
323
324 surface->PenColour(colourBody);
325 surface->MoveTo(centreX, ircWhole.top);
326 surface->LineTo(centreX, centreY - blobSize);
327
328 DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
329 DrawPlus(surface, centreX, centreY, blobSize, colourTail);
330
331 if (part == FoldPart::body) {
332 surface->PenColour(colourTail);
333 surface->MoveTo(centreX + 1, centreY + blobSize);
334 surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
335
336 surface->MoveTo(centreX + blobSize, centreY + blobSize);
337 surface->LineTo(centreX + blobSize, centreY - blobSize);
338
339 surface->MoveTo(centreX + 1, centreY - blobSize);
340 surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
341 }
342 }
343 break;
344
345 case SC_MARK_BOXMINUS: {
346 DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
347 DrawMinus(surface, centreX, centreY, blobSize, colourTail);
348
349 surface->PenColour(colourHead);
350 surface->MoveTo(centreX, centreY + blobSize);
351 surface->LineTo(centreX, ircWhole.bottom);
352 }
353 break;
354
356 DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
357 DrawMinus(surface, centreX, centreY, blobSize, colourTail);
358
359 surface->PenColour(colourHead);
360 surface->MoveTo(centreX, centreY + blobSize);
361 surface->LineTo(centreX, ircWhole.bottom);
362
363 surface->PenColour(colourBody);
364 surface->MoveTo(centreX, ircWhole.top);
365 surface->LineTo(centreX, centreY - blobSize);
366
367 if (part == FoldPart::body) {
368 surface->PenColour(colourTail);
369 surface->MoveTo(centreX + 1, centreY + blobSize);
370 surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
371
372 surface->MoveTo(centreX + blobSize, centreY + blobSize);
373 surface->LineTo(centreX + blobSize, centreY - blobSize);
374
375 surface->MoveTo(centreX + 1, centreY - blobSize);
376 surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
377 }
378 }
379 break;
380
381 case SC_MARK_CIRCLEPLUS: {
382 DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
383 DrawPlus(surface, centreX, centreY, blobSize, colourTail);
384 }
385 break;
386
388 if (part == FoldPart::headWithTail)
389 surface->PenColour(colourTail);
390 else
391 surface->PenColour(colourBody);
392 surface->MoveTo(centreX, centreY + blobSize);
393 surface->LineTo(centreX, ircWhole.bottom);
394
395 surface->PenColour(colourBody);
396 surface->MoveTo(centreX, ircWhole.top);
397 surface->LineTo(centreX, centreY - blobSize);
398
399 DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
400 DrawPlus(surface, centreX, centreY, blobSize, colourTail);
401 }
402 break;
403
404 case SC_MARK_CIRCLEMINUS: {
405 surface->PenColour(colourHead);
406 surface->MoveTo(centreX, centreY + blobSize);
407 surface->LineTo(centreX, ircWhole.bottom);
408
409 DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
410 DrawMinus(surface, centreX, centreY, blobSize, colourTail);
411 }
412 break;
413
415 surface->PenColour(colourHead);
416 surface->MoveTo(centreX, centreY + blobSize);
417 surface->LineTo(centreX, ircWhole.bottom);
418
419 surface->PenColour(colourBody);
420 surface->MoveTo(centreX, ircWhole.top);
421 surface->LineTo(centreX, centreY - blobSize);
422
423 DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
424 DrawMinus(surface, centreX, centreY, blobSize, colourTail);
425 }
426 break;
427
428 case SC_MARK_DOTDOTDOT: {
429 XYPOSITION right = static_cast<XYPOSITION>(centreX - 6);
430 for (int b = 0; b < 3; b++) {
431 const PRectangle rcBlob(right, rc.bottom - 4, right + 2, rc.bottom - 2);
432 surface->FillRectangle(rcBlob, fore);
433 right += 5.0f;
434 }
435 }
436 break;
437
438 case SC_MARK_ARROWS: {
439 surface->PenColour(fore);
440 int right = centreX - 2;
441 const int armLength = dimOn2 - 1;
442 for (int b = 0; b < 3; b++) {
443 surface->MoveTo(right, centreY);
444 surface->LineTo(right - armLength, centreY - armLength);
445 surface->MoveTo(right, centreY);
446 surface->LineTo(right - armLength, centreY + armLength);
447 right += 4;
448 }
449 }
450 break;
451
452 case SC_MARK_SHORTARROW: {
453 Point pts[] = {
454 Point::FromInts(centreX, centreY + dimOn2),
455 Point::FromInts(centreX + dimOn2, centreY),
456 Point::FromInts(centreX, centreY - dimOn2),
457 Point::FromInts(centreX, centreY - dimOn4),
458 Point::FromInts(centreX - dimOn4, centreY - dimOn4),
459 Point::FromInts(centreX - dimOn4, centreY + dimOn4),
460 Point::FromInts(centreX, centreY + dimOn4),
461 Point::FromInts(centreX, centreY + dimOn2),
462 };
463 surface->Polygon(pts, Sci::size(pts), fore, back);
464 }
465 break;
466
467 case SC_MARK_FULLRECT:
468 surface->FillRectangle(rcWhole, back);
469 break;
470
471 case SC_MARK_LEFTRECT: {
472 PRectangle rcLeft = rcWhole;
473 rcLeft.right = rcLeft.left + 4;
474 surface->FillRectangle(rcLeft, back);
475 }
476 break;
477
478 case SC_MARK_BOOKMARK: {
479 const int halfHeight = minDim / 3;
480 Point pts[] = {
481 Point::FromInts(ircWhole.left, centreY - halfHeight),
482 Point::FromInts(ircWhole.right - 3, centreY - halfHeight),
483 Point::FromInts(ircWhole.right - 3 - halfHeight, centreY),
484 Point::FromInts(ircWhole.right - 3, centreY + halfHeight),
485 Point::FromInts(ircWhole.left, centreY + halfHeight),
486 };
487 surface->Polygon(pts, Sci::size(pts), fore, back);
488 }
489 break;
490
492 const int halfWidth = minDim / 3;
493 Point pts[] = {
494 Point::FromInts(centreX - halfWidth, centreY - dimOn2),
495 Point::FromInts(centreX + halfWidth, centreY - dimOn2),
496 Point::FromInts(centreX + halfWidth, centreY + dimOn2),
497 Point::FromInts(centreX, centreY + dimOn2 - halfWidth),
498 Point::FromInts(centreX - halfWidth, centreY + dimOn2),
499 };
500 surface->Polygon(pts, Sci::size(pts), fore, back);
501 }
502 break;
503
504 default:
506 char character[1];
507 character[0] = static_cast<char>(markType - SC_MARK_CHARACTER);
508 const XYPOSITION width = surface->WidthText(fontForCharacter, character, 1);
509 PRectangle rcText = rc;
510 rcText.left += (rc.Width() - width) / 2;
511 rcText.right = rc.left + width;
512 surface->DrawTextClipped(rcText, fontForCharacter, rcText.bottom - 2,
513 character, 1, fore, back);
514 } else {
515 // treat as SC_MARK_FULLRECT
516 surface->FillRectangle(rcWhole, back);
517 }
518 break;
519 }
520}
A rectangle with integer coordinates.
static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back)
Definition: LineMarker.cxx:81
static void DrawPlus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore)
Definition: LineMarker.cxx:99
static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back)
Definition: LineMarker.cxx:90
static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore)
Definition: LineMarker.cxx:106
Defines the look of a line marker in the margin .
Interface to platform facilities.
Interface to the edit control.
#define SC_MARK_UNDERLINE
Definition: Scintilla.h:148
#define SC_MARK_SMALLRECT
Definition: Scintilla.h:122
#define SC_MARK_PIXMAP
Definition: Scintilla.h:144
#define SC_MARK_ARROWS
Definition: Scintilla.h:143
#define SC_MARK_RGBAIMAGE
Definition: Scintilla.h:149
#define SC_MARK_EMPTY
Definition: Scintilla.h:124
#define SC_MARK_TCORNERCURVE
Definition: Scintilla.h:136
#define SC_MARK_TCORNER
Definition: Scintilla.h:130
#define SC_MARGIN_TEXT
Definition: Scintilla.h:180
#define SC_MARGIN_NUMBER
Definition: Scintilla.h:177
#define SC_MARK_PLUS
Definition: Scintilla.h:127
#define SC_MARGIN_RTEXT
Definition: Scintilla.h:181
#define SC_MARK_CIRCLEMINUS
Definition: Scintilla.h:139
#define SC_MARK_ARROWDOWN
Definition: Scintilla.h:125
#define SC_MARK_LCORNER
Definition: Scintilla.h:129
#define SC_MARK_CIRCLEMINUSCONNECTED
Definition: Scintilla.h:140
#define SC_MARK_AVAILABLE
Definition: Scintilla.h:147
#define SC_MARK_MINUS
Definition: Scintilla.h:126
#define SC_MARK_BOXMINUS
Definition: Scintilla.h:133
#define SC_MARK_BOOKMARK
Definition: Scintilla.h:150
#define SC_MARK_VERTICALBOOKMARK
Definition: Scintilla.h:151
#define SC_MARK_DOTDOTDOT
Definition: Scintilla.h:142
#define SC_MARK_SHORTARROW
Definition: Scintilla.h:123
#define SC_MARK_BOXPLUSCONNECTED
Definition: Scintilla.h:132
#define SC_MARK_BACKGROUND
Definition: Scintilla.h:141
#define SC_MARK_ROUNDRECT
Definition: Scintilla.h:120
#define SC_MARK_BOXPLUS
Definition: Scintilla.h:131
#define SC_MARK_CIRCLEPLUSCONNECTED
Definition: Scintilla.h:138
#define SC_MARK_LCORNERCURVE
Definition: Scintilla.h:135
#define SC_MARK_LEFTRECT
Definition: Scintilla.h:146
#define SC_MARK_CIRCLEPLUS
Definition: Scintilla.h:137
#define SC_MARK_FULLRECT
Definition: Scintilla.h:145
#define SC_MARK_CIRCLE
Definition: Scintilla.h:119
#define SC_MARK_BOXMINUSCONNECTED
Definition: Scintilla.h:134
#define SC_MARK_ARROW
Definition: Scintilla.h:121
#define SC_MARK_VLINE
Definition: Scintilla.h:128
#define SC_MARK_CHARACTER
Definition: Scintilla.h:152
Define a classes to hold image data in the X Pixmap (XPM) and RGBA formats.
DrawLineMarkerFn customDraw
Some platforms, notably PLAT_CURSES, do not support Scintilla's native Draw function for drawing line...
Definition: LineMarker.h:35
std::unique_ptr< XPM > pxpm
Definition: LineMarker.h:29
ColourDesired fore
Definition: LineMarker.h:25
ColourDesired back
Definition: LineMarker.h:26
LineMarker & operator=(const LineMarker &other)
Definition: LineMarker.cxx:45
ColourDesired backSelected
Definition: LineMarker.h:27
void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage)
Definition: LineMarker.cxx:76
std::unique_ptr< RGBAImage > image
Definition: LineMarker.h:30
void SetXPM(const char *textForm)
Definition: LineMarker.cxx:66
void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, FoldPart part, int marginStyle) const
Definition: LineMarker.cxx:111
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
constexpr XYPOSITION Width() const noexcept
Definition: Platform.h:176
XYPOSITION bottom
Definition: Platform.h:136
A geometric point class.
Definition: Platform.h:99
static constexpr Point FromInts(int x_, int y_) noexcept
Definition: Platform.h:107
XYPOSITION y
Definition: Platform.h:102
XYPOSITION x
Definition: Platform.h:101
A surface abstracts a place to draw.
Definition: Platform.h:340
virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage)=0
virtual void PenColour(ColourDesired fore)=0
virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0
virtual void Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back)=0
virtual void MoveTo(int x_, int y_)=0
virtual void LineTo(int x_, int y_)=0
virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0
virtual void FillRectangle(PRectangle rc, ColourDesired back)=0
virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0
Styling buffer using one element for each run rather than using a filled buffer.
Definition: Converter.h:9
float XYPOSITION
Definition: Platform.h:81
int Width() const noexcept
int Height() const noexcept