* Add `RequestedSize` and `RequestedPosition` enum to enable asking for
logical or physical size/position.
* Rename `Window::size()` to `Window::physical_size()`
* Make `Window::set_size(...)` take an `Into<RequestedSize>`
* Rename `Window::position()` to `Window::physical_position()`
* Make `Window::set_position(...)` take an `Into<RequestedPosition>`
* Change `WindowAdapter` and related classes to be able to handle
requests being made in the either physical or logical units.
Implement this for C++, Rust and node.
and use Rc<dyn PlatformWindow> instead. The alias has to stay with the ffi
functions though and the item vtable definitions,
because we don't have an Rc<> template in C++.
Previously: Window is an Rc<WindowInner>, which has an Rc<dyn
PLatformWindow> - and weak references the other way around.
Now: Rc<dyn PlatformWindow> is the root of window ownership. The impl
PlatformWindow has a slint::api::Window, which just holds a WindowInner.
This change is incomplete on a few levels, mainly that neither of the
code generators nor the interpreter is ported.
For hide() we don't really need Rc<Self>, and for show() we had Rc<Self> because
for example for winit we need a Weak<Self> for the thread-local mapping of
window id to window.
However that can be encapsulated in the PlatformWindow impl using Rc::new_cyclic,
there's no need to expose this in the trait.
Move the self_weak of WindowInner into the impl of PlatformWindow. Most implementations already have it anyway.
While right now the method returns a `WindowRc`, at the end of the series
it should return a `&Window`.
From that `&Window` we can get to `&WindowInner` and all receivers there
are `&self`.
Every backend will do something different with the string that needs to go into the clipboard.
Qt will convert it to a QString, copypasta to a String, in theory it could be written
directly to a socket.
Given that we don't know what the perfect representation on the backend side is, passing
a string slice avoids any immediate conversions.
This includes the cache of decoded images, the HTMLImage element support
and the SVG rendering adapter.
The objective is that Image holds an ImageInner, which is not a path
anymore that the backend has to process, but instead always either
decoded image data, a pointer to a static texture or an SVG tree that
can be rendered to the desired size.
I want to track component structure changes in the window without
generating more code. So use a more generic name for the init_*_items
functions, so that I can add the functionality I need in there.
Also add a register_component to PlatformWindow and call that.
I want a more generic name as I want to do to track component structure
changes in addition to resource freeing and I do not want to add another
call into the generated code.
Commit 738ac0dc01 increased the size of the ImageInner::StaticTextures variant,
which breaks the size assertions in the interpreter ffi build.
This changes fixes that by reducing the size of the ImageInner variant again by
moving all the fields into a separate struct.
Since the cat picture is now in jpeg, we need to be able to decaode it
from the tests.
Luckily on the CI this works fine beacause we do a full cargo test that
build all the crates including the gl crate that has the jpeg format enaabled,
but if we try to compile the test with limited feature set, it wouldn't be available.