aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Indicator.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-03-08 01:43:56 +0000
committernyamatongwe <unknown>2000-03-08 01:43:56 +0000
commitc196d2fc7c3ece7ccb7d89c425499a75ead7e59b (patch)
tree3ea3c536f04e88499b86ed82e8a9a457f96b4978 /src/Indicator.cxx
parent7fbd8e2a34d2f5084ce26ad95d7c70ae4de6a233 (diff)
downloadscintilla-mirror-c196d2fc7c3ece7ccb7d89c425499a75ead7e59b.tar.gz
Initial revision
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r--src/Indicator.cxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
new file mode 100644
index 000000000..fb6ad0915
--- /dev/null
+++ b/src/Indicator.cxx
@@ -0,0 +1,45 @@
+// Scintilla source code edit control
+// Indicator.cxx - defines the style of indicators which are text decorations such as underlining
+// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "Indicator.h"
+
+void Indicator::Draw(Surface *surface, PRectangle &rc) {
+ surface->PenColour(fore.allocated);
+ int ymid = (rc.bottom + rc.top) / 2;
+ if (style == INDIC_SQUIGGLE) {
+ surface->MoveTo(rc.left, rc.top);
+ int x = rc.left + 2;
+ int y = 2;
+ while (x < rc.right) {
+ surface->LineTo(x, rc.top + y);
+ x += 2;
+ y = 2 - y;
+ }
+ surface->LineTo(rc.right, rc.top + y); // Finish the line
+ } else if (style == INDIC_TT) {
+ surface->MoveTo(rc.left, ymid);
+ int x = rc.left + 5;
+ while (x < rc.right) {
+ surface->LineTo(x, ymid);
+ surface->MoveTo(x-3, ymid);
+ surface->LineTo(x-3, ymid+2);
+ x++;
+ surface->MoveTo(x, ymid);
+ x += 5;
+ }
+ surface->LineTo(rc.right, ymid); // Finish the line
+ if (x - 3 <= rc.right) {
+ surface->MoveTo(x-3, ymid);
+ surface->LineTo(x-3, ymid+2);
+ }
+ } else { // Either INDIC_PLAIN or unknown
+ surface->MoveTo(rc.left, ymid);
+ surface->LineTo(rc.right, ymid);
+ }
+}
+