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 
5 use glib;
6 use glib::object::Cast;
7 use glib::object::IsA;
8 use glib::signal::connect_raw;
9 use glib::signal::SignalHandlerId;
10 use glib::translate::*;
11 use glib::GString;
12 use glib::StaticType;
13 use glib::ToValue;
14 use glib::Value;
15 use glib_sys;
16 use gobject_sys;
17 use gtk_sys;
18 use libc;
19 use std;
20 use std::boxed::Box as Box_;
21 use std::fmt;
22 use std::mem::transmute;
23 use std::ptr;
24 use PageSetup;
25 use PrintContext;
26 use PrintOperationAction;
27 use PrintOperationPreview;
28 use PrintOperationResult;
29 use PrintSettings;
30 use PrintStatus;
31 use Unit;
32 use Widget;
33 use Window;
34 
35 glib_wrapper! {
36     pub struct PrintOperation(Object<gtk_sys::GtkPrintOperation, gtk_sys::GtkPrintOperationClass, PrintOperationClass>) @implements PrintOperationPreview;
37 
38     match fn {
39         get_type => || gtk_sys::gtk_print_operation_get_type(),
40     }
41 }
42 
43 impl PrintOperation {
new() -> PrintOperation44     pub fn new() -> PrintOperation {
45         assert_initialized_main_thread!();
46         unsafe { from_glib_full(gtk_sys::gtk_print_operation_new()) }
47     }
48 }
49 
50 impl Default for PrintOperation {
default() -> Self51     fn default() -> Self {
52         Self::new()
53     }
54 }
55 
56 #[derive(Clone, Default)]
57 pub struct PrintOperationBuilder {
58     allow_async: Option<bool>,
59     current_page: Option<i32>,
60     custom_tab_label: Option<String>,
61     default_page_setup: Option<PageSetup>,
62     embed_page_setup: Option<bool>,
63     export_filename: Option<String>,
64     has_selection: Option<bool>,
65     job_name: Option<String>,
66     n_pages: Option<i32>,
67     print_settings: Option<PrintSettings>,
68     show_progress: Option<bool>,
69     support_selection: Option<bool>,
70     track_print_status: Option<bool>,
71     unit: Option<Unit>,
72     use_full_page: Option<bool>,
73 }
74 
75 impl PrintOperationBuilder {
new() -> Self76     pub fn new() -> Self {
77         Self::default()
78     }
79 
build(self) -> PrintOperation80     pub fn build(self) -> PrintOperation {
81         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
82         if let Some(ref allow_async) = self.allow_async {
83             properties.push(("allow-async", allow_async));
84         }
85         if let Some(ref current_page) = self.current_page {
86             properties.push(("current-page", current_page));
87         }
88         if let Some(ref custom_tab_label) = self.custom_tab_label {
89             properties.push(("custom-tab-label", custom_tab_label));
90         }
91         if let Some(ref default_page_setup) = self.default_page_setup {
92             properties.push(("default-page-setup", default_page_setup));
93         }
94         if let Some(ref embed_page_setup) = self.embed_page_setup {
95             properties.push(("embed-page-setup", embed_page_setup));
96         }
97         if let Some(ref export_filename) = self.export_filename {
98             properties.push(("export-filename", export_filename));
99         }
100         if let Some(ref has_selection) = self.has_selection {
101             properties.push(("has-selection", has_selection));
102         }
103         if let Some(ref job_name) = self.job_name {
104             properties.push(("job-name", job_name));
105         }
106         if let Some(ref n_pages) = self.n_pages {
107             properties.push(("n-pages", n_pages));
108         }
109         if let Some(ref print_settings) = self.print_settings {
110             properties.push(("print-settings", print_settings));
111         }
112         if let Some(ref show_progress) = self.show_progress {
113             properties.push(("show-progress", show_progress));
114         }
115         if let Some(ref support_selection) = self.support_selection {
116             properties.push(("support-selection", support_selection));
117         }
118         if let Some(ref track_print_status) = self.track_print_status {
119             properties.push(("track-print-status", track_print_status));
120         }
121         if let Some(ref unit) = self.unit {
122             properties.push(("unit", unit));
123         }
124         if let Some(ref use_full_page) = self.use_full_page {
125             properties.push(("use-full-page", use_full_page));
126         }
127         glib::Object::new(PrintOperation::static_type(), &properties)
128             .expect("object new")
129             .downcast()
130             .expect("downcast")
131     }
132 
allow_async(mut self, allow_async: bool) -> Self133     pub fn allow_async(mut self, allow_async: bool) -> Self {
134         self.allow_async = Some(allow_async);
135         self
136     }
137 
current_page(mut self, current_page: i32) -> Self138     pub fn current_page(mut self, current_page: i32) -> Self {
139         self.current_page = Some(current_page);
140         self
141     }
142 
custom_tab_label(mut self, custom_tab_label: &str) -> Self143     pub fn custom_tab_label(mut self, custom_tab_label: &str) -> Self {
144         self.custom_tab_label = Some(custom_tab_label.to_string());
145         self
146     }
147 
default_page_setup(mut self, default_page_setup: &PageSetup) -> Self148     pub fn default_page_setup(mut self, default_page_setup: &PageSetup) -> Self {
149         self.default_page_setup = Some(default_page_setup.clone());
150         self
151     }
152 
embed_page_setup(mut self, embed_page_setup: bool) -> Self153     pub fn embed_page_setup(mut self, embed_page_setup: bool) -> Self {
154         self.embed_page_setup = Some(embed_page_setup);
155         self
156     }
157 
export_filename(mut self, export_filename: &str) -> Self158     pub fn export_filename(mut self, export_filename: &str) -> Self {
159         self.export_filename = Some(export_filename.to_string());
160         self
161     }
162 
has_selection(mut self, has_selection: bool) -> Self163     pub fn has_selection(mut self, has_selection: bool) -> Self {
164         self.has_selection = Some(has_selection);
165         self
166     }
167 
job_name(mut self, job_name: &str) -> Self168     pub fn job_name(mut self, job_name: &str) -> Self {
169         self.job_name = Some(job_name.to_string());
170         self
171     }
172 
n_pages(mut self, n_pages: i32) -> Self173     pub fn n_pages(mut self, n_pages: i32) -> Self {
174         self.n_pages = Some(n_pages);
175         self
176     }
177 
print_settings(mut self, print_settings: &PrintSettings) -> Self178     pub fn print_settings(mut self, print_settings: &PrintSettings) -> Self {
179         self.print_settings = Some(print_settings.clone());
180         self
181     }
182 
show_progress(mut self, show_progress: bool) -> Self183     pub fn show_progress(mut self, show_progress: bool) -> Self {
184         self.show_progress = Some(show_progress);
185         self
186     }
187 
support_selection(mut self, support_selection: bool) -> Self188     pub fn support_selection(mut self, support_selection: bool) -> Self {
189         self.support_selection = Some(support_selection);
190         self
191     }
192 
track_print_status(mut self, track_print_status: bool) -> Self193     pub fn track_print_status(mut self, track_print_status: bool) -> Self {
194         self.track_print_status = Some(track_print_status);
195         self
196     }
197 
unit(mut self, unit: Unit) -> Self198     pub fn unit(mut self, unit: Unit) -> Self {
199         self.unit = Some(unit);
200         self
201     }
202 
use_full_page(mut self, use_full_page: bool) -> Self203     pub fn use_full_page(mut self, use_full_page: bool) -> Self {
204         self.use_full_page = Some(use_full_page);
205         self
206     }
207 }
208 
209 pub const NONE_PRINT_OPERATION: Option<&PrintOperation> = None;
210 
211 pub trait PrintOperationExt: 'static {
cancel(&self)212     fn cancel(&self);
213 
draw_page_finish(&self)214     fn draw_page_finish(&self);
215 
get_default_page_setup(&self) -> Option<PageSetup>216     fn get_default_page_setup(&self) -> Option<PageSetup>;
217 
get_embed_page_setup(&self) -> bool218     fn get_embed_page_setup(&self) -> bool;
219 
get_error(&self) -> Result<(), glib::Error>220     fn get_error(&self) -> Result<(), glib::Error>;
221 
get_has_selection(&self) -> bool222     fn get_has_selection(&self) -> bool;
223 
get_n_pages_to_print(&self) -> i32224     fn get_n_pages_to_print(&self) -> i32;
225 
get_print_settings(&self) -> Option<PrintSettings>226     fn get_print_settings(&self) -> Option<PrintSettings>;
227 
get_status(&self) -> PrintStatus228     fn get_status(&self) -> PrintStatus;
229 
get_status_string(&self) -> Option<GString>230     fn get_status_string(&self) -> Option<GString>;
231 
get_support_selection(&self) -> bool232     fn get_support_selection(&self) -> bool;
233 
is_finished(&self) -> bool234     fn is_finished(&self) -> bool;
235 
run<P: IsA<Window>>( &self, action: PrintOperationAction, parent: Option<&P>, ) -> Result<PrintOperationResult, glib::Error>236     fn run<P: IsA<Window>>(
237         &self,
238         action: PrintOperationAction,
239         parent: Option<&P>,
240     ) -> Result<PrintOperationResult, glib::Error>;
241 
set_allow_async(&self, allow_async: bool)242     fn set_allow_async(&self, allow_async: bool);
243 
set_current_page(&self, current_page: i32)244     fn set_current_page(&self, current_page: i32);
245 
set_custom_tab_label(&self, label: Option<&str>)246     fn set_custom_tab_label(&self, label: Option<&str>);
247 
set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)248     fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>);
249 
set_defer_drawing(&self)250     fn set_defer_drawing(&self);
251 
set_embed_page_setup(&self, embed: bool)252     fn set_embed_page_setup(&self, embed: bool);
253 
set_export_filename<P: AsRef<std::path::Path>>(&self, filename: P)254     fn set_export_filename<P: AsRef<std::path::Path>>(&self, filename: P);
255 
set_has_selection(&self, has_selection: bool)256     fn set_has_selection(&self, has_selection: bool);
257 
set_job_name(&self, job_name: &str)258     fn set_job_name(&self, job_name: &str);
259 
set_n_pages(&self, n_pages: i32)260     fn set_n_pages(&self, n_pages: i32);
261 
set_print_settings(&self, print_settings: Option<&PrintSettings>)262     fn set_print_settings(&self, print_settings: Option<&PrintSettings>);
263 
set_show_progress(&self, show_progress: bool)264     fn set_show_progress(&self, show_progress: bool);
265 
set_support_selection(&self, support_selection: bool)266     fn set_support_selection(&self, support_selection: bool);
267 
set_track_print_status(&self, track_status: bool)268     fn set_track_print_status(&self, track_status: bool);
269 
set_unit(&self, unit: Unit)270     fn set_unit(&self, unit: Unit);
271 
set_use_full_page(&self, full_page: bool)272     fn set_use_full_page(&self, full_page: bool);
273 
get_property_allow_async(&self) -> bool274     fn get_property_allow_async(&self) -> bool;
275 
get_property_current_page(&self) -> i32276     fn get_property_current_page(&self) -> i32;
277 
get_property_custom_tab_label(&self) -> Option<GString>278     fn get_property_custom_tab_label(&self) -> Option<GString>;
279 
get_property_export_filename(&self) -> Option<GString>280     fn get_property_export_filename(&self) -> Option<GString>;
281 
get_property_job_name(&self) -> Option<GString>282     fn get_property_job_name(&self) -> Option<GString>;
283 
get_property_n_pages(&self) -> i32284     fn get_property_n_pages(&self) -> i32;
285 
get_property_show_progress(&self) -> bool286     fn get_property_show_progress(&self) -> bool;
287 
get_property_track_print_status(&self) -> bool288     fn get_property_track_print_status(&self) -> bool;
289 
get_property_unit(&self) -> Unit290     fn get_property_unit(&self) -> Unit;
291 
get_property_use_full_page(&self) -> bool292     fn get_property_use_full_page(&self) -> bool;
293 
connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId294     fn connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId;
295 
connect_create_custom_widget<F: Fn(&Self) -> glib::Object + 'static>( &self, f: F, ) -> SignalHandlerId296     fn connect_create_custom_widget<F: Fn(&Self) -> glib::Object + 'static>(
297         &self,
298         f: F,
299     ) -> SignalHandlerId;
300 
connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId301     fn connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>(&self, f: F)
302         -> SignalHandlerId;
303 
connect_done<F: Fn(&Self, PrintOperationResult) + 'static>(&self, f: F) -> SignalHandlerId304     fn connect_done<F: Fn(&Self, PrintOperationResult) + 'static>(&self, f: F) -> SignalHandlerId;
305 
connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>( &self, f: F, ) -> SignalHandlerId306     fn connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>(
307         &self,
308         f: F,
309     ) -> SignalHandlerId;
310 
connect_end_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId311     fn connect_end_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId;
312 
connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId313     fn connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>(
314         &self,
315         f: F,
316     ) -> SignalHandlerId;
317 
connect_preview< F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static, >( &self, f: F, ) -> SignalHandlerId318     fn connect_preview<
319         F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static,
320     >(
321         &self,
322         f: F,
323     ) -> SignalHandlerId;
324 
connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>( &self, f: F, ) -> SignalHandlerId325     fn connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>(
326         &self,
327         f: F,
328     ) -> SignalHandlerId;
329 
connect_status_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId330     fn connect_status_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
331 
connect_update_custom_widget<F: Fn(&Self, &Widget, &PageSetup, &PrintSettings) + 'static>( &self, f: F, ) -> SignalHandlerId332     fn connect_update_custom_widget<F: Fn(&Self, &Widget, &PageSetup, &PrintSettings) + 'static>(
333         &self,
334         f: F,
335     ) -> SignalHandlerId;
336 
connect_property_allow_async_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId337     fn connect_property_allow_async_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
338 
connect_property_current_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId339     fn connect_property_current_page_notify<F: Fn(&Self) + 'static>(&self, f: F)
340         -> SignalHandlerId;
341 
connect_property_custom_tab_label_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId342     fn connect_property_custom_tab_label_notify<F: Fn(&Self) + 'static>(
343         &self,
344         f: F,
345     ) -> SignalHandlerId;
346 
connect_property_default_page_setup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId347     fn connect_property_default_page_setup_notify<F: Fn(&Self) + 'static>(
348         &self,
349         f: F,
350     ) -> SignalHandlerId;
351 
connect_property_embed_page_setup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId352     fn connect_property_embed_page_setup_notify<F: Fn(&Self) + 'static>(
353         &self,
354         f: F,
355     ) -> SignalHandlerId;
356 
connect_property_export_filename_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId357     fn connect_property_export_filename_notify<F: Fn(&Self) + 'static>(
358         &self,
359         f: F,
360     ) -> SignalHandlerId;
361 
connect_property_has_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId362     fn connect_property_has_selection_notify<F: Fn(&Self) + 'static>(
363         &self,
364         f: F,
365     ) -> SignalHandlerId;
366 
connect_property_job_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId367     fn connect_property_job_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
368 
connect_property_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId369     fn connect_property_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
370 
connect_property_n_pages_to_print_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId371     fn connect_property_n_pages_to_print_notify<F: Fn(&Self) + 'static>(
372         &self,
373         f: F,
374     ) -> SignalHandlerId;
375 
connect_property_print_settings_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId376     fn connect_property_print_settings_notify<F: Fn(&Self) + 'static>(
377         &self,
378         f: F,
379     ) -> SignalHandlerId;
380 
connect_property_show_progress_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId381     fn connect_property_show_progress_notify<F: Fn(&Self) + 'static>(
382         &self,
383         f: F,
384     ) -> SignalHandlerId;
385 
connect_property_status_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId386     fn connect_property_status_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
387 
connect_property_status_string_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId388     fn connect_property_status_string_notify<F: Fn(&Self) + 'static>(
389         &self,
390         f: F,
391     ) -> SignalHandlerId;
392 
connect_property_support_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId393     fn connect_property_support_selection_notify<F: Fn(&Self) + 'static>(
394         &self,
395         f: F,
396     ) -> SignalHandlerId;
397 
connect_property_track_print_status_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId398     fn connect_property_track_print_status_notify<F: Fn(&Self) + 'static>(
399         &self,
400         f: F,
401     ) -> SignalHandlerId;
402 
connect_property_unit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId403     fn connect_property_unit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
404 
connect_property_use_full_page_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId405     fn connect_property_use_full_page_notify<F: Fn(&Self) + 'static>(
406         &self,
407         f: F,
408     ) -> SignalHandlerId;
409 }
410 
411 impl<O: IsA<PrintOperation>> PrintOperationExt for O {
cancel(&self)412     fn cancel(&self) {
413         unsafe {
414             gtk_sys::gtk_print_operation_cancel(self.as_ref().to_glib_none().0);
415         }
416     }
417 
draw_page_finish(&self)418     fn draw_page_finish(&self) {
419         unsafe {
420             gtk_sys::gtk_print_operation_draw_page_finish(self.as_ref().to_glib_none().0);
421         }
422     }
423 
get_default_page_setup(&self) -> Option<PageSetup>424     fn get_default_page_setup(&self) -> Option<PageSetup> {
425         unsafe {
426             from_glib_none(gtk_sys::gtk_print_operation_get_default_page_setup(
427                 self.as_ref().to_glib_none().0,
428             ))
429         }
430     }
431 
get_embed_page_setup(&self) -> bool432     fn get_embed_page_setup(&self) -> bool {
433         unsafe {
434             from_glib(gtk_sys::gtk_print_operation_get_embed_page_setup(
435                 self.as_ref().to_glib_none().0,
436             ))
437         }
438     }
439 
get_error(&self) -> Result<(), glib::Error>440     fn get_error(&self) -> Result<(), glib::Error> {
441         unsafe {
442             let mut error = ptr::null_mut();
443             let _ =
444                 gtk_sys::gtk_print_operation_get_error(self.as_ref().to_glib_none().0, &mut error);
445             if error.is_null() {
446                 Ok(())
447             } else {
448                 Err(from_glib_full(error))
449             }
450         }
451     }
452 
get_has_selection(&self) -> bool453     fn get_has_selection(&self) -> bool {
454         unsafe {
455             from_glib(gtk_sys::gtk_print_operation_get_has_selection(
456                 self.as_ref().to_glib_none().0,
457             ))
458         }
459     }
460 
get_n_pages_to_print(&self) -> i32461     fn get_n_pages_to_print(&self) -> i32 {
462         unsafe { gtk_sys::gtk_print_operation_get_n_pages_to_print(self.as_ref().to_glib_none().0) }
463     }
464 
get_print_settings(&self) -> Option<PrintSettings>465     fn get_print_settings(&self) -> Option<PrintSettings> {
466         unsafe {
467             from_glib_none(gtk_sys::gtk_print_operation_get_print_settings(
468                 self.as_ref().to_glib_none().0,
469             ))
470         }
471     }
472 
get_status(&self) -> PrintStatus473     fn get_status(&self) -> PrintStatus {
474         unsafe {
475             from_glib(gtk_sys::gtk_print_operation_get_status(
476                 self.as_ref().to_glib_none().0,
477             ))
478         }
479     }
480 
get_status_string(&self) -> Option<GString>481     fn get_status_string(&self) -> Option<GString> {
482         unsafe {
483             from_glib_none(gtk_sys::gtk_print_operation_get_status_string(
484                 self.as_ref().to_glib_none().0,
485             ))
486         }
487     }
488 
get_support_selection(&self) -> bool489     fn get_support_selection(&self) -> bool {
490         unsafe {
491             from_glib(gtk_sys::gtk_print_operation_get_support_selection(
492                 self.as_ref().to_glib_none().0,
493             ))
494         }
495     }
496 
is_finished(&self) -> bool497     fn is_finished(&self) -> bool {
498         unsafe {
499             from_glib(gtk_sys::gtk_print_operation_is_finished(
500                 self.as_ref().to_glib_none().0,
501             ))
502         }
503     }
504 
run<P: IsA<Window>>( &self, action: PrintOperationAction, parent: Option<&P>, ) -> Result<PrintOperationResult, glib::Error>505     fn run<P: IsA<Window>>(
506         &self,
507         action: PrintOperationAction,
508         parent: Option<&P>,
509     ) -> Result<PrintOperationResult, glib::Error> {
510         unsafe {
511             let mut error = ptr::null_mut();
512             let ret = gtk_sys::gtk_print_operation_run(
513                 self.as_ref().to_glib_none().0,
514                 action.to_glib(),
515                 parent.map(|p| p.as_ref()).to_glib_none().0,
516                 &mut error,
517             );
518             if error.is_null() {
519                 Ok(from_glib(ret))
520             } else {
521                 Err(from_glib_full(error))
522             }
523         }
524     }
525 
set_allow_async(&self, allow_async: bool)526     fn set_allow_async(&self, allow_async: bool) {
527         unsafe {
528             gtk_sys::gtk_print_operation_set_allow_async(
529                 self.as_ref().to_glib_none().0,
530                 allow_async.to_glib(),
531             );
532         }
533     }
534 
set_current_page(&self, current_page: i32)535     fn set_current_page(&self, current_page: i32) {
536         unsafe {
537             gtk_sys::gtk_print_operation_set_current_page(
538                 self.as_ref().to_glib_none().0,
539                 current_page,
540             );
541         }
542     }
543 
set_custom_tab_label(&self, label: Option<&str>)544     fn set_custom_tab_label(&self, label: Option<&str>) {
545         unsafe {
546             gtk_sys::gtk_print_operation_set_custom_tab_label(
547                 self.as_ref().to_glib_none().0,
548                 label.to_glib_none().0,
549             );
550         }
551     }
552 
set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)553     fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>) {
554         unsafe {
555             gtk_sys::gtk_print_operation_set_default_page_setup(
556                 self.as_ref().to_glib_none().0,
557                 default_page_setup.to_glib_none().0,
558             );
559         }
560     }
561 
set_defer_drawing(&self)562     fn set_defer_drawing(&self) {
563         unsafe {
564             gtk_sys::gtk_print_operation_set_defer_drawing(self.as_ref().to_glib_none().0);
565         }
566     }
567 
set_embed_page_setup(&self, embed: bool)568     fn set_embed_page_setup(&self, embed: bool) {
569         unsafe {
570             gtk_sys::gtk_print_operation_set_embed_page_setup(
571                 self.as_ref().to_glib_none().0,
572                 embed.to_glib(),
573             );
574         }
575     }
576 
set_export_filename<P: AsRef<std::path::Path>>(&self, filename: P)577     fn set_export_filename<P: AsRef<std::path::Path>>(&self, filename: P) {
578         unsafe {
579             gtk_sys::gtk_print_operation_set_export_filename(
580                 self.as_ref().to_glib_none().0,
581                 filename.as_ref().to_glib_none().0,
582             );
583         }
584     }
585 
set_has_selection(&self, has_selection: bool)586     fn set_has_selection(&self, has_selection: bool) {
587         unsafe {
588             gtk_sys::gtk_print_operation_set_has_selection(
589                 self.as_ref().to_glib_none().0,
590                 has_selection.to_glib(),
591             );
592         }
593     }
594 
set_job_name(&self, job_name: &str)595     fn set_job_name(&self, job_name: &str) {
596         unsafe {
597             gtk_sys::gtk_print_operation_set_job_name(
598                 self.as_ref().to_glib_none().0,
599                 job_name.to_glib_none().0,
600             );
601         }
602     }
603 
set_n_pages(&self, n_pages: i32)604     fn set_n_pages(&self, n_pages: i32) {
605         unsafe {
606             gtk_sys::gtk_print_operation_set_n_pages(self.as_ref().to_glib_none().0, n_pages);
607         }
608     }
609 
set_print_settings(&self, print_settings: Option<&PrintSettings>)610     fn set_print_settings(&self, print_settings: Option<&PrintSettings>) {
611         unsafe {
612             gtk_sys::gtk_print_operation_set_print_settings(
613                 self.as_ref().to_glib_none().0,
614                 print_settings.to_glib_none().0,
615             );
616         }
617     }
618 
set_show_progress(&self, show_progress: bool)619     fn set_show_progress(&self, show_progress: bool) {
620         unsafe {
621             gtk_sys::gtk_print_operation_set_show_progress(
622                 self.as_ref().to_glib_none().0,
623                 show_progress.to_glib(),
624             );
625         }
626     }
627 
set_support_selection(&self, support_selection: bool)628     fn set_support_selection(&self, support_selection: bool) {
629         unsafe {
630             gtk_sys::gtk_print_operation_set_support_selection(
631                 self.as_ref().to_glib_none().0,
632                 support_selection.to_glib(),
633             );
634         }
635     }
636 
set_track_print_status(&self, track_status: bool)637     fn set_track_print_status(&self, track_status: bool) {
638         unsafe {
639             gtk_sys::gtk_print_operation_set_track_print_status(
640                 self.as_ref().to_glib_none().0,
641                 track_status.to_glib(),
642             );
643         }
644     }
645 
set_unit(&self, unit: Unit)646     fn set_unit(&self, unit: Unit) {
647         unsafe {
648             gtk_sys::gtk_print_operation_set_unit(self.as_ref().to_glib_none().0, unit.to_glib());
649         }
650     }
651 
set_use_full_page(&self, full_page: bool)652     fn set_use_full_page(&self, full_page: bool) {
653         unsafe {
654             gtk_sys::gtk_print_operation_set_use_full_page(
655                 self.as_ref().to_glib_none().0,
656                 full_page.to_glib(),
657             );
658         }
659     }
660 
get_property_allow_async(&self) -> bool661     fn get_property_allow_async(&self) -> bool {
662         unsafe {
663             let mut value = Value::from_type(<bool as StaticType>::static_type());
664             gobject_sys::g_object_get_property(
665                 self.to_glib_none().0 as *mut gobject_sys::GObject,
666                 b"allow-async\0".as_ptr() as *const _,
667                 value.to_glib_none_mut().0,
668             );
669             value
670                 .get()
671                 .expect("Return Value for property `allow-async` getter")
672                 .unwrap()
673         }
674     }
675 
get_property_current_page(&self) -> i32676     fn get_property_current_page(&self) -> i32 {
677         unsafe {
678             let mut value = Value::from_type(<i32 as StaticType>::static_type());
679             gobject_sys::g_object_get_property(
680                 self.to_glib_none().0 as *mut gobject_sys::GObject,
681                 b"current-page\0".as_ptr() as *const _,
682                 value.to_glib_none_mut().0,
683             );
684             value
685                 .get()
686                 .expect("Return Value for property `current-page` getter")
687                 .unwrap()
688         }
689     }
690 
get_property_custom_tab_label(&self) -> Option<GString>691     fn get_property_custom_tab_label(&self) -> Option<GString> {
692         unsafe {
693             let mut value = Value::from_type(<GString as StaticType>::static_type());
694             gobject_sys::g_object_get_property(
695                 self.to_glib_none().0 as *mut gobject_sys::GObject,
696                 b"custom-tab-label\0".as_ptr() as *const _,
697                 value.to_glib_none_mut().0,
698             );
699             value
700                 .get()
701                 .expect("Return Value for property `custom-tab-label` getter")
702         }
703     }
704 
get_property_export_filename(&self) -> Option<GString>705     fn get_property_export_filename(&self) -> Option<GString> {
706         unsafe {
707             let mut value = Value::from_type(<GString as StaticType>::static_type());
708             gobject_sys::g_object_get_property(
709                 self.to_glib_none().0 as *mut gobject_sys::GObject,
710                 b"export-filename\0".as_ptr() as *const _,
711                 value.to_glib_none_mut().0,
712             );
713             value
714                 .get()
715                 .expect("Return Value for property `export-filename` getter")
716         }
717     }
718 
get_property_job_name(&self) -> Option<GString>719     fn get_property_job_name(&self) -> Option<GString> {
720         unsafe {
721             let mut value = Value::from_type(<GString as StaticType>::static_type());
722             gobject_sys::g_object_get_property(
723                 self.to_glib_none().0 as *mut gobject_sys::GObject,
724                 b"job-name\0".as_ptr() as *const _,
725                 value.to_glib_none_mut().0,
726             );
727             value
728                 .get()
729                 .expect("Return Value for property `job-name` getter")
730         }
731     }
732 
get_property_n_pages(&self) -> i32733     fn get_property_n_pages(&self) -> i32 {
734         unsafe {
735             let mut value = Value::from_type(<i32 as StaticType>::static_type());
736             gobject_sys::g_object_get_property(
737                 self.to_glib_none().0 as *mut gobject_sys::GObject,
738                 b"n-pages\0".as_ptr() as *const _,
739                 value.to_glib_none_mut().0,
740             );
741             value
742                 .get()
743                 .expect("Return Value for property `n-pages` getter")
744                 .unwrap()
745         }
746     }
747 
get_property_show_progress(&self) -> bool748     fn get_property_show_progress(&self) -> bool {
749         unsafe {
750             let mut value = Value::from_type(<bool as StaticType>::static_type());
751             gobject_sys::g_object_get_property(
752                 self.to_glib_none().0 as *mut gobject_sys::GObject,
753                 b"show-progress\0".as_ptr() as *const _,
754                 value.to_glib_none_mut().0,
755             );
756             value
757                 .get()
758                 .expect("Return Value for property `show-progress` getter")
759                 .unwrap()
760         }
761     }
762 
get_property_track_print_status(&self) -> bool763     fn get_property_track_print_status(&self) -> bool {
764         unsafe {
765             let mut value = Value::from_type(<bool as StaticType>::static_type());
766             gobject_sys::g_object_get_property(
767                 self.to_glib_none().0 as *mut gobject_sys::GObject,
768                 b"track-print-status\0".as_ptr() as *const _,
769                 value.to_glib_none_mut().0,
770             );
771             value
772                 .get()
773                 .expect("Return Value for property `track-print-status` getter")
774                 .unwrap()
775         }
776     }
777 
get_property_unit(&self) -> Unit778     fn get_property_unit(&self) -> Unit {
779         unsafe {
780             let mut value = Value::from_type(<Unit as StaticType>::static_type());
781             gobject_sys::g_object_get_property(
782                 self.to_glib_none().0 as *mut gobject_sys::GObject,
783                 b"unit\0".as_ptr() as *const _,
784                 value.to_glib_none_mut().0,
785             );
786             value
787                 .get()
788                 .expect("Return Value for property `unit` getter")
789                 .unwrap()
790         }
791     }
792 
get_property_use_full_page(&self) -> bool793     fn get_property_use_full_page(&self) -> bool {
794         unsafe {
795             let mut value = Value::from_type(<bool as StaticType>::static_type());
796             gobject_sys::g_object_get_property(
797                 self.to_glib_none().0 as *mut gobject_sys::GObject,
798                 b"use-full-page\0".as_ptr() as *const _,
799                 value.to_glib_none_mut().0,
800             );
801             value
802                 .get()
803                 .expect("Return Value for property `use-full-page` getter")
804                 .unwrap()
805         }
806     }
807 
connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId808     fn connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId {
809         unsafe extern "C" fn begin_print_trampoline<P, F: Fn(&P, &PrintContext) + 'static>(
810             this: *mut gtk_sys::GtkPrintOperation,
811             context: *mut gtk_sys::GtkPrintContext,
812             f: glib_sys::gpointer,
813         ) where
814             P: IsA<PrintOperation>,
815         {
816             let f: &F = &*(f as *const F);
817             f(
818                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
819                 &from_glib_borrow(context),
820             )
821         }
822         unsafe {
823             let f: Box_<F> = Box_::new(f);
824             connect_raw(
825                 self.as_ptr() as *mut _,
826                 b"begin-print\0".as_ptr() as *const _,
827                 Some(transmute(begin_print_trampoline::<Self, F> as usize)),
828                 Box_::into_raw(f),
829             )
830         }
831     }
832 
connect_create_custom_widget<F: Fn(&Self) -> glib::Object + 'static>( &self, f: F, ) -> SignalHandlerId833     fn connect_create_custom_widget<F: Fn(&Self) -> glib::Object + 'static>(
834         &self,
835         f: F,
836     ) -> SignalHandlerId {
837         unsafe extern "C" fn create_custom_widget_trampoline<
838             P,
839             F: Fn(&P) -> glib::Object + 'static,
840         >(
841             this: *mut gtk_sys::GtkPrintOperation,
842             f: glib_sys::gpointer,
843         ) -> *mut gobject_sys::GObject
844         where
845             P: IsA<PrintOperation>,
846         {
847             let f: &F = &*(f as *const F);
848             f(&PrintOperation::from_glib_borrow(this).unsafe_cast()) /*Not checked*/
849                 .to_glib_none()
850                 .0
851         }
852         unsafe {
853             let f: Box_<F> = Box_::new(f);
854             connect_raw(
855                 self.as_ptr() as *mut _,
856                 b"create-custom-widget\0".as_ptr() as *const _,
857                 Some(transmute(
858                     create_custom_widget_trampoline::<Self, F> as usize,
859                 )),
860                 Box_::into_raw(f),
861             )
862         }
863     }
864 
connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>( &self, f: F, ) -> SignalHandlerId865     fn connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>(
866         &self,
867         f: F,
868     ) -> SignalHandlerId {
869         unsafe extern "C" fn custom_widget_apply_trampoline<P, F: Fn(&P, &Widget) + 'static>(
870             this: *mut gtk_sys::GtkPrintOperation,
871             widget: *mut gtk_sys::GtkWidget,
872             f: glib_sys::gpointer,
873         ) where
874             P: IsA<PrintOperation>,
875         {
876             let f: &F = &*(f as *const F);
877             f(
878                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
879                 &from_glib_borrow(widget),
880             )
881         }
882         unsafe {
883             let f: Box_<F> = Box_::new(f);
884             connect_raw(
885                 self.as_ptr() as *mut _,
886                 b"custom-widget-apply\0".as_ptr() as *const _,
887                 Some(transmute(
888                     custom_widget_apply_trampoline::<Self, F> as usize,
889                 )),
890                 Box_::into_raw(f),
891             )
892         }
893     }
894 
connect_done<F: Fn(&Self, PrintOperationResult) + 'static>(&self, f: F) -> SignalHandlerId895     fn connect_done<F: Fn(&Self, PrintOperationResult) + 'static>(&self, f: F) -> SignalHandlerId {
896         unsafe extern "C" fn done_trampoline<P, F: Fn(&P, PrintOperationResult) + 'static>(
897             this: *mut gtk_sys::GtkPrintOperation,
898             result: gtk_sys::GtkPrintOperationResult,
899             f: glib_sys::gpointer,
900         ) where
901             P: IsA<PrintOperation>,
902         {
903             let f: &F = &*(f as *const F);
904             f(
905                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
906                 from_glib(result),
907             )
908         }
909         unsafe {
910             let f: Box_<F> = Box_::new(f);
911             connect_raw(
912                 self.as_ptr() as *mut _,
913                 b"done\0".as_ptr() as *const _,
914                 Some(transmute(done_trampoline::<Self, F> as usize)),
915                 Box_::into_raw(f),
916             )
917         }
918     }
919 
connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>( &self, f: F, ) -> SignalHandlerId920     fn connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>(
921         &self,
922         f: F,
923     ) -> SignalHandlerId {
924         unsafe extern "C" fn draw_page_trampoline<P, F: Fn(&P, &PrintContext, i32) + 'static>(
925             this: *mut gtk_sys::GtkPrintOperation,
926             context: *mut gtk_sys::GtkPrintContext,
927             page_nr: libc::c_int,
928             f: glib_sys::gpointer,
929         ) where
930             P: IsA<PrintOperation>,
931         {
932             let f: &F = &*(f as *const F);
933             f(
934                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
935                 &from_glib_borrow(context),
936                 page_nr,
937             )
938         }
939         unsafe {
940             let f: Box_<F> = Box_::new(f);
941             connect_raw(
942                 self.as_ptr() as *mut _,
943                 b"draw-page\0".as_ptr() as *const _,
944                 Some(transmute(draw_page_trampoline::<Self, F> as usize)),
945                 Box_::into_raw(f),
946             )
947         }
948     }
949 
connect_end_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId950     fn connect_end_print<F: Fn(&Self, &PrintContext) + 'static>(&self, f: F) -> SignalHandlerId {
951         unsafe extern "C" fn end_print_trampoline<P, F: Fn(&P, &PrintContext) + 'static>(
952             this: *mut gtk_sys::GtkPrintOperation,
953             context: *mut gtk_sys::GtkPrintContext,
954             f: glib_sys::gpointer,
955         ) where
956             P: IsA<PrintOperation>,
957         {
958             let f: &F = &*(f as *const F);
959             f(
960                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
961                 &from_glib_borrow(context),
962             )
963         }
964         unsafe {
965             let f: Box_<F> = Box_::new(f);
966             connect_raw(
967                 self.as_ptr() as *mut _,
968                 b"end-print\0".as_ptr() as *const _,
969                 Some(transmute(end_print_trampoline::<Self, F> as usize)),
970                 Box_::into_raw(f),
971             )
972         }
973     }
974 
connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId975     fn connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>(
976         &self,
977         f: F,
978     ) -> SignalHandlerId {
979         unsafe extern "C" fn paginate_trampoline<P, F: Fn(&P, &PrintContext) -> bool + 'static>(
980             this: *mut gtk_sys::GtkPrintOperation,
981             context: *mut gtk_sys::GtkPrintContext,
982             f: glib_sys::gpointer,
983         ) -> glib_sys::gboolean
984         where
985             P: IsA<PrintOperation>,
986         {
987             let f: &F = &*(f as *const F);
988             f(
989                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
990                 &from_glib_borrow(context),
991             )
992             .to_glib()
993         }
994         unsafe {
995             let f: Box_<F> = Box_::new(f);
996             connect_raw(
997                 self.as_ptr() as *mut _,
998                 b"paginate\0".as_ptr() as *const _,
999                 Some(transmute(paginate_trampoline::<Self, F> as usize)),
1000                 Box_::into_raw(f),
1001             )
1002         }
1003     }
1004 
connect_preview< F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static, >( &self, f: F, ) -> SignalHandlerId1005     fn connect_preview<
1006         F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static,
1007     >(
1008         &self,
1009         f: F,
1010     ) -> SignalHandlerId {
1011         unsafe extern "C" fn preview_trampoline<
1012             P,
1013             F: Fn(&P, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static,
1014         >(
1015             this: *mut gtk_sys::GtkPrintOperation,
1016             preview: *mut gtk_sys::GtkPrintOperationPreview,
1017             context: *mut gtk_sys::GtkPrintContext,
1018             parent: *mut gtk_sys::GtkWindow,
1019             f: glib_sys::gpointer,
1020         ) -> glib_sys::gboolean
1021         where
1022             P: IsA<PrintOperation>,
1023         {
1024             let f: &F = &*(f as *const F);
1025             f(
1026                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
1027                 &from_glib_borrow(preview),
1028                 &from_glib_borrow(context),
1029                 Option::<Window>::from_glib_borrow(parent).as_ref(),
1030             )
1031             .to_glib()
1032         }
1033         unsafe {
1034             let f: Box_<F> = Box_::new(f);
1035             connect_raw(
1036                 self.as_ptr() as *mut _,
1037                 b"preview\0".as_ptr() as *const _,
1038                 Some(transmute(preview_trampoline::<Self, F> as usize)),
1039                 Box_::into_raw(f),
1040             )
1041         }
1042     }
1043 
connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>( &self, f: F, ) -> SignalHandlerId1044     fn connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>(
1045         &self,
1046         f: F,
1047     ) -> SignalHandlerId {
1048         unsafe extern "C" fn request_page_setup_trampoline<
1049             P,
1050             F: Fn(&P, &PrintContext, i32, &PageSetup) + 'static,
1051         >(
1052             this: *mut gtk_sys::GtkPrintOperation,
1053             context: *mut gtk_sys::GtkPrintContext,
1054             page_nr: libc::c_int,
1055             setup: *mut gtk_sys::GtkPageSetup,
1056             f: glib_sys::gpointer,
1057         ) where
1058             P: IsA<PrintOperation>,
1059         {
1060             let f: &F = &*(f as *const F);
1061             f(
1062                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
1063                 &from_glib_borrow(context),
1064                 page_nr,
1065                 &from_glib_borrow(setup),
1066             )
1067         }
1068         unsafe {
1069             let f: Box_<F> = Box_::new(f);
1070             connect_raw(
1071                 self.as_ptr() as *mut _,
1072                 b"request-page-setup\0".as_ptr() as *const _,
1073                 Some(transmute(request_page_setup_trampoline::<Self, F> as usize)),
1074                 Box_::into_raw(f),
1075             )
1076         }
1077     }
1078 
connect_status_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1079     fn connect_status_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1080         unsafe extern "C" fn status_changed_trampoline<P, F: Fn(&P) + 'static>(
1081             this: *mut gtk_sys::GtkPrintOperation,
1082             f: glib_sys::gpointer,
1083         ) where
1084             P: IsA<PrintOperation>,
1085         {
1086             let f: &F = &*(f as *const F);
1087             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1088         }
1089         unsafe {
1090             let f: Box_<F> = Box_::new(f);
1091             connect_raw(
1092                 self.as_ptr() as *mut _,
1093                 b"status-changed\0".as_ptr() as *const _,
1094                 Some(transmute(status_changed_trampoline::<Self, F> as usize)),
1095                 Box_::into_raw(f),
1096             )
1097         }
1098     }
1099 
connect_update_custom_widget<F: Fn(&Self, &Widget, &PageSetup, &PrintSettings) + 'static>( &self, f: F, ) -> SignalHandlerId1100     fn connect_update_custom_widget<F: Fn(&Self, &Widget, &PageSetup, &PrintSettings) + 'static>(
1101         &self,
1102         f: F,
1103     ) -> SignalHandlerId {
1104         unsafe extern "C" fn update_custom_widget_trampoline<
1105             P,
1106             F: Fn(&P, &Widget, &PageSetup, &PrintSettings) + 'static,
1107         >(
1108             this: *mut gtk_sys::GtkPrintOperation,
1109             widget: *mut gtk_sys::GtkWidget,
1110             setup: *mut gtk_sys::GtkPageSetup,
1111             settings: *mut gtk_sys::GtkPrintSettings,
1112             f: glib_sys::gpointer,
1113         ) where
1114             P: IsA<PrintOperation>,
1115         {
1116             let f: &F = &*(f as *const F);
1117             f(
1118                 &PrintOperation::from_glib_borrow(this).unsafe_cast(),
1119                 &from_glib_borrow(widget),
1120                 &from_glib_borrow(setup),
1121                 &from_glib_borrow(settings),
1122             )
1123         }
1124         unsafe {
1125             let f: Box_<F> = Box_::new(f);
1126             connect_raw(
1127                 self.as_ptr() as *mut _,
1128                 b"update-custom-widget\0".as_ptr() as *const _,
1129                 Some(transmute(
1130                     update_custom_widget_trampoline::<Self, F> as usize,
1131                 )),
1132                 Box_::into_raw(f),
1133             )
1134         }
1135     }
1136 
connect_property_allow_async_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1137     fn connect_property_allow_async_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1138         unsafe extern "C" fn notify_allow_async_trampoline<P, F: Fn(&P) + 'static>(
1139             this: *mut gtk_sys::GtkPrintOperation,
1140             _param_spec: glib_sys::gpointer,
1141             f: glib_sys::gpointer,
1142         ) where
1143             P: IsA<PrintOperation>,
1144         {
1145             let f: &F = &*(f as *const F);
1146             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1147         }
1148         unsafe {
1149             let f: Box_<F> = Box_::new(f);
1150             connect_raw(
1151                 self.as_ptr() as *mut _,
1152                 b"notify::allow-async\0".as_ptr() as *const _,
1153                 Some(transmute(notify_allow_async_trampoline::<Self, F> as usize)),
1154                 Box_::into_raw(f),
1155             )
1156         }
1157     }
1158 
connect_property_current_page_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1159     fn connect_property_current_page_notify<F: Fn(&Self) + 'static>(
1160         &self,
1161         f: F,
1162     ) -> SignalHandlerId {
1163         unsafe extern "C" fn notify_current_page_trampoline<P, F: Fn(&P) + 'static>(
1164             this: *mut gtk_sys::GtkPrintOperation,
1165             _param_spec: glib_sys::gpointer,
1166             f: glib_sys::gpointer,
1167         ) where
1168             P: IsA<PrintOperation>,
1169         {
1170             let f: &F = &*(f as *const F);
1171             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1172         }
1173         unsafe {
1174             let f: Box_<F> = Box_::new(f);
1175             connect_raw(
1176                 self.as_ptr() as *mut _,
1177                 b"notify::current-page\0".as_ptr() as *const _,
1178                 Some(transmute(
1179                     notify_current_page_trampoline::<Self, F> as usize,
1180                 )),
1181                 Box_::into_raw(f),
1182             )
1183         }
1184     }
1185 
connect_property_custom_tab_label_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1186     fn connect_property_custom_tab_label_notify<F: Fn(&Self) + 'static>(
1187         &self,
1188         f: F,
1189     ) -> SignalHandlerId {
1190         unsafe extern "C" fn notify_custom_tab_label_trampoline<P, F: Fn(&P) + 'static>(
1191             this: *mut gtk_sys::GtkPrintOperation,
1192             _param_spec: glib_sys::gpointer,
1193             f: glib_sys::gpointer,
1194         ) where
1195             P: IsA<PrintOperation>,
1196         {
1197             let f: &F = &*(f as *const F);
1198             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1199         }
1200         unsafe {
1201             let f: Box_<F> = Box_::new(f);
1202             connect_raw(
1203                 self.as_ptr() as *mut _,
1204                 b"notify::custom-tab-label\0".as_ptr() as *const _,
1205                 Some(transmute(
1206                     notify_custom_tab_label_trampoline::<Self, F> as usize,
1207                 )),
1208                 Box_::into_raw(f),
1209             )
1210         }
1211     }
1212 
connect_property_default_page_setup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1213     fn connect_property_default_page_setup_notify<F: Fn(&Self) + 'static>(
1214         &self,
1215         f: F,
1216     ) -> SignalHandlerId {
1217         unsafe extern "C" fn notify_default_page_setup_trampoline<P, F: Fn(&P) + 'static>(
1218             this: *mut gtk_sys::GtkPrintOperation,
1219             _param_spec: glib_sys::gpointer,
1220             f: glib_sys::gpointer,
1221         ) where
1222             P: IsA<PrintOperation>,
1223         {
1224             let f: &F = &*(f as *const F);
1225             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1226         }
1227         unsafe {
1228             let f: Box_<F> = Box_::new(f);
1229             connect_raw(
1230                 self.as_ptr() as *mut _,
1231                 b"notify::default-page-setup\0".as_ptr() as *const _,
1232                 Some(transmute(
1233                     notify_default_page_setup_trampoline::<Self, F> as usize,
1234                 )),
1235                 Box_::into_raw(f),
1236             )
1237         }
1238     }
1239 
connect_property_embed_page_setup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1240     fn connect_property_embed_page_setup_notify<F: Fn(&Self) + 'static>(
1241         &self,
1242         f: F,
1243     ) -> SignalHandlerId {
1244         unsafe extern "C" fn notify_embed_page_setup_trampoline<P, F: Fn(&P) + 'static>(
1245             this: *mut gtk_sys::GtkPrintOperation,
1246             _param_spec: glib_sys::gpointer,
1247             f: glib_sys::gpointer,
1248         ) where
1249             P: IsA<PrintOperation>,
1250         {
1251             let f: &F = &*(f as *const F);
1252             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1253         }
1254         unsafe {
1255             let f: Box_<F> = Box_::new(f);
1256             connect_raw(
1257                 self.as_ptr() as *mut _,
1258                 b"notify::embed-page-setup\0".as_ptr() as *const _,
1259                 Some(transmute(
1260                     notify_embed_page_setup_trampoline::<Self, F> as usize,
1261                 )),
1262                 Box_::into_raw(f),
1263             )
1264         }
1265     }
1266 
connect_property_export_filename_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1267     fn connect_property_export_filename_notify<F: Fn(&Self) + 'static>(
1268         &self,
1269         f: F,
1270     ) -> SignalHandlerId {
1271         unsafe extern "C" fn notify_export_filename_trampoline<P, F: Fn(&P) + 'static>(
1272             this: *mut gtk_sys::GtkPrintOperation,
1273             _param_spec: glib_sys::gpointer,
1274             f: glib_sys::gpointer,
1275         ) where
1276             P: IsA<PrintOperation>,
1277         {
1278             let f: &F = &*(f as *const F);
1279             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1280         }
1281         unsafe {
1282             let f: Box_<F> = Box_::new(f);
1283             connect_raw(
1284                 self.as_ptr() as *mut _,
1285                 b"notify::export-filename\0".as_ptr() as *const _,
1286                 Some(transmute(
1287                     notify_export_filename_trampoline::<Self, F> as usize,
1288                 )),
1289                 Box_::into_raw(f),
1290             )
1291         }
1292     }
1293 
connect_property_has_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1294     fn connect_property_has_selection_notify<F: Fn(&Self) + 'static>(
1295         &self,
1296         f: F,
1297     ) -> SignalHandlerId {
1298         unsafe extern "C" fn notify_has_selection_trampoline<P, F: Fn(&P) + 'static>(
1299             this: *mut gtk_sys::GtkPrintOperation,
1300             _param_spec: glib_sys::gpointer,
1301             f: glib_sys::gpointer,
1302         ) where
1303             P: IsA<PrintOperation>,
1304         {
1305             let f: &F = &*(f as *const F);
1306             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1307         }
1308         unsafe {
1309             let f: Box_<F> = Box_::new(f);
1310             connect_raw(
1311                 self.as_ptr() as *mut _,
1312                 b"notify::has-selection\0".as_ptr() as *const _,
1313                 Some(transmute(
1314                     notify_has_selection_trampoline::<Self, F> as usize,
1315                 )),
1316                 Box_::into_raw(f),
1317             )
1318         }
1319     }
1320 
connect_property_job_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1321     fn connect_property_job_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1322         unsafe extern "C" fn notify_job_name_trampoline<P, F: Fn(&P) + 'static>(
1323             this: *mut gtk_sys::GtkPrintOperation,
1324             _param_spec: glib_sys::gpointer,
1325             f: glib_sys::gpointer,
1326         ) where
1327             P: IsA<PrintOperation>,
1328         {
1329             let f: &F = &*(f as *const F);
1330             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1331         }
1332         unsafe {
1333             let f: Box_<F> = Box_::new(f);
1334             connect_raw(
1335                 self.as_ptr() as *mut _,
1336                 b"notify::job-name\0".as_ptr() as *const _,
1337                 Some(transmute(notify_job_name_trampoline::<Self, F> as usize)),
1338                 Box_::into_raw(f),
1339             )
1340         }
1341     }
1342 
connect_property_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1343     fn connect_property_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1344         unsafe extern "C" fn notify_n_pages_trampoline<P, F: Fn(&P) + 'static>(
1345             this: *mut gtk_sys::GtkPrintOperation,
1346             _param_spec: glib_sys::gpointer,
1347             f: glib_sys::gpointer,
1348         ) where
1349             P: IsA<PrintOperation>,
1350         {
1351             let f: &F = &*(f as *const F);
1352             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1353         }
1354         unsafe {
1355             let f: Box_<F> = Box_::new(f);
1356             connect_raw(
1357                 self.as_ptr() as *mut _,
1358                 b"notify::n-pages\0".as_ptr() as *const _,
1359                 Some(transmute(notify_n_pages_trampoline::<Self, F> as usize)),
1360                 Box_::into_raw(f),
1361             )
1362         }
1363     }
1364 
connect_property_n_pages_to_print_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1365     fn connect_property_n_pages_to_print_notify<F: Fn(&Self) + 'static>(
1366         &self,
1367         f: F,
1368     ) -> SignalHandlerId {
1369         unsafe extern "C" fn notify_n_pages_to_print_trampoline<P, F: Fn(&P) + 'static>(
1370             this: *mut gtk_sys::GtkPrintOperation,
1371             _param_spec: glib_sys::gpointer,
1372             f: glib_sys::gpointer,
1373         ) where
1374             P: IsA<PrintOperation>,
1375         {
1376             let f: &F = &*(f as *const F);
1377             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1378         }
1379         unsafe {
1380             let f: Box_<F> = Box_::new(f);
1381             connect_raw(
1382                 self.as_ptr() as *mut _,
1383                 b"notify::n-pages-to-print\0".as_ptr() as *const _,
1384                 Some(transmute(
1385                     notify_n_pages_to_print_trampoline::<Self, F> as usize,
1386                 )),
1387                 Box_::into_raw(f),
1388             )
1389         }
1390     }
1391 
connect_property_print_settings_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1392     fn connect_property_print_settings_notify<F: Fn(&Self) + 'static>(
1393         &self,
1394         f: F,
1395     ) -> SignalHandlerId {
1396         unsafe extern "C" fn notify_print_settings_trampoline<P, F: Fn(&P) + 'static>(
1397             this: *mut gtk_sys::GtkPrintOperation,
1398             _param_spec: glib_sys::gpointer,
1399             f: glib_sys::gpointer,
1400         ) where
1401             P: IsA<PrintOperation>,
1402         {
1403             let f: &F = &*(f as *const F);
1404             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1405         }
1406         unsafe {
1407             let f: Box_<F> = Box_::new(f);
1408             connect_raw(
1409                 self.as_ptr() as *mut _,
1410                 b"notify::print-settings\0".as_ptr() as *const _,
1411                 Some(transmute(
1412                     notify_print_settings_trampoline::<Self, F> as usize,
1413                 )),
1414                 Box_::into_raw(f),
1415             )
1416         }
1417     }
1418 
connect_property_show_progress_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1419     fn connect_property_show_progress_notify<F: Fn(&Self) + 'static>(
1420         &self,
1421         f: F,
1422     ) -> SignalHandlerId {
1423         unsafe extern "C" fn notify_show_progress_trampoline<P, F: Fn(&P) + 'static>(
1424             this: *mut gtk_sys::GtkPrintOperation,
1425             _param_spec: glib_sys::gpointer,
1426             f: glib_sys::gpointer,
1427         ) where
1428             P: IsA<PrintOperation>,
1429         {
1430             let f: &F = &*(f as *const F);
1431             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1432         }
1433         unsafe {
1434             let f: Box_<F> = Box_::new(f);
1435             connect_raw(
1436                 self.as_ptr() as *mut _,
1437                 b"notify::show-progress\0".as_ptr() as *const _,
1438                 Some(transmute(
1439                     notify_show_progress_trampoline::<Self, F> as usize,
1440                 )),
1441                 Box_::into_raw(f),
1442             )
1443         }
1444     }
1445 
connect_property_status_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1446     fn connect_property_status_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1447         unsafe extern "C" fn notify_status_trampoline<P, F: Fn(&P) + 'static>(
1448             this: *mut gtk_sys::GtkPrintOperation,
1449             _param_spec: glib_sys::gpointer,
1450             f: glib_sys::gpointer,
1451         ) where
1452             P: IsA<PrintOperation>,
1453         {
1454             let f: &F = &*(f as *const F);
1455             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1456         }
1457         unsafe {
1458             let f: Box_<F> = Box_::new(f);
1459             connect_raw(
1460                 self.as_ptr() as *mut _,
1461                 b"notify::status\0".as_ptr() as *const _,
1462                 Some(transmute(notify_status_trampoline::<Self, F> as usize)),
1463                 Box_::into_raw(f),
1464             )
1465         }
1466     }
1467 
connect_property_status_string_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1468     fn connect_property_status_string_notify<F: Fn(&Self) + 'static>(
1469         &self,
1470         f: F,
1471     ) -> SignalHandlerId {
1472         unsafe extern "C" fn notify_status_string_trampoline<P, F: Fn(&P) + 'static>(
1473             this: *mut gtk_sys::GtkPrintOperation,
1474             _param_spec: glib_sys::gpointer,
1475             f: glib_sys::gpointer,
1476         ) where
1477             P: IsA<PrintOperation>,
1478         {
1479             let f: &F = &*(f as *const F);
1480             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1481         }
1482         unsafe {
1483             let f: Box_<F> = Box_::new(f);
1484             connect_raw(
1485                 self.as_ptr() as *mut _,
1486                 b"notify::status-string\0".as_ptr() as *const _,
1487                 Some(transmute(
1488                     notify_status_string_trampoline::<Self, F> as usize,
1489                 )),
1490                 Box_::into_raw(f),
1491             )
1492         }
1493     }
1494 
connect_property_support_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1495     fn connect_property_support_selection_notify<F: Fn(&Self) + 'static>(
1496         &self,
1497         f: F,
1498     ) -> SignalHandlerId {
1499         unsafe extern "C" fn notify_support_selection_trampoline<P, F: Fn(&P) + 'static>(
1500             this: *mut gtk_sys::GtkPrintOperation,
1501             _param_spec: glib_sys::gpointer,
1502             f: glib_sys::gpointer,
1503         ) where
1504             P: IsA<PrintOperation>,
1505         {
1506             let f: &F = &*(f as *const F);
1507             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1508         }
1509         unsafe {
1510             let f: Box_<F> = Box_::new(f);
1511             connect_raw(
1512                 self.as_ptr() as *mut _,
1513                 b"notify::support-selection\0".as_ptr() as *const _,
1514                 Some(transmute(
1515                     notify_support_selection_trampoline::<Self, F> as usize,
1516                 )),
1517                 Box_::into_raw(f),
1518             )
1519         }
1520     }
1521 
connect_property_track_print_status_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1522     fn connect_property_track_print_status_notify<F: Fn(&Self) + 'static>(
1523         &self,
1524         f: F,
1525     ) -> SignalHandlerId {
1526         unsafe extern "C" fn notify_track_print_status_trampoline<P, F: Fn(&P) + 'static>(
1527             this: *mut gtk_sys::GtkPrintOperation,
1528             _param_spec: glib_sys::gpointer,
1529             f: glib_sys::gpointer,
1530         ) where
1531             P: IsA<PrintOperation>,
1532         {
1533             let f: &F = &*(f as *const F);
1534             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1535         }
1536         unsafe {
1537             let f: Box_<F> = Box_::new(f);
1538             connect_raw(
1539                 self.as_ptr() as *mut _,
1540                 b"notify::track-print-status\0".as_ptr() as *const _,
1541                 Some(transmute(
1542                     notify_track_print_status_trampoline::<Self, F> as usize,
1543                 )),
1544                 Box_::into_raw(f),
1545             )
1546         }
1547     }
1548 
connect_property_unit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1549     fn connect_property_unit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1550         unsafe extern "C" fn notify_unit_trampoline<P, F: Fn(&P) + 'static>(
1551             this: *mut gtk_sys::GtkPrintOperation,
1552             _param_spec: glib_sys::gpointer,
1553             f: glib_sys::gpointer,
1554         ) where
1555             P: IsA<PrintOperation>,
1556         {
1557             let f: &F = &*(f as *const F);
1558             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1559         }
1560         unsafe {
1561             let f: Box_<F> = Box_::new(f);
1562             connect_raw(
1563                 self.as_ptr() as *mut _,
1564                 b"notify::unit\0".as_ptr() as *const _,
1565                 Some(transmute(notify_unit_trampoline::<Self, F> as usize)),
1566                 Box_::into_raw(f),
1567             )
1568         }
1569     }
1570 
connect_property_use_full_page_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1571     fn connect_property_use_full_page_notify<F: Fn(&Self) + 'static>(
1572         &self,
1573         f: F,
1574     ) -> SignalHandlerId {
1575         unsafe extern "C" fn notify_use_full_page_trampoline<P, F: Fn(&P) + 'static>(
1576             this: *mut gtk_sys::GtkPrintOperation,
1577             _param_spec: glib_sys::gpointer,
1578             f: glib_sys::gpointer,
1579         ) where
1580             P: IsA<PrintOperation>,
1581         {
1582             let f: &F = &*(f as *const F);
1583             f(&PrintOperation::from_glib_borrow(this).unsafe_cast())
1584         }
1585         unsafe {
1586             let f: Box_<F> = Box_::new(f);
1587             connect_raw(
1588                 self.as_ptr() as *mut _,
1589                 b"notify::use-full-page\0".as_ptr() as *const _,
1590                 Some(transmute(
1591                     notify_use_full_page_trampoline::<Self, F> as usize,
1592                 )),
1593                 Box_::into_raw(f),
1594             )
1595         }
1596     }
1597 }
1598 
1599 impl fmt::Display for PrintOperation {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1600     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1601         write!(f, "PrintOperation")
1602     }
1603 }
1604