This repository was archived by the owner on Mar 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-16
lines changed Expand file tree Collapse file tree 4 files changed +26
-16
lines changed Original file line number Diff line number Diff line change @@ -1772,6 +1772,10 @@ status = "generate"
1772
1772
name = " Gtk.PrintOperation"
1773
1773
status = " generate"
1774
1774
generate_builder = true
1775
+ [[object .function ]]
1776
+ name = " get_error"
1777
+ # It quacks like a fallible function, but it isn't.
1778
+ ignore = true
1775
1779
1776
1780
[[object ]]
1777
1781
name = " Gtk.PrintSettings"
Original file line number Diff line number Diff line change @@ -233,10 +233,6 @@ pub trait PrintOperationExt: 'static {
233
233
#[ doc( alias = "get_embed_page_setup" ) ]
234
234
fn embeds_page_setup ( & self ) -> bool ;
235
235
236
- #[ doc( alias = "gtk_print_operation_get_error" ) ]
237
- #[ doc( alias = "get_error" ) ]
238
- fn error ( & self ) -> Result < ( ) , glib:: Error > ;
239
-
240
236
#[ doc( alias = "gtk_print_operation_get_has_selection" ) ]
241
237
#[ doc( alias = "get_has_selection" ) ]
242
238
fn has_selection ( & self ) -> bool ;
@@ -486,18 +482,6 @@ impl<O: IsA<PrintOperation>> PrintOperationExt for O {
486
482
}
487
483
}
488
484
489
- fn error ( & self ) -> Result < ( ) , glib:: Error > {
490
- unsafe {
491
- let mut error = ptr:: null_mut ( ) ;
492
- let _ = ffi:: gtk_print_operation_get_error ( self . as_ref ( ) . to_glib_none ( ) . 0 , & mut error) ;
493
- if error. is_null ( ) {
494
- Ok ( ( ) )
495
- } else {
496
- Err ( from_glib_full ( error) )
497
- }
498
- }
499
- }
500
-
501
485
fn has_selection ( & self ) -> bool {
502
486
unsafe {
503
487
from_glib ( ffi:: gtk_print_operation_get_has_selection (
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ mod pad_action_entry;
99
99
#[ cfg( any( feature = "v3_22" , feature = "dox" ) ) ]
100
100
mod pad_controller;
101
101
mod page_range;
102
+ mod print_operation;
102
103
mod print_settings;
103
104
mod radio_button;
104
105
mod radio_menu_item;
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments