Horizon
unplaced_box.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include <map>
4 #include <set>
5 #include "util/uuid.hpp"
6 #include "util/uuid_path.hpp"
7 
8 namespace horizon {
9 class UnplacedBox : public Gtk::Box {
10 public:
11  UnplacedBox(const std::string &title);
12 
13  void update(const std::map<UUIDPath<2>, std::string> &items);
14  typedef sigc::signal<void, std::vector<UUIDPath<2>>> type_signal_place;
15  type_signal_place signal_place()
16  {
17  return s_signal_place;
18  }
19 
20 private:
21  class ListColumns : public Gtk::TreeModelColumnRecord {
22  public:
23  ListColumns()
24  {
25  Gtk::TreeModelColumnRecord::add(text);
26  Gtk::TreeModelColumnRecord::add(uuid);
27  }
28  Gtk::TreeModelColumn<Glib::ustring> text;
29  Gtk::TreeModelColumn<UUIDPath<2>> uuid;
30  };
31  ListColumns list_columns;
32 
33  Gtk::TreeView *view = nullptr;
34  Glib::RefPtr<Gtk::ListStore> store;
35  Gtk::ToolButton *button_place = nullptr;
36 
37  type_signal_place s_signal_place;
38  void row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
39 };
40 } // namespace horizon
Definition: unplaced_box.hpp:9