Port the C++ generator and C++ API to the new window ownership model

One key difference to the Rust way is what `slint::Window` means. In
Rust that holds the `WindowInner` and `slint::Window` is only exposed as
`&slint::Window`. This is possible because the component owns the
`Rc<dyn PlatformWindow>`, which has a function to return the
`&slint::Window`.

In C++ `slint::Window` is also exposed as `slint::Window&` in the
`window()` getter, but there's no way to get a reference to a  C++
wrapper for the Rust `&slint::Window` that the `PlatformWindow` trait
returns. Therefore in C++ `slint::Window` wraps `Rc<dyn
PlatformWindow>`.
This commit is contained in:
Simon Hausmann 2022-08-18 15:00:49 +02:00 committed by Simon Hausmann
parent fd026a3991
commit 98e1befd0d
9 changed files with 26 additions and 30 deletions

View file

@ -151,9 +151,6 @@ TEST_CASE("Image")
{
using namespace slint;
// ensure a backend exists, using private api
private_api::WindowRc wnd;
Image img;
{
auto size = img.size();