Signed-off-by: falkTX <falktx@falktx.com>wayland
| @@ -47,11 +47,12 @@ public: | |||||
| const char* const bundlePath = nullptr, | const char* const bundlePath = nullptr, | ||||
| void* const dspPtr = nullptr, | void* const dspPtr = nullptr, | ||||
| const double scaleFactor = 0.0, | const double scaleFactor = 0.0, | ||||
| const bool isModern = false, | |||||
| const uint32_t bgColor = 0, | const uint32_t bgColor = 0, | ||||
| const uint32_t fgColor = 0xffffffff, | const uint32_t fgColor = 0xffffffff, | ||||
| const char* const appClassName = nullptr) | const char* const appClassName = nullptr) | ||||
| : ui(nullptr), | : ui(nullptr), | ||||
| uiData(new UI::PrivateData(appClassName)) | |||||
| uiData(new UI::PrivateData(appClassName, isModern)) | |||||
| { | { | ||||
| uiData->sampleRate = sampleRate; | uiData->sampleRate = sampleRate; | ||||
| uiData->bundlePath = bundlePath != nullptr ? strdup(bundlePath) : nullptr; | uiData->bundlePath = bundlePath != nullptr ? strdup(bundlePath) : nullptr; | ||||
| @@ -80,6 +80,7 @@ public: | |||||
| void* const dspPtr, | void* const dspPtr, | ||||
| const float sampleRate, | const float sampleRate, | ||||
| const float scaleFactor, | const float scaleFactor, | ||||
| const bool isModern, | |||||
| const uint32_t bgColor, | const uint32_t bgColor, | ||||
| const uint32_t fgColor, | const uint32_t fgColor, | ||||
| const char* const appClassName) | const char* const appClassName) | ||||
| @@ -101,7 +102,7 @@ public: | |||||
| sendNoteCallback, | sendNoteCallback, | ||||
| setSizeCallback, | setSizeCallback, | ||||
| fileRequestCallback, | fileRequestCallback, | ||||
| bundlePath, dspPtr, scaleFactor, bgColor, fgColor, appClassName) | |||||
| bundlePath, dspPtr, scaleFactor, isModern, bgColor, fgColor, appClassName) | |||||
| { | { | ||||
| if (widget != nullptr) | if (widget != nullptr) | ||||
| *widget = (LV2UI_Widget)fUI.getNativeWindowHandle(); | *widget = (LV2UI_Widget)fUI.getNativeWindowHandle(); | ||||
| @@ -499,6 +500,9 @@ static LV2UI_Handle lv2ui_instantiate(const LV2UI_Descriptor*, | |||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| // TODO allow classic vs modern ui type | |||||
| static constexpr const bool isModern = false; | |||||
| const LV2_Options_Option* options = nullptr; | const LV2_Options_Option* options = nullptr; | ||||
| const LV2_URID_Map* uridMap = nullptr; | const LV2_URID_Map* uridMap = nullptr; | ||||
| void* parentId = nullptr; | void* parentId = nullptr; | ||||
| @@ -633,7 +637,7 @@ static LV2UI_Handle lv2ui_instantiate(const LV2UI_Descriptor*, | |||||
| return new UiLv2(bundlePath, winId, options, uridMap, features, | return new UiLv2(bundlePath, winId, options, uridMap, features, | ||||
| controller, writeFunction, widget, instance, | controller, writeFunction, widget, instance, | ||||
| sampleRate, scaleFactor, bgColor, fgColor, appClassName); | |||||
| sampleRate, scaleFactor, isModern, bgColor, fgColor, appClassName); | |||||
| } | } | ||||
| #define uiPtr ((UiLv2*)ui) | #define uiPtr ((UiLv2*)ui) | ||||
| @@ -67,14 +67,14 @@ START_NAMESPACE_DISTRHO | |||||
| int dpf_webview_start(int argc, char* argv[]); | int dpf_webview_start(int argc, char* argv[]); | ||||
| #endif | #endif | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| // Plugin Application, will set class name based on plugin details | // Plugin Application, will set class name based on plugin details | ||||
| class PluginApplication : public DGL_NAMESPACE::Application | class PluginApplication : public DGL_NAMESPACE::Application | ||||
| { | { | ||||
| public: | public: | ||||
| explicit PluginApplication(const char* className) | |||||
| : DGL_NAMESPACE::Application(DISTRHO_UI_IS_STANDALONE) | |||||
| explicit PluginApplication(const char* className, const bool isModern) | |||||
| : DGL_NAMESPACE::Application(DISTRHO_UI_IS_STANDALONE, isModern ? kTypeModern : kTypeClassic) | |||||
| { | { | ||||
| #if defined(__MOD_DEVICES__) || !defined(__EMSCRIPTEN__) | #if defined(__MOD_DEVICES__) || !defined(__EMSCRIPTEN__) | ||||
| if (className == nullptr) | if (className == nullptr) | ||||
| @@ -292,8 +292,8 @@ struct UI::PrivateData { | |||||
| setSizeFunc setSizeCallbackFunc; | setSizeFunc setSizeCallbackFunc; | ||||
| fileRequestFunc fileRequestCallbackFunc; | fileRequestFunc fileRequestCallbackFunc; | ||||
| PrivateData(const char* const appClassName) noexcept | |||||
| : app(appClassName), | |||||
| PrivateData(const char* const appClassName, const bool isModern) noexcept | |||||
| : app(appClassName, isModern), | |||||
| window(nullptr), | window(nullptr), | ||||
| #if DISTRHO_UI_USE_WEB_VIEW | #if DISTRHO_UI_USE_WEB_VIEW | ||||
| webview(nullptr), | webview(nullptr), | ||||