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.
7 
8 #ifndef LINEMARKER_H
9 #define LINEMARKER_H
10 
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14 
15 /**
16  */
17 class LineMarker {
18 public:
19 	enum typeOfFold { undefined, head, body, tail, headWithTail };
20 
21 	int markType;
22 	ColourDesired fore;
23 	ColourDesired back;
24 	ColourDesired backSelected;
25 	int alpha;
26 	XPM *pxpm;
27 	RGBAImage *image;
LineMarker()28 	LineMarker() {
29 		markType = SC_MARK_CIRCLE;
30 		fore = ColourDesired(0,0,0);
31 		back = ColourDesired(0xff,0xff,0xff);
32 		backSelected = ColourDesired(0xff,0x00,0x00);
33 		alpha = SC_ALPHA_NOALPHA;
34 		pxpm = NULL;
35 		image = NULL;
36 	}
LineMarker(const LineMarker &)37 	LineMarker(const LineMarker &) {
38 		// Defined to avoid pxpm being blindly copied, not as a complete copy constructor
39 		markType = SC_MARK_CIRCLE;
40 		fore = ColourDesired(0,0,0);
41 		back = ColourDesired(0xff,0xff,0xff);
42 		backSelected = ColourDesired(0xff,0x00,0x00);
43 		alpha = SC_ALPHA_NOALPHA;
44 		pxpm = NULL;
45 		image = NULL;
46 	}
~LineMarker()47 	~LineMarker() {
48 		delete pxpm;
49 		delete image;
50 	}
51 	LineMarker &operator=(const LineMarker &other) {
52 		// Defined to avoid pxpm being blindly copied, not as a complete assignment operator
53 		if (this != &other) {
54 			markType = SC_MARK_CIRCLE;
55 			fore = ColourDesired(0,0,0);
56 			back = ColourDesired(0xff,0xff,0xff);
57 			backSelected = ColourDesired(0xff,0x00,0x00);
58 			alpha = SC_ALPHA_NOALPHA;
59 			delete pxpm;
60 			pxpm = NULL;
61 			delete image;
62 			image = NULL;
63 		}
64 		return *this;
65 	}
66 	void SetXPM(const char *textForm);
67 	void SetXPM(const char *const *linesForm);
68 	void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
69 	void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
70 };
71 
72 #ifdef SCI_NAMESPACE
73 }
74 #endif
75 
76 #endif
77