Add some more boilerplate for impl trait inheritance

This needs some macros added.
This commit is contained in:
Sebastian Dröge 2017-09-23 19:58:18 +03:00
parent b7c396d70b
commit 540011a4a0
2 changed files with 23 additions and 2 deletions

View file

@ -209,7 +209,18 @@ impl ElementImpl for Box<BaseSrcImpl> {
} }
} }
impl ObjectImpl for Box<BaseSrcImpl> {} // FIXME: Boilerplate
impl ObjectImpl for Box<BaseSrcImpl> {
fn set_property(&self, obj: &glib::Object, id: u32, value: &glib::Value) {
let imp: &BaseSrcImpl = self.as_ref();
imp.set_property(obj, id, value);
}
fn get_property(&self, obj: &glib::Object, id: u32, value: &mut glib::Value) {
let imp: &BaseSrcImpl = self.as_ref();
imp.get_property(obj, id, value);
}
}
impl ObjectType for RsBaseSrc { impl ObjectType for RsBaseSrc {
const NAME: &'static str = "RsBaseSrc"; const NAME: &'static str = "RsBaseSrc";

View file

@ -121,7 +121,17 @@ unsafe impl ElementClass<RsElement> for gst_ffi::GstElementClass {}
unsafe impl ObjectClassStruct for gst_ffi::GstElementClass {} unsafe impl ObjectClassStruct for gst_ffi::GstElementClass {}
// FIXME: Boilerplate // FIXME: Boilerplate
impl ObjectImpl for Box<ElementImpl> {} impl ObjectImpl for Box<ElementImpl> {
fn set_property(&self, obj: &glib::Object, id: u32, value: &glib::Value) {
let imp: &ElementImpl = self.as_ref();
imp.set_property(obj, id, value);
}
fn get_property(&self, obj: &glib::Object, id: u32, value: &mut glib::Value) {
let imp: &ElementImpl = self.as_ref();
imp.get_property(obj, id, value);
}
}
impl ElementImpl for Box<ElementImpl> { impl ElementImpl for Box<ElementImpl> {
fn change_state( fn change_state(