gtk/auto/
text_attributes.rs1use crate::ffi;
6use glib::translate::*;
7
8glib::wrapper! {
9 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
14 pub struct TextAttributes(Shared<ffi::GtkTextAttributes>);
15
16 match fn {
17 ref => |ptr| ffi::gtk_text_attributes_ref(ptr),
18 unref => |ptr| ffi::gtk_text_attributes_unref(ptr),
19 type_ => || ffi::gtk_text_attributes_get_type(),
20 }
21}
22
23impl TextAttributes {
24 #[doc(alias = "gtk_text_attributes_new")]
32 pub fn new() -> TextAttributes {
33 assert_initialized_main_thread!();
34 unsafe { from_glib_full(ffi::gtk_text_attributes_new()) }
35 }
36
37 #[doc(alias = "gtk_text_attributes_copy")]
38 #[must_use]
39 pub fn copy(&self) -> Option<TextAttributes> {
40 unsafe { from_glib_full(ffi::gtk_text_attributes_copy(self.to_glib_none().0)) }
41 }
42
43 #[doc(alias = "gtk_text_attributes_copy_values")]
48 pub fn copy_values(&self, dest: &TextAttributes) {
49 unsafe {
50 ffi::gtk_text_attributes_copy_values(self.to_glib_none().0, dest.to_glib_none().0);
51 }
52 }
53}
54
55impl Default for TextAttributes {
56 fn default() -> Self {
57 Self::new()
58 }
59}