41 void run(
int argc,
char *argv[]);
42 virtual void handle_tool_change(ToolID
id);
43 virtual void construct() = 0;
44 void canvas_update_from_pp();
48 void set_read_only(
bool v);
49 void set_suggested_filename(
const std::string &s);
50 enum class TempMode { YES, NO };
57 WORK_LAYER_ONLY_ENABLED,
65 std::vector<int> layers;
66 Flag flags = Flag::DEFAULT;
69 virtual std::map<ObjectType, SelectionFilterInfo> get_selection_filter_info()
const;
70 virtual bool is_layered()
const
81 Gtk::Menu *context_menu =
nullptr;
82 std::unique_ptr<SelectionFilterDialog> selection_filter_dialog;
83 std::optional<GridController> grid_controller;
86 std::unique_ptr<Pool> pool;
89 std::unique_ptr<Pool> real_pool_caching;
93 class Core *core =
nullptr;
94 std::unique_ptr<ClipboardBase> clipboard =
nullptr;
95 std::unique_ptr<ClipboardHandler> clipboard_handler =
nullptr;
96 std::unique_ptr<KeySequenceDialog> key_sequence_dialog =
nullptr;
97 std::unique_ptr<ImpInterface> imp_interface =
nullptr;
98 Glib::RefPtr<Glib::Binding> grid_spacing_binding;
100 std::map<ActionToolID, ActionConnection> action_connections;
110 zmq::socket_t sock_broadcast_rx;
111 zmq::socket_t sock_project;
112 bool sockets_connected =
false;
115 bool no_update =
false;
116 bool distraction_free =
false;
118 virtual void canvas_update() = 0;
119 virtual void expand_selection_for_property_panel(std::set<SelectableRef> &sel_extra,
120 const std::set<SelectableRef> &sel);
121 void handle_selection_changed(
void);
122 virtual void handle_selection_cross_probe()
125 bool handle_key_press(
const GdkEventKey *key_event);
126 void handle_cursor_move(
const Coordi &pos);
127 bool handle_click(
const GdkEventButton *button_event);
128 virtual void handle_extra_button(
const GdkEventButton *button_event)
131 bool handle_click_release(
const GdkEventButton *button_event);
132 bool handle_context_menu(
const GdkEventButton *button_event);
133 void tool_process(ToolResponse &resp);
134 void tool_begin(ToolID
id,
bool override_selection =
false,
const std::set<SelectableRef> &sel = {},
135 std::unique_ptr<ToolData> data =
nullptr);
136 void add_tool_button(ToolID
id,
const std::string &label,
bool left =
true);
137 void handle_warning_selected(
const Coordi &pos);
138 virtual bool handle_broadcast(
const json &j);
139 bool handle_close(
const GdkEventAny *ev);
142 bool trigger_action(ActionToolID action, ActionSource source = ActionSource::UNKNOWN);
144 void connect_go_to_project_manager_action();
146 void add_tool_action(ActionToolID
id,
const std::string &action);
147 void add_hamburger_menu();
149 Preferences preferences;
151 virtual const CanvasPreferences &get_canvas_preferences()
153 return preferences.canvas_non_layer;
155 virtual void apply_preferences();
157 std::unique_ptr<WindowStateStore> state_store =
nullptr;
159 virtual void handle_maybe_drag(
bool ctrl);
161 virtual ActionCatalogItem::Availability get_editor_type_for_action()
const = 0;
162 ObjectType get_editor_type()
const;
164 void layer_up_down(
bool up);
165 void goto_layer(
int layer);
167 Gtk::Button *create_action_button(ActionToolID action);
169 void set_action_sensitive(ActionID,
bool v);
170 bool get_action_sensitive(ActionID)
const;
171 virtual void update_action_sensitivity();
173 typedef sigc::signal<void> type_signal_action_sensitive;
174 type_signal_action_sensitive signal_action_sensitive()
176 return s_signal_action_sensitive;
179 virtual std::string get_hud_text(std::set<SelectableRef> &sel);
180 std::string get_hud_text_for_component(
const Component *comp);
181 virtual const Block &get_block_for_group_tag_names();
182 std::string get_hud_text_for_net(
const Net *net);
183 std::string get_hud_text_for_layers(
const std::set<int> &layers);
185 void set_monitor_files(
const std::set<std::string> &files);
186 void set_monitor_items(
const ItemSet &items);
187 virtual void update_monitor()
190 void edit_pool_item(ObjectType type,
const UUID &uu);
192 void parameter_window_add_polygon_expand(
class ParameterWindow *parameter_window);
194 bool read_only =
false;
196 void tool_update_data(std::unique_ptr<ToolData> data);
198 virtual void search_center(
const Searcher::SearchResult &res);
199 virtual ActionToolID get_doubleclick_action(ObjectType type,
const UUID &uu);
201 Glib::RefPtr<Gio::Menu> hamburger_menu;
205 static const std::string meta_suffix;
207 virtual void get_save_meta(
json &j)
211 virtual void set_window_title(
const std::string &s);
212 void set_window_title_from_block();
214 void update_view_hints();
215 virtual std::vector<std::string> get_view_hints();
217 Gtk::Box *view_options_menu =
nullptr;
218 void view_options_menu_append_action(
const std::string &label,
const std::string &action);
220 virtual Searcher *get_searcher_ptr()
227 return get_searcher_ptr();
230 Searcher &get_searcher()
232 auto s = get_searcher_ptr();
234 throw std::runtime_error(
"not implemented");
238 class ActionButton &add_action_button(ActionToolID action);
239 class ActionButtonMenu &add_action_button_menu(
const char *icon_name);
240 class ActionButton &add_action_button_polygon();
241 class ActionButton &add_action_button_line();
243 virtual ToolID get_tool_for_drag_move(
bool ctrl,
const std::set<SelectableRef> &sel)
const;
244 bool force_end_tool();
245 void reset_tool_hint_label();
247 std::set<ObjectRef> highlights;
249 virtual void update_highlights()
252 virtual void clear_highlights();
254 enum class ShowInPoolManagerPool { CURRENT, LAST };
255 void show_in_pool_manager(ObjectType type,
const UUID &uu, ShowInPoolManagerPool p);
257 virtual bool uses_dynamic_version()
const
262 virtual unsigned int get_required_version()
const
264 throw std::runtime_error(
"not implemented");
267 bool temp_mode =
false;
268 std::string suggested_filename;
271 void fix_cursor_pos();
272 Glib::RefPtr<Gio::FileMonitor> preferences_monitor;
274 void update_selection_label();
275 std::string get_tool_settings_filename(ToolID
id);
279 std::map<std::string, Glib::RefPtr<Gio::FileMonitor>> file_monitors;
280 sigc::connection file_monitor_delay_connection;
282 void handle_file_changed(
const Glib::RefPtr<Gio::File> &file1,
const Glib::RefPtr<Gio::File> &file2,
283 Gio::FileMonitorEvent ev);
285 void create_context_menu(Gtk::Menu *parent,
const std::set<SelectableRef> &sel);
286 Gtk::MenuItem *create_context_menu_item(ActionToolID act);
288 KeySequence keys_current;
289 KeyMatchResult keys_match(
const KeySequence &keys)
const;
290 bool handle_action_key(
const GdkEventKey *ev);
291 void handle_tool_action(
const ActionConnection &conn);
292 void handle_select_polygon(
const ActionConnection &a);
294 void handle_search();
295 void search_go(
int dir);
296 std::list<Searcher::SearchResult> search_results;
297 unsigned int search_result_current = 0;
298 void update_search_markers();
299 void update_search_types_label();
300 void set_search_mode(
bool enabled,
bool focus =
true);
301 std::map<Searcher::Type, Gtk::CheckButton *> search_check_buttons;
303 LogDispatcher log_dispatcher;
304 class LogWindow *log_window =
nullptr;
305 std::set<SelectableRef> selection_for_drag_move;
307 Coordf cursor_pos_drag_begin;
308 Coordi cursor_pos_grid_drag_begin;
310 std::map<ActionID, bool> action_sensitivity;
311 type_signal_action_sensitive s_signal_action_sensitive;
313 bool property_panel_has_focus();
315 sigc::connection initial_view_all_conn;
317 bool sockets_broken =
false;
318 void show_sockets_broken_dialog(
const std::string &msg =
"");
319 bool needs_autosave =
false;
320 bool queue_autosave =
false;
322 void update_property_panels();
323 std::map<CanvasGL::SelectionTool, CanvasGL::SelectionQualifier> selection_qualifiers;
324 std::list<class ActionButtonBase *> action_buttons;
326 Glib::RefPtr<Gio::SimpleAction> bottom_view_action;
327 Glib::RefPtr<Gio::SimpleAction> distraction_free_action;
328 Glib::RefPtr<Gio::SimpleAction> show_pictures_action;
330 int left_panel_width = 0;
332 void tool_bar_set_actions(
const std::vector<ActionLabelInfo> &labels);
333 void tool_bar_append_action(InToolActionID action1, InToolActionID action2,
const std::string &s);
334 void tool_bar_clear_actions();
335 InToolKeySequencesPreferences in_tool_key_sequeces_preferences;
336 std::vector<ActionLabelInfo> in_tool_action_label_infos;
338 void tool_process_one();
340 void show_preferences(std::optional<std::string> page = std::nullopt);
346 void handle_pan_action(
const ActionConnection &c);
347 void handle_zoom_action(
const ActionConnection &c);
349 std::string get_complete_display_name(
const SelectableRef &sr);
351 void set_flip_view(
bool flip);
352 void apply_arrow_keys();
353 void check_version();
355 void update_cursor(ToolID tool_id);
357 std::set<SelectableRef> last_canvas_selection;
359 Gtk::Button *undo_button =
nullptr;
360 Gtk::Button *redo_button =
nullptr;
362 unsigned int saved_version = 0;
364 class MSDTuningWindow *msd_tuning_window =
nullptr;
366 Gtk::Button *save_button =
nullptr;
367 virtual bool set_filename();