summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-11-05 19:15:42 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-11-05 19:15:42 +0100
commitfedabb417604ceeae1f30e486f2142bb407a1411 (patch)
treedbf24860424b7170bf397d2f1da0844eb5d9d89c /src/buffer.hh
parent42315c4b5c995ba13b3d20d9abf3df5129ce3015 (diff)
Rework Window creation, avoid using the same window in multiple clients
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/buffer.hh b/src/buffer.hh
index d955bb14..f38de731 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -143,8 +143,11 @@ public:
const String& name() const { return m_name; }
- Window* get_or_create_window();
- void delete_window(Window* window);
+ // Window handling
+ using WindowList = std::vector<std::unique_ptr<Window>>;
+ const WindowList& windows() const { return m_windows; }
+ Window& new_window();
+ void delete_window(Window& window);
// returns true if the buffer is in a different state than
// the last time it was saved
@@ -216,7 +219,7 @@ private:
void apply_modification(const Modification& modification);
void revert_modification(const Modification& modification);
- std::list<std::unique_ptr<Window>> m_windows;
+ WindowList m_windows;
size_t m_last_save_undo_index;
size_t m_timestamp;