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
use crate::{ContentFormats, ContentFormatsBuilder};
use glib::translate::*;
impl ContentFormatsBuilder {
#[doc(alias = "gdk_content_formats_builder_add_formats")]
#[must_use]
pub fn add_formats(self, formats: &ContentFormats) -> Self {
unsafe {
ffi::gdk_content_formats_builder_add_formats(
self.to_glib_none().0,
formats.to_glib_none().0,
);
}
self
}
#[doc(alias = "gdk_content_formats_builder_add_gtype")]
#[must_use]
pub fn add_type(self, type_: glib::types::Type) -> Self {
unsafe {
ffi::gdk_content_formats_builder_add_gtype(self.to_glib_none().0, type_.into_glib());
}
self
}
#[doc(alias = "gdk_content_formats_builder_add_mime_type")]
#[must_use]
pub fn add_mime_type(self, mime_type: &str) -> Self {
unsafe {
ffi::gdk_content_formats_builder_add_mime_type(
self.to_glib_none().0,
mime_type.to_glib_none().0,
);
}
self
}
#[doc(alias = "gdk_content_formats_builder_to_formats")]
#[must_use = "The builder must be built to be used"]
pub fn build(self) -> ContentFormats {
unsafe {
from_glib_full(ffi::gdk_content_formats_builder_to_formats(
self.to_glib_none().0,
))
}
}
}