1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-19 09:21:30 +03:00
kakoune/src/user_interface.hh
Maxime Coste a32b49acd1 Rename ColorPair to Face and ColorRegistry to FaceRegistry
Face also stores the attributes
2014-07-11 00:27:43 +01:00

56 lines
1.3 KiB
C++

#ifndef user_interface_hh_INCLUDED
#define user_interface_hh_INCLUDED
#include "color.hh"
#include "keys.hh"
#include "memoryview.hh"
#include "utils.hh"
namespace Kakoune
{
class String;
class DisplayBuffer;
class DisplayLine;
struct CharCoord;
enum class MenuStyle
{
Prompt,
Inline
};
using InputCallback = std::function<void()>;
class UserInterface : public SafeCountable
{
public:
virtual ~UserInterface() {}
virtual void menu_show(memoryview<String> choices,
CharCoord anchor, Face fg, Face bg,
MenuStyle style) = 0;
virtual void menu_select(int selected) = 0;
virtual void menu_hide() = 0;
virtual void info_show(StringView title, StringView content,
CharCoord anchor, Face face,
MenuStyle style) = 0;
virtual void info_hide() = 0;
virtual void draw(const DisplayBuffer& display_buffer,
const DisplayLine& status_line,
const DisplayLine& mode_line) = 0;
virtual CharCoord dimensions() = 0;
virtual bool is_key_available() = 0;
virtual Key get_key() = 0;
virtual void refresh() = 0;
virtual void set_input_callback(InputCallback callback) = 0;
};
}
#endif // user_interface_hh_INCLUDED