| @@ -13,7 +13,7 @@ | |||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
| #include <plugin.hpp> | #include <plugin.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <patch.hpp> | #include <patch.hpp> | ||||
| #include <history.hpp> | #include <history.hpp> | ||||
| #include <ui/common.hpp> | #include <ui/common.hpp> | ||||
| @@ -7,8 +7,9 @@ | |||||
| namespace rack { | namespace rack { | ||||
| /** A controller for manipulating a float value (which subclasses must store somehow) with limits and labels | |||||
| Often used as a decorator component for widget::Widgets that read or write a quantity. | |||||
| /** A controller for manipulating a float value (which subclasses must store somehow) with limits and labels. | |||||
| Often used as a decorator component for `widget::Widget`s that read or write a quantity. | |||||
| */ | */ | ||||
| struct Quantity { | struct Quantity { | ||||
| virtual ~Quantity() {} | virtual ~Quantity() {} | ||||
| @@ -42,7 +42,7 @@ struct ModuleWidget : widget::OpaqueWidget { | |||||
| Transfers ownership. | Transfers ownership. | ||||
| */ | */ | ||||
| void setPanel(widget::Widget* panel); | void setPanel(widget::Widget* panel); | ||||
| void setPanel(std::shared_ptr<Svg> svg); | |||||
| void setPanel(std::shared_ptr<window::Svg> svg); | |||||
| /** Convenience functions for adding special widgets. | /** Convenience functions for adding special widgets. | ||||
| Just calls addChild() with additional checking. | Just calls addChild() with additional checking. | ||||
| @@ -14,10 +14,10 @@ struct SvgButton : widget::OpaqueWidget { | |||||
| widget::FramebufferWidget* fb; | widget::FramebufferWidget* fb; | ||||
| CircularShadow* shadow; | CircularShadow* shadow; | ||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| std::vector<std::shared_ptr<Svg>> frames; | |||||
| std::vector<std::shared_ptr<window::Svg>> frames; | |||||
| SvgButton(); | SvgButton(); | ||||
| void addFrame(std::shared_ptr<Svg> svg); | |||||
| void addFrame(std::shared_ptr<window::Svg> svg); | |||||
| void onButton(const ButtonEvent& e) override; | void onButton(const ButtonEvent& e) override; | ||||
| void onDragStart(const DragStartEvent& e) override; | void onDragStart(const DragStartEvent& e) override; | ||||
| void onDragEnd(const DragEndEvent& e) override; | void onDragEnd(const DragEndEvent& e) override; | ||||
| @@ -19,8 +19,8 @@ struct SvgKnob : Knob { | |||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| SvgKnob(); | SvgKnob(); | ||||
| void setSvg(std::shared_ptr<Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<Svg> svg) { | |||||
| void setSvg(std::shared_ptr<window::Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<window::Svg> svg) { | |||||
| setSvg(svg); | setSvg(svg); | ||||
| } | } | ||||
| void onChange(const ChangeEvent& e) override; | void onChange(const ChangeEvent& e) override; | ||||
| @@ -19,11 +19,11 @@ struct SvgPanel : widget::Widget { | |||||
| widget::FramebufferWidget* fb; | widget::FramebufferWidget* fb; | ||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| PanelBorder* panelBorder; | PanelBorder* panelBorder; | ||||
| std::shared_ptr<Svg> svg; | |||||
| std::shared_ptr<window::Svg> svg; | |||||
| SvgPanel(); | SvgPanel(); | ||||
| void step() override; | void step() override; | ||||
| void setBackground(std::shared_ptr<Svg> svg); | |||||
| void setBackground(std::shared_ptr<window::Svg> svg); | |||||
| }; | }; | ||||
| @@ -16,8 +16,8 @@ struct SvgPort : PortWidget { | |||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| SvgPort(); | SvgPort(); | ||||
| void setSvg(std::shared_ptr<Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<Svg> svg) { | |||||
| void setSvg(std::shared_ptr<window::Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<window::Svg> svg) { | |||||
| setSvg(svg); | setSvg(svg); | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -15,7 +15,7 @@ struct SvgScrew : widget::Widget { | |||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| SvgScrew(); | SvgScrew(); | ||||
| void setSvg(std::shared_ptr<Svg> svg); | |||||
| void setSvg(std::shared_ptr<window::Svg> svg); | |||||
| }; | }; | ||||
| @@ -20,19 +20,19 @@ struct SvgSlider : app::SliderKnob { | |||||
| math::Vec minHandlePos, maxHandlePos; | math::Vec minHandlePos, maxHandlePos; | ||||
| SvgSlider(); | SvgSlider(); | ||||
| void setBackgroundSvg(std::shared_ptr<Svg> svg); | |||||
| void setHandleSvg(std::shared_ptr<Svg> svg); | |||||
| void setBackgroundSvg(std::shared_ptr<window::Svg> svg); | |||||
| void setHandleSvg(std::shared_ptr<window::Svg> svg); | |||||
| void setHandlePos(math::Vec minHandlePos, math::Vec maxHandlePos); | void setHandlePos(math::Vec minHandlePos, math::Vec maxHandlePos); | ||||
| void setHandlePosCentered(math::Vec minHandlePosCentered, math::Vec maxHandlePosCentered); | void setHandlePosCentered(math::Vec minHandlePosCentered, math::Vec maxHandlePosCentered); | ||||
| void onChange(const ChangeEvent& e) override; | void onChange(const ChangeEvent& e) override; | ||||
| DEPRECATED void setBackgroundSVG(std::shared_ptr<Svg> svg) { | |||||
| DEPRECATED void setBackgroundSVG(std::shared_ptr<window::Svg> svg) { | |||||
| setBackgroundSvg(svg); | setBackgroundSvg(svg); | ||||
| } | } | ||||
| DEPRECATED void setHandleSVG(std::shared_ptr<Svg> svg) { | |||||
| DEPRECATED void setHandleSVG(std::shared_ptr<window::Svg> svg) { | |||||
| setBackgroundSvg(svg); | setBackgroundSvg(svg); | ||||
| } | } | ||||
| DEPRECATED void setSVGs(std::shared_ptr<Svg> backgroundSvg, std::shared_ptr<Svg> handleSvg) { | |||||
| DEPRECATED void setSVGs(std::shared_ptr<window::Svg> backgroundSvg, std::shared_ptr<window::Svg> handleSvg) { | |||||
| setBackgroundSvg(backgroundSvg); | setBackgroundSvg(backgroundSvg); | ||||
| setHandleSvg(handleSvg); | setHandleSvg(handleSvg); | ||||
| } | } | ||||
| @@ -15,11 +15,11 @@ struct SvgSwitch : Switch { | |||||
| widget::FramebufferWidget* fb; | widget::FramebufferWidget* fb; | ||||
| CircularShadow* shadow; | CircularShadow* shadow; | ||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| std::vector<std::shared_ptr<Svg>> frames; | |||||
| std::vector<std::shared_ptr<window::Svg>> frames; | |||||
| SvgSwitch(); | SvgSwitch(); | ||||
| /** Adds an SVG file to represent the next switch position */ | /** Adds an SVG file to represent the next switch position */ | ||||
| void addFrame(std::shared_ptr<Svg> svg); | |||||
| void addFrame(std::shared_ptr<window::Svg> svg); | |||||
| void onChange(const ChangeEvent& e) override; | void onChange(const ChangeEvent& e) override; | ||||
| }; | }; | ||||
| @@ -2,8 +2,8 @@ | |||||
| #include <jansson.h> | #include <jansson.h> | ||||
| #include <common.hpp> | #include <common.hpp> | ||||
| #include <math.hpp> | |||||
| #include <ui/common.hpp> | #include <ui/common.hpp> | ||||
| #include <svg.hpp> // for mm2px(), etc | |||||
| namespace rack { | namespace rack { | ||||
| @@ -21,6 +21,9 @@ See LICENSE.md for legal details about using Rack component graphics in your Rac | |||||
| namespace componentlibrary { | namespace componentlibrary { | ||||
| using namespace window; | |||||
| //////////////////// | //////////////////// | ||||
| // Color scheme | // Color scheme | ||||
| //////////////////// | //////////////////// | ||||
| @@ -66,8 +66,7 @@ TWidget* createWidgetCentered(math::Vec pos) { | |||||
| inline app::SvgPanel* createPanel(std::string svgPath) { | inline app::SvgPanel* createPanel(std::string svgPath) { | ||||
| app::SvgPanel* panel = new app::SvgPanel; | app::SvgPanel* panel = new app::SvgPanel; | ||||
| std::shared_ptr<Svg> svg = Svg::load(svgPath); | |||||
| panel->setBackground(svg); | |||||
| panel->setBackground(window::Svg::load(svgPath)); | |||||
| return panel; | return panel; | ||||
| } | } | ||||
| @@ -8,6 +8,7 @@ namespace rack { | |||||
| namespace patch { | namespace patch { | ||||
| /** Handles the Rack patch file state. */ | |||||
| struct Manager { | struct Manager { | ||||
| struct Internal; | struct Internal; | ||||
| Internal* internal; | Internal* internal; | ||||
| @@ -9,7 +9,7 @@ | |||||
| #include <random.hpp> | #include <random.hpp> | ||||
| #include <network.hpp> | #include <network.hpp> | ||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <midi.hpp> | #include <midi.hpp> | ||||
| #include <settings.hpp> | #include <settings.hpp> | ||||
| @@ -12,7 +12,7 @@ struct WeakHandle { | |||||
| }; | }; | ||||
| /** Base class for classes that allow WeakPtrs to be used. | |||||
| /** Base class for classes that allow `WeakPtr`s to be used. | |||||
| */ | */ | ||||
| struct WeakBase { | struct WeakBase { | ||||
| WeakHandle* weakHandle = nullptr; | WeakHandle* weakHandle = nullptr; | ||||
| @@ -1,6 +1,5 @@ | |||||
| #pragma once | #pragma once | ||||
| #include <widget/Widget.hpp> | #include <widget/Widget.hpp> | ||||
| #include <svg.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| @@ -9,14 +8,14 @@ namespace widget { | |||||
| /** Draws an Svg */ | /** Draws an Svg */ | ||||
| struct SvgWidget : Widget { | struct SvgWidget : Widget { | ||||
| std::shared_ptr<Svg> svg; | |||||
| std::shared_ptr<window::Svg> svg; | |||||
| /** Sets the box size to the SVG image size */ | /** Sets the box size to the SVG image size */ | ||||
| void wrap(); | void wrap(); | ||||
| /** Sets and wraps the SVG */ | /** Sets and wraps the SVG */ | ||||
| void setSvg(std::shared_ptr<Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<Svg> svg) { | |||||
| void setSvg(std::shared_ptr<window::Svg> svg); | |||||
| DEPRECATED void setSVG(std::shared_ptr<window::Svg> svg) { | |||||
| setSvg(svg); | setSvg(svg); | ||||
| } | } | ||||
| @@ -3,7 +3,7 @@ | |||||
| #include <common.hpp> | #include <common.hpp> | ||||
| #include <math.hpp> | #include <math.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <color.hpp> | #include <color.hpp> | ||||
| #include <widget/event.hpp> | #include <widget/event.hpp> | ||||
| #include <weakptr.hpp> | #include <weakptr.hpp> | ||||
| @@ -9,6 +9,7 @@ | |||||
| namespace rack { | namespace rack { | ||||
| namespace window { | |||||
| /** Arbitrary DPI, standardized for Rack. */ | /** Arbitrary DPI, standardized for Rack. */ | ||||
| @@ -60,4 +61,5 @@ DEPRECATED typedef Svg SVG; | |||||
| void svgDraw(NVGcontext* vg, NSVGimage* svg); | void svgDraw(NVGcontext* vg, NSVGimage* svg); | ||||
| } // namespace window | |||||
| } // namespace rack | } // namespace rack | ||||
| @@ -3,6 +3,10 @@ | |||||
| #include <memory> | #include <memory> | ||||
| #include <map> | #include <map> | ||||
| #include <common.hpp> | |||||
| #include <math.hpp> | |||||
| #include <window/Svg.hpp> | |||||
| #define GLEW_STATIC | #define GLEW_STATIC | ||||
| #define GLEW_NO_GLU | #define GLEW_NO_GLU | ||||
| #include <GL/glew.h> | #include <GL/glew.h> | ||||
| @@ -11,14 +15,11 @@ | |||||
| #define NANOVG_GL2 | #define NANOVG_GL2 | ||||
| #include <nanovg_gl.h> | #include <nanovg_gl.h> | ||||
| #include <nanovg_gl_utils.h> | #include <nanovg_gl_utils.h> | ||||
| #include <nanosvg.h> | |||||
| #include <svg.hpp> | |||||
| #include <common.hpp> | |||||
| #include <math.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| /** Handles OS windowing, OpenGL, and NanoVG | |||||
| */ | |||||
| namespace window { | namespace window { | ||||
| @@ -48,6 +49,7 @@ struct Image { | |||||
| }; | }; | ||||
| /** OS window with OpenGL context. */ | |||||
| struct Window { | struct Window { | ||||
| struct Internal; | struct Internal; | ||||
| Internal* internal; | Internal* internal; | ||||
| @@ -93,9 +95,7 @@ struct Window { | |||||
| std::shared_ptr<Font> loadFont(const std::string& filename); | std::shared_ptr<Font> loadFont(const std::string& filename); | ||||
| std::shared_ptr<Image> loadImage(const std::string& filename); | std::shared_ptr<Image> loadImage(const std::string& filename); | ||||
| /** Use `Svg::load(filename)` in new code. */ | |||||
| DEPRECATED std::shared_ptr<Svg> loadSvg(const std::string& filename) { | |||||
| std::shared_ptr<Svg> loadSvg(const std::string& filename) { | |||||
| return Svg::load(filename); | return Svg::load(filename); | ||||
| } | } | ||||
| @@ -57,14 +57,14 @@ struct PlugWidget : widget::Widget { | |||||
| plugTransform->addChild(plugTint); | plugTransform->addChild(plugTint); | ||||
| plug = new widget::SvgWidget; | plug = new widget::SvgWidget; | ||||
| plug->setSvg(Svg::load(asset::system("res/ComponentLibrary/Plug.svg"))); | |||||
| plug->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/Plug.svg"))); | |||||
| plugTint->addChild(plug); | plugTint->addChild(plug); | ||||
| plugTransform->setSize(plug->getSize()); | plugTransform->setSize(plug->getSize()); | ||||
| plugTransform->setPosition(plug->getSize().mult(-0.5)); | plugTransform->setPosition(plug->getSize().mult(-0.5)); | ||||
| plugTint->setSize(plug->getSize()); | plugTint->setSize(plug->getSize()); | ||||
| plugPort = new widget::SvgWidget; | plugPort = new widget::SvgWidget; | ||||
| plugPort->setSvg(Svg::load(asset::system("res/ComponentLibrary/PlugPort.svg"))); | |||||
| plugPort->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/PlugPort.svg"))); | |||||
| plugPort->setPosition(plugPort->getSize().mult(-0.5)); | plugPort->setPosition(plugPort->getSize().mult(-0.5)); | ||||
| fb->addChild(plugPort); | fb->addChild(plugPort); | ||||
| @@ -1,6 +1,6 @@ | |||||
| #include <app/LedDisplay.hpp> | #include <app/LedDisplay.hpp> | ||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <context.hpp> | #include <context.hpp> | ||||
| @@ -36,7 +36,7 @@ void LedDisplaySeparator::draw(const DrawArgs& args) { | |||||
| LedDisplayChoice::LedDisplayChoice() { | LedDisplayChoice::LedDisplayChoice() { | ||||
| box.size = mm2px(math::Vec(0, 28.0 / 3)); | |||||
| box.size = window::mm2px(math::Vec(0, 28.0 / 3)); | |||||
| fontPath = asset::system("res/fonts/ShareTechMono-Regular.ttf"); | fontPath = asset::system("res/fonts/ShareTechMono-Regular.ttf"); | ||||
| textOffset = math::Vec(10, 18); | textOffset = math::Vec(10, 18); | ||||
| color = nvgRGB(0xff, 0xd7, 0x14); | color = nvgRGB(0xff, 0xd7, 0x14); | ||||
| @@ -16,7 +16,7 @@ | |||||
| #include <ui/ProgressBar.hpp> | #include <ui/ProgressBar.hpp> | ||||
| #include <ui/Label.hpp> | #include <ui/Label.hpp> | ||||
| #include <engine/Engine.hpp> | #include <engine/Engine.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <settings.hpp> | #include <settings.hpp> | ||||
| @@ -98,7 +98,7 @@ void ModuleWidget::setPanel(widget::Widget* panel) { | |||||
| } | } | ||||
| } | } | ||||
| void ModuleWidget::setPanel(std::shared_ptr<Svg> svg) { | |||||
| void ModuleWidget::setPanel(std::shared_ptr<window::Svg> svg) { | |||||
| // Create SvgPanel | // Create SvgPanel | ||||
| SvgPanel* panel = new SvgPanel; | SvgPanel* panel = new SvgPanel; | ||||
| panel->setBackground(svg); | panel->setBackground(svg); | ||||
| @@ -1,6 +1,6 @@ | |||||
| #include <app/PortWidget.hpp> | #include <app/PortWidget.hpp> | ||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <history.hpp> | #include <history.hpp> | ||||
| #include <engine/Engine.hpp> | #include <engine/Engine.hpp> | ||||
| @@ -1,6 +1,6 @@ | |||||
| #include <app/RackScrollWidget.hpp> | #include <app/RackScrollWidget.hpp> | ||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <settings.hpp> | #include <settings.hpp> | ||||
| @@ -1,7 +1,6 @@ | |||||
| #include <app/RailWidget.hpp> | #include <app/RailWidget.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <svg.hpp> | |||||
| #include <widget/SvgWidget.hpp> | #include <widget/SvgWidget.hpp> | ||||
| #include <widget/FramebufferWidget.hpp> | #include <widget/FramebufferWidget.hpp> | ||||
| @@ -27,7 +26,7 @@ RailWidget::RailWidget() { | |||||
| addChild(internal->railFb); | addChild(internal->railFb); | ||||
| internal->railSw = new widget::SvgWidget; | internal->railSw = new widget::SvgWidget; | ||||
| internal->railSw->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rail.svg"))); | |||||
| internal->railSw->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/Rail.svg"))); | |||||
| internal->railFb->addChild(internal->railSw); | internal->railFb->addChild(internal->railSw); | ||||
| } | } | ||||
| @@ -30,7 +30,7 @@ void SvgButton::onButton(const ButtonEvent& e) { | |||||
| } | } | ||||
| void SvgButton::addFrame(std::shared_ptr<Svg> svg) { | |||||
| void SvgButton::addFrame(std::shared_ptr<window::Svg> svg) { | |||||
| frames.push_back(svg); | frames.push_back(svg); | ||||
| // If this is our first frame, automatically set SVG and size | // If this is our first frame, automatically set SVG and size | ||||
| if (!sw->svg) { | if (!sw->svg) { | ||||
| @@ -20,7 +20,7 @@ SvgKnob::SvgKnob() { | |||||
| tw->addChild(sw); | tw->addChild(sw); | ||||
| } | } | ||||
| void SvgKnob::setSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgKnob::setSvg(std::shared_ptr<window::Svg> svg) { | |||||
| sw->setSvg(svg); | sw->setSvg(svg); | ||||
| tw->box.size = sw->box.size; | tw->box.size = sw->box.size; | ||||
| fb->box.size = sw->box.size; | fb->box.size = sw->box.size; | ||||
| @@ -37,7 +37,7 @@ void SvgPanel::step() { | |||||
| Widget::step(); | Widget::step(); | ||||
| } | } | ||||
| void SvgPanel::setBackground(std::shared_ptr<Svg> svg) { | |||||
| void SvgPanel::setBackground(std::shared_ptr<window::Svg> svg) { | |||||
| this->svg = svg; | this->svg = svg; | ||||
| sw->setSvg(svg); | sw->setSvg(svg); | ||||
| @@ -19,7 +19,7 @@ SvgPort::SvgPort() { | |||||
| fb->addChild(sw); | fb->addChild(sw); | ||||
| } | } | ||||
| void SvgPort::setSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgPort::setSvg(std::shared_ptr<window::Svg> svg) { | |||||
| sw->setSvg(svg); | sw->setSvg(svg); | ||||
| fb->box.size = sw->box.size; | fb->box.size = sw->box.size; | ||||
| box.size = sw->box.size; | box.size = sw->box.size; | ||||
| @@ -14,7 +14,7 @@ SvgScrew::SvgScrew() { | |||||
| } | } | ||||
| void SvgScrew::setSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgScrew::setSvg(std::shared_ptr<window::Svg> svg) { | |||||
| sw->setSvg(svg); | sw->setSvg(svg); | ||||
| fb->box.size = sw->box.size; | fb->box.size = sw->box.size; | ||||
| box.size = sw->box.size; | box.size = sw->box.size; | ||||
| @@ -19,7 +19,7 @@ SvgSlider::SvgSlider() { | |||||
| } | } | ||||
| void SvgSlider::setBackgroundSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgSlider::setBackgroundSvg(std::shared_ptr<window::Svg> svg) { | |||||
| background->setSvg(svg); | background->setSvg(svg); | ||||
| box.size = background->box.size; | box.size = background->box.size; | ||||
| fb->box.size = background->box.size; | fb->box.size = background->box.size; | ||||
| @@ -27,7 +27,7 @@ void SvgSlider::setBackgroundSvg(std::shared_ptr<Svg> svg) { | |||||
| } | } | ||||
| void SvgSlider::setHandleSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgSlider::setHandleSvg(std::shared_ptr<window::Svg> svg) { | |||||
| handle->setSvg(svg); | handle->setSvg(svg); | ||||
| handle->box.pos = minHandlePos; | handle->box.pos = minHandlePos; | ||||
| fb->setDirty(); | fb->setDirty(); | ||||
| @@ -17,7 +17,7 @@ SvgSwitch::SvgSwitch() { | |||||
| fb->addChild(sw); | fb->addChild(sw); | ||||
| } | } | ||||
| void SvgSwitch::addFrame(std::shared_ptr<Svg> svg) { | |||||
| void SvgSwitch::addFrame(std::shared_ptr<window::Svg> svg) { | |||||
| frames.push_back(svg); | frames.push_back(svg); | ||||
| // If this is our first frame, automatically set SVG and size | // If this is our first frame, automatically set SVG and size | ||||
| if (!sw->svg) { | if (!sw->svg) { | ||||
| @@ -1,5 +1,5 @@ | |||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <patch.hpp> | #include <patch.hpp> | ||||
| #include <engine/Engine.hpp> | #include <engine/Engine.hpp> | ||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
| @@ -1,7 +1,7 @@ | |||||
| #include <gamepad.hpp> | #include <gamepad.hpp> | ||||
| #include <midi.hpp> | #include <midi.hpp> | ||||
| #include <string.hpp> | #include <string.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| @@ -2,7 +2,7 @@ | |||||
| #include <keyboard.hpp> | #include <keyboard.hpp> | ||||
| #include <midi.hpp> | #include <midi.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| @@ -8,7 +8,7 @@ | |||||
| #include <network.hpp> | #include <network.hpp> | ||||
| #include <system.hpp> | #include <system.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <settings.hpp> | #include <settings.hpp> | ||||
| #include <plugin.hpp> | #include <plugin.hpp> | ||||
| @@ -1,7 +1,7 @@ | |||||
| #include <jansson.h> | #include <jansson.h> | ||||
| #include <settings.hpp> | #include <settings.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <plugin.hpp> | #include <plugin.hpp> | ||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
| #include <engine/Engine.hpp> | #include <engine/Engine.hpp> | ||||
| @@ -1,7 +1,7 @@ | |||||
| #include <ui/Scrollbar.hpp> | #include <ui/Scrollbar.hpp> | ||||
| #include <ui/ScrollWidget.hpp> | #include <ui/ScrollWidget.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| @@ -15,7 +15,7 @@ void SvgWidget::wrap() { | |||||
| } | } | ||||
| } | } | ||||
| void SvgWidget::setSvg(std::shared_ptr<Svg> svg) { | |||||
| void SvgWidget::setSvg(std::shared_ptr<window::Svg> svg) { | |||||
| this->svg = svg; | this->svg = svg; | ||||
| wrap(); | wrap(); | ||||
| } | } | ||||
| @@ -24,7 +24,7 @@ void SvgWidget::draw(const DrawArgs& args) { | |||||
| if (!svg) | if (!svg) | ||||
| return; | return; | ||||
| svgDraw(args.vg, svg->handle); | |||||
| window::svgDraw(args.vg, svg->handle); | |||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| #include <widget/event.hpp> | #include <widget/event.hpp> | ||||
| #include <widget/Widget.hpp> | #include <widget/Widget.hpp> | ||||
| #include <context.hpp> | #include <context.hpp> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <system.hpp> | #include <system.hpp> | ||||
| @@ -1,4 +1,4 @@ | |||||
| #include <svg.hpp> | |||||
| #include <window/Svg.hpp> | |||||
| #include <map> | #include <map> | ||||
| #include <math.hpp> | #include <math.hpp> | ||||
| #include <string.hpp> | #include <string.hpp> | ||||
| @@ -9,6 +9,7 @@ | |||||
| namespace rack { | namespace rack { | ||||
| namespace window { | |||||
| Svg::~Svg() { | Svg::~Svg() { | ||||
| @@ -301,4 +302,5 @@ void svgDraw(NVGcontext* vg, NSVGimage* svg) { | |||||
| } | } | ||||
| } // namespace window | |||||
| } // namespace rack | } // namespace rack | ||||
| @@ -10,7 +10,7 @@ | |||||
| #include <stb_image_write.h> | #include <stb_image_write.h> | ||||
| #include <osdialog.h> | #include <osdialog.h> | ||||
| #include <window.hpp> | |||||
| #include <window/Window.hpp> | |||||
| #include <asset.hpp> | #include <asset.hpp> | ||||
| #include <widget/Widget.hpp> | #include <widget/Widget.hpp> | ||||
| #include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||