pinetime-lvgl 2.0.1

LVGL Bindings for Mynewt on PineTime Smart Watch
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
/* automatically generated by rust-bindgen */

use
super::*;

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    storage: Storage,
    align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    pub fn new(storage: Storage) -> Self {
        Self { storage, align: [] }
    }
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val {
            *byte |= mask;
        } else {
            *byte &= !mask;
        }
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            self.set_bit(index + bit_offset, val_bit_is_set);
        }
    }
}
pub type lv_coord_t = i16;
pub type lv_font_user_data_t = *mut ::cty::c_void;
pub type lv_obj_user_data_t = *mut ::cty::c_void;
pub type lv_res_t = u8;
#[doc = " Represents a point on the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_point_t {
    pub x: lv_coord_t,
    pub y: lv_coord_t,
}
#[doc = " Represents an area of the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_area_t {
    pub x1: lv_coord_t,
    pub y1: lv_coord_t,
    pub x2: lv_coord_t,
    pub y2: lv_coord_t,
}
pub type lv_align_t = u8;
#[doc = " Describes the properties of a glyph."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_font_glyph_dsc_t {
    #[doc = "< The glyph needs this space. Draw the next glyph after this width. 8 bit integer, 4 bit fractional"]
    pub adv_w: u16,
    #[doc = "< Width of the glyph's bounding box"]
    pub box_w: u16,
    #[doc = "< Height of the glyph's bounding box"]
    pub box_h: u16,
    #[doc = "< x offset of the bounding box"]
    pub ofs_x: i16,
    #[doc = "< y offset of the bounding box"]
    pub ofs_y: i16,
    #[doc = "< Bit-per-pixel: 1, 2, 4, 8"]
    pub bpp: u8,
}
#[doc = " Describe the properties of a font"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _lv_font_struct {
    #[doc = " Get a glyph's  descriptor from a font"]
    pub get_glyph_dsc: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *const _lv_font_struct,
            arg2: *mut lv_font_glyph_dsc_t,
            letter: u32,
            letter_next: u32,
        ) -> bool,
    >,
    #[doc = " Get a glyph's bitmap from a font"]
    pub get_glyph_bitmap: ::core::option::Option<
        unsafe extern "C" fn(arg1: *const _lv_font_struct, arg2: u32) -> *const u8,
    >,
    #[doc = "< The real line height where any text fits"]
    pub line_height: lv_coord_t,
    #[doc = "< Base line measured from the top of the line_height"]
    pub base_line: lv_coord_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
    #[doc = "< Distance between the top of the underline and base line (< 0 means below the base line)"]
    pub underline_position: i8,
    #[doc = "< Thickness of the underline"]
    pub underline_thickness: i8,
    #[doc = "< Store implementation specific or run_time data or caching here"]
    pub dsc: *mut ::cty::c_void,
    #[doc = "< Custom user data for font."]
    pub user_data: lv_font_user_data_t,
}
impl Default for _lv_font_struct {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl _lv_font_struct {
    #[inline]
    pub fn subpx(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
    }
    #[inline]
    pub fn set_subpx(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(subpx: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 2u8, {
            let subpx: u8 = unsafe { ::core::mem::transmute(subpx) };
            subpx as u64
        });
        __bindgen_bitfield_unit
    }
}
pub type lv_font_t = _lv_font_struct;
#[repr(C)]
#[derive(Copy, Clone)]
pub union lv_color16_t {
    pub ch: lv_color16_t__bindgen_ty_1,
    pub full: u16,
    _bindgen_union_align: u16,
}
#[repr(C)]
#[repr(align(2))]
#[derive(Default, Copy, Clone)]
pub struct lv_color16_t__bindgen_ty_1 {
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
}
impl lv_color16_t__bindgen_ty_1 {
    #[inline]
    pub fn green_h(&self) -> u16 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) }
    }
    #[inline]
    pub fn set_green_h(&mut self, val: u16) {
        unsafe {
            let val: u16 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 3u8, val as u64)
        }
    }
    #[inline]
    pub fn red(&self) -> u16 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u16) }
    }
    #[inline]
    pub fn set_red(&mut self, val: u16) {
        unsafe {
            let val: u16 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub fn blue(&self) -> u16 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 5u8) as u16) }
    }
    #[inline]
    pub fn set_blue(&mut self, val: u16) {
        unsafe {
            let val: u16 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub fn green_l(&self) -> u16 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) }
    }
    #[inline]
    pub fn set_green_l(&mut self, val: u16) {
        unsafe {
            let val: u16 = ::core::mem::transmute(val);
            self._bitfield_1.set(13usize, 3u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        green_h: u16,
        red: u16,
        blue: u16,
        green_l: u16,
    ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 3u8, {
            let green_h: u16 = unsafe { ::core::mem::transmute(green_h) };
            green_h as u64
        });
        __bindgen_bitfield_unit.set(3usize, 5u8, {
            let red: u16 = unsafe { ::core::mem::transmute(red) };
            red as u64
        });
        __bindgen_bitfield_unit.set(8usize, 5u8, {
            let blue: u16 = unsafe { ::core::mem::transmute(blue) };
            blue as u64
        });
        __bindgen_bitfield_unit.set(13usize, 3u8, {
            let green_l: u16 = unsafe { ::core::mem::transmute(green_l) };
            green_l as u64
        });
        __bindgen_bitfield_unit
    }
}
impl Default for lv_color16_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
pub type lv_color_t = lv_color16_t;
#[doc = "! @cond Doxygen_Suppress"]
pub type lv_opa_t = u8;
pub type lv_blend_mode_t = u8;
pub type lv_grad_dir_t = u8;
pub type lv_text_decor_t = u8;
pub type lv_style_int_t = i16;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_style_list_t {
    pub style_list: *mut *mut lv_style_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
    pub __bindgen_padding_0: u32,
}
impl Default for lv_style_list_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_style_list_t {
    #[inline]
    pub fn style_cnt(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u32) }
    }
    #[inline]
    pub fn set_style_cnt(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 6u8, val as u64)
        }
    }
    #[inline]
    pub fn has_local(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_has_local(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(6usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn has_trans(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_has_trans(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(7usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn skip_trans(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_skip_trans(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn ignore_trans(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ignore_trans(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(9usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn valid_cache(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_valid_cache(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(10usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn ignore_cache(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ignore_cache(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(11usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn radius_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_radius_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(12usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn opa_scale_cover(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_opa_scale_cover(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(13usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn clip_corner_off(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_clip_corner_off(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(14usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn transform_all_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_transform_all_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(15usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn pad_all_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_pad_all_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(16usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn blend_mode_all_normal(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_blend_mode_all_normal(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(17usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn bg_opa_transp(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bg_opa_transp(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(18usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn bg_opa_cover(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bg_opa_cover(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(19usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn bg_grad_dir_none(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bg_grad_dir_none(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(20usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn border_width_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_border_width_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(21usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn border_side_full(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_border_side_full(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(22usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn border_post_off(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_border_post_off(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(23usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn outline_width_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_outline_width_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(24usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn pattern_img_null(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_pattern_img_null(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(25usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn shadow_width_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_shadow_width_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(26usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn value_txt_str(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_value_txt_str(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(27usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn img_recolor_opa_transp(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_img_recolor_opa_transp(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(28usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn text_space_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_text_space_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(29usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn text_decor_none(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_text_decor_none(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(30usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn text_font_normal(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_text_font_normal(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(31usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        style_cnt: u32,
        has_local: u32,
        has_trans: u32,
        skip_trans: u32,
        ignore_trans: u32,
        valid_cache: u32,
        ignore_cache: u32,
        radius_zero: u32,
        opa_scale_cover: u32,
        clip_corner_off: u32,
        transform_all_zero: u32,
        pad_all_zero: u32,
        blend_mode_all_normal: u32,
        bg_opa_transp: u32,
        bg_opa_cover: u32,
        bg_grad_dir_none: u32,
        border_width_zero: u32,
        border_side_full: u32,
        border_post_off: u32,
        outline_width_zero: u32,
        pattern_img_null: u32,
        shadow_width_zero: u32,
        value_txt_str: u32,
        img_recolor_opa_transp: u32,
        text_space_zero: u32,
        text_decor_none: u32,
        text_font_normal: u32,
    ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 6u8, {
            let style_cnt: u32 = unsafe { ::core::mem::transmute(style_cnt) };
            style_cnt as u64
        });
        __bindgen_bitfield_unit.set(6usize, 1u8, {
            let has_local: u32 = unsafe { ::core::mem::transmute(has_local) };
            has_local as u64
        });
        __bindgen_bitfield_unit.set(7usize, 1u8, {
            let has_trans: u32 = unsafe { ::core::mem::transmute(has_trans) };
            has_trans as u64
        });
        __bindgen_bitfield_unit.set(8usize, 1u8, {
            let skip_trans: u32 = unsafe { ::core::mem::transmute(skip_trans) };
            skip_trans as u64
        });
        __bindgen_bitfield_unit.set(9usize, 1u8, {
            let ignore_trans: u32 = unsafe { ::core::mem::transmute(ignore_trans) };
            ignore_trans as u64
        });
        __bindgen_bitfield_unit.set(10usize, 1u8, {
            let valid_cache: u32 = unsafe { ::core::mem::transmute(valid_cache) };
            valid_cache as u64
        });
        __bindgen_bitfield_unit.set(11usize, 1u8, {
            let ignore_cache: u32 = unsafe { ::core::mem::transmute(ignore_cache) };
            ignore_cache as u64
        });
        __bindgen_bitfield_unit.set(12usize, 1u8, {
            let radius_zero: u32 = unsafe { ::core::mem::transmute(radius_zero) };
            radius_zero as u64
        });
        __bindgen_bitfield_unit.set(13usize, 1u8, {
            let opa_scale_cover: u32 = unsafe { ::core::mem::transmute(opa_scale_cover) };
            opa_scale_cover as u64
        });
        __bindgen_bitfield_unit.set(14usize, 1u8, {
            let clip_corner_off: u32 = unsafe { ::core::mem::transmute(clip_corner_off) };
            clip_corner_off as u64
        });
        __bindgen_bitfield_unit.set(15usize, 1u8, {
            let transform_all_zero: u32 = unsafe { ::core::mem::transmute(transform_all_zero) };
            transform_all_zero as u64
        });
        __bindgen_bitfield_unit.set(16usize, 1u8, {
            let pad_all_zero: u32 = unsafe { ::core::mem::transmute(pad_all_zero) };
            pad_all_zero as u64
        });
        __bindgen_bitfield_unit.set(17usize, 1u8, {
            let blend_mode_all_normal: u32 =
                unsafe { ::core::mem::transmute(blend_mode_all_normal) };
            blend_mode_all_normal as u64
        });
        __bindgen_bitfield_unit.set(18usize, 1u8, {
            let bg_opa_transp: u32 = unsafe { ::core::mem::transmute(bg_opa_transp) };
            bg_opa_transp as u64
        });
        __bindgen_bitfield_unit.set(19usize, 1u8, {
            let bg_opa_cover: u32 = unsafe { ::core::mem::transmute(bg_opa_cover) };
            bg_opa_cover as u64
        });
        __bindgen_bitfield_unit.set(20usize, 1u8, {
            let bg_grad_dir_none: u32 = unsafe { ::core::mem::transmute(bg_grad_dir_none) };
            bg_grad_dir_none as u64
        });
        __bindgen_bitfield_unit.set(21usize, 1u8, {
            let border_width_zero: u32 = unsafe { ::core::mem::transmute(border_width_zero) };
            border_width_zero as u64
        });
        __bindgen_bitfield_unit.set(22usize, 1u8, {
            let border_side_full: u32 = unsafe { ::core::mem::transmute(border_side_full) };
            border_side_full as u64
        });
        __bindgen_bitfield_unit.set(23usize, 1u8, {
            let border_post_off: u32 = unsafe { ::core::mem::transmute(border_post_off) };
            border_post_off as u64
        });
        __bindgen_bitfield_unit.set(24usize, 1u8, {
            let outline_width_zero: u32 = unsafe { ::core::mem::transmute(outline_width_zero) };
            outline_width_zero as u64
        });
        __bindgen_bitfield_unit.set(25usize, 1u8, {
            let pattern_img_null: u32 = unsafe { ::core::mem::transmute(pattern_img_null) };
            pattern_img_null as u64
        });
        __bindgen_bitfield_unit.set(26usize, 1u8, {
            let shadow_width_zero: u32 = unsafe { ::core::mem::transmute(shadow_width_zero) };
            shadow_width_zero as u64
        });
        __bindgen_bitfield_unit.set(27usize, 1u8, {
            let value_txt_str: u32 = unsafe { ::core::mem::transmute(value_txt_str) };
            value_txt_str as u64
        });
        __bindgen_bitfield_unit.set(28usize, 1u8, {
            let img_recolor_opa_transp: u32 =
                unsafe { ::core::mem::transmute(img_recolor_opa_transp) };
            img_recolor_opa_transp as u64
        });
        __bindgen_bitfield_unit.set(29usize, 1u8, {
            let text_space_zero: u32 = unsafe { ::core::mem::transmute(text_space_zero) };
            text_space_zero as u64
        });
        __bindgen_bitfield_unit.set(30usize, 1u8, {
            let text_decor_none: u32 = unsafe { ::core::mem::transmute(text_decor_none) };
            text_decor_none as u64
        });
        __bindgen_bitfield_unit.set(31usize, 1u8, {
            let text_font_normal: u32 = unsafe { ::core::mem::transmute(text_font_normal) };
            text_font_normal as u64
        });
        __bindgen_bitfield_unit
    }
}
#[doc = " Dummy type to make handling easier"]
pub type lv_ll_node_t = u8;
#[doc = " Description of a linked list"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_ll_t {
    pub n_size: u32,
    pub head: *mut lv_ll_node_t,
    pub tail: *mut lv_ll_node_t,
}
impl Default for lv_ll_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
pub type lv_drag_dir_t = u8;
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_draw_rect_dsc_t {
    pub radius: lv_style_int_t,
    pub bg_color: lv_color_t,
    pub bg_grad_color: lv_color_t,
    pub bg_grad_dir: lv_grad_dir_t,
    pub bg_main_color_stop: lv_style_int_t,
    pub bg_grad_color_stop: lv_style_int_t,
    pub bg_opa: lv_opa_t,
    pub bg_blend_mode: lv_blend_mode_t,
    pub border_color: lv_color_t,
    pub border_width: lv_style_int_t,
    pub border_side: lv_style_int_t,
    pub border_opa: lv_opa_t,
    pub border_blend_mode: lv_blend_mode_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
    pub outline_color: lv_color_t,
    pub outline_width: lv_style_int_t,
    pub outline_pad: lv_style_int_t,
    pub outline_opa: lv_opa_t,
    pub outline_blend_mode: lv_blend_mode_t,
    pub shadow_color: lv_color_t,
    pub shadow_width: lv_style_int_t,
    pub shadow_ofs_x: lv_style_int_t,
    pub shadow_ofs_y: lv_style_int_t,
    pub shadow_spread: lv_style_int_t,
    pub shadow_opa: lv_opa_t,
    pub shadow_blend_mode: lv_blend_mode_t,
    pub pattern_image: *const ::cty::c_void,
    pub pattern_font: *const lv_font_t,
    pub pattern_recolor: lv_color_t,
    pub pattern_opa: lv_opa_t,
    pub pattern_recolor_opa: lv_opa_t,
    pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize], u8>,
    pub pattern_blend_mode: lv_blend_mode_t,
    pub value_str: *const ::cty::c_char,
    pub value_font: *const lv_font_t,
    pub value_opa: lv_opa_t,
    pub value_color: lv_color_t,
    pub value_ofs_x: lv_style_int_t,
    pub value_ofs_y: lv_style_int_t,
    pub value_letter_space: lv_style_int_t,
    pub value_line_space: lv_style_int_t,
    pub value_align: lv_align_t,
    pub value_blend_mode: lv_blend_mode_t,
}
impl Default for lv_draw_rect_dsc_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_draw_rect_dsc_t {
    #[inline]
    pub fn border_post(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_border_post(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(border_post: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let border_post: u8 = unsafe { ::core::mem::transmute(border_post) };
            border_post as u64
        });
        __bindgen_bitfield_unit
    }
    #[inline]
    pub fn pattern_repeat(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_2.get(0usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_pattern_repeat(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_2.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_2(pattern_repeat: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let pattern_repeat: u8 = unsafe { ::core::mem::transmute(pattern_repeat) };
            pattern_repeat as u64
        });
        __bindgen_bitfield_unit
    }
}
pub type lv_bidi_dir_t = u8;
pub type lv_txt_flag_t = u8;
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_draw_label_dsc_t {
    pub color: lv_color_t,
    pub sel_color: lv_color_t,
    pub font: *const lv_font_t,
    pub opa: lv_opa_t,
    pub line_space: lv_style_int_t,
    pub letter_space: lv_style_int_t,
    pub sel_start: u32,
    pub sel_end: u32,
    pub ofs_x: lv_coord_t,
    pub ofs_y: lv_coord_t,
    pub bidi_dir: lv_bidi_dir_t,
    pub flag: lv_txt_flag_t,
    pub decor: lv_text_decor_t,
    pub blend_mode: lv_blend_mode_t,
}
impl Default for lv_draw_label_dsc_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_draw_line_dsc_t {
    pub color: lv_color_t,
    pub width: lv_style_int_t,
    pub dash_width: lv_style_int_t,
    pub dash_gap: lv_style_int_t,
    pub opa: lv_opa_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
}
impl Default for lv_draw_line_dsc_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_draw_line_dsc_t {
    #[inline]
    pub fn blend_mode(&self) -> lv_blend_mode_t {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
    }
    #[inline]
    pub fn set_blend_mode(&mut self, val: lv_blend_mode_t) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub fn round_start(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_round_start(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(2usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn round_end(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_round_end(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn raw_end(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_raw_end(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        blend_mode: lv_blend_mode_t,
        round_start: u8,
        round_end: u8,
        raw_end: u8,
    ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 2u8, {
            let blend_mode: u8 = unsafe { ::core::mem::transmute(blend_mode) };
            blend_mode as u64
        });
        __bindgen_bitfield_unit.set(2usize, 1u8, {
            let round_start: u8 = unsafe { ::core::mem::transmute(round_start) };
            round_start as u64
        });
        __bindgen_bitfield_unit.set(3usize, 1u8, {
            let round_end: u8 = unsafe { ::core::mem::transmute(round_end) };
            round_end as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let raw_end: u8 = unsafe { ::core::mem::transmute(raw_end) };
            raw_end as u64
        });
        __bindgen_bitfield_unit
    }
}
pub type lv_img_cf_t = u8;
#[repr(C)]
#[repr(align(4))]
#[derive(Default, Copy, Clone)]
pub struct lv_img_header_t {
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>,
}
impl lv_img_header_t {
    #[inline]
    pub fn cf(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u32) }
    }
    #[inline]
    pub fn set_cf(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub fn always_zero(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u32) }
    }
    #[inline]
    pub fn set_always_zero(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 3u8, val as u64)
        }
    }
    #[inline]
    pub fn reserved(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_reserved(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub fn w(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 11u8) as u32) }
    }
    #[inline]
    pub fn set_w(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(10usize, 11u8, val as u64)
        }
    }
    #[inline]
    pub fn h(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 11u8) as u32) }
    }
    #[inline]
    pub fn set_h(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(21usize, 11u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        cf: u32,
        always_zero: u32,
        reserved: u32,
        w: u32,
        h: u32,
    ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 5u8, {
            let cf: u32 = unsafe { ::core::mem::transmute(cf) };
            cf as u64
        });
        __bindgen_bitfield_unit.set(5usize, 3u8, {
            let always_zero: u32 = unsafe { ::core::mem::transmute(always_zero) };
            always_zero as u64
        });
        __bindgen_bitfield_unit.set(8usize, 2u8, {
            let reserved: u32 = unsafe { ::core::mem::transmute(reserved) };
            reserved as u64
        });
        __bindgen_bitfield_unit.set(10usize, 11u8, {
            let w: u32 = unsafe { ::core::mem::transmute(w) };
            w as u64
        });
        __bindgen_bitfield_unit.set(21usize, 11u8, {
            let h: u32 = unsafe { ::core::mem::transmute(h) };
            h as u64
        });
        __bindgen_bitfield_unit
    }
}
#[doc = " Image header it is compatible with"]
#[doc = " the result from image converter utility"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_dsc_t {
    pub header: lv_img_header_t,
    pub data_size: u32,
    pub data: *const u8,
}
impl Default for lv_img_dsc_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_draw_img_dsc_t {
    pub opa: lv_opa_t,
    pub angle: u16,
    pub pivot: lv_point_t,
    pub zoom: u16,
    pub recolor_opa: lv_opa_t,
    pub recolor: lv_color_t,
    pub blend_mode: lv_blend_mode_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
}
impl Default for lv_draw_img_dsc_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_draw_img_dsc_t {
    #[inline]
    pub fn antialias(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_antialias(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(antialias: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let antialias: u8 = unsafe { ::core::mem::transmute(antialias) };
            antialias as u64
        });
        __bindgen_bitfield_unit
    }
}
pub type lv_design_mode_t = u8;
pub type lv_design_res_t = u8;
#[doc = " The design callback is used to draw the object on the screen."]
#[doc = " It accepts the object, a mask area, and the mode in which to draw the object."]
pub type lv_design_cb_t = ::core::option::Option<
    unsafe extern "C" fn(
        obj: *mut _lv_obj_t,
        clip_area: *const lv_area_t,
        mode: lv_design_mode_t,
    ) -> lv_design_res_t,
>;
pub type lv_event_t = u8;
#[doc = " @brief Event callback."]
#[doc = " Events are used to notify the user of some action being taken on the object."]
#[doc = " For details, see ::lv_event_t."]
pub type lv_event_cb_t =
    ::core::option::Option<unsafe extern "C" fn(obj: *mut _lv_obj_t, event: lv_event_t)>;
pub type lv_signal_t = u8;
pub type lv_signal_cb_t = ::core::option::Option<
    unsafe extern "C" fn(
        obj: *mut _lv_obj_t,
        sign: lv_signal_t,
        param: *mut ::cty::c_void,
    ) -> lv_res_t,
>;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_realign_t {
    pub base: *const _lv_obj_t,
    pub xofs: lv_coord_t,
    pub yofs: lv_coord_t,
    pub align: lv_align_t,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
    pub __bindgen_padding_0: u16,
}
impl Default for lv_realign_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_realign_t {
    #[inline]
    pub fn auto_realign(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_auto_realign(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn mid_align(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_mid_align(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(1usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        auto_realign: u8,
        mid_align: u8,
    ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let auto_realign: u8 = unsafe { ::core::mem::transmute(auto_realign) };
            auto_realign as u64
        });
        __bindgen_bitfield_unit.set(1usize, 1u8, {
            let mid_align: u8 = unsafe { ::core::mem::transmute(mid_align) };
            mid_align as u64
        });
        __bindgen_bitfield_unit
    }
}
pub type lv_state_t = u8;
pub type lv_obj_t = _lv_obj_t;
pub type lv_label_align_t = u8;
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_ext_t {
    pub src: *const ::cty::c_void,
    pub offset: lv_point_t,
    pub w: lv_coord_t,
    pub h: lv_coord_t,
    pub angle: u16,
    pub pivot: lv_point_t,
    pub zoom: u16,
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
    pub __bindgen_padding_0: [u16; 3usize],
}
impl Default for lv_img_ext_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
impl lv_img_ext_t {
    #[inline]
    pub fn src_type(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
    }
    #[inline]
    pub fn set_src_type(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub fn auto_size(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_auto_size(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(2usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn cf(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) }
    }
    #[inline]
    pub fn set_cf(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub fn antialias(&self) -> u8 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
    }
    #[inline]
    pub fn set_antialias(&mut self, val: u8) {
        unsafe {
            let val: u8 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        src_type: u8,
        auto_size: u8,
        cf: u8,
        antialias: u8,
    ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
            Default::default();
        __bindgen_bitfield_unit.set(0usize, 2u8, {
            let src_type: u8 = unsafe { ::core::mem::transmute(src_type) };
            src_type as u64
        });
        __bindgen_bitfield_unit.set(2usize, 1u8, {
            let auto_size: u8 = unsafe { ::core::mem::transmute(auto_size) };
            auto_size as u64
        });
        __bindgen_bitfield_unit.set(3usize, 5u8, {
            let cf: u8 = unsafe { ::core::mem::transmute(cf) };
            cf as u64
        });
        __bindgen_bitfield_unit.set(8usize, 1u8, {
            let antialias: u8 = unsafe { ::core::mem::transmute(antialias) };
            antialias as u64
        });
        __bindgen_bitfield_unit
    }
}
#[doc = "      TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_canvas_ext_t {
    pub img: lv_img_ext_t,
    pub dsc: lv_img_dsc_t,
}
impl Default for lv_canvas_ext_t {
    fn default() -> Self {
        unsafe { ::core::mem::zeroed() }
    }
}
pub const LV_CANVAS_PART_MAIN: _bindgen_ty_36 = 0;
pub type _bindgen_ty_36 = u32;
pub type lv_canvas_part_t = u8;
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Create a canvas object"]
    #[doc = " - __`par`__: pointer to an object, it will be the parent of the new canvas"]
    #[doc = " - __`copy`__: pointer to a canvas object, if not NULL then the new object will be copied from it"]
    #[doc = " Return: pointer to the created canvas"]
    pub fn lv_canvas_create(par: *mut lv_obj_t, copy: *const lv_obj_t) -> *mut lv_obj_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Set a buffer for the canvas."]
    #[doc = " - __`buf`__: a buffer where the content of the canvas will be."]
    #[doc = " The required size is (lv_img_color_format_get_px_size(cf) * w) / 8 * h)"]
    #[doc = " It can be allocated with `lv_mem_alloc()` or"]
    #[doc = " it can be statically allocated array (e.g. static lv_color_t buf[100*50]) or"]
    #[doc = " it can be an address in RAM or external SRAM"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`w`__: width of the canvas"]
    #[doc = " - __`h`__: height of the canvas"]
    #[doc = " - __`cf`__: color format. `LV_IMG_CF_...`"]
    pub fn lv_canvas_set_buffer(
        canvas: *mut lv_obj_t,
        buf: *mut ::cty::c_void,
        w: lv_coord_t,
        h: lv_coord_t,
        cf: lv_img_cf_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Set the color of a pixel on the canvas"]
    #[doc = " @param canvas"]
    #[doc = " - __`x`__: x coordinate of the point to set"]
    #[doc = " - __`y`__: x coordinate of the point to set"]
    #[doc = " - __`c`__: color of the point"]
    pub fn lv_canvas_set_px(canvas: *mut lv_obj_t, x: lv_coord_t, y: lv_coord_t, c: lv_color_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Set the palette color of a canvas with index format. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`"]
    #[doc = " - __`canvas`__: pointer to canvas object"]
    #[doc = " - __`id`__: the palette color to set:"]
    #[doc = "   - for `LV_IMG_CF_INDEXED1`: 0..1"]
    #[doc = "   - for `LV_IMG_CF_INDEXED2`: 0..3"]
    #[doc = "   - for `LV_IMG_CF_INDEXED4`: 0..15"]
    #[doc = "   - for `LV_IMG_CF_INDEXED8`: 0..255"]
    #[doc = " - __`c`__: the color to set"]
    pub fn lv_canvas_set_palette(canvas: *mut lv_obj_t, id: u8, c: lv_color_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Get the color of a pixel on the canvas"]
    #[doc = " @param canvas"]
    #[doc = " - __`x`__: x coordinate of the point to set"]
    #[doc = " - __`y`__: x coordinate of the point to set"]
    #[doc = " Return: color of the point"]
    pub fn lv_canvas_get_px(canvas: *mut lv_obj_t, x: lv_coord_t, y: lv_coord_t) -> lv_color_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Get the image of the canvas as a pointer to an `lv_img_dsc_t` variable."]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " Return: pointer to the image descriptor."]
    pub fn lv_canvas_get_img(canvas: *mut lv_obj_t) -> *mut lv_img_dsc_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Copy a buffer to the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`to_copy`__: buffer to copy. The color format has to match with the canvas's buffer color"]
    #[doc = " format"]
    #[doc = " - __`x`__: left side of the destination position"]
    #[doc = " - __`y`__: top side of the destination position"]
    #[doc = " - __`w`__: width of the buffer to copy"]
    #[doc = " - __`h`__: height of the buffer to copy"]
    pub fn lv_canvas_copy_buf(
        canvas: *mut lv_obj_t,
        to_copy: *const ::cty::c_void,
        x: lv_coord_t,
        y: lv_coord_t,
        w: lv_coord_t,
        h: lv_coord_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Transform and image and store the result on a canvas."]
    #[doc = " - __`canvas`__: pointer to a canvas object to store the result of the transformation."]
    #[doc = " - __`img`__: pointer to an image descriptor to transform."]
    #[doc = "             Can be the image descriptor of an other canvas too (`lv_canvas_get_img()`)."]
    #[doc = " - __`angle`__: the angle of rotation (0..3600), 0.1 deg resolution"]
    #[doc = " - __`zoom`__: zoom factor (256 no zoom);"]
    #[doc = " - __`offset_x`__: offset X to tell where to put the result data on destination canvas"]
    #[doc = " - __`offset_y`__: offset X to tell where to put the result data on destination canvas"]
    #[doc = " - __`pivot_x`__: pivot X of rotation. Relative to the source canvas"]
    #[doc = "                Set to `source width / 2` to rotate around the center"]
    #[doc = " - __`pivot_y`__: pivot Y of rotation. Relative to the source canvas"]
    #[doc = "                Set to `source height / 2` to rotate around the center"]
    #[doc = " - __`antialias`__: apply anti-aliasing during the transformation. Looks better but slower."]
    pub fn lv_canvas_transform(
        canvas: *mut lv_obj_t,
        img: *mut lv_img_dsc_t,
        angle: i16,
        zoom: u16,
        offset_x: lv_coord_t,
        offset_y: lv_coord_t,
        pivot_x: i32,
        pivot_y: i32,
        antialias: bool,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Apply horizontal blur on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`area`__: the area to blur. If `NULL` the whole canvas will be blurred."]
    #[doc = " - __`r`__: radius of the blur"]
    pub fn lv_canvas_blur_hor(canvas: *mut lv_obj_t, area: *const lv_area_t, r: u16);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Apply vertical blur on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`area`__: the area to blur. If `NULL` the whole canvas will be blurred."]
    #[doc = " - __`r`__: radius of the blur"]
    pub fn lv_canvas_blur_ver(canvas: *mut lv_obj_t, area: *const lv_area_t, r: u16);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Fill the canvas with color"]
    #[doc = " - __`canvas`__: pointer to a canvas"]
    #[doc = " - __`color`__: the background color"]
    #[doc = " - __`opa`__: the desired opacity"]
    pub fn lv_canvas_fill_bg(canvas: *mut lv_obj_t, color: lv_color_t, opa: lv_opa_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw a rectangle on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`x`__: left coordinate of the rectangle"]
    #[doc = " - __`y`__: top coordinate of the rectangle"]
    #[doc = " - __`w`__: width of the rectangle"]
    #[doc = " - __`h`__: height of the rectangle"]
    #[doc = " - __`rect_dsc`__: descriptor of the rectangle"]
    pub fn lv_canvas_draw_rect(
        canvas: *mut lv_obj_t,
        x: lv_coord_t,
        y: lv_coord_t,
        w: lv_coord_t,
        h: lv_coord_t,
        rect_dsc: *const lv_draw_rect_dsc_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw a text on the canvas."]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`x`__: left coordinate of the text"]
    #[doc = " - __`y`__: top coordinate of the text"]
    #[doc = " - __`max_w`__: max width of the text. The text will be wrapped to fit into this size"]
    #[doc = " - __`label_draw_dsc`__: pointer to a valid label descriptor `lv_draw_label_dsc_t`"]
    #[doc = " - __`txt`__: text to display"]
    #[doc = " - __`align`__: align of the text (`LV_LABEL_ALIGN_LEFT/RIGHT/CENTER`)"]
    pub fn lv_canvas_draw_text(
        canvas: *mut lv_obj_t,
        x: lv_coord_t,
        y: lv_coord_t,
        max_w: lv_coord_t,
        label_draw_dsc: *mut lv_draw_label_dsc_t,
        txt: *const ::cty::c_char,
        align: lv_label_align_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw an image on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`x`__: left coordinate of the image"]
    #[doc = " - __`y`__: top coordinate of the image"]
    #[doc = " - __`src`__: image source. Can be a pointer an `lv_img_dsc_t` variable or a path an image."]
    #[doc = " - __`img_draw_dsc`__: pointer to a valid label descriptor `lv_draw_img_dsc_t`"]
    pub fn lv_canvas_draw_img(
        canvas: *mut lv_obj_t,
        x: lv_coord_t,
        y: lv_coord_t,
        src: *const ::cty::c_void,
        img_draw_dsc: *const lv_draw_img_dsc_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw a line on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`points`__: point of the line"]
    #[doc = " - __`point_cnt`__: number of points"]
    #[doc = " - __`line_draw_dsc`__: pointer to an initialized `lv_draw_line_dsc_t` variable"]
    pub fn lv_canvas_draw_line(
        canvas: *mut lv_obj_t,
        points: *const lv_point_t,
        point_cnt: u32,
        line_draw_dsc: *const lv_draw_line_dsc_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw a polygon on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`points`__: point of the polygon"]
    #[doc = " - __`point_cnt`__: number of points"]
    #[doc = " - __`poly_draw_dsc`__: pointer to an initialized `lv_draw_rect_dsc_t` variable"]
    pub fn lv_canvas_draw_polygon(
        canvas: *mut lv_obj_t,
        points: *const lv_point_t,
        point_cnt: u32,
        poly_draw_dsc: *const lv_draw_rect_dsc_t,
    );
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
    #[doc = " Draw an arc on the canvas"]
    #[doc = " - __`canvas`__: pointer to a canvas object"]
    #[doc = " - __`x`__: origo x  of the arc"]
    #[doc = " - __`y`__: origo y of the arc"]
    #[doc = " - __`r`__: radius of the arc"]
    #[doc = " - __`start_angle`__: start angle in degrees"]
    #[doc = " - __`end_angle`__: end angle in degrees"]
    #[doc = " - __`arc_draw_dsc`__: pointer to an initialized `lv_draw_line_dsc_t` variable"]
    pub fn lv_canvas_draw_arc(
        canvas: *mut lv_obj_t,
        x: lv_coord_t,
        y: lv_coord_t,
        r: lv_coord_t,
        start_angle: i32,
        end_angle: i32,
        arc_draw_dsc: *const lv_draw_line_dsc_t,
    );
}