Horizon
main_window.hpp
1 #pragma once
2 #include "common/common.hpp"
3 #include <gtkmm.h>
4 
5 namespace horizon {
6 
7 class MainWindow : public Gtk::ApplicationWindow {
8 public:
9  MainWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x);
10  static MainWindow *create();
11  class CanvasGL *canvas = nullptr;
12  Gtk::Label *tool_hint_label = nullptr;
13  Gtk::Label *cursor_label = nullptr;
14  Gtk::Box *left_panel = nullptr;
15  Gtk::Box *grid_box = nullptr;
16  Gtk::Label *grid_mul_label = nullptr;
17  Gtk::Label *selection_label = nullptr;
18  Gtk::Viewport *property_viewport = nullptr;
19  Gtk::ScrolledWindow *property_scrolled_window = nullptr;
20  Gtk::Revealer *property_throttled_revealer = nullptr;
21  Gtk::HeaderBar *header = nullptr;
22  Glib::RefPtr<Gtk::Builder> builder;
23 
24  Gtk::Button *pool_reload_button = nullptr;
25 
26  Gtk::SearchEntry *search_entry = nullptr;
27  Gtk::Button *search_previous_button = nullptr;
28  Gtk::Button *search_next_button = nullptr;
29  Gtk::Label *search_status_label = nullptr;
30  Gtk::Revealer *search_revealer = nullptr;
31  Gtk::Expander *search_expander = nullptr;
32  Gtk::Box *search_types_box = nullptr;
33  Gtk::Label *selection_mode_label = nullptr;
34 
35  void tool_bar_set_visible(bool v);
36  void tool_bar_set_tool_name(const std::string &s);
37  void tool_bar_set_tool_tip(const std::string &s);
38  void tool_bar_flash(const std::string &s);
39 
40  void hud_update(const std::string &s);
41  void hud_hide();
42 
43  void show_nonmodal(const std::string &la, const std::string &button, std::function<void(void)> fn,
44  const std::string &la2 = "");
45 
46  // virtual ~MainWindow();
47 private:
48  Gtk::Box *gl_container = nullptr;
49  Gtk::Revealer *tool_bar = nullptr;
50  Gtk::Label *tool_bar_name_label = nullptr;
51  Gtk::Label *tool_bar_tip_label = nullptr;
52  Gtk::Label *tool_bar_flash_label = nullptr;
53  Gtk::Stack *tool_bar_stack = nullptr;
54  sigc::connection tip_timeout_connection;
55  bool tool_bar_queue_close = false;
56 
57  Gtk::Revealer *hud = nullptr;
58  Gtk::Label *hud_label = nullptr;
59 
60  sigc::connection hud_timeout_connection;
61  bool hud_queue_close = false;
62 
63  Gtk::Button *nonmodal_close_button = nullptr;
64  Gtk::Button *nonmodal_button = nullptr;
65  Gtk::Revealer *nonmodal_rev = nullptr;
66  Gtk::Label *nonmodal_label = nullptr;
67  Gtk::Label *nonmodal_label2 = nullptr;
68  std::function<void(void)> nonmodal_fn;
69 
70  void sc(void);
71  void cm(const horizon::Coordi &cursor_pos);
72 };
73 } // namespace horizon
horizon::CanvasGL
Definition: canvas_gl.hpp:15
horizon::MainWindow
Definition: main_window.hpp:7
horizon::Coord< int64_t >