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. | |||
*/ | |||
template <class BaseWidget> | |||
class CairoWidget : public BaseWidget | |||
class CairoBaseWidget : public BaseWidget | |||
{ | |||
public: | |||
/** | |||
Constructor for a CairoSubWidget. | |||
@see CreateFlags | |||
*/ | |||
explicit CairoWidget(Widget* const parentGroupWidget); | |||
explicit CairoBaseWidget(Widget* const parentGroupWidget); | |||
/** | |||
Constructor for a CairoTopLevelWidget. | |||
@see CreateFlags | |||
*/ | |||
explicit CairoWidget(Window& windowToMapTo); | |||
explicit CairoBaseWidget(Window& windowToMapTo); | |||
/** | |||
Constructor for a CairoStandaloneWindow without parent window. | |||
@see CreateFlags | |||
*/ | |||
explicit CairoWidget(Application& app); | |||
explicit CairoBaseWidget(Application& app); | |||
/** | |||
Constructor for a CairoStandaloneWindow with parent window. | |||
@see CreateFlags | |||
*/ | |||
explicit CairoWidget(Application& app, Window& parentWindow); | |||
explicit CairoBaseWidget(Application& app, Window& parentWindow); | |||
/** | |||
Destructor. | |||
*/ | |||
virtual ~CairoWidget() {} | |||
virtual ~CairoBaseWidget() {} | |||
protected: | |||
/** | |||
@@ -160,12 +160,12 @@ private: | |||
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 | |||
#define DGL_IMAGE_HPP_INCLUDED | |||
#include "ImageBase.hpp" | |||
#include "OpenGL.hpp" | |||
START_NAMESPACE_DGL | |||
@@ -878,38 +878,38 @@ private: | |||
new onNanoDisplay() needs to be overridden instead. | |||
*/ | |||
template <class BaseWidget> | |||
class NanoWidget : public BaseWidget, | |||
public NanoVG | |||
class NanoBaseWidget : public BaseWidget, | |||
public NanoVG | |||
{ | |||
public: | |||
/** | |||
Constructor for a NanoSubWidget. | |||
@see CreateFlags | |||
*/ | |||
explicit NanoWidget(Widget* const parentGroupWidget, int flags = CREATE_ANTIALIAS); | |||
explicit NanoBaseWidget(Widget* const parentGroupWidget, int flags = CREATE_ANTIALIAS); | |||
/** | |||
Constructor for a NanoTopLevelWidget. | |||
@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. | |||
@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. | |||
@see CreateFlags | |||
*/ | |||
explicit NanoWidget(Application& app, Window& parentWindow, int flags = CREATE_ANTIALIAS); | |||
explicit NanoBaseWidget(Application& app, Window& parentWindow, int flags = CREATE_ANTIALIAS); | |||
/** | |||
Destructor. | |||
*/ | |||
virtual ~NanoWidget() {} | |||
virtual ~NanoBaseWidget() {} | |||
protected: | |||
/** | |||
@@ -937,12 +937,15 @@ private: | |||
void cancelFrame() {} | |||
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; | |||
PrivateData* const pData; | |||
friend class Widget; | |||
template <class BaseWidget> friend class NanoWidget; | |||
template <class BaseWidget> friend class NanoBaseWidget; | |||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SubWidget) | |||
}; | |||
@@ -432,32 +432,32 @@ CairoImage& CairoImage::operator=(const CairoImage& image) noexcept | |||
// CairoSubWidget | |||
template <> | |||
CairoWidget<SubWidget>::CairoWidget(Widget* const parent) | |||
CairoBaseWidget<SubWidget>::CairoBaseWidget(Widget* const parent) | |||
: SubWidget(parent) {} | |||
template class CairoWidget<SubWidget>; | |||
template class CairoBaseWidget<SubWidget>; | |||
// ----------------------------------------------------------------------- | |||
// CairoTopLevelWidget | |||
template <> | |||
CairoWidget<TopLevelWidget>::CairoWidget(Window& windowToMapTo) | |||
CairoBaseWidget<TopLevelWidget>::CairoBaseWidget(Window& windowToMapTo) | |||
: TopLevelWidget(windowToMapTo) {} | |||
template class CairoWidget<TopLevelWidget>; | |||
template class CairoBaseWidget<TopLevelWidget>; | |||
// ----------------------------------------------------------------------- | |||
// CairoStandaloneWindow | |||
template <> | |||
CairoWidget<StandaloneWindow>::CairoWidget(Application& app) | |||
CairoBaseWidget<StandaloneWindow>::CairoBaseWidget(Application& app) | |||
: StandaloneWindow(app) {} | |||
template <> | |||
CairoWidget<StandaloneWindow>::CairoWidget(Application& app, Window& parentWindow) | |||
CairoBaseWidget<StandaloneWindow>::CairoBaseWidget(Application& app, Window& parentWindow) | |||
: StandaloneWindow(app, parentWindow) {} | |||
template class CairoWidget<StandaloneWindow>; | |||
template class CairoBaseWidget<StandaloneWindow>; | |||
// ----------------------------------------------------------------------- | |||
@@ -257,11 +257,6 @@ NanoVG::NanoVG(int flags) | |||
fInFrame(false), | |||
fIsSubWidget(false) {} | |||
// NanoVG::NanoVG(NanoWidget* groupWidget) | |||
// : fContext(groupWidget->fContext), | |||
// fInFrame(false), | |||
// fIsSubWidget(true) {} | |||
NanoVG::~NanoVG() | |||
{ | |||
DISTRHO_SAFE_ASSERT(! fInFrame); | |||
@@ -946,39 +941,39 @@ bool NanoVG::loadSharedResources() | |||
// NanoSubWidget | |||
template <> | |||
NanoWidget<SubWidget>::NanoWidget(Widget* const parent, int flags) | |||
NanoBaseWidget<SubWidget>::NanoBaseWidget(Widget* const parent, int flags) | |||
: SubWidget(parent), | |||
NanoVG(flags) | |||
{ | |||
pData->needsViewportScaling = true; | |||
} | |||
template class NanoWidget<SubWidget>; | |||
template class NanoBaseWidget<SubWidget>; | |||
// ----------------------------------------------------------------------- | |||
// NanoTopLevelWidget | |||
template <> | |||
NanoWidget<TopLevelWidget>::NanoWidget(Window& windowToMapTo, int flags) | |||
NanoBaseWidget<TopLevelWidget>::NanoBaseWidget(Window& windowToMapTo, int flags) | |||
: TopLevelWidget(windowToMapTo), | |||
NanoVG(flags) {} | |||
template class NanoWidget<TopLevelWidget>; | |||
template class NanoBaseWidget<TopLevelWidget>; | |||
// ----------------------------------------------------------------------- | |||
// NanoStandaloneWindow | |||
template <> | |||
NanoWidget<StandaloneWindow>::NanoWidget(Application& app, int flags) | |||
NanoBaseWidget<StandaloneWindow>::NanoBaseWidget(Application& app, int flags) | |||
: StandaloneWindow(app), | |||
NanoVG(flags) {} | |||
template <> | |||
NanoWidget<StandaloneWindow>::NanoWidget(Application& app, Window& parentWindow, int flags) | |||
NanoBaseWidget<StandaloneWindow>::NanoBaseWidget(Application& app, Window& parentWindow, int flags) | |||
: StandaloneWindow(app, parentWindow), | |||
NanoVG(flags) {} | |||
template class NanoWidget<StandaloneWindow>; | |||
template class NanoBaseWidget<StandaloneWindow>; | |||
// ----------------------------------------------------------------------- | |||
@@ -213,6 +213,6 @@ END_NAMESPACE_DISTRHO | |||
// ----------------------------------------------------------------------- | |||
// 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>; |