Horizon
Loading...
Searching...
No Matches
svg_overlay.hpp
1#pragma once
2#include <gtkmm.h>
3#include <librsvg/rsvg.h>
4
5namespace horizon {
6class SVGOverlay : public Gtk::Overlay {
7public:
8 SVGOverlay(const guint8 *data, gsize data_len);
9 SVGOverlay(const char *resource);
11
12 void add_at_sub(Gtk::Widget &widget, const char *sub);
13 std::map<std::string, std::string> sub_texts;
14
15private:
16 RsvgHandle *handle = nullptr;
17 void init(const guint8 *data, gsize data_len);
18 Gtk::DrawingArea *area;
19 bool draw(const Cairo::RefPtr<Cairo::Context> &ctx);
20 void apply_style();
21 Gdk::RGBA fg_color;
22
23 class SubInfo {
24 public:
25 double x;
26 double y;
27 double width;
28 double height;
29 };
30
31 std::map<std::string, SubInfo> subs;
32};
33} // namespace horizon
Definition svg_overlay.hpp:6