Update Scintilla to version 3.5.3
[TortoiseGit.git] / ext / scintilla / src / LineMarker.h
blobda2898a0a6b550c1fbd96e9a2001c5200c3937b8
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 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
17 /**
19 class LineMarker {
20 public:
21 enum typeOfFold { undefined, head, body, tail, headWithTail };
23 int markType;
24 ColourDesired fore;
25 ColourDesired back;
26 ColourDesired backSelected;
27 int alpha;
28 XPM *pxpm;
29 RGBAImage *image;
30 /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
31 * Draw function for drawing line markers. Allow those platforms to override
32 * it instead of creating a new method(s) in the Surface class that existing
33 * platforms must implement as empty. */
34 DrawLineMarkerFn customDraw;
35 LineMarker() {
36 markType = SC_MARK_CIRCLE;
37 fore = ColourDesired(0,0,0);
38 back = ColourDesired(0xff,0xff,0xff);
39 backSelected = ColourDesired(0xff,0x00,0x00);
40 alpha = SC_ALPHA_NOALPHA;
41 pxpm = NULL;
42 image = NULL;
43 customDraw = NULL;
45 LineMarker(const LineMarker &) {
46 // Defined to avoid pxpm being blindly copied, not as a complete copy constructor
47 markType = SC_MARK_CIRCLE;
48 fore = ColourDesired(0,0,0);
49 back = ColourDesired(0xff,0xff,0xff);
50 backSelected = ColourDesired(0xff,0x00,0x00);
51 alpha = SC_ALPHA_NOALPHA;
52 pxpm = NULL;
53 image = NULL;
54 customDraw = NULL;
56 ~LineMarker() {
57 delete pxpm;
58 delete image;
60 LineMarker &operator=(const LineMarker &other) {
61 // Defined to avoid pxpm being blindly copied, not as a complete assignment operator
62 if (this != &other) {
63 markType = SC_MARK_CIRCLE;
64 fore = ColourDesired(0,0,0);
65 back = ColourDesired(0xff,0xff,0xff);
66 backSelected = ColourDesired(0xff,0x00,0x00);
67 alpha = SC_ALPHA_NOALPHA;
68 delete pxpm;
69 pxpm = NULL;
70 delete image;
71 image = NULL;
72 customDraw = NULL;
74 return *this;
76 void SetXPM(const char *textForm);
77 void SetXPM(const char *const *linesForm);
78 void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
79 void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
82 #ifdef SCI_NAMESPACE
84 #endif
86 #endif