@@ -52,7 +52,7 @@ public: | |||||
}; | }; | ||||
explicit ButtonEventHandler(SubWidget* self); | explicit ButtonEventHandler(SubWidget* self); | ||||
~ButtonEventHandler(); | |||||
virtual ~ButtonEventHandler(); | |||||
bool isActive() noexcept; | bool isActive() noexcept; | ||||
void setActive(bool active, bool sendCallback) noexcept; | void setActive(bool active, bool sendCallback) noexcept; | ||||
@@ -117,7 +117,7 @@ public: | |||||
explicit KnobEventHandler(SubWidget* self); | explicit KnobEventHandler(SubWidget* self); | ||||
explicit KnobEventHandler(SubWidget* self, const KnobEventHandler& other); | explicit KnobEventHandler(SubWidget* self, const KnobEventHandler& other); | ||||
KnobEventHandler& operator=(const KnobEventHandler& other); | KnobEventHandler& operator=(const KnobEventHandler& other); | ||||
~KnobEventHandler(); | |||||
virtual ~KnobEventHandler(); | |||||
// returns raw value, is assumed to be scaled if using log | // returns raw value, is assumed to be scaled if using log | ||||
float getValue() const noexcept; | float getValue() const noexcept; | ||||
@@ -154,6 +154,15 @@ private: | |||||
struct PrivateData; | struct PrivateData; | ||||
PrivateData* const pData; | PrivateData* const pData; | ||||
/* not for use */ | |||||
#ifdef DISTRHO_PROPER_CPP11_SUPPORT | |||||
KnobEventHandler(KnobEventHandler& other) = delete; | |||||
KnobEventHandler(const KnobEventHandler& other) = delete; | |||||
#else | |||||
KnobEventHandler(KnobEventHandler& other); | |||||
KnobEventHandler(const KnobEventHandler& other); | |||||
#endif | |||||
DISTRHO_LEAK_DETECTOR(KnobEventHandler) | DISTRHO_LEAK_DETECTOR(KnobEventHandler) | ||||
}; | }; | ||||
@@ -23,6 +23,10 @@ | |||||
#include "TopLevelWidget.hpp" | #include "TopLevelWidget.hpp" | ||||
#include "StandaloneWindow.hpp" | #include "StandaloneWindow.hpp" | ||||
#ifdef _MSC_VER | |||||
# pragma warning(disable:4661) /* instantiated template classes whose methods are defined elsewhere */ | |||||
#endif | |||||
#ifndef DGL_NO_SHARED_RESOURCES | #ifndef DGL_NO_SHARED_RESOURCES | ||||
# define NANOVG_DEJAVU_SANS_TTF "__dpf_dejavusans_ttf__" | # define NANOVG_DEJAVU_SANS_TTF "__dpf_dejavusans_ttf__" | ||||
#endif | #endif | ||||
@@ -964,4 +968,8 @@ typedef NanoSubWidget NanoWidget; | |||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
#ifdef _MSC_VER | |||||
# pragma warning(enable:4661) | |||||
#endif | |||||
#endif // DGL_NANO_WIDGET_HPP_INCLUDED | #endif // DGL_NANO_WIDGET_HPP_INCLUDED |
@@ -114,10 +114,10 @@ Color::Color(const Color& color1, const Color& color2, const float u) noexcept | |||||
interpolate(color2, u); | interpolate(color2, u); | ||||
} | } | ||||
Color Color::withAlpha(const float alpha) noexcept | |||||
Color Color::withAlpha(const float alpha2) noexcept | |||||
{ | { | ||||
Color color(*this); | Color color(*this); | ||||
color.alpha = alpha; | |||||
color.alpha = alpha2; | |||||
return color; | return color; | ||||
} | } | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -15,8 +15,10 @@ | |||||
*/ | */ | ||||
#ifdef _MSC_VER | #ifdef _MSC_VER | ||||
// instantiated template classes whose methods are defined elsewhere | |||||
# pragma warning(disable:4661) | |||||
# pragma warning(disable:4661) /* instantiated template classes whose methods are defined elsewhere */ | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wconversion" | |||||
#endif | #endif | ||||
#include "../Geometry.hpp" | #include "../Geometry.hpp" | ||||
@@ -678,7 +678,7 @@ void Window::PrivateData::renderToPicture(const char* const filename, | |||||
GLubyte* const pixels = new GLubyte[width * height * 3 * sizeof(GLubyte)]; | GLubyte* const pixels = new GLubyte[width * height * 3 * sizeof(GLubyte)]; | ||||
glFlush(); | glFlush(); | ||||
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); | |||||
glReadPixels(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height), GL_RGB, GL_UNSIGNED_BYTE, pixels); | |||||
fprintf(f, "P3\n%d %d\n255\n", width, height); | fprintf(f, "P3\n%d %d\n255\n", width, height); | ||||
for (uint y = 0; y < height; y++) | for (uint y = 0; y < height; y++) | ||||
@@ -34,7 +34,9 @@ SubWidget::~SubWidget() | |||||
template<typename T> | template<typename T> | ||||
bool SubWidget::contains(const T x, const T y) const noexcept | bool SubWidget::contains(const T x, const T y) const noexcept | ||||
{ | { | ||||
return Rectangle<double>(0, 0, getWidth()-pData->margin.getX(), getHeight()-pData->margin.getY()).contains(x, y); | |||||
return Rectangle<double>(0, 0, | |||||
static_cast<double>(getWidth()) - pData->margin.getX(), | |||||
static_cast<double>(getHeight()) - pData->margin.getY()).contains(x, y); | |||||
} | } | ||||
template<typename T> | template<typename T> | ||||
@@ -220,10 +220,10 @@ void Window::setSize(uint width, uint height) | |||||
{ | { | ||||
// fix width | // fix width | ||||
if (reqRatio > ratio) | if (reqRatio > ratio) | ||||
width = height * ratio; | |||||
width = static_cast<uint>(height * ratio + 0.5); | |||||
// fix height | // fix height | ||||
else | else | ||||
height = width / ratio; | |||||
height = static_cast<uint>(static_cast<double>(width) / ratio + 0.5); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -355,7 +355,7 @@ public: | |||||
portGroupIndices.erase(kPortGroupNone); | portGroupIndices.erase(kPortGroupNone); | ||||
if (const size_t portGroupSize = portGroupIndices.size()) | |||||
if (const uint32_t portGroupSize = portGroupIndices.size()) | |||||
{ | { | ||||
fData->portGroups = new PortGroupWithId[portGroupSize]; | fData->portGroups = new PortGroupWithId[portGroupSize]; | ||||
fData->portGroupCount = portGroupSize; | fData->portGroupCount = portGroupSize; | ||||