Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()

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.
This commit is contained in:
Simon Hausmann 2021-01-18 16:33:45 +01:00
parent 2b7a1eebcd
commit 5f265ffc09
23 changed files with 186 additions and 32 deletions

View file

@ -89,7 +89,8 @@ public:
ComponentWindow(ComponentWindow &&) = delete;
ComponentWindow &operator=(const ComponentWindow &) = delete;
void run() const { sixtyfps_component_window_run(&inner); }
void show() const { sixtyfps_component_window_show(&inner); }
void hide() const { sixtyfps_component_window_hide(&inner); }
float scale_factor() const { return sixtyfps_component_window_get_scale_factor(&inner); }
void set_scale_factor(float value) const
@ -624,4 +625,9 @@ struct VersionCheckHelper
};
}
void run_event_loop()
{
cbindgen_private::sixtyfps_run_event_loop();
}
} // namespace sixtyfps