mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-11 02:28:18 +00:00
24 lines
442 B
C++
24 lines
442 B
C++
|
|
||
|
// 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; }
|
||
|
};
|