As per commit 0c02f133f3daee146b805149e69bba8cee6727b2 in qtbase (qt6),
quit() on QCoreApplication on macOS calls [NSApp terminate], which will
not return to main. The latter however is documented behavior, and
sixtyfps-viewer for example relies on it.
Use the new fontdb API:
* When registering embedded fonts, we don't need to make a copy of the
embedded font data anymore.
* We don't have to mmap the font files ourselves anymore, fontdb can
do this now for us.
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
* Remove the `new` function from the main impl and use the slightly
less visible From conversion trait
* Make the inner Rc<Window> pub(crate) instead of pub
* Instead, provide a public as_any() accessor that the Qt backend can use
This requires the image size query to be window independent and go
through the backend instead.
This implies minor changes for the Qt backend and bigger ones for the GL
backend:
* There exists now a thread-local IMAGE_CACHE, which is used by the
backend's image_size() function as well as by the renderer for
loading CPU side images.
* The image remain as decoded images in there (including SVG tree)
and the window now has a texture_cache, which holds CachedImage
with ImageData::Texture.
* Rendering an image item therefore fetches the CPU side image,
calls upload_to_gpu() on it, which creates a new Rc<CachedImage>
and that's stored in the texture_cache.
* The texture cache continues to be pruned when hiding the window.
* Provide an internal behavior parameter to run_event_loop() that we can use
from the preview to not quit when the last window was closed.
* Fix Drop for the winit event loop GraphicsWindow to drop the backend window correctly
when unmapping, not when the graphics window dies. Otherwise QuitOnLastWindowClosed doesn't work.
* sixtyfps_timer_start needs to *take* the timer id out of the Rust
timer to avoid that the subsequent drop stops the timer again
* For the Qt event loop, call `timer_event()` once before entering
QCoreApplication::exec(), to schedule any timers that were started
beforehand.
* Added a way to quit the event loop gently, in order to use that
from the C++ unit test.
Remove the `application` infix from `register_application_font`, to
reduce the changes that it might be interpreted to be a function that
also changes the default font in all text elements.
- re-enable Qt for the C++ part now that the download server is back up
- Use the proper way to set env variable on Windows
- Silent deprecated warning for alloc::LayoutError
- Silent warning in qt/lib.rs when Qt is not there
- remove LD_LIBRARY_PATH workaround as the install-qt-action is fixed
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.
As a bonus, the run() function on generated components is not consuming
anymore.