diff --git a/source/modules/dgl/Geometry.hpp b/source/modules/dgl/Geometry.hpp index c39eb8157..ca9300069 100644 --- a/source/modules/dgl/Geometry.hpp +++ b/source/modules/dgl/Geometry.hpp @@ -369,7 +369,7 @@ public: bool operator==(const Line& line) const noexcept; bool operator!=(const Line& line) const noexcept; - #ifdef DGL_ALLOW_DEPRECATED_METHODS + #if DGL_ALLOW_DEPRECATED_METHODS /** Draw this line using the current OpenGL state.@n DEPRECATED Please use draw(const GraphicsContext&) instead. @@ -487,7 +487,7 @@ public: bool operator==(const Circle& cir) const noexcept; bool operator!=(const Circle& cir) const noexcept; - #ifdef DGL_ALLOW_DEPRECATED_METHODS + #if DGL_ALLOW_DEPRECATED_METHODS /** Draw this circle using the current OpenGL state.@n DEPRECATED Please use draw(const GraphicsContext&) instead. @@ -580,7 +580,7 @@ public: bool operator==(const Triangle& tri) const noexcept; bool operator!=(const Triangle& tri) const noexcept; - #ifdef DGL_ALLOW_DEPRECATED_METHODS + #if DGL_ALLOW_DEPRECATED_METHODS /** Draw this triangle using the current OpenGL state.@n DEPRECATED Please use draw(const GraphicsContext&) instead. @@ -811,7 +811,7 @@ public: bool operator==(const Rectangle& size) const noexcept; bool operator!=(const Rectangle& size) const noexcept; - #ifdef DGL_ALLOW_DEPRECATED_METHODS + #if DGL_ALLOW_DEPRECATED_METHODS /** Draw this rectangle using the current OpenGL state.@n DEPRECATED Please use draw(const GraphicsContext&) instead. diff --git a/source/modules/dgl/OpenGL.hpp b/source/modules/dgl/OpenGL.hpp index 46d5aecbf..03d0ad152 100644 --- a/source/modules/dgl/OpenGL.hpp +++ b/source/modules/dgl/OpenGL.hpp @@ -274,7 +274,7 @@ public: inline void drawAt(const GraphicsContext& context, int x, int y) { drawAt(context, Point(x, y)); } - #ifdef DGL_ALLOW_DEPRECATED_METHODS + #if DGL_ALLOW_DEPRECATED_METHODS /** Constructor using raw image data, specifying an OpenGL image format. @note @a rawData must remain valid for the lifetime of this Image. diff --git a/source/modules/dgl/Window.hpp b/source/modules/dgl/Window.hpp index 64d0f561f..2a811b00c 100644 --- a/source/modules/dgl/Window.hpp +++ b/source/modules/dgl/Window.hpp @@ -479,6 +479,7 @@ public: */ void setTransientParent(uintptr_t transientParentWindowHandle); + #if DGL_ALLOW_DEPRECATED_METHODS /** DEPRECATED Use isIgnoringKeyRepeat(). */ DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()") inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); } @@ -490,6 +491,7 @@ public: /** DEPRECATED Use runAsModal(bool). */ DISTRHO_DEPRECATED_BY("runAsModal(bool)") inline void exec(bool blockWait = false) { runAsModal(blockWait); } + #endif protected: /** @@ -528,12 +530,11 @@ protected: */ virtual void onFocus(bool focus, CrossingMode mode); - /** - A function called when the window is resized. - If there is a top-level widget associated with this window, its size will be set right after this function. - The default implementation sets up drawing context where necessary. - */ + #if DGL_ALLOW_DEPRECATED_METHODS + /** DEPRECATED DO NOT USE */ + DISTRHO_DEPRECATED virtual void onReshape(uint width, uint height); + #endif /** A function called when scale factor requested for this window changes. @@ -542,7 +543,7 @@ protected: */ virtual void onScaleFactorChanged(double scaleFactor); - #ifdef DGL_USE_FILE_BROWSER + #ifdef DGL_USE_FILE_BROWSER /** A function called when a path is selected by the user, as triggered by openFileBrowser(). This action happens after the user confirms the action, so the file browser dialog will be closed at this point. @@ -550,10 +551,12 @@ protected: */ virtual void onFileSelected(const char* filename); + #if DGL_ALLOW_DEPRECATED_METHODS /** DEPRECATED Use onFileSelected(). */ DISTRHO_DEPRECATED_BY("onFileSelected(const char*)") inline virtual void fileBrowserSelected(const char* filename) { return onFileSelected(filename); } #endif + #endif private: PrivateData* const pData; diff --git a/source/modules/dgl/src/ApplicationPrivateData.cpp b/source/modules/dgl/src/ApplicationPrivateData.cpp index ca0d27f9e..3a145e9b1 100644 --- a/source/modules/dgl/src/ApplicationPrivateData.cpp +++ b/source/modules/dgl/src/ApplicationPrivateData.cpp @@ -165,13 +165,11 @@ void Application::PrivateData::quit() isQuitting = true; - #ifndef DPF_TEST_APPLICATION_CPP for (WindowListReverseIterator rit = windows.rbegin(), rite = windows.rend(); rit != rite; ++rit) { DGL_NAMESPACE::Window* const window(*rit); window->close(); } - #endif } double Application::PrivateData::getTime() const diff --git a/source/modules/dgl/src/Geometry.cpp b/source/modules/dgl/src/Geometry.cpp index eb8df6e57..3af7842c2 100644 --- a/source/modules/dgl/src/Geometry.cpp +++ b/source/modules/dgl/src/Geometry.cpp @@ -23,6 +23,8 @@ #include "../Geometry.hpp" +#define DGL_GEOMETRY_CPP_INCLUDED + #include START_NAMESPACE_DGL diff --git a/source/modules/dgl/src/NanoVG.cpp b/source/modules/dgl/src/NanoVG.cpp index 56546d76b..6203ebb21 100644 --- a/source/modules/dgl/src/NanoVG.cpp +++ b/source/modules/dgl/src/NanoVG.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2021 Filipe Coelho + * Copyright (C) 2012-2025 Filipe Coelho * * 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 @@ -1144,6 +1144,9 @@ inline void NanoBaseWidget::onDisplay() onNanoDisplay(); displayChildren(); NanoVG::endFrame(); + #ifdef DGL_USE_OPENGL3 + glUseProgram(reinterpret_cast(getGraphicsContext()).program); + #endif } } diff --git a/source/modules/dgl/src/OpenGL.cpp b/source/modules/dgl/src/OpenGL.cpp index 989db626f..5eac3eb36 100644 --- a/source/modules/dgl/src/OpenGL.cpp +++ b/source/modules/dgl/src/OpenGL.cpp @@ -125,7 +125,7 @@ OpenGLImage& OpenGLImage::operator=(const OpenGLImage& image) noexcept return *this; } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS OpenGLImage::OpenGLImage(const char* const rdata, const uint w, const uint h, const GLenum fmt) : ImageBase(rdata, w, h, asDISTRHOImageFormat(fmt)), setupCalled(false), diff --git a/source/modules/dgl/src/OpenGL2.cpp b/source/modules/dgl/src/OpenGL2.cpp index 78e3be3ef..bdfd900ad 100644 --- a/source/modules/dgl/src/OpenGL2.cpp +++ b/source/modules/dgl/src/OpenGL2.cpp @@ -93,7 +93,7 @@ void Line::draw(const GraphicsContext&, const T width) drawLine(posStart, posEnd); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Line::draw() { @@ -101,13 +101,6 @@ void Line::draw() } #endif -template class Line; -template class Line; -template class Line; -template class Line; -template class Line; -template class Line; - // -------------------------------------------------------------------------------------------------------------------- // Circle @@ -168,7 +161,7 @@ void Circle::drawOutline(const GraphicsContext& context, const T lineWidth) drawCircle(context, fPos, fNumSegments, fSize, fSin, fCos, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Circle::draw() { @@ -182,13 +175,6 @@ void Circle::drawOutline() } #endif -template class Circle; -template class Circle; -template class Circle; -template class Circle; -template class Circle; -template class Circle; - // -------------------------------------------------------------------------------------------------------------------- // Triangle @@ -236,7 +222,7 @@ void Triangle::drawOutline(const GraphicsContext&, const T lineWidth) drawTriangle(pos1, pos2, pos3, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Triangle::draw() { @@ -250,13 +236,6 @@ void Triangle::drawOutline() } #endif -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; - // -------------------------------------------------------------------------------------------------------------------- // Rectangle @@ -290,13 +269,13 @@ static void drawRectangle(const Rectangle& rect, const bool outline) } template -void Rectangle::draw(const GraphicsContext& context) +void Rectangle::draw(const GraphicsContext&) { drawRectangle(*this, false); } template -void Rectangle::drawOutline(const GraphicsContext& context, const T lineWidth) +void Rectangle::drawOutline(const GraphicsContext&, const T lineWidth) { DISTRHO_SAFE_ASSERT_RETURN(lineWidth != 0,); @@ -304,7 +283,7 @@ void Rectangle::drawOutline(const GraphicsContext& context, const T lineWidth drawRectangle(*this, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Rectangle::draw() { @@ -318,13 +297,6 @@ void Rectangle::drawOutline() } #endif -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; - // -------------------------------------------------------------------------------------------------------------------- // OpenGLImage @@ -408,7 +380,7 @@ void OpenGLImage::drawAt(const GraphicsContext&, const Point& pos) drawOpenGLImage(*this, pos, textureId, setupCalled); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS void OpenGLImage::draw() { drawOpenGLImage(*this, Point(0, 0), textureId, setupCalled); @@ -559,6 +531,17 @@ void Window::PrivateData::destroyContext() void Window::PrivateData::startContext() { + const PuglArea size = puglGetSizeHint(view, PUGL_CURRENT_SIZE); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glViewport(0, 0, static_cast(size.width), static_cast(size.height)); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0, static_cast(size.width), static_cast(size.height), 0.0, 0.0, 1.0); + glViewport(0, 0, static_cast(size.width), static_cast(size.height)); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } void Window::PrivateData::endContext() @@ -567,4 +550,36 @@ void Window::PrivateData::endContext() // -------------------------------------------------------------------------------------------------------------------- +#ifndef DGL_GEOMETRY_CPP_INCLUDED +template class Line; +template class Line; +template class Line; +template class Line; +template class Line; +template class Line; + +template class Circle; +template class Circle; +template class Circle; +template class Circle; +template class Circle; +template class Circle; + +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; + +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +#endif + +// -------------------------------------------------------------------------------------------------------------------- + END_NAMESPACE_DGL diff --git a/source/modules/dgl/src/OpenGL3.cpp b/source/modules/dgl/src/OpenGL3.cpp index 90497ec10..69b970ea7 100644 --- a/source/modules/dgl/src/OpenGL3.cpp +++ b/source/modules/dgl/src/OpenGL3.cpp @@ -93,10 +93,12 @@ DGL_EXT(PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer) // -------------------------------------------------------------------------------------------------------------------- +#if DGL_ALLOW_DEPRECATED_METHODS static void notImplemented(const char* const name) { d_stderr2("OpenGL3 function not implemented: %s", name); } +#endif // -------------------------------------------------------------------------------------------------------------------- // Color @@ -149,7 +151,7 @@ void Line::draw(const GraphicsContext& context, const T width) glBindBuffer(GL_ARRAY_BUFFER, 0); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Line::draw() { @@ -157,13 +159,6 @@ void Line::draw() } #endif -template class Line; -template class Line; -template class Line; -template class Line; -template class Line; -template class Line; - // -------------------------------------------------------------------------------------------------------------------- // Circle @@ -260,7 +255,7 @@ void Circle::drawOutline(const GraphicsContext& context, const T lineWidth) drawCircle(context, fPos, fNumSegments, fSize, fSin, fCos, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Circle::draw() { @@ -274,13 +269,6 @@ void Circle::drawOutline() } #endif -template class Circle; -template class Circle; -template class Circle; -template class Circle; -template class Circle; -template class Circle; - // -------------------------------------------------------------------------------------------------------------------- // Triangle @@ -344,7 +332,7 @@ void Triangle::drawOutline(const GraphicsContext& context, const T lineWidth) drawTriangle(context, pos1, pos2, pos3, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Triangle::draw() { @@ -358,13 +346,6 @@ void Triangle::drawOutline() } #endif -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; -template class Triangle; - // -------------------------------------------------------------------------------------------------------------------- // Rectangle @@ -424,7 +405,7 @@ void Rectangle::drawOutline(const GraphicsContext& context, const T lineWidth drawRectangle(context, *this, true); } -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS template void Rectangle::draw() { @@ -438,13 +419,6 @@ void Rectangle::drawOutline() } #endif -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; -template class Rectangle; - // -------------------------------------------------------------------------------------------------------------------- // OpenGLImage @@ -626,18 +600,18 @@ const char* OpenGLImage::getRawData() const noexcept } #endif -#ifdef DGL_ALLOW_DEPRECATED_METHODS +#if DGL_ALLOW_DEPRECATED_METHODS void OpenGLImage::draw() { notImplemented("OpenGLImage::draw"); } -void OpenGLImage::drawAt(const int x, const int y) +void OpenGLImage::drawAt(int, int) { notImplemented("OpenGLImage::drawAt"); } -void OpenGLImage::drawAt(const Point& pos) +void OpenGLImage::drawAt(const Point&) { notImplemented("OpenGLImage::drawAt"); } @@ -1013,6 +987,8 @@ void Window::PrivateData::startContext() gl3context.width = size.width; gl3context.height = size.height; glUseProgram(gl3context.program); + + glViewport(0, 0, static_cast(size.width), static_cast(size.height)); } void Window::PrivateData::endContext() @@ -1022,4 +998,36 @@ void Window::PrivateData::endContext() // -------------------------------------------------------------------------------------------------------------------- +#ifndef DGL_GEOMETRY_CPP_INCLUDED +template class Line; +template class Line; +template class Line; +template class Line; +template class Line; +template class Line; + +template class Circle; +template class Circle; +template class Circle; +template class Circle; +template class Circle; +template class Circle; + +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; +template class Triangle; + +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +template class Rectangle; +#endif + +// -------------------------------------------------------------------------------------------------------------------- + END_NAMESPACE_DGL diff --git a/source/modules/dgl/src/TopLevelWidgetPrivateData.cpp b/source/modules/dgl/src/TopLevelWidgetPrivateData.cpp index ebdce51fa..adcd71bc2 100644 --- a/source/modules/dgl/src/TopLevelWidgetPrivateData.cpp +++ b/source/modules/dgl/src/TopLevelWidgetPrivateData.cpp @@ -135,11 +135,6 @@ bool TopLevelWidget::PrivateData::scrollEvent(const ScrollEvent& ev) return selfw->pData->giveScrollEventForSubWidgets(rev); } -void TopLevelWidget::PrivateData::fallbackOnResize(const uint width, const uint height) -{ - puglFallbackOnResize(window.pData->view, width, height); -} - // ----------------------------------------------------------------------- END_NAMESPACE_DGL diff --git a/source/modules/dgl/src/TopLevelWidgetPrivateData.hpp b/source/modules/dgl/src/TopLevelWidgetPrivateData.hpp index 21060d2f4..7cbf2c343 100644 --- a/source/modules/dgl/src/TopLevelWidgetPrivateData.hpp +++ b/source/modules/dgl/src/TopLevelWidgetPrivateData.hpp @@ -38,7 +38,6 @@ struct TopLevelWidget::PrivateData { bool mouseEvent(const MouseEvent& ev); bool motionEvent(const MotionEvent& ev); bool scrollEvent(const ScrollEvent& ev); - void fallbackOnResize(uint width, uint height); DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData) }; diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index 6f7562e21..01c285e04 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -397,12 +397,10 @@ Application& Window::getApp() const noexcept return pData->app; } -#ifndef DPF_TEST_WINDOW_CPP const GraphicsContext& Window::getGraphicsContext() const noexcept { return pData->getGraphicsContext(); } -#endif uintptr_t Window::getNativeWindowHandle() const noexcept { @@ -583,11 +581,11 @@ void Window::onFocus(bool, CrossingMode) { } -void Window::onReshape(const uint width, const uint height) +#if DGL_ALLOW_DEPRECATED_METHODS +void Window::onReshape(uint, uint) { - if (pData->view != nullptr) - puglFallbackOnResize(pData->view, width, height); } +#endif void Window::onScaleFactorChanged(double) { diff --git a/source/modules/dgl/src/WindowPrivateData.cpp b/source/modules/dgl/src/WindowPrivateData.cpp index d7a3c934f..563d2b44a 100644 --- a/source/modules/dgl/src/WindowPrivateData.cpp +++ b/source/modules/dgl/src/WindowPrivateData.cpp @@ -268,9 +268,7 @@ Window::PrivateData::~PrivateData() isVisible = false; } - #ifndef DPF_TEST_WINDOW_CPP destroyContext(); - #endif puglFreeView(view); } @@ -646,9 +644,7 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height) DGL_DBGp("PUGL: onReshape : %d %d\n", width, height); - #ifndef DPF_TEST_WINDOW_CPP createContextIfNeeded(); - #endif if (autoScaling) { @@ -672,9 +668,27 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height) autoScaling ? autoScaleFactor : scaleFactor); #endif + #if DGL_ALLOW_DEPRECATED_METHODS + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4996) + #elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif self->onReshape(uwidth, uheight); + #if defined(_MSC_VER) + #pragma warning(pop) + #elif defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic pop + #endif + #endif -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET(it) { TopLevelWidget* const widget = *it; @@ -689,7 +703,6 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height) */ ((Widget*)widget)->setSize(uwidth, uheight); } -#endif // always repaint after a resize puglObscureView(view); @@ -701,7 +714,6 @@ void Window::PrivateData::onPuglExpose() puglOnDisplayPrepare(view); -#ifndef DPF_TEST_WINDOW_CPP startContext(); FOR_EACH_TOP_LEVEL_WIDGET(it) @@ -721,7 +733,6 @@ void Window::PrivateData::onPuglExpose() } endContext(); -#endif } void Window::PrivateData::onPuglClose() @@ -774,7 +785,6 @@ void Window::PrivateData::onPuglKey(const Widget::KeyboardEvent& ev) if (modal.child != nullptr) return modal.child->focus(); -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET_INV(rit) { TopLevelWidget* const widget(*rit); @@ -782,7 +792,6 @@ void Window::PrivateData::onPuglKey(const Widget::KeyboardEvent& ev) if (widget->isVisible() && widget->onKeyboard(ev)) break; } -#endif } void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev) @@ -792,7 +801,6 @@ void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev) if (modal.child != nullptr) return modal.child->focus(); -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET_INV(rit) { TopLevelWidget* const widget(*rit); @@ -800,7 +808,6 @@ void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev) if (widget->isVisible() && widget->onCharacterInput(ev)) break; } -#endif } void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev) @@ -810,7 +817,6 @@ void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev) if (modal.child != nullptr) return modal.child->focus(); -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET_INV(rit) { TopLevelWidget* const widget(*rit); @@ -818,7 +824,6 @@ void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev) if (widget->isVisible() && widget->onMouse(ev)) break; } -#endif } void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev) @@ -828,7 +833,6 @@ void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev) if (modal.child != nullptr) return modal.child->focus(); -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET_INV(rit) { TopLevelWidget* const widget(*rit); @@ -836,7 +840,6 @@ void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev) if (widget->isVisible() && widget->onMotion(ev)) break; } -#endif } void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev) @@ -846,7 +849,6 @@ void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev) if (modal.child != nullptr) return modal.child->focus(); -#ifndef DPF_TEST_WINDOW_CPP FOR_EACH_TOP_LEVEL_WIDGET_INV(rit) { TopLevelWidget* const widget(*rit); @@ -854,7 +856,6 @@ void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev) if (widget->isVisible() && widget->onScroll(ev)) break; } -#endif } const void* Window::PrivateData::getClipboard(size_t& dataSize) diff --git a/source/modules/dgl/src/pugl-upstream/include/pugl/pugl.h b/source/modules/dgl/src/pugl-upstream/include/pugl/pugl.h index df1e3a290..ef7320b23 100644 --- a/source/modules/dgl/src/pugl-upstream/include/pugl/pugl.h +++ b/source/modules/dgl/src/pugl-upstream/include/pugl/pugl.h @@ -680,9 +680,8 @@ typedef struct { to the appropriate type, or the union members used. The graphics system may only be accessed when handling certain events. The - graphics context is active for #PUGL_REALIZE, #PUGL_UNREALIZE, - #PUGL_CONFIGURE, and #PUGL_EXPOSE, but only enabled for drawing for - #PUGL_EXPOSE. + graphics context is active for #PUGL_REALIZE, #PUGL_UNREALIZE, and + #PUGL_EXPOSE, but only enabled for drawing for #PUGL_EXPOSE. */ typedef union { PuglAnyEvent any; ///< Valid for all event types @@ -1367,7 +1366,7 @@ typedef enum { do so automatically. If the view is currently hidden, it will be shown and possibly raised to the top depending on the platform. - @return #PUGL_SUCCESS, an error from puglRealize(), or #PUGL_FAILURE if the + @return #PUGL_SUCCESS, an error from realization, or #PUGL_FAILURE if the window was shown but not raised. */ PUGL_API PuglStatus @@ -1395,12 +1394,7 @@ puglHide(PuglView* view); PUGL_API PuglStatus puglSetViewStyle(PuglView* view, PuglViewStyleFlags flags); -/** - Return true if the view currently has a style flag set. - - The result is determined based on the state announced in the last configure - event. -*/ +/// Return the style flags currently set for a view PUGL_API PuglViewStyleFlags puglGetViewStyle(const PuglView* view); @@ -1410,7 +1404,7 @@ puglGetVisible(const PuglView* view); /// Return the native window handle PUGL_API PuglNativeView -puglGetNativeView(PuglView* view); +puglGetNativeView(const PuglView* view); /** @} diff --git a/source/modules/dgl/src/pugl-upstream/src/internal.c b/source/modules/dgl/src/pugl-upstream/src/internal.c index 09b3680b3..3e0a1c8b3 100644 --- a/source/modules/dgl/src/pugl-upstream/src/internal.c +++ b/source/modules/dgl/src/pugl-upstream/src/internal.c @@ -1,4 +1,4 @@ -// Copyright 2012-2023 David Robillard +// Copyright 2012-2025 David Robillard // SPDX-License-Identifier: ISC #include "internal.h" @@ -258,26 +258,6 @@ puglDispatchSimpleEvent(PuglView* view, const PuglEventType type) return puglDispatchEvent(view, &event); } -static inline bool -puglMustConfigure(PuglView* view, const PuglConfigureEvent* configure) -{ - return !!memcmp(configure, &view->lastConfigure, sizeof(PuglConfigureEvent)); -} - -PuglStatus -puglConfigure(PuglView* view, const PuglEvent* event) -{ - PuglStatus st = PUGL_SUCCESS; - - assert(event->type == PUGL_CONFIGURE); - if (puglMustConfigure(view, &event->configure)) { - st = view->eventFunc(view, event); - view->lastConfigure = event->configure; - } - - return st; -} - PuglStatus puglDispatchEvent(PuglView* view, const PuglEvent* event) { @@ -307,12 +287,8 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event) break; case PUGL_CONFIGURE: - if (puglMustConfigure(view, &event->configure)) { - if (!(st0 = view->backend->enter(view, NULL))) { - st0 = puglConfigure(view, event); - st1 = view->backend->leave(view, NULL); - } - } + st0 = view->eventFunc(view, event); + view->lastConfigure = event->configure; if (view->stage == PUGL_VIEW_STAGE_REALIZED) { view->stage = PUGL_VIEW_STAGE_CONFIGURED; } diff --git a/source/modules/dgl/src/pugl-upstream/src/internal.h b/source/modules/dgl/src/pugl-upstream/src/internal.h index 1ff9a2981..9f7a1d77b 100644 --- a/source/modules/dgl/src/pugl-upstream/src/internal.h +++ b/source/modules/dgl/src/pugl-upstream/src/internal.h @@ -6,7 +6,6 @@ #ifndef PUGL_INTERNAL_H #define PUGL_INTERNAL_H -#include "attributes.h" #include "types.h" #include @@ -81,10 +80,6 @@ puglPreRealize(PuglView* view); PuglStatus puglDispatchSimpleEvent(PuglView* view, PuglEventType type); -/// Process configure event while already in the graphics context -PUGL_WARN_UNUSED_RESULT PuglStatus -puglConfigure(PuglView* view, const PuglEvent* event); - /// Dispatch `event` to `view`, entering graphics context if necessary PuglStatus puglDispatchEvent(PuglView* view, const PuglEvent* event); diff --git a/source/modules/dgl/src/pugl-upstream/src/mac.m b/source/modules/dgl/src/pugl-upstream/src/mac.m index 977cd7e48..cfb45a91a 100644 --- a/source/modules/dgl/src/pugl-upstream/src/mac.m +++ b/source/modules/dgl/src/pugl-upstream/src/mac.m @@ -1689,7 +1689,7 @@ puglObscureRegion(PuglView* view, } PuglNativeView -puglGetNativeView(PuglView* view) +puglGetNativeView(const PuglView* view) { return (PuglNativeView)view->impl->wrapperView; } diff --git a/source/modules/dgl/src/pugl-upstream/src/win.c b/source/modules/dgl/src/pugl-upstream/src/win.c index c56cc449a..a443d0e06 100644 --- a/source/modules/dgl/src/pugl-upstream/src/win.c +++ b/source/modules/dgl/src/pugl-upstream/src/win.c @@ -1230,7 +1230,7 @@ puglObscureRegion(PuglView* const view, } PuglNativeView -puglGetNativeView(PuglView* view) +puglGetNativeView(const PuglView* view) { return (PuglNativeView)view->impl->hwnd; } @@ -1635,9 +1635,11 @@ puglWinConfigure(PuglView* view) PuglStatus puglWinEnter(PuglView* view, const PuglExposeEvent* expose) { - return expose - ? puglWinStatus(!!BeginPaint(view->impl->hwnd, &view->impl->paint)) - : PUGL_SUCCESS; + if (expose) { + return puglWinStatus(!!BeginPaint(view->impl->hwnd, &view->impl->paint)); + } + + return PUGL_SUCCESS; } PuglStatus diff --git a/source/modules/dgl/src/pugl-upstream/src/win_cairo.c b/source/modules/dgl/src/pugl-upstream/src/win_cairo.c index 873d395c6..328b6f02b 100644 --- a/source/modules/dgl/src/pugl-upstream/src/win_cairo.c +++ b/source/modules/dgl/src/pugl-upstream/src/win_cairo.c @@ -27,7 +27,7 @@ puglWinCairoCreateDrawContext(PuglView* view) surface->drawDc = CreateCompatibleDC(impl->hdc); surface->drawBitmap = CreateCompatibleBitmap( - impl->hdc, (int)view->lastConfigure.width, (int)view->lastConfigure.height); + impl->hdc, view->lastConfigure.width, view->lastConfigure.height); DeleteObject(SelectObject(surface->drawDc, surface->drawBitmap)); @@ -106,12 +106,11 @@ puglWinCairoEnter(PuglView* view, const PuglExposeEvent* expose) { PuglStatus st = PUGL_SUCCESS; - if (expose && !(st = puglWinCairoCreateDrawContext(view)) && - !(st = puglWinCairoOpen(view))) { - st = puglWinEnter(view, expose); + if (expose && !(st = puglWinCairoCreateDrawContext(view))) { + st = puglWinCairoOpen(view); } - return st; + return st ? st : puglWinEnter(view, expose); } static PuglStatus @@ -125,8 +124,8 @@ puglWinCairoLeave(PuglView* view, const PuglExposeEvent* expose) BitBlt(impl->hdc, 0, 0, - (int)view->lastConfigure.width, - (int)view->lastConfigure.height, + view->lastConfigure.width, + view->lastConfigure.height, surface->drawDc, 0, 0, diff --git a/source/modules/dgl/src/pugl-upstream/src/x11.c b/source/modules/dgl/src/pugl-upstream/src/x11.c index 84a6fa3c4..e134ccdd3 100644 --- a/source/modules/dgl/src/pugl-upstream/src/x11.c +++ b/source/modules/dgl/src/pugl-upstream/src/x11.c @@ -418,12 +418,12 @@ puglUpdateSizeHints(PuglView* const view) } sizeHints.flags = PBaseSize | PMinSize | PMaxSize; - sizeHints.base_width = (int)size.width; - sizeHints.base_height = (int)size.height; - sizeHints.min_width = (int)size.width; - sizeHints.min_height = (int)size.height; - sizeHints.max_width = (int)size.width; - sizeHints.max_height = (int)size.height; + sizeHints.base_width = size.width; + sizeHints.base_height = size.height; + sizeHints.min_width = size.width; + sizeHints.min_height = size.height; + sizeHints.max_width = size.width; + sizeHints.max_height = size.height; } else { // Avoid setting PBaseSize for top level views to avoid window manager bugs const PuglArea defaultSize = view->sizeHints[PUGL_DEFAULT_SIZE]; @@ -729,13 +729,7 @@ puglUnrealize(PuglView* const view) impl->vi = NULL; memset(&view->lastConfigure, 0, sizeof(PuglConfigureEvent)); - memset(&view->impl->pendingConfigure, 0, sizeof(PuglEvent)); memset(&view->impl->pendingExpose, 0, sizeof(PuglEvent)); - - if (impl->mapped) { - view->impl->pendingConfigure.configure.style |= PUGL_VIEW_STYLE_MAPPED; - } - return PUGL_SUCCESS; } @@ -1072,6 +1066,7 @@ getCurrentViewStyleFlags(PuglView* const view) state |= PUGL_VIEW_STYLE_DEMANDING; } } + XFree(hints); } if (view->impl->mapped) { @@ -1110,22 +1105,6 @@ getCurrentConfiguration(PuglView* const view) return configureEvent; } -static PuglEvent -makeConfigureEvent(PuglView* const view) -{ - PuglEvent event = view->impl->pendingConfigure; - - if (event.type != PUGL_CONFIGURE) { - event = getCurrentConfiguration(view); - } else if (view->impl->mapped) { - event.configure.style |= PUGL_VIEW_STYLE_MAPPED; - } else { - event.configure.style &= ~(PuglViewStyleFlags)PUGL_VIEW_STYLE_MAPPED; - } - - return event; -} - static PuglEvent translatePropertyNotify(PuglView* const view, XPropertyEvent message) { @@ -1142,8 +1121,7 @@ translatePropertyNotify(PuglView* const view, XPropertyEvent message) } // Make a configure event based on the current configuration to update - event = makeConfigureEvent(view); - event.configure.style = getCurrentViewStyleFlags(view); // FIXME: necessary? + event = getCurrentConfiguration(view); XFree(hints); } else if (message.atom == atoms->NET_FRAME_EXTENTS) { @@ -1192,21 +1170,21 @@ translateEvent(PuglView* const view, XEvent xevent) event = translatePropertyNotify(view, xevent.xproperty); break; case VisibilityNotify: - event = makeConfigureEvent(view); + event = getCurrentConfiguration(view); break; case MapNotify: view->impl->mapped = true; - event = makeConfigureEvent(view); + event = getCurrentConfiguration(view); break; case UnmapNotify: view->impl->mapped = false; - event = makeConfigureEvent(view); + event = getCurrentConfiguration(view); break; case DestroyNotify: view->impl->win = None; break; case ConfigureNotify: - event = makeConfigureEvent(view); + event = getCurrentConfiguration(view); event.configure.width = (PuglSpan)xevent.xconfigure.width; event.configure.height = (PuglSpan)xevent.xconfigure.height; if (view->parent) { @@ -1688,7 +1666,6 @@ flushExposures(PuglWorld* const world) { PuglStatus st0 = PUGL_SUCCESS; PuglStatus st1 = PUGL_SUCCESS; - PuglStatus st2 = PUGL_SUCCESS; // Send update events so the application can trigger redraws for (size_t i = 0; i < world->numViews; ++i) { @@ -1702,32 +1679,17 @@ flushExposures(PuglWorld* const world) for (size_t i = 0; i < world->numViews; ++i) { PuglView* const view = world->views[i]; - // Copy and reset pending events (in case their handlers write new ones) - const PuglEvent configure = view->impl->pendingConfigure; - const PuglEvent expose = view->impl->pendingExpose; - - view->impl->pendingConfigure.type = PUGL_NOTHING; - view->impl->pendingExpose.type = PUGL_NOTHING; - - if (expose.type || configure.type) { - const PuglExposeEvent* const exposeEvent = - expose.type ? &expose.expose : NULL; - - if (!(st0 = view->backend->enter(view, exposeEvent))) { - if (configure.type) { - st0 = puglConfigure(view, &configure); - } - - if (expose.type) { - st1 = view->eventFunc(view, &expose); - } + if (puglGetVisible(view)) { + const PuglEvent expose = view->impl->pendingExpose; + if (expose.type && !(st0 = view->backend->enter(view, &expose.expose))) { + st0 = view->eventFunc(view, &expose); + st1 = view->backend->leave(view, &expose.expose); + view->impl->pendingExpose.type = PUGL_NOTHING; } - - st2 = view->backend->leave(view, exposeEvent); } } - return st0 ? st0 : st1 ? st1 : st2; + return st0 ? st0 : st1; } static bool @@ -1808,10 +1770,6 @@ dispatchX11Events(PuglWorld* const world) const PuglEvent event = translateEvent(view, xevent); switch (event.type) { - case PUGL_CONFIGURE: - // Update configure event to be dispatched after loop - view->impl->pendingConfigure = event; - break; case PUGL_EXPOSE: // Expand expose event to be dispatched after loop mergeExposeEvents(&view->impl->pendingExpose.expose, &event.expose); @@ -1928,7 +1886,7 @@ puglObscureRegion(PuglView* const view, } PuglNativeView -puglGetNativeView(PuglView* const view) +puglGetNativeView(const PuglView* const view) { return (PuglNativeView)view->impl->win; } diff --git a/source/modules/dgl/src/pugl-upstream/src/x11.h b/source/modules/dgl/src/pugl-upstream/src/x11.h index a52ea2811..42e8baa34 100644 --- a/source/modules/dgl/src/pugl-upstream/src/x11.h +++ b/source/modules/dgl/src/pugl-upstream/src/x11.h @@ -82,7 +82,6 @@ struct PuglInternalsImpl { Window win; XIC xic; PuglSurface* surface; - PuglEvent pendingConfigure; PuglEvent pendingExpose; PuglX11Clipboard clipboard; long frameExtentLeft; diff --git a/source/modules/dgl/src/pugl-upstream/src/x11_gl.c b/source/modules/dgl/src/pugl-upstream/src/x11_gl.c index 527335bcd..c5b530204 100644 --- a/source/modules/dgl/src/pugl-upstream/src/x11_gl.c +++ b/source/modules/dgl/src/pugl-upstream/src/x11_gl.c @@ -14,7 +14,6 @@ #include #include -#include #include #include diff --git a/source/modules/dgl/src/pugl.cpp b/source/modules/dgl/src/pugl.cpp index f618e0711..fda302d7a 100644 --- a/source/modules/dgl/src/pugl.cpp +++ b/source/modules/dgl/src/pugl.cpp @@ -435,33 +435,6 @@ void puglOnDisplayPrepare(PuglView*) #endif } -// -------------------------------------------------------------------------------------------------------------------- -// DGL specific, build-specific fallback resize - -void puglFallbackOnResize(PuglView* const view, const uint width, const uint height) -{ - #ifdef DGL_OPENGL - #if defined(DGL_USE_OPENGL3) - glViewport(0, 0, static_cast(width), static_cast(height)); - #else - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glViewport(0, 0, static_cast(width), static_cast(height)); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, static_cast(width), static_cast(height), 0.0, 0.0, 1.0); - glViewport(0, 0, static_cast(width), static_cast(height)); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - #endif - #else - // unused - (void)view; - (void)width; - (void)height; - #endif -} - // -------------------------------------------------------------------------------------------------------------------- #if defined(DISTRHO_OS_HAIKU) diff --git a/source/modules/dgl/src/pugl.hpp b/source/modules/dgl/src/pugl.hpp index 125707af9..41dc36abd 100644 --- a/source/modules/dgl/src/pugl.hpp +++ b/source/modules/dgl/src/pugl.hpp @@ -84,9 +84,6 @@ PuglStatus puglSetSizeAndDefault(PuglView* view, uint width, uint height); // DGL specific, build-specific drawing prepare void puglOnDisplayPrepare(PuglView* view); -// DGL specific, build-specific fallback resize -void puglFallbackOnResize(PuglView* view, uint width, uint height); - #if defined(DISTRHO_OS_HAIKU) // nothing here yet diff --git a/source/modules/distrho/DistrhoUI.hpp b/source/modules/distrho/DistrhoUI.hpp index 77418403e..2401197da 100644 --- a/source/modules/distrho/DistrhoUI.hpp +++ b/source/modules/distrho/DistrhoUI.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2024 Filipe Coelho + * Copyright (C) 2012-2025 Filipe Coelho * * 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 @@ -291,19 +291,13 @@ protected: */ virtual void uiFocus(bool focus, DGL_NAMESPACE::CrossingMode mode); - /** - Window reshape function, called when the window is resized. - This function is for plugin UIs to be able to override Window::onReshape(uint, uint). - - The plugin UI size will be set right after this function. - The default implementation sets up the drawing context where necessary. - - You should almost never need to override this function. - The most common exception is custom OpenGL setup, but only really needed for custom OpenGL drawing code. - */ + #if DGL_ALLOW_DEPRECATED_METHODS + /** DEPRECATED DO NOT USE */ + DISTRHO_DEPRECATED virtual void uiReshape(uint width, uint height); + #endif -#if DISTRHO_UI_FILE_BROWSER + #if DISTRHO_UI_FILE_BROWSER /** Window file selected function, called when a path is selected by the user, as triggered by openFileBrowser(). This function is for plugin UIs to be able to override Window::onFileSelected(const char*). @@ -314,7 +308,7 @@ protected: If you need to use files as plugin state, please setup and use states with kStateIsFilenamePath instead. */ virtual void uiFileBrowserSelected(const char* filename); -#endif + #endif /* -------------------------------------------------------------------------------------------------------- * UI Resize Handling, internal */ diff --git a/source/modules/distrho/DistrhoUIMain.cpp b/source/modules/distrho/DistrhoUIMain.cpp index efc5d9f7e..9a80087a2 100644 --- a/source/modules/distrho/DistrhoUIMain.cpp +++ b/source/modules/distrho/DistrhoUIMain.cpp @@ -77,6 +77,11 @@ int main(int argc, char* argv[]) { return DISTRHO_NAMESPACE::dpf_webview_start(argc, argv); } +#elif defined(DISTRHO_OS_LINUX) && defined(DGL_USE_WEB_VIEW) && !DISTRHO_IS_STANDALONE +int main() +{ + return 0; +} #endif #endif diff --git a/source/modules/distrho/extra/String.hpp b/source/modules/distrho/extra/String.hpp index 015ff49e0..3f16895c8 100644 --- a/source/modules/distrho/extra/String.hpp +++ b/source/modules/distrho/extra/String.hpp @@ -695,11 +695,11 @@ public: "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; - const size_t strBufSize = std::min(d_nextPowerOf2(static_cast(dataSize/3)), 65536U); + const size_t strBufSize = std::min(d_nextPowerOf2(static_cast(dataSize / 3) + 1), 65536U); char* strBuf = static_cast(std::malloc(strBufSize)); DISTRHO_SAFE_ASSERT_RETURN(strBuf != nullptr, String()); - strBuf[strBufSize] = '\0'; + strBuf[strBufSize - 1] = '\0'; size_t strBufIndex = 0; const uchar* bytesToEncode = static_cast(data); diff --git a/source/modules/distrho/src/DistrhoUI.cpp b/source/modules/distrho/src/DistrhoUI.cpp index 0241b59ce..09b4a4d02 100644 --- a/source/modules/distrho/src/DistrhoUI.cpp +++ b/source/modules/distrho/src/DistrhoUI.cpp @@ -560,11 +560,11 @@ void UI::uiFocus(bool, DGL_NAMESPACE::CrossingMode) { } -void UI::uiReshape(const uint width, const uint height) +#if DGL_ALLOW_DEPRECATED_METHODS +void UI::uiReshape(uint, uint) { - // NOTE this must be the same as Window::onReshape - pData->fallbackOnResize(width, height); } +#endif #if DISTRHO_UI_FILE_BROWSER void UI::uiFileBrowserSelected(const char*) diff --git a/source/modules/distrho/src/DistrhoUIPrivateData.hpp b/source/modules/distrho/src/DistrhoUIPrivateData.hpp index 108e76b6c..7a1b4360f 100644 --- a/source/modules/distrho/src/DistrhoUIPrivateData.hpp +++ b/source/modules/distrho/src/DistrhoUIPrivateData.hpp @@ -115,7 +115,9 @@ class PluginWindow : public DGL_NAMESPACE::Window { UI* const ui; bool initializing; + #if DGL_ALLOW_DEPRECATED_METHODS bool receivedReshapeDuringInit; + #endif public: explicit PluginWindow(UI* const uiPtr, @@ -130,8 +132,10 @@ public: DISTRHO_UI_USES_SIZE_REQUEST, false), ui(uiPtr), - initializing(true), - receivedReshapeDuringInit(false) + initializing(true) + #if DGL_ALLOW_DEPRECATED_METHODS + , receivedReshapeDuringInit(false) + #endif { if (pData->view == nullptr) return; @@ -159,12 +163,31 @@ public: initializing = false; puglBackendLeave(pData->view); + #if DGL_ALLOW_DEPRECATED_METHODS if (receivedReshapeDuringInit) { puglBackendEnter(pData->view); + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4996) + #elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif ui->uiReshape(getWidth(), getHeight()); + #if defined(_MSC_VER) + #pragma warning(pop) + #elif defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic pop + #endif puglBackendLeave(pData->view); } + #endif } // used for temporary windows (VST/CLAP get size without active/visible view) @@ -213,6 +236,17 @@ protected: ui->uiFocus(focus, mode); } + #if DGL_ALLOW_DEPRECATED_METHODS + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4996) + #elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif void onReshape(const uint width, const uint height) override { DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,); @@ -225,6 +259,14 @@ protected: ui->uiReshape(width, height); } + #if defined(_MSC_VER) + #pragma warning(pop) + #elif defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic pop + #endif + #endif void onScaleFactorChanged(const double scaleFactor) override {