aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-10-03 01:34:29 +0000
committernyamatongwe <unknown>2002-10-03 01:34:29 +0000
commitb9421289267244b65832ad0d0955abd68b07a1df (patch)
tree3158a7e57d4ac630e7ba7a0eaabdc3226141d1e1 /src
parent85c8267b67e9c7bdf49916db228ed84b7b1d4904 (diff)
downloadscintilla-mirror-b9421289267244b65832ad0d0955abd68b07a1df.tar.gz
Cleaned up pixmap marker code.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx13
-rw-r--r--src/LineMarker.cxx24
2 files changed, 4 insertions, 33 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 425847852..790840f51 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5142,19 +5142,6 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_MARKERDEFINE:
if (wParam <= MARKER_MAX)
vs.markers[wParam].markType = lParam;
- {
- static char *stop_xpm = "\
- static char *stop_xpm[] = {\
-\"4 4 3 1\",\
-\" c None\",\
-\". c #0000FF\",\
-\"+ c #FFFF00\",\
-\" .. \",\
-\".++.\",\
-\".++.\",\
-\" .. \"};";
- vs.markers[wParam].SetXPM(stop_xpm);
- };
InvalidateStyleData();
RedrawSelMargin();
break;
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 16be7436a..03a9c1dd8 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -22,24 +22,6 @@ static const char *NextField(const char *s) {
return s;
}
-static int IntFromHexDigit(const char ch) {
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 10;
- else
- return 0;
-}
-
-static ColourDesired ColourFromString(const char *val) {
- int r = IntFromHexDigit(val[1]) * 16 + IntFromHexDigit(val[2]);
- int g = IntFromHexDigit(val[3]) * 16 + IntFromHexDigit(val[4]);
- int b = IntFromHexDigit(val[5]) * 16 + IntFromHexDigit(val[6]);
- return ColourDesired(r, g, b);
-}
-
void XPM::Init(const char * const *linesForm) {
height = 1;
width = 1;
@@ -66,7 +48,7 @@ void XPM::Init(const char * const *linesForm) {
codes[c] = colourDef[0];
colourDef += 4;
if (*colourDef == '#') {
- colours[c].desired = ColourFromString(colourDef);
+ colours[c].desired.Set(colourDef);
} else {
colours[c].desired = ColourDesired(0xff, 0xff, 0xff);
codeTransparent = codes[c];
@@ -171,11 +153,13 @@ void LineMarker::RefreshColourPalette(Palette &pal, bool want) {
void LineMarker::SetXPM(const char *textForm) {
delete pxpm;
pxpm = new XPM(textForm);
+ markType = SC_MARK_PIXMAP;
}
void LineMarker::SetXPM(const char * const *linesForm) {
delete pxpm;
pxpm = new XPM(linesForm);
+ markType = SC_MARK_PIXMAP;
}
static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourAllocated fore, ColourAllocated back) {
@@ -209,7 +193,7 @@ static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, C
}
void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter) {
- if (pxpm) {
+ if ((markType == SC_MARK_PIXMAP) && (pxpm)) {
pxpm->Draw(surface, rcWhole);
return;
}