Must be called to get the current mouse cursor state for the plugin
Must be called periodically (ideally 60 times per second but this is not mandatory). time must refer to the window creation time. dt and time are expressed in seconds (not milliseconds).
Render the window in software in the buffer previously returned by onResized. At the end of this function, the whole buffer should be a valid, coherent UI.
Called on keyboard press.
Called on keyboard release.
Called whenever mouse capture was canceled (ALT + TAB, SetForegroundWindow...)
Called on mouse click.
Called whenever mouse exited the window (but a capture could still be in action).
Called on mouse movement (might not be within the window)
Called on mouse button release
Called on mouse wheel movement
The drawing area size has changed. Always called at least once before onDraw.
Recompute internally what needs be done for the next onDraw. This function MUST have been called before calling onDraw and getDirtyRectangle. This method exists to allow the Window to recompute these draw lists less. And because cache invalidation was easier on user code than internally in the UI. Important: once you've called recomputeDirtyAreas() you COMMIT to redraw the corresponding area given by getDirtyRectangle(). IMPORTANT: Two calls to recomputeDirtyAreas() will not yield the same area. VERY IMPORTANT: See the above note about concurrent calls.
Receiving commands from a window.
IMPORTANT The IWindow implementation should not call these callback without care. In particular, there are two sets of calls that are assumed will NOT be called concurrently.
Set 1: - onAnimate - key events - mouse events - onMouseCaptureCancelled MUST NOT be called concurrently.
Set 2: - onDraw - onResized - recomputeDirtyAreas <---- this particular set has birthed many data races - getDirtyRectangle MUST NOT be called concurrently.
Some IWindow implentation ensure that unicity through passing in an event queue, others like the X11 implementation have to use locks.
TODO: clarify this, additionally onDraw and onAnimate are NOT called concurrently, on purpose: https://github.com/AuburnSounds/Dplug/issues/453