Signed-off-by: falkTX <falktx@falktx.com>pull/272/head
@@ -110,37 +110,37 @@ private: | |||||
CairoWidget, handy class that takes graphics context during onDisplay and passes it in a new function. | CairoWidget, handy class that takes graphics context during onDisplay and passes it in a new function. | ||||
*/ | */ | ||||
template <class BaseWidget> | template <class BaseWidget> | ||||
class CairoWidget : public BaseWidget | |||||
class CairoBaseWidget : public BaseWidget | |||||
{ | { | ||||
public: | public: | ||||
/** | /** | ||||
Constructor for a CairoSubWidget. | Constructor for a CairoSubWidget. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit CairoWidget(Widget* const parentGroupWidget); | |||||
explicit CairoBaseWidget(Widget* const parentGroupWidget); | |||||
/** | /** | ||||
Constructor for a CairoTopLevelWidget. | Constructor for a CairoTopLevelWidget. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit CairoWidget(Window& windowToMapTo); | |||||
explicit CairoBaseWidget(Window& windowToMapTo); | |||||
/** | /** | ||||
Constructor for a CairoStandaloneWindow without parent window. | Constructor for a CairoStandaloneWindow without parent window. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit CairoWidget(Application& app); | |||||
explicit CairoBaseWidget(Application& app); | |||||
/** | /** | ||||
Constructor for a CairoStandaloneWindow with parent window. | Constructor for a CairoStandaloneWindow with parent window. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit CairoWidget(Application& app, Window& parentWindow); | |||||
explicit CairoBaseWidget(Application& app, Window& parentWindow); | |||||
/** | /** | ||||
Destructor. | Destructor. | ||||
*/ | */ | ||||
virtual ~CairoWidget() {} | |||||
virtual ~CairoBaseWidget() {} | |||||
protected: | protected: | ||||
/** | /** | ||||
@@ -160,12 +160,12 @@ private: | |||||
onCairoDisplay(context); | onCairoDisplay(context); | ||||
} | } | ||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CairoWidget); | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CairoBaseWidget); | |||||
}; | }; | ||||
typedef CairoWidget<SubWidget> CairoSubWidget; | |||||
typedef CairoWidget<TopLevelWidget> CairoTopLevelWidget; | |||||
typedef CairoWidget<StandaloneWindow> CairoStandaloneWindow; | |||||
typedef CairoBaseWidget<SubWidget> CairoSubWidget; | |||||
typedef CairoBaseWidget<TopLevelWidget> CairoTopLevelWidget; | |||||
typedef CairoBaseWidget<StandaloneWindow> CairoStandaloneWindow; | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
@@ -17,7 +17,6 @@ | |||||
#ifndef DGL_IMAGE_HPP_INCLUDED | #ifndef DGL_IMAGE_HPP_INCLUDED | ||||
#define DGL_IMAGE_HPP_INCLUDED | #define DGL_IMAGE_HPP_INCLUDED | ||||
#include "ImageBase.hpp" | |||||
#include "OpenGL.hpp" | #include "OpenGL.hpp" | ||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
@@ -878,38 +878,38 @@ private: | |||||
new onNanoDisplay() needs to be overridden instead. | new onNanoDisplay() needs to be overridden instead. | ||||
*/ | */ | ||||
template <class BaseWidget> | template <class BaseWidget> | ||||
class NanoWidget : public BaseWidget, | |||||
public NanoVG | |||||
class NanoBaseWidget : public BaseWidget, | |||||
public NanoVG | |||||
{ | { | ||||
public: | public: | ||||
/** | /** | ||||
Constructor for a NanoSubWidget. | Constructor for a NanoSubWidget. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit NanoWidget(Widget* const parentGroupWidget, int flags = CREATE_ANTIALIAS); | |||||
explicit NanoBaseWidget(Widget* const parentGroupWidget, int flags = CREATE_ANTIALIAS); | |||||
/** | /** | ||||
Constructor for a NanoTopLevelWidget. | Constructor for a NanoTopLevelWidget. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit NanoWidget(Window& windowToMapTo, int flags = CREATE_ANTIALIAS); | |||||
explicit NanoBaseWidget(Window& windowToMapTo, int flags = CREATE_ANTIALIAS); | |||||
/** | /** | ||||
Constructor for a NanoStandaloneWindow without parent window. | Constructor for a NanoStandaloneWindow without parent window. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit NanoWidget(Application& app, int flags = CREATE_ANTIALIAS); | |||||
explicit NanoBaseWidget(Application& app, int flags = CREATE_ANTIALIAS); | |||||
/** | /** | ||||
Constructor for a NanoStandaloneWindow with parent window. | Constructor for a NanoStandaloneWindow with parent window. | ||||
@see CreateFlags | @see CreateFlags | ||||
*/ | */ | ||||
explicit NanoWidget(Application& app, Window& parentWindow, int flags = CREATE_ANTIALIAS); | |||||
explicit NanoBaseWidget(Application& app, Window& parentWindow, int flags = CREATE_ANTIALIAS); | |||||
/** | /** | ||||
Destructor. | Destructor. | ||||
*/ | */ | ||||
virtual ~NanoWidget() {} | |||||
virtual ~NanoBaseWidget() {} | |||||
protected: | protected: | ||||
/** | /** | ||||
@@ -937,12 +937,15 @@ private: | |||||
void cancelFrame() {} | void cancelFrame() {} | ||||
void endFrame() {} | void endFrame() {} | ||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NanoWidget) | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NanoBaseWidget) | |||||
}; | }; | ||||
typedef NanoWidget<SubWidget> NanoSubWidget; | |||||
typedef NanoWidget<TopLevelWidget> NanoTopLevelWidget; | |||||
typedef NanoWidget<StandaloneWindow> NanoStandaloneWindow; | |||||
typedef NanoBaseWidget<SubWidget> NanoSubWidget; | |||||
typedef NanoBaseWidget<TopLevelWidget> NanoTopLevelWidget; | |||||
typedef NanoBaseWidget<StandaloneWindow> NanoStandaloneWindow; | |||||
DISTRHO_DEPRECATED_BY("NanoSubWidget") | |||||
typedef NanoSubWidget NanoWidget; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -136,7 +136,7 @@ private: | |||||
struct PrivateData; | struct PrivateData; | ||||
PrivateData* const pData; | PrivateData* const pData; | ||||
friend class Widget; | friend class Widget; | ||||
template <class BaseWidget> friend class NanoWidget; | |||||
template <class BaseWidget> friend class NanoBaseWidget; | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SubWidget) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SubWidget) | ||||
}; | }; | ||||
@@ -432,32 +432,32 @@ CairoImage& CairoImage::operator=(const CairoImage& image) noexcept | |||||
// CairoSubWidget | // CairoSubWidget | ||||
template <> | template <> | ||||
CairoWidget<SubWidget>::CairoWidget(Widget* const parent) | |||||
CairoBaseWidget<SubWidget>::CairoBaseWidget(Widget* const parent) | |||||
: SubWidget(parent) {} | : SubWidget(parent) {} | ||||
template class CairoWidget<SubWidget>; | |||||
template class CairoBaseWidget<SubWidget>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// CairoTopLevelWidget | // CairoTopLevelWidget | ||||
template <> | template <> | ||||
CairoWidget<TopLevelWidget>::CairoWidget(Window& windowToMapTo) | |||||
CairoBaseWidget<TopLevelWidget>::CairoBaseWidget(Window& windowToMapTo) | |||||
: TopLevelWidget(windowToMapTo) {} | : TopLevelWidget(windowToMapTo) {} | ||||
template class CairoWidget<TopLevelWidget>; | |||||
template class CairoBaseWidget<TopLevelWidget>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// CairoStandaloneWindow | // CairoStandaloneWindow | ||||
template <> | template <> | ||||
CairoWidget<StandaloneWindow>::CairoWidget(Application& app) | |||||
CairoBaseWidget<StandaloneWindow>::CairoBaseWidget(Application& app) | |||||
: StandaloneWindow(app) {} | : StandaloneWindow(app) {} | ||||
template <> | template <> | ||||
CairoWidget<StandaloneWindow>::CairoWidget(Application& app, Window& parentWindow) | |||||
CairoBaseWidget<StandaloneWindow>::CairoBaseWidget(Application& app, Window& parentWindow) | |||||
: StandaloneWindow(app, parentWindow) {} | : StandaloneWindow(app, parentWindow) {} | ||||
template class CairoWidget<StandaloneWindow>; | |||||
template class CairoBaseWidget<StandaloneWindow>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -257,11 +257,6 @@ NanoVG::NanoVG(int flags) | |||||
fInFrame(false), | fInFrame(false), | ||||
fIsSubWidget(false) {} | fIsSubWidget(false) {} | ||||
// NanoVG::NanoVG(NanoWidget* groupWidget) | |||||
// : fContext(groupWidget->fContext), | |||||
// fInFrame(false), | |||||
// fIsSubWidget(true) {} | |||||
NanoVG::~NanoVG() | NanoVG::~NanoVG() | ||||
{ | { | ||||
DISTRHO_SAFE_ASSERT(! fInFrame); | DISTRHO_SAFE_ASSERT(! fInFrame); | ||||
@@ -946,39 +941,39 @@ bool NanoVG::loadSharedResources() | |||||
// NanoSubWidget | // NanoSubWidget | ||||
template <> | template <> | ||||
NanoWidget<SubWidget>::NanoWidget(Widget* const parent, int flags) | |||||
NanoBaseWidget<SubWidget>::NanoBaseWidget(Widget* const parent, int flags) | |||||
: SubWidget(parent), | : SubWidget(parent), | ||||
NanoVG(flags) | NanoVG(flags) | ||||
{ | { | ||||
pData->needsViewportScaling = true; | pData->needsViewportScaling = true; | ||||
} | } | ||||
template class NanoWidget<SubWidget>; | |||||
template class NanoBaseWidget<SubWidget>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// NanoTopLevelWidget | // NanoTopLevelWidget | ||||
template <> | template <> | ||||
NanoWidget<TopLevelWidget>::NanoWidget(Window& windowToMapTo, int flags) | |||||
NanoBaseWidget<TopLevelWidget>::NanoBaseWidget(Window& windowToMapTo, int flags) | |||||
: TopLevelWidget(windowToMapTo), | : TopLevelWidget(windowToMapTo), | ||||
NanoVG(flags) {} | NanoVG(flags) {} | ||||
template class NanoWidget<TopLevelWidget>; | |||||
template class NanoBaseWidget<TopLevelWidget>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// NanoStandaloneWindow | // NanoStandaloneWindow | ||||
template <> | template <> | ||||
NanoWidget<StandaloneWindow>::NanoWidget(Application& app, int flags) | |||||
NanoBaseWidget<StandaloneWindow>::NanoBaseWidget(Application& app, int flags) | |||||
: StandaloneWindow(app), | : StandaloneWindow(app), | ||||
NanoVG(flags) {} | NanoVG(flags) {} | ||||
template <> | template <> | ||||
NanoWidget<StandaloneWindow>::NanoWidget(Application& app, Window& parentWindow, int flags) | |||||
NanoBaseWidget<StandaloneWindow>::NanoBaseWidget(Application& app, Window& parentWindow, int flags) | |||||
: StandaloneWindow(app, parentWindow), | : StandaloneWindow(app, parentWindow), | ||||
NanoVG(flags) {} | NanoVG(flags) {} | ||||
template class NanoWidget<StandaloneWindow>; | |||||
template class NanoBaseWidget<StandaloneWindow>; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -213,6 +213,6 @@ END_NAMESPACE_DISTRHO | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// Possible template data types | // Possible template data types | ||||
template class NanoWidget<SubWidget>; | |||||
template class NanoWidget<TopLevelWidget>; | |||||
template class NanoWidget<StandaloneWindow>; | |||||
// template class NanoBaseWidget<SubWidget>; | |||||
// template class NanoBaseWidget<TopLevelWidget>; | |||||
// template class NanoBaseWidget<StandaloneWindow>; |