1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{Buffer, View};
use glib::{
    prelude::*,
    signal::{connect_raw, SignalHandlerId},
    translate::*,
};
use std::{boxed::Box as Box_, fmt, mem::transmute};

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `body-font-name`
    ///  Name of the font used for the text body.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. "Monospace 10"). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `buffer`
    ///  The GtkSourceBuffer object to print.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `footer-font-name`
    ///  Name of the font used to print page footer.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. "Monospace 10"). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `header-font-name`
    ///  Name of the font used to print page header.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. "Monospace 10"). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `highlight-syntax`
    ///  Whether to print the document with highlighted syntax.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-numbers-font-name`
    ///  Name of the font used to print line numbers on the left margin.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. "Monospace 10"). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `n-pages`
    ///  The number of pages in the document or `<code>`-1`</code>` if the
    /// document has not been completely paginated.
    ///
    /// Readable
    ///
    ///
    /// #### `print-footer`
    ///  Whether to print a footer in each page.
    ///
    /// Note that by default the footer format is unspecified, and if it is
    /// unspecified the footer will not be printed, regardless of the value of
    /// this property.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `print-header`
    ///  Whether to print a header in each page.
    ///
    /// Note that by default the header format is unspecified, and if it is
    /// unspecified the header will not be printed, regardless of the value of
    /// this property.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `print-line-numbers`
    ///  Interval of printed line numbers. If this property is set to 0 no
    /// numbers will be printed. If greater than 0, a number will be
    /// printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `tab-width`
    ///  Width of a tab character expressed in spaces.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `wrap-mode`
    ///  Whether to wrap lines never, at word boundaries, or at character boundaries.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    ///
    /// Readable | Writeable
    ///
    /// # Implements
    ///
    /// [`PrintCompositorExt`][trait@crate::prelude::PrintCompositorExt]
    #[doc(alias = "GtkSourcePrintCompositor")]
    pub struct PrintCompositor(Object<ffi::GtkSourcePrintCompositor, ffi::GtkSourcePrintCompositorClass>);

    match fn {
        type_ => || ffi::gtk_source_print_compositor_get_type(),
    }
}

impl PrintCompositor {
    pub const NONE: Option<&'static PrintCompositor> = None;

    /// Creates a new print compositor that can be used to print `buffer`.
    /// ## `buffer`
    /// the [`Buffer`][crate::Buffer] to print.
    ///
    /// # Returns
    ///
    /// a new print compositor object.
    #[doc(alias = "gtk_source_print_compositor_new")]
    pub fn new(buffer: &impl IsA<Buffer>) -> PrintCompositor {
        skip_assert_initialized!();
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_new(
                buffer.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Creates a new print compositor that can be used to print the buffer
    /// associated with `view`.
    /// This constructor sets some configuration properties to make the
    /// printed output match `view` as much as possible. The properties set are
    /// [`tab-width`][struct@crate::PrintCompositor#tab-width], [`highlight-syntax`][struct@crate::PrintCompositor#highlight-syntax],
    /// [`wrap-mode`][struct@crate::PrintCompositor#wrap-mode], [`body-font-name`][struct@crate::PrintCompositor#body-font-name] and
    /// [`print-line-numbers`][struct@crate::PrintCompositor#print-line-numbers].
    /// ## `view`
    /// a [`View`][crate::View] to get configuration from.
    ///
    /// # Returns
    ///
    /// a new print compositor object.
    #[doc(alias = "gtk_source_print_compositor_new_from_view")]
    #[doc(alias = "new_from_view")]
    pub fn from_view(view: &impl IsA<View>) -> PrintCompositor {
        skip_assert_initialized!();
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_new_from_view(
                view.as_ref().to_glib_none().0,
            ))
        }
    }

    // rustdoc-stripper-ignore-next
    /// Creates a new builder-pattern struct instance to construct [`PrintCompositor`] objects.
    ///
    /// This method returns an instance of [`PrintCompositorBuilder`](crate::builders::PrintCompositorBuilder) which can be used to create [`PrintCompositor`] objects.
    pub fn builder() -> PrintCompositorBuilder {
        PrintCompositorBuilder::new()
    }
}

impl Default for PrintCompositor {
    fn default() -> Self {
        glib::object::Object::new::<Self>()
    }
}

// rustdoc-stripper-ignore-next
/// A [builder-pattern] type to construct [`PrintCompositor`] objects.
///
/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
#[must_use = "The builder must be built to be used"]
pub struct PrintCompositorBuilder {
    builder: glib::object::ObjectBuilder<'static, PrintCompositor>,
}

impl PrintCompositorBuilder {
    fn new() -> Self {
        Self {
            builder: glib::object::Object::builder(),
        }
    }

    /// Name of the font used for the text body.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn body_font_name(self, body_font_name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self
                .builder
                .property("body-font-name", body_font_name.into()),
        }
    }

    /// The GtkSourceBuffer object to print.
    pub fn buffer(self, buffer: &impl IsA<Buffer>) -> Self {
        Self {
            builder: self.builder.property("buffer", buffer.clone().upcast()),
        }
    }

    /// Name of the font used to print page footer.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn footer_font_name(self, footer_font_name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self
                .builder
                .property("footer-font-name", footer_font_name.into()),
        }
    }

    /// Name of the font used to print page header.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn header_font_name(self, header_font_name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self
                .builder
                .property("header-font-name", header_font_name.into()),
        }
    }

    /// Whether to print the document with highlighted syntax.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn highlight_syntax(self, highlight_syntax: bool) -> Self {
        Self {
            builder: self.builder.property("highlight-syntax", highlight_syntax),
        }
    }

    /// Name of the font used to print line numbers on the left margin.
    /// If this property is unspecified, the text body font is used.
    ///
    /// Accepted values are strings representing a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn line_numbers_font_name(self, line_numbers_font_name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self
                .builder
                .property("line-numbers-font-name", line_numbers_font_name.into()),
        }
    }

    /// Whether to print a footer in each page.
    ///
    /// Note that by default the footer format is unspecified, and if it is
    /// unspecified the footer will not be printed, regardless of the value of
    /// this property.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn print_footer(self, print_footer: bool) -> Self {
        Self {
            builder: self.builder.property("print-footer", print_footer),
        }
    }

    /// Whether to print a header in each page.
    ///
    /// Note that by default the header format is unspecified, and if it is
    /// unspecified the header will not be printed, regardless of the value of
    /// this property.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn print_header(self, print_header: bool) -> Self {
        Self {
            builder: self.builder.property("print-header", print_header),
        }
    }

    /// Interval of printed line numbers. If this property is set to 0 no
    /// numbers will be printed. If greater than 0, a number will be
    /// printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn print_line_numbers(self, print_line_numbers: u32) -> Self {
        Self {
            builder: self
                .builder
                .property("print-line-numbers", print_line_numbers),
        }
    }

    /// Width of a tab character expressed in spaces.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn tab_width(self, tab_width: u32) -> Self {
        Self {
            builder: self.builder.property("tab-width", tab_width),
        }
    }

    /// Whether to wrap lines never, at word boundaries, or at character boundaries.
    ///
    /// The value of this property cannot be changed anymore after the first
    /// call to the [`PrintCompositorExt::paginate()`][crate::prelude::PrintCompositorExt::paginate()] function.
    pub fn wrap_mode(self, wrap_mode: gtk::WrapMode) -> Self {
        Self {
            builder: self.builder.property("wrap-mode", wrap_mode),
        }
    }

    // rustdoc-stripper-ignore-next
    /// Build the [`PrintCompositor`].
    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
    pub fn build(self) -> PrintCompositor {
        self.builder.build()
    }
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::PrintCompositor>> Sealed for T {}
}

/// Trait containing all [`struct@PrintCompositor`] methods.
///
/// # Implementors
///
/// [`PrintCompositor`][struct@crate::PrintCompositor]
pub trait PrintCompositorExt: IsA<PrintCompositor> + sealed::Sealed + 'static {
    /// Draw page `page_nr` for printing on the the Cairo context encapsuled in `context`.
    ///
    /// This method has been designed to be called in the handler of the `GtkPrintOperation::draw_page` signal
    /// as shown in the following example:
    ///
    /// `<informalexample>``<programlisting>`
    /// // Signal handler for the GtkPrintOperation::draw_page signal
    ///
    /// static void
    /// draw_page (GtkPrintOperation *operation,
    ///  GtkPrintContext *context,
    ///  gint page_nr,
    ///  gpointer user_data)
    /// {
    ///  GtkSourcePrintCompositor *compositor;
    ///
    ///  compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
    ///
    ///  gtk_source_print_compositor_draw_page (compositor,
    ///  context,
    ///  page_nr);
    /// }
    /// `</programlisting>``</informalexample>`
    /// ## `context`
    /// the [`gtk::PrintContext`][crate::gtk::PrintContext] encapsulating the context information that is required when
    ///  drawing the page for printing.
    /// ## `page_nr`
    /// the number of the page to print.
    #[doc(alias = "gtk_source_print_compositor_draw_page")]
    fn draw_page(&self, context: &gtk::PrintContext, page_nr: i32) {
        unsafe {
            ffi::gtk_source_print_compositor_draw_page(
                self.as_ref().to_glib_none().0,
                context.to_glib_none().0,
                page_nr,
            );
        }
    }

    /// Returns the name of the font used to print the text body. The returned string
    /// must be freed with `g_free()`.
    ///
    /// # Returns
    ///
    /// a new string containing the name of the font used to print the
    /// text body.
    #[doc(alias = "gtk_source_print_compositor_get_body_font_name")]
    #[doc(alias = "get_body_font_name")]
    fn body_font_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_get_body_font_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets the bottom margin in units of `unit`.
    /// ## `unit`
    /// the unit for the return value.
    ///
    /// # Returns
    ///
    /// the bottom margin.
    #[doc(alias = "gtk_source_print_compositor_get_bottom_margin")]
    #[doc(alias = "get_bottom_margin")]
    fn bottom_margin(&self, unit: gtk::Unit) -> f64 {
        unsafe {
            ffi::gtk_source_print_compositor_get_bottom_margin(
                self.as_ref().to_glib_none().0,
                unit.into_glib(),
            )
        }
    }

    /// Gets the [`Buffer`][crate::Buffer] associated with the compositor. The returned
    /// object reference is owned by the compositor object and
    /// should not be unreferenced.
    ///
    /// # Returns
    ///
    /// the [`Buffer`][crate::Buffer] associated with the compositor.
    #[doc(alias = "gtk_source_print_compositor_get_buffer")]
    #[doc(alias = "get_buffer")]
    fn buffer(&self) -> Option<Buffer> {
        unsafe {
            from_glib_none(ffi::gtk_source_print_compositor_get_buffer(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the name of the font used to print the page footer.
    /// The returned string must be freed with `g_free()`.
    ///
    /// # Returns
    ///
    /// a new string containing the name of the font used to print
    /// the page footer.
    #[doc(alias = "gtk_source_print_compositor_get_footer_font_name")]
    #[doc(alias = "get_footer_font_name")]
    fn footer_font_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_get_footer_font_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the name of the font used to print the page header.
    /// The returned string must be freed with `g_free()`.
    ///
    /// # Returns
    ///
    /// a new string containing the name of the font used to print
    /// the page header.
    #[doc(alias = "gtk_source_print_compositor_get_header_font_name")]
    #[doc(alias = "get_header_font_name")]
    fn header_font_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_get_header_font_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Determines whether the printed text will be highlighted according to the
    /// buffer rules. Note that highlighting will happen
    /// only if the buffer to print has highlighting activated.
    ///
    /// # Returns
    ///
    /// [`true`] if the printed output will be highlighted.
    #[doc(alias = "gtk_source_print_compositor_get_highlight_syntax")]
    #[doc(alias = "get_highlight_syntax")]
    fn is_highlight_syntax(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_source_print_compositor_get_highlight_syntax(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets the left margin in units of `unit`.
    /// ## `unit`
    /// the unit for the return value.
    ///
    /// # Returns
    ///
    /// the left margin
    #[doc(alias = "gtk_source_print_compositor_get_left_margin")]
    #[doc(alias = "get_left_margin")]
    fn left_margin(&self, unit: gtk::Unit) -> f64 {
        unsafe {
            ffi::gtk_source_print_compositor_get_left_margin(
                self.as_ref().to_glib_none().0,
                unit.into_glib(),
            )
        }
    }

    /// Returns the name of the font used to print line numbers on the left margin.
    /// The returned string must be freed with `g_free()`.
    ///
    /// # Returns
    ///
    /// a new string containing the name of the font used to print
    /// line numbers on the left margin.
    #[doc(alias = "gtk_source_print_compositor_get_line_numbers_font_name")]
    #[doc(alias = "get_line_numbers_font_name")]
    fn line_numbers_font_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_source_print_compositor_get_line_numbers_font_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the number of pages in the document or `<code>`-1`</code>` if the
    /// document has not been completely paginated.
    ///
    /// # Returns
    ///
    /// the number of pages in the document or `<code>`-1`</code>` if the
    /// document has not been completely paginated.
    #[doc(alias = "gtk_source_print_compositor_get_n_pages")]
    #[doc(alias = "get_n_pages")]
    fn n_pages(&self) -> i32 {
        unsafe { ffi::gtk_source_print_compositor_get_n_pages(self.as_ref().to_glib_none().0) }
    }

    /// Returns the current fraction of the document pagination that has been completed.
    ///
    /// # Returns
    ///
    /// a fraction from 0.0 to 1.0 inclusive.
    #[doc(alias = "gtk_source_print_compositor_get_pagination_progress")]
    #[doc(alias = "get_pagination_progress")]
    fn pagination_progress(&self) -> f64 {
        unsafe {
            ffi::gtk_source_print_compositor_get_pagination_progress(self.as_ref().to_glib_none().0)
        }
    }

    /// Determines if a footer is set to be printed for each page. A
    /// footer will be printed if this function returns [`true`]
    /// `<emphasis>`and`</emphasis>` some format strings have been specified
    /// with [`set_footer_format()`][Self::set_footer_format()].
    ///
    /// # Returns
    ///
    /// [`true`] if the footer is set to be printed.
    #[doc(alias = "gtk_source_print_compositor_get_print_footer")]
    #[doc(alias = "get_print_footer")]
    fn is_print_footer(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_source_print_compositor_get_print_footer(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Determines if a header is set to be printed for each page. A
    /// header will be printed if this function returns [`true`]
    /// `<emphasis>`and`</emphasis>` some format strings have been specified
    /// with [`set_header_format()`][Self::set_header_format()].
    ///
    /// # Returns
    ///
    /// [`true`] if the header is set to be printed.
    #[doc(alias = "gtk_source_print_compositor_get_print_header")]
    #[doc(alias = "get_print_header")]
    fn is_print_header(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_source_print_compositor_get_print_header(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the interval used for line number printing. If the
    /// value is 0, no line numbers will be printed. The default value is
    /// 1 (i.e. numbers printed in all lines).
    ///
    /// # Returns
    ///
    /// the interval of printed line numbers.
    #[doc(alias = "gtk_source_print_compositor_get_print_line_numbers")]
    #[doc(alias = "get_print_line_numbers")]
    fn print_line_numbers(&self) -> u32 {
        unsafe {
            ffi::gtk_source_print_compositor_get_print_line_numbers(self.as_ref().to_glib_none().0)
        }
    }

    /// Gets the right margin in units of `unit`.
    /// ## `unit`
    /// the unit for the return value.
    ///
    /// # Returns
    ///
    /// the right margin.
    #[doc(alias = "gtk_source_print_compositor_get_right_margin")]
    #[doc(alias = "get_right_margin")]
    fn right_margin(&self, unit: gtk::Unit) -> f64 {
        unsafe {
            ffi::gtk_source_print_compositor_get_right_margin(
                self.as_ref().to_glib_none().0,
                unit.into_glib(),
            )
        }
    }

    /// Returns the width of tabulation in characters for printed text.
    ///
    /// # Returns
    ///
    /// width of tab.
    #[doc(alias = "gtk_source_print_compositor_get_tab_width")]
    #[doc(alias = "get_tab_width")]
    fn tab_width(&self) -> u32 {
        unsafe { ffi::gtk_source_print_compositor_get_tab_width(self.as_ref().to_glib_none().0) }
    }

    /// Gets the top margin in units of `unit`.
    /// ## `unit`
    /// the unit for the return value.
    ///
    /// # Returns
    ///
    /// the top margin.
    #[doc(alias = "gtk_source_print_compositor_get_top_margin")]
    #[doc(alias = "get_top_margin")]
    fn top_margin(&self, unit: gtk::Unit) -> f64 {
        unsafe {
            ffi::gtk_source_print_compositor_get_top_margin(
                self.as_ref().to_glib_none().0,
                unit.into_glib(),
            )
        }
    }

    /// Gets the line wrapping mode for the printed text.
    ///
    /// # Returns
    ///
    /// the line wrap mode.
    #[doc(alias = "gtk_source_print_compositor_get_wrap_mode")]
    #[doc(alias = "get_wrap_mode")]
    fn wrap_mode(&self) -> gtk::WrapMode {
        unsafe {
            from_glib(ffi::gtk_source_print_compositor_get_wrap_mode(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Paginate the document associated with the `self`.
    ///
    /// In order to support non-blocking pagination, document is paginated in small chunks.
    /// Each time [`paginate()`][Self::paginate()] is invoked, a chunk of the document
    /// is paginated. To paginate the entire document, [`paginate()`][Self::paginate()]
    /// must be invoked multiple times.
    /// It returns [`true`] if the document has been completely paginated, otherwise it returns [`false`].
    ///
    /// This method has been designed to be invoked in the handler of the `GtkPrintOperation::paginate` signal,
    /// as shown in the following example:
    ///
    /// `<informalexample>``<programlisting>`
    /// // Signal handler for the GtkPrintOperation::paginate signal
    ///
    /// static gboolean
    /// paginate (GtkPrintOperation *operation,
    ///  GtkPrintContext *context,
    ///  gpointer user_data)
    /// {
    ///  GtkSourcePrintCompositor *compositor;
    ///
    ///  compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
    ///
    ///  if (gtk_source_print_compositor_paginate (compositor, context))
    ///  {
    ///  gint n_pages;
    ///
    ///  n_pages = gtk_source_print_compositor_get_n_pages (compositor);
    ///  gtk_print_operation_set_n_pages (operation, n_pages);
    ///
    ///  return TRUE;
    ///  }
    ///
    ///  return FALSE;
    /// }
    /// `</programlisting>``</informalexample>`
    ///
    /// If you don't need to do pagination in chunks, you can simply do it all in the
    /// `GtkPrintOperation::begin-print` handler, and set the number of pages from there, like
    /// in the following example:
    ///
    /// `<informalexample>``<programlisting>`
    /// // Signal handler for the GtkPrintOperation::begin-print signal
    ///
    /// static void
    /// begin_print (GtkPrintOperation *operation,
    ///  GtkPrintContext *context,
    ///  gpointer user_data)
    /// {
    ///  GtkSourcePrintCompositor *compositor;
    ///  gint n_pages;
    ///
    ///  compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
    ///
    ///  while (!gtk_source_print_compositor_paginate (compositor, context));
    ///
    ///  n_pages = gtk_source_print_compositor_get_n_pages (compositor);
    ///  gtk_print_operation_set_n_pages (operation, n_pages);
    /// }
    /// `</programlisting>``</informalexample>`
    /// ## `context`
    /// the [`gtk::PrintContext`][crate::gtk::PrintContext] whose parameters (e.g. paper size, print margins, etc.)
    /// are used by the the `self` to paginate the document.
    ///
    /// # Returns
    ///
    /// [`true`] if the document has been completely paginated, [`false`] otherwise.
    #[doc(alias = "gtk_source_print_compositor_paginate")]
    fn paginate(&self, context: &gtk::PrintContext) -> bool {
        unsafe {
            from_glib(ffi::gtk_source_print_compositor_paginate(
                self.as_ref().to_glib_none().0,
                context.to_glib_none().0,
            ))
        }
    }

    /// Sets the default font for the printed text.
    ///
    /// `font_name` should be a
    /// string representation of a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `font_name`
    /// the name of the default font for the body text.
    #[doc(alias = "gtk_source_print_compositor_set_body_font_name")]
    fn set_body_font_name(&self, font_name: &str) {
        unsafe {
            ffi::gtk_source_print_compositor_set_body_font_name(
                self.as_ref().to_glib_none().0,
                font_name.to_glib_none().0,
            );
        }
    }

    /// Sets the bottom margin used by `self`.
    /// ## `margin`
    /// the new bottom margin in units of `unit`.
    /// ## `unit`
    /// the units for `margin`.
    #[doc(alias = "gtk_source_print_compositor_set_bottom_margin")]
    fn set_bottom_margin(&self, margin: f64, unit: gtk::Unit) {
        unsafe {
            ffi::gtk_source_print_compositor_set_bottom_margin(
                self.as_ref().to_glib_none().0,
                margin,
                unit.into_glib(),
            );
        }
    }

    /// Sets the font for printing the page footer. If
    /// [`None`] is supplied, the default font (i.e. the one being used for the
    /// text) will be used instead.
    ///
    /// `font_name` should be a
    /// string representation of a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `font_name`
    /// the name of the font for the footer text, or [`None`].
    #[doc(alias = "gtk_source_print_compositor_set_footer_font_name")]
    fn set_footer_font_name(&self, font_name: Option<&str>) {
        unsafe {
            ffi::gtk_source_print_compositor_set_footer_font_name(
                self.as_ref().to_glib_none().0,
                font_name.to_glib_none().0,
            );
        }
    }

    /// See [`set_header_format()`][Self::set_header_format()] for more information
    /// about the parameters.
    /// ## `separator`
    /// [`true`] if you want a separator line to be printed.
    /// ## `left`
    /// a format string to print on the left of the footer.
    /// ## `center`
    /// a format string to print on the center of the footer.
    /// ## `right`
    /// a format string to print on the right of the footer.
    #[doc(alias = "gtk_source_print_compositor_set_footer_format")]
    fn set_footer_format(
        &self,
        separator: bool,
        left: Option<&str>,
        center: Option<&str>,
        right: Option<&str>,
    ) {
        unsafe {
            ffi::gtk_source_print_compositor_set_footer_format(
                self.as_ref().to_glib_none().0,
                separator.into_glib(),
                left.to_glib_none().0,
                center.to_glib_none().0,
                right.to_glib_none().0,
            );
        }
    }

    /// Sets the font for printing the page header. If
    /// [`None`] is supplied, the default font (i.e. the one being used for the
    /// text) will be used instead.
    ///
    /// `font_name` should be a
    /// string representation of a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `font_name`
    /// the name of the font for header text, or [`None`].
    #[doc(alias = "gtk_source_print_compositor_set_header_font_name")]
    fn set_header_font_name(&self, font_name: Option<&str>) {
        unsafe {
            ffi::gtk_source_print_compositor_set_header_font_name(
                self.as_ref().to_glib_none().0,
                font_name.to_glib_none().0,
            );
        }
    }

    /// Sets strftime like header format strings, to be printed on the
    /// left, center and right of the top of each page. The strings may
    /// include strftime(3) codes which will be expanded at print time.
    /// A subset of `strftime()` codes are accepted, see `g_date_time_format()`
    /// for more details on the accepted format specifiers.
    /// Additionally the following format specifiers are accepted:
    /// - `N`: the page number
    /// - `Q`: the page count.
    ///
    /// `separator` specifies if a solid line should be drawn to separate
    /// the header from the document text.
    ///
    /// If [`None`] is given for any of the three arguments, that particular
    /// string will not be printed.
    ///
    /// For the header to be printed, in
    /// addition to specifying format strings, you need to enable header
    /// printing with [`set_print_header()`][Self::set_print_header()].
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `separator`
    /// [`true`] if you want a separator line to be printed.
    /// ## `left`
    /// a format string to print on the left of the header.
    /// ## `center`
    /// a format string to print on the center of the header.
    /// ## `right`
    /// a format string to print on the right of the header.
    #[doc(alias = "gtk_source_print_compositor_set_header_format")]
    fn set_header_format(
        &self,
        separator: bool,
        left: Option<&str>,
        center: Option<&str>,
        right: Option<&str>,
    ) {
        unsafe {
            ffi::gtk_source_print_compositor_set_header_format(
                self.as_ref().to_glib_none().0,
                separator.into_glib(),
                left.to_glib_none().0,
                center.to_glib_none().0,
                right.to_glib_none().0,
            );
        }
    }

    /// Sets whether the printed text will be highlighted according to the
    /// buffer rules. Both color and font style are applied.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `highlight`
    /// whether syntax should be highlighted.
    #[doc(alias = "gtk_source_print_compositor_set_highlight_syntax")]
    fn set_highlight_syntax(&self, highlight: bool) {
        unsafe {
            ffi::gtk_source_print_compositor_set_highlight_syntax(
                self.as_ref().to_glib_none().0,
                highlight.into_glib(),
            );
        }
    }

    /// Sets the left margin used by `self`.
    /// ## `margin`
    /// the new left margin in units of `unit`.
    /// ## `unit`
    /// the units for `margin`.
    #[doc(alias = "gtk_source_print_compositor_set_left_margin")]
    fn set_left_margin(&self, margin: f64, unit: gtk::Unit) {
        unsafe {
            ffi::gtk_source_print_compositor_set_left_margin(
                self.as_ref().to_glib_none().0,
                margin,
                unit.into_glib(),
            );
        }
    }

    /// Sets the font for printing line numbers on the left margin. If
    /// [`None`] is supplied, the default font (i.e. the one being used for the
    /// text) will be used instead.
    ///
    /// `font_name` should be a
    /// string representation of a font description Pango can understand.
    /// (e.g. &quot;Monospace 10&quot;). See [`pango::FontDescription::from_string()`][crate::pango::FontDescription::from_string()]
    /// for a description of the format of the string representation.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `font_name`
    /// the name of the font for line numbers, or [`None`].
    #[doc(alias = "gtk_source_print_compositor_set_line_numbers_font_name")]
    fn set_line_numbers_font_name(&self, font_name: Option<&str>) {
        unsafe {
            ffi::gtk_source_print_compositor_set_line_numbers_font_name(
                self.as_ref().to_glib_none().0,
                font_name.to_glib_none().0,
            );
        }
    }

    /// Sets whether you want to print a footer in each page. The
    /// footer consists of three pieces of text and an optional line
    /// separator, configurable with
    /// [`set_footer_format()`][Self::set_footer_format()].
    ///
    /// Note that by default the footer format is unspecified, and if it's
    /// empty it will not be printed, regardless of this setting.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `print`
    /// [`true`] if you want the footer to be printed.
    #[doc(alias = "gtk_source_print_compositor_set_print_footer")]
    fn set_print_footer(&self, print: bool) {
        unsafe {
            ffi::gtk_source_print_compositor_set_print_footer(
                self.as_ref().to_glib_none().0,
                print.into_glib(),
            );
        }
    }

    /// Sets whether you want to print a header in each page. The
    /// header consists of three pieces of text and an optional line
    /// separator, configurable with
    /// [`set_header_format()`][Self::set_header_format()].
    ///
    /// Note that by default the header format is unspecified, and if it's
    /// empty it will not be printed, regardless of this setting.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `print`
    /// [`true`] if you want the header to be printed.
    #[doc(alias = "gtk_source_print_compositor_set_print_header")]
    fn set_print_header(&self, print: bool) {
        unsafe {
            ffi::gtk_source_print_compositor_set_print_header(
                self.as_ref().to_glib_none().0,
                print.into_glib(),
            );
        }
    }

    /// Sets the interval for printed line numbers. If `interval` is 0 no
    /// numbers will be printed. If greater than 0, a number will be
    /// printed every `interval` lines (i.e. 1 will print all line numbers).
    ///
    /// Maximum accepted value for `interval` is 100.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `interval`
    /// interval for printed line numbers.
    #[doc(alias = "gtk_source_print_compositor_set_print_line_numbers")]
    fn set_print_line_numbers(&self, interval: u32) {
        unsafe {
            ffi::gtk_source_print_compositor_set_print_line_numbers(
                self.as_ref().to_glib_none().0,
                interval,
            );
        }
    }

    /// Sets the right margin used by `self`.
    /// ## `margin`
    /// the new right margin in units of `unit`.
    /// ## `unit`
    /// the units for `margin`.
    #[doc(alias = "gtk_source_print_compositor_set_right_margin")]
    fn set_right_margin(&self, margin: f64, unit: gtk::Unit) {
        unsafe {
            ffi::gtk_source_print_compositor_set_right_margin(
                self.as_ref().to_glib_none().0,
                margin,
                unit.into_glib(),
            );
        }
    }

    /// Sets the width of tabulation in characters for printed text.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `width`
    /// width of tab in characters.
    #[doc(alias = "gtk_source_print_compositor_set_tab_width")]
    fn set_tab_width(&self, width: u32) {
        unsafe {
            ffi::gtk_source_print_compositor_set_tab_width(self.as_ref().to_glib_none().0, width);
        }
    }

    /// Sets the top margin used by `self`.
    /// ## `margin`
    /// the new top margin in units of `unit`
    /// ## `unit`
    /// the units for `margin`
    #[doc(alias = "gtk_source_print_compositor_set_top_margin")]
    fn set_top_margin(&self, margin: f64, unit: gtk::Unit) {
        unsafe {
            ffi::gtk_source_print_compositor_set_top_margin(
                self.as_ref().to_glib_none().0,
                margin,
                unit.into_glib(),
            );
        }
    }

    /// Sets the line wrapping mode for the printed text.
    ///
    /// This function cannot be called anymore after the first call to the
    /// [`paginate()`][Self::paginate()] function.
    /// ## `wrap_mode`
    /// a [`gtk::WrapMode`][crate::gtk::WrapMode].
    #[doc(alias = "gtk_source_print_compositor_set_wrap_mode")]
    fn set_wrap_mode(&self, wrap_mode: gtk::WrapMode) {
        unsafe {
            ffi::gtk_source_print_compositor_set_wrap_mode(
                self.as_ref().to_glib_none().0,
                wrap_mode.into_glib(),
            );
        }
    }

    #[doc(alias = "body-font-name")]
    fn connect_body_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_body_font_name_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::body-font-name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_body_font_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "footer-font-name")]
    fn connect_footer_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_footer_font_name_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::footer-font-name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_footer_font_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "header-font-name")]
    fn connect_header_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_header_font_name_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::header-font-name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_header_font_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "highlight-syntax")]
    fn connect_highlight_syntax_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_highlight_syntax_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::highlight-syntax\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_highlight_syntax_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "line-numbers-font-name")]
    fn connect_line_numbers_font_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_line_numbers_font_name_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::line-numbers-font-name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_line_numbers_font_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "n-pages")]
    fn connect_n_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_n_pages_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::n-pages\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_n_pages_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "print-footer")]
    fn connect_print_footer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_print_footer_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::print-footer\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_print_footer_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "print-header")]
    fn connect_print_header_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_print_header_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::print-header\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_print_header_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "print-line-numbers")]
    fn connect_print_line_numbers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_print_line_numbers_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::print-line-numbers\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_print_line_numbers_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "tab-width")]
    fn connect_tab_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_tab_width_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::tab-width\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_tab_width_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "wrap-mode")]
    fn connect_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_wrap_mode_trampoline<
            P: IsA<PrintCompositor>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkSourcePrintCompositor,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(PrintCompositor::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::wrap-mode\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_wrap_mode_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl<O: IsA<PrintCompositor>> PrintCompositorExt for O {}

impl fmt::Display for PrintCompositor {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("PrintCompositor")
    }
}