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
// 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::Accessible;
use glib::translate::*;

glib::wrapper! {
    /// A boxed type which wraps a list of references to GtkAccessible objects.
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct AccessibleList(Boxed<ffi::GtkAccessibleList>);

    match fn {
        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gtk_accessible_list_get_type(), ptr as *mut _) as *mut ffi::GtkAccessibleList,
        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gtk_accessible_list_get_type(), ptr as *mut _),
        type_ => || ffi::gtk_accessible_list_get_type(),
    }
}

impl AccessibleList {
    /// Allocates a new list of accessible instances.
    /// ## `accessibles`
    /// array of GtkAccessible
    ///
    /// # Returns
    ///
    /// the newly created list of accessible instances
    #[doc(alias = "gtk_accessible_list_new_from_array")]
    #[doc(alias = "new_from_array")]
    pub fn from_array(accessibles: &[Accessible]) -> AccessibleList {
        assert_initialized_main_thread!();
        let n_accessibles = accessibles.len() as _;
        unsafe {
            from_glib_full(ffi::gtk_accessible_list_new_from_array(
                accessibles.to_glib_none().0,
                n_accessibles,
            ))
        }
    }

    /// Gets the list of objects this boxed type holds
    ///
    /// # Returns
    ///
    /// a shallow copy of the objects
    #[doc(alias = "gtk_accessible_list_get_objects")]
    #[doc(alias = "get_objects")]
    pub fn objects(&self) -> Vec<Accessible> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_accessible_list_get_objects(
                mut_override(self.to_glib_none().0),
            ))
        }
    }
}