Horizon
canvas_cairo2.hpp
1 #pragma once
2 #include "canvas/canvas.hpp"
3 #include <cairomm/cairomm.h>
4 
5 namespace horizon {
6 class CanvasCairo2 : public Canvas {
7 public:
8  CanvasCairo2();
9  void push() override
10  {
11  }
12  void request_push() override
13  {
14  }
15  Cairo::RefPtr<Cairo::Surface> get_surface()
16  {
17  return surface;
18  }
19  void load(const class Symbol &sym, const Placement &placement = Placement());
20  void load(const class Package &pkg);
21  Cairo::RefPtr<Cairo::Surface> get_image_surface(double scale = 1, double grid = -1);
22 
23 private:
24  void img_polygon(const Polygon &poly, bool tr) override;
25  void img_line(const Coordi &p0, const Coordi &p1, const uint64_t width, int layer, bool tr = true) override;
26  void img_hole(const Hole &hole) override;
27  void render_pad_names(const Package &pkg);
28  void draw_text_box(const Placement &q, float width, float height, const std::string &s, ColorP color, int layer,
29  uint64_t text_width, TextBoxMode mode);
30 
31  bool layer_filter = false;
32  int current_layer = 0;
33  bool cairo_layer_visible(int l) const;
34  bool fill = false;
35  double min_line_width = 0.1_mm;
36 
37  cairo_surface_t *recording_surface;
38  Cairo::RefPtr<Cairo::Surface> surface;
39  Cairo::RefPtr<Cairo::Context> cr;
40 };
41 } // namespace horizon
libzip::uint64_t
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108