Horizon
Loading...
Searching...
No Matches
canvas_cairo2.hpp
1#pragma once
2#include "canvas/canvas.hpp"
3#include <cairomm/cairomm.h>
4
5namespace horizon {
6class CanvasCairo2 : public Canvas {
7public:
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 void load(const class Decal &dec);
22 void load(const class Frame &frame);
23 Cairo::RefPtr<Cairo::Surface> get_image_surface(double scale = 1, double grid = -1);
24
25private:
26 void img_polygon(const Polygon &poly, bool tr) override;
27 void img_line(const Coordi &p0, const Coordi &p1, const uint64_t width, int layer, bool tr = true) override;
28 void img_hole(const Hole &hole) override;
29 void render_pad_names(const Package &pkg);
30 void draw_text_box(const Placement &q, float width, float height, const std::string &s, ColorP color, int layer,
31 uint64_t text_width, TextBoxMode mode);
32
33 bool layer_filter = false;
34 int current_layer = 0;
35 bool cairo_layer_visible(int l) const;
36 bool fill = false;
37 double min_line_width = 0.1_mm;
38
39 cairo_surface_t *recording_surface;
40 Cairo::RefPtr<Cairo::Surface> surface;
41 Cairo::RefPtr<Cairo::Context> cr;
42};
43} // namespace horizon
Definition canvas_cairo2.hpp:6
Definition canvas.hpp:25
Definition decal.hpp:16
Definition frame.hpp:18
A hole with diameter and position, that's it.
Definition hole.hpp:15
Definition package.hpp:29
Definition placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition polygon.hpp:25
Definition symbol.hpp:72