Horizon
prj-mgr-app.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "util/uuid.hpp"
4 #include <glibmm/datetime.h>
5 #include <gtkmm.h>
6 #include <map>
7 #include <zmq.hpp>
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
13 public:
14  ProjectManagerPool(const json &j, const std::string &p);
15  std::string path;
16  std::string name;
17  UUID uuid;
18  UUID default_via;
19 };
20 
21 class ProjectManagerApplication : public Gtk::Application {
22 protected:
24 
25 public:
26  static Glib::RefPtr<ProjectManagerApplication> create();
27  std::map<UUID, ProjectManagerPool> pools;
28  std::deque<UUID> part_favorites;
29  void add_pool(const std::string &p);
30  std::string get_config_filename();
31  const std::string &get_ep_broadcast() const;
32  void send_json(int pid, const json &j);
33  zmq::context_t zctx;
34 
35  std::map<std::string, Glib::DateTime> recent_items;
36 
37 protected:
38  // Override default signal handlers:
39  void on_activate() override;
40  void on_startup() override;
41  void on_shutdown();
42  void on_open(const Gio::Application::type_vec_files &files, const Glib::ustring &hint) override;
43 
44  std::string sock_broadcast_ep;
45 
46 private:
47  class ProjectManagerAppWindow *create_appwindow();
48  void on_hide_window(Gtk::Window *window);
49  void on_action_quit();
50  void on_action_preferences();
51 
52 public:
53  zmq::socket_t sock_broadcast;
54 };
55 } // namespace horizon
Definition: prj-mgr-app_win.hpp:64
a class to store JSON values
Definition: json.hpp:161
Definition: prj-mgr-app.hpp:21
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: block.cpp:7
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
Definition: prj-mgr-app.hpp:12