mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-03 05:12:55 +00:00
C++: Include AccessibleRole in the slint::testing namespace docs
This commit is contained in:
parent
c76f9fe795
commit
2be4b320b9
1 changed files with 19 additions and 0 deletions
|
|
@ -28,14 +28,30 @@ fn enums(path: &Path) -> anyhow::Result<()> {
|
||||||
writeln!(enums_priv, "using slint::PointerEventButton;")?;
|
writeln!(enums_priv, "using slint::PointerEventButton;")?;
|
||||||
&mut enums_pub
|
&mut enums_pub
|
||||||
}};
|
}};
|
||||||
|
(AccessibleRole) => {{
|
||||||
|
writeln!(enums_priv, "using slint::testing::AccessibleRole;")?;
|
||||||
|
&mut enums_pub
|
||||||
|
}};
|
||||||
($_:ident) => {
|
($_:ident) => {
|
||||||
&mut enums_priv
|
&mut enums_priv
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
macro_rules! enum_sub_namespace {
|
||||||
|
(AccessibleRole) => {{
|
||||||
|
Some("testing")
|
||||||
|
}};
|
||||||
|
($_:ident) => {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
}
|
||||||
macro_rules! print_enums {
|
macro_rules! print_enums {
|
||||||
($( $(#[doc = $enum_doc:literal])* $(#[non_exhaustive])? enum $Name:ident { $( $(#[doc = $value_doc:literal])* $Value:ident,)* })*) => {
|
($( $(#[doc = $enum_doc:literal])* $(#[non_exhaustive])? enum $Name:ident { $( $(#[doc = $value_doc:literal])* $Value:ident,)* })*) => {
|
||||||
$(
|
$(
|
||||||
let file = enum_file!($Name);
|
let file = enum_file!($Name);
|
||||||
|
let namespace: Option<&'static str> = enum_sub_namespace!($Name);
|
||||||
|
if let Some(ns) = namespace {
|
||||||
|
writeln!(file, "namespace {} {{", ns)?;
|
||||||
|
}
|
||||||
$(writeln!(file, "///{}", $enum_doc)?;)*
|
$(writeln!(file, "///{}", $enum_doc)?;)*
|
||||||
writeln!(file, "enum class {} {{", stringify!($Name))?;
|
writeln!(file, "enum class {} {{", stringify!($Name))?;
|
||||||
$(
|
$(
|
||||||
|
|
@ -43,6 +59,9 @@ fn enums(path: &Path) -> anyhow::Result<()> {
|
||||||
writeln!(file, " {},", stringify!($Value).trim_start_matches("r#"))?;
|
writeln!(file, " {},", stringify!($Value).trim_start_matches("r#"))?;
|
||||||
)*
|
)*
|
||||||
writeln!(file, "}};")?;
|
writeln!(file, "}};")?;
|
||||||
|
if namespace.is_some() {
|
||||||
|
writeln!(file, "}}")?;
|
||||||
|
}
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue