slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.01k stars 526 forks source link

Include the C++ testing API in the C++ API docs #5398

Open tronical opened 3 weeks ago

tronical commented 3 weeks ago

This adds the testing API, but the AccessibleRole is still not documented. It needs to go into a public header file, otherwise doxygen won't look at it. I think I'll try to hack it that it goes into slint::testing inside slint_enums.h.

ogoffart commented 3 weeks ago

Should we wait until this is no longer experimental perhaps? Or is there a way to mark it as such?

tronical commented 3 weeks ago

I don't have a strong opinion on this, but if we every want to ask folks for feedback on an API, I think it makes sense that they have API documentation to read to learn how to use it... (yes, we should also do that for slint-esp).

We could document that in the testing namespace, that it's experimental. Or have everything under slint::experimental:: (so slint::experimental::testing:...).

ogoffart commented 3 weeks ago

Having it under slint::experimental:: is an option, but it is more complicated than just adding an #ifdef as then we will have to search and replace once we move it out of experimental

tronical commented 3 weeks ago

Yep, I also don't like slint::experimental. Ok, I'll add a bit comment for the docs for the slint::testing namespace it's conditional - better than nothing IMO and good to have docs for this API (the doc building also helps us find issues).

tronical commented 1 week ago

What do you think about this compromise?

(One caveat here is that while the AccessibleRole is now under slint::testing, it's not surrounded by #ifdefs, but maybe that's an acceptable corner?)