1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::Builder; 6 use glib::object::IsA; 7 use glib::translate::*; 8 use std::fmt; 9 10 glib::wrapper! { 11 #[doc(alias = "GtkBuildable")] 12 pub struct Buildable(Interface<ffi::GtkBuildable, ffi::GtkBuildableIface>); 13 14 match fn { 15 type_ => || ffi::gtk_buildable_get_type(), 16 } 17 } 18 19 pub const NONE_BUILDABLE: Option<&Buildable> = None; 20 21 pub trait BuildableExt: 'static { 22 #[doc(alias = "gtk_buildable_add_child")] add_child<P: IsA<Builder>, Q: IsA<glib::Object>>( &self, builder: &P, child: &Q, type_: Option<&str>, )23 fn add_child<P: IsA<Builder>, Q: IsA<glib::Object>>( 24 &self, 25 builder: &P, 26 child: &Q, 27 type_: Option<&str>, 28 ); 29 30 #[doc(alias = "gtk_buildable_construct_child")] construct_child<P: IsA<Builder>>(&self, builder: &P, name: &str) -> Option<glib::Object>31 fn construct_child<P: IsA<Builder>>(&self, builder: &P, name: &str) -> Option<glib::Object>; 32 33 //#[doc(alias = "gtk_buildable_custom_finished")] 34 //fn custom_finished<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, data: /*Unimplemented*/Option<Fundamental: Pointer>); 35 36 //#[doc(alias = "gtk_buildable_custom_tag_end")] 37 //fn custom_tag_end<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, data: /*Unimplemented*/Option<Fundamental: Pointer>); 38 39 //#[doc(alias = "gtk_buildable_custom_tag_start")] 40 //fn custom_tag_start<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, parser: /*Ignored*/glib::MarkupParser, data: /*Unimplemented*/&mut Option<Fundamental: Pointer>) -> bool; 41 42 #[doc(alias = "gtk_buildable_get_internal_child")] 43 #[doc(alias = "get_internal_child")] internal_child<P: IsA<Builder>>(&self, builder: &P, childname: &str) -> Option<glib::Object>44 fn internal_child<P: IsA<Builder>>(&self, builder: &P, childname: &str) 45 -> Option<glib::Object>; 46 47 #[doc(alias = "gtk_buildable_parser_finished")] parser_finished<P: IsA<Builder>>(&self, builder: &P)48 fn parser_finished<P: IsA<Builder>>(&self, builder: &P); 49 50 #[doc(alias = "gtk_buildable_set_buildable_property")] set_buildable_property<P: IsA<Builder>>(&self, builder: &P, name: &str, value: &glib::Value)51 fn set_buildable_property<P: IsA<Builder>>(&self, builder: &P, name: &str, value: &glib::Value); 52 } 53 54 impl<O: IsA<Buildable>> BuildableExt for O { add_child<P: IsA<Builder>, Q: IsA<glib::Object>>( &self, builder: &P, child: &Q, type_: Option<&str>, )55 fn add_child<P: IsA<Builder>, Q: IsA<glib::Object>>( 56 &self, 57 builder: &P, 58 child: &Q, 59 type_: Option<&str>, 60 ) { 61 unsafe { 62 ffi::gtk_buildable_add_child( 63 self.as_ref().to_glib_none().0, 64 builder.as_ref().to_glib_none().0, 65 child.as_ref().to_glib_none().0, 66 type_.to_glib_none().0, 67 ); 68 } 69 } 70 construct_child<P: IsA<Builder>>(&self, builder: &P, name: &str) -> Option<glib::Object>71 fn construct_child<P: IsA<Builder>>(&self, builder: &P, name: &str) -> Option<glib::Object> { 72 unsafe { 73 from_glib_full(ffi::gtk_buildable_construct_child( 74 self.as_ref().to_glib_none().0, 75 builder.as_ref().to_glib_none().0, 76 name.to_glib_none().0, 77 )) 78 } 79 } 80 81 //fn custom_finished<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, data: /*Unimplemented*/Option<Fundamental: Pointer>) { 82 // unsafe { TODO: call ffi:gtk_buildable_custom_finished() } 83 //} 84 85 //fn custom_tag_end<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, data: /*Unimplemented*/Option<Fundamental: Pointer>) { 86 // unsafe { TODO: call ffi:gtk_buildable_custom_tag_end() } 87 //} 88 89 //fn custom_tag_start<P: IsA<Builder>, Q: IsA<glib::Object>>(&self, builder: &P, child: Option<&Q>, tagname: &str, parser: /*Ignored*/glib::MarkupParser, data: /*Unimplemented*/&mut Option<Fundamental: Pointer>) -> bool { 90 // unsafe { TODO: call ffi:gtk_buildable_custom_tag_start() } 91 //} 92 internal_child<P: IsA<Builder>>( &self, builder: &P, childname: &str, ) -> Option<glib::Object>93 fn internal_child<P: IsA<Builder>>( 94 &self, 95 builder: &P, 96 childname: &str, 97 ) -> Option<glib::Object> { 98 unsafe { 99 from_glib_none(ffi::gtk_buildable_get_internal_child( 100 self.as_ref().to_glib_none().0, 101 builder.as_ref().to_glib_none().0, 102 childname.to_glib_none().0, 103 )) 104 } 105 } 106 parser_finished<P: IsA<Builder>>(&self, builder: &P)107 fn parser_finished<P: IsA<Builder>>(&self, builder: &P) { 108 unsafe { 109 ffi::gtk_buildable_parser_finished( 110 self.as_ref().to_glib_none().0, 111 builder.as_ref().to_glib_none().0, 112 ); 113 } 114 } 115 set_buildable_property<P: IsA<Builder>>( &self, builder: &P, name: &str, value: &glib::Value, )116 fn set_buildable_property<P: IsA<Builder>>( 117 &self, 118 builder: &P, 119 name: &str, 120 value: &glib::Value, 121 ) { 122 unsafe { 123 ffi::gtk_buildable_set_buildable_property( 124 self.as_ref().to_glib_none().0, 125 builder.as_ref().to_glib_none().0, 126 name.to_glib_none().0, 127 value.to_glib_none().0, 128 ); 129 } 130 } 131 } 132 133 impl fmt::Display for Buildable { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result134 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 135 f.write_str("Buildable") 136 } 137 } 138