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
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FileList(Boxed<ffi::GdkFileList>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gdk_file_list_get_type(), ptr as *mut _) as *mut ffi::GdkFileList,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gdk_file_list_get_type(), ptr as *mut _),
type_ => || ffi::gdk_file_list_get_type(),
}
}
impl FileList {
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[doc(alias = "gdk_file_list_new_from_array")]
#[doc(alias = "new_from_array")]
pub fn from_array(files: &[gio::File]) -> FileList {
assert_initialized_main_thread!();
let n_files = files.len() as _;
unsafe {
from_glib_full(ffi::gdk_file_list_new_from_array(
files.to_glib_none().0,
n_files,
))
}
}
#[doc(alias = "gdk_file_list_get_files")]
#[doc(alias = "get_files")]
pub fn files(&self) -> Vec<gio::File> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::gdk_file_list_get_files(mut_override(
self.to_glib_none().0,
)))
}
}
}