libobs_simple\sources/
macro_helper.rs1#[allow(unused)]
2#[macro_export]
3macro_rules! define_object_manager {
4 ($(#[$parent_meta:meta])* struct $struct_name:ident($obs_id:literal) for $updatable_name:ident {
5 $(
6 $(#[$meta:meta])*
7 $field:ident: $ty:ty,
8 )*
9 }) => {
10 paste::paste! {
11 #[libobs_simple_macro::obs_object_builder($obs_id)]
12 $(#[$parent_meta])*
13 pub struct [<$struct_name Builder>] {
14 $(
15 $(#[$meta])*
16 $field: $ty,
17 )*
18 }
19
20 #[libobs_simple_macro::obs_object_updater($obs_id, $updatable_name)]
21 pub struct [<$struct_name Updater>] {
24 $(
25 $(#[$meta])*
26 $field: $ty,
27 )*
28 }
29 }
30 };
31}
32
33#[allow(unused)]
34pub(crate) use define_object_manager;