1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-22 19:11:40 +03:00
kakoune/src/client.hh

77 lines
1.7 KiB
C++
Raw Normal View History

2013-09-13 01:47:23 +04:00
#ifndef client_hh_INCLUDED
#define client_hh_INCLUDED
#include "display_buffer.hh"
#include "env_vars.hh"
#include "input_handler.hh"
#include "safe_ptr.hh"
#include "utils.hh"
#include "option_manager.hh"
namespace Kakoune
{
class UserInterface;
class Window;
2014-11-13 00:27:07 +03:00
class String;
struct Key;
enum class EventMode;
2013-11-14 22:09:15 +04:00
class Client : public SafeCountable, public OptionManagerWatcher
2013-11-14 22:09:15 +04:00
{
public:
Client(std::unique_ptr<UserInterface>&& ui,
std::unique_ptr<Window>&& window,
SelectionList selections,
EnvVarMap env_vars,
String name);
2013-11-14 22:09:15 +04:00
~Client();
Client(Client&&) = delete;
2013-11-14 22:09:15 +04:00
// handle all the keys currently available in the user interface
void handle_available_input(EventMode mode);
2013-11-14 22:09:15 +04:00
void print_status(DisplayLine status_line);
void redraw_ifn();
UserInterface& ui() const { return *m_ui; }
Window& window() const { return *m_window; }
void check_buffer_fs_timestamp();
2013-11-14 22:09:15 +04:00
Context& context() { return m_input_handler.context(); }
const Context& context() const { return m_input_handler.context(); }
InputHandler& input_handler() { return m_input_handler; }
const InputHandler& input_handler() const { return m_input_handler; }
void change_buffer(Buffer& buffer);
const String& get_env_var(const String& name) const;
private:
void on_option_changed(const Option& option) override;
DisplayLine generate_mode_line() const;
std::unique_ptr<UserInterface> m_ui;
std::unique_ptr<Window> m_window;
EnvVarMap m_env_vars;
InputHandler m_input_handler;
DisplayLine m_status_line;
DisplayLine m_pending_status_line;
DisplayLine m_mode_line;
std::vector<Key> m_pending_keys;
};
}
2013-09-13 01:47:23 +04:00
#endif // client_hh_INCLUDED