diff options
| author | nyamatongwe <unknown> | 2009-04-12 09:32:53 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2009-04-12 09:32:53 +0000 | 
| commit | 01355323d119b4c7b74d11f5012099813afa3031 (patch) | |
| tree | 20390b4aacfaa851b870a4236d2d33bf40f9c65c /src/PerLine.h | |
| parent | 001550a0de196eca314eea792bfada74a19773b1 (diff) | |
| download | scintilla-mirror-01355323d119b4c7b74d11f5012099813afa3031.tar.gz | |
Annotations and text margins added.
Diffstat (limited to 'src/PerLine.h')
| -rw-r--r-- | src/PerLine.h | 104 | 
1 files changed, 104 insertions, 0 deletions
| diff --git a/src/PerLine.h b/src/PerLine.h new file mode 100644 index 000000000..471219131 --- /dev/null +++ b/src/PerLine.h @@ -0,0 +1,104 @@ +// Scintilla source code edit control +/** @file PerLine.h + ** Manages data associated with each line of the document + **/ +// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +/** + * This holds the marker identifier and the marker type to display. + * MarkerHandleNumbers are members of lists. + */ +struct MarkerHandleNumber { +	int handle; +	int number; +	MarkerHandleNumber *next; +}; + +/** + * A marker handle set contains any number of MarkerHandleNumbers. + */ +class MarkerHandleSet { +	MarkerHandleNumber *root; + +public: +	MarkerHandleSet(); +	~MarkerHandleSet(); +	int Length() const; +	int NumberFromHandle(int handle) const; +	int MarkValue() const;	///< Bit set of marker numbers. +	bool Contains(int handle) const; +	bool InsertHandle(int handle, int markerNum); +	void RemoveHandle(int handle); +	bool RemoveNumber(int markerNum); +	void CombineWith(MarkerHandleSet *other); +}; + +class LineMarkers : public PerLine { +	SplitVector<MarkerHandleSet *> markers; +	/// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big. +	int handleCurrent; +public: +	LineMarkers() : handleCurrent(0) { +	} +	virtual ~LineMarkers(); +	virtual void InsertLine(int line); +	virtual void RemoveLine(int line); + +	int MarkValue(int line); +	int AddMark(int line, int marker, int lines); +	void MergeMarkers(int pos); +	void DeleteMark(int line, int markerNum, bool all); +	void DeleteMarkFromHandle(int markerHandle); +	int LineFromHandle(int markerHandle); +}; + +class LineLevels : public PerLine { +	SplitVector<int> levels; +public: +	virtual ~LineLevels(); +	virtual void InsertLine(int line); +	virtual void RemoveLine(int line); + +	void ExpandLevels(int sizeNew=-1); +	void ClearLevels(); +	int SetLevel(int line, int level, int lines); +	int GetLevel(int line); +}; + +class LineState : public PerLine { +	SplitVector<int> lineStates; +public: +	LineState() { +	} +	virtual ~LineState(); +	virtual void InsertLine(int line); +	virtual void RemoveLine(int line); + +	int SetLineState(int line, int state); +	int GetLineState(int line); +	int GetMaxLineState(); +}; + +class LineAnnotation : public PerLine { +	SplitVector<char *> annotations; +public: +	LineAnnotation() { +	} +	virtual ~LineAnnotation(); +	virtual void InsertLine(int line); +	virtual void RemoveLine(int line); + +	bool AnySet() const; +	bool MultipleStyles(int line) const; +	int Style(int line); +	const char *Text(int line) const; +	const char *Styles(int line) const; +	void SetText(int line, const char *text); +	void ClearAll(); +	void SetStyle(int line, int style); +	void SetStyles(int line, const char *styles); +	int Length(int line) const; +	int Lines(int line) const; +}; + | 
