summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2018-09-30 16:03:28 +0200
committerfalkTX <falktx@gmail.com>2018-09-30 16:03:28 +0200
commita1748a1a9fd1ac6f8b8abaa26cec64f121d13d7e (patch)
treec6231b8dde5c830bde667670678fed6665c727ae
parent981e61a807280ea91bece2780e75ee3a48949675 (diff)
Assume Windows to be resizable by default; Add UI::isUserResizable
-rw-r--r--dgl/src/Window.cpp2
-rw-r--r--distrho/DistrhoUI.hpp6
-rw-r--r--distrho/src/DistrhoPluginLV2export.cpp31
-rw-r--r--distrho/src/DistrhoUI.cpp5
4 files changed, 37 insertions, 7 deletions
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
index 06549785..18c0d5f6 100644
--- a/dgl/src/Window.cpp
+++ b/dgl/src/Window.cpp
@@ -153,7 +153,7 @@ struct Window::PrivateData {
fView(puglInit()),
fFirstInit(true),
fVisible(parentId != 0),
- fResizable(parentId == 0),
+ fResizable(true),
fUsingEmbed(parentId != 0),
fWidth(1),
fHeight(1),
diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp
index 6975a699..b5e44e49 100644
--- a/distrho/DistrhoUI.hpp
+++ b/distrho/DistrhoUI.hpp
@@ -62,6 +62,12 @@ public:
virtual ~UI();
/**
+ Wherever this UI is resizable by the user.
+ This simply returns the value passed in the constructor.
+ */
+ bool isUserResizable() const noexcept;
+
+ /**
Set geometry constraints for the UI when resized by the user, and optionally scale UI automatically.
@see Window::setGeometryConstraints(uint,uint,bool)
@see Window::setScaling(double)
diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp
index 6ed2f7c5..08103f4d 100644
--- a/distrho/src/DistrhoPluginLV2export.cpp
+++ b/distrho/src/DistrhoPluginLV2export.cpp
@@ -139,8 +139,17 @@ void lv2_generate_ttl(const char* const basename)
# endif
manifestString += "\n";
# if DISTRHO_PLUGIN_HAS_EMBED_UI
- manifestString += " lv2:optionalFeature ui:noUserResize ,\n";
- manifestString += " ui:resize ,\n";
+ /*
+ if (! pluginUI.isUserResizable())
+ {
+ manifestString += " lv2:optionalFeature ui:noUserResize ,\n";
+ manifestString += " ui:resize ,\n";
+ }
+ else
+ */
+ {
+ manifestString += " lv2:optionalFeature ui:resize ,\n";
+ }
manifestString += " ui:touch ;\n";
manifestString += "\n";
# endif
@@ -148,9 +157,10 @@ void lv2_generate_ttl(const char* const basename)
manifestString += " <" LV2_INSTANCE_ACCESS_URI "> ,\n";
manifestString += " <" LV2_OPTIONS__options "> ,\n";
manifestString += " <" LV2_URID__map "> .\n";
-# else
+ manifestString += " opts:supportedOption <" LV2_PARAMETERS__sampleRate "> .\n";
+# else // DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
manifestString += " rdfs:seeAlso <" + uiTTL + "> .\n";
-# endif
+# endif // DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
manifestString += "\n";
#endif
@@ -628,8 +638,17 @@ void lv2_generate_ttl(const char* const basename)
# endif
uiString += "\n";
# if DISTRHO_PLUGIN_HAS_EMBED_UI
- uiString += " lv2:optionalFeature ui:noUserResize ,\n";
- uiString += " ui:resize ,\n";
+ /*
+ if (! pluginUI.isUserResizable())
+ {
+ uiString += " lv2:optionalFeature ui:noUserResize ,\n";
+ uiString += " ui:resize ,\n";
+ }
+ else
+ */
+ {
+ uiString += " lv2:optionalFeature ui:resize ,\n";
+ }
uiString += " ui:touch ;\n";
uiString += "\n";
# endif
diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp
index e48e365c..f83d0775 100644
--- a/distrho/src/DistrhoUI.cpp
+++ b/distrho/src/DistrhoUI.cpp
@@ -57,6 +57,11 @@ UI::~UI()
delete pData;
}
+bool UI::isUserResizable() const noexcept
+{
+ return pData->userResizable;
+}
+
void UI::setGeometryConstraints(uint minWidth, uint minHeight, bool keepAspectRatio, bool automaticallyScale)
{
DISTRHO_SAFE_ASSERT_RETURN(minWidth > 0,);