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
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

use crate::{prelude::*, MapListModel};

impl MapListModel {
    #[doc(alias = "gtk_map_list_model_new")]
    pub fn without_map_func(model: Option<&impl IsA<gio::ListModel>>) -> Self {
        assert_initialized_main_thread!();
        unsafe {
            from_glib_full(ffi::gtk_map_list_model_new(
                model.map(|p| p.as_ref()).to_glib_full(),
                None,
                std::ptr::null_mut(),
                None,
            ))
        }
    }

    #[doc(alias = "gtk_map_list_model_set_map_func")]
    #[doc(alias = "set_map_func")]
    pub fn unset_map_func(&self) {
        unsafe {
            ffi::gtk_map_list_model_set_map_func(
                self.to_glib_none().0,
                None,
                std::ptr::null_mut(),
                None,
            );
        }
    }
}