Browse Source

Assume Windows to be resizable by default; Add UI::isUserResizable

pull/83/head
falkTX 6 years ago
parent
commit
a1748a1a9f
4 changed files with 37 additions and 7 deletions
  1. +1
    -1
      dgl/src/Window.cpp
  2. +6
    -0
      distrho/DistrhoUI.hpp
  3. +25
    -6
      distrho/src/DistrhoPluginLV2export.cpp
  4. +5
    -0
      distrho/src/DistrhoUI.cpp

+ 1
- 1
dgl/src/Window.cpp View File

@@ -153,7 +153,7 @@ struct Window::PrivateData {
fView(puglInit()), fView(puglInit()),
fFirstInit(true), fFirstInit(true),
fVisible(parentId != 0), fVisible(parentId != 0),
fResizable(parentId == 0),
fResizable(true),
fUsingEmbed(parentId != 0), fUsingEmbed(parentId != 0),
fWidth(1), fWidth(1),
fHeight(1), fHeight(1),


+ 6
- 0
distrho/DistrhoUI.hpp View File

@@ -61,6 +61,12 @@ public:
*/ */
virtual ~UI(); 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. Set geometry constraints for the UI when resized by the user, and optionally scale UI automatically.
@see Window::setGeometryConstraints(uint,uint,bool) @see Window::setGeometryConstraints(uint,uint,bool)


+ 25
- 6
distrho/src/DistrhoPluginLV2export.cpp View File

@@ -139,8 +139,17 @@ void lv2_generate_ttl(const char* const basename)
# endif # endif
manifestString += "\n"; manifestString += "\n";
# if DISTRHO_PLUGIN_HAS_EMBED_UI # 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 += " ui:touch ;\n";
manifestString += "\n"; manifestString += "\n";
# endif # endif
@@ -148,9 +157,10 @@ void lv2_generate_ttl(const char* const basename)
manifestString += " <" LV2_INSTANCE_ACCESS_URI "> ,\n"; manifestString += " <" LV2_INSTANCE_ACCESS_URI "> ,\n";
manifestString += " <" LV2_OPTIONS__options "> ,\n"; manifestString += " <" LV2_OPTIONS__options "> ,\n";
manifestString += " <" LV2_URID__map "> .\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"; manifestString += " rdfs:seeAlso <" + uiTTL + "> .\n";
# endif
# endif // DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
manifestString += "\n"; manifestString += "\n";
#endif #endif


@@ -628,8 +638,17 @@ void lv2_generate_ttl(const char* const basename)
# endif # endif
uiString += "\n"; uiString += "\n";
# if DISTRHO_PLUGIN_HAS_EMBED_UI # 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 += " ui:touch ;\n";
uiString += "\n"; uiString += "\n";
# endif # endif


+ 5
- 0
distrho/src/DistrhoUI.cpp View File

@@ -57,6 +57,11 @@ UI::~UI()
delete pData; delete pData;
} }


bool UI::isUserResizable() const noexcept
{
return pData->userResizable;
}

void UI::setGeometryConstraints(uint minWidth, uint minHeight, bool keepAspectRatio, bool automaticallyScale) void UI::setGeometryConstraints(uint minWidth, uint minHeight, bool keepAspectRatio, bool automaticallyScale)
{ {
DISTRHO_SAFE_ASSERT_RETURN(minWidth > 0,); DISTRHO_SAFE_ASSERT_RETURN(minWidth > 0,);


Loading…
Cancel
Save