17 #ifndef DISTRHO_UI_HPP_INCLUDED
18 #define DISTRHO_UI_HPP_INCLUDED
20 #include "extra/LeakDetector.hpp"
21 #include "src/DistrhoPluginChecks.h"
27 # include "OpenGL.hpp"
30 # include "Vulkan.hpp"
33 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
34 # include "../dgl/Base.hpp"
35 # include "extra/ExternalWindow.hpp"
36 typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget;
37 #elif DISTRHO_UI_USE_CUSTOM
38 # include DISTRHO_UI_CUSTOM_INCLUDE_PATH
40 #elif DISTRHO_UI_USE_CAIRO
41 # include "../dgl/Cairo.hpp"
42 typedef DGL_NAMESPACE::CairoTopLevelWidget UIWidget;
43 #elif DISTRHO_UI_USE_NANOVG
44 # include "../dgl/NanoVG.hpp"
45 typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget;
47 # include "../dgl/TopLevelWidget.hpp"
48 typedef DGL_NAMESPACE::TopLevelWidget UIWidget;
51 #if DISTRHO_UI_FILE_BROWSER
52 # include "extra/FileBrowserDialog.hpp"
73 class UI :
public UIWidget
85 UI(uint width = 0, uint height = 0,
bool automaticallyScaleAndSetAsMinimumSize =
false);
159 #if DISTRHO_PLUGIN_WANT_STATE
178 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
183 void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
186 #if DISTRHO_UI_FILE_BROWSER
199 bool openFileBrowser(
const DISTRHO_NAMESPACE::FileBrowserOptions& options =
FileBrowserOptions());
202 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
213 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
231 # if DISTRHO_PLUGIN_HAS_EMBED_UI
251 #if DISTRHO_PLUGIN_WANT_PROGRAMS
259 #if DISTRHO_PLUGIN_WANT_STATE
296 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
301 std::vector<DGL_NAMESPACE::ClipboardDataOffer> getClipboardDataOfferTypes();
312 virtual uint32_t uiClipboardDataOffer();
320 virtual void uiFocus(
bool focus, DGL_NAMESPACE::CrossingMode mode);
332 virtual void uiReshape(uint width, uint height);
335 #if DISTRHO_UI_FILE_BROWSER
345 virtual void uiFileBrowserSelected(
const char* filename);
351 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
364 void onResize(
const ResizeEvent& ev)
override;
371 PrivateData*
const uiData;
372 friend class PluginWindow;
373 friend class UIExporter;
374 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
376 void requestSizeChange(uint width, uint height)
override;
379 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
UI)
Definition: DistrhoUI.hpp:74
void * getPluginInstancePointer() const noexcept
virtual void stateChanged(const char *key, const char *value)=0
void editParameter(uint32_t index, bool started)
virtual void programLoaded(uint32_t index)=0
const char * getBundlePath() const noexcept
uint getBackgroundColor() const noexcept
void sizeChanged(uint width, uint height) override
static uintptr_t getNextWindowId() noexcept
bool requestStateFile(const char *key)
uint getForegroundColor() const noexcept
UI(uint width=0, uint height=0, bool automaticallyScaleAndSetAsMinimumSize=false)
bool isResizable() const noexcept
void setParameterValue(uint32_t index, float value)
double getSampleRate() const noexcept
void sendNote(uint8_t channel, uint8_t note, uint8_t velocity)
static double getNextScaleFactor() noexcept
static const char * getNextBundlePath() noexcept
virtual void parameterChanged(uint32_t index, float value)=0
void setState(const char *key, const char *value)
virtual void sampleRateChanged(double newSampleRate)
virtual void uiScaleFactorChanged(double scaleFactor)
virtual void uiIdle()
Definition: DistrhoUI.hpp:285
#define END_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:834
#define START_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:828
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE
Definition: DistrhoInfo.hpp:619
Definition: FileBrowserDialogImpl.hpp:33