From 03cca7be7b6f7e1a2899c01bf50a7a61f9be1a21 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 14 Jul 2009 03:28:22 +0000 Subject: Added controls for enabling multiple selection and multiple selection typing. Renamed multiline options to reflect use on multiple selections. Using std::vector for selections. --- src/Selection.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Selection.h') diff --git a/src/Selection.h b/src/Selection.h index 6fe828a2c..e98709312 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -116,19 +116,17 @@ struct SelectionRange { SelectionPosition End() const { return (anchor < caret) ? caret : anchor; } - bool Trim(SelectionPosition startPos, SelectionPosition endPos); + bool Trim(SelectionRange range); // If range is all virtual collapse to start of virtual space void MinimizeVirtualSpace(); }; class Selection { - SelectionRange *ranges; + std::vector ranges; SelectionRange rangeRectangular; - size_t allocated; size_t nRanges; size_t mainRange; bool moveExtends; - void Allocate(); public: enum selTypes { noSel, selStream, selRectangle, selLines, selThin }; selTypes selType; @@ -151,7 +149,8 @@ public: SelectionPosition Last() const; int Length() const; void MovePositions(bool insertion, int startChange, int length); - void TrimSelection(SelectionPosition startPos, SelectionPosition endPos); + void TrimSelection(SelectionRange range); + void AddSelection(SelectionRange range); void AddSelection(SelectionPosition spPos); void AddSelection(SelectionPosition spStartPos, SelectionPosition spEndPos, bool anchorLeft); int CharacterInSelection(int posCharacter) const; -- cgit v1.2.3