summaryrefslogtreecommitdiff
path: root/src/textbuf_type.h
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2013-08-05 20:37:22 +0000
committermichi_cc <michi_cc@openttd.org>2013-08-05 20:37:22 +0000
commit64d2fc4d1e4124a55ccee8c4a4c6e43d1c2ae9fe (patch)
tree90f51bd4c12f00dbd8daac0075d25a1972f85329 /src/textbuf_type.h
parentcbdfd31a3c4607501d3869af87695b524b51a911 (diff)
downloadopenttd-64d2fc4d1e4124a55ccee8c4a4c6e43d1c2ae9fe.tar.xz
(svn r25683) -Add: Support for a marked/selected range to the textbuf.
Diffstat (limited to 'src/textbuf_type.h')
-rw-r--r--src/textbuf_type.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/textbuf_type.h b/src/textbuf_type.h
index 7f3673623..910e7fa5f 100644
--- a/src/textbuf_type.h
+++ b/src/textbuf_type.h
@@ -40,6 +40,10 @@ struct Textbuf {
bool caret; ///< is the caret ("_") visible or not
uint16 caretpos; ///< the current position of the caret in the buffer, in bytes
uint16 caretxoffs; ///< the current position of the caret in pixels
+ uint16 markpos; ///< the start position of the marked area in the buffer, in bytes
+ uint16 markend; ///< the end position of the marked area in the buffer, in bytes
+ uint16 markxoffs; ///< the start position of the marked area in pixels
+ uint16 marklength; ///< the length of the marked area in pixels
explicit Textbuf(uint16 max_bytes, uint16 max_chars = UINT16_MAX);
~Textbuf();
@@ -62,6 +66,8 @@ struct Textbuf {
bool HandleCaret();
void UpdateSize();
+ void DiscardMarkedText(bool update = true);
+
private:
StringIterator *char_iter;
@@ -70,6 +76,7 @@ private:
void UpdateStringIter();
void UpdateWidth();
void UpdateCaretPosition();
+ void UpdateMarkedText();
};
#endif /* TEXTBUF_TYPE_H */