In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.
Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
Instead of the WindowAdapter being a template for a concept, let's just
use an abstract base class for the renderer. Since we provide the
renderers, this simplifies two things:
- Ownership becomes clear to the user by creating the renderer instance
in a field of theirs.
- All template use goes away on the user side.
Remove the generic window handle owner part of the API. Instead assume
that the caller provides safety for the given window handles, like we do
for FemtoVG and like softbuffer does it in its public API.
Having a const generic for that didn't turn to be a good API.
Also made the C++ side more difficult
(Also renamed buffer_stride to pixel_stride)
Closes#2135
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
* move cpp StandardListViewItem to public namespace
* Fix missing C++ docs for StandardListViewItem
The struct is originally defined in Rust in model.rs and cbindgen creates the
compatible C++ declaration. For doxygen
to see it, it needs to be emitted into slint_generated_public.h.
* Improve the StandardListViewItem docs a little bit
* move cpp StandardListViewItem to public namespace
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Make sure that we return an unsigned for row_count() in C++ and Rust by ensuring an unsigned int model at creation time.
For the interpreter this "worked" by chance as casting a negative floating
number to usize automatically caps at zero, and all values are stored as f64. For safety this patch
applies the same fix though, to be on the safe side.
* Text only StandardTableView with column and rows
* Text editing of cells
* Sort by column ascending and descending
* Variants of the TableView for native, fluent and material
- virtual destructor can be = default
- rules of 3 for AbstractWindowAdapter
- Since WindowAdapter inherit AbstractWindowAdapter, it is already no-copy
Re-use the cells but mark them as dirty, instead of re-creating them every time.
In the included test-case that provides behavior that's
more intuitive.