From d6ea31cdee4e43269dc11f1030fa9aad5f87a58a Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 3 May 2013 20:52:53 +0100 Subject: [PATCH] Move DGL StandaloneWindow to his own header --- source/libs/distrho/dgl/StandaloneWindow.hpp | 62 ++++++++++++++++++++ source/tests/DGL.cpp | 34 +---------- 2 files changed, 63 insertions(+), 33 deletions(-) create mode 100644 source/libs/distrho/dgl/StandaloneWindow.hpp diff --git a/source/libs/distrho/dgl/StandaloneWindow.hpp b/source/libs/distrho/dgl/StandaloneWindow.hpp new file mode 100644 index 000000000..6b7c3abc3 --- /dev/null +++ b/source/libs/distrho/dgl/StandaloneWindow.hpp @@ -0,0 +1,62 @@ +/* + * DISTRHO Plugin Toolkit (DPT) + * Copyright (C) 2012-2013 Filipe Coelho + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * For a full copy of the license see the LGPL.txt file + */ + +#ifndef __DGL_STANDALONE_WINDOW_HPP__ +#define __DGL_STANDALONE_WINDOW_HPP__ + +#include "App.hpp" +#include "Widget.hpp" +#include "Window.hpp" + +START_NAMESPACE_DGL + +// ------------------------------------------------- + +class StandaloneWindow +{ +public: + StandaloneWindow() + : fApp(), + fWindow(&fApp) + { + } + + App* getApp() + { + return &fApp; + } + + Window* getWindow() + { + return &fWindow; + } + + void exec() + { + fWindow.show(); + fApp.exec(); + } + +private: + App fApp; + Window fWindow; +}; + +// ------------------------------------------------- + +END_NAMESPACE_DGL + +#endif // __DGL_STANDALONE_WINDOW_HPP__ diff --git a/source/tests/DGL.cpp b/source/tests/DGL.cpp index 75b324167..ee06b6707 100644 --- a/source/tests/DGL.cpp +++ b/source/tests/DGL.cpp @@ -15,45 +15,13 @@ * For a full copy of the GNU General Public License see the GPL.txt file */ -#include "dgl/App.hpp" #include "dgl/Image.hpp" -#include "dgl/Widget.hpp" -#include "dgl/Window.hpp" +#include "dgl/StandaloneWindow.hpp" #include "DGL_Artwork.hpp" USE_NAMESPACE_DGL; -class StandaloneWindow -{ -public: - StandaloneWindow() - : fApp(), - fWindow(&fApp) - { - } - - App* getApp() - { - return &fApp; - } - - Window* getWindow() - { - return &fWindow; - } - - void exec() - { - fWindow.show(); - fApp.exec(); - } - -private: - App fApp; - Window fWindow; -}; - class MyWidget : public Widget { public: