Horizon
editor_window.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "common/common.hpp"
4 #include <memory>
5 #include "editor_interface.hpp"
6 #include "util/window_state_store.hpp"
7 #include "util/pool_goto_provider.hpp"
8 
9 namespace horizon {
11 public:
12  EditorWindowStore(const std::string &fn);
13  void save();
14  virtual void save_as(const std::string &fn) = 0;
15  std::string filename;
16  virtual ~EditorWindowStore()
17  {
18  }
19 };
20 
21 class EditorWindow : public Gtk::Window, public PoolGotoProvider {
22 public:
23  EditorWindow(ObjectType type, const std::string &filename, class Pool *p, bool read_only);
24  void reload();
25  bool get_need_update();
26  static std::string fix_filename(std::string s);
27  void save();
28  void force_close();
29  bool get_needs_save();
30 
31 private:
32  ObjectType type;
33  std::unique_ptr<EditorWindowStore> store = nullptr;
34  PoolEditorInterface *iface = nullptr;
35  Gtk::Button *save_button = nullptr;
36  class Pool *pool;
37  bool need_update = false;
38 
39  WindowStateStore state_store;
40 };
41 } // namespace horizon
Definition: editor_window.hpp:10
Definition: pool_goto_provider.hpp:7
Definition: window_state_store.hpp:20
Definition: editor_interface.hpp:5
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
Definition: block.cpp:9
Definition: editor_window.hpp:21