gtk/auto/
text_attributes.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 glib::translate::*;
6use gtk_sys;
7
8glib_wrapper! {
9    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
10    pub struct TextAttributes(Shared<gtk_sys::GtkTextAttributes>);
11
12    match fn {
13        ref => |ptr| gtk_sys::gtk_text_attributes_ref(ptr),
14        unref => |ptr| gtk_sys::gtk_text_attributes_unref(ptr),
15        get_type => || gtk_sys::gtk_text_attributes_get_type(),
16    }
17}
18
19impl TextAttributes {
20    pub fn new() -> TextAttributes {
21        assert_initialized_main_thread!();
22        unsafe { from_glib_full(gtk_sys::gtk_text_attributes_new()) }
23    }
24
25    pub fn copy(&self) -> Option<TextAttributes> {
26        unsafe { from_glib_full(gtk_sys::gtk_text_attributes_copy(self.to_glib_none().0)) }
27    }
28
29    pub fn copy_values(&self, dest: &TextAttributes) {
30        unsafe {
31            gtk_sys::gtk_text_attributes_copy_values(self.to_glib_none().0, dest.to_glib_none().0);
32        }
33    }
34}
35
36impl Default for TextAttributes {
37    fn default() -> Self {
38        Self::new()
39    }
40}