Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit f90cad7

Browse files
committed
gtk: manually implement gtk_print_operation_get_error
1 parent 21e5543 commit f90cad7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

gtk/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ mod pad_action_entry;
9999
#[cfg(any(feature = "v3_22", feature = "dox"))]
100100
mod pad_controller;
101101
mod page_range;
102+
mod print_operation;
102103
mod print_settings;
103104
mod radio_button;
104105
mod radio_menu_item;

gtk/src/print_operation.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Take a look at the license at the top of the repository in the LICENSE file.
2+
3+
use crate::PrintOperation;
4+
use glib::translate::*;
5+
use std::ptr;
6+
7+
impl PrintOperation {
8+
#[doc(alias = "gtk_print_operation_get_error")]
9+
#[doc(alias = "get_error")]
10+
pub fn error(&self) -> Option<glib::Error> {
11+
unsafe {
12+
let mut error = ptr::null_mut();
13+
ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error);
14+
if error.is_null() {
15+
None
16+
} else {
17+
Some(from_glib_full(error))
18+
}
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)