2 #include "core/clipboard.hpp" 3 #include "core/core_package.hpp" 4 #include "core/core_padstack.hpp" 5 #include "core/core_schematic.hpp" 6 #include "core/core_symbol.hpp" 7 #include "core/cores.hpp" 8 #include "imp_interface.hpp" 9 #include "keyseq_dialog.hpp" 10 #include "main_window.hpp" 11 #include "pool/pool.hpp" 12 #include "preferences/preferences.hpp" 13 #include "selection_filter_dialog.hpp" 14 #include "util/window_state_store.hpp" 15 #include "widgets/spin_button_dim.hpp" 16 #include "widgets/warnings_box.hpp" 29 PoolParams(
const std::string &bp,
const std::string &cp =
"") : base_path(bp), cache_path(cp)
32 std::string base_path;
33 std::string cache_path;
36 std::unique_ptr<Pool> make_pool(
const PoolParams ¶ms);
43 void run(
int argc,
char *argv[]);
44 virtual void handle_tool_change(ToolID
id);
45 virtual void construct() = 0;
46 void canvas_update_from_pp();
50 void set_read_only(
bool v);
52 std::set<ObjectRef> highlights;
53 virtual void update_highlights(){};
61 Gtk::Menu *context_menu =
nullptr;
63 std::unique_ptr<SelectionFilterDialog> selection_filter_dialog;
65 std::unique_ptr<Pool> pool;
67 std::unique_ptr<ClipboardManager> clipboard =
nullptr;
68 std::unique_ptr<KeySequenceDialog> key_sequence_dialog =
nullptr;
69 std::unique_ptr<ImpInterface> imp_interface =
nullptr;
70 Glib::RefPtr<Glib::Binding> grid_spacing_binding;
80 zmq::socket_t sock_broadcast_rx;
81 zmq::socket_t sock_project;
82 bool sockets_connected =
false;
84 bool no_update =
false;
86 virtual void canvas_update() = 0;
88 bool handle_key_press(GdkEventKey *key_event);
89 void handle_cursor_move(
const Coordi &pos);
90 bool handle_click(GdkEventButton *button_event);
91 bool handle_click_release(GdkEventButton *button_event);
92 bool handle_context_menu(GdkEventButton *button_event);
94 void tool_begin(ToolID
id,
bool override_selection =
false,
const std::set<SelectableRef> &sel = {});
95 void add_tool_button(ToolID
id,
const std::string &label,
bool left =
true);
96 void handle_warning_selected(
const Coordi &pos);
97 virtual bool handle_broadcast(
const json &j);
98 bool handle_close(GdkEventAny *ev);
101 bool trigger_action(
const std::pair<ActionID, ToolID> &action);
102 bool trigger_action(ActionID aid);
103 bool trigger_action(ToolID tid);
105 void add_tool_action(ToolID tid,
const std::string &action);
106 Glib::RefPtr<Gio::Menu> add_hamburger_menu();
112 return &preferences.canvas_non_layer;
114 virtual void apply_preferences();
116 std::unique_ptr<WindowStateStore> state_store =
nullptr;
118 virtual void handle_maybe_drag();
120 virtual ActionCatalogItem::Availability get_editor_type_for_action()
const = 0;
121 virtual ObjectType get_editor_type()
const = 0;
123 void layer_up_down(
bool up);
124 void goto_layer(
int layer);
126 Gtk::Button *create_action_button(std::pair<ActionID, ToolID> action);
128 void set_action_sensitive(std::pair<ActionID, ToolID>,
bool v);
129 bool get_action_sensitive(std::pair<ActionID, ToolID>)
const;
130 virtual void update_action_sensitivity();
132 typedef sigc::signal<void> type_signal_action_sensitive;
133 type_signal_action_sensitive signal_action_sensitive()
135 return s_signal_action_sensitive;
138 virtual std::string get_hud_text(std::set<SelectableRef> &sel);
139 std::string get_hud_text_for_part(
const Part *part);
140 std::string get_hud_text_for_net(
const Net *net);
142 void set_monitor_files(
const std::set<std::string> &files);
143 void set_monitor_items(
const std::set<std::pair<ObjectType, UUID>> &items);
144 virtual void update_monitor()
147 void edit_pool_item(ObjectType type,
const UUID &uu);
149 void parameter_window_add_polygon_expand(
class ParameterWindow *parameter_window);
151 bool read_only =
false;
153 void tool_update_data(std::unique_ptr<ToolData> &data);
156 void fix_cursor_pos();
157 Glib::RefPtr<Gio::FileMonitor> preferences_monitor;
159 void update_selection_label();
160 std::string get_tool_settings_filename(ToolID
id);
164 std::map<std::string, Glib::RefPtr<Gio::FileMonitor>> file_monitors;
166 void handle_file_changed(
const Glib::RefPtr<Gio::File> &file1,
const Glib::RefPtr<Gio::File> &file2,
167 Gio::FileMonitorEvent ev);
172 void create_context_menu(Gtk::Menu *parent,
const std::set<SelectableRef> &sel);
174 KeySequence2 keys_current;
175 bool handle_action_key(GdkEventKey *ev);
179 std::set<SelectableRef> selection_for_drag_move;
180 Coordf cursor_pos_drag_begin;
181 Coordi cursor_pos_grid_drag_begin;
183 std::map<std::pair<ActionID, ToolID>,
bool> action_sensitivity;
184 type_signal_action_sensitive s_signal_action_sensitive;
Definition: warnings_box.hpp:7
Definition: rules_window.hpp:13
a class to store JSON values
Definition: json.hpp:161
Definition: main_window.hpp:7
Definition: preferences.hpp:13
Definition: parameter_window.hpp:11
Definition: log_window.hpp:6
Definition: property_panels.hpp:7
Definition: canvas_gl.hpp:13
Tools use this class to actually access the core.
Definition: cores.hpp:13
Definition: imp_interface.hpp:7
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: action.hpp:89
Definition: preferences.hpp:57