1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

use crate::PrintOperation;

impl PrintOperation {
    #[doc(alias = "gtk_print_operation_get_error")]
    #[doc(alias = "get_error")]
    pub fn error(&self) -> Option<glib::Error> {
        unsafe {
            let mut error = std::ptr::null_mut();
            ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error);
            if error.is_null() {
                None
            } else {
                Some(from_glib_full(error))
            }
        }
    }
}