mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
API cleanup: Rename PlatformWindow to WindowAdapter
This commit is contained in:
parent
344f5c437b
commit
1e6ffeaa0f
50 changed files with 600 additions and 604 deletions
|
|
@ -83,23 +83,23 @@ inline void assert_main_thread()
|
|||
#endif
|
||||
}
|
||||
|
||||
class PlatformWindowRc
|
||||
class WindowAdapterRc
|
||||
{
|
||||
public:
|
||||
explicit PlatformWindowRc(cbindgen_private::PlatformWindowRcOpaque adopted_inner)
|
||||
explicit WindowAdapterRc(cbindgen_private::WindowAdapterRcOpaque adopted_inner)
|
||||
: inner(adopted_inner)
|
||||
{
|
||||
}
|
||||
PlatformWindowRc() { cbindgen_private::slint_windowrc_init(&inner); }
|
||||
~PlatformWindowRc() { cbindgen_private::slint_windowrc_drop(&inner); }
|
||||
PlatformWindowRc(const PlatformWindowRc &other)
|
||||
WindowAdapterRc() { cbindgen_private::slint_windowrc_init(&inner); }
|
||||
~WindowAdapterRc() { cbindgen_private::slint_windowrc_drop(&inner); }
|
||||
WindowAdapterRc(const WindowAdapterRc &other)
|
||||
{
|
||||
assert_main_thread();
|
||||
cbindgen_private::slint_windowrc_clone(&other.inner, &inner);
|
||||
}
|
||||
PlatformWindowRc(PlatformWindowRc &&) = delete;
|
||||
PlatformWindowRc &operator=(PlatformWindowRc &&) = delete;
|
||||
PlatformWindowRc &operator=(const PlatformWindowRc &other)
|
||||
WindowAdapterRc(WindowAdapterRc &&) = delete;
|
||||
WindowAdapterRc &operator=(WindowAdapterRc &&) = delete;
|
||||
WindowAdapterRc &operator=(const WindowAdapterRc &other)
|
||||
{
|
||||
assert_main_thread();
|
||||
if (this != &other) {
|
||||
|
|
@ -226,7 +226,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
cbindgen_private::PlatformWindowRcOpaque inner;
|
||||
cbindgen_private::WindowAdapterRcOpaque inner;
|
||||
};
|
||||
|
||||
constexpr inline ItemTreeNode make_item_node(uint32_t child_count, uint32_t child_index,
|
||||
|
|
@ -374,7 +374,7 @@ public:
|
|||
/// \private
|
||||
/// Internal function used by the generated code to construct a new instance of this
|
||||
/// public API wrapper.
|
||||
explicit Window(const private_api::PlatformWindowRc &windowrc) : inner(windowrc) { }
|
||||
explicit Window(const private_api::WindowAdapterRc &windowrc) : inner(windowrc) { }
|
||||
Window(const Window &other) = delete;
|
||||
Window &operator=(const Window &other) = delete;
|
||||
Window(Window &&other) = delete;
|
||||
|
|
@ -432,12 +432,12 @@ public:
|
|||
void set_size(const slint::Size<unsigned int> &size) { inner.set_size(size); }
|
||||
|
||||
/// \private
|
||||
private_api::PlatformWindowRc &window_handle() { return inner; }
|
||||
private_api::WindowAdapterRc &window_handle() { return inner; }
|
||||
/// \private
|
||||
const private_api::PlatformWindowRc &window_handle() const { return inner; }
|
||||
const private_api::WindowAdapterRc &window_handle() const { return inner; }
|
||||
|
||||
private:
|
||||
private_api::PlatformWindowRc inner;
|
||||
private_api::WindowAdapterRc inner;
|
||||
};
|
||||
|
||||
/// A Timer that can call a callback at repeated interval
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ public:
|
|||
/// such as the position on the screen.
|
||||
const slint::Window &window()
|
||||
{
|
||||
const cbindgen_private::PlatformWindowRcOpaque *win_ptr = nullptr;
|
||||
const cbindgen_private::WindowAdapterRcOpaque *win_ptr = nullptr;
|
||||
cbindgen_private::slint_interpreter_component_instance_window(inner(), &win_ptr);
|
||||
return *reinterpret_cast<const slint::Window *>(win_ptr);
|
||||
}
|
||||
|
|
@ -582,10 +582,10 @@ public:
|
|||
/// it may return nullptr if the Qt backend is not used at runtime.
|
||||
QWidget *qwidget() const
|
||||
{
|
||||
const cbindgen_private::PlatformWindowRcOpaque *win_ptr = nullptr;
|
||||
const cbindgen_private::WindowAdapterRcOpaque *win_ptr = nullptr;
|
||||
cbindgen_private::slint_interpreter_component_instance_window(inner(), &win_ptr);
|
||||
auto wid = reinterpret_cast<QWidget *>(cbindgen_private::slint_qt_get_widget(
|
||||
reinterpret_cast<const cbindgen_private::PlatformWindowRc *>(win_ptr)));
|
||||
reinterpret_cast<const cbindgen_private::WindowAdapterRc *>(win_ptr)));
|
||||
return wid;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1010,10 +1010,10 @@ inline void send_keyboard_string_sequence(const slint::interpreter::ComponentIns
|
|||
const slint::SharedString &str,
|
||||
KeyboardModifiers modifiers = {})
|
||||
{
|
||||
const cbindgen_private::PlatformWindowRcOpaque *win_ptr = nullptr;
|
||||
const cbindgen_private::WindowAdapterRcOpaque *win_ptr = nullptr;
|
||||
cbindgen_private::slint_interpreter_component_instance_window(
|
||||
reinterpret_cast<const cbindgen_private::ErasedComponentBox *>(component), &win_ptr);
|
||||
cbindgen_private::send_keyboard_string_sequence(
|
||||
&str, modifiers, reinterpret_cast<const cbindgen_private::PlatformWindowRc *>(win_ptr));
|
||||
&str, modifiers, reinterpret_cast<const cbindgen_private::WindowAdapterRc *>(win_ptr));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue