Signed-off-by: falkTX <falktx@falktx.com>tags/v2.4.0
@@ -1,3 +1,4 @@ | |||||
../backend/ | |||||
../includes/ | ../includes/ | ||||
../modules/ | ../modules/ | ||||
../theme/ | ../theme/ | ||||
@@ -254,7 +254,7 @@ bool CarlaBridgeFormat::msgReceived(const char* const msg) noexcept | |||||
opts.transientWindowId = transientWindowId; | opts.transientWindowId = transientWindowId; | ||||
// we can assume we are not standalone if we got options from controller side | // we can assume we are not standalone if we got options from controller side | ||||
opts.isStandalone = true; | |||||
opts.isStandalone = false; | |||||
fGotOptions = true; | fGotOptions = true; | ||||
uiOptionsChanged(opts); | uiOptionsChanged(opts); | ||||
@@ -103,6 +103,11 @@ public: | |||||
*/ | */ | ||||
virtual void* getWidget() const noexcept = 0; | virtual void* getWidget() const noexcept = 0; | ||||
/*! | |||||
* TESTING | |||||
*/ | |||||
virtual void setScaleFactor(double scaleFactor) = 0; | |||||
/*! | /*! | ||||
* TESTING | * TESTING | ||||
*/ | */ | ||||
@@ -831,6 +831,11 @@ public: | |||||
fUiOptions.useThemeColors = opts.useThemeColors; | fUiOptions.useThemeColors = opts.useThemeColors; | ||||
} | } | ||||
void setScaleFactor(const double scaleFactor) override | |||||
{ | |||||
fLv2Options.uiScale = static_cast<float>(scaleFactor); | |||||
} | |||||
void uiResized(const uint width, const uint height) override | void uiResized(const uint width, const uint height) override | ||||
{ | { | ||||
if (fHandle != nullptr && fExt.resize != nullptr) | if (fHandle != nullptr && fExt.resize != nullptr) | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* Carla Bridge UI | * Carla Bridge UI | ||||
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -31,21 +31,21 @@ class CarlaBridgeToolkit | |||||
public: | public: | ||||
virtual ~CarlaBridgeToolkit() {} | virtual ~CarlaBridgeToolkit() {} | ||||
virtual bool init(const int argc, const char* argv[]) = 0; | |||||
virtual void exec(const bool showUI) = 0; | |||||
virtual bool init(int argc, const char* argv[]) = 0; | |||||
virtual void exec(bool showUI) = 0; | |||||
virtual void quit() = 0; | virtual void quit() = 0; | ||||
virtual void show() = 0; | virtual void show() = 0; | ||||
virtual void focus() = 0; | virtual void focus() = 0; | ||||
virtual void hide() = 0; | virtual void hide() = 0; | ||||
virtual void setChildWindow(void* const ptr) = 0; | |||||
virtual void setSize(const uint width, const uint height) = 0; | |||||
virtual void setTitle(const char* const title) = 0; | |||||
virtual void setChildWindow(void* ptr) = 0; | |||||
virtual void setSize(uint width, uint height) = 0; | |||||
virtual void setTitle(const char* title) = 0; | |||||
virtual void* getContainerId() const { return nullptr; } | |||||
virtual void* getContainerId() const { return nullptr; } | |||||
virtual void* getContainerId2() const { return nullptr; } | virtual void* getContainerId2() const { return nullptr; } | ||||
static CarlaBridgeToolkit* createNew(CarlaBridgeFormat* const format); | |||||
static CarlaBridgeToolkit* createNew(CarlaBridgeFormat* format); | |||||
protected: | protected: | ||||
CarlaBridgeFormat* const fPlugin; | CarlaBridgeFormat* const fPlugin; | ||||
@@ -20,6 +20,7 @@ | |||||
#include "CarlaMainLoop.hpp" | #include "CarlaMainLoop.hpp" | ||||
#include "CarlaPluginUI.hpp" | #include "CarlaPluginUI.hpp" | ||||
#include "CarlaUtils.h" | |||||
#if defined(CARLA_OS_MAC) && defined(BRIDGE_COCOA) | #if defined(CARLA_OS_MAC) && defined(BRIDGE_COCOA) | ||||
# include "CarlaMacUtils.hpp" | # include "CarlaMacUtils.hpp" | ||||
@@ -71,9 +72,12 @@ public: | |||||
#endif | #endif | ||||
CARLA_SAFE_ASSERT_RETURN(fHostUI != nullptr, false); | CARLA_SAFE_ASSERT_RETURN(fHostUI != nullptr, false); | ||||
if (options.isStandalone) | |||||
fPlugin->setScaleFactor(carla_get_desktop_scale_factor()); | |||||
fHostUI->setTitle(options.windowTitle.buffer()); | fHostUI->setTitle(options.windowTitle.buffer()); | ||||
#if (defined(CARLA_OS_WIN) && defined(BRIDGE_HWND)) || (defined(HAVE_X11) && defined(BRIDGE_X11)) | |||||
#ifndef CARLA_OS_MAC | |||||
if (options.transientWindowId != 0) | if (options.transientWindowId != 0) | ||||
{ | { | ||||
fHostUI->setTransientWinId(options.transientWindowId); | fHostUI->setTransientWinId(options.transientWindowId); | ||||
@@ -235,5 +239,6 @@ CARLA_BRIDGE_UI_END_NAMESPACE | |||||
#define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative | #define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative | ||||
#include "CarlaPluginUI.cpp" | #include "CarlaPluginUI.cpp" | ||||
#include "CarlaMacUtils.cpp" | #include "CarlaMacUtils.cpp" | ||||
#include "utils/Windows.cpp" | |||||
// ------------------------------------------------------------------------- | // ------------------------------------------------------------------------- |
@@ -29,7 +29,7 @@ public: | |||||
public: | public: | ||||
virtual ~Callback() {} | virtual ~Callback() {} | ||||
virtual void handlePluginUIClosed() = 0; | virtual void handlePluginUIClosed() = 0; | ||||
virtual void handlePluginUIResized(const uint width, const uint height) = 0; | |||||
virtual void handlePluginUIResized(uint width, uint height) = 0; | |||||
}; | }; | ||||
virtual ~CarlaPluginUI() {} | virtual ~CarlaPluginUI() {} | ||||
@@ -37,17 +37,17 @@ public: | |||||
virtual void hide() = 0; | virtual void hide() = 0; | ||||
virtual void focus() = 0; | virtual void focus() = 0; | ||||
virtual void idle() = 0; | virtual void idle() = 0; | ||||
virtual void setSize(const uint with, const uint height, const bool forceUpdate) = 0; | |||||
virtual void setTitle(const char* const title) = 0; | |||||
virtual void setChildWindow(void* const ptr) = 0; | |||||
virtual void setTransientWinId(const uintptr_t winId) = 0; | |||||
virtual void setSize(uint with, uint height, bool forceUpdate) = 0; | |||||
virtual void setTitle(const char* title) = 0; | |||||
virtual void setChildWindow(void* ptr) = 0; | |||||
virtual void setTransientWinId(uintptr_t winId) = 0; | |||||
virtual void* getPtr() const noexcept = 0; | virtual void* getPtr() const noexcept = 0; | ||||
#ifdef HAVE_X11 | #ifdef HAVE_X11 | ||||
virtual void* getDisplay() const noexcept = 0; | virtual void* getDisplay() const noexcept = 0; | ||||
#endif | #endif | ||||
#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | ||||
static bool tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI); | |||||
static bool tryTransientWinIdMatch(uintptr_t pid, const char* uiTitle, uintptr_t winId, bool centerUI); | |||||
#endif | #endif | ||||
#ifdef CARLA_OS_MAC | #ifdef CARLA_OS_MAC | ||||