1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::BuilderScope;
use crate::ListItemFactory;
use glib::object::Cast;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;

glib::wrapper! {
    #[doc(alias = "GtkBuilderListItemFactory")]
    pub struct BuilderListItemFactory(Object<ffi::GtkBuilderListItemFactory, ffi::GtkBuilderListItemFactoryClass>) @extends ListItemFactory;

    match fn {
        type_ => || ffi::gtk_builder_list_item_factory_get_type(),
    }
}

impl BuilderListItemFactory {
    #[doc(alias = "gtk_builder_list_item_factory_new_from_bytes")]
    #[doc(alias = "new_from_bytes")]
    pub fn from_bytes(
        scope: Option<&impl IsA<BuilderScope>>,
        bytes: &glib::Bytes,
    ) -> BuilderListItemFactory {
        assert_initialized_main_thread!();
        unsafe {
            ListItemFactory::from_glib_full(ffi::gtk_builder_list_item_factory_new_from_bytes(
                scope.map(|p| p.as_ref()).to_glib_none().0,
                bytes.to_glib_none().0,
            ))
            .unsafe_cast()
        }
    }

    #[doc(alias = "gtk_builder_list_item_factory_new_from_resource")]
    #[doc(alias = "new_from_resource")]
    pub fn from_resource(
        scope: Option<&impl IsA<BuilderScope>>,
        resource_path: &str,
    ) -> BuilderListItemFactory {
        assert_initialized_main_thread!();
        unsafe {
            ListItemFactory::from_glib_full(ffi::gtk_builder_list_item_factory_new_from_resource(
                scope.map(|p| p.as_ref()).to_glib_none().0,
                resource_path.to_glib_none().0,
            ))
            .unsafe_cast()
        }
    }

    #[doc(alias = "gtk_builder_list_item_factory_get_bytes")]
    #[doc(alias = "get_bytes")]
    pub fn bytes(&self) -> glib::Bytes {
        unsafe {
            from_glib_none(ffi::gtk_builder_list_item_factory_get_bytes(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gtk_builder_list_item_factory_get_resource")]
    #[doc(alias = "get_resource")]
    pub fn resource(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gtk_builder_list_item_factory_get_resource(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gtk_builder_list_item_factory_get_scope")]
    #[doc(alias = "get_scope")]
    pub fn scope(&self) -> Option<BuilderScope> {
        unsafe {
            from_glib_none(ffi::gtk_builder_list_item_factory_get_scope(
                self.to_glib_none().0,
            ))
        }
    }
}

impl fmt::Display for BuilderListItemFactory {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("BuilderListItemFactory")
    }
}