Change Model::row_data to return an Option<T> (rust) or std::optional<T> (c++)
Co-authored-by: Olivier Goffart <olivier@woboq.com>
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
The indexes stored in `VisitChildrenResult` are unsigned. We have 64
bits to store two values and we need to have one special value as a flag.
So accept any index `< u32::MAX` instead of `< i32::MAX`, which should
allow for more data to be visited;-)
This change makes the start of sharing the docs for the `TimerMode` enum
between Rust and C++. The reference to Timer::start in there works as
both doxygen and rustdoc find the right reference, but this needs
careful editing in the future and double-checking!
Another "caveat" is that the docs for the TimerMode enum say that the
enum is defined in the file "sixtyfps_generated_public.h", which is
correct as-is but not as pretty as "sixtyfps.h". I tried various ways
with \file and \includedoc, but couldn't get it working differently.
To implement this, the cppdocs steps now also runs cbindgen and cbindgen
generates a new sixtyfps_generated_public.h file that contains types we
do want to have in the public sixtyfps namespace.
Similar to the parent commit, the model tracks changes to the rows and
marks an internal property dirty. Since we have a base class this is a
little less intrusive.
cc #98
This allows compiling with SIXTYFPS_EMBED_RESOURCES=true and
images/fonts are embedded as inline variables.
Generated data is emitted into the header file as
inline uint8_t sfps_embedded_resources_123[789] = {
0x1, 0x2, 0x3,
};
This can be reproduced by deleting the last item of the printer queue in the
printer demo.
It is a regression showing up because we now emit the MouseExit event after
the mouse grab as released.
The problem is that we upgrade the weak item, and call geometry() on it.
Calling geometry will re-evaluate the layout cache which will re-evaluate
the model which will result in the component being removed and the cache
entry having less item than expected.
It is ok to simply return 0. for these layout location since the item will
disapear anyway.
Move the sixtyfps::namespace entry into a dedicated C++ integration overview
page. Also duplicate and specialize the instantiation and model bits, which
differ between the compiled code and the interpreter.
Finally, fix the generated C++ docs to not mention that there's a constructor,
instead we generate a constructor function.
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
Doxygen would still generate xml for private_api::ArrayModel and would
try to resolve a reference to iself, which is not possible because we've
excluded the namespace:
```
stderr: (!) Critical error while generating the file for [/home/vagrant/sixtyfps/target/cppdocs/api/classsixtyfps_1_1Model.rst].Traceback (most recent call last):
File "/home/vagrant/.local/share/virtualenvs/docs-4wjFCyEr/lib/python3.8/site-packages/exhale/graph.py", line 2591, in generateSingleNodeRST
gen_file.write("{0}\n".format(node.baseOrDerivedListString(
File "/home/vagrant/.local/share/virtualenvs/docs-4wjFCyEr/lib/python3.8/site-packages/exhale/graph.py", line 393, in baseOrDerivedListString
link=nodeByRefid[refid].link_name
KeyError: 'classsixtyfps_1_1private__api_1_1ArrayModel'
```
Making the entire class as \private works around it.
Oddly, this isn't needed for IntModel, perhaps because it's not a template?