commit 3de334d26cce42808314d53eddcee99a959dda85
parent 7f65db5dd30ffd11525c5e1e15d6b3bb3e72f85c
Author: falkTX <falktx@falktx.com>
Date: Thu, 2 Jun 2022 01:12:56 +0100
Tweaks to special macOS builds
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/distrho/DistrhoUI_macOS.mm b/distrho/DistrhoUI_macOS.mm
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -21,18 +21,20 @@
#include "src/DistrhoPluginChecks.h"
#include "src/DistrhoDefines.h"
-#if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
-
+#if DISTRHO_UI_FILE_BROWSER || DISTRHO_PLUGIN_HAS_EXTERNAL_UI
# import <Cocoa/Cocoa.h>
+#endif
+
+// A few utils declared in DistrhoUI.cpp but defined here because they uses Obj-C
+#if DISTRHO_UI_FILE_BROWSER
+# define FILE_BROWSER_DIALOG_DISTRHO_NAMESPACE
+# include "extra/FileBrowserDialog.hpp"
+# import "extra/FileBrowserDialogImpl.cpp"
+#endif
+
+#if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
# include <algorithm>
# include <cmath>
-# if DISTRHO_UI_FILE_BROWSER
-# define FILE_BROWSER_DIALOG_DISTRHO_NAMESPACE
-# include "extra/FileBrowserDialog.hpp"
-# import "extra/FileBrowserDialogImpl.cpp"
-# endif
-
-// Declared in DistrhoUI.cpp but defined here because it uses Obj-C
START_NAMESPACE_DISTRHO
double getDesktopScaleFactor(const uintptr_t parentWindowHandle)
{
@@ -47,9 +49,7 @@ double getDesktopScaleFactor(const uintptr_t parentWindowHandle)
return [NSScreen mainScreen].backingScaleFactor;
}
END_NAMESPACE_DISTRHO
-
#else // DISTRHO_PLUGIN_HAS_EXTERNAL_UI
-
# include "../dgl/Base.hpp"
# define DISTRHO_MACOS_NAMESPACE_MACRO_HELPER(DGL_NS, SEP, PUGL_NS, INTERFACE) DGL_NS ## SEP ## PUGL_NS ## SEP ## INTERFACE
# define DISTRHO_MACOS_NAMESPACE_MACRO(DGL_NS, PUGL_NS, INTERFACE) DISTRHO_MACOS_NAMESPACE_MACRO_HELPER(DGL_NS, _, PUGL_NS, INTERFACE)
@@ -61,5 +61,4 @@ END_NAMESPACE_DISTRHO
# define PuglWindowDelegate DISTRHO_MACOS_NAMESPACE_MACRO(DGL_NAMESPACE, PUGL_NAMESPACE, WindowDelegate)
# define PuglWrapperView DISTRHO_MACOS_NAMESPACE_MACRO(DGL_NAMESPACE, PUGL_NAMESPACE, WrapperView)
# import "src/pugl.mm"
-
#endif // DISTRHO_PLUGIN_HAS_EXTERNAL_UI