diff options
author | Joursoir <chat@joursoir.net> | 2020-11-22 01:34:39 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-11-22 01:34:39 +0300 |
commit | 3db205de39289ee249cd4587ede88249963201f7 (patch) | |
tree | 396706591d10a8bf6eea591d4f27428f71ec599a /src/client/clui.hpp | |
parent | 83645ac2b31ed10aecb00d660399c0a4d3ce4df2 (diff) | |
download | want-chat-3db205de39289ee249cd4587ede88249963201f7.tar.gz want-chat-3db205de39289ee249cd4587ede88249963201f7.tar.bz2 want-chat-3db205de39289ee249cd4587ede88249963201f7.zip |
start feature: clui
Diffstat (limited to 'src/client/clui.hpp')
-rw-r--r-- | src/client/clui.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/client/clui.hpp b/src/client/clui.hpp new file mode 100644 index 0000000..ff447ef --- /dev/null +++ b/src/client/clui.hpp @@ -0,0 +1,57 @@ +// CLUI - Command Line User Interface + +#ifndef COMMANDLINEUI_H +#define COMMANDLINEUI_H + +#include <ncurses.h> + +class Interface_wc { + WINDOW *w; + int ny, nx; + int beg_y, beg_x; +public: + Interface_wc(int num_y, int num_x, int by, int bx, char ch); + + WINDOW *GetWindow() { return w; } + void Update() { wrefresh(w); } + void Delete() { delwin(w); } + + void Hide(); +}; + +class SelectionMenu : public Interface_wc { + char const *title; + const char**choises; + int choises_number; + int current_choice; + +public: + SelectionMenu(char const *i_title, const char**i_choises, int choises_num, + int num_y, int num_x, int by, int bx, char ch); + + int Handling(); +}; + +class ChatRoom { + Interface_wc *chat; + Interface_wc *players; + Interface_wc *input; + int i_nx, i_ny; +public: + ChatRoom(); + ~ChatRoom(); + + // for chat: + void PrintMessage(const char *msg); + + // for players: + //void AddPlayer() + + // for input: + bool AddCharToSendMsg(char ch); + bool RemoveCharFromMsg(); + + WINDOW *GetWin() { return input->GetWindow(); } +}; + +#endif
\ No newline at end of file |