Scintilla 4.0.3
[TortoiseGit.git] / ext / scintilla / src / LineMarker.h
blobdd62b4fed5c206f7236b147ad100f7f8517e17d2
1 // Scintilla source code edit control
2 /** @file LineMarker.h
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.
8 #ifndef LINEMARKER_H
9 #define LINEMARKER_H
11 namespace Scintilla {
13 typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
15 /**
17 class LineMarker {
18 public:
19 enum typeOfFold { undefined, head, body, tail, headWithTail };
21 int markType;
22 ColourDesired fore;
23 ColourDesired back;
24 ColourDesired backSelected;
25 int alpha;
26 std::unique_ptr<XPM> pxpm;
27 std::unique_ptr<RGBAImage> image;
28 /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
29 * Draw function for drawing line markers. Allow those platforms to override
30 * it instead of creating a new method(s) in the Surface class that existing
31 * platforms must implement as empty. */
32 DrawLineMarkerFn customDraw;
33 LineMarker() {
34 markType = SC_MARK_CIRCLE;
35 fore = ColourDesired(0,0,0);
36 back = ColourDesired(0xff,0xff,0xff);
37 backSelected = ColourDesired(0xff,0x00,0x00);
38 alpha = SC_ALPHA_NOALPHA;
39 customDraw = nullptr;
41 LineMarker(const LineMarker &) {
42 // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
43 markType = SC_MARK_CIRCLE;
44 fore = ColourDesired(0,0,0);
45 back = ColourDesired(0xff,0xff,0xff);
46 backSelected = ColourDesired(0xff,0x00,0x00);
47 alpha = SC_ALPHA_NOALPHA;
48 pxpm.reset();
49 image.reset();
50 customDraw = nullptr;
52 ~LineMarker() {
54 LineMarker &operator=(const LineMarker &other) {
55 // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
56 if (this != &other) {
57 markType = SC_MARK_CIRCLE;
58 fore = ColourDesired(0,0,0);
59 back = ColourDesired(0xff,0xff,0xff);
60 backSelected = ColourDesired(0xff,0x00,0x00);
61 alpha = SC_ALPHA_NOALPHA;
62 pxpm.reset();
63 image.reset();
64 customDraw = nullptr;
66 return *this;
68 void SetXPM(const char *textForm);
69 void SetXPM(const char *const *linesForm);
70 void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
71 void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
76 #endif