From 0380c999c3e3f0b6689a06ccace1fe80461a40f4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 24 Sep 2012 14:03:04 +0200 Subject: [PATCH] move Client::Mode class definition in client.cc --- src/client.cc | 17 +++++++++++++++++ src/client.hh | 15 ++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/client.cc b/src/client.cc index 8e172583..4ad21115 100644 --- a/src/client.cc +++ b/src/client.cc @@ -10,6 +10,19 @@ namespace Kakoune extern std::unordered_map> keymap; +class Client::Mode +{ +public: + Mode(Client& client) : m_client(client) {} + virtual ~Mode() {} + Mode(const Mode&) = delete; + Mode& operator=(const Mode&) = delete; + + virtual void on_key(const Key& key, Context& context) = 0; +protected: + Client& m_client; +}; + class Client::NormalMode : public Client::Mode { public: @@ -374,6 +387,10 @@ Client::Client() { } +Client::~Client() +{ +} + void Client::insert(Editor& editor, IncrementalInserter::Mode mode) { m_mode.reset(new InsertMode(*this, editor, mode)); diff --git a/src/client.hh b/src/client.hh index 14645080..4f1c5406 100644 --- a/src/client.hh +++ b/src/client.hh @@ -22,7 +22,7 @@ class Client : public SafeCountable { public: Client(); - virtual ~Client() {} + virtual ~Client(); virtual void draw_window(Window& window) = 0; virtual void print_status(const String& status, CharCount cursor_pos = -1) = 0; @@ -49,18 +49,7 @@ private: void reset_normal_mode(); std::pair> m_last_insert; - class Mode - { - public: - Mode(Client& client) : m_client(client) {} - virtual ~Mode() {} - Mode(const Mode&) = delete; - Mode& operator=(const Mode&) = delete; - - virtual void on_key(const Key& key, Context& context) = 0; - protected: - Client& m_client; - }; + class Mode; std::unique_ptr m_mode; class NormalMode;