17 #ifndef DISTRHO_UI_HPP_INCLUDED
18 #define DISTRHO_UI_HPP_INCLUDED
20 #include "DistrhoDetails.hpp"
21 #include "extra/LeakDetector.hpp"
22 #include "src/DistrhoPluginChecks.h"
28 # include "OpenGL.hpp"
31 # include "Vulkan.hpp"
34 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
35 # include "../dgl/Base.hpp"
36 # include "extra/ExternalWindow.hpp"
37 typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget;
38 #elif DISTRHO_UI_USE_CUSTOM
39 # include DISTRHO_UI_CUSTOM_INCLUDE_PATH
41 #elif DISTRHO_UI_USE_CAIRO
42 # include "../dgl/Cairo.hpp"
43 typedef DGL_NAMESPACE::CairoTopLevelWidget UIWidget;
44 #elif DISTRHO_UI_USE_NANOVG
45 # include "../dgl/NanoVG.hpp"
46 typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget;
48 # include "../dgl/TopLevelWidget.hpp"
49 typedef DGL_NAMESPACE::TopLevelWidget UIWidget;
52 #if DISTRHO_UI_FILE_BROWSER
53 # include "extra/FileBrowserDialog.hpp"
55 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
77 class UI :
public UIWidget
89 UI(uint width = 0, uint height = 0,
bool automaticallyScaleAndSetAsMinimumSize =
false);
163 #if DISTRHO_PLUGIN_WANT_STATE
182 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
187 void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
190 #if DISTRHO_UI_FILE_BROWSER
203 bool openFileBrowser(
const DISTRHO_NAMESPACE::FileBrowserOptions& options =
FileBrowserOptions());
206 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
217 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
235 # if DISTRHO_PLUGIN_HAS_EMBED_UI
255 #if DISTRHO_PLUGIN_WANT_PROGRAMS
263 #if DISTRHO_PLUGIN_WANT_STATE
300 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
305 std::vector<DGL_NAMESPACE::ClipboardDataOffer> getClipboardDataOfferTypes();
316 virtual uint32_t uiClipboardDataOffer();
324 virtual void uiFocus(
bool focus, DGL_NAMESPACE::CrossingMode mode);
336 virtual void uiReshape(uint width, uint height);
339 #if DISTRHO_UI_FILE_BROWSER
349 virtual void uiFileBrowserSelected(
const char* filename);
355 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
368 void onResize(
const ResizeEvent& ev)
override;
375 PrivateData*
const uiData;
376 friend class PluginWindow;
377 friend class UIExporter;
378 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
380 void requestSizeChange(uint width, uint height)
override;
383 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
UI)
Definition: DistrhoUI.hpp:78
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:289
#define END_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:949
#define START_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:943
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE
Definition: DistrhoInfo.hpp:626
Definition: FileBrowserDialogImpl.hpp:33