[go: up one dir, main page]

gtk4/auto/
accessible_list.rs

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
5use crate::{ffi, Accessible};
6use glib::translate::*;
7
8glib::wrapper! {
9    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
10    pub struct AccessibleList(Boxed<ffi::GtkAccessibleList>);
11
12    match fn {
13        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gtk_accessible_list_get_type(), ptr as *mut _) as *mut ffi::GtkAccessibleList,
14        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gtk_accessible_list_get_type(), ptr as *mut _),
15        type_ => || ffi::gtk_accessible_list_get_type(),
16    }
17}
18
19impl AccessibleList {
20    #[doc(alias = "gtk_accessible_list_new_from_array")]
21    #[doc(alias = "new_from_array")]
22    pub fn from_array(accessibles: &[Accessible]) -> AccessibleList {
23        assert_initialized_main_thread!();
24        let n_accessibles = accessibles.len() as _;
25        unsafe {
26            from_glib_full(ffi::gtk_accessible_list_new_from_array(
27                accessibles.to_glib_none().0,
28                n_accessibles,
29            ))
30        }
31    }
32
33    #[doc(alias = "gtk_accessible_list_get_objects")]
34    #[doc(alias = "get_objects")]
35    pub fn objects(&self) -> Vec<Accessible> {
36        unsafe {
37            FromGlibPtrContainer::from_glib_container(ffi::gtk_accessible_list_get_objects(
38                mut_override(self.to_glib_none().0),
39            ))
40        }
41    }
42}