Cpp: Give each generated component a ComponentWindow

That's a counted reference to the window in the run-time and avoids the need to do the parent->parent->window dance.
This commit is contained in:
Simon Hausmann 2020-11-16 16:59:57 +01:00
parent f9ced44188
commit 54ee7b3556
4 changed files with 45 additions and 30 deletions

View file

@ -77,7 +77,10 @@ class ComponentWindow
public:
ComponentWindow() { cbindgen_private::sixtyfps_component_window_init(&inner); }
~ComponentWindow() { cbindgen_private::sixtyfps_component_window_drop(&inner); }
ComponentWindow(const ComponentWindow &) = delete;
ComponentWindow(const ComponentWindow &other)
{
cbindgen_private::sixtyfps_component_window_clone(&other.inner, &inner);
}
ComponentWindow(ComponentWindow &&) = delete;
ComponentWindow &operator=(const ComponentWindow &) = delete;