C++: drops IntSize in favor of Size<T> (#922)

Fixes #909

Since we declare the struct in C++, we don't need to declare it in
rust for cbindgen anymore, as long as we expose the Size2D type from
euclid to the cbindgen_private namespace
This commit is contained in:
Olivier Goffart 2022-02-08 14:12:52 +01:00 committed by GitHub
parent 7a735a48db
commit 753784c331
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 32 deletions

View file

@ -161,7 +161,6 @@ fn gen_corelib(
"slint_image_size",
"slint_image_path",
"TimerMode", // included in generated_public.h
"IntSize", // included in generated_public.h
"RenderingState", // included in generated_public.h
"SetRenderingNotifierError", // included in generated_public.h
"GraphicsAPI", // included in generated_public.h
@ -267,7 +266,6 @@ fn gen_corelib(
"slint_color_darker",
"slint_image_size",
"slint_image_path",
"IntSize",
]
.iter()
.filter(|exclusion| !rust_types.iter().any(|inclusion| inclusion == *exclusion))
@ -317,20 +315,11 @@ fn gen_corelib(
public_config.export.exclude.push("Point".into());
public_config.export.include = vec![
"TimerMode".into(),
"IntSize".into(),
"RenderingState".into(),
"SetRenderingNotifierError".into(),
"GraphicsAPI".into(),
];
public_config.export.body.insert(
"IntSize".to_owned(),
r#"
/// Compares this IntSize with \a other and returns true if they are equal; false otherwise.
bool operator==(const IntSize &other) const = default;"#
.to_owned(),
);
cbindgen::Builder::new()
.with_config(public_config)
.with_src(crate_dir.join("timers.rs"))