Horizon
preview_box.hpp
1 #pragma once
2 #include "pool/symbol.hpp"
3 #include <gtkmm.h>
4 #include <utility>
5 #include "util/changeable.hpp"
6 
7 namespace horizon {
8 class SymbolPreviewBox : public Gtk::Box, public Changeable {
9 public:
10  SymbolPreviewBox(const std::pair<int, bool> &view);
11  void update(const Symbol &sym);
12  void zoom_to_fit();
13  std::map<std::tuple<int, bool, UUID>, Placement> get_text_placements() const;
14  void set_text_placements(const std::map<std::tuple<int, bool, UUID>, Placement> &p);
15 
16 private:
17  class CanvasGL *canvas = nullptr;
18  Gtk::Button *set_button = nullptr;
19  const std::pair<int, bool> view;
20  Symbol symbol;
21  std::map<UUID, Placement> text_placements;
22  void set_placements();
23  void clear_placements();
24 };
25 } // namespace horizon
Definition: changeable.hpp:5
Definition: preview_box.hpp:8
Definition: placement.hpp:8
Definition: canvas_gl.hpp:10
Definition: symbol.hpp:70
Definition: block.cpp:7