From d126e56e2c800188a2546c241299453c2e4304a8 Mon Sep 17 00:00:00 2001
From: Zufu Liu
Date: Sun, 7 Apr 2019 10:03:38 +1000
Subject: Backport: Feature [feature-requests:#1276]. Add
SC_MARK_VERTICALBOOKMARK.
Backport of changeset 7407:fc237c9afcdd.
---
doc/Markers.png | Bin 8399 -> 22999 bytes
doc/ScintillaDoc.html | 3 ++-
doc/ScintillaHistory.html | 6 +++++-
include/Scintilla.h | 1 +
include/Scintilla.iface | 1 +
src/LineMarker.cxx | 10 ++++++++++
6 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/doc/Markers.png b/doc/Markers.png
index 2ad37b102..b1d0120c0 100644
Binary files a/doc/Markers.png and b/doc/Markers.png differ
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index c4b0112b3..5c0c08d34 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -4044,7 +4044,8 @@ struct Sci_TextToFind {
SC_MARK_BACKGROUND,
SC_MARK_LEFTRECT,
SC_MARK_FULLRECT,
- SC_MARK_BOOKMARK, and
+ SC_MARK_BOOKMARK,
+ SC_MARK_VERTICALBOOKMARK, and
SC_MARK_UNDERLINE.
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 262813ab1..471fdf42d 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -565,7 +565,11 @@
at the expense of memory.
Feature #1259.
-
+
+ Add vertical bookmark symbol SC_MARK_VERTICALBOOKMARK.
+ Feature #1276.
+
+
Improve performance of accessibility on GTK.
Bug #2094.
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 88610672b..b4b4f2e7e 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -135,6 +135,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_MARK_UNDERLINE 29
#define SC_MARK_RGBAIMAGE 30
#define SC_MARK_BOOKMARK 31
+#define SC_MARK_VERTICALBOOKMARK 32
#define SC_MARK_CHARACTER 10000
#define SC_MARKNUM_FOLDEREND 25
#define SC_MARKNUM_FOLDEROPENMID 26
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index d5360a201..c009371c1 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -304,6 +304,7 @@ val SC_MARK_AVAILABLE=28
val SC_MARK_UNDERLINE=29
val SC_MARK_RGBAIMAGE=30
val SC_MARK_BOOKMARK=31
+val SC_MARK_VERTICALBOOKMARK=32
val SC_MARK_CHARACTER=10000
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index ca542be16..ea5e5e780 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -430,6 +430,16 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
Point::FromInts(ircWhole.left, centreY + halfHeight),
};
surface->Polygon(pts, ELEMENTS(pts), fore, back);
+ } else if (markType == SC_MARK_VERTICALBOOKMARK) {
+ const int halfWidth = minDim / 3;
+ Point pts[] = {
+ Point::FromInts(centreX - halfWidth, centreY - dimOn2),
+ Point::FromInts(centreX + halfWidth, centreY - dimOn2),
+ Point::FromInts(centreX + halfWidth, centreY + dimOn2),
+ Point::FromInts(centreX, centreY + dimOn2 - halfWidth),
+ Point::FromInts(centreX - halfWidth, centreY + dimOn2),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else { // SC_MARK_FULLRECT
surface->FillRectangle(rcWhole, back);
}
--
cgit v1.2.3