From 327e870962e53a9ae809f588d520f216274679ed Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 26 Mar 2008 10:08:17 +0000 Subject: (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik. --- src/textbuf_gui.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/textbuf_gui.h') diff --git a/src/textbuf_gui.h b/src/textbuf_gui.h index 5f0f6bd78..4a7f70c85 100644 --- a/src/textbuf_gui.h +++ b/src/textbuf_gui.h @@ -7,6 +7,7 @@ #include "window_type.h" #include "string_type.h" +#include "strings_type.h" struct Textbuf { char *buf; ///< buffer in which text is saved @@ -26,6 +27,8 @@ struct querystr_d { }; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d)); +extern char _edit_str_buf[64]; +extern char _orig_str_buf[lengthof(_edit_str_buf)]; void DrawEditBox(Window *w, querystr_d *string, int wid); void HandleEditBox(Window *w, querystr_d *string, int wid); @@ -43,4 +46,16 @@ void UpdateTextBufferSize(Textbuf *tb); void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter); void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool)); +/** The number of 'characters' on the on-screen keyboard. */ +static const uint OSK_KEYBOARD_ENTRIES = 50; + +/** + * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these + * have to be UTF-8 encoded, which means up to 4 bytes per character. + * Furthermore the string needs to be '\0'-terminated. + */ +extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1]; + +void ShowOnScreenKeyboard(Window *parent, querystr_d *q, int button, int cancel, int ok); + #endif /* TEXTBUF_GUI_H */ -- cgit v1.2.3-54-g00ecf