diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-09-08 00:13:19 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-09-08 00:13:19 +0000 |
| commit | d3499ecd9cc7b2b685d1bc96ac7591f29a1752ce (patch) | |
| tree | f66659eac5163b4c27f599e3fe29b9a3f94d20c7 /src/buffer.hh | |
| parent | 535e2005870ce6e0822418307bde22b09b8db3df (diff) | |
Window lifetime is now handled by it's buffer.
A window cannot outlive it's buffer, so it makes sense to keep only a
reference on it hand have the buffer manage the window lifetime.
Diffstat (limited to 'src/buffer.hh')
| -rw-r--r-- | src/buffer.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buffer.hh b/src/buffer.hh index 60306647..28a87fc4 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -3,6 +3,8 @@ #include <string> #include <vector> +#include <list> +#include <memory> #include "utils.hh" @@ -10,6 +12,8 @@ namespace Kakoune { class Buffer; +class Window; + typedef int BufferPos; typedef int BufferSize; typedef char BufferChar; @@ -96,6 +100,9 @@ public: const BufferString& content() const { return m_content; } + void register_window(Window* window); + void delete_window(Window* window); + private: BufferChar at(BufferPos position) const; @@ -140,6 +147,8 @@ private: void revert_modification(const Modification& modification); void append_modification(Modification&& modification); + + std::list<std::unique_ptr<Window>> m_windows; }; } |
