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  void set_canvas_appearance(const class Appearance &a);
16 
17 private:
18  class CanvasGL *canvas = nullptr;
19  Gtk::Button *set_button = nullptr;
20  const std::pair<int, bool> view;
21  Symbol symbol;
22  std::map<UUID, Placement> text_placements;
23  void set_placements();
24  void clear_placements();
25 };
26 } // namespace horizon
Definition: changeable.hpp:5
Definition: preview_box.hpp:8
Definition: placement.hpp:8
Definition: appearance.hpp:7
Definition: canvas_gl.hpp:13
Definition: symbol.hpp:74
Definition: block.cpp:9