Horizon
Loading...
Searching...
No Matches
net_selector.hpp
1#pragma once
2#include <gtkmm.h>
3#include "util/uuid.hpp"
4
5namespace horizon {
6class NetSelector : public Gtk::Box {
7public:
8 NetSelector(const class Block &b);
9 void set_power_only(bool p);
10 void set_bus_mode(bool b);
11 void set_bus_member_mode(const UUID &bus_uuid);
12 UUID get_selected_net();
13 void select_net(const UUID &uu);
14
15 typedef sigc::signal<void, UUID> type_signal_selected;
16 // type_signal_selected signal_selected() {return s_signal_selected;}
17 type_signal_selected signal_activated()
18 {
19 return s_signal_activated;
20 }
21 void update();
22
23private:
24 class ListColumns : public Gtk::TreeModelColumnRecord {
25 public:
26 ListColumns()
27 {
28 Gtk::TreeModelColumnRecord::add(name);
29 Gtk::TreeModelColumnRecord::add(uuid);
30 Gtk::TreeModelColumnRecord::add(is_power);
31 }
32 Gtk::TreeModelColumn<Glib::ustring> name;
33 Gtk::TreeModelColumn<UUID> uuid;
34 Gtk::TreeModelColumn<bool> is_power;
35 };
36 ListColumns list_columns;
37 const Block &block;
38 bool power_only = false;
39 bool bus_mode = false;
40 bool bus_member_mode = false;
41 const class Bus *bus = nullptr;
42
43
44 Gtk::TreeView *view;
45 Glib::RefPtr<Gtk::ListStore> store;
46
47 // type_signal_selected s_signal_selected;
48 type_signal_selected s_signal_activated;
49 void row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
50};
51} // namespace horizon
A block is one level of hierarchy in the netlist.
Definition block.hpp:29
A Bus is used for grouping nets.
Definition bus.hpp:18
Definition net_selector.hpp:6
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16