2012-02-16 18:25:16 +04:00
|
|
|
#ifndef ncurses_hh_INCLUDED
|
|
|
|
#define ncurses_hh_INCLUDED
|
|
|
|
|
2012-08-30 23:53:22 +04:00
|
|
|
#include <ncurses.h>
|
|
|
|
#include <menu.h>
|
|
|
|
|
2012-09-24 21:24:27 +04:00
|
|
|
#include "user_interface.hh"
|
2012-02-16 18:25:16 +04:00
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2012-09-24 21:24:27 +04:00
|
|
|
class NCursesUI : public UserInterface
|
2012-02-16 18:25:16 +04:00
|
|
|
{
|
2012-06-06 03:15:19 +04:00
|
|
|
public:
|
2012-09-24 21:24:27 +04:00
|
|
|
NCursesUI();
|
|
|
|
~NCursesUI();
|
2012-02-16 18:25:16 +04:00
|
|
|
|
2012-09-24 21:24:27 +04:00
|
|
|
NCursesUI(const NCursesUI&) = delete;
|
|
|
|
NCursesUI& operator=(const NCursesUI&) = delete;
|
2012-02-16 18:25:16 +04:00
|
|
|
|
2012-09-03 16:22:02 +04:00
|
|
|
void draw_window(Window& window) override;
|
|
|
|
void print_status(const String& status, CharCount cursor_pos) override;
|
2012-06-06 03:15:19 +04:00
|
|
|
|
2012-09-03 16:22:02 +04:00
|
|
|
Key get_key() override;
|
2012-08-30 23:14:28 +04:00
|
|
|
|
2012-09-05 21:02:06 +04:00
|
|
|
void menu_show(const memoryview<String>& choices) override;
|
|
|
|
void menu_select(int selected) override;
|
|
|
|
void menu_hide() override;
|
2012-08-30 23:53:22 +04:00
|
|
|
private:
|
|
|
|
MENU* m_menu;
|
|
|
|
std::vector<ITEM*> m_items;
|
|
|
|
std::vector<String> m_choices;
|
2012-09-05 02:49:59 +04:00
|
|
|
|
|
|
|
int m_menu_fg;
|
|
|
|
int m_menu_bg;
|
2012-06-06 03:15:19 +04:00
|
|
|
};
|
2012-02-16 18:25:16 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ncurses_hh_INCLUDED
|
|
|
|
|