diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-09-12 23:39:34 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-09-12 23:39:34 +0200 |
| commit | ac7e437730ecbe32f9e4e168a3ee4a7b7f3cd761 (patch) | |
| tree | cb5b0e413373ed209d092d476f0abf4a0eeb8209 /src/input_handler.hh | |
| parent | 916a0cb52e8637d0e6ec456363ef6412142945da (diff) | |
Move Client responsibilities to InputHandler
InputHandler owns it's UserInterface, and is directly stored by the ClientManager.
Diffstat (limited to 'src/input_handler.hh')
| -rw-r--r-- | src/input_handler.hh | 9 |
1 files changed, 8 insertions, 1 deletions
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<UserInterface>&& 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<UserInterface> m_ui; std::unique_ptr<InputMode> m_mode; std::vector<std::unique_ptr<InputMode>> m_mode_trash; + String m_name; + using Insertion = std::pair<InsertMode, std::vector<Key>>; Insertion m_last_insert = {InsertMode::Insert, {}}; |
