3 #include "util/uuid.hpp"
4 #include "util/changeable.hpp"
5 #include "common/common.hpp"
7 #include "nlohmann/json.hpp"
12 class AirwireFilterWindow :
public Gtk::Window,
public Changeable {
14 static AirwireFilterWindow *create(Gtk::Window *p,
const class Board &b);
15 AirwireFilterWindow(BaseObjectType *cobject,
const Glib::RefPtr<Gtk::Builder> &x,
const class Board &b);
17 void update_from_board();
19 bool airwire_is_visible(
const UUID &net)
const;
20 bool get_filtered()
const;
22 void set_only(
const std::set<UUID> &nets);
24 typedef sigc::signal<void, std::set<UUID>> type_signal_selection_changed;
25 type_signal_selection_changed signal_selection_changed()
27 return s_signal_selection_changed;
29 const std::map<UUID, ColorI> &get_net_colors()
const
35 void load_from_json(
const json &j);
38 const class Board &brd;
39 const class Block █
40 std::map<UUID, bool> airwires_visible;
41 std::map<UUID, ColorI> net_colors;
43 class ListColumns :
public Gtk::TreeModelColumnRecord {
47 Gtk::TreeModelColumnRecord::add(net);
48 Gtk::TreeModelColumnRecord::add(net_name);
49 Gtk::TreeModelColumnRecord::add(net_class);
50 Gtk::TreeModelColumnRecord::add(net_class_name);
51 Gtk::TreeModelColumnRecord::add(airwires_visible);
52 Gtk::TreeModelColumnRecord::add(n_airwires);
53 Gtk::TreeModelColumnRecord::add(color);
55 Gtk::TreeModelColumn<UUID> net;
56 Gtk::TreeModelColumn<Glib::ustring> net_name;
57 Gtk::TreeModelColumn<UUID> net_class;
58 Gtk::TreeModelColumn<Glib::ustring> net_class_name;
59 Gtk::TreeModelColumn<bool> airwires_visible;
60 Gtk::TreeModelColumn<unsigned int> n_airwires;
61 Gtk::TreeModelColumn<Gdk::RGBA> color;
63 ListColumns list_columns;
65 Glib::RefPtr<Gtk::ListStore> store;
66 Glib::RefPtr<Gtk::TreeModelFilter> store_filtered;
67 Glib::RefPtr<Gtk::TreeModelSort> store_sorted;
68 Gtk::TreeView *treeview =
nullptr;
69 Gtk::Button *all_on_button =
nullptr;
70 Gtk::Button *all_off_button =
nullptr;
72 Gtk::ToggleButton *search_button =
nullptr;
73 Gtk::ToggleButton *airwires_button =
nullptr;
74 Gtk::Revealer *search_revealer =
nullptr;
75 Gtk::Revealer *airwires_revealer =
nullptr;
76 Gtk::ComboBoxText *netclass_combo =
nullptr;
79 Gtk::SearchEntry *search_entry =
nullptr;
80 std::optional<Glib::PatternSpec> search_spec;
82 Gtk::CheckButton *airwires_only_cb =
nullptr;
84 Gtk::Menu context_menu;
85 enum class MenuOP { CHECK, UNCHECK, TOGGLE, SET_COLOR, CLEAR_COLOR };
86 void append_context_menu_item(
const std::string &name, MenuOP op);
88 type_signal_selection_changed s_signal_selection_changed;