1 // Scintilla source code edit control
3 ** Manages data associated with each line of the document
5 // Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
16 * This holds the marker identifier and the marker type to display.
17 * MarkerHandleNumbers are members of lists.
19 struct MarkerHandleNumber
{
22 MarkerHandleNumber
*next
;
26 * A marker handle set contains any number of MarkerHandleNumbers.
28 class MarkerHandleSet
{
29 MarkerHandleNumber
*root
;
35 int NumberFromHandle(int handle
) const;
36 int MarkValue() const; ///< Bit set of marker numbers.
37 bool Contains(int handle
) const;
38 bool InsertHandle(int handle
, int markerNum
);
39 void RemoveHandle(int handle
);
40 bool RemoveNumber(int markerNum
);
41 void CombineWith(MarkerHandleSet
*other
);
44 class LineMarkers
: public PerLine
{
45 SplitVector
<MarkerHandleSet
*> markers
;
46 /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
49 LineMarkers() : handleCurrent(0) {
51 virtual ~LineMarkers();
53 virtual void InsertLine(int line
);
54 virtual void RemoveLine(int line
);
56 int MarkValue(int line
);
57 int AddMark(int line
, int marker
, int lines
);
58 void MergeMarkers(int pos
);
59 void DeleteMark(int line
, int markerNum
, bool all
);
60 void DeleteMarkFromHandle(int markerHandle
);
61 int LineFromHandle(int markerHandle
);
64 class LineLevels
: public PerLine
{
65 SplitVector
<int> levels
;
67 virtual ~LineLevels();
69 virtual void InsertLine(int line
);
70 virtual void RemoveLine(int line
);
72 void ExpandLevels(int sizeNew
=-1);
74 int SetLevel(int line
, int level
, int lines
);
75 int GetLevel(int line
);
78 class LineState
: public PerLine
{
79 SplitVector
<int> lineStates
;
85 virtual void InsertLine(int line
);
86 virtual void RemoveLine(int line
);
88 int SetLineState(int line
, int state
);
89 int GetLineState(int line
);
90 int GetMaxLineState();
93 class LineAnnotation
: public PerLine
{
94 SplitVector
<char *> annotations
;
98 virtual ~LineAnnotation();
100 virtual void InsertLine(int line
);
101 virtual void RemoveLine(int line
);
104 bool MultipleStyles(int line
) const;
106 const char *Text(int line
) const;
107 const unsigned char *Styles(int line
) const;
108 void SetText(int line
, const char *text
);
110 void SetStyle(int line
, int style
);
111 void SetStyles(int line
, const unsigned char *styles
);
112 int Length(int line
) const;
113 int Lines(int line
) const;