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
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::ffi;
use glib::{
    prelude::*,
    signal::{connect_raw, SignalHandlerId},
    translate::*,
};
use std::boxed::Box as Box_;

glib::wrapper! {
    /// A tag that can be applied to text in a [`Buffer`][crate::Buffer].
    ///
    /// [`Tag`][crate::Tag] is a subclass of [`gtk::TextTag`][crate::gtk::TextTag] that adds properties useful for
    /// the GtkSourceView library.
    ///
    /// If, for a certain tag, [`gtk::TextTag`][crate::gtk::TextTag] is sufficient, it's better that you create
    /// a [`gtk::TextTag`][crate::gtk::TextTag], not a [`Tag`][crate::Tag].
    ///
    /// ## Properties
    ///
    ///
    /// #### `draw-spaces`
    ///  Whether to draw white spaces.
    ///
    /// This property takes precedence over the value defined by the [`SpaceDrawer`][crate::SpaceDrawer]'s
    /// [`matrix`][struct@crate::SpaceDrawer#matrix] property (only where the tag is applied).
    ///
    /// Setting this property also changes [`draw-spaces-set`][struct@crate::Tag#draw-spaces-set] to
    /// [`true`].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `draw-spaces-set`
    ///  Whether the [`draw-spaces`][struct@crate::Tag#draw-spaces] property is set and must be
    /// taken into account.
    ///
    /// Readable | Writeable
    /// <details><summary><h4>TextTag</h4></summary>
    ///
    ///
    /// #### `accumulative-margin`
    ///  Whether the margins accumulate or override each other.
    ///
    /// When set to [`true`] the margins of this tag are added to the margins
    /// of any other non-accumulative margins present. When set to [`false`]
    /// the margins override one another (the default).
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `allow-breaks`
    ///  Whether breaks are allowed.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `allow-breaks-set`
    ///  Whether the `allow-breaks` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `background`
    ///  Background color as a string.
    ///
    /// Writeable
    ///
    ///
    /// #### `background-full-height`
    ///  Whether the background color fills the entire line height
    /// or only the height of the tagged characters.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `background-full-height-set`
    ///  Whether the `background-full-height` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `background-rgba`
    ///  Background color as a [`gdk::RGBA`][crate::gdk::RGBA].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `background-set`
    ///  Whether the `background` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `direction`
    ///  Text direction, e.g. right-to-left or left-to-right.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `editable`
    ///  Whether the text can be modified by the user.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `editable-set`
    ///  Whether the `editable` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `fallback`
    ///  Whether font fallback is enabled.
    ///
    /// When set to [`true`], other fonts will be substituted
    /// where the current font is missing glyphs.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `fallback-set`
    ///  Whether the `fallback` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `family`
    ///  Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `family-set`
    ///  Whether the `family` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `font`
    ///  Font description as string, e.g. \"Sans Italic 12\".
    ///
    /// Note that the initial value of this property depends on
    /// the internals of [`pango::FontDescription`][crate::pango::FontDescription].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `font-desc`
    ///  Font description as a [`pango::FontDescription`][crate::pango::FontDescription].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `font-features`
    ///  OpenType font features, as a string.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `font-features-set`
    ///  Whether the `font-features` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `foreground`
    ///  Foreground color as a string.
    ///
    /// Writeable
    ///
    ///
    /// #### `foreground-rgba`
    ///  Foreground color as a [`gdk::RGBA`][crate::gdk::RGBA].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `foreground-set`
    ///  Whether the `foreground` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `indent`
    ///  Amount to indent the paragraph, in pixels.
    ///
    /// A negative value of indent will produce a hanging indentation.
    /// That is, the first line will have the full width, and subsequent
    /// lines will be indented by the absolute value of indent.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `indent-set`
    ///  Whether the `indent` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `insert-hyphens`
    ///  Whether to insert hyphens at breaks.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `insert-hyphens-set`
    ///  Whether the `insert-hyphens` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `invisible`
    ///  Whether this text is hidden.
    ///
    /// Note that there may still be problems with the support for invisible
    /// text, in particular when navigating programmatically inside a buffer
    /// containing invisible segments.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `invisible-set`
    ///  Whether the `invisible` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `justification`
    ///  Left, right, or center justification.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `justification-set`
    ///  Whether the `justification` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `language`
    ///  The language this text is in, as an ISO code.
    ///
    /// Pango can use this as a hint when rendering the text.
    /// If not set, an appropriate default will be used.
    ///
    /// Note that the initial value of this property depends
    /// on the current locale, see also `get_default_language()`.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `language-set`
    ///  Whether the `language` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `left-margin`
    ///  Width of the left margin in pixels.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `left-margin-set`
    ///  Whether the `left-margin` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `letter-spacing`
    ///  Extra spacing between graphemes, in Pango units.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `letter-spacing-set`
    ///  Whether the `letter-spacing` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-height`
    ///  Factor to scale line height by.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-height-set`
    ///  Whether the `line-height` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `name`
    ///  The name used to refer to the tag.
    ///
    /// [`None`] for anonymous tags.
    ///
    /// Readable | Writeable | Construct Only
    ///
    ///
    /// #### `overline`
    ///  Style of overline for this text.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `overline-rgba`
    ///  This property modifies the color of overlines.
    ///
    /// If not set, overlines will use the foreground color.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `overline-rgba-set`
    ///  Whether the `overline-rgba` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `overline-set`
    ///  Whether the `overline` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `paragraph-background`
    ///  The paragraph background color as a string.
    ///
    /// Writeable
    ///
    ///
    /// #### `paragraph-background-rgba`
    ///  The paragraph background color as a [`gdk::RGBA`][crate::gdk::RGBA].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `paragraph-background-set`
    ///  Whether the `paragraph-background` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-above-lines`
    ///  Pixels of blank space above paragraphs.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-above-lines-set`
    ///  Whether the `pixels-above-lines` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-below-lines`
    ///  Pixels of blank space below paragraphs.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-below-lines-set`
    ///  Whether the `pixels-below-lines` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-inside-wrap`
    ///  Pixels of blank space between wrapped lines in a paragraph.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pixels-inside-wrap-set`
    ///  Whether the `pixels-inside-wrap` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `right-margin`
    ///  Width of the right margin, in pixels.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `right-margin-set`
    ///  Whether the `right-margin` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `rise`
    ///  Offset of text above the baseline, in Pango units.
    ///
    /// Negative values go below the baseline.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `rise-set`
    ///  Whether the `rise` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `scale`
    ///  Font size as a scale factor relative to the default font size.
    ///
    /// This properly adapts to theme changes, etc. so is recommended.
    /// Pango predefines some scales such as `PANGO_SCALE_X_LARGE`.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `scale-set`
    ///  Whether the `scale` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `sentence`
    ///  Whether this tag represents a single sentence.
    ///
    /// This affects cursor movement.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `sentence-set`
    ///  Whether the `sentence` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `show-spaces`
    ///  How to render invisible characters.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `show-spaces-set`
    ///  Whether the `show-spaces` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `size`
    ///  Font size in Pango units.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `size-points`
    ///  Font size in points.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `size-set`
    ///  Whether the `size` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `stretch`
    ///  Font stretch as a [`pango::Stretch`][crate::pango::Stretch], e.g. [`pango::Stretch::Condensed`][crate::pango::Stretch::Condensed].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `stretch-set`
    ///  Whether the `stretch` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `strikethrough`
    ///  Whether to strike through the text.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `strikethrough-rgba`
    ///  This property modifies the color of strikeouts.
    ///
    /// If not set, strikeouts will use the foreground color.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `strikethrough-rgba-set`
    ///  If the `strikethrough-rgba` property has been set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `strikethrough-set`
    ///  Whether the `strikethrough` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `style`
    ///  Font style as a [`pango::Style`][crate::pango::Style], e.g. [`pango::Style::Italic`][crate::pango::Style::Italic].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `style-set`
    ///  Whether the `style` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `tabs`
    ///  Custom tabs for this text.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `tabs-set`
    ///  Whether the `tabs` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `text-transform`
    ///  How to transform the text for display.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `text-transform-set`
    ///  Whether the `text-transform` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `underline`
    ///  Style of underline for this text.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `underline-rgba`
    ///  This property modifies the color of underlines.
    ///
    /// If not set, underlines will use the foreground color.
    ///
    /// If [`underline`][struct@crate::gtk::TextTag#underline] is set to [`pango::Underline::Error`][crate::pango::Underline::Error],
    /// an alternate color may be applied instead of the foreground. Setting
    /// this property will always override those defaults.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `underline-rgba-set`
    ///  If the `underline-rgba` property has been set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `underline-set`
    ///  Whether the `underline` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `variant`
    ///  Font variant as a [`pango::Variant`][crate::pango::Variant], e.g. [`pango::Variant::SmallCaps`][crate::pango::Variant::SmallCaps].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `variant-set`
    ///  Whether the `variant` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `weight`
    ///  Font weight as an integer.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `weight-set`
    ///  Whether the `weight` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `word`
    ///  Whether this tag represents a single word.
    ///
    /// This affects line breaks and cursor movement.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `word-set`
    ///  Whether the `word` property is set.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `wrap-mode`
    ///  Whether to wrap lines never, at word boundaries, or
    /// at character boundaries.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `wrap-mode-set`
    ///  Whether the `wrap-mode` property is set.
    ///
    /// Readable | Writeable
    /// </details>
    ///
    /// # Implements
    ///
    /// [`TagExt`][trait@crate::prelude::TagExt], [`trait@gtk::prelude::TextTagExt`], [`trait@glib::ObjectExt`]
    #[doc(alias = "GtkSourceTag")]
    pub struct Tag(Object<ffi::GtkSourceTag, ffi::GtkSourceTagClass>) @extends gtk::TextTag;

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

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

    /// Creates a [`Tag`][crate::Tag].
    ///
    /// Configure the tag using object arguments, i.e. using [`ObjectExt::set()`][crate::glib::prelude::ObjectExt::set()].
    ///
    /// For usual cases, `Buffer::create_source_tag()` is more convenient to
    /// use.
    /// ## `name`
    /// tag name, or [`None`].
    ///
    /// # Returns
    ///
    /// a new [`Tag`][crate::Tag].
    #[doc(alias = "gtk_source_tag_new")]
    pub fn new(name: Option<&str>) -> Tag {
        assert_initialized_main_thread!();
        unsafe {
            gtk::TextTag::from_glib_full(ffi::gtk_source_tag_new(name.to_glib_none().0))
                .unsafe_cast()
        }
    }

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

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

// rustdoc-stripper-ignore-next
/// A [builder-pattern] type to construct [`Tag`] 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 TagBuilder {
    builder: glib::object::ObjectBuilder<'static, Tag>,
}

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

    /// Whether to draw white spaces.
    ///
    /// This property takes precedence over the value defined by the [`SpaceDrawer`][crate::SpaceDrawer]'s
    /// [`matrix`][struct@crate::SpaceDrawer#matrix] property (only where the tag is applied).
    ///
    /// Setting this property also changes [`draw-spaces-set`][struct@crate::Tag#draw-spaces-set] to
    /// [`true`].
    pub fn draw_spaces(self, draw_spaces: bool) -> Self {
        Self {
            builder: self.builder.property("draw-spaces", draw_spaces),
        }
    }

    /// Whether the [`draw-spaces`][struct@crate::Tag#draw-spaces] property is set and must be
    /// taken into account.
    pub fn draw_spaces_set(self, draw_spaces_set: bool) -> Self {
        Self {
            builder: self.builder.property("draw-spaces-set", draw_spaces_set),
        }
    }

    /// Whether the margins accumulate or override each other.
    ///
    /// When set to [`true`] the margins of this tag are added to the margins
    /// of any other non-accumulative margins present. When set to [`false`]
    /// the margins override one another (the default).
    pub fn accumulative_margin(self, accumulative_margin: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("accumulative-margin", accumulative_margin),
        }
    }

    /// Whether breaks are allowed.
    pub fn allow_breaks(self, allow_breaks: bool) -> Self {
        Self {
            builder: self.builder.property("allow-breaks", allow_breaks),
        }
    }

    /// Whether the `allow-breaks` property is set.
    pub fn allow_breaks_set(self, allow_breaks_set: bool) -> Self {
        Self {
            builder: self.builder.property("allow-breaks-set", allow_breaks_set),
        }
    }

    /// Background color as a string.
    pub fn background(self, background: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("background", background.into()),
        }
    }

    /// Whether the background color fills the entire line height
    /// or only the height of the tagged characters.
    pub fn background_full_height(self, background_full_height: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("background-full-height", background_full_height),
        }
    }

    /// Whether the `background-full-height` property is set.
    pub fn background_full_height_set(self, background_full_height_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("background-full-height-set", background_full_height_set),
        }
    }

    /// Background color as a [`gdk::RGBA`][crate::gdk::RGBA].
    pub fn background_rgba(self, background_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self.builder.property("background-rgba", background_rgba),
        }
    }

    /// Whether the `background` property is set.
    pub fn background_set(self, background_set: bool) -> Self {
        Self {
            builder: self.builder.property("background-set", background_set),
        }
    }

    /// Text direction, e.g. right-to-left or left-to-right.
    pub fn direction(self, direction: gtk::TextDirection) -> Self {
        Self {
            builder: self.builder.property("direction", direction),
        }
    }

    /// Whether the text can be modified by the user.
    pub fn editable(self, editable: bool) -> Self {
        Self {
            builder: self.builder.property("editable", editable),
        }
    }

    /// Whether the `editable` property is set.
    pub fn editable_set(self, editable_set: bool) -> Self {
        Self {
            builder: self.builder.property("editable-set", editable_set),
        }
    }

    /// Whether font fallback is enabled.
    ///
    /// When set to [`true`], other fonts will be substituted
    /// where the current font is missing glyphs.
    pub fn fallback(self, fallback: bool) -> Self {
        Self {
            builder: self.builder.property("fallback", fallback),
        }
    }

    /// Whether the `fallback` property is set.
    pub fn fallback_set(self, fallback_set: bool) -> Self {
        Self {
            builder: self.builder.property("fallback-set", fallback_set),
        }
    }

    /// Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
    pub fn family(self, family: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("family", family.into()),
        }
    }

    /// Whether the `family` property is set.
    pub fn family_set(self, family_set: bool) -> Self {
        Self {
            builder: self.builder.property("family-set", family_set),
        }
    }

    /// Font description as string, e.g. \"Sans Italic 12\".
    ///
    /// Note that the initial value of this property depends on
    /// the internals of [`pango::FontDescription`][crate::pango::FontDescription].
    pub fn font(self, font: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("font", font.into()),
        }
    }

    /// Font description as a [`pango::FontDescription`][crate::pango::FontDescription].
    pub fn font_desc(self, font_desc: &pango::FontDescription) -> Self {
        Self {
            builder: self.builder.property("font-desc", font_desc),
        }
    }

    /// OpenType font features, as a string.
    pub fn font_features(self, font_features: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("font-features", font_features.into()),
        }
    }

    /// Whether the `font-features` property is set.
    pub fn font_features_set(self, font_features_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("font-features-set", font_features_set),
        }
    }

    /// Foreground color as a string.
    pub fn foreground(self, foreground: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("foreground", foreground.into()),
        }
    }

    /// Foreground color as a [`gdk::RGBA`][crate::gdk::RGBA].
    pub fn foreground_rgba(self, foreground_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self.builder.property("foreground-rgba", foreground_rgba),
        }
    }

    /// Whether the `foreground` property is set.
    pub fn foreground_set(self, foreground_set: bool) -> Self {
        Self {
            builder: self.builder.property("foreground-set", foreground_set),
        }
    }

    /// Amount to indent the paragraph, in pixels.
    ///
    /// A negative value of indent will produce a hanging indentation.
    /// That is, the first line will have the full width, and subsequent
    /// lines will be indented by the absolute value of indent.
    pub fn indent(self, indent: i32) -> Self {
        Self {
            builder: self.builder.property("indent", indent),
        }
    }

    /// Whether the `indent` property is set.
    pub fn indent_set(self, indent_set: bool) -> Self {
        Self {
            builder: self.builder.property("indent-set", indent_set),
        }
    }

    /// Whether to insert hyphens at breaks.
    pub fn insert_hyphens(self, insert_hyphens: bool) -> Self {
        Self {
            builder: self.builder.property("insert-hyphens", insert_hyphens),
        }
    }

    /// Whether the `insert-hyphens` property is set.
    pub fn insert_hyphens_set(self, insert_hyphens_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("insert-hyphens-set", insert_hyphens_set),
        }
    }

    /// Whether this text is hidden.
    ///
    /// Note that there may still be problems with the support for invisible
    /// text, in particular when navigating programmatically inside a buffer
    /// containing invisible segments.
    pub fn invisible(self, invisible: bool) -> Self {
        Self {
            builder: self.builder.property("invisible", invisible),
        }
    }

    /// Whether the `invisible` property is set.
    pub fn invisible_set(self, invisible_set: bool) -> Self {
        Self {
            builder: self.builder.property("invisible-set", invisible_set),
        }
    }

    /// Left, right, or center justification.
    pub fn justification(self, justification: gtk::Justification) -> Self {
        Self {
            builder: self.builder.property("justification", justification),
        }
    }

    /// Whether the `justification` property is set.
    pub fn justification_set(self, justification_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("justification-set", justification_set),
        }
    }

    /// The language this text is in, as an ISO code.
    ///
    /// Pango can use this as a hint when rendering the text.
    /// If not set, an appropriate default will be used.
    ///
    /// Note that the initial value of this property depends
    /// on the current locale, see also `get_default_language()`.
    pub fn language(self, language: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("language", language.into()),
        }
    }

    /// Whether the `language` property is set.
    pub fn language_set(self, language_set: bool) -> Self {
        Self {
            builder: self.builder.property("language-set", language_set),
        }
    }

    /// Width of the left margin in pixels.
    pub fn left_margin(self, left_margin: i32) -> Self {
        Self {
            builder: self.builder.property("left-margin", left_margin),
        }
    }

    /// Whether the `left-margin` property is set.
    pub fn left_margin_set(self, left_margin_set: bool) -> Self {
        Self {
            builder: self.builder.property("left-margin-set", left_margin_set),
        }
    }

    /// Extra spacing between graphemes, in Pango units.
    pub fn letter_spacing(self, letter_spacing: i32) -> Self {
        Self {
            builder: self.builder.property("letter-spacing", letter_spacing),
        }
    }

    /// Whether the `letter-spacing` property is set.
    pub fn letter_spacing_set(self, letter_spacing_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("letter-spacing-set", letter_spacing_set),
        }
    }

    /// Factor to scale line height by.
    #[cfg(feature = "gtk_v4_6")]
    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))]
    pub fn line_height(self, line_height: f32) -> Self {
        Self {
            builder: self.builder.property("line-height", line_height),
        }
    }

    /// Whether the `line-height` property is set.
    pub fn line_height_set(self, line_height_set: bool) -> Self {
        Self {
            builder: self.builder.property("line-height-set", line_height_set),
        }
    }

    /// The name used to refer to the tag.
    ///
    /// [`None`] for anonymous tags.
    pub fn name(self, name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("name", name.into()),
        }
    }

    /// Style of overline for this text.
    pub fn overline(self, overline: pango::Overline) -> Self {
        Self {
            builder: self.builder.property("overline", overline),
        }
    }

    /// This property modifies the color of overlines.
    ///
    /// If not set, overlines will use the foreground color.
    pub fn overline_rgba(self, overline_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self.builder.property("overline-rgba", overline_rgba),
        }
    }

    /// Whether the `overline-rgba` property is set.
    pub fn overline_rgba_set(self, overline_rgba_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("overline-rgba-set", overline_rgba_set),
        }
    }

    /// Whether the `overline` property is set.
    pub fn overline_set(self, overline_set: bool) -> Self {
        Self {
            builder: self.builder.property("overline-set", overline_set),
        }
    }

    /// The paragraph background color as a string.
    pub fn paragraph_background(self, paragraph_background: impl Into<glib::GString>) -> Self {
        Self {
            builder: self
                .builder
                .property("paragraph-background", paragraph_background.into()),
        }
    }

    /// The paragraph background color as a [`gdk::RGBA`][crate::gdk::RGBA].
    pub fn paragraph_background_rgba(self, paragraph_background_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self
                .builder
                .property("paragraph-background-rgba", paragraph_background_rgba),
        }
    }

    /// Whether the `paragraph-background` property is set.
    pub fn paragraph_background_set(self, paragraph_background_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("paragraph-background-set", paragraph_background_set),
        }
    }

    /// Pixels of blank space above paragraphs.
    pub fn pixels_above_lines(self, pixels_above_lines: i32) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-above-lines", pixels_above_lines),
        }
    }

    /// Whether the `pixels-above-lines` property is set.
    pub fn pixels_above_lines_set(self, pixels_above_lines_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-above-lines-set", pixels_above_lines_set),
        }
    }

    /// Pixels of blank space below paragraphs.
    pub fn pixels_below_lines(self, pixels_below_lines: i32) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-below-lines", pixels_below_lines),
        }
    }

    /// Whether the `pixels-below-lines` property is set.
    pub fn pixels_below_lines_set(self, pixels_below_lines_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-below-lines-set", pixels_below_lines_set),
        }
    }

    /// Pixels of blank space between wrapped lines in a paragraph.
    pub fn pixels_inside_wrap(self, pixels_inside_wrap: i32) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-inside-wrap", pixels_inside_wrap),
        }
    }

    /// Whether the `pixels-inside-wrap` property is set.
    pub fn pixels_inside_wrap_set(self, pixels_inside_wrap_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("pixels-inside-wrap-set", pixels_inside_wrap_set),
        }
    }

    /// Width of the right margin, in pixels.
    pub fn right_margin(self, right_margin: i32) -> Self {
        Self {
            builder: self.builder.property("right-margin", right_margin),
        }
    }

    /// Whether the `right-margin` property is set.
    pub fn right_margin_set(self, right_margin_set: bool) -> Self {
        Self {
            builder: self.builder.property("right-margin-set", right_margin_set),
        }
    }

    /// Offset of text above the baseline, in Pango units.
    ///
    /// Negative values go below the baseline.
    pub fn rise(self, rise: i32) -> Self {
        Self {
            builder: self.builder.property("rise", rise),
        }
    }

    /// Whether the `rise` property is set.
    pub fn rise_set(self, rise_set: bool) -> Self {
        Self {
            builder: self.builder.property("rise-set", rise_set),
        }
    }

    /// Font size as a scale factor relative to the default font size.
    ///
    /// This properly adapts to theme changes, etc. so is recommended.
    /// Pango predefines some scales such as `PANGO_SCALE_X_LARGE`.
    pub fn scale(self, scale: f64) -> Self {
        Self {
            builder: self.builder.property("scale", scale),
        }
    }

    /// Whether the `scale` property is set.
    pub fn scale_set(self, scale_set: bool) -> Self {
        Self {
            builder: self.builder.property("scale-set", scale_set),
        }
    }

    /// Whether this tag represents a single sentence.
    ///
    /// This affects cursor movement.
    #[cfg(feature = "gtk_v4_6")]
    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))]
    pub fn sentence(self, sentence: bool) -> Self {
        Self {
            builder: self.builder.property("sentence", sentence),
        }
    }

    /// Whether the `sentence` property is set.
    pub fn sentence_set(self, sentence_set: bool) -> Self {
        Self {
            builder: self.builder.property("sentence-set", sentence_set),
        }
    }

    /// How to render invisible characters.
    pub fn show_spaces(self, show_spaces: pango::ShowFlags) -> Self {
        Self {
            builder: self.builder.property("show-spaces", show_spaces),
        }
    }

    /// Whether the `show-spaces` property is set.
    pub fn show_spaces_set(self, show_spaces_set: bool) -> Self {
        Self {
            builder: self.builder.property("show-spaces-set", show_spaces_set),
        }
    }

    /// Font size in Pango units.
    pub fn size(self, size: i32) -> Self {
        Self {
            builder: self.builder.property("size", size),
        }
    }

    /// Font size in points.
    pub fn size_points(self, size_points: f64) -> Self {
        Self {
            builder: self.builder.property("size-points", size_points),
        }
    }

    /// Whether the `size` property is set.
    pub fn size_set(self, size_set: bool) -> Self {
        Self {
            builder: self.builder.property("size-set", size_set),
        }
    }

    /// Font stretch as a [`pango::Stretch`][crate::pango::Stretch], e.g. [`pango::Stretch::Condensed`][crate::pango::Stretch::Condensed].
    pub fn stretch(self, stretch: pango::Stretch) -> Self {
        Self {
            builder: self.builder.property("stretch", stretch),
        }
    }

    /// Whether the `stretch` property is set.
    pub fn stretch_set(self, stretch_set: bool) -> Self {
        Self {
            builder: self.builder.property("stretch-set", stretch_set),
        }
    }

    /// Whether to strike through the text.
    pub fn strikethrough(self, strikethrough: bool) -> Self {
        Self {
            builder: self.builder.property("strikethrough", strikethrough),
        }
    }

    /// This property modifies the color of strikeouts.
    ///
    /// If not set, strikeouts will use the foreground color.
    pub fn strikethrough_rgba(self, strikethrough_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self
                .builder
                .property("strikethrough-rgba", strikethrough_rgba),
        }
    }

    /// If the `strikethrough-rgba` property has been set.
    pub fn strikethrough_rgba_set(self, strikethrough_rgba_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("strikethrough-rgba-set", strikethrough_rgba_set),
        }
    }

    /// Whether the `strikethrough` property is set.
    pub fn strikethrough_set(self, strikethrough_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("strikethrough-set", strikethrough_set),
        }
    }

    /// Font style as a [`pango::Style`][crate::pango::Style], e.g. [`pango::Style::Italic`][crate::pango::Style::Italic].
    pub fn style(self, style: pango::Style) -> Self {
        Self {
            builder: self.builder.property("style", style),
        }
    }

    /// Whether the `style` property is set.
    pub fn style_set(self, style_set: bool) -> Self {
        Self {
            builder: self.builder.property("style-set", style_set),
        }
    }

    /// Custom tabs for this text.
    pub fn tabs(self, tabs: &pango::TabArray) -> Self {
        Self {
            builder: self.builder.property("tabs", tabs),
        }
    }

    /// Whether the `tabs` property is set.
    pub fn tabs_set(self, tabs_set: bool) -> Self {
        Self {
            builder: self.builder.property("tabs-set", tabs_set),
        }
    }

    /// How to transform the text for display.
    #[cfg(feature = "gtk_v4_6")]
    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))]
    pub fn text_transform(self, text_transform: pango::TextTransform) -> Self {
        Self {
            builder: self.builder.property("text-transform", text_transform),
        }
    }

    /// Whether the `text-transform` property is set.
    pub fn text_transform_set(self, text_transform_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("text-transform-set", text_transform_set),
        }
    }

    /// Style of underline for this text.
    pub fn underline(self, underline: pango::Underline) -> Self {
        Self {
            builder: self.builder.property("underline", underline),
        }
    }

    /// This property modifies the color of underlines.
    ///
    /// If not set, underlines will use the foreground color.
    ///
    /// If [`underline`][struct@crate::gtk::TextTag#underline] is set to [`pango::Underline::Error`][crate::pango::Underline::Error],
    /// an alternate color may be applied instead of the foreground. Setting
    /// this property will always override those defaults.
    pub fn underline_rgba(self, underline_rgba: &gdk::RGBA) -> Self {
        Self {
            builder: self.builder.property("underline-rgba", underline_rgba),
        }
    }

    /// If the `underline-rgba` property has been set.
    pub fn underline_rgba_set(self, underline_rgba_set: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("underline-rgba-set", underline_rgba_set),
        }
    }

    /// Whether the `underline` property is set.
    pub fn underline_set(self, underline_set: bool) -> Self {
        Self {
            builder: self.builder.property("underline-set", underline_set),
        }
    }

    /// Font variant as a [`pango::Variant`][crate::pango::Variant], e.g. [`pango::Variant::SmallCaps`][crate::pango::Variant::SmallCaps].
    pub fn variant(self, variant: pango::Variant) -> Self {
        Self {
            builder: self.builder.property("variant", variant),
        }
    }

    /// Whether the `variant` property is set.
    pub fn variant_set(self, variant_set: bool) -> Self {
        Self {
            builder: self.builder.property("variant-set", variant_set),
        }
    }

    /// Font weight as an integer.
    pub fn weight(self, weight: i32) -> Self {
        Self {
            builder: self.builder.property("weight", weight),
        }
    }

    /// Whether the `weight` property is set.
    pub fn weight_set(self, weight_set: bool) -> Self {
        Self {
            builder: self.builder.property("weight-set", weight_set),
        }
    }

    /// Whether this tag represents a single word.
    ///
    /// This affects line breaks and cursor movement.
    #[cfg(feature = "gtk_v4_6")]
    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))]
    pub fn word(self, word: bool) -> Self {
        Self {
            builder: self.builder.property("word", word),
        }
    }

    /// Whether the `word` property is set.
    pub fn word_set(self, word_set: bool) -> Self {
        Self {
            builder: self.builder.property("word-set", word_set),
        }
    }

    /// Whether to wrap lines never, at word boundaries, or
    /// at character boundaries.
    pub fn wrap_mode(self, wrap_mode: gtk::WrapMode) -> Self {
        Self {
            builder: self.builder.property("wrap-mode", wrap_mode),
        }
    }

    /// Whether the `wrap-mode` property is set.
    pub fn wrap_mode_set(self, wrap_mode_set: bool) -> Self {
        Self {
            builder: self.builder.property("wrap-mode-set", wrap_mode_set),
        }
    }

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

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

/// Trait containing all [`struct@Tag`] methods.
///
/// # Implementors
///
/// [`Tag`][struct@crate::Tag]
pub trait TagExt: IsA<Tag> + sealed::Sealed + 'static {
    /// Whether to draw white spaces.
    ///
    /// This property takes precedence over the value defined by the [`SpaceDrawer`][crate::SpaceDrawer]'s
    /// [`matrix`][struct@crate::SpaceDrawer#matrix] property (only where the tag is applied).
    ///
    /// Setting this property also changes [`draw-spaces-set`][struct@crate::Tag#draw-spaces-set] to
    /// [`true`].
    #[doc(alias = "draw-spaces")]
    fn draws_spaces(&self) -> bool {
        ObjectExt::property(self.as_ref(), "draw-spaces")
    }

    /// Whether to draw white spaces.
    ///
    /// This property takes precedence over the value defined by the [`SpaceDrawer`][crate::SpaceDrawer]'s
    /// [`matrix`][struct@crate::SpaceDrawer#matrix] property (only where the tag is applied).
    ///
    /// Setting this property also changes [`draw-spaces-set`][struct@crate::Tag#draw-spaces-set] to
    /// [`true`].
    #[doc(alias = "draw-spaces")]
    fn set_draw_spaces(&self, draw_spaces: bool) {
        ObjectExt::set_property(self.as_ref(), "draw-spaces", draw_spaces)
    }

    /// Whether the [`draw-spaces`][struct@crate::Tag#draw-spaces] property is set and must be
    /// taken into account.
    #[doc(alias = "draw-spaces-set")]
    fn draws_spaces_set(&self) -> bool {
        ObjectExt::property(self.as_ref(), "draw-spaces-set")
    }

    /// Whether the [`draw-spaces`][struct@crate::Tag#draw-spaces] property is set and must be
    /// taken into account.
    #[doc(alias = "draw-spaces-set")]
    fn set_draw_spaces_set(&self, draw_spaces_set: bool) {
        ObjectExt::set_property(self.as_ref(), "draw-spaces-set", draw_spaces_set)
    }

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

    #[doc(alias = "draw-spaces-set")]
    fn connect_draw_spaces_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_draw_spaces_set_trampoline<P: IsA<Tag>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkSourceTag,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Tag::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::draw-spaces-set\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_draw_spaces_set_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl<O: IsA<Tag>> TagExt for O {}