gtk/buildable.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{Buildable, ffi};
4use glib::object::IsA;
5use glib::translate::*;
6
7pub trait BuildableExtManual: IsA<Buildable> + 'static {
8 #[doc(alias = "gtk_buildable_get_name")]
9 #[doc(alias = "get_buildable_name")]
10 fn buildable_name(&self) -> Option<String> {
11 unsafe { from_glib_none(ffi::gtk_buildable_get_name(self.as_ref().to_glib_none().0)) }
12 }
13
14 #[doc(alias = "gtk_buildable_set_name")]
15 fn set_buildable_name(&self, name: &str) {
16 unsafe {
17 ffi::gtk_buildable_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
18 }
19 }
20}
21
22impl<O: IsA<Buildable>> BuildableExtManual for O {}