libadwaita/auto/
wrap_layout.rs

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
// 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, JustifyMode, LengthUnit, PackDirection, WrapPolicy};
use glib::{
    prelude::*,
    signal::{connect_raw, SignalHandlerId},
    translate::*,
};
use std::boxed::Box as Box_;

glib::wrapper! {
    /// A box-like layout that can wrap into multiple lines.
    ///
    /// <picture>
    ///   <source srcset="wrap-box-dark.png" media="(prefers-color-scheme: dark)">
    ///   <img src="wrap-box.png" alt="wrap-box">
    /// </picture>
    ///
    /// [`WrapLayout`][crate::WrapLayout] is similar to `Gtk::BoxLayout`, but can wrap lines when
    /// the widgets cannot fit otherwise. Unlike `Gtk::FlowBox`, the children
    /// aren't arranged into a grid and behave more like words in a wrapping label.
    ///
    /// Like `GtkBoxLayout`, [`WrapLayout`][crate::WrapLayout] is orientable and has spacing:
    ///
    /// - [`child-spacing`][struct@crate::WrapLayout#child-spacing] between children in the same line;
    /// - [`line-spacing`][struct@crate::WrapLayout#line-spacing] between lines.
    ///
    /// ::: note
    ///     Unlike `GtkBoxLayout`, [`WrapLayout`][crate::WrapLayout] cannot follow the CSS
    ///     `border-spacing` property.
    ///
    /// Use the [`natural-line-length`][struct@crate::WrapLayout#natural-line-length] property to determine the
    /// layout's natural size, e.g. when using it in a [`gtk::Popover`][crate::gtk::Popover].
    ///
    /// Normally, a horizontal [`WrapLayout`][crate::WrapLayout] wraps left to right and top to bottom
    /// for left-to-right languages. Both of these directions can be reversed, using
    /// the [`pack-direction`][struct@crate::WrapLayout#pack-direction] and
    /// [`wrap-reverse`][struct@crate::WrapLayout#wrap-reverse] properties. Additionally, the alignment
    /// of each line can be controlled with the [`align`][struct@crate::WrapLayout#align] property.
    ///
    /// Lines can be justified using the [`justify`][struct@crate::WrapLayout#justify] property,
    /// filling the entire line by either increasing child size or spacing depending
    /// on the value. Set [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] to justify the last
    /// line as well.
    ///
    /// By default, [`WrapLayout`][crate::WrapLayout] wraps as soon as the previous line cannot fit
    /// any more children without shrinking them past their natural size. Set
    /// [`wrap-policy`][struct@crate::WrapLayout#wrap-policy] to [enum@Adw.WrapPolicy.MINIMUM] to only
    /// wrap once all the children in the previous line have been shrunk to their
    /// minimum size.
    ///
    /// To make each line take the same amount of space, set
    /// [`line-homogeneous`][struct@crate::WrapLayout#line-homogeneous] to `TRUE`.
    ///
    /// Spacing and natural line length can scale with the text scale factor, use the
    /// [`child-spacing-unit`][struct@crate::WrapLayout#child-spacing-unit],
    /// [`line-spacing-unit`][struct@crate::WrapLayout#line-spacing-unit] and/or
    /// [`natural-line-length-unit`][struct@crate::WrapLayout#natural-line-length-unit] properties to enable that
    /// behavior.
    ///
    /// See [`WrapBox`][crate::WrapBox].
    ///
    /// ## Properties
    ///
    ///
    /// #### `align`
    ///  The alignment of the children within each line.
    ///
    /// 0 means the children are placed at the start of the line, 1 means they are
    /// placed at the end of the line. 0.5 means they are placed in the middle of
    /// the line.
    ///
    /// Alignment is only used when [`justify`][struct@crate::WrapLayout#justify] is set to
    /// `ADW_JUSTIFY_NONE`, or on the last line when the
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] is `FALSE`.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `child-spacing`
    ///  The spacing between widgets on the same line.
    ///
    /// See [`child-spacing-unit`][struct@crate::WrapLayout#child-spacing-unit].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `child-spacing-unit`
    ///  The length unit for child spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`child-spacing`][struct@crate::WrapLayout#child-spacing].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `justify`
    ///  Determines whether and how each complete line should be stretched to fill
    /// the entire widget.
    ///
    /// If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched,
    /// keeping consistent spacing, so that the line fills the entire widget.
    ///
    /// If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be
    /// increased, keeping widget sizes intact. The first and last widget will be
    /// aligned with the beginning and end of the line. If the line only contains a
    /// single widget, it will be stretched regardless.
    ///
    /// If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the
    /// children will be placed together within the line, according to
    /// [`align`][struct@crate::WrapLayout#align].
    ///
    /// By default this doesn't affect the last line, as it will be incomplete. Use
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] to justify it as well.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `justify-last-line`
    ///  Whether the last line should be stretched to fill the entire widget.
    ///
    /// See [`justify`][struct@crate::WrapLayout#justify].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-homogeneous`
    ///  Whether all lines should take the same amount of space.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-spacing`
    ///  The spacing between lines.
    ///
    /// See [`line-spacing-unit`][struct@crate::WrapLayout#line-spacing-unit].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `line-spacing-unit`
    ///  The length unit for line spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`line-spacing`][struct@crate::WrapLayout#line-spacing].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `natural-line-length`
    ///  Determines the natural size for each line.
    ///
    /// It should be used to limit the line lengths, for example when used in
    /// popovers.
    ///
    /// See [`natural-line-length-unit`][struct@crate::WrapLayout#natural-line-length-unit].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `natural-line-length-unit`
    ///  The length unit for natural line length.
    ///
    /// Allows the length to vary depending on the text scale factor.
    ///
    /// See [`natural-line-length`][struct@crate::WrapLayout#natural-line-length].
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pack-direction`
    ///  The direction children are packed in each line.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `wrap-policy`
    ///  Whether wrap direction should be reversed.
    ///
    /// By default, lines wrap downwards in a horizontal box, and towards the end
    /// in a vertical box. If set to `TRUE`, they wrap upwards or towards the start
    /// respectively.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `wrap-reverse`
    ///  Whether wrap direction should be reversed.
    ///
    /// By default, lines wrap downwards in a horizontal box, and towards the end
    /// in a vertical box. If set to `TRUE`, they wrap upwards or towards the start
    /// respectively.
    ///
    /// Readable | Writeable
    /// <details><summary><h4>Orientable</h4></summary>
    ///
    ///
    /// #### `orientation`
    ///  The orientation of the orientable.
    ///
    /// Readable | Writeable
    /// </details>
    ///
    /// # Implements
    ///
    /// [`trait@gtk::prelude::LayoutManagerExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::OrientableExt`]
    #[doc(alias = "AdwWrapLayout")]
    pub struct WrapLayout(Object<ffi::AdwWrapLayout, ffi::AdwWrapLayoutClass>) @extends gtk::LayoutManager, @implements gtk::Orientable;

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

impl WrapLayout {
    /// Creates a new [`WrapLayout`][crate::WrapLayout].
    ///
    /// # Returns
    ///
    /// the newly created [`WrapLayout`][crate::WrapLayout]
    #[doc(alias = "adw_wrap_layout_new")]
    pub fn new() -> WrapLayout {
        assert_initialized_main_thread!();
        unsafe { gtk::LayoutManager::from_glib_full(ffi::adw_wrap_layout_new()).unsafe_cast() }
    }

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

    /// Gets the alignment of the children within each line.
    ///
    /// # Returns
    ///
    /// the child alignment
    #[doc(alias = "adw_wrap_layout_get_align")]
    #[doc(alias = "get_align")]
    pub fn align(&self) -> f32 {
        unsafe { ffi::adw_wrap_layout_get_align(self.to_glib_none().0) }
    }

    /// Gets spacing between widgets on the same line.
    ///
    /// # Returns
    ///
    /// spacing between widgets on the same line
    #[doc(alias = "adw_wrap_layout_get_child_spacing")]
    #[doc(alias = "get_child_spacing")]
    #[doc(alias = "child-spacing")]
    pub fn child_spacing(&self) -> i32 {
        unsafe { ffi::adw_wrap_layout_get_child_spacing(self.to_glib_none().0) }
    }

    /// Gets the length unit for child spacing.
    ///
    /// # Returns
    ///
    /// the length unit
    #[doc(alias = "adw_wrap_layout_get_child_spacing_unit")]
    #[doc(alias = "get_child_spacing_unit")]
    #[doc(alias = "child-spacing-unit")]
    pub fn child_spacing_unit(&self) -> LengthUnit {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_child_spacing_unit(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets whether and how each complete line is stretched to fill the entire widget.
    ///
    /// # Returns
    ///
    /// the justify mode
    #[doc(alias = "adw_wrap_layout_get_justify")]
    #[doc(alias = "get_justify")]
    pub fn justify(&self) -> JustifyMode {
        unsafe { from_glib(ffi::adw_wrap_layout_get_justify(self.to_glib_none().0)) }
    }

    /// Gets whether the last line should be stretched to fill the entire widget.
    ///
    /// # Returns
    ///
    /// whether the last line is justified
    #[doc(alias = "adw_wrap_layout_get_justify_last_line")]
    #[doc(alias = "get_justify_last_line")]
    #[doc(alias = "justify-last-line")]
    pub fn is_justify_last_line(&self) -> bool {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_justify_last_line(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets whether all lines should take the same amount of space.
    ///
    /// # Returns
    ///
    /// whether lines should be homogeneous
    #[doc(alias = "adw_wrap_layout_get_line_homogeneous")]
    #[doc(alias = "get_line_homogeneous")]
    #[doc(alias = "line-homogeneous")]
    pub fn is_line_homogeneous(&self) -> bool {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_line_homogeneous(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets the spacing between lines.
    ///
    /// # Returns
    ///
    /// the line spacing
    #[doc(alias = "adw_wrap_layout_get_line_spacing")]
    #[doc(alias = "get_line_spacing")]
    #[doc(alias = "line-spacing")]
    pub fn line_spacing(&self) -> i32 {
        unsafe { ffi::adw_wrap_layout_get_line_spacing(self.to_glib_none().0) }
    }

    /// Gets the length unit for line spacing.
    ///
    /// # Returns
    ///
    /// the length unit
    #[doc(alias = "adw_wrap_layout_get_line_spacing_unit")]
    #[doc(alias = "get_line_spacing_unit")]
    #[doc(alias = "line-spacing-unit")]
    pub fn line_spacing_unit(&self) -> LengthUnit {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_line_spacing_unit(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets the natural size for each line.
    ///
    /// # Returns
    ///
    /// the natural length
    #[doc(alias = "adw_wrap_layout_get_natural_line_length")]
    #[doc(alias = "get_natural_line_length")]
    #[doc(alias = "natural-line-length")]
    pub fn natural_line_length(&self) -> i32 {
        unsafe { ffi::adw_wrap_layout_get_natural_line_length(self.to_glib_none().0) }
    }

    /// Gets the length unit for line spacing.
    ///
    /// # Returns
    ///
    /// the length unit
    #[doc(alias = "adw_wrap_layout_get_natural_line_length_unit")]
    #[doc(alias = "get_natural_line_length_unit")]
    #[doc(alias = "natural-line-length-unit")]
    pub fn natural_line_length_unit(&self) -> LengthUnit {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_natural_line_length_unit(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets the direction children are packed in each line.
    ///
    /// # Returns
    ///
    /// the line direction
    #[doc(alias = "adw_wrap_layout_get_pack_direction")]
    #[doc(alias = "get_pack_direction")]
    #[doc(alias = "pack-direction")]
    pub fn pack_direction(&self) -> PackDirection {
        unsafe {
            from_glib(ffi::adw_wrap_layout_get_pack_direction(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets the policy for line wrapping.
    ///
    /// # Returns
    ///
    /// the wrap policy
    #[doc(alias = "adw_wrap_layout_get_wrap_policy")]
    #[doc(alias = "get_wrap_policy")]
    #[doc(alias = "wrap-policy")]
    pub fn wrap_policy(&self) -> WrapPolicy {
        unsafe { from_glib(ffi::adw_wrap_layout_get_wrap_policy(self.to_glib_none().0)) }
    }

    /// Gets whether wrap direction is reversed.
    ///
    /// # Returns
    ///
    /// whether wrap direction is reversed
    #[doc(alias = "adw_wrap_layout_get_wrap_reverse")]
    #[doc(alias = "get_wrap_reverse")]
    #[doc(alias = "wrap-reverse")]
    pub fn wraps_reverse(&self) -> bool {
        unsafe { from_glib(ffi::adw_wrap_layout_get_wrap_reverse(self.to_glib_none().0)) }
    }

    /// Sets the alignment of the children within each line.
    ///
    /// 0 means the children are placed at the start of the line, 1 means they are
    /// placed at the end of the line. 0.5 means they are placed in the middle of the
    /// line.
    ///
    /// Alignment is only used when [`justify`][struct@crate::WrapLayout#justify] is set to
    /// `ADW_JUSTIFY_NONE`, or on the last line when the
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] is `FALSE`.
    /// ## `align`
    /// the child alignment
    #[doc(alias = "adw_wrap_layout_set_align")]
    #[doc(alias = "align")]
    pub fn set_align(&self, align: f32) {
        unsafe {
            ffi::adw_wrap_layout_set_align(self.to_glib_none().0, align);
        }
    }

    /// Sets the spacing between widgets on the same line.
    ///
    /// See [`child-spacing-unit`][struct@crate::WrapLayout#child-spacing-unit].
    /// ## `child_spacing`
    /// the child spacing
    #[doc(alias = "adw_wrap_layout_set_child_spacing")]
    #[doc(alias = "child-spacing")]
    pub fn set_child_spacing(&self, child_spacing: i32) {
        unsafe {
            ffi::adw_wrap_layout_set_child_spacing(self.to_glib_none().0, child_spacing);
        }
    }

    /// Sets the length unit for child spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`child-spacing`][struct@crate::WrapLayout#child-spacing].
    /// ## `unit`
    /// the length unit
    #[doc(alias = "adw_wrap_layout_set_child_spacing_unit")]
    #[doc(alias = "child-spacing-unit")]
    pub fn set_child_spacing_unit(&self, unit: LengthUnit) {
        unsafe {
            ffi::adw_wrap_layout_set_child_spacing_unit(self.to_glib_none().0, unit.into_glib());
        }
    }

    /// Sets whether and how each complete line should be stretched to fill the
    /// entire widget.
    ///
    /// If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched,
    /// keeping consistent spacing, so that the line fills the entire widget.
    ///
    /// If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be
    /// increased, keeping widget sizes intact. The first and last widget will be
    /// aligned with the beginning and end of the line. If the line only contains a
    /// single widget, it will be stretched regardless.
    ///
    /// If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the children
    /// will be placed together within the line, according to
    /// [`align`][struct@crate::WrapLayout#align].
    ///
    /// By default this doesn't affect the last line, as it will be incomplete. Use
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] to justify it as well.
    /// ## `justify`
    /// the justify mode
    #[doc(alias = "adw_wrap_layout_set_justify")]
    #[doc(alias = "justify")]
    pub fn set_justify(&self, justify: JustifyMode) {
        unsafe {
            ffi::adw_wrap_layout_set_justify(self.to_glib_none().0, justify.into_glib());
        }
    }

    /// Sets whether the last line should be stretched to fill the entire widget.
    ///
    /// See [`justify`][struct@crate::WrapLayout#justify].
    /// ## `justify_last_line`
    /// whether to justify the last line
    #[doc(alias = "adw_wrap_layout_set_justify_last_line")]
    #[doc(alias = "justify-last-line")]
    pub fn set_justify_last_line(&self, justify_last_line: bool) {
        unsafe {
            ffi::adw_wrap_layout_set_justify_last_line(
                self.to_glib_none().0,
                justify_last_line.into_glib(),
            );
        }
    }

    /// Sets whether all lines should take the same amount of space.
    /// ## `homogeneous`
    /// whether lines should be homogeneous
    #[doc(alias = "adw_wrap_layout_set_line_homogeneous")]
    #[doc(alias = "line-homogeneous")]
    pub fn set_line_homogeneous(&self, homogeneous: bool) {
        unsafe {
            ffi::adw_wrap_layout_set_line_homogeneous(
                self.to_glib_none().0,
                homogeneous.into_glib(),
            );
        }
    }

    /// Sets the spacing between lines.
    ///
    /// See [`line-spacing-unit`][struct@crate::WrapLayout#line-spacing-unit].
    /// ## `line_spacing`
    /// the line spacing
    #[doc(alias = "adw_wrap_layout_set_line_spacing")]
    #[doc(alias = "line-spacing")]
    pub fn set_line_spacing(&self, line_spacing: i32) {
        unsafe {
            ffi::adw_wrap_layout_set_line_spacing(self.to_glib_none().0, line_spacing);
        }
    }

    /// Sets the length unit for line spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`line-spacing`][struct@crate::WrapLayout#line-spacing].
    /// ## `unit`
    /// the length unit
    #[doc(alias = "adw_wrap_layout_set_line_spacing_unit")]
    #[doc(alias = "line-spacing-unit")]
    pub fn set_line_spacing_unit(&self, unit: LengthUnit) {
        unsafe {
            ffi::adw_wrap_layout_set_line_spacing_unit(self.to_glib_none().0, unit.into_glib());
        }
    }

    /// Sets the natural size for each line.
    ///
    /// It should be used to limit the line lengths, for example when used in
    /// popovers.
    ///
    /// See [`natural-line-length-unit`][struct@crate::WrapLayout#natural-line-length-unit].
    /// ## `natural_line_length`
    /// the natural length
    #[doc(alias = "adw_wrap_layout_set_natural_line_length")]
    #[doc(alias = "natural-line-length")]
    pub fn set_natural_line_length(&self, natural_line_length: i32) {
        unsafe {
            ffi::adw_wrap_layout_set_natural_line_length(
                self.to_glib_none().0,
                natural_line_length,
            );
        }
    }

    /// Sets the length unit for natural line length.
    ///
    /// Allows the length to vary depending on the text scale factor.
    ///
    /// See [`natural-line-length`][struct@crate::WrapLayout#natural-line-length].
    /// ## `unit`
    /// the length unit
    #[doc(alias = "adw_wrap_layout_set_natural_line_length_unit")]
    #[doc(alias = "natural-line-length-unit")]
    pub fn set_natural_line_length_unit(&self, unit: LengthUnit) {
        unsafe {
            ffi::adw_wrap_layout_set_natural_line_length_unit(
                self.to_glib_none().0,
                unit.into_glib(),
            );
        }
    }

    /// Sets the direction children are packed in each line.
    /// ## `pack_direction`
    /// the new line direction
    #[doc(alias = "adw_wrap_layout_set_pack_direction")]
    #[doc(alias = "pack-direction")]
    pub fn set_pack_direction(&self, pack_direction: PackDirection) {
        unsafe {
            ffi::adw_wrap_layout_set_pack_direction(
                self.to_glib_none().0,
                pack_direction.into_glib(),
            );
        }
    }

    /// Sets the policy for line wrapping.
    ///
    /// If set to `ADW_WRAP_NATURAL`, the box will wrap to the next line as soon as
    /// the previous line cannot fit any more children without shrinking them past
    /// their natural size.
    ///
    /// If set to `ADW_WRAP_MINIMUM`, the box will try to fit as many children into
    /// each line as possible, shrinking them down to their minimum size before
    /// wrapping to the next line.
    /// ## `wrap_policy`
    /// the new wrap policy
    #[doc(alias = "adw_wrap_layout_set_wrap_policy")]
    #[doc(alias = "wrap-policy")]
    pub fn set_wrap_policy(&self, wrap_policy: WrapPolicy) {
        unsafe {
            ffi::adw_wrap_layout_set_wrap_policy(self.to_glib_none().0, wrap_policy.into_glib());
        }
    }

    /// Sets whether wrap direction should be reversed.
    ///
    /// By default, lines wrap downwards in a horizontal box, and towards the end
    /// in a vertical box. If set to `TRUE`, they wrap upwards or towards the start
    /// respectively.
    /// ## `wrap_reverse`
    /// whether to reverse wrap direction
    #[doc(alias = "adw_wrap_layout_set_wrap_reverse")]
    #[doc(alias = "wrap-reverse")]
    pub fn set_wrap_reverse(&self, wrap_reverse: bool) {
        unsafe {
            ffi::adw_wrap_layout_set_wrap_reverse(self.to_glib_none().0, wrap_reverse.into_glib());
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "align")]
    pub fn connect_align_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_align_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::align\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_align_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "child-spacing")]
    pub fn connect_child_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_child_spacing_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::child-spacing\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_child_spacing_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "child-spacing-unit")]
    pub fn connect_child_spacing_unit_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_child_spacing_unit_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::child-spacing-unit\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_child_spacing_unit_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "justify")]
    pub fn connect_justify_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_justify_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::justify\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_justify_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "justify-last-line")]
    pub fn connect_justify_last_line_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_justify_last_line_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::justify-last-line\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_justify_last_line_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "line-homogeneous")]
    pub fn connect_line_homogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_line_homogeneous_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::line-homogeneous\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_line_homogeneous_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "line-spacing")]
    pub fn connect_line_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_line_spacing_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::line-spacing\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_line_spacing_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "line-spacing-unit")]
    pub fn connect_line_spacing_unit_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_line_spacing_unit_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::line-spacing-unit\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_line_spacing_unit_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "natural-line-length")]
    pub fn connect_natural_line_length_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_natural_line_length_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::natural-line-length\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_natural_line_length_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "natural-line-length-unit")]
    pub fn connect_natural_line_length_unit_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_natural_line_length_unit_trampoline<
            F: Fn(&WrapLayout) + 'static,
        >(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::natural-line-length-unit\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_natural_line_length_unit_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "pack-direction")]
    pub fn connect_pack_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_pack_direction_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::pack-direction\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_pack_direction_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "wrap-policy")]
    pub fn connect_wrap_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_wrap_policy_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::wrap-policy\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_wrap_policy_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    #[doc(alias = "wrap-reverse")]
    pub fn connect_wrap_reverse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_wrap_reverse_trampoline<F: Fn(&WrapLayout) + 'static>(
            this: *mut ffi::AdwWrapLayout,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::wrap-reverse\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_wrap_reverse_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

#[cfg(feature = "v1_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
impl Default for WrapLayout {
    fn default() -> Self {
        Self::new()
    }
}

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

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

    /// The alignment of the children within each line.
    ///
    /// 0 means the children are placed at the start of the line, 1 means they are
    /// placed at the end of the line. 0.5 means they are placed in the middle of
    /// the line.
    ///
    /// Alignment is only used when [`justify`][struct@crate::WrapLayout#justify] is set to
    /// `ADW_JUSTIFY_NONE`, or on the last line when the
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] is `FALSE`.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn align(self, align: f32) -> Self {
        Self {
            builder: self.builder.property("align", align),
        }
    }

    /// The spacing between widgets on the same line.
    ///
    /// See [`child-spacing-unit`][struct@crate::WrapLayout#child-spacing-unit].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn child_spacing(self, child_spacing: i32) -> Self {
        Self {
            builder: self.builder.property("child-spacing", child_spacing),
        }
    }

    /// The length unit for child spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`child-spacing`][struct@crate::WrapLayout#child-spacing].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn child_spacing_unit(self, child_spacing_unit: LengthUnit) -> Self {
        Self {
            builder: self
                .builder
                .property("child-spacing-unit", child_spacing_unit),
        }
    }

    /// Determines whether and how each complete line should be stretched to fill
    /// the entire widget.
    ///
    /// If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched,
    /// keeping consistent spacing, so that the line fills the entire widget.
    ///
    /// If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be
    /// increased, keeping widget sizes intact. The first and last widget will be
    /// aligned with the beginning and end of the line. If the line only contains a
    /// single widget, it will be stretched regardless.
    ///
    /// If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the
    /// children will be placed together within the line, according to
    /// [`align`][struct@crate::WrapLayout#align].
    ///
    /// By default this doesn't affect the last line, as it will be incomplete. Use
    /// [`justify-last-line`][struct@crate::WrapLayout#justify-last-line] to justify it as well.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn justify(self, justify: JustifyMode) -> Self {
        Self {
            builder: self.builder.property("justify", justify),
        }
    }

    /// Whether the last line should be stretched to fill the entire widget.
    ///
    /// See [`justify`][struct@crate::WrapLayout#justify].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn justify_last_line(self, justify_last_line: bool) -> Self {
        Self {
            builder: self
                .builder
                .property("justify-last-line", justify_last_line),
        }
    }

    /// Whether all lines should take the same amount of space.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn line_homogeneous(self, line_homogeneous: bool) -> Self {
        Self {
            builder: self.builder.property("line-homogeneous", line_homogeneous),
        }
    }

    /// The spacing between lines.
    ///
    /// See [`line-spacing-unit`][struct@crate::WrapLayout#line-spacing-unit].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn line_spacing(self, line_spacing: i32) -> Self {
        Self {
            builder: self.builder.property("line-spacing", line_spacing),
        }
    }

    /// The length unit for line spacing.
    ///
    /// Allows the spacing to vary depending on the text scale factor.
    ///
    /// See [`line-spacing`][struct@crate::WrapLayout#line-spacing].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn line_spacing_unit(self, line_spacing_unit: LengthUnit) -> Self {
        Self {
            builder: self
                .builder
                .property("line-spacing-unit", line_spacing_unit),
        }
    }

    /// Determines the natural size for each line.
    ///
    /// It should be used to limit the line lengths, for example when used in
    /// popovers.
    ///
    /// See [`natural-line-length-unit`][struct@crate::WrapLayout#natural-line-length-unit].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn natural_line_length(self, natural_line_length: i32) -> Self {
        Self {
            builder: self
                .builder
                .property("natural-line-length", natural_line_length),
        }
    }

    /// The length unit for natural line length.
    ///
    /// Allows the length to vary depending on the text scale factor.
    ///
    /// See [`natural-line-length`][struct@crate::WrapLayout#natural-line-length].
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn natural_line_length_unit(self, natural_line_length_unit: LengthUnit) -> Self {
        Self {
            builder: self
                .builder
                .property("natural-line-length-unit", natural_line_length_unit),
        }
    }

    /// The direction children are packed in each line.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn pack_direction(self, pack_direction: PackDirection) -> Self {
        Self {
            builder: self.builder.property("pack-direction", pack_direction),
        }
    }

    /// Whether wrap direction should be reversed.
    ///
    /// By default, lines wrap downwards in a horizontal box, and towards the end
    /// in a vertical box. If set to `TRUE`, they wrap upwards or towards the start
    /// respectively.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn wrap_policy(self, wrap_policy: WrapPolicy) -> Self {
        Self {
            builder: self.builder.property("wrap-policy", wrap_policy),
        }
    }

    /// Whether wrap direction should be reversed.
    ///
    /// By default, lines wrap downwards in a horizontal box, and towards the end
    /// in a vertical box. If set to `TRUE`, they wrap upwards or towards the start
    /// respectively.
    #[cfg(feature = "v1_7")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
    pub fn wrap_reverse(self, wrap_reverse: bool) -> Self {
        Self {
            builder: self.builder.property("wrap-reverse", wrap_reverse),
        }
    }

    /// The orientation of the orientable.
    pub fn orientation(self, orientation: gtk::Orientation) -> Self {
        Self {
            builder: self.builder.property("orientation", orientation),
        }
    }

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