1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
// 6 april 2015
// TODO add a uiVerifyControlType() function that can be used by control implementations to verify controls
// TODOs
// - make getters that return whether something exists accept a NULL pointer to discard the value (and thus only return that the thing exists?)
// - const-correct everything
// - normalize documentation between typedefs and structs
/**
* @defgroup container Container controls
* @defgroup dataEntry Data entry controls
* @defgroup static Static controls
* @defgroup button Buttons
* @defgroup dialogWindow Dialog windows
* @defgroup menu Menus
* @defgroup table Tables
*/
extern "C" libui_EXPORTS
// TODO add __declspec(dllimport) on windows, but only if not static
// C++ is really really really really really really dumb about enums, so screw that and just make them anonymous
// This has the advantage of being ABI-able should we ever need an ABI...
// This constant is provided because M_PI is nonstandard.
// This comes from Go's math.Pi, which in turn comes from http://oeis.org/A000796.
// TODO uiBool?
// uiForEach represents the return value from one of libui's various ForEach functions.
;
typedef struct uiInitOptions uiInitOptions;
;
_UI_EXTERN const char *;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN int ;
_UI_EXTERN void ;
_UI_EXTERN void ;
// TODO standardize the looping behavior return type, either with some enum or something, and the test expressions throughout the code
// TODO figure out what to do about looping and the exact point that the timer is rescheduled so we can document it; see https://github.com/andlabs/libui/pull/277
// TODO (also in the above link) document that this cannot be called from any thread, unlike uiQueueMain()
// TODO document that the minimum exact timing, either accuracy (timer burst, etc.) or granularity (15ms on Windows, etc.), is OS-defined
// TODO also figure out how long until the initial tick is registered on all platforms to document
// TODO also add a comment about how useful this could be in bindings, depending on the language being bound to
_UI_EXTERN void ;
_UI_EXTERN void ;
/**
* Free the memory of a returned string.
*
* @note Every time a string is returned from the library, this method should be called.
* Examples of these functions are uiWindowTitle, uiOpenFile, uiSaveFile, and uiEntryText.
* It is not required for input strings, e.g. in uiWindowSetTitle.
*
* @param text The string to free memory
*/
_UI_EXTERN void ;
/**
* Base class for GUI controls providing common methods.
*
* @struct uiControl
*/
typedef struct uiControl uiControl;
;
// TOOD add argument names to all arguments
/**
* Dispose and free all allocated resources.
*
* The platform specific APIs that actually destroy a control (and its children) are called.
*
* @note Most of the time is needed to be used directly only on the top level windows.
*
* @param c uiControl instance.
* @todo Document ownership.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Returns the control's OS-level handle.
*
* @param c uiControl instance.
* @returns OS-level handle.
* @memberof uiControl
*/
_UI_EXTERN uintptr_t ;
/**
* Returns the parent control.
*
* @param c uiControl instance.
* @returns The parent control, `NULL` if detached.
* @memberof uiControl
*/
_UI_EXTERN uiControl *;
/**
* Sets the control's parent.
*
* @param c uiControl instance.
* @param parent The parent control, `NULL` to detach.
* @todo Document ownership.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Returns whether or not the control is a top level control.
*
* @param c uiControl instance.
* @returns `TRUE` if top level control, `FALSE` otherwise.
* @memberof uiControl
*/
_UI_EXTERN int ;
/**
* Returns whether or not the control is visible.
*
* @param c uiControl instance.
* @returns `TRUE` if visible, `FALSE` otherwise.
* @memberof uiControl
*/
_UI_EXTERN int ;
/**
* Shows the control.
*
* @param c uiControl instance.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Hides the control.
*
* @param c uiControl instance.
* @note Hidden controls do not take up space within the layout.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Returns whether or not the control is enabled.
*
* Defaults to `true`.
*
* @param c uiControl instance.
* @see uiControlEnabledToUser
* @memberof uiControl
*/
_UI_EXTERN int ;
/**
* Enables the control.
*
* @param c uiControl instance.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Disables the control.
*
* @param c uiControl instance.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Allocates a uiControl.
*
* Helper to allocate new controls.
*
* @param n Size of type to allocate.
* @todo Document parameters
* @memberof uiControl @static
*/
_UI_EXTERN uiControl *;
/**
* Frees the memory associated with the control reference.
*
* @note This method is public only for writing custom controls.
*
* @param c uiControl instance.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Makes sure the control's parent can be set to @p parent.
*
* @param c uiControl instance.
* @param parent uiControl instance.
* @todo Make sure all controls have these
* @warning This will crash the application if `FALSE`.
* @memberof uiControl
*/
_UI_EXTERN void ;
/**
* Returns whether or not the control can be interacted with by the user.
*
* Checks if the control and all it's parents are enabled to make sure it can
* be interacted with by the user.
*
* @param c uiControl instance.
* @returns `TRUE` if enabled, `FALSE` otherwise.
* @see uiControlEnabled
* @memberof uiControl
*/
_UI_EXTERN int ;
// TODO Move this to private API? According to old/new.md this should be used by toplevel controls.
_UI_EXTERN void ;
/**
* A control that represents a top-level window.
*
* A window contains exactly one child control that occupied the entire window.
*
* @note Many of the uiWindow methods should be regarded as mere hints.
* The underlying system may override these or even choose to ignore them
* completely. This is especially true for many Unix systems.
*
* @warning A uiWindow can NOT be a child of another uiControl.
*
* @struct uiWindow
* @extends uiControl
* @ingroup container
*/
typedef struct uiWindow uiWindow;
/**
* Returns the window title.
*
* @param w uiWindow instance.
* @returns The window title text.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiWindow
*/
_UI_EXTERN char *;
/**
* Sets the window title.
*
* @param w uiWindow instance.
* @param title Window title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @note This method is merely a hint and may be ignored on unix platforms.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Gets the window position.
*
* Coordinates are measured from the top left corner of the screen.
*
* @param w uiWindow instance.
* @param[out] x X position of the window.
* @param[out] y Y position of the window.
* @note This method may return inaccurate or dummy values on Unix platforms.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Moves the window to the specified position.
*
* Coordinates are measured from the top left corner of the screen.
*
* @param w uiWindow instance.
* @param x New x position of the window.
* @param y New y position of the window.
* @note This method is merely a hint and may be ignored on Unix platforms.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the window moved.
*
* @param w uiWindow instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.\n
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @note The callback is not triggered when calling uiWindowSetPosition().
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Gets the window content size.
*
* @param w uiWindow instance.
* @param[out] width Window content width.
* @param[out] height Window content height.
* @note The content size does NOT include window decorations like menus or title bars.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Sets the window content size.
*
* @param w uiWindow instance.
* @param width Window content width to set.
* @param height Window content height to set.
* @note The content size does NOT include window decorations like menus or title bars.
* @note This method is merely a hint and may be ignored by the system.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Returns whether or not the window is full screen.
*
* @param w uiWindow instance.
* @returns `TRUE` if full screen, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiWindow
*/
_UI_EXTERN int ;
/**
* Sets whether or not the window is full screen.
*
* @param w uiWindow instance.
* @param fullscreen `TRUE` to make window full screen, `FALSE` otherwise.
* @note This method is merely a hint and may be ignored by the system.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the window content size is changed.
*
* @param w uiWindow instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiWindowSetContentSize().
* @note Only one callback can be registered at a time.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the window is to be closed.
*
* @param w uiWindow instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.\n
* Return:\n
* `TRUE` to destroys the window.\n
* `FALSE` to abort closing and keep the window alive and visible.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the window focus changes.
*
* @param w uiWindow instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Returns whether or not the window is focused.
*
* @param w uiWindow instance.
* @returns `TRUE` if window is focused, `FALSE` otherwise.
* @memberof uiWindow
*/
_UI_EXTERN int ;
/**
* Returns whether or not the window is borderless.
*
* @param w uiWindow instance.
* @returns `TRUE` if window is borderless, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiWindow
*/
_UI_EXTERN int ;
/**
* Sets whether or not the window is borderless.
*
* @param w uiWindow instance.
* @param borderless `TRUE` to make window borderless, `FALSE` otherwise.
* @note This method is merely a hint and may be ignored by the system.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Sets the window's child.
*
* @param w uiWindow instance.
* @param child Control to be made child.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Returns whether or not the window has a margin.
*
* @param w uiWindow instance.
* @returns `TRUE` if window has a margin, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiWindow
*/
_UI_EXTERN int ;
/**
* Sets whether or not the window has a margin.
*
* The margin size is determined by the OS defaults.
*
* @param w uiWindow instance.
* @param margined `TRUE` to set a window margin, `FALSE` otherwise.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Returns whether or not the window is user resizeable.
*
* @param w uiWindow instance.
* @returns `TRUE` if window is resizable, `FALSE` otherwise. [Default: `TRUE`]
* @memberof uiWindow
*/
_UI_EXTERN int ;
/**
* Sets whether or not the window is user resizeable.
*
* @param w uiWindow instance.
* @param resizeable `TRUE` to make window resizable, `FALSE` otherwise.
* @note This method is merely a hint and may be ignored by the system.
* @memberof uiWindow
*/
_UI_EXTERN void ;
/**
* Creates a new uiWindow.
*
* @param title Window title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param width Window width.
* @param height Window height.
* @param hasMenubar Whether or not the window should display a menu bar.
* @returns A new uiWindow instance.
* @memberof uiWindow @static
*/
_UI_EXTERN uiWindow *;
/**
* A control that visually represents a button to be clicked by the user to trigger an action.
*
* @struct uiButton
* @extends uiControl
* @ingroup button
*/
typedef struct uiButton uiButton;
/**
* Returns the button label text.
*
* @param b uiButton instance.
* @returns The text of the label.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiButton
*/
_UI_EXTERN char *;
/**
* Sets the button label text.
*
* @param b uiButton instance.
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiButton
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the button is clicked.
*
* @param b uiButton instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiButton
*/
_UI_EXTERN void ;
/**
* Creates a new button.
*
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiButton instance.
* @memberof uiButton @static
*/
_UI_EXTERN uiButton *;
/**
* A boxlike container that holds a group of controls.
*
* The contained controls are arranged to be displayed either horizontally or
* vertically next to each other.
*
* @struct uiBox
* @extends uiControl
* @ingroup container
*/
typedef struct uiBox uiBox;
/**
* Appends a control to the box.
*
* Stretchy items expand to use the remaining space within the box.
* In the case of multiple stretchy items the space is shared equally.
*
* @param b uiBox instance.
* @param child Control instance to append.
* @param stretchy `TRUE` to stretch control, `FALSE` otherwise.
* @memberof uiBox
*/
_UI_EXTERN void ;
/**
* Returns the number of controls contained within the box.
*
* @param b uiBox instance.
* @returns Number of children.
* @memberof uiBox
*/
_UI_EXTERN int ;
/**
* Removes the control at @p index from the box.
*
* @param b uiBox instance.
* @param index Index of control to be removed.
* @note The control neither destroyed nor freed.
* @memberof uiBox
*/
_UI_EXTERN void ;
/**
* Returns whether or not controls within the box are padded.
*
* Padding is defined as space between individual controls.
*
* @param b uiBox instance.
* @returns `TRUE` if controls are padded, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiBox
*/
_UI_EXTERN int ;
/**
* Sets whether or not controls within the box are padded.
*
* Padding is defined as space between individual controls.
* The padding size is determined by the OS defaults.
*
* @param b uiBox instance.
* @param padded `TRUE` to make controls padded, `FALSE` otherwise.
* @memberof uiBox
*/
_UI_EXTERN void ;
/**
* Creates a new horizontal box.
*
* Controls within the box are placed next to each other horizontally.
*
* @returns A new uiBox instance.
* @memberof uiBox @static
*/
_UI_EXTERN uiBox *;
/**
* Creates a new vertical box.
*
* Controls within the box are placed next to each other vertically.
*
* @returns A new uiBox instance.
* @memberof uiBox @static
*/
_UI_EXTERN uiBox *;
/**
* A control with a user checkable box accompanied by a text label.
*
* @struct uiCheckbox
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiCheckbox uiCheckbox;
/**
* Returns the checkbox label text.
*
* @param c uiCheckbox instance.
* @returns The text of the label.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiCheckbox
*/
_UI_EXTERN char *;
/**
* Sets the checkbox label text.
*
* @param c uiCheckbox instance.
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiCheckbox
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the checkbox is toggled by the user.
*
* @param c uiCheckbox instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that initiated the callback.\n
* @p senderData User data registered with the sender instance.\n
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiCheckboxSetChecked().
* @note Only one callback can be registered at a time.
* @memberof uiCheckbox
*/
_UI_EXTERN void ;
/**
* Returns whether or the checkbox is checked.
*
* @param c uiCheckbox instance.
* @returns `TRUE` if checked, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiCheckbox
*/
_UI_EXTERN int ;
/**
* Sets whether or not the checkbox is checked.
*
* @param c uiCheckbox instance.
* @param checked `TRUE` to check box, `FALSE` otherwise.
* @memberof uiCheckbox
*/
_UI_EXTERN void ;
/**
* Creates a new checkbox.
*
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiCheckbox instance.
* @memberof uiCheckbox @static
*/
_UI_EXTERN uiCheckbox *;
/**
* A control with a single line text entry field.
*
* @struct uiEntry
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiEntry uiEntry;
/**
* Returns the entry's text.
*
* @param e uiEntry instance.
* @returns The text of the entry.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiEntry
*/
_UI_EXTERN char *;
/**
* Sets the entry's text.
*
* @param e uiEntry instance.
* @param text Entry text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiEntry
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the user changes the entry's text.
*
* @param e uiEntry instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that initiated the callback.\n
* @p senderData User data registered with the sender instance.\n
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiEntrySetText().
* @memberof uiEntry
*/
_UI_EXTERN void ;
/**
* Returns whether or not the entry's text can be changed.
*
* @param e uiEntry instance.
* @returns `TRUE` if read only, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiEntry
*/
_UI_EXTERN int ;
/**
* Sets whether or not the entry's text is read only.
*
* @param e uiEntry instance.
* @param readonly `TRUE` to make read only, `FALSE` otherwise.
* @memberof uiEntry
*/
_UI_EXTERN void ;
/**
* Creates a new entry.
*
* @returns A new uiEntry instance.
* @memberof uiEntry @static
*/
_UI_EXTERN uiEntry *;
/**
* Creates a new entry suitable for sensitive inputs like passwords.
*
* The entered text is NOT readable by the user but masked as *******.
*
* @returns A new uiEntry instance.
* @memberof uiEntry @static
*/
_UI_EXTERN uiEntry *;
/**
* Creates a new entry suitable for search.
*
* Some systems will deliberately delay the uiEntryOnChanged() callback for
* a more natural feel.
*
* @returns A new uiEntry instance.
* @memberof uiEntry @static
*/
_UI_EXTERN uiEntry *;
/**
* A control that displays non interactive text.
*
* @struct uiLabel
* @extends uiControl
* @ingroup static
*/
typedef struct uiLabel uiLabel;
/**
* Returns the label text.
*
* @param l uiLabel instance.
* @returns The text of the label.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiLabel
*/
_UI_EXTERN char *;
/**
* Sets the label text.
*
* @param l uiLabel instance.
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiLabel
*/
_UI_EXTERN void ;
/**
* Creates a new label.
*
* @param text Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiLabel instance.
* @memberof uiLabel @static
*/
_UI_EXTERN uiLabel *;
/**
* A multi page control interface that displays one page at a time.
*
* Each page/tab has an associated label that can be selected to switch
* between pages/tabs.
*
* @struct uiTab
* @extends uiControl
* @ingroup container
*/
typedef struct uiTab uiTab;
/**
* Returns the index of the tab selected.
*
* @param c uiTab instance.
* @returns Index of the tab selected
* @memberof uiTab
*/
_UI_EXTERN int ;
/**
* Sets the tab selected.
*
* @param c uiTab instance.
* @param index Index of the tab to be selected
* @note The @p index must be in the range [0, uiTabNumPages(t) - 1].
* If out of bounds, the selection is not changed.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Registers a callback for when a tab is selected.
*
* @param t uiTab instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiTabSetSelected(),
* @note Only one callback can be registered at a time.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Appends a control in form of a page/tab with label.
*
* @param t uiTab instance.
* @param name Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param c Control to append.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Inserts a control in form of a page/tab with label at @p index.
*
* @param t uiTab instance.
* @param name Label text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param index Index at which to insert the control.
* @param c Control to insert.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Removes the control at @p index.
*
* @param t uiTab instance.
* @param index Index of the control to be removed.
* @note The control is neither destroyed nor freed.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Returns the number of pages contained.
*
* @param t uiTab instance.
* @returns Number of pages.
* @memberof uiTab
*/
_UI_EXTERN int ;
/**
* Returns whether or not the page/tab at @p index has a margin.
*
* @param t uiTab instance.
* @param index Index to check if it has a margin.
* @returns `TRUE` if the tab has a margin, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiTab
*/
_UI_EXTERN int ;
/**
* Sets whether or not the page/tab at @p index has a margin.
*
* The margin size is determined by the OS defaults.
*
* @param t uiTab instance.
* @param index Index of the tab/page to un/set margin for.
* @param margined `TRUE` to set a margin for tab at @p index, `FALSE` otherwise.
* @memberof uiTab
*/
_UI_EXTERN void ;
/**
* Creates a new tab container.
*
* @return A new uiTab instance.
* @memberof uiTab @static
*/
_UI_EXTERN uiTab *;
/**
* A control container that adds a label to the contained child control.
*
* This control is a great way of grouping related controls in combination with
* uiBox.
*
* A visual box will or will not be drawn around the child control dependent
* on the underlying OS implementation.
*
* @struct uiGroup
* @extends uiControl
* @ingroup container
*/
typedef struct uiGroup uiGroup;
/**
* Returns the group title.
*
* @param g uiGroup instance.
* @returns The group title text.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiGroup
*/
_UI_EXTERN char *;
/**
* Sets the group title.
*
* @param g uiGroup instance.
* @param title Group title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiGroup
*/
_UI_EXTERN void ;
/**
* Sets the group's child.
*
* @param g uiGroup instance.
* @param c uiControl child instance, or `NULL`.
* @memberof uiGroup
*/
_UI_EXTERN void ;
/**
* Returns whether or not the group has a margin.
*
* @param g uiGroup instance.
* @returns `TRUE` if the group has a margin, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiGroup
*/
_UI_EXTERN int ;
/**
* Sets whether or not the group has a margin.
*
* The margin size is determined by the OS defaults.
*
* @param g uiGroup instance.
* @param margined `TRUE` to set a margin, `FALSE` otherwise.
* @memberof uiGroup
*/
_UI_EXTERN void ;
/**
* Creates a new group.
*
* @param title Group title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiGroup instance.
* @memberof uiGroup @static
*/
_UI_EXTERN uiGroup *;
/**
* A control to display and modify integer values via a text field or +/- buttons.
*
* This is a convenient control for having the user enter integer values.
* Values are guaranteed to be within the specified range.
*
* The + button increases the held value by 1.\n
* The - button decreased the held value by 1.
*
* Entering a value out of range will clamp to the nearest value in range.
*
* @struct uiSpinbox
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiSpinbox uiSpinbox;
/**
* Returns the spinbox value.
*
* @param s uiSpinbox instance.
* @returns Spinbox value.
* @memberof uiSpinbox
*/
_UI_EXTERN int ;
/**
* Sets the spinbox value.
*
* @param s uiSpinbox instance.
* @param value Value to set.
* @note Setting a value out of range will clamp to the nearest value in range.
* @memberof uiSpinbox
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the spinbox value is changed by the user.
*
* @param s uiSpinbox instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiSpinboxSetValue().
* @note Only one callback can be registered at a time.
* @memberof uiSpinbox
*/
_UI_EXTERN void ;
/**
* Creates a new spinbox.
*
* The initial spinbox value equals the minimum value.
*
* In the current implementation @p min and @p max are swapped if `min>max`.
* This may change in the future though. See TODO.
*
* @param min Minimum value.
* @param max Maximum value.
* @returns A new uiSpinbox instance.
* @todo complain or disallow min>max?
* @memberof uiSpinbox @static
*/
_UI_EXTERN uiSpinbox *;
/**
* A control to display and modify integer values via a user draggable slider.
*
* Values are guaranteed to be within the specified range.
*
* Sliders by default display a tool tip showing the current value when being
* dragged.
*
* Sliders are horizontal only.
*
* @struct uiSlider
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiSlider uiSlider;
/**
* Returns the slider value.
*
* @param s uiSlider instance.
* @returns Slider value.
* @memberof uiSlider
*/
_UI_EXTERN int ;
/**
* Sets the slider value.
*
* @param s uiSlider intance.
* @param value Value to set.
* @memberof uiSlider
*/
_UI_EXTERN void ;
/**
* Returns whether or not the slider has a tool tip.
*
* @param s uiSlider instance.
* @returns `TRUE` if a tool tip is present, `FALSE` otherwise. [Default `TRUE`]
* @memberof uiSlider
*/
_UI_EXTERN int ;
/**
* Sets whether or not the slider has a tool tip.
*
* @param s uiSlider instance.
* @param hasToolTip `TRUE` to display a tool tip, `FALSE` to display no tool tip.
* @memberof uiSlider
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the slider value is changed by the user.
*
* @param s uiSlider instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiSliderSetValue().
* @note Only one callback can be registered at a time.
* @memberof uiSlider
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the slider is released from dragging.
*
* @param s uiSlider instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiSlider
*/
_UI_EXTERN void ;
/**
* Sets the slider range.
*
* @param s uiSlider instance.
* @param min Minimum value.
* @param max Maximum value.
* @todo Make sure to clamp the slider value to the nearest value in range - should
* it be out of range. Call uiSliderOnChanged() in such a case.
* @memberof uiSlider
*/
_UI_EXTERN void ;
/**
* Creates a new slider.
*
* The initial slider value equals the minimum value.
*
* In the current implementation @p min and @p max are swapped if `min>max`.
* This may change in the future though. See TODO.
*
* @param min Minimum value.
* @param max Maximum value.
* @returns A new uiSlider instance.
* @todo complain or disallow min>max?
* @memberof uiSlider @static
*/
_UI_EXTERN uiSlider *;
/**
* A control that visualizes the progress of a task via the fill level of a horizontal bar.
*
* Indeterminate values are supported via an animated bar.
*
* @struct uiProgressBar
* @extends uiControl
* @ingroup static
*/
typedef struct uiProgressBar uiProgressBar;
/**
* Returns the progress bar value.
*
* @param p uiProgressBar instance.
* @returns Progress bar value. `[Default 0]`
* @memberof uiProgressBar
*/
_UI_EXTERN int ;
/**
* Sets the progress bar value.
*
* Valid values are `[0, 100]` for displaying a solid bar imitating a percent
* value.
*
* Use a value of `-1` to render an animated bar to convey an indeterminate
* value.
*
* @param p uiProgressBar instance.
* @param n Value to set. Integer in the range of `[-1, 100]`.
* @memberof uiProgressBar
*/
_UI_EXTERN void ;
/**
* Creates a new progress bar.
*
* @returns A new uiProgressBar instance.
* @memberof uiProgressBar @static
*/
_UI_EXTERN uiProgressBar *;
/**
* A control to visually separate controls, horizontally or vertically.
*
* @struct uiSeparator
* @extends uiControl
* @ingroup static
*/
typedef struct uiSeparator uiSeparator;
/**
* Creates a new horizontal separator to separate controls being stacked vertically.
*
* @returns A new uiSeparator instance.
* @memberof uiSeparator @static
*/
_UI_EXTERN uiSeparator *;
/**
* Creates a new vertical separator to separate controls being stacked horizontally.
*
* @returns A new uiSeparator instance.
* @memberof uiSeparator @static
*/
_UI_EXTERN uiSeparator *;
/**
* A control to select one item from a predefined list of items via a drop down menu.
*
* @see uiEditableCombobox.
* @struct uiCombobox
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiCombobox uiCombobox;
/**
* Appends an item to the combo box.
*
* @param c uiCombobox instance.
* @param text Item text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Inserts an item at @p index to the combo box.
*
* @param c uiCombobox instance.
* @param index Index at which to insert the item.
* @param text Item text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Deletes an item at @p index from the combo box.
*
* @note Deleting the index of the item currently selected will move the
* selection to the next item in the combo box or `-1` if no such item exists.
*
* @param c uiCombobox instance.
* @param index Index of the item to be deleted.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Deletes all items from the combo box.
*
* @param c uiCombobox instance.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Returns the number of items contained within the combo box.
*
* @param c uiCombobox instance.
* @returns Number of items.
* @memberof uiCombobox
*/
_UI_EXTERN int ;
/**
* Returns the index of the item selected.
*
* @param c uiCombobox instance.
* @returns Index of the item selected, `-1` on empty selection. [Default `-1`]
* @memberof uiCombobox
*/
_UI_EXTERN int ;
/**
* Sets the item selected.
*
* @param c uiCombobox instance.
* @param index Index of the item to be selected, `-1` to clear selection.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Registers a callback for when a combo box item is selected.
*
* @param c uiCombobox instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiComboboxSetSelected(),
* uiComboboxInsertAt(), uiComboboxDelete(), or uiComboboxClear().
* @note Only one callback can be registered at a time.
* @memberof uiCombobox
*/
_UI_EXTERN void ;
/**
* Creates a new combo box.
*
* @returns A new uiCombobox instance.
* @memberof uiCombobox @static
*/
_UI_EXTERN uiCombobox *;
/**
* A control to select one item from a predefined list of items or enter ones own.
*
* Predefined items can be selected from a drop down menu.
*
* A customary item can be entered by the user via an editable text field.
*
* @see uiCombobox
* @struct uiEditableCombobox
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiEditableCombobox uiEditableCombobox;
/**
* Appends an item to the editable combo box.
*
* @param c uiEditableCombobox instance.
* @param text Item text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiEditableCombobox
*/
_UI_EXTERN void ;
/**
* Returns the text of the editable combo box.
*
* This text is either the text of one of the predefined list items or the
* text manually entered by the user.
*
* @param c uiEditableCombobox instance.
* @returns The editable combo box text.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiEditableCombobox
*/
_UI_EXTERN char *;
/**
* Sets the editable combo box text.
*
* @param c uiEditableCombobox instance.
* @param text Text field text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiEditableCombobox
*/
_UI_EXTERN void ;
// TODO what do we call a function that sets the currently selected item and fills the text field with it?
// editable comboboxes have no consistent concept of selected item
/**
* Registers a callback for when an editable combo box item is selected or user text changed.
*
* @param c uiEditableCombobox instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiEditableComboboxSetText().
* @note Only one callback can be registered at a time.
* @memberof uiEditableCombobox
*/
_UI_EXTERN void ;
/**
* Creates a new editable combo box.
*
* @returns A new uiEditableCombobox instance.
* @memberof uiEditableCombobox @static
*/
_UI_EXTERN uiEditableCombobox *;
/**
* A multiple choice control of check buttons from which only one can be selected at a time.
*
* @struct uiRadioButtons
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiRadioButtons uiRadioButtons;
/**
* Appends a radio button.
*
* @param r uiRadioButtons instance.
* @param text Radio button text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiRadioButtons
*/
_UI_EXTERN void ;
/**
* Returns the index of the item selected.
*
* @param r uiRadioButtons instance.
* @returns Index of the item selected, `-1` on empty selection.
* @memberof uiRadioButtons
*/
_UI_EXTERN int ;
/**
* Sets the item selected.
*
* @param r uiRadioButtons instance.
* @param index Index of the item to be selected, `-1` to clear selection.
* @memberof uiRadioButtons
*/
_UI_EXTERN void ;
/**
* Registers a callback for when radio button is selected.
*
* @param r uiRadioButtons instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiRadioButtonsSetSelected().
* @note Only one callback can be registered at a time.
* @memberof uiRadioButtons
*/
_UI_EXTERN void ;
/**
* Creates a new radio buttons instance.
*
* @returns A new uiRadioButtons instance.
* @memberof uiRadioButtons @static
*/
_UI_EXTERN uiRadioButtons *;
;
/**
* A control to enter a date and/or time.
*
* All functions operate on `struct tm` as defined in `<time.h>`.
*
* All functions assume local time and do NOT perform any time zone conversions.
*
* @warning The `struct tm` members `tm_wday` and `tm_yday` are undefined.
* @warning The `struct tm` member `tm_isdst` is ignored on windows and should be set to `-1`.
*
* @todo for Time: define what values are returned when a part is missing
*
* @struct uiDateTimePicker
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiDateTimePicker uiDateTimePicker;
/**
* Returns date and time stored in the data time picker.
*
* @param d uiDateTimePicker instance.
* @param[out] time Date and/or time as local time.
* @warning The `struct tm` members `tm_wday` and `tm_yday` are undefined.
* @memberof uiDateTimePicker
*/
_UI_EXTERN void ;
/**
* Sets date and time of the data time picker.
*
*
* @param d uiDateTimePicker instance.
* @param time Date and/or time as local time.
* @warning The `struct tm` member `tm_isdst` is ignored on windows and should be set to `-1`.
* @memberof uiDateTimePicker
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the date time picker value is changed by the user.
*
* @param d uiDateTimePicker instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiDateTimePickerSetTime().
* @note Only one callback can be registered at a time.
* @memberof uiDateTimePicker
*/
_UI_EXTERN void ;
/**
* Creates a new date picker.
*
* @returns A new uiDateTimePicker instance.
* @memberof uiDateTimePicker @static
*/
_UI_EXTERN uiDateTimePicker *;
/**
* Creates a new time picker.
*
* @returns A new uiDateTimePicker instance.
* @memberof uiDateTimePicker @static
*/
_UI_EXTERN uiDateTimePicker *;
/**
* Creates a new date and time picker.
*
* @returns A new uiDateTimePicker instance.
* @memberof uiDateTimePicker @static
*/
_UI_EXTERN uiDateTimePicker *;
/**
* A control with a multi line text entry field.
*
* @todo provide a facility for entering tab stops?
* @struct uiMultilineEntry
* @extends uiControl
* @ingroup dataEntry
*/
typedef struct uiMultilineEntry uiMultilineEntry;
/**
* Returns the multi line entry's text.
*
* @param e uiMultilineEntry instance.
* @returns The containing text.\n
* A `NUL` terminated UTF-8 string.\n
* Caller is responsible for freeing the data with `uiFreeText()`.
* @memberof uiMultilineEntry
*/
_UI_EXTERN char *;
/**
* Sets the multi line entry's text.
*
* @param e uiMultilineEntry instance.
* @param text Single/multi line text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiMultilineEntry
*/
_UI_EXTERN void ;
/**
* Appends text to the multi line entry's text.
*
* @param e uiMultilineEntry instance.
* @param text Text to append.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @memberof uiMultilineEntry
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the user changes the multi line entry's text.
*
* @param e uiMultilineEntry instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that initiated the callback.\n
* @p senderData User data registered with the sender instance.\n
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiMultilineEntrySetText()
* or uiMultilineEntryAppend().
* @note Only one callback can be registered at a time.
* @memberof uiMultilineEntry
*/
_UI_EXTERN void ;
/**
* Returns whether or not the multi line entry's text can be changed.
*
* @param e uiMultilineEntry instance.
* @returns `TRUE` if read only, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiMultilineEntry
*/
_UI_EXTERN int ;
/**
* Sets whether or not the multi line entry's text is read only.
*
* @param e uiMultilineEntry instance.
* @param readonly `TRUE` to make read only, `FALSE` otherwise.
* @memberof uiMultilineEntry
*/
_UI_EXTERN void ;
/**
* Creates a new multi line entry that visually wraps text when lines overflow.
*
* @returns A new uiMultilineEntry instance.
* @memberof uiMultilineEntry @static
*/
_UI_EXTERN uiMultilineEntry *;
/**
* Creates a new multi line entry that scrolls horizontally when lines overflow.
*
* @remark Windows does not allow for this style to be changed after creation,
* hence the two constructors.
* @returns A new uiMultilineEntry instance.
* @memberof uiMultilineEntry @static
*/
_UI_EXTERN uiMultilineEntry *;
/**
* A menu item used in conjunction with uiMenu.
*
* @struct uiMenuItem
* @ingroup static menu
*/
typedef struct uiMenuItem uiMenuItem;
/**
* Enables the menu item.
*
* @param m uiMenuItem instance.
* @memberof uiMenuItem
*/
_UI_EXTERN void ;
/**
* Disables the menu item.
*
* Menu item is grayed out and user interaction is not possible.
*
* @param m uiMenuItem instance.
* @memberof uiMenuItem
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the menu item is clicked.
*
* @param m uiMenuItem instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p window Reference to the window from which the callback got triggered.\
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiMenuItem
*/
_UI_EXTERN void ;
/**
* Returns whether or not the menu item's checkbox is checked.
*
* To be used only with items created via uiMenuAppendCheckItem().
*
* @param m uiMenuItem instance.
* @returns `TRUE` if checked, `FALSE` otherwise. [Default: `FALSE`]
* @memberof uiMenuItem
*/
_UI_EXTERN int ;
/**
* Sets whether or not the menu item's checkbox is checked.
*
* To be used only with items created via uiMenuAppendCheckItem().
*
* @param m uiMenuItem instance.
* @param checked `TRUE` to check menu item checkbox, `FALSE` otherwise.
* @memberof uiMenuItem
*/
_UI_EXTERN void ;
/**
* An application level menu bar.
*
* The various operating systems impose different requirements on the
* creation and placement of menu bar items, hence the abstraction of the
* items `Quit`, `Preferences` and `About`.
*
* An exemplary, cross platform menu bar:
*
* - File
* * New
* * Open
* * Save
* * Quit, _use uiMenuAppendQuitItem()_
* - Edit
* * Undo
* * Redo
* * Cut
* * Copy
* * Paste
* * Select All
* * Preferences, _use uiMenuAppendPreferencesItem()_
* - Help
* * About, _use uiMenuAppendAboutItem()_
*
* @struct uiMenu
* @ingroup static menu
*/
typedef struct uiMenu uiMenu;
/**
* Appends a generic menu item.
*
* @param m uiMenu instance.
* @param name Menu item text.\n
* A `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiMenuItem instance.
* @memberof uiMenu
*/
_UI_EXTERN uiMenuItem *;
/**
* Appends a generic menu item with a checkbox.
*
* @param m uiMenu instance.
* @param name Menu item text.\n
* A `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiMenuItem instance.
* @memberof uiMenu
*/
_UI_EXTERN uiMenuItem *;
/**
* Appends a new `Quit` menu item.
*
* @param m uiMenu instance.
* @returns A new uiMenuItem instance.
* @warning Only one such menu item may exist per application.
* @memberof uiMenu
*/
_UI_EXTERN uiMenuItem *;
/**
* Appends a new `Preferences` menu item.
*
* @param m uiMenu instance.
* @returns A new uiMenuItem instance.
* @warning Only one such menu item may exist per application.
* @memberof uiMenu
*/
_UI_EXTERN uiMenuItem *;
/**
* Appends a new `About` menu item.
*
* @param m uiMenu instance.
* @warning Only one such menu item may exist per application.
* @returns A new uiMenuItem instance.
* @memberof uiMenu
*/
_UI_EXTERN uiMenuItem *;
/**
* Appends a new separator.
*
* @param m uiMenu instance.
* @memberof uiMenu
*/
_UI_EXTERN void ;
/**
* Creates a new menu.
*
* Typical values are `File`, `Edit`, `Help`.
*
* @param name Menu label.\n
* A `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiMenu instance.
* @memberof uiMenu @static
*/
_UI_EXTERN uiMenu *;
/**
* File chooser dialog window to select a single file.
*
* @param parent Parent window.
* @returns File path, `NULL` on cancel.\n
* If path is not `NULL`:\n
* TODO: clarify string encoding.
* Caller is responsible for freeing the data with `uiFreeText()`.
* @note File paths are separated by the underlying OS file path separator.
* @ingroup dataEntry dialogWindow
*/
_UI_EXTERN char *;
/**
* Folder chooser dialog window to select a single folder.
*
* @param parent Parent window.
* @returns Folder path, `NULL` on cancel.\n
* If path is not `NULL`:\n
* TODO: clarify string encoding.
* Caller is responsible for freeing the data with `uiFreeText()`.
* @note File paths are separated by the underlying OS file path separator.
* @ingroup dataEntry dialogWindow
*/
_UI_EXTERN char *;
/**
* Save file dialog window.
*
* The user is asked to confirm overwriting existing files, should the chosen
* file path already exist on the system.
*
* @param parent Parent window.
* @returns File path, `NULL` on cancel.\n
* If path is not `NULL`:\n
* TODO: clarify string encoding.
* Caller is responsible for freeing the data with `uiFreeText()`.
* @note File paths are separated by the underlying OS file path separator.
* @ingroup dataEntry dialogWindow
*/
_UI_EXTERN char *;
/**
* Message box dialog window.
*
* A message box displayed in a new window indicating a common message.
*
* @param parent Parent window.
* @param title Dialog window title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param description Dialog message text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @ingroup dialogWindow
*/
_UI_EXTERN void ;
/**
* Error message box dialog window.
*
* A message box displayed in a new window indicating an error. On some systems
* this may invoke an accompanying sound.
*
* @param parent Parent window.
* @param title Dialog window title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param description Dialog message text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @ingroup dialogWindow
*/
_UI_EXTERN void ;
typedef struct uiArea uiArea;
typedef struct uiAreaHandler uiAreaHandler;
typedef struct uiAreaDrawParams uiAreaDrawParams;
typedef struct uiAreaMouseEvent uiAreaMouseEvent;
typedef struct uiAreaKeyEvent uiAreaKeyEvent;
typedef struct uiDrawContext uiDrawContext;
;
// TODO RTL layouts?
// TODO reconcile edge and corner naming
;
// TODO give a better name
// TODO document the types of width and height
_UI_EXTERN void ;
// TODO uiAreaQueueRedraw()
_UI_EXTERN void ;
_UI_EXTERN void ;
// TODO document these can only be called within Mouse() handlers
// TODO should these be allowed on scrolling areas?
// TODO decide which mouse events should be accepted; Down is the only one guaranteed to work right now
// TODO what happens to events after calling this up to and including the next mouse up?
// TODO release capture?
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN uiArea *;
_UI_EXTERN uiArea *;
;
typedef struct uiDrawPath uiDrawPath;
typedef struct uiDrawBrush uiDrawBrush;
typedef struct uiDrawStrokeParams uiDrawStrokeParams;
typedef struct uiDrawMatrix uiDrawMatrix;
typedef struct uiDrawBrushGradientStop uiDrawBrushGradientStop;
;
;
;
// this is the default for botoh cairo and Direct2D (in the latter case, from the C++ helper functions)
// Core Graphics doesn't explicitly specify a default, but NSBezierPath allows you to choose one, and this is the initial value
// so we're good to use it too!
;
;
;
;
;
_UI_EXTERN uiDrawPath *;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
// notes: angles are both relative to 0 and go counterclockwise
// TODO is the initial line segment on cairo and OS X a proper join?
// TODO what if sweep < 0?
_UI_EXTERN void ;
_UI_EXTERN void ;
// TODO quadratic bezier
_UI_EXTERN void ;
// TODO effect of these when a figure is already started
_UI_EXTERN void ;
_UI_EXTERN int ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
// TODO primitives:
// - rounded rectangles
// - elliptical arcs
// - quadratic bezier curves
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN int ;
_UI_EXTERN int ;
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
// TODO add a uiDrawPathStrokeToFill() or something like that
_UI_EXTERN void ;
_UI_EXTERN void ;
_UI_EXTERN void ;
// uiAttribute stores information about an attribute in a
// uiAttributedString.
//
// You do not create uiAttributes directly; instead, you create a
// uiAttribute of a given type using the specialized constructor
// functions. For every Unicode codepoint in the uiAttributedString,
// at most one value of each attribute type can be applied.
//
// uiAttributes are immutable and the uiAttributedString takes
// ownership of the uiAttribute object once assigned, copying its
// contents as necessary.
// TODO define whether all this, for both uiTableValue and uiAttribute, is undefined behavior or a caught error
typedef struct uiAttribute uiAttribute;
// @role uiAttribute destructor
// uiFreeAttribute() frees a uiAttribute. You generally do not need to
// call this yourself, as uiAttributedString does this for you. In fact,
// it is an error to call this function on a uiAttribute that has been
// given to a uiAttributedString. You can call this, however, if you
// created a uiAttribute that you aren't going to use later.
_UI_EXTERN void ;
// uiAttributeType holds the possible uiAttribute types that may be
// returned by uiAttributeGetType(). Refer to the documentation for
// each type's constructor function for details on each type.
;
// uiAttributeGetType() returns the type of a.
// TODO I don't like this name
_UI_EXTERN uiAttributeType ;
// uiNewFamilyAttribute() creates a new uiAttribute that changes the
// font family of the text it is applied to. family is copied; you do not
// need to keep it alive after uiNewFamilyAttribute() returns. Font
// family names are case-insensitive.
_UI_EXTERN uiAttribute *;
// uiAttributeFamily() returns the font family stored in a. The
// returned string is owned by a. It is an error to call this on a
// uiAttribute that does not hold a font family.
_UI_EXTERN const char *;
// uiNewSizeAttribute() creates a new uiAttribute that changes the
// size of the text it is applied to, in typographical points.
_UI_EXTERN uiAttribute *;
// uiAttributeSize() returns the font size stored in a. It is an error to
// call this on a uiAttribute that does not hold a font size.
_UI_EXTERN double ;
// uiTextWeight represents possible text weights. These roughly
// map to the OS/2 text weight field of TrueType and OpenType
// fonts, or to CSS weight numbers. The named constants are
// nominal values; the actual values may vary by font and by OS,
// though this isn't particularly likely. Any value between
// uiTextWeightMinimum and uiTextWeightMaximum, inclusive,
// is allowed.
//
// Note that due to restrictions in early versions of Windows, some
// fonts have "special" weights be exposed in many programs as
// separate font families. This is perhaps most notable with
// Arial Black. libui does not do this, even on Windows (because the
// DirectWrite API libui uses on Windows does not do this); to
// specify Arial Black, use family Arial and weight uiTextWeightBlack.
;
// uiNewWeightAttribute() creates a new uiAttribute that changes the
// weight of the text it is applied to. It is an error to specify a weight
// outside the range [uiTextWeightMinimum,
// uiTextWeightMaximum].
_UI_EXTERN uiAttribute *;
// uiAttributeWeight() returns the font weight stored in a. It is an error
// to call this on a uiAttribute that does not hold a font weight.
_UI_EXTERN uiTextWeight ;
// uiTextItalic represents possible italic modes for a font. Italic
// represents "true" italics where the slanted glyphs have custom
// shapes, whereas oblique represents italics that are merely slanted
// versions of the normal glyphs. Most fonts usually have one or the
// other.
;
// uiNewItalicAttribute() creates a new uiAttribute that changes the
// italic mode of the text it is applied to. It is an error to specify an
// italic mode not specified in uiTextItalic.
_UI_EXTERN uiAttribute *;
// uiAttributeItalic() returns the font italic mode stored in a. It is an
// error to call this on a uiAttribute that does not hold a font italic
// mode.
_UI_EXTERN uiTextItalic ;
// uiTextStretch represents possible stretches (also called "widths")
// of a font.
//
// Note that due to restrictions in early versions of Windows, some
// fonts have "special" stretches be exposed in many programs as
// separate font families. This is perhaps most notable with
// Arial Condensed. libui does not do this, even on Windows (because
// the DirectWrite API libui uses on Windows does not do this); to
// specify Arial Condensed, use family Arial and stretch
// uiTextStretchCondensed.
;
// uiNewStretchAttribute() creates a new uiAttribute that changes the
// stretch of the text it is applied to. It is an error to specify a strech
// not specified in uiTextStretch.
_UI_EXTERN uiAttribute *;
// uiAttributeStretch() returns the font stretch stored in a. It is an
// error to call this on a uiAttribute that does not hold a font stretch.
_UI_EXTERN uiTextStretch ;
// uiNewColorAttribute() creates a new uiAttribute that changes the
// color of the text it is applied to. It is an error to specify an invalid
// color.
_UI_EXTERN uiAttribute *;
// uiAttributeColor() returns the text color stored in a. It is an
// error to call this on a uiAttribute that does not hold a text color.
_UI_EXTERN void ;
// uiNewBackgroundAttribute() creates a new uiAttribute that
// changes the background color of the text it is applied to. It is an
// error to specify an invalid color.
_UI_EXTERN uiAttribute *;
// TODO reuse uiAttributeColor() for background colors, or make a new function...
// uiUnderline specifies a type of underline to use on text.
;
// uiNewUnderlineAttribute() creates a new uiAttribute that changes
// the type of underline on the text it is applied to. It is an error to
// specify an underline type not specified in uiUnderline.
_UI_EXTERN uiAttribute *;
// uiAttributeUnderline() returns the underline type stored in a. It is
// an error to call this on a uiAttribute that does not hold an underline
// style.
_UI_EXTERN uiUnderline ;
// uiUnderlineColor specifies the color of any underline on the text it
// is applied to, regardless of the type of underline. In addition to
// being able to specify a custom color, you can explicitly specify
// platform-specific colors for suggestion underlines; to use them
// correctly, pair them with uiUnderlineSuggestion (though they can
// be used on other types of underline as well).
//
// If an underline type is applied but no underline color is
// specified, the text color is used instead. If an underline color
// is specified without an underline type, the underline color
// attribute is ignored, but not removed from the uiAttributedString.
;
// uiNewUnderlineColorAttribute() creates a new uiAttribute that
// changes the color of the underline on the text it is applied to.
// It is an error to specify an underline color not specified in
// uiUnderlineColor.
//
// If the specified color type is uiUnderlineColorCustom, it is an
// error to specify an invalid color value. Otherwise, the color values
// are ignored and should be specified as zero.
_UI_EXTERN uiAttribute *;
// uiAttributeUnderlineColor() returns the underline color stored in
// a. It is an error to call this on a uiAttribute that does not hold an
// underline color.
_UI_EXTERN void ;
// uiOpenTypeFeatures represents a set of OpenType feature
// tag-value pairs, for applying OpenType features to text.
// OpenType feature tags are four-character codes defined by
// OpenType that cover things from design features like small
// caps and swashes to language-specific glyph shapes and
// beyond. Each tag may only appear once in any given
// uiOpenTypeFeatures instance. Each value is a 32-bit integer,
// often used as a Boolean flag, but sometimes as an index to choose
// a glyph shape to use.
//
// If a font does not support a certain feature, that feature will be
// ignored. (TODO verify this on all OSs)
//
// See the OpenType specification at
// https://www.microsoft.com/typography/otspec/featuretags.htm
// for the complete list of available features, information on specific
// features, and how to use them.
// TODO invalid features
typedef struct uiOpenTypeFeatures uiOpenTypeFeatures;
// uiOpenTypeFeaturesForEachFunc is the type of the function
// invoked by uiOpenTypeFeaturesForEach() for every OpenType
// feature in otf. Refer to that function's documentation for more
// details.
typedef ;
// @role uiOpenTypeFeatures constructor
// uiNewOpenTypeFeatures() returns a new uiOpenTypeFeatures
// instance, with no tags yet added.
_UI_EXTERN uiOpenTypeFeatures *;
// @role uiOpenTypeFeatures destructor
// uiFreeOpenTypeFeatures() frees otf.
_UI_EXTERN void ;
// uiOpenTypeFeaturesClone() makes a copy of otf and returns it.
// Changing one will not affect the other.
_UI_EXTERN uiOpenTypeFeatures *;
// uiOpenTypeFeaturesAdd() adds the given feature tag and value
// to otf. The feature tag is specified by a, b, c, and d. If there is
// already a value associated with the specified tag in otf, the old
// value is removed.
_UI_EXTERN void ;
// uiOpenTypeFeaturesRemove() removes the given feature tag
// and value from otf. If the tag is not present in otf,
// uiOpenTypeFeaturesRemove() does nothing.
_UI_EXTERN void ;
// uiOpenTypeFeaturesGet() determines whether the given feature
// tag is present in otf. If it is, *value is set to the tag's value and
// nonzero is returned. Otherwise, zero is returned.
//
// Note that if uiOpenTypeFeaturesGet() returns zero, value isn't
// changed. This is important: if a feature is not present in a
// uiOpenTypeFeatures, the feature is NOT treated as if its
// value was zero anyway. Script-specific font shaping rules and
// font-specific feature settings may use a different default value
// for a feature. You should likewise not treat a missing feature as
// having a value of zero either. Instead, a missing feature should
// be treated as having some unspecified default value.
_UI_EXTERN int ;
// uiOpenTypeFeaturesForEach() executes f for every tag-value
// pair in otf. The enumeration order is unspecified. You cannot
// modify otf while uiOpenTypeFeaturesForEach() is running.
_UI_EXTERN void ;
// uiNewFeaturesAttribute() creates a new uiAttribute that changes
// the font family of the text it is applied to. otf is copied; you may
// free it after uiNewFeaturesAttribute() returns.
_UI_EXTERN uiAttribute *;
// uiAttributeFeatures() returns the OpenType features stored in a.
// The returned uiOpenTypeFeatures object is owned by a. It is an
// error to call this on a uiAttribute that does not hold OpenType
// features.
_UI_EXTERN const uiOpenTypeFeatures *;
// uiAttributedString represents a string of UTF-8 text that can
// optionally be embellished with formatting attributes. libui
// provides the list of formatting attributes, which cover common
// formatting traits like boldface and color as well as advanced
// typographical features provided by OpenType like superscripts
// and small caps. These attributes can be combined in a variety of
// ways.
//
// Attributes are applied to runs of Unicode codepoints in the string.
// Zero-length runs are elided. Consecutive runs that have the same
// attribute type and value are merged. Each attribute is independent
// of each other attribute; overlapping attributes of different types
// do not split each other apart, but different values of the same
// attribute type do.
//
// The empty string can also be represented by uiAttributedString,
// but because of the no-zero-length-attribute rule, it will not have
// attributes.
//
// A uiAttributedString takes ownership of all attributes given to
// it, as it may need to duplicate or delete uiAttribute objects at
// any time. By extension, when you free a uiAttributedString,
// all uiAttributes within will also be freed. Each method will
// describe its own rules in more details.
//
// In addition, uiAttributedString provides facilities for moving
// between grapheme clusters, which represent a character
// from the point of view of the end user. The cursor of a text editor
// is always placed on a grapheme boundary, so you can use these
// features to move the cursor left or right by one "character".
// TODO does uiAttributedString itself need this
//
// uiAttributedString does not provide enough information to be able
// to draw itself onto a uiDrawContext or respond to user actions.
// In order to do that, you'll need to use a uiDrawTextLayout, which
// is built from the combination of a uiAttributedString and a set of
// layout-specific properties.
typedef struct uiAttributedString uiAttributedString;
// uiAttributedStringForEachAttributeFunc is the type of the function
// invoked by uiAttributedStringForEachAttribute() for every
// attribute in s. Refer to that function's documentation for more
// details.
typedef ;
// @role uiAttributedString constructor
// uiNewAttributedString() creates a new uiAttributedString from
// initialString. The string will be entirely unattributed.
_UI_EXTERN uiAttributedString *;
// @role uiAttributedString destructor
// uiFreeAttributedString() destroys the uiAttributedString s.
// It will also free all uiAttributes within.
_UI_EXTERN void ;
// uiAttributedStringString() returns the textual content of s as a
// '\0'-terminated UTF-8 string. The returned pointer is valid until
// the next change to the textual content of s.
_UI_EXTERN const char *;
// uiAttributedStringLength() returns the number of UTF-8 bytes in
// the textual content of s, excluding the terminating '\0'.
_UI_EXTERN size_t ;
// uiAttributedStringAppendUnattributed() adds the '\0'-terminated
// UTF-8 string str to the end of s. The new substring will be
// unattributed.
_UI_EXTERN void ;
// uiAttributedStringInsertAtUnattributed() adds the '\0'-terminated
// UTF-8 string str to s at the byte position specified by at. The new
// substring will be unattributed; existing attributes will be moved
// along with their text.
_UI_EXTERN void ;
// TODO add the Append and InsertAtExtendingAttributes functions
// TODO and add functions that take a string + length
// uiAttributedStringDelete() deletes the characters and attributes of
// s in the byte range [start, end).
_UI_EXTERN void ;
// TODO add a function to uiAttributedString to get an attribute's value at a specific index or in a specific range, so we can edit
// uiAttributedStringSetAttribute() sets a in the byte range [start, end)
// of s. Any existing attributes in that byte range of the same type are
// removed. s takes ownership of a; you should not use it after
// uiAttributedStringSetAttribute() returns.
_UI_EXTERN void ;
// uiAttributedStringForEachAttribute() enumerates all the
// uiAttributes in s. It is an error to modify s in f. Within f, s still
// owns the attribute; you can neither free it nor save it for later
// use.
// TODO reword the above for consistency (TODO and find out what I meant by that)
// TODO define an enumeration order (or mark it as undefined); also define how consecutive runs of identical attributes are handled here and sync with the definition of uiAttributedString itself
_UI_EXTERN void ;
// TODO const correct this somehow (the implementation needs to mutate the structure)
_UI_EXTERN size_t ;
// TODO const correct this somehow (the implementation needs to mutate the structure)
_UI_EXTERN size_t ;
// TODO const correct this somehow (the implementation needs to mutate the structure)
_UI_EXTERN size_t ;
// uiFontDescriptor provides a complete description of a font where
// one is needed. Currently, this means as the default font of a
// uiDrawTextLayout and as the data returned by uiFontButton.
// All the members operate like the respective uiAttributes.
typedef struct uiFontDescriptor uiFontDescriptor;
;
_UI_EXTERN void ;
_UI_EXTERN void ;
// uiDrawTextLayout is a concrete representation of a
// uiAttributedString that can be displayed in a uiDrawContext.
// It includes information important for the drawing of a block of
// text, including the bounding box to wrap the text within, the
// alignment of lines of text within that box, areas to mark as
// being selected, and other things.
//
// Unlike uiAttributedString, the content of a uiDrawTextLayout is
// immutable once it has been created.
//
// TODO talk about OS-specific differences with text drawing that libui can't account for...
typedef struct uiDrawTextLayout uiDrawTextLayout;
// uiDrawTextAlign specifies the alignment of lines of text in a
// uiDrawTextLayout.
// TODO should this really have Draw in the name?
;
// uiDrawTextLayoutParams describes a uiDrawTextLayout.
// DefaultFont is used to render any text that is not attributed
// sufficiently in String. Width determines the width of the bounding
// box of the text; the height is determined automatically.
typedef struct uiDrawTextLayoutParams uiDrawTextLayoutParams;
// TODO const-correct this somehow
;
// @role uiDrawTextLayout constructor
// uiDrawNewTextLayout() creates a new uiDrawTextLayout from
// the given parameters.
//
// TODO
// - allow creating a layout out of a substring
// - allow marking compositon strings
// - allow marking selections, even after creation
// - add the following functions:
// - uiDrawTextLayoutHeightForWidth() (returns the height that a layout would need to be to display the entire string at a given width)
// - uiDrawTextLayoutRangeForSize() (returns what substring would fit in a given size)
// - uiDrawTextLayoutNewWithHeight() (limits amount of string used by the height)
// - some function to fix up a range (for text editing)
_UI_EXTERN uiDrawTextLayout *;
// @role uiDrawFreeTextLayout destructor
// uiDrawFreeTextLayout() frees tl. The underlying
// uiAttributedString is not freed.
_UI_EXTERN void ;
// uiDrawText() draws tl in c with the top-left point of tl at (x, y).
_UI_EXTERN void ;
// uiDrawTextLayoutExtents() returns the width and height of tl
// in width and height. The returned width may be smaller than
// the width passed into uiDrawNewTextLayout() depending on
// how the text in tl is wrapped. Therefore, you can use this
// function to get the actual size of the text layout.
_UI_EXTERN void ;
// TODO metrics functions
// TODO number of lines visible for clipping rect, range visible for clipping rect?
/**
* A button-like control that opens a font chooser when clicked.
*
* @ŧodo SetFont, mechanics
* @todo Have a function that sets an entire font descriptor to a range in a uiAttributedString at once, for SetFont?
*
* @struct uiFontButton
* @extends uiControl
* @ingroup button dataEntry
*/
typedef struct uiFontButton uiFontButton;
/**
* Returns the selected font.
*
* @param b uiFontButton instance.
* @param[out] desc Font descriptor. [Default: OS-dependent].
* @note Make sure to call `uiFreeFontButtonFont()` to free all allocated
* resources within @p desc.
* @memberof uiFontButton
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the font is changed.
*
* @param b uiFontButton instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiFontButton
*/
_UI_EXTERN void ;
/**
* Creates a new font button.
*
* The default font is determined by the OS defaults.
*
* @returns A new uiFontButton instance.
* @memberof uiFontButton @static
*/
_UI_EXTERN uiFontButton *;
/**
* Frees a uiFontDescriptor previously filled by uiFontButtonFont().
*
* After calling this function the contents of @p desc should be assumed undefined,
* however you can safely reuse @p desc.
*
* Calling this function on a uiFontDescriptor not previously filled by
* uiFontButtonFont() results in undefined behavior.
*
* @param desc Font descriptor to free.
* @memberof uiFontButton
*/
_UI_EXTERN void ;
/**
* Keyboard modifier keys.
*
* Usable as bitmasks.
*
* @enum uiModifiers
*/
;
// TODO document drag captures
;
;
;
/**
* A control with a color indicator that opens a color chooser when clicked.
*
* The control visually represents a button with a color field representing
* the selected color.
*
* Clicking on the button opens up a color chooser in form of a color palette.
*
* @struct uiColorButton
* @extends uiControl
* @ingroup dataEntry button
*/
typedef struct uiColorButton uiColorButton;
/**
* Returns the color button color.
*
* @param b uiColorButton instance.
* @param[out] r Red. Double in range of [0, 1.0].
* @param[out] g Green. Double in range of [0, 1.0].
* @param[out] bl Blue. Double in range of [0, 1.0].
* @param[out] a Alpha. Double in range of [0, 1.0].
* @memberof uiColorButton
*/
_UI_EXTERN void ;
/**
* Sets the color button color.
*
* @param b uiColorButton instance.
* @param r Red. Double in range of [0, 1.0].
* @param g Green. Double in range of [0, 1.0].
* @param bl Blue. Double in range of [0, 1.0].
* @param a Alpha. Double in range of [0, 1.0].
* @memberof uiColorButton
*/
_UI_EXTERN void ;
/** Registers a callback for when the color is changed.
*
* @param b uiColorButton instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiColorButtonSetColor().
* @note Only one callback can be registered at a time.
* @memberof uiColorButton
*/
_UI_EXTERN void ;
/**
* Creates a new color button.
*
* @returns A new uiColorButton instance.
* @memberof uiColorButton @static
*/
_UI_EXTERN uiColorButton *;
/**
* A container control to organize contained controls as labeled fields.
*
* As the name suggests this container is perfect to create ascetically pleasing
* input forms.
*
* Each control is preceded by it's corresponding label.
*
* Labels and containers are organized into two panes, making both labels
* and containers align with each other.
*
* @struct uiForm
* @extends uiControl
* @ingroup container
*/
typedef struct uiForm uiForm;
/**
* Appends a control with a label to the form.
*
* Stretchy items expand to use the remaining space within the container.
* In the case of multiple stretchy items the space is shared equally.
*
* @param f uiForm instance.
* @param label Label text.\n
* A `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param c Control to append.
* @param stretchy `TRUE` to stretch control, `FALSE` otherwise.
* @memberof uiForm
*/
_UI_EXTERN void ;
/**
* Returns the number of controls contained within the form.
*
* @param f uiForm instance.
* @memberof uiForm
*/
_UI_EXTERN int ;
/**
* Removes the control at @p index from the form.
*
* @param f uiForm instance.
* @param index Index of the control to be removed.
* @note The control is neither destroyed nor freed.
* @memberof uiForm
*/
_UI_EXTERN void ;
/**
* Returns whether or not controls within the form are padded.
*
* Padding is defined as space between individual controls.
*
* @param f uiForm instance.
* @returns `TRUE` if controls are padded, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiForm
*/
_UI_EXTERN int ;
/**
* Sets whether or not controls within the box are padded.
*
* Padding is defined as space between individual controls.
* The padding size is determined by the OS defaults.
*
* @param f uiForm instance.
* @param padded `TRUE` to make controls padded, `FALSE` otherwise.
* @memberof uiForm
*/
_UI_EXTERN void ;
/**
* Creates a new form.
*
* @returns A new uiForm instance.
* @memberof uiForm @static
*/
_UI_EXTERN uiForm *;
/**
* Alignment specifiers to define placement within the reserved area.
*
* Used in uiGrid.
* @enum uiAlign
*/
;
/**
* Placement specifier to define placement in relation to another control.
*
* Used in uiGrid.
* @enum uiAt
*/
;
/**
* A control container to arrange containing controls in a grid.
*
* Contained controls are arranged on an imaginary grid of rows and columns.
* Controls can be placed anywhere on this grid, spanning multiple rows and/or
* columns.
*
* Additionally placed controls can be programmed to expand horizontally and/or
* vertically, sharing the remaining space among other expanded controls.
*
* Alignment options are available via @ref uiAlign attributes to determine the
* controls placement within the reserved area, should the area be bigger than
* the control itself.
*
* Controls can also be placed in relation to other controls using @ref uiAt
* attributes.
*
* @struct uiGrid
* @extends uiControl
* @ingroup container
*/
typedef struct uiGrid uiGrid;
/**
* Appends a control to the grid.
*
* @param g uiGrid instance.
* @param c The control to insert.
* @param left Placement as number of columns from the left. Integer in range of `[INT_MIN, INT_MAX]`.
* @param top Placement as number of rows from the top. Integer in range of `[INT_MIN, INT_MAX]`.
* @param xspan Number of columns to span. Integer in range of `[0, INT_MAX]`.
* @param yspan Number of rows to span. Integer in range of `[0, INT_MAX]`.
* @param hexpand `TRUE` to expand reserved area horizontally, `FALSE` otherwise.
* @param halign Horizontal alignment of the control within the reserved space.
* @param vexpand `TRUE` to expand reserved area vertically, `FALSE` otherwise.
* @param valign Vertical alignment of the control within the reserved space.
* @memberof uiGrid
*/
_UI_EXTERN void ;
/**
* Inserts a control positioned in relation to another control within the grid.
*
* @param g uiGrid instance.
* @param c The control to insert.
* @param existing The existing control to position relatively to.
* @param at Placement specifier in relation to @p existing control.
* @param xspan Number of columns to span. Integer in range of `[0, INT_MAX]`.
* @param yspan Number of rows to span. Integer in range of `[0, INT_MAX]`.
* @param hexpand `TRUE` to expand reserved area horizontally, `FALSE` otherwise.
* @param halign Horizontal alignment of the control within the reserved space.
* @param vexpand `TRUE` to expand reserved area vertically, `FALSE` otherwise.
* @param valign Vertical alignment of the control within the reserved space.
* @memberof uiGrid
*/
_UI_EXTERN void ;
/**
* Returns whether or not controls within the grid are padded.
*
* Padding is defined as space between individual controls.
*
* @param g uiGrid instance.
* @returns `TRUE` if controls are padded, `FALSE` otherwise. [Default: `TODO`]
* @memberof uiGrid
*/
_UI_EXTERN int ;
/**
* Sets whether or not controls within the grid are padded.
*
* Padding is defined as space between individual controls.
* The padding size is determined by the OS defaults.
*
* @param g uiGrid instance.
* @param padded `TRUE` to make controls padded, `FALSE` otherwise.
* @memberof uiGrid
*/
_UI_EXTERN void ;
/**
* Creates a new grid.
*
* @returns A new uiGrid instance.
* @memberof uiGrid @static
*/
_UI_EXTERN uiGrid *;
/**
* A container for an image to be displayed on screen.
*
* The container can hold multiple representations of the same image with the
* _same_ aspect ratio but in different resolutions to support high-density
* displays.
*
* Common image dimension scale factors are `1x` and `2x`. Providing higher
* density representations is entirely optional.
*
* The system will automatically determine the correct image to render depending
* on the screen's pixel density.
*
* uiImage only supports premultiplied 32-bit RGBA images.
*
* No image file loading or image format conversion utilities are provided.
*
* @struct uiImage
* @ingroup static
*/
typedef struct uiImage uiImage;
/**
* Creates a new image container.
*
* Dimensions are measured in points. This is most commonly the pixel size
* of the `1x` scaled image.
*
* @param width Width in points.
* @param height Height in points.
* @returns A new uiImage instance.
* @memberof uiImage @static
*/
_UI_EXTERN uiImage *;
/**
* Frees the image container and all associated resources.
*
* @param i uiImage instance.
* @memberof uiImage
*/
_UI_EXTERN void ;
/**
* Appends a new image representation.
*
* @param i uiImage instance.
* @param pixels Byte array of premultiplied pixels in [R G B A] order.\n
* `((uint8_t *) pixels)[0]` equals the **R** of the first pixel,
* `[3]` the **A** of the first pixel.\n
* `pixels` must be at least `byteStride * pixelHeight` bytes long.\n
* Data is copied internally. Ownership is not transferred.
* @param pixelWidth Width in pixels.
* @param pixelHeight Height in pixels.
* @param byteStride Number of bytes per row of the pixel array.
* @todo see if we either need the stride or can provide a way to get the OS-preferred stride (in cairo we do)
* @todo use const void * for const correctness
* @memberof uiImage
*/
_UI_EXTERN void ;
/**
* @addtogroup table
* @{
*
* Types and methods for organizing and displaying tabular data.
*
* Tables follow the concept of separation of concerns, similar to common
* patterns like model-view-controller or model-view-adapter.
*
* They consist of three main components:
*
* - uiTableModel acts as a delegate for the underlying data store. Its purpose
* is to provide the data for views and inform about any updates.
* - uiTable represents the view. Its purpose is to display the data provided
* by the model as well as provide an interface to the user to modify data.
* - uiTableModelHandler takes on the role of controller and model. It provides
* the actual data while also handling data edits.
*
* To get started:
*
* 1. Implement all of the methods defined in uiTableModelHandler.
* This involves defining columns, their data types as well as getters and
* setters for each table cell.
* 2. Wrap the uiTableModelHandler from step 1 in a uiTableModel object.
* 3. Create a new uiTable using the model created in step 2.
* Start adding columns to your table. Each table column is backed by
* one or more model columns.
*
* You can create multiple differing views (uiTable) using the same
* uiTableModel.
*
* @}
*/
/**
* Container to store values used in container related methods.
*
* uiTableValue objects are immutable.
*
* uiTable and uiTableModel methods take ownership of the uiTableValue objects
* when passed as parameter. Exception: uiNewTableValueImage().
*
* uiTable and uiTableModel methods retain ownership when returning uiTableValue
* objects. Exception: uiTableValueImage().
*
* @struct uiTableValue
* @ingroup table
*/
typedef struct uiTableValue uiTableValue;
/**
* Frees the uiTableValue.
*
* @param v Table value to free.
*
* @warning This function is to be used only on uiTableValue objects that
* have NOT been passed to uiTable or uiTableModel - as these
* take ownership of the object.\n
* Use this for freeing erroneously created values or when directly
* calling uiTableModelHandler without transferring ownership to
* uiTable or uiTableModel.
* @memberof uiTableValue
*/
_UI_EXTERN void ;
/**
* uiTableValue types.
*
* @todo Define whether calling any of the getters on the wrong type is
* undefined behavior or caught error.
* @enum uiTableValueType
*/
;
/**
* Gets the uiTableValue type.
*
* @param v Table value.
* @returns Table value type.
* @memberof uiTableValue
*/
_UI_EXTERN uiTableValueType ;
/**
* Creates a new table value to store a text string.
*
* @param str String value.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @returns A new uiTableValue instance.
* @memberof uiTableValue @static
*/
_UI_EXTERN uiTableValue *;
/**
* Returns the string value held internally.
*
* To be used only on uiTableValue objects of type uiTableValueTypeString.
*
* @param v Table value.
* @returns String value.\n
* A `NUL` terminated UTF-8 string.\n
* Data remains owned by @p v, do **NOT** call `uiFreeText()`.
* @memberof uiTableValue
*/
_UI_EXTERN const char *;
/**
* Creates a new table value to store an image.
*
* @param img Image.\n
* Data is NOT copied and needs to kept alive.
* @returns A new uiTableValue instance.
* @warning Unlike other uiTableValue constructors, uiNewTableValueImage() does
* NOT copy the image to save time and space. Make sure the image
* data stays valid while in use by the library.
* As a general rule: if the constructor is called via the
* uiTableModelHandler, the image is safe to free once execution
* returns to ANY of your code.
* @memberof uiTableValue @static
*/
_UI_EXTERN uiTableValue *;
/**
* Returns a reference to the image contained.
*
* To be used only on uiTableValue objects of type uiTableValueTypeImage.
*
* @param v Table value.
* @returns Image.\n
* Data is owned by the caller of uiNewTableValueImage().
* @warning The image returned is not owned by the object @p v,
* hence no lifetime guarantees can be made.
* @memberof uiTableValue
*/
_UI_EXTERN uiImage *;
/**
* Creates a new table value to store an integer.
*
* This value type can be used in conjunction with properties like
* column editable [`TRUE`, `FALSE`] or controls like progress bars and
* checkboxes. For these, consult uiProgressBar and uiCheckbox for the allowed
* integer ranges.
*
* @param i Integer value.
* @returns A new uiTableValue instance.
* @memberof uiTableValue @static
*/
_UI_EXTERN uiTableValue *;
/**
* Returns the integer value held internally.
*
* To be used only on uiTableValue objects of type uiTableValueTypeInt.
*
* @param v Table value.
* @returns Integer value.
* @memberof uiTableValue
*/
_UI_EXTERN int ;
/**
* Creates a new table value to store a color in.
*
* @param r Red. Double in range of [0, 1.0].
* @param g Green. Double in range of [0, 1.0].
* @param b Blue. Double in range of [0, 1.0].
* @param a Alpha. Double in range of [0, 1.0].
* @returns A new uiTableValue instance.
* @memberof uiTableValue @static
*/
_UI_EXTERN uiTableValue *;
/**
* Returns the color value held internally.
*
* To be used only on uiTableValue objects of type uiTableValueTypeColor.
*
* @param v Table value.
* @param[out] r Red. Double in range of [0, 1.0].
* @param[out] g Green. Double in range of [0, 1.0].
* @param[out] b Blue. Double in range of [0, 1.0].
* @param[out] a Alpha. Double in range of [0, 1.0].
* @memberof uiTableValue
*/
_UI_EXTERN void ;
/**
* Sort indicators.
*
* Generic sort indicators to display sorting direction.
*
* @enum uiSortIndicator
* @ingroup table
*/
;
/**
* Table model delegate to retrieve data and inform about model changes.
*
* This is a wrapper around uiTableModelHandler where the actual data is
* held.
*
* The main purpose it to provide methods to the developer to signal that
* underlying data has changed.
*
* Row indexes match both the row indexes in uiTable and uiTableModelHandler.
*
* A uiTableModel can be used as the backing store for multiple uiTable views.
*
* Once created, the number of columns and their data types are not allowed
* to change.
*
* @warning Not informing the uiTableModel about out-of-band data changes is
* an error. User edits via uiTable do *not* fall in this category.
* @struct uiTableModel
* @ingroup table
*/
typedef struct uiTableModel uiTableModel;
/**
* Developer defined methods for data retrieval and setting.
*
* These methods get called whenever the associated uiTableModel needs to
* retrieve data or a uiTable wants to set data.
*
* @warning These methods are NOT allowed to change as soon as the
* uiTableModelHandler is associated with a uiTableModel.
* @todo Validate ranges
* @todo Validate types on each getter/setter call (? table columns only?)
* @struct uiTableModelHandler
* @ingroup table
*/
typedef struct uiTableModelHandler uiTableModelHandler;
;
/**
* Creates a new table model.
*
* @param mh Table model handler.
* @returns A new uiTableModel instance.
* @memberof uiTableModel @static
*/
_UI_EXTERN uiTableModel *;
/**
* Frees the table model.
*
* @param m Table model to free.
* @warning It is an error to free table models currently associated with a
* uiTable.
* @memberof uiTableModel
*/
_UI_EXTERN void ;
/**
* Informs all associated uiTable views that a new row has been added.
*
* You must insert the row data in your model before calling this function.
*
* NumRows() must represent the new row count before you call this function.
*
* @param m Table model that has changed.
* @param newIndex Index of the row that has been added.
* @memberof uiTableModel
*/
_UI_EXTERN void ;
/**
* Informs all associated uiTable views that a row has been changed.
*
* You do NOT need to call this in your SetCellValue() handlers, but NEED
* to call this if your data changes at any other point.
*
* @param m Table model that has changed.
* @param index Index of the row that has changed.
* @memberof uiTableModel
*/
_UI_EXTERN void ;
/**
* Informs all associated uiTable views that a row has been deleted.
*
* You must delete the row from your model before you call this function.
*
* NumRows() must represent the new row count before you call this function.
*
* @param m Table model that has changed.
* @param oldIndex Index of the row that has been deleted.
* @memberof uiTableModel
*/
_UI_EXTERN void ;
// TODO reordering/moving
/** Parameter to editable model columns to signify all rows are never editable. */
/** Parameter to editable model columns to signify all rows are always editable. */
/**
* Optional parameters to control the appearance of text columns.
*
* @struct uiTableTextColumnOptionalParams
* @ingroup table
*/
typedef struct uiTableTextColumnOptionalParams uiTableTextColumnOptionalParams;
;
/**
* Table parameters passed to uiNewTable().
*
* @struct uiTableParams
* @ingroup table
*/
typedef struct uiTableParams uiTableParams;
;
/**
* A control to display data in a tabular fashion.
*
* The view of the architecture.
*
* Data is retrieved from a uiTableModel via methods that you need to define
* in a uiTableModelHandler.
*
* Make sure the uiTableModel columns return the right type, as specified in
* the `uiTableAppend*Column()` parameters.
*
* The `*EditableModelColumn` parameters typically point to a uiTableModel
* column index, that specifies the property on a per row basis.\n
* They can however also be passed two special values defining the property
* for all rows: `uiTableModelColumnNeverEditable` and
* `uiTableModelColumnAlwaysEditable`.
*
* @struct uiTable
* @extends uiControl
* @ingroup dataEntry table
*/
typedef struct uiTable uiTable;
/**
* Appends a text column to the table.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param textModelColumn Column that holds the text to be displayed.\n
* #uiTableValueTypeString
* @param textEditableModelColumn Column that defines whether or not the text is editable.\n
* #uiTableValueTypeInt `TRUE` to make text editable, `FALSE`
* otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never editable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always editable.
* @param textParams Text display settings, `NULL` to use defaults.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends an image column to the table.
*
* Images are drawn at icon size, using the representation that best fits the
* pixel density of the screen.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param imageModelColumn Column that holds the images to be displayed.\n
* #uiTableValueTypeImage
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends a column to the table that displays both an image and text.
*
* Images are drawn at icon size, using the representation that best fits the
* pixel density of the screen.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param imageModelColumn Column that holds the images to be displayed.\n
* #uiTableValueTypeImage
* @param textModelColumn Column that holds the text to be displayed.\n
* #uiTableValueTypeString
* @param textEditableModelColumn Column that defines whether or not the text is editable.\n
* #uiTableValueTypeInt `TRUE` to make text editable, `FALSE` otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never editable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always editable.
* @param textParams Text display settings, `NULL` to use defaults.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends a column to the table containing a checkbox.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param checkboxModelColumn Column that holds the data to be displayed.\n
* #uiTableValueTypeInt `TRUE` for a checked checkbox, `FALSE` otherwise.
* @param checkboxEditableModelColumn Column that defines whether or not the checkbox is editable.\n
* #uiTableValueTypeInt `TRUE` to make checkbox editable, `FALSE` otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never editable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always editable.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends a column to the table containing a checkbox and text.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param checkboxModelColumn Column that holds the data to be displayed.\n
* #uiTableValueTypeInt
* `TRUE` for a checked checkbox, `FALSE` otherwise.
* @param checkboxEditableModelColumn Column that defines whether or not the checkbox is editable.\n
* #uiTableValueTypeInt `TRUE` to make checkbox editable, `FALSE` otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never editable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always editable.
* @param textModelColumn Column that holds the text to be displayed.\n
* #uiTableValueTypeString
* @param textEditableModelColumn Column that defines whether or not the text is editable.\n
* #uiTableValueTypeInt `TRUE` to make text editable, `FALSE` otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never editable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always editable.
* @param textParams Text display settings, `NULL` to use defaults.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends a column to the table containing a progress bar.
*
* The workings and valid range are exactly the same as that of uiProgressBar.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param progressModelColumn Column that holds the data to be displayed.\n
* #uiTableValueTypeInt Integer in range of `[-1, 100]`, see uiProgressBar
* for details.
* @see uiProgressBar
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Appends a column to the table containing a button.
*
* Button clicks are signaled to the uiTableModelHandler via a call to
* SetCellValue() with a value of `NULL` for the @p buttonModelColumn.
*
* CellValue() must return the button text to display.
*
* @param t uiTable instance.
* @param name Column title text.\n
* A valid, `NUL` terminated UTF-8 string.\n
* Data is copied internally. Ownership is not transferred.
* @param buttonModelColumn Column that holds the button text to be displayed.\n
* #uiTableValueTypeString
* @param buttonClickableModelColumn Column that defines whether or not the button is clickable.\n
* #uiTableValueTypeInt `TRUE` to make button clickable, `FALSE` otherwise.\n
* `uiTableModelColumnNeverEditable` to make all rows never clickable.\n
* `uiTableModelColumnAlwaysEditable` to make all rows always clickable.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Returns whether or not the table header is visible.
*
* @param t uiTable instance.
* @returns `TRUE` if visible, `FALSE` otherwise. [Default `TRUE`]
* @memberof uiTable
*/
_UI_EXTERN int ;
/**
* Sets whether or not the table header is visible.
*
* @param t uiTable instance.
* @param visible `TRUE` to show header, `FALSE` to hide header.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Creates a new table.
*
* @param params Table parameters.
* @returns A new uiTable instance.
* @memberof uiTable @static
*/
_UI_EXTERN uiTable *;
/**
* Registers a callback for when the user single clicks a table row.
*
* @param t uiTable instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p row Row index that was clicked.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the user double clicks a table row.
*
* @param t uiTable instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p row Row index that was double clicked.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The double click callback is always preceded by one uiTableOnRowClicked() callback.
* @bug For unix systems linking against `GTK < 3.14` the preceding uiTableOnRowClicked()
* callback will be triggered twice.
* @note Only one callback can be registered at a time.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Sets the column's sort indicator displayed in the table header.
*
* Use this to display appropriate arrows in the table header to indicate a
* sort direction.
*
* @param t uiTable instance.
* @param column Column index.
* @param indicator Sort indicator.
* @note Setting the indicator is purely visual and does not perform any sorting.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Returns the column's sort indicator displayed in the table header.
*
* @param t uiTable instance.
* @param column Column index.
* @returns The current sort indicator. [Default: `uiSortIndicatorNone`]
* @memberof uiTable
*/
_UI_EXTERN uiSortIndicator ;
/**
* Registers a callback for when a table column header is clicked.
*
* @param t uiTable instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p column Column index that was clicked.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note Only one callback can be registered at a time.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Returns the table column width.
*
* @param t uiTable instance.
* @param column Column index.
* @returns Column width in pixels.
* @memberof uiTable
*/
_UI_EXTERN int ;
/**
* Sets the table column width.
*
* Setting the width to `-1` will restore automatic column sizing matching
* either the width of the content or column header (which ever one is bigger).
* @note Darwin currently only resizes to the column header width on `-1`.
*
* @param t uiTable instance.
* @param column Column index.
* @param width Column width to set in pixels, `-1` to restore automatic
* column sizing.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Table selection modes.
*
* Table selection that enforce how a user can interact with a table.
*
* @warning An empty table selection is a valid state for any selection mode.
* This is in fact the default upon table creation and can otherwise
* triggered through operations such as row deletion.
*
* @enum uiTableSelectionMode
* @ingroup table
*/
;
/**
* Returns the table selection mode.
*
* @param t uiTable instance.
* @returns The table selection mode. [Default `uiTableSelectionModeZeroOrOne`]
*
* @memberof uiTable
*/
_UI_EXTERN uiTableSelectionMode ;
/**
* Sets the table selection mode.
*
* @param t uiTable instance.
* @param mode Table selection mode to set.
*
* @warning All rows will be deselected if the existing selection is illegal
* in the new selection mode.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Registers a callback for when the table selection changed.
*
* @param t uiTable instance.
* @param f Callback function.\n
* @p sender Back reference to the instance that triggered the callback.\n
* @p senderData User data registered with the sender instance.
* @param data User data to be passed to the callback.
*
* @note The callback is not triggered when calling uiTableSetSelection() or
* when needing to clear the selection on uiTableSetSelectionMode().
* @note Only one callback can be registered at a time.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Holds an array of selected row indices for a table.
*
* @struct uiTableSelection
* @ingroup table
*/
typedef struct uiTableSelection uiTableSelection;
;
/**
* Returns the current table selection.
*
* @param t uiTable instance.
* @returns The number of selected rows and corresponding row indices.\n
* Caller is responsible for freeing the data with `uiFreeTableSelection()`.
*
* @note For empty selections the `Rows` pointer will be NULL.
* @memberof uiTable
*/
_UI_EXTERN uiTableSelection* ;
/**
* Sets the current table selection clearing any previous selection.
*
* @param t uiTable instance.
* @param sel Table selection.\n
* Data is copied internally. Ownership is not transferred.
*
* @note Selecting more rows than the selection mode allows for results in nothing happening.
* @note For empty selections the Rows pointer is never accessed.
* @memberof uiTable
*/
_UI_EXTERN void ;
/**
* Frees the given uiTableSelection and all it's resources.
*
* @param s uiTableSelection instance.
* @memberof uiTableSelection
*/
_UI_EXTERN void ;
}