diff -r a76af67a3a4b -r 7b156b764d11 sources/interface.h --- a/sources/interface.h Sat Jan 09 02:35:00 2016 +0200 +++ b/sources/interface.h Sat Jan 09 17:41:21 2016 +0200 @@ -33,6 +33,9 @@ #include "network/ipaddress.h" #include "coloredline.h" #include "network/rconsession.h" +#include "coloredline.h" + +BEGIN_ZFC_NAMESPACE class Interface { @@ -57,6 +60,7 @@ void tab_complete (const String& part, String complete); RCONSession* get_session() { return &Session; } void disconnected(); + void handle_command(const String& input); void vprint (const char* fmtstr, va_list args); void __cdecl print (const char* fmtstr, ...); @@ -65,20 +69,20 @@ private: StringList InputHistory; - int InputCursor = 0; - int CursorPosition = 0; - int InputPanning = 0; - bool NeedRefresh = false; - bool NeedStatusBarRender = false; - bool NeedInputRender = false; - bool NeedOutputRender = false; - bool NeedNicklistRender = false; + int InputCursor; + int CursorPosition; + int InputPanning; + bool NeedRefresh; + bool NeedStatusBarRender; + bool NeedInputRender; + bool NeedOutputRender; + bool NeedNicklistRender; struct { char ch; int x; } CursorCharacter; Vector OutputLines; - int OutputScroll = 0; + int OutputScroll; String Title; - InputState CurrentInputState = INPUTSTATE_NORMAL; - Function DisconnectConfirmFunction = nullptr; + InputState CurrentInputState; + std::function DisconnectConfirmFunction; IPAddress CurrentAddress; String StatusBarText; StringList PlayerNames; @@ -86,7 +90,7 @@ RCONSession Session; void render_titlebar(); - void safe_disconnect (Function afterwards); + void safe_disconnect (std::function afterwards); int render_colorline (int y, int x0, int width, const ColoredLine& line, bool allowWrap); int nicklist_width(); void render_output(); @@ -94,15 +98,17 @@ void render_input(); void render_statusbar(); void position_cursor(); - int color_pair (Color fg, Color bg); + chtype color_pair (Color fg, Color bg); const String& current_input(); void detach_input(); String& mutable_current_input(); void move_input_cursor (int delta); String prompt_string(); void set_input_state (InputState newstate); - void print_to_console (String a); + void print_to_console (String message); void yank (int a, int b); int find_previous_word(); int find_next_word(); }; + +END_ZFC_NAMESPACE