From 8b7226c7d497503afecd2fdb74aa88f04bba2e44 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 11 May 2024 03:05:46 +0200 Subject: [PATCH] Cleanup Signed-off-by: falkTX --- dgl/Widget.hpp | 6 ++---- distrho/DistrhoUI_macOS.mm | 4 +--- distrho/src/DistrhoPluginChecks.h | 36 ++++++++++++++----------------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/dgl/Widget.hpp b/dgl/Widget.hpp index 0c7e38f2..7766f483 100644 --- a/dgl/Widget.hpp +++ b/dgl/Widget.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2022 Filipe Coelho + * Copyright (C) 2012-2024 Filipe Coelho * * 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 @@ -404,12 +404,10 @@ public: Window& getParentWindow() const noexcept { return getWindow(); } protected: - #if defined(DGL_CAIRO) || defined(DGL_OPENGL) || defined(DGL_VULKAN) /** A function called to draw the widget contents. */ - virtual void onDisplay() = 0; - #endif + virtual void onDisplay() {}; /** A function called when a key is pressed or released. diff --git a/distrho/DistrhoUI_macOS.mm b/distrho/DistrhoUI_macOS.mm index ed33aae5..83560761 100644 --- a/distrho/DistrhoUI_macOS.mm +++ b/distrho/DistrhoUI_macOS.mm @@ -20,9 +20,7 @@ #include "src/DistrhoPluginChecks.h" #include "src/DistrhoDefines.h" -#if DISTRHO_UI_FILE_BROWSER || DISTRHO_UI_WEB_VIEW || DISTRHO_PLUGIN_HAS_EXTERNAL_UI -# import -#endif +#import #if DISTRHO_UI_FILE_BROWSER # define DISTRHO_FILE_BROWSER_DIALOG_HPP_INCLUDED diff --git a/distrho/src/DistrhoPluginChecks.h b/distrho/src/DistrhoPluginChecks.h index 37bf2d6c..37caaf2c 100644 --- a/distrho/src/DistrhoPluginChecks.h +++ b/distrho/src/DistrhoPluginChecks.h @@ -91,11 +91,7 @@ #endif #ifndef DISTRHO_UI_FILE_BROWSER -# if defined(DGL_FILE_BROWSER_DISABLED) || DISTRHO_PLUGIN_HAS_EXTERNAL_UI -# define DISTRHO_UI_FILE_BROWSER 0 -# else -# define DISTRHO_UI_FILE_BROWSER 1 -# endif +# define DISTRHO_UI_FILE_BROWSER 0 #endif #ifndef DISTRHO_UI_WEB_VIEW @@ -106,6 +102,17 @@ # define DISTRHO_UI_USER_RESIZABLE 0 #endif +// -------------------------------------------------------------------------------------------------------------------- +// set UI type + +#ifndef DISTRHO_UI_USE_CAIRO +# define DISTRHO_UI_USE_CAIRO 0 +#endif + +#ifndef DISTRHO_UI_USE_CUSTOM +# define DISTRHO_UI_USE_CUSTOM 0 +#endif + #ifndef DISTRHO_UI_USE_EXTERNAL # define DISTRHO_UI_USE_EXTERNAL 0 #endif @@ -136,14 +143,14 @@ // -------------------------------------------------------------------------------------------------------------------- // Test for wrong compiler macros -#if defined(DISTRHO_PLUGIN_HAS_EXTERNAL_UI) -# error DISTRHO_PLUGIN_HAS_EXTERNAL_UI has been replaced by DISTRHO_UI_USE_EXTERNAL -#endif - #if defined(DISTRHO_PLUGIN_HAS_EMBED_UI) # warning DISTRHO_PLUGIN_HAS_EMBED_UI has been removed, it is now always on #endif +#if defined(DISTRHO_PLUGIN_HAS_EXTERNAL_UI) +# error DISTRHO_PLUGIN_HAS_EXTERNAL_UI has been replaced by DISTRHO_UI_USE_EXTERNAL +#endif + #if defined(DGL_CAIRO) && defined(DGL_OPENGL) # error invalid build config: trying to build for both cairo and opengl at the same time #elif defined(DGL_EXTERNAL) && defined(DGL_CAIRO) @@ -216,17 +223,6 @@ # error DISTRHO_UI_DEFAULT_HEIGHT is defined but DISTRHO_UI_DEFAULT_WIDTH is not #endif -// -------------------------------------------------------------------------------------------------------------------- -// Other UI defaults - -#ifndef DISTRHO_UI_USE_CAIRO -# define DISTRHO_UI_USE_CAIRO 0 -#endif - -#ifndef DISTRHO_UI_USE_CUSTOM -# define DISTRHO_UI_USE_CUSTOM 0 -#endif - // -------------------------------------------------------------------------------------------------------------------- // Define DISTRHO_PLUGIN_AU_TYPE if needed