Further build on b3529d1b75 and move the
strong/weak reference dance into the API crate out of the generated
code.
Saves ~21k llvm lines on the printer demo (debug).
It's also possible to move the as_pin_ref() bit, but that didn't
really give any savings overall.
The binding setup functions (set_binding, set_animated_binding, etc.)
are taking the binding basically as an `impl Fn() -> T`, which means
each call site creates a new copy. The bodies of these can be quite big.
Since most of our uses follow the pattern of just capturing the
samereduce the number of copies needed parameter, we can reduce the
number of copies needed by providing wrappers.
With rustc 1.54.0 on my mbp and debug, the build time of
touch ../ui/printerdemo.60
cargo rustc
goes from 1m:15s down to 42s, and total llvm lines goes from
2079842 down to 1134237.
and replace it with the internal, re-exported WindowHandleAccess
one.
Strictly speaking, this is a breaking change. In practice the
returned type of this trait was in `sixtyfps::re_exports`, so any
public use is questionable :)
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.
* 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.
`ComponentHandle` offers a richer API of common functions, such as
`show()`/`hide()` as well as the new `clone_strong()` - that should help
to prevent mistakely created strong reference that may cause leaks.
Fixes#188
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.
This will give a nicer API to expose to .60. If the struct weren't
repr(C) then the booleans would be nicely packed, but alas that's not
happening. On the other hand we're not keeping many instances of them
around.