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 namespace Scintilla { 12 13 class XPM; 14 class RGBAImage; 15 16 typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker); 17 18 /** 19 */ 20 class LineMarker { 21 public: 22 enum typeOfFold { undefined, head, body, tail, headWithTail }; 23 24 int markType; 25 ColourDesired fore; 26 ColourDesired back; 27 ColourDesired backSelected; 28 int alpha; 29 std::unique_ptr<XPM> pxpm; 30 std::unique_ptr<RGBAImage> image; 31 /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native 32 * Draw function for drawing line markers. Allow those platforms to override 33 * it instead of creating a new method(s) in the Surface class that existing 34 * platforms must implement as empty. */ 35 DrawLineMarkerFn customDraw; 36 LineMarker(); 37 LineMarker(const LineMarker &); 38 virtual ~LineMarker(); 39 LineMarker &operator=(const LineMarker &other); 40 void SetXPM(const char *textForm); 41 void SetXPM(const char *const *linesForm); 42 void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage); 43 void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const; 44 }; 45 46 } 47 48 #endif 49