![]() |
undoStudio
The IDE of the undoRT ecosystem
|
Abstract interface for window management service. More...
#include <WindowService.hpp>


Public Types | |
| using | FileDropHandler = std::function< void(const std::vector< std::string > &)> |
| Be told which paths were dropped onto the window. | |
| using | ResizeCallback = std::function< void(int, int)> |
| using | KeyCallback = std::function< void(int, int, int, int)> |
| using | MouseCallback = std::function< void(double, double)> |
| using | MouseButtonCallback = std::function< void(int, int, int)> |
| using | ScrollCallback = std::function< void(double, double)> |
| using | CloseCallback = std::function< void()> |
Public Member Functions | |
| virtual | ~WindowService ()=default |
| virtual bool | initialize (const WindowConfig &config)=0 |
| Initialize the window with the given configuration. | |
| virtual void | shutdown ()=0 |
| Shutdown and destroy the window. | |
| virtual bool | shouldClose () const =0 |
| Check if the window should be closed. | |
| virtual void | pollEvents ()=0 |
| Poll and process all pending events. | |
| virtual void | setFileDropHandler (FileDropHandler handler)=0 |
| virtual void | swapBuffers ()=0 |
| Swap the front and back buffers. | |
| virtual glm::ivec2 | getWindowSize () const =0 |
| Get the current window size. | |
| virtual void | setWindowSize (int width, int height)=0 |
| Set the window size. | |
| virtual void | setTitle (const std::string &title)=0 |
| Set the window title. | |
| virtual void * | getNativeHandle () const =0 |
| Get the native window handle. | |
| virtual void | setResizeCallback (ResizeCallback callback)=0 |
| Set the window resize callback. | |
| virtual void | setKeyCallback (KeyCallback callback)=0 |
| Set the keyboard input callback. | |
| virtual void | setMouseCallback (MouseCallback callback)=0 |
| Set the mouse movement callback. | |
| virtual void | setMouseButtonCallback (MouseButtonCallback callback)=0 |
| Set the mouse button callback. | |
| virtual void | setScrollCallback (ScrollCallback callback)=0 |
| Set the scroll wheel callback. | |
| virtual void | setCloseCallback (CloseCallback callback)=0 |
| Set the window close callback. | |
Static Public Member Functions | |
| static WindowService & | getInstance () |
| Get the singleton instance of WindowService. | |
Abstract interface for window management service.
This service provides platform-independent window management. It handles window creation, event processing, and rendering context management.
| using undoStudio::services::WindowService::CloseCallback = std::function<void()> |
| using undoStudio::services::WindowService::FileDropHandler = std::function<void(const std::vector<std::string>&)> |
Be told which paths were dropped onto the window.
| handler | Called with the dropped paths, or with an empty list for a drop that carried none, which a drag from inside a browser does not. |
The handler is called from pollEvents, so it runs on the same thread as the rest of the window's events and may set a request that a later frame picks up. It may be null, and then drops are still delivered by the platform and simply go nowhere.
A drop arrives here rather than through ImGui because the paths come from the window system, and the window is this service's. The undoApp that opens them is not: see ImGuiManager::requestOpenFile.
| using undoStudio::services::WindowService::KeyCallback = std::function<void(int, int, int, int)> |
| using undoStudio::services::WindowService::MouseButtonCallback = std::function<void(int, int, int)> |
| using undoStudio::services::WindowService::MouseCallback = std::function<void(double, double)> |
| using undoStudio::services::WindowService::ResizeCallback = std::function<void(int, int)> |
| using undoStudio::services::WindowService::ScrollCallback = std::function<void(double, double)> |
|
virtualdefault |
|
static |
Get the singleton instance of WindowService.
|
pure virtual |
Get the native window handle.
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Get the current window size.
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Initialize the window with the given configuration.
| config | Window configuration parameters |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Poll and process all pending events.
This method processes all pending window events including input, resize, and close events.
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the window close callback.
| callback | Function to call on window close |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the keyboard input callback.
| callback | Function to call on keyboard events |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the mouse button callback.
| callback | Function to call on mouse button events |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the mouse movement callback.
| callback | Function to call on mouse movement |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the window resize callback.
| callback | Function to call on window resize |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the scroll wheel callback.
| callback | Function to call on scroll events |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the window title.
| title | New window title string |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Set the window size.
| width | New window width in pixels |
| height | New window height in pixels |
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Check if the window should be closed.
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Shutdown and destroy the window.
Implemented in undoStudio::services::WindowServiceGLFW.
|
pure virtual |
Swap the front and back buffers.
This method swaps the OpenGL/DirectX buffers, displaying the rendered frame.
Implemented in undoStudio::services::WindowServiceGLFW.