From ac7e437730ecbe32f9e4e168a3ee4a7b7f3cd761 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 12 Sep 2013 23:39:34 +0200 Subject: Move Client responsibilities to InputHandler InputHandler owns it's UserInterface, and is directly stored by the ClientManager. --- src/input_handler.hh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/input_handler.hh') diff --git a/src/input_handler.hh b/src/input_handler.hh index 4089ac82..b4431a70 100644 --- a/src/input_handler.hh +++ b/src/input_handler.hh @@ -37,7 +37,7 @@ enum class InsertMode : unsigned; class InputHandler : public SafeCountable { public: - InputHandler(UserInterface& ui); + InputHandler(std::unique_ptr&& ui, Editor& editor, String name); ~InputHandler(); // switch to insert mode @@ -72,12 +72,19 @@ public: void stop_recording(); Context& context() { return m_context; } + const String& name() const { return m_name; } + + UserInterface& ui() const { return *m_ui; } private: Context m_context; friend class InputMode; + friend class ClientManager; + std::unique_ptr m_ui; std::unique_ptr m_mode; std::vector> m_mode_trash; + String m_name; + using Insertion = std::pair>; Insertion m_last_insert = {InsertMode::Insert, {}}; -- cgit v1.2.3