Horizon
Loading...
Searching...
No Matches
main_window.hpp
1#pragma once
2#include "common/common.hpp"
3#include <gtkmm.h>
4
5namespace horizon {
6
7class MainWindow : public Gtk::ApplicationWindow {
8public:
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_square = nullptr;
16 Gtk::Box *grid_box_rect = nullptr;
17 Gtk::Label *grid_mul_label = nullptr;
18 Gtk::Label *selection_label = nullptr;
19 Gtk::Viewport *property_viewport = nullptr;
20 Gtk::ScrolledWindow *property_scrolled_window = nullptr;
21 Gtk::Revealer *property_throttled_revealer = nullptr;
22 Gtk::HeaderBar *header = nullptr;
23 Glib::RefPtr<Gtk::Builder> builder;
24
25 Gtk::Button *pool_reload_button = nullptr;
26
27 Gtk::SearchEntry *search_entry = nullptr;
28 Gtk::Button *search_previous_button = nullptr;
29 Gtk::Button *search_next_button = nullptr;
30 Gtk::Label *search_status_label = nullptr;
31 Gtk::Revealer *search_revealer = nullptr;
32 Gtk::CheckButton *search_exact_cb = nullptr;
33 Gtk::Expander *search_expander = nullptr;
34 Gtk::Box *search_types_box = nullptr;
35 Gtk::Label *selection_mode_label = nullptr;
36 Gtk::MenuButton *view_options_button = nullptr;
37
38 Gtk::Revealer *action_bar_revealer = nullptr;
39 Gtk::Box *action_bar_box = nullptr;
40 void set_use_action_bar(bool u);
41
42 Gtk::RadioButton *grid_square_button = nullptr;
43 Gtk::RadioButton *grid_rect_button = nullptr;
44 Gtk::Grid *grid_grid = nullptr;
45 Gtk::Button *grid_reset_origin_button = nullptr;
46
47 Gtk::Button *grid_window_button = nullptr;
48
49 Gtk::ListBox *key_hint_box = nullptr;
50 Glib::RefPtr<Gtk::SizeGroup> key_hint_size_group;
51 void key_hint_set_visible(bool v);
52
53 Gtk::Revealer *instance_path_revealer = nullptr;
54 Gtk::Button *parent_block_button = nullptr;
55 Gtk::Box *instance_path_box = nullptr;
56 Gtk::Button *block_symbol_button = nullptr;
57 Gtk::Button *ports_button = nullptr;
58 Gtk::Stack *hierarchy_stack = nullptr;
59 Gtk::Label *out_of_hierarchy_label = nullptr;
60
61 Gtk::Button *undo_selection_button = nullptr;
62 Gtk::Button *redo_selection_button = nullptr;
63
64 Glib::SignalProxy<bool, const Glib::ustring &> signal_activate_hud_link()
65 {
66 return hud_label->signal_activate_link();
67 }
68
69
70 void tool_bar_set_visible(bool v);
71 void tool_bar_set_tool_name(const std::string &s);
72 void tool_bar_set_tool_tip(const std::string &s);
73 void tool_bar_flash(const std::string &s);
74 void tool_bar_flash_replace(const std::string &s);
75 void tool_bar_set_use_actions(bool use_actions);
76 void tool_bar_clear_actions();
77 void tool_bar_append_action(Gtk::Widget &w);
78 void tool_bar_set_vertical(bool vert);
79
80 void hud_update(const std::string &s);
81 void hud_hide();
82
83 void show_nonmodal(const std::string &la, const std::string &button, std::function<void(void)> fn,
84 const std::string &la2 = "");
85
86 void set_view_hints_label(const std::vector<std::string> &s);
87
88 void disable_grid_options();
89
90 void set_version_info(const std::string &s);
91
92 void set_undo_redo_hint(const std::string &s);
93
94 // virtual ~MainWindow();
95private:
96 Gtk::EventBox *gl_container = nullptr;
97
98 Gtk::Revealer *tool_bar = nullptr;
99 Gtk::Label *tool_bar_name_label = nullptr;
100 Gtk::Label *tool_bar_tip_label = nullptr;
101 Gtk::Label *tool_bar_flash_label = nullptr;
102 Gtk::Stack *tool_bar_stack = nullptr;
103 Gtk::Label *tool_bar_action_tip_label = nullptr;
104 Gtk::Box *tool_bar_box = nullptr;
105 Gtk::Box *tool_bar_actions_box = nullptr;
106 class ReflowBox *tool_bar_actions_reflow_box = nullptr;
107 sigc::connection tip_timeout_connection;
108 std::string flash_text;
109 bool tool_bar_queue_close = false;
110 void tool_bar_flash(const std::string &s, bool replace);
111
112 Gtk::Revealer *hud = nullptr;
113 Gtk::Label *hud_label = nullptr;
114
115 sigc::connection hud_timeout_connection;
116 bool hud_queue_close = false;
117
118 Gtk::Button *nonmodal_close_button = nullptr;
119 Gtk::Button *nonmodal_button = nullptr;
120 Gtk::Revealer *nonmodal_rev = nullptr;
121 Gtk::Label *nonmodal_label = nullptr;
122 Gtk::Label *nonmodal_label2 = nullptr;
123 std::function<void(void)> nonmodal_fn;
124
125 Gtk::Label *view_hints_label = nullptr;
126
127 Gtk::ToggleButton *grid_options_button = nullptr;
128 Gtk::Revealer *grid_options_revealer = nullptr;
129
130 Gtk::Stack *grid_box_stack = nullptr;
131
132 Gtk::InfoBar *version_info_bar = nullptr;
133 Gtk::Label *version_label = nullptr;
134
135 bool tool_bar_use_actions = false;
136
137 Gtk::Revealer *key_hint_revealer = nullptr;
138 sigc::connection key_hint_connection;
139 void update_key_hint_position();
140
141 Gtk::Frame *undo_redo_hint_frame = nullptr;
142 Gtk::Label *undo_redo_hint_label = nullptr;
143 sigc::connection undo_redo_hint_connection;
144};
145} // namespace horizon
Definition canvas_gl.hpp:20
Definition reflow_box.hpp:5