summaryrefslogtreecommitdiff
path: root/distrho/src/DistrhoUIInternal.hpp
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2014-11-20 08:50:13 +0000
committerfalkTX <falktx@gmail.com>2014-11-20 08:50:13 +0000
commitd3fe0ec778625b27eadd754b39199b881e2ae18f (patch)
tree4dbad7ddf73e5908b16fea4da52d5d339f4643ce /distrho/src/DistrhoUIInternal.hpp
parentf3d6a10d7505846ecdbac24d60a45f44a9d1c4fa (diff)
Remove NTK references, now in a separate repo
Diffstat (limited to 'distrho/src/DistrhoUIInternal.hpp')
-rw-r--r--distrho/src/DistrhoUIInternal.hpp46
1 files changed, 11 insertions, 35 deletions
diff --git a/distrho/src/DistrhoUIInternal.hpp b/distrho/src/DistrhoUIInternal.hpp
index 14b2fdd4..5092af33 100644
--- a/distrho/src/DistrhoUIInternal.hpp
+++ b/distrho/src/DistrhoUIInternal.hpp
@@ -18,29 +18,21 @@
#define DISTRHO_UI_INTERNAL_HPP_INCLUDED
#include "../DistrhoUI.hpp"
+#include "../../dgl/App.hpp"
+#include "../../dgl/Window.hpp"
-#if DISTRHO_UI_USE_NTK
-# include "../../dgl/ntk/NtkApp.hpp"
-# include "../../dgl/ntk/NtkWindow.hpp"
-typedef DGL::NtkApp App;
-typedef DGL::NtkWindow UIWindow;
-#else
-# include "../../dgl/App.hpp"
-# include "../../dgl/Window.hpp"
-typedef DGL::App App;
-typedef DGL::Window UIWindow;
-#endif
-
+using DGL::App;
using DGL::IdleCallback;
+using DGL::Window;
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
// Static data, see DistrhoUI.cpp
-extern double d_lastUiSampleRate;
-extern void* d_lastUiDspPtr;
-extern UIWindow* d_lastUiWindow;
+extern double d_lastUiSampleRate;
+extern void* d_lastUiDspPtr;
+extern Window* d_lastUiWindow;
// -----------------------------------------------------------------------
// UI callbacks
@@ -137,25 +129,21 @@ struct UI::PrivateData {
// Plugin Window, needed to take care of resize properly
static inline
-UI* createUiWrapper(void* const dspPtr, UIWindow* const window)
+UI* createUiWrapper(void* const dspPtr, Window* const window)
{
d_lastUiDspPtr = dspPtr;
d_lastUiWindow = window;
-#if DISTRHO_UI_USE_NTK
- UI* const ret = window->getApp().createUI((void*)createUI);
-#else
UI* const ret = createUI();
-#endif
d_lastUiDspPtr = nullptr;
d_lastUiWindow = nullptr;
return ret;
}
-class UIExporterWindow : public UIWindow
+class UIExporterWindow : public Window
{
public:
UIExporterWindow(App& app, const intptr_t winId, void* const dspPtr)
- : UIWindow(app, winId),
+ : Window(app, winId),
fUI(createUiWrapper(dspPtr, this)),
fIsReady(false)
{
@@ -168,11 +156,7 @@ public:
~UIExporterWindow()
{
-#if DISTRHO_UI_USE_NTK
- getApp().deleteUI(fUI);
-#else
delete fUI;
-#endif
}
UI* getUI() const noexcept
@@ -185,14 +169,7 @@ public:
return fIsReady;
}
-//protected:
-#if DISTRHO_UI_USE_NTK
- void resize(int x, int y, int width, int height) override
- {
- UIWindow::resize(x, y, width, height);
- fIsReady = true;
- }
-#else
+protected:
void onReshape(uint width, uint height) override
{
DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,);
@@ -202,7 +179,6 @@ public:
fIsReady = true;
}
-#endif
private:
UI* const fUI;