Update Scintilla to version 3.7.5 (#1503)
[geany-mirror.git] / scintilla / src / Decoration.h
blobd096da385d8430a55c42318f48fdb306ac699db4
1 /** @file Decoration.h
2 ** Visual elements added over text.
3 **/
4 // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
5 // The License.txt file describes the conditions under which this software may be distributed.
7 #ifndef DECORATION_H
8 #define DECORATION_H
10 #ifdef SCI_NAMESPACE
11 namespace Scintilla {
12 #endif
14 class Decoration {
15 int indicator;
16 public:
17 RunStyles rs;
19 explicit Decoration(int indicator_);
20 ~Decoration();
22 bool Empty() const;
23 int Indicator() const {
24 return indicator;
28 class DecorationList {
29 int currentIndicator;
30 int currentValue;
31 Decoration *current; // Cached so FillRange doesn't have to search for each call.
32 int lengthDocument;
33 // Ordered by indicator
34 std::vector<std::unique_ptr<Decoration>> decorationList;
35 std::vector<const Decoration*> decorationView; // Read-only view of decorationList
36 bool clickNotified;
38 Decoration *DecorationFromIndicator(int indicator);
39 Decoration *Create(int indicator, int length);
40 void Delete(int indicator);
41 void DeleteAnyEmpty();
42 void SetView();
43 public:
45 DecorationList();
46 ~DecorationList();
48 const std::vector<const Decoration*> &View() const { return decorationView; }
50 void SetCurrentIndicator(int indicator);
51 int GetCurrentIndicator() const { return currentIndicator; }
53 void SetCurrentValue(int value);
54 int GetCurrentValue() const { return currentValue; }
56 // Returns true if some values may have changed
57 bool FillRange(int &position, int value, int &fillLength);
59 void InsertSpace(int position, int insertLength);
60 void DeleteRange(int position, int deleteLength);
62 void DeleteLexerDecorations();
64 int AllOnFor(int position) const;
65 int ValueAt(int indicator, int position);
66 int Start(int indicator, int position);
67 int End(int indicator, int position);
69 bool ClickNotified() const {
70 return clickNotified;
72 void SetClickNotified(bool notified) {
73 clickNotified = notified;
77 #ifdef SCI_NAMESPACE
79 #endif
81 #endif