VCV Rack API v2
Loading...
Searching...
No Matches
SvgWidget.hpp
Go to the documentation of this file.
1#pragma once
2#include <widget/Widget.hpp>
3
4
5namespace rack {
6namespace widget {
7
8
10struct SvgWidget : Widget {
11 std::shared_ptr<window::Svg> svg;
12
14
16 void wrap();
17
19 void setSvg(std::shared_ptr<window::Svg> svg);
20 DEPRECATED void setSVG(std::shared_ptr<window::Svg> svg) {
21 setSvg(svg);
22 }
23
24 void draw(const DrawArgs& args) override;
25};
26
27
29
30
31} // namespace widget
32} // namespace rack
#define DEPRECATED
Attribute for deprecated functions and symbols.
Definition common.hpp:26
DEPRECATED typedef SvgWidget SVGWidget
Definition SvgWidget.hpp:28
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Owns and draws a window::Svg.
Definition SvgWidget.hpp:10
void setSvg(std::shared_ptr< window::Svg > svg)
Sets and wraps the SVG.
DEPRECATED void setSVG(std::shared_ptr< window::Svg > svg)
Definition SvgWidget.hpp:20
void wrap()
Sets the box size to the SVG image size.
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
std::shared_ptr< window::Svg > svg
Definition SvgWidget.hpp:11
Definition Widget.hpp:141
A node in the 2D scene graph.
Definition Widget.hpp:21