Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed May 11, 2024
1 parent d855726 commit 8b7226c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
6 changes: 2 additions & 4 deletions dgl/Widget.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2024 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
Expand Down Expand Up @@ -404,12 +404,10 @@ class Widget
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.
Expand Down
4 changes: 1 addition & 3 deletions distrho/DistrhoUI_macOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Cocoa/Cocoa.h>
#endif
#import <Cocoa/Cocoa.h>

#if DISTRHO_UI_FILE_BROWSER
# define DISTRHO_FILE_BROWSER_DIALOG_HPP_INCLUDED
Expand Down
36 changes: 16 additions & 20 deletions distrho/src/DistrhoPluginChecks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8b7226c

Please sign in to comment.