summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ttlgen.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/ttlgen.cc b/ttlgen.cc
index 77780d0..7d6bd93 100644
--- a/ttlgen.cc
+++ b/ttlgen.cc
@@ -69,6 +69,23 @@ static void includes(std::ostream& output)
";
}
+// If UIClass was not explicitly set already, try to autodetect it based on
+// operating system.
+#ifndef UIClass
+ #ifdef __linux__
+ #define UIClass "X11UI"
+ #elif _WIN32
+ #define UIClass "WindowsUI"
+ #elif __APPLE__
+ #define UIClass "CocoaUI"
+ #elif __FreeBSD__
+ #define UIClass "X11UI"
+ #elif __unix__
+ // All other unices (*BSD etc)
+ #define UIClass "X11UI"
+ #endif
+#endif
+
static void ui(Plugin& plugin, const std::string& pluginfile, std::ostream& output)
{
if(!plugin.hasGUI())
@@ -78,7 +95,7 @@ static void ui(Plugin& plugin, const std::string& pluginfile, std::ostream& outp
output << "\
<" << plugin.getURI() << "/lv2#ui>\n\
- a ui:X11UI ;\n\
+ a ui:" UIClass " ;\n \
lv2:requiredFeature ui:resize ;\n\
lv2:extensionData ui:resize ;\n\
lv2:requiredFeature ui:idleInterface ;\n\