2013-09-13 01:47:23 +04:00
|
|
|
#ifndef client_hh_INCLUDED
|
|
|
|
#define client_hh_INCLUDED
|
2012-06-06 03:15:19 +04:00
|
|
|
|
2013-09-16 22:15:13 +04:00
|
|
|
#include "display_buffer.hh"
|
2014-04-08 00:25:44 +04:00
|
|
|
#include "env_vars.hh"
|
2014-08-12 03:30:13 +04:00
|
|
|
#include "input_handler.hh"
|
|
|
|
#include "safe_ptr.hh"
|
|
|
|
#include "utils.hh"
|
2014-11-11 02:29:16 +03:00
|
|
|
#include "option_manager.hh"
|
2012-06-06 03:15:19 +04:00
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2013-11-15 01:12:59 +04:00
|
|
|
class UserInterface;
|
2013-12-21 00:10:08 +04:00
|
|
|
class Window;
|
2014-11-13 00:27:07 +03:00
|
|
|
class String;
|
2013-11-14 22:09:15 +04:00
|
|
|
|
2014-11-11 02:29:16 +03:00
|
|
|
class Client : public SafeCountable, public OptionManagerWatcher
|
2013-11-14 22:09:15 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-12-21 00:10:08 +04:00
|
|
|
Client(std::unique_ptr<UserInterface>&& ui,
|
|
|
|
std::unique_ptr<Window>&& window,
|
2014-04-08 00:25:44 +04:00
|
|
|
SelectionList selections,
|
|
|
|
EnvVarMap env_vars,
|
|
|
|
String name);
|
2013-11-14 22:09:15 +04:00
|
|
|
~Client();
|
|
|
|
|
2014-11-11 02:29:16 +03:00
|
|
|
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();
|
|
|
|
|
2013-09-16 22:15:13 +04:00
|
|
|
void print_status(DisplayLine status_line);
|
|
|
|
|
|
|
|
void redraw_ifn();
|
|
|
|
|
2013-09-13 01:39:34 +04:00
|
|
|
UserInterface& ui() const { return *m_ui; }
|
2013-12-21 00:10:08 +04:00
|
|
|
Window& window() const { return *m_window; }
|
2013-10-15 21:50:43 +04:00
|
|
|
|
2013-10-15 21:51:31 +04:00
|
|
|
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(); }
|
|
|
|
|
2014-08-12 22:24:09 +04:00
|
|
|
InputHandler& input_handler() { return m_input_handler; }
|
|
|
|
const InputHandler& input_handler() const { return m_input_handler; }
|
|
|
|
|
2013-12-21 00:10:08 +04:00
|
|
|
void change_buffer(Buffer& buffer);
|
2013-10-11 00:34:19 +04:00
|
|
|
|
2014-04-08 00:25:44 +04:00
|
|
|
const String& get_env_var(const String& name) const;
|
|
|
|
|
2013-12-21 00:10:08 +04:00
|
|
|
private:
|
2014-11-11 02:29:16 +03:00
|
|
|
void on_option_changed(const Option& option) override;
|
|
|
|
|
2013-10-11 00:34:19 +04:00
|
|
|
DisplayLine generate_mode_line() const;
|
|
|
|
|
2013-09-13 01:39:34 +04:00
|
|
|
std::unique_ptr<UserInterface> m_ui;
|
2013-12-21 00:10:08 +04:00
|
|
|
std::unique_ptr<Window> m_window;
|
|
|
|
|
2014-04-08 00:25:44 +04:00
|
|
|
EnvVarMap m_env_vars;
|
|
|
|
|
2013-12-21 00:10:08 +04:00
|
|
|
InputHandler m_input_handler;
|
2013-02-18 17:07:30 +04:00
|
|
|
|
2013-09-16 22:15:13 +04:00
|
|
|
DisplayLine m_status_line;
|
2014-08-12 22:19:46 +04:00
|
|
|
DisplayLine m_pending_status_line;
|
2014-07-07 23:13:08 +04:00
|
|
|
DisplayLine m_mode_line;
|
2012-06-06 03:15:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-09-13 01:47:23 +04:00
|
|
|
#endif // client_hh_INCLUDED
|