@@ -31,11 +31,10 @@ | |||||
#define END_NAMESPACE_DGL } | #define END_NAMESPACE_DGL } | ||||
#define USE_NAMESPACE_DGL using namespace DGL_NAMESPACE; | #define USE_NAMESPACE_DGL using namespace DGL_NAMESPACE; | ||||
#ifdef DISTRHO_OS_WINDOWS | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// Fix OpenGL includes for Windows, based on glfw code | // Fix OpenGL includes for Windows, based on glfw code | ||||
#ifdef DISTRHO_OS_WINDOWS | |||||
#ifndef APIENTRY | #ifndef APIENTRY | ||||
# define APIENTRY __stdcall | # define APIENTRY __stdcall | ||||
#endif // APIENTRY | #endif // APIENTRY | ||||
@@ -34,13 +34,13 @@ public: | |||||
virtual void imageButtonClicked(ImageButton* imageButton, int button) = 0; | virtual void imageButtonClicked(ImageButton* imageButton, int button) = 0; | ||||
}; | }; | ||||
ImageButton(Window& parent, const Image& image); | |||||
ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown); | |||||
ImageButton(Widget* widget, const Image& image); | |||||
ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown); | |||||
ImageButton(const ImageButton& imageButton); | |||||
ImageButton(Window& parent, const Image& image) noexcept; | |||||
ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown) noexcept; | |||||
ImageButton(Widget* widget, const Image& image) noexcept; | |||||
ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown) noexcept; | |||||
ImageButton(const ImageButton& imageButton) noexcept; | |||||
void setCallback(Callback* callback); | |||||
void setCallback(Callback* callback) noexcept; | |||||
protected: | protected: | ||||
void onDisplay() override; | void onDisplay() override; | ||||
@@ -59,8 +59,6 @@ private: | |||||
DISTRHO_LEAK_DETECTOR(ImageButton) | DISTRHO_LEAK_DETECTOR(ImageButton) | ||||
}; | }; | ||||
typedef ScopedPointer<ImageButton> ImageButtonPtr; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
@@ -41,19 +41,22 @@ public: | |||||
virtual void imageKnobValueChanged(ImageKnob* imageKnob, float value) = 0; | virtual void imageKnobValueChanged(ImageKnob* imageKnob, float value) = 0; | ||||
}; | }; | ||||
ImageKnob(Window& parent, const Image& image, Orientation orientation = Vertical); | |||||
ImageKnob(Widget* widget, const Image& image, Orientation orientation = Vertical); | |||||
ImageKnob(Window& parent, const Image& image, Orientation orientation = Vertical, int id = 0) noexcept; | |||||
ImageKnob(Widget* widget, const Image& image, Orientation orientation = Vertical, int id = 0) noexcept; | |||||
ImageKnob(const ImageKnob& imageKnob); | ImageKnob(const ImageKnob& imageKnob); | ||||
float getValue() const; | |||||
int getId() const noexcept; | |||||
void setId(int id) noexcept; | |||||
void setOrientation(Orientation orientation); | |||||
void setRange(float min, float max); | |||||
void setStep(float step); | |||||
void setValue(float value, bool sendCallback = false); | |||||
float getValue() const noexcept; | |||||
void setOrientation(Orientation orientation) noexcept; | |||||
void setRange(float min, float max) noexcept; | |||||
void setStep(float step) noexcept; | |||||
void setValue(float value, bool sendCallback = false) noexcept; | |||||
void setRotationAngle(int angle); | void setRotationAngle(int angle); | ||||
void setCallback(Callback* callback); | |||||
void setCallback(Callback* callback) noexcept; | |||||
protected: | protected: | ||||
void onDisplay() override; | void onDisplay() override; | ||||
@@ -64,6 +67,7 @@ protected: | |||||
private: | private: | ||||
Image fImage; | Image fImage; | ||||
int fId; | |||||
float fMinimum; | float fMinimum; | ||||
float fMaximum; | float fMaximum; | ||||
float fStep; | float fStep; | ||||
@@ -87,8 +91,6 @@ private: | |||||
DISTRHO_LEAK_DETECTOR(ImageKnob) | DISTRHO_LEAK_DETECTOR(ImageKnob) | ||||
}; | }; | ||||
typedef ScopedPointer<ImageKnob> ImageKnobPtr; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
@@ -36,23 +36,26 @@ public: | |||||
virtual void imageSliderValueChanged(ImageSlider* imageSlider, float value) = 0; | virtual void imageSliderValueChanged(ImageSlider* imageSlider, float value) = 0; | ||||
}; | }; | ||||
ImageSlider(Window& parent, const Image& image); | |||||
ImageSlider(Widget* widget, const Image& image); | |||||
ImageSlider(const ImageSlider& imageSlider); | |||||
ImageSlider(Window& parent, const Image& image, int id = 0) noexcept; | |||||
ImageSlider(Widget* widget, const Image& image, int id = 0) noexcept; | |||||
ImageSlider(const ImageSlider& imageSlider) noexcept; | |||||
float getValue() const; | |||||
int getId() const noexcept; | |||||
void setId(int id) noexcept; | |||||
void setStartPos(const Point<int>& startPos); | |||||
void setStartPos(int x, int y); | |||||
void setEndPos(const Point<int>& endPos); | |||||
void setEndPos(int x, int y); | |||||
float getValue() const noexcept; | |||||
void setInverted(bool inverted); | |||||
void setRange(float min, float max); | |||||
void setStep(float step); | |||||
void setValue(float value, bool sendCallback = false); | |||||
void setStartPos(const Point<int>& startPos) noexcept; | |||||
void setStartPos(int x, int y) noexcept; | |||||
void setEndPos(const Point<int>& endPos) noexcept; | |||||
void setEndPos(int x, int y) noexcept; | |||||
void setCallback(Callback* callback); | |||||
void setInverted(bool inverted) noexcept; | |||||
void setRange(float min, float max) noexcept; | |||||
void setStep(float step) noexcept; | |||||
void setValue(float value, bool sendCallback = false) noexcept; | |||||
void setCallback(Callback* callback) noexcept; | |||||
protected: | protected: | ||||
void onDisplay() override; | void onDisplay() override; | ||||
@@ -61,6 +64,7 @@ protected: | |||||
private: | private: | ||||
Image fImage; | Image fImage; | ||||
int fId; | |||||
float fMinimum; | float fMinimum; | ||||
float fMaximum; | float fMaximum; | ||||
float fStep; | float fStep; | ||||
@@ -78,13 +82,11 @@ private: | |||||
Point<int> fEndPos; | Point<int> fEndPos; | ||||
Rectangle<int> fSliderArea; | Rectangle<int> fSliderArea; | ||||
void _recheckArea(); | |||||
void _recheckArea() noexcept; | |||||
DISTRHO_LEAK_DETECTOR(ImageSlider) | DISTRHO_LEAK_DETECTOR(ImageSlider) | ||||
}; | }; | ||||
typedef ScopedPointer<ImageSlider> ImageSliderPtr; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
@@ -42,30 +42,30 @@ public: | |||||
int getY() const noexcept; | int getY() const noexcept; | ||||
const Point<int>& getPos() const noexcept; | const Point<int>& getPos() const noexcept; | ||||
void setX(int x); | |||||
void setY(int y); | |||||
void setPos(int x, int y); | |||||
void setPos(const Point<int>& pos); | |||||
void setX(int x) noexcept; | |||||
void setY(int y) noexcept; | |||||
void setPos(int x, int y) noexcept; | |||||
void setPos(const Point<int>& pos) noexcept; | |||||
int getWidth() const noexcept; | int getWidth() const noexcept; | ||||
int getHeight() const noexcept; | int getHeight() const noexcept; | ||||
const Size<int>& getSize() const noexcept; | const Size<int>& getSize() const noexcept; | ||||
// virtual needed by cairo | // virtual needed by cairo | ||||
virtual void setWidth(int width); | |||||
virtual void setHeight(int height); | |||||
virtual void setSize(int width, int height); | |||||
virtual void setSize(const Size<int>& size); | |||||
virtual void setWidth(int width) noexcept; | |||||
virtual void setHeight(int height) noexcept; | |||||
virtual void setSize(int width, int height) noexcept; | |||||
virtual void setSize(const Size<int>& size) noexcept; | |||||
const Rectangle<int>& getArea() const noexcept; | const Rectangle<int>& getArea() const noexcept; | ||||
uint getEventTimestamp(); | |||||
int getModifiers(); | |||||
uint getEventTimestamp() const noexcept; | |||||
int getModifiers() const noexcept; | |||||
App& getParentApp() const noexcept; | App& getParentApp() const noexcept; | ||||
Window& getParentWindow() const noexcept; | Window& getParentWindow() const noexcept; | ||||
void repaint(); | |||||
void repaint() noexcept; | |||||
protected: | protected: | ||||
virtual void onDisplay() = 0; | virtual void onDisplay() = 0; | ||||
@@ -40,7 +40,7 @@ public: | |||||
void exec(bool lockWait = false); | void exec(bool lockWait = false); | ||||
void focus(); | void focus(); | ||||
void repaint(); | |||||
void repaint() noexcept; | |||||
bool isVisible() const noexcept; | bool isVisible() const noexcept; | ||||
void setVisible(bool yesNo); | void setVisible(bool yesNo); | ||||
@@ -58,9 +58,9 @@ public: | |||||
void setTransientWinId(intptr_t winId); | void setTransientWinId(intptr_t winId); | ||||
App& getApp() const noexcept; | App& getApp() const noexcept; | ||||
uint getEventTimestamp() const; | |||||
int getModifiers() const; | |||||
intptr_t getWindowId() const; | |||||
uint getEventTimestamp() const noexcept; | |||||
int getModifiers() const noexcept; | |||||
intptr_t getWindowId() const noexcept; | |||||
void addIdleCallback(IdleCallback* const callback); | void addIdleCallback(IdleCallback* const callback); | ||||
void removeIdleCallback(IdleCallback* const callback); | void removeIdleCallback(IdleCallback* const callback); | ||||
@@ -20,7 +20,7 @@ START_NAMESPACE_DGL | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
ImageButton::ImageButton(Window& parent, const Image& image) | |||||
ImageButton::ImageButton(Window& parent, const Image& image) noexcept | |||||
: Widget(parent), | : Widget(parent), | ||||
fImageNormal(image), | fImageNormal(image), | ||||
fImageHover(image), | fImageHover(image), | ||||
@@ -31,7 +31,7 @@ ImageButton::ImageButton(Window& parent, const Image& image) | |||||
{ | { | ||||
} | } | ||||
ImageButton::ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown) | |||||
ImageButton::ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown) noexcept | |||||
: Widget(parent), | : Widget(parent), | ||||
fImageNormal(imageNormal), | fImageNormal(imageNormal), | ||||
fImageHover(imageHover), | fImageHover(imageHover), | ||||
@@ -45,7 +45,7 @@ ImageButton::ImageButton(Window& parent, const Image& imageNormal, const Image& | |||||
setSize(fCurImage->getSize()); | setSize(fCurImage->getSize()); | ||||
} | } | ||||
ImageButton::ImageButton(Widget* widget, const Image& image) | |||||
ImageButton::ImageButton(Widget* widget, const Image& image) noexcept | |||||
: Widget(widget->getParentWindow()), | : Widget(widget->getParentWindow()), | ||||
fImageNormal(image), | fImageNormal(image), | ||||
fImageHover(image), | fImageHover(image), | ||||
@@ -56,7 +56,7 @@ ImageButton::ImageButton(Widget* widget, const Image& image) | |||||
{ | { | ||||
} | } | ||||
ImageButton::ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown) | |||||
ImageButton::ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown) noexcept | |||||
: Widget(widget->getParentWindow()), | : Widget(widget->getParentWindow()), | ||||
fImageNormal(imageNormal), | fImageNormal(imageNormal), | ||||
fImageHover(imageHover), | fImageHover(imageHover), | ||||
@@ -70,7 +70,7 @@ ImageButton::ImageButton(Widget* widget, const Image& imageNormal, const Image& | |||||
setSize(fCurImage->getSize()); | setSize(fCurImage->getSize()); | ||||
} | } | ||||
ImageButton::ImageButton(const ImageButton& imageButton) | |||||
ImageButton::ImageButton(const ImageButton& imageButton) noexcept | |||||
: Widget(imageButton.getParentWindow()), | : Widget(imageButton.getParentWindow()), | ||||
fImageNormal(imageButton.fImageNormal), | fImageNormal(imageButton.fImageNormal), | ||||
fImageHover(imageButton.fImageHover), | fImageHover(imageButton.fImageHover), | ||||
@@ -84,7 +84,7 @@ ImageButton::ImageButton(const ImageButton& imageButton) | |||||
setSize(fCurImage->getSize()); | setSize(fCurImage->getSize()); | ||||
} | } | ||||
void ImageButton::setCallback(Callback* callback) | |||||
void ImageButton::setCallback(Callback* callback) noexcept | |||||
{ | { | ||||
fCallback = callback; | fCallback = callback; | ||||
} | } | ||||
@@ -22,9 +22,10 @@ START_NAMESPACE_DGL | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation) | |||||
ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation, int id) noexcept | |||||
: Widget(parent), | : Widget(parent), | ||||
fImage(image), | fImage(image), | ||||
fId(id), | |||||
fMinimum(0.0f), | fMinimum(0.0f), | ||||
fMaximum(1.0f), | fMaximum(1.0f), | ||||
fStep(0.0f), | fStep(0.0f), | ||||
@@ -45,9 +46,10 @@ ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation | |||||
setSize(fImgLayerSize, fImgLayerSize); | setSize(fImgLayerSize, fImgLayerSize); | ||||
} | } | ||||
ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation) | |||||
ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation, int id) noexcept | |||||
: Widget(widget->getParentWindow()), | : Widget(widget->getParentWindow()), | ||||
fImage(image), | fImage(image), | ||||
fId(id), | |||||
fMinimum(0.0f), | fMinimum(0.0f), | ||||
fMaximum(1.0f), | fMaximum(1.0f), | ||||
fStep(0.0f), | fStep(0.0f), | ||||
@@ -71,6 +73,7 @@ ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation | |||||
ImageKnob::ImageKnob(const ImageKnob& imageKnob) | ImageKnob::ImageKnob(const ImageKnob& imageKnob) | ||||
: Widget(imageKnob.getParentWindow()), | : Widget(imageKnob.getParentWindow()), | ||||
fImage(imageKnob.fImage), | fImage(imageKnob.fImage), | ||||
fId(imageKnob.fId), | |||||
fMinimum(imageKnob.fMinimum), | fMinimum(imageKnob.fMinimum), | ||||
fMaximum(imageKnob.fMaximum), | fMaximum(imageKnob.fMaximum), | ||||
fStep(imageKnob.fStep), | fStep(imageKnob.fStep), | ||||
@@ -98,12 +101,22 @@ ImageKnob::ImageKnob(const ImageKnob& imageKnob) | |||||
} | } | ||||
} | } | ||||
float ImageKnob::getValue() const | |||||
int ImageKnob::getId() const noexcept | |||||
{ | |||||
return fId; | |||||
} | |||||
void ImageKnob::setId(int id) noexcept | |||||
{ | |||||
fId = id;; | |||||
} | |||||
float ImageKnob::getValue() const noexcept | |||||
{ | { | ||||
return fValue; | return fValue; | ||||
} | } | ||||
void ImageKnob::setOrientation(Orientation orientation) | |||||
void ImageKnob::setOrientation(Orientation orientation) noexcept | |||||
{ | { | ||||
if (fOrientation == orientation) | if (fOrientation == orientation) | ||||
return; | return; | ||||
@@ -111,7 +124,7 @@ void ImageKnob::setOrientation(Orientation orientation) | |||||
fOrientation = orientation; | fOrientation = orientation; | ||||
} | } | ||||
void ImageKnob::setRange(float min, float max) | |||||
void ImageKnob::setRange(float min, float max) noexcept | |||||
{ | { | ||||
if (fValue < min) | if (fValue < min) | ||||
{ | { | ||||
@@ -119,7 +132,11 @@ void ImageKnob::setRange(float min, float max) | |||||
repaint(); | repaint(); | ||||
if (fCallback != nullptr) | if (fCallback != nullptr) | ||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageKnob::setRange < min"); | |||||
} | |||||
} | } | ||||
else if (fValue > max) | else if (fValue > max) | ||||
{ | { | ||||
@@ -127,19 +144,23 @@ void ImageKnob::setRange(float min, float max) | |||||
repaint(); | repaint(); | ||||
if (fCallback != nullptr) | if (fCallback != nullptr) | ||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageKnob::setRange > max"); | |||||
} | |||||
} | } | ||||
fMinimum = min; | fMinimum = min; | ||||
fMaximum = max; | fMaximum = max; | ||||
} | } | ||||
void ImageKnob::setStep(float step) | |||||
void ImageKnob::setStep(float step) noexcept | |||||
{ | { | ||||
fStep = step; | fStep = step; | ||||
} | } | ||||
void ImageKnob::setValue(float value, bool sendCallback) | |||||
void ImageKnob::setValue(float value, bool sendCallback) noexcept | |||||
{ | { | ||||
if (fValue == value) | if (fValue == value) | ||||
return; | return; | ||||
@@ -152,7 +173,11 @@ void ImageKnob::setValue(float value, bool sendCallback) | |||||
repaint(); | repaint(); | ||||
if (sendCallback && fCallback != nullptr) | if (sendCallback && fCallback != nullptr) | ||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageKnobValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageKnob::setValue"); | |||||
} | |||||
} | } | ||||
void ImageKnob::setRotationAngle(int angle) | void ImageKnob::setRotationAngle(int angle) | ||||
@@ -192,7 +217,7 @@ void ImageKnob::setRotationAngle(int angle) | |||||
} | } | ||||
} | } | ||||
void ImageKnob::setCallback(Callback* callback) | |||||
void ImageKnob::setCallback(Callback* callback) noexcept | |||||
{ | { | ||||
fCallback = callback; | fCallback = callback; | ||||
} | } | ||||
@@ -22,9 +22,10 @@ START_NAMESPACE_DGL | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
ImageSlider::ImageSlider(Window& parent, const Image& image) | |||||
ImageSlider::ImageSlider(Window& parent, const Image& image, int id) noexcept | |||||
: Widget(parent), | : Widget(parent), | ||||
fImage(image), | fImage(image), | ||||
fId(id), | |||||
fMinimum(0.0f), | fMinimum(0.0f), | ||||
fMaximum(1.0f), | fMaximum(1.0f), | ||||
fStep(0.0f), | fStep(0.0f), | ||||
@@ -39,9 +40,10 @@ ImageSlider::ImageSlider(Window& parent, const Image& image) | |||||
setSize(fImage.getSize()); | setSize(fImage.getSize()); | ||||
} | } | ||||
ImageSlider::ImageSlider(Widget* widget, const Image& image) | |||||
ImageSlider::ImageSlider(Widget* widget, const Image& image, int id) noexcept | |||||
: Widget(widget->getParentWindow()), | : Widget(widget->getParentWindow()), | ||||
fImage(image), | fImage(image), | ||||
fId(id), | |||||
fMinimum(0.0f), | fMinimum(0.0f), | ||||
fMaximum(1.0f), | fMaximum(1.0f), | ||||
fStep(0.0f), | fStep(0.0f), | ||||
@@ -56,9 +58,10 @@ ImageSlider::ImageSlider(Widget* widget, const Image& image) | |||||
setSize(fImage.getSize()); | setSize(fImage.getSize()); | ||||
} | } | ||||
ImageSlider::ImageSlider(const ImageSlider& imageSlider) | |||||
ImageSlider::ImageSlider(const ImageSlider& imageSlider) noexcept | |||||
: Widget(imageSlider.getParentWindow()), | : Widget(imageSlider.getParentWindow()), | ||||
fImage(imageSlider.fImage), | fImage(imageSlider.fImage), | ||||
fId(imageSlider.fId), | |||||
fMinimum(imageSlider.fMinimum), | fMinimum(imageSlider.fMinimum), | ||||
fMaximum(imageSlider.fMaximum), | fMaximum(imageSlider.fMaximum), | ||||
fStep(imageSlider.fStep), | fStep(imageSlider.fStep), | ||||
@@ -76,34 +79,44 @@ ImageSlider::ImageSlider(const ImageSlider& imageSlider) | |||||
setSize(fImage.getSize()); | setSize(fImage.getSize()); | ||||
} | } | ||||
float ImageSlider::getValue() const | |||||
int ImageSlider::getId() const noexcept | |||||
{ | |||||
return fId; | |||||
} | |||||
void ImageSlider::setId(int id) noexcept | |||||
{ | |||||
fId = id;; | |||||
} | |||||
float ImageSlider::getValue() const noexcept | |||||
{ | { | ||||
return fValue; | return fValue; | ||||
} | } | ||||
void ImageSlider::setStartPos(const Point<int>& startPos) | |||||
void ImageSlider::setStartPos(const Point<int>& startPos) noexcept | |||||
{ | { | ||||
fStartPos = startPos; | fStartPos = startPos; | ||||
_recheckArea(); | _recheckArea(); | ||||
} | } | ||||
void ImageSlider::setStartPos(int x, int y) | |||||
void ImageSlider::setStartPos(int x, int y) noexcept | |||||
{ | { | ||||
setStartPos(Point<int>(x, y)); | setStartPos(Point<int>(x, y)); | ||||
} | } | ||||
void ImageSlider::setEndPos(const Point<int>& endPos) | |||||
void ImageSlider::setEndPos(const Point<int>& endPos) noexcept | |||||
{ | { | ||||
fEndPos = endPos; | fEndPos = endPos; | ||||
_recheckArea(); | _recheckArea(); | ||||
} | } | ||||
void ImageSlider::setEndPos(int x, int y) | |||||
void ImageSlider::setEndPos(int x, int y) noexcept | |||||
{ | { | ||||
setEndPos(Point<int>(x, y)); | setEndPos(Point<int>(x, y)); | ||||
} | } | ||||
void ImageSlider::setInverted(bool inverted) | |||||
void ImageSlider::setInverted(bool inverted) noexcept | |||||
{ | { | ||||
if (fInverted == inverted) | if (fInverted == inverted) | ||||
return; | return; | ||||
@@ -112,7 +125,7 @@ void ImageSlider::setInverted(bool inverted) | |||||
repaint(); | repaint(); | ||||
} | } | ||||
void ImageSlider::setRange(float min, float max) | |||||
void ImageSlider::setRange(float min, float max) noexcept | |||||
{ | { | ||||
if (fValue < min) | if (fValue < min) | ||||
{ | { | ||||
@@ -120,7 +133,11 @@ void ImageSlider::setRange(float min, float max) | |||||
repaint(); | repaint(); | ||||
if (fCallback != nullptr) | if (fCallback != nullptr) | ||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageSlider::setRange < min"); | |||||
} | |||||
} | } | ||||
else if (fValue > max) | else if (fValue > max) | ||||
{ | { | ||||
@@ -128,19 +145,23 @@ void ImageSlider::setRange(float min, float max) | |||||
repaint(); | repaint(); | ||||
if (fCallback != nullptr) | if (fCallback != nullptr) | ||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageSlider::setRange > max"); | |||||
} | |||||
} | } | ||||
fMinimum = min; | fMinimum = min; | ||||
fMaximum = max; | fMaximum = max; | ||||
} | } | ||||
void ImageSlider::setStep(float step) | |||||
void ImageSlider::setStep(float step) noexcept | |||||
{ | { | ||||
fStep = step; | fStep = step; | ||||
} | } | ||||
void ImageSlider::setValue(float value, bool sendCallback) | |||||
void ImageSlider::setValue(float value, bool sendCallback) noexcept | |||||
{ | { | ||||
if (fValue == value) | if (fValue == value) | ||||
return; | return; | ||||
@@ -153,10 +174,14 @@ void ImageSlider::setValue(float value, bool sendCallback) | |||||
repaint(); | repaint(); | ||||
if (sendCallback && fCallback != nullptr) | if (sendCallback && fCallback != nullptr) | ||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
{ | |||||
try { | |||||
fCallback->imageSliderValueChanged(this, fValue); | |||||
} DISTRHO_SAFE_EXCEPTION("ImageSlider::setValue"); | |||||
} | |||||
} | } | ||||
void ImageSlider::setCallback(Callback* callback) | |||||
void ImageSlider::setCallback(Callback* callback) noexcept | |||||
{ | { | ||||
fCallback = callback; | fCallback = callback; | ||||
} | } | ||||
@@ -333,7 +358,7 @@ bool ImageSlider::onMotion(int x, int y) | |||||
return true; | return true; | ||||
} | } | ||||
void ImageSlider::_recheckArea() | |||||
void ImageSlider::_recheckArea() noexcept | |||||
{ | { | ||||
if (fStartPos.getY() == fEndPos.getY()) | if (fStartPos.getY() == fEndPos.getY()) | ||||
{ | { | ||||
@@ -73,7 +73,7 @@ const Point<int>& Widget::getPos() const noexcept | |||||
return fArea.getPos(); | return fArea.getPos(); | ||||
} | } | ||||
void Widget::setX(int x) | |||||
void Widget::setX(int x) noexcept | |||||
{ | { | ||||
if (fArea.getX() == x) | if (fArea.getX() == x) | ||||
return; | return; | ||||
@@ -82,7 +82,7 @@ void Widget::setX(int x) | |||||
fParent.repaint(); | fParent.repaint(); | ||||
} | } | ||||
void Widget::setY(int y) | |||||
void Widget::setY(int y) noexcept | |||||
{ | { | ||||
if (fArea.getY() == y) | if (fArea.getY() == y) | ||||
return; | return; | ||||
@@ -91,12 +91,12 @@ void Widget::setY(int y) | |||||
fParent.repaint(); | fParent.repaint(); | ||||
} | } | ||||
void Widget::setPos(int x, int y) | |||||
void Widget::setPos(int x, int y) noexcept | |||||
{ | { | ||||
setPos(Point<int>(x, y)); | setPos(Point<int>(x, y)); | ||||
} | } | ||||
void Widget::setPos(const Point<int>& pos) | |||||
void Widget::setPos(const Point<int>& pos) noexcept | |||||
{ | { | ||||
if (fArea.getPos() == pos) | if (fArea.getPos() == pos) | ||||
return; | return; | ||||
@@ -120,7 +120,7 @@ const Size<int>& Widget::getSize() const noexcept | |||||
return fArea.getSize(); | return fArea.getSize(); | ||||
} | } | ||||
void Widget::setWidth(int width) | |||||
void Widget::setWidth(int width) noexcept | |||||
{ | { | ||||
if (fArea.getWidth() == width) | if (fArea.getWidth() == width) | ||||
return; | return; | ||||
@@ -129,7 +129,7 @@ void Widget::setWidth(int width) | |||||
fParent.repaint(); | fParent.repaint(); | ||||
} | } | ||||
void Widget::setHeight(int height) | |||||
void Widget::setHeight(int height) noexcept | |||||
{ | { | ||||
if (fArea.getHeight() == height) | if (fArea.getHeight() == height) | ||||
return; | return; | ||||
@@ -138,12 +138,12 @@ void Widget::setHeight(int height) | |||||
fParent.repaint(); | fParent.repaint(); | ||||
} | } | ||||
void Widget::setSize(int width, int height) | |||||
void Widget::setSize(int width, int height) noexcept | |||||
{ | { | ||||
setSize(Size<int>(width, height)); | setSize(Size<int>(width, height)); | ||||
} | } | ||||
void Widget::setSize(const Size<int>& size) | |||||
void Widget::setSize(const Size<int>& size) noexcept | |||||
{ | { | ||||
if (fArea.getSize() == size) | if (fArea.getSize() == size) | ||||
return; | return; | ||||
@@ -157,12 +157,12 @@ const Rectangle<int>& Widget::getArea() const noexcept | |||||
return fArea; | return fArea; | ||||
} | } | ||||
uint Widget::getEventTimestamp() | |||||
uint Widget::getEventTimestamp() const noexcept | |||||
{ | { | ||||
return fParent.getEventTimestamp(); | return fParent.getEventTimestamp(); | ||||
} | } | ||||
int Widget::getModifiers() | |||||
int Widget::getModifiers() const noexcept | |||||
{ | { | ||||
return fParent.getModifiers(); | return fParent.getModifiers(); | ||||
} | } | ||||
@@ -177,7 +177,7 @@ Window& Widget::getParentWindow() const noexcept | |||||
return fParent; | return fParent; | ||||
} | } | ||||
void Widget::repaint() | |||||
void Widget::repaint() noexcept | |||||
{ | { | ||||
fParent.repaint(); | fParent.repaint(); | ||||
} | } | ||||
@@ -295,7 +295,7 @@ struct Window::PrivateData { | |||||
#endif | #endif | ||||
} | } | ||||
void repaint() | |||||
void repaint() noexcept | |||||
{ | { | ||||
//DBG("Window repaint\n"); | //DBG("Window repaint\n"); | ||||
puglPostRedisplay(fView); | puglPostRedisplay(fView); | ||||
@@ -514,17 +514,17 @@ struct Window::PrivateData { | |||||
return fApp; | return fApp; | ||||
} | } | ||||
int getModifiers() const | |||||
int getModifiers() const noexcept | |||||
{ | { | ||||
return puglGetModifiers(fView); | return puglGetModifiers(fView); | ||||
} | } | ||||
uint getEventTimestamp() const | |||||
uint getEventTimestamp() const noexcept | |||||
{ | { | ||||
return puglGetEventTimestamp(fView); | return puglGetEventTimestamp(fView); | ||||
} | } | ||||
intptr_t getWindowId() const | |||||
intptr_t getWindowId() const noexcept | |||||
{ | { | ||||
return puglGetNativeWindow(fView); | return puglGetNativeWindow(fView); | ||||
} | } | ||||
@@ -894,7 +894,7 @@ void Window::focus() | |||||
pData->focus(); | pData->focus(); | ||||
} | } | ||||
void Window::repaint() | |||||
void Window::repaint() noexcept | |||||
{ | { | ||||
pData->repaint(); | pData->repaint(); | ||||
} | } | ||||
@@ -954,17 +954,17 @@ App& Window::getApp() const noexcept | |||||
return pData->getApp(); | return pData->getApp(); | ||||
} | } | ||||
int Window::getModifiers() const | |||||
int Window::getModifiers() const noexcept | |||||
{ | { | ||||
return pData->getModifiers(); | return pData->getModifiers(); | ||||
} | } | ||||
uint Window::getEventTimestamp() const | |||||
uint Window::getEventTimestamp() const noexcept | |||||
{ | { | ||||
return pData->getEventTimestamp(); | return pData->getEventTimestamp(); | ||||
} | } | ||||
intptr_t Window::getWindowId() const | |||||
intptr_t Window::getWindowId() const noexcept | |||||
{ | { | ||||
return pData->getWindowId(); | return pData->getWindowId(); | ||||
} | } | ||||