2009-04-24 23:35:41 +00:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file LineMarker.h
|
|
|
|
** Defines the look of a line marker in the margin .
|
|
|
|
**/
|
2011-07-17 22:30:49 +00:00
|
|
|
// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
|
2009-04-24 23:35:41 +00:00
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
|
|
|
#ifndef LINEMARKER_H
|
|
|
|
#define LINEMARKER_H
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
namespace Scintilla {
|
|
|
|
#endif
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
|
2011-07-17 22:30:49 +00:00
|
|
|
|
2009-04-24 23:35:41 +00:00
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class LineMarker {
|
|
|
|
public:
|
2013-08-28 00:44:27 +00:00
|
|
|
enum typeOfFold { undefined, head, body, tail, headWithTail };
|
2011-07-17 22:30:49 +00:00
|
|
|
|
2009-04-24 23:35:41 +00:00
|
|
|
int markType;
|
2013-08-28 00:44:27 +00:00
|
|
|
ColourDesired fore;
|
|
|
|
ColourDesired back;
|
|
|
|
ColourDesired backSelected;
|
2009-04-24 23:35:41 +00:00
|
|
|
int alpha;
|
|
|
|
XPM *pxpm;
|
2013-08-28 00:44:27 +00:00
|
|
|
RGBAImage *image;
|
2015-06-07 21:19:26 +00:00
|
|
|
/** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
|
|
|
|
* Draw function for drawing line markers. Allow those platforms to override
|
|
|
|
* it instead of creating a new method(s) in the Surface class that existing
|
|
|
|
* platforms must implement as empty. */
|
|
|
|
DrawLineMarkerFn customDraw;
|
2009-04-24 23:35:41 +00:00
|
|
|
LineMarker() {
|
|
|
|
markType = SC_MARK_CIRCLE;
|
|
|
|
fore = ColourDesired(0,0,0);
|
|
|
|
back = ColourDesired(0xff,0xff,0xff);
|
2011-07-17 22:30:49 +00:00
|
|
|
backSelected = ColourDesired(0xff,0x00,0x00);
|
2009-04-24 23:35:41 +00:00
|
|
|
alpha = SC_ALPHA_NOALPHA;
|
|
|
|
pxpm = NULL;
|
2013-08-28 00:44:27 +00:00
|
|
|
image = NULL;
|
2015-06-07 21:19:26 +00:00
|
|
|
customDraw = NULL;
|
2009-04-24 23:35:41 +00:00
|
|
|
}
|
|
|
|
LineMarker(const LineMarker &) {
|
2013-08-28 00:44:27 +00:00
|
|
|
// Defined to avoid pxpm being blindly copied, not as a complete copy constructor
|
2009-04-24 23:35:41 +00:00
|
|
|
markType = SC_MARK_CIRCLE;
|
|
|
|
fore = ColourDesired(0,0,0);
|
|
|
|
back = ColourDesired(0xff,0xff,0xff);
|
2011-07-17 22:30:49 +00:00
|
|
|
backSelected = ColourDesired(0xff,0x00,0x00);
|
2009-04-24 23:35:41 +00:00
|
|
|
alpha = SC_ALPHA_NOALPHA;
|
|
|
|
pxpm = NULL;
|
2013-08-28 00:44:27 +00:00
|
|
|
image = NULL;
|
2015-06-07 21:19:26 +00:00
|
|
|
customDraw = NULL;
|
2009-04-24 23:35:41 +00:00
|
|
|
}
|
|
|
|
~LineMarker() {
|
|
|
|
delete pxpm;
|
2013-08-28 00:44:27 +00:00
|
|
|
delete image;
|
2009-04-24 23:35:41 +00:00
|
|
|
}
|
2013-08-28 00:44:27 +00:00
|
|
|
LineMarker &operator=(const LineMarker &other) {
|
|
|
|
// Defined to avoid pxpm being blindly copied, not as a complete assignment operator
|
|
|
|
if (this != &other) {
|
|
|
|
markType = SC_MARK_CIRCLE;
|
|
|
|
fore = ColourDesired(0,0,0);
|
|
|
|
back = ColourDesired(0xff,0xff,0xff);
|
|
|
|
backSelected = ColourDesired(0xff,0x00,0x00);
|
|
|
|
alpha = SC_ALPHA_NOALPHA;
|
|
|
|
delete pxpm;
|
|
|
|
pxpm = NULL;
|
|
|
|
delete image;
|
|
|
|
image = NULL;
|
2015-06-07 21:19:26 +00:00
|
|
|
customDraw = NULL;
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
2009-04-24 23:35:41 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
void SetXPM(const char *textForm);
|
2010-07-12 22:19:51 +00:00
|
|
|
void SetXPM(const char *const *linesForm);
|
2013-08-28 00:44:27 +00:00
|
|
|
void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
|
2015-06-07 21:19:26 +00:00
|
|
|
void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
|
2009-04-24 23:35:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|