blob: cf42a7a5ccac33a25e61abf17d441a29b968670e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// line input helter
class LINEINPUT
{
char str[256];
unsigned len;
unsigned cursor_pos;
public:
class CALLBACK
{
public:
virtual ~CALLBACK() {}
virtual bool event(INPUT_EVENT e) = 0;
};
LINEINPUT();
void clear();
void process_input(INPUT_EVENT e);
void set(const char *string);
const char *get_string() const { return str; }
int get_length() const { return len; }
unsigned cursor_offset() const { return cursor_pos; }
};
|