sources/interface.h

branch
protocol5
changeset 131
4996c8684b93
parent 106
7b156b764d11
parent 127
6610b8b29848
child 133
4d8fa5394d67
equal deleted inserted replaced
130:9f54db6f9922 131:4996c8684b93
1 /* 1 /*
2 Copyright 2014, 2015 Teemu Piippo 2 Copyright 2014 - 2016 Teemu Piippo
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions 6 modification, are permitted provided that the following conditions
7 are met: 7 are met:
56 void update_statusbar(); 56 void update_statusbar();
57 void connect (String address, String password); 57 void connect (String address, String password);
58 void set_player_names (const StringList& names); 58 void set_player_names (const StringList& names);
59 void need_refresh(); 59 void need_refresh();
60 void tab_complete (const String& part, String complete); 60 void tab_complete (const String& part, String complete);
61 RCONSession* get_session() { return &Session; } 61 RCONSession* get_session() { return &m_session; }
62 void handle_command(const String& input);
62 void disconnected(); 63 void disconnected();
63 void handle_command(const String& input); 64
64
65 void vprint (const char* fmtstr, va_list args); 65 void vprint (const char* fmtstr, va_list args);
66 void __cdecl print (const char* fmtstr, ...); 66 void __cdecl print (const char* fmtstr, ...);
67 void __cdecl print_warning (const char* fmtstr, ...); 67 void __cdecl print_warning (const char* fmtstr, ...);
68 void __cdecl print_error (const char* fmtstr, ...); 68 void __cdecl print_error (const char* fmtstr, ...);
69 void __cdecl print_text (const char* fmtstr, ...);
69 70
70 private: 71 private:
71 StringList InputHistory; 72 StringList m_inputHistory;
72 int InputCursor; 73 int m_inputCursor;
73 int CursorPosition; 74 int m_cursorPosition;
74 int InputPanning; 75 int m_inputPanning;
75 bool NeedRefresh; 76 bool m_needRefresh;
76 bool NeedStatusBarRender; 77 bool m_needStatusBarRender;
77 bool NeedInputRender; 78 bool m_needInputRender;
78 bool NeedOutputRender; 79 bool m_needOutputRender;
79 bool NeedNicklistRender; 80 bool m_needNicklistRender;
80 struct { char ch; int x; } CursorCharacter; 81 struct { char ch; int x; } m_cursorCharacter;
81 Vector<ColoredLine> OutputLines; 82 Vector<ColoredLine> m_outputLines;
82 int OutputScroll; 83 int m_outputScroll;
83 String Title; 84 String m_title;
84 InputState CurrentInputState; 85 InputState m_inputState;
85 std::function<void (void)> DisconnectConfirmFunction; 86 std::function<void(bool)> m_disconnectCallback;
86 IPAddress CurrentAddress; 87 IPAddress m_remoteAddress;
87 String StatusBarText; 88 String m_statusBarText;
88 StringList PlayerNames; 89 StringList m_playerNames;
89 String PasteBuffer; 90 String m_pasteBuffer;
90 RCONSession Session; 91 RCONSession m_session;
91 92
92 void render_titlebar(); 93 void render_titlebar();
93 void safe_disconnect (std::function<void()> afterwards); 94 void safe_disconnect (std::function<void(bool)> afterwards);
94 int render_colorline (int y, int x0, int width, const ColoredLine& line, bool allowWrap); 95 int render_colorline (int y, int x0, int width, const ColoredLine& line, bool allowWrap);
95 int nicklist_width(); 96 int nicklist_width();
96 void render_output(); 97 void render_output();
97 void render_nicklist(); 98 void render_nicklist();
98 void render_input(); 99 void render_input();
107 void set_input_state (InputState newstate); 108 void set_input_state (InputState newstate);
108 void print_to_console (String message); 109 void print_to_console (String message);
109 void yank (int a, int b); 110 void yank (int a, int b);
110 int find_previous_word(); 111 int find_previous_word();
111 int find_next_word(); 112 int find_next_word();
113 void reset_title();
114 void flush_input();
112 }; 115 };
113 116
114 END_ZFC_NAMESPACE 117 END_ZFC_NAMESPACE

mercurial