summaryrefslogtreecommitdiff
path: root/src/textbuf_type.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-06-04 15:30:29 +0000
committerfrosch <frosch@openttd.org>2012-06-04 15:30:29 +0000
commitd58eee1e7945098f32e2d4419506ce1a81f3e4d6 (patch)
treed5b61295290e921e8dff31d1bd73d149c84c113a /src/textbuf_type.h
parent31eb896143ca5a38c0dc7355921393f357c5a383 (diff)
downloadopenttd-d58eee1e7945098f32e2d4419506ce1a81f3e4d6.tar.xz
(svn r24324) -Codechange: Turn functions dealing with Textbufs into member functions.
Diffstat (limited to 'src/textbuf_type.h')
-rw-r--r--src/textbuf_type.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/textbuf_type.h b/src/textbuf_type.h
index 717630230..0c4208f53 100644
--- a/src/textbuf_type.h
+++ b/src/textbuf_type.h
@@ -23,17 +23,21 @@ 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
-};
-bool HandleCaret(Textbuf *tb);
+ void Initialize(char *buf, uint16 max_bytes);
+ void Initialize(char *buf, uint16 max_bytes, uint16 max_chars);
+
+ void DeleteAll();
+ bool DeleteChar(int delmode);
+ bool InsertChar(uint32 key);
+ bool InsertClipboard();
+ bool MovePos(int navmode);
-void DeleteTextBufferAll(Textbuf *tb);
-bool DeleteTextBufferChar(Textbuf *tb, int delmode);
-bool InsertTextBufferChar(Textbuf *tb, uint32 key);
-bool InsertTextBufferClipboard(Textbuf *tb);
-bool MoveTextBufferPos(Textbuf *tb, int navmode);
-void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 max_bytes);
-void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 max_bytes, uint16 max_chars);
-void UpdateTextBufferSize(Textbuf *tb);
+ bool HandleCaret();
+ void UpdateSize();
+
+private:
+ void DelChar(bool backspace);
+};
#endif /* TEXTBUF_TYPE_H */