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-04-09 21:39:03 +04:00
|
|
|
#include "string.hh"
|
|
|
|
#include "utils.hh"
|
2013-09-16 22:15:13 +04:00
|
|
|
#include "display_buffer.hh"
|
2013-11-15 01:12:59 +04:00
|
|
|
#include "input_handler.hh"
|
2014-04-08 00:25:44 +04:00
|
|
|
#include "env_vars.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;
|
2013-11-14 22:09:15 +04:00
|
|
|
|
|
|
|
class Client : public SafeCountable
|
|
|
|
{
|
|
|
|
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();
|
|
|
|
|
|
|
|
// 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(); }
|
|
|
|
|
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:
|
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-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
|