MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostlyharmless_WebviewEditor.h
Go to the documentation of this file.
1//
2// Created by Syl Morrison on 11/08/2024.
3//
4
5#ifndef MOSTLYHARMLESS_MOSTLYHARMLESS_WEBVIEWEDITOR_H
6#define MOSTLYHARMLESS_MOSTLYHARMLESS_WEBVIEWEDITOR_H
10#include <choc/gui/choc_WebView.h>
11#include <nlohmann/json.hpp>
12#include <optional>
13#include <string>
14#include <memory>
15namespace mostly_harmless::gui {
16
92 class WebviewEditor : public WebviewBase {
93 public:
99 WebviewEditor(core::ISharedState* sharedState, std::uint32_t initialWidth, std::uint32_t initialHeight, Colour backgroundColour);
100
104 ~WebviewEditor() noexcept override = default;
105
106 void initialise() override;
107
115 void onParamEvent(events::ProcToGuiParamEvent event) override;
116
122 virtual void sendEvent(events::WebEvent&& event) noexcept;
123
124
125 protected:
132 virtual choc::value::Value beginParamChangeGestureCallback(const choc::value::ValueView& args);
133
140 virtual choc::value::Value paramChangeGestureCallback(const choc::value::ValueView& args);
141
148 virtual choc::value::Value endParamChangeGestureCallback(const choc::value::ValueView& args);
149
150 core::ISharedState* m_sharedState{ nullptr };
151 };
152} // namespace mostly_harmless::gui
153#endif // MOSTLYHARMLESS_MOSTLYHARMLESS_WEBVIEWEDITOR_H
Base class for the plugin's shared state.
Definition mostlyharmless_ISharedState.h:26
WebviewBase(std::uint32_t initialWidth, std::uint32_t initialHeight, Colour backgroundColour)
virtual choc::value::Value endParamChangeGestureCallback(const choc::value::ValueView &args)
~WebviewEditor() noexcept override=default
virtual choc::value::Value beginParamChangeGestureCallback(const choc::value::ValueView &args)
virtual void sendEvent(events::WebEvent &&event) noexcept
core::ISharedState * m_sharedState
Definition mostlyharmless_WebviewEditor.h:150
virtual choc::value::Value paramChangeGestureCallback(const choc::value::ValueView &args)
void onParamEvent(events::ProcToGuiParamEvent event) override
WebviewEditor(core::ISharedState *sharedState, std::uint32_t initialWidth, std::uint32_t initialHeight, Colour backgroundColour)
Contains core functionality of the framework.
Definition mostlyharmless_PluginBase.h:15
Contains classes and functions related to events.
Definition mostlyharmless_InputEventContext.h:4
Contains GUI related classes & functions.
Definition mostlyharmless_WebviewBase.h:10
Convenience struct representing a colour.
Definition mostlyharmless_Colour.h:12