ranfdev
ranfdev
There are many advantages: - if the flag is called "unstable_class_macro", you can't use it accidentally. - each function is tracked consistently and a global search for "unstable_class_macro" will bring...
The latest API is: ```rust #[derive(Props, Default)] pub struct Foo { #[prop(get, set)] bar: Mutex, #[prop(get = Self::hello_world)] _buzz: RefCell, #[prop(get, set = Self::set_fizz, name = "fizz")] fizz: RefCell, }...
> auto generate ... This is already implemented: `#[prop(get)]` -> autogenerate `#[prop(get = func)]` -> custom `#[prop()]` -> not readable > should it generate a "fields" enum Yes, I could...
> Should it have flags to auto generate getters and setters? Sorry @jf2048, I misread. You actually want to generate getters/setters on the _wrapper_ type. I don't know if this...
That syntax is invalid: ```rust impl ::Type { fn hi() {} } ``` ``` error[E0118]: no nominal type found for inherent implementation --> glib-macros/tests/props.rs:20:22 | 20 | #[derive(Props, Default)] |...
> but you can generate a trait and implement it for T::Type no? Yes, I thought about it, but then when you import the type you must import the related...
This now also includes #585. This PR is basically done. I only have to add some doc. Is there anything else that I should add? I'd like to get this...
@jf2048 > - `abstract` flag to avoid allocating storage for the type, probably needs the type to be `PhantomData` since we can't remove fields with a derive macro. Yeah, you...
I've ported a gstreamer plugin to use this macro: https://gitlab.freedesktop.org/ranfdev/gst-plugins-rs/-/commit/874cb77055ea5163cbdec633899bb5f8540cef2f CC @sdroege, who proposed the idea.
Finally, the ParamSpec's type parameter is set automatically. Before: ```rust #[property(get, set, builder(SimpleBoxedString::static_type()))] boxed: RefCell, ``` Now: ```rust #[property(get, set)] boxed: RefCell, ``` @MicroJoe The feature set is now complete....