geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

PerLine.h
Go to the documentation of this file.
1// Scintilla source code edit control
2/** @file PerLine.h
3 ** Manages data associated with each line of the document
4 **/
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.
7
8#ifndef PERLINE_H
9#define PERLINE_H
10
11namespace Scintilla {
12
13/**
14 * This holds the marker identifier and the marker type to display.
15 * MarkerHandleNumbers are members of lists.
16 */
18 int handle;
19 int number;
20 MarkerHandleNumber(int handle_, int number_) noexcept : handle(handle_), number(number_) {}
21};
22
23/**
24 * A marker handle set contains any number of MarkerHandleNumbers.
25 */
27 std::forward_list<MarkerHandleNumber> mhList;
28
29public:
31 // Deleted so MarkerHandleSet objects can not be copied.
34 void operator=(const MarkerHandleSet &) = delete;
35 void operator=(MarkerHandleSet &&) = delete;
37 bool Empty() const noexcept;
38 int MarkValue() const noexcept; ///< Bit set of marker numbers.
39 bool Contains(int handle) const noexcept;
40 bool InsertHandle(int handle, int markerNum);
41 void RemoveHandle(int handle);
42 bool RemoveNumber(int markerNum, bool all);
43 void CombineWith(MarkerHandleSet *other) noexcept;
44 MarkerHandleNumber const *GetMarkerHandleNumber(int which) const noexcept;
45};
46
47class LineMarkers : public PerLine {
49 /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
51public:
52 LineMarkers() : handleCurrent(0) {
53 }
54 // Deleted so LineMarkers objects can not be copied.
55 LineMarkers(const LineMarkers &) = delete;
57 void operator=(const LineMarkers &) = delete;
58 void operator=(LineMarkers &&) = delete;
59 ~LineMarkers() override;
60 void Init() override;
61 void InsertLine(Sci::Line line) override;
62 void InsertLines(Sci::Line line, Sci::Line lines) override;
63 void RemoveLine(Sci::Line line) override;
64
65 int MarkValue(Sci::Line line) const noexcept;
66 Sci::Line MarkerNext(Sci::Line lineStart, int mask) const noexcept;
67 int AddMark(Sci::Line line, int markerNum, Sci::Line lines);
68 void MergeMarkers(Sci::Line line);
69 bool DeleteMark(Sci::Line line, int markerNum, bool all);
70 void DeleteMarkFromHandle(int markerHandle);
71 Sci::Line LineFromHandle(int markerHandle) const noexcept;
72 int HandleFromLine(Sci::Line line, int which) const noexcept;
73 int NumberFromLine(Sci::Line line, int which) const noexcept;
74};
75
76class LineLevels : public PerLine {
78public:
80 }
81 // Deleted so LineLevels objects can not be copied.
82 LineLevels(const LineLevels &) = delete;
83 LineLevels(LineLevels &&) = delete;
84 void operator=(const LineLevels &) = delete;
85 void operator=(LineLevels &&) = delete;
86 ~LineLevels() override;
87 void Init() override;
88 void InsertLine(Sci::Line line) override;
89 void InsertLines(Sci::Line line, Sci::Line lines) override;
90 void RemoveLine(Sci::Line line) override;
91
92 void ExpandLevels(Sci::Line sizeNew=-1);
93 void ClearLevels();
94 int SetLevel(Sci::Line line, int level, Sci::Line lines);
95 int GetLevel(Sci::Line line) const noexcept;
96};
97
98class LineState : public PerLine {
100public:
102 }
103 // Deleted so LineState objects can not be copied.
104 LineState(const LineState &) = delete;
105 LineState(LineState &&) = delete;
106 void operator=(const LineState &) = delete;
107 void operator=(LineState &&) = delete;
108 ~LineState() override;
109 void Init() override;
110 void InsertLine(Sci::Line line) override;
111 void InsertLines(Sci::Line line, Sci::Line lines) override;
112 void RemoveLine(Sci::Line line) override;
113
114 int SetLineState(Sci::Line line, int state);
115 int GetLineState(Sci::Line line);
116 Sci::Line GetMaxLineState() const noexcept;
117};
118
119class LineAnnotation : public PerLine {
121public:
123 }
124 // Deleted so LineAnnotation objects can not be copied.
127 void operator=(const LineAnnotation &) = delete;
128 void operator=(LineAnnotation &&) = delete;
129 ~LineAnnotation() override;
130 void Init() override;
131 void InsertLine(Sci::Line line) override;
132 void InsertLines(Sci::Line line, Sci::Line lines) override;
133 void RemoveLine(Sci::Line line) override;
134
135 bool MultipleStyles(Sci::Line line) const noexcept;
136 int Style(Sci::Line line) const noexcept;
137 const char *Text(Sci::Line line) const noexcept;
138 const unsigned char *Styles(Sci::Line line) const noexcept;
139 void SetText(Sci::Line line, const char *text);
140 void ClearAll();
141 void SetStyle(Sci::Line line, int style);
142 void SetStyles(Sci::Line line, const unsigned char *styles);
143 int Length(Sci::Line line) const noexcept;
144 int Lines(Sci::Line line) const noexcept;
145};
146
147typedef std::vector<int> TabstopList;
148
149class LineTabstops : public PerLine {
151public:
153 }
154 // Deleted so LineTabstops objects can not be copied.
155 LineTabstops(const LineTabstops &) = delete;
157 void operator=(const LineTabstops &) = delete;
158 void operator=(LineTabstops &&) = delete;
159 ~LineTabstops() override;
160 void Init() override;
161 void InsertLine(Sci::Line line) override;
162 void InsertLines(Sci::Line line, Sci::Line lines) override;
163 void RemoveLine(Sci::Line line) override;
164
165 bool ClearTabstops(Sci::Line line) noexcept;
166 bool AddTabstop(Sci::Line line, int x);
167 int GetNextTabstop(Sci::Line line, int x) const noexcept;
168};
169
170}
171
172#endif
SplitVector< std::unique_ptr< char[]> > annotations
Definition: PerLine.h:120
LineAnnotation(LineAnnotation &&)=delete
void operator=(LineAnnotation &&)=delete
LineAnnotation(const LineAnnotation &)=delete
void operator=(const LineAnnotation &)=delete
void operator=(const LineLevels &)=delete
SplitVector< int > levels
Definition: PerLine.h:77
void operator=(LineLevels &&)=delete
LineLevels(const LineLevels &)=delete
LineLevels(LineLevels &&)=delete
int handleCurrent
Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
Definition: PerLine.h:50
void operator=(const LineMarkers &)=delete
LineMarkers(LineMarkers &&)=delete
LineMarkers(const LineMarkers &)=delete
SplitVector< std::unique_ptr< MarkerHandleSet > > markers
Definition: PerLine.h:48
void operator=(LineMarkers &&)=delete
void operator=(const LineState &)=delete
SplitVector< int > lineStates
Definition: PerLine.h:99
LineState(LineState &&)=delete
void operator=(LineState &&)=delete
LineState(const LineState &)=delete
SplitVector< std::unique_ptr< TabstopList > > tabstops
Definition: PerLine.h:150
LineTabstops(const LineTabstops &)=delete
void operator=(LineTabstops &&)=delete
LineTabstops(LineTabstops &&)=delete
void operator=(const LineTabstops &)=delete
A marker handle set contains any number of MarkerHandleNumbers.
Definition: PerLine.h:26
MarkerHandleSet(const MarkerHandleSet &)=delete
int MarkValue() const noexcept
Bit set of marker numbers.
Definition: PerLine.cxx:40
MarkerHandleSet(MarkerHandleSet &&)=delete
MarkerHandleNumber const * GetMarkerHandleNumber(int which) const noexcept
Definition: PerLine.cxx:57
void CombineWith(MarkerHandleSet *other) noexcept
Definition: PerLine.cxx:87
bool Contains(int handle) const noexcept
Definition: PerLine.cxx:48
void RemoveHandle(int handle)
Definition: PerLine.cxx:71
bool Empty() const noexcept
Definition: PerLine.cxx:36
bool RemoveNumber(int markerNum, bool all)
Definition: PerLine.cxx:75
void operator=(const MarkerHandleSet &)=delete
std::forward_list< MarkerHandleNumber > mhList
Definition: PerLine.h:27
bool InsertHandle(int handle, int markerNum)
Definition: PerLine.cxx:66
void operator=(MarkerHandleSet &&)=delete
gchar * text
Definition: editor.c:83
vString * line
Definition: geany_cobol.c:133
ptrdiff_t Line
Definition: Position.h:20
Styling buffer using one element for each run rather than using a filled buffer.
Definition: Converter.h:9
std::vector< int > TabstopList
Definition: PerLine.h:147
long lines
Definition: stats.c:32
This holds the marker identifier and the marker type to display.
Definition: PerLine.h:17
MarkerHandleNumber(int handle_, int number_) noexcept
Definition: PerLine.h:20