(svn r25683) -Add: Support for a marked/selected range to the textbuf.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user