xdot/impl_help.rs
1#[macro_export]
2macro_rules! impl_bitflags_accessors {
3 ($cls: path, $( $flag: ident ),+ $(,)?) => {
4 paste::paste! {
5 #[cfg(feature = "pyo3")]
6 #[pyo3::pymethods]
7 impl $cls {
8 $(
9 #[getter]
10 fn [< get_ $flag >](&self) -> bool {
11 self.contains($cls::[< $flag:upper >])
12 }
13 #[setter]
14 fn [< set_ $flag >](&mut self, value: bool) {
15 self.set($cls::[< $flag:upper >], value);
16 }
17 )+
18 }
19 }
20 };
21}