move cpp StandardListViewItem from private to public namespace (#2062)

* 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>
This commit is contained in:
Florian Blasius 2023-01-16 08:06:36 +00:00 committed by GitHub
parent 96c80a2dd1
commit ac5eaf495f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 45 deletions

View file

@ -170,6 +170,7 @@ fn gen_corelib(
"SetRenderingNotifierError",
"GraphicsAPI",
"CloseRequestResponse",
"StandardListViewItem",
];
config.export.exclude = [
@ -392,12 +393,18 @@ fn gen_corelib(
public_config.export.exclude.push("Point".into());
public_config.export.include = public_exported_types.into_iter().map(str::to_string).collect();
public_config.export.body.insert(
"StandardListViewItem".to_owned(),
"/// \\private\nfriend bool operator==(const StandardListViewItem&, const StandardListViewItem&) = default;".into(),
);
cbindgen::Builder::new()
.with_config(public_config)
.with_src(crate_dir.join("timers.rs"))
.with_src(crate_dir.join("graphics.rs"))
.with_src(crate_dir.join("window.rs"))
.with_src(crate_dir.join("api.rs"))
.with_src(crate_dir.join("model.rs"))
.with_after_include(format!(
r"
/// This macro expands to the to the numeric value of the major version of Slint you're
@ -439,10 +446,6 @@ fn gen_corelib(
friend inline LayoutInfo operator+(const LayoutInfo &a, const LayoutInfo &b) { return a.merge(b); }
friend bool operator==(const LayoutInfo&, const LayoutInfo&) = default;".into(),
);
config.export.body.insert(
"StandardListViewItem".to_owned(),
"friend bool operator==(const StandardListViewItem&, const StandardListViewItem&) = default;".into(),
);
config.export.body.insert(
"TableColumn".to_owned(),
"friend bool operator==(const TableColumn&, const TableColumn&) = default;".into(),
@ -452,7 +455,6 @@ fn gen_corelib(
.body
.insert("Flickable".to_owned(), " inline Flickable(); inline ~Flickable();".into());
config.export.pre_body.insert("FlickableDataBox".to_owned(), "struct FlickableData;".into());
config.export.include.push("StandardListViewItem".into());
config.export.include.push("TableColumn".into());
cbindgen::Builder::new()
.with_config(config)

View file

@ -62,7 +62,6 @@ using ItemArray = slint::cbindgen_private::Slice<ItemArrayEntry>;
using cbindgen_private::KeyboardModifiers;
using cbindgen_private::KeyEvent;
using cbindgen_private::PointerEvent;
using cbindgen_private::StandardListViewItem;
using cbindgen_private::TableColumn;
/// Internal function that checks that the API that must be called from the main