diff --git a/dgl/Window.hpp b/dgl/Window.hpp index 1996832d..9142712a 100644 --- a/dgl/Window.hpp +++ b/dgl/Window.hpp @@ -252,7 +252,7 @@ protected: A function called when the window gains or loses the keyboard focus. The default implementation does nothing. */ - virtual void onFocus(bool focus); + virtual void onFocus(bool focus, CrossingMode mode); /** A function called when the window is resized. @@ -278,16 +278,6 @@ END_NAMESPACE_DGL * add eventcrossing/enter-leave event */ -// class StandaloneWindow; -// class Widget; - -// #ifdef DISTRHO_DEFINES_H_INCLUDED -// START_NAMESPACE_DISTRHO -// class UI; -// class UIExporter; -// END_NAMESPACE_DISTRHO -// #endif - #if 0 #ifndef DGL_FILE_BROWSER_DISABLED /** @@ -332,8 +322,6 @@ END_NAMESPACE_DGL void exec(bool lockWait = false); - const GraphicsContext& getGraphicsContext() const noexcept; - void addIdleCallback(IdleCallback* const callback); void removeIdleCallback(IdleCallback* const callback); @@ -341,38 +329,13 @@ END_NAMESPACE_DGL bool openFileBrowser(const FileBrowserOptions& options); #endif - protected: #ifndef DGL_FILE_BROWSER_DISABLED virtual void fileBrowserSelected(const char* filename); #endif - // internal - void _setAutoScaling(double scaling) noexcept; - - virtual void _addWidget(Widget* const widget); - virtual void _removeWidget(Widget* const widget); - void _idle(); - bool handlePluginKeyboard(const bool press, const uint key); bool handlePluginSpecial(const bool press, const Key key); - -// friend class Widget; -// friend class StandaloneWindow; -// #ifdef DISTRHO_DEFINES_H_INCLUDED -// friend class DISTRHO_NAMESPACE::UI; -// friend class DISTRHO_NAMESPACE::UIExporter; -// #endif - - // Prevent copies -// #ifdef DISTRHO_PROPER_CPP11_SUPPORT -// Window& operator=(Window&) = delete; -// Window& operator=(const Window&) = delete; -// #else -// Window& operator=(Window&); -// Window& operator=(const Window&); -// #endif - #endif // ----------------------------------------------------------------------- diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp index 09fd0a6b..fe3f78cd 100644 --- a/dgl/src/Window.cpp +++ b/dgl/src/Window.cpp @@ -232,7 +232,7 @@ bool Window::onClose() return true; } -void Window::onFocus(bool) +void Window::onFocus(bool, CrossingMode) { } diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp index cb4a093c..f3ca1922 100644 --- a/dgl/src/WindowPrivateData.cpp +++ b/dgl/src/WindowPrivateData.cpp @@ -384,15 +384,15 @@ void Window::PrivateData::onPuglClose() close(); } -void Window::PrivateData::onPuglFocus(const bool focus) +void Window::PrivateData::onPuglFocus(const bool focus, const CrossingMode mode) { - DGL_DBGp("onPuglFocus : %i %u %u\n", focus); + DGL_DBGp("onPuglFocus : %i %i\n", focus, mode); // if (fModal.childFocus != nullptr) // return fModal.childFocus->focus(); #ifndef DPF_TEST_WINDOW_CPP - self->onFocus(focus); + self->onFocus(focus, mode); #endif } @@ -532,7 +532,8 @@ PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const Pu case PUGL_FOCUS_IN: ///< Keyboard focus left view, a #PuglEventFocus case PUGL_FOCUS_OUT: - pData->onPuglFocus(event->type == PUGL_FOCUS_IN); + pData->onPuglFocus(event->type == PUGL_FOCUS_IN, + static_cast(event->focus.mode)); break; ///< Key pressed, a #PuglEventKey diff --git a/dgl/src/WindowPrivateData.hpp b/dgl/src/WindowPrivateData.hpp index 4a029dc4..f128f3d5 100644 --- a/dgl/src/WindowPrivateData.hpp +++ b/dgl/src/WindowPrivateData.hpp @@ -109,7 +109,7 @@ struct Window::PrivateData : IdleCallback { void onPuglConfigure(int width, int height); void onPuglExpose(); void onPuglClose(); - void onPuglFocus(bool focus); + void onPuglFocus(bool focus, CrossingMode mode); void onPuglKey(const Events::KeyboardEvent& ev); void onPuglSpecial(const Events::SpecialEvent& ev); void onPuglText(const Events::CharacterInputEvent& ev);