Blame view

Giac_maj/giac-1.4.9/src/hist.fl 158 KB
6663b6c9   adorian   projet complet av...
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
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
  # data file for the Fltk User Interface Designer (fluid)
  version 1.0300 
  i18n_type 1 
  i18n_include "giac/giacintl.h" 
  i18n_function gettext 
  header_name {.h} 
  code_name {.cxx}
  decl {\#include <algorithm>} {public local
  } 
  
  decl {\#include "Xcas1.h"} {public local
  } 
  
  decl {\#include "Help1.h"} {public local
  } 
  
  decl {\#include <FL/fl_ask.H>} {public local
  } 
  
  decl {\#include <FL/Fl_Tooltip.H>} {public local
  } 
  
  decl {\#include <FL/Fl_Bitmap.H>} {public local
  } 
  
  decl {\#include <FL/fl_show_colormap.H>} {public local
  } 
  
  decl {\#include <FL/gl.h>} {public local
  } 
  
  decl {\#include "Input.h"} {public local
  } 
  
  decl {\#include "Editeur.h"} {public local
  } 
  
  decl {\#include "Equation.h"} {public local
  } 
  
  decl {\#include "History.h"} {public local
  } 
  
  decl {\#include "Tableur.h"} {public local
  } 
  
  decl {\#include "Cfg.h"} {public local
  } 
  
  decl {\#include <giac/giac.h>} {public local
  } 
  
  decl {\#include <giac/misc.h>} {public local
  } 
  
  declblock {\#ifdef FL_DEVICE} {open after {\#endif}
  } {
    decl {\#include <FL/Fl_Printer.H>} {private local
    }
  } 
  
  decl {/* */ namespace xcas { extern int printer_format; extern bool printer_landscape; void widget_ps_print(Fl_Widget * widget,const std::string & fname,bool eps,int pngpdf,bool preview,bool,bool ); void widget_print(Fl_Widget * widget);}} {private local
  } 
  
  declblock {\#ifdef HAVE_MALLOC_H} {open after {\#endif}
  } {
    decl {\#include <malloc.h>} {private local
    }
  } 
  
  decl {char ** xcas_argv;} {private local
  } 
  
  decl {int xcas_argc,xcas_user_level,update_xcas=0;} {private local
  } 
  
  decl {xcas::objet_bidon mon_objet_bidon;} {private local
  } 
  
  decl {giac::vecteur rpn_menu;} {private local
  } 
  
  decl {giac::vecteur rpn_description;} {private local
  } 
  
  decl {unsigned rpn_menu_page;} {private local
  } 
  
  decl {std::string rpn_menu_string[6],rpnn_menu_string[5],doc_prefix("doc/fr/"); bool rpn_menu_is_directory[6];} {private local
  } 
  
  decl {giac::vecteur home_menu, rpnn_menu[5];} {private local
  } 
  
  Function {Xcas_alt_ctrl_cb(int i)} {return_type void
  } {
    code {if (!(i & 1)){
    Xcas_Alpha_Keyboard->hide();
    Xcas_Scientific_Keyboard->show();
  }} {}
  } 
  
  Function {Xcas_current_session()} {return_type {Fl_Widget *}
  } {
    code {Fl_Widget * wid=Xcas_Main_Tab->value();
    if (xcas::History_Fold * hf=dynamic_cast<xcas::History_Fold *>(wid))
      wid=hf->pack;
    return wid;} {}
  } 
  
  Function {Xcas_get_context()} {return_type {const giac::context *}
  } {
    code {Fl_Widget * wid=Xcas_Main_Tab->value();
    if (xcas::History_Fold * hf=dynamic_cast<xcas::History_Fold *>(wid))
      wid=hf->pack;
    return xcas::get_context(wid);} {}
  } 
  
  Function {Xcas_Keyboard_Switch(unsigned u)} {return_type void
  } {
    code {bool always_show=u&0x8000;
     bool always_hide=u&0x4000;
     if (u & 1){
      if ( always_hide || (!always_show && Xcas_Keyboard_Group->visible()) ) {
        Xcas_Keyboard_Group->hide(); 
      } else {
        Xcas_Keyboard_Group->show(); 
      }
     }
     if (u & 2){
       if ( always_hide || (!always_show && Xcas_Messages->visible() ) ){
         Xcas_Messages->hide(); 
       } else {
         Xcas_Messages->show(); 
       }
     }
     if (u & 4){
       if (always_hide || (!always_show && Xcas_Bandeau_Keys->visible() ) ){
         Xcas_Bandeau_Keys->hide(); 
       } else {
         Xcas_Bandeau_Keys->show(); 
       }
     }
     if (u & 8){
       if (always_hide || (!always_show &&Xcas_Messages->visible() ) ){
         Xcas_Messages->hide(); 
       } else {
         Xcas_Messages->show(); 
       }
     }
     Xcas_resize_mainwindow();} {}
  } 
  
  Function {hist_max(int i,int j)} {return_type int
  } {
    code {return i>j?i:j;} {}
  } 
  
  Function {hist_min(int i,int j)} {return_type int
  } {
    code {return i>j?j:i;} {}
  } 
  
  Function {Xcas_save_all(Fl_Group * wid)} {return_type bool
  } {
    code {int n=wid->children();
      for (int i=0;i<n;++i){
        if (xcas::History_Fold * f=dynamic_cast<xcas::History_Fold *>(wid->child(i))){
  	if (f->pack->_modified){
  	  char chaine[25]; // enough even for very large numbers!
  	  sprintf(chaine,"%i",i+1);
  	  std::string name="session "+std::string(chaine)+" ";
  	  if (f->pack->url)
  	    name += *f->pack->url ;
  	  int j=xcas::confirm_close((name+gettext(" has changed. Save?")).c_str());
  	  if (j==0)
  	    return false;
  	  if (j!=2)
  	    f->pack->save(name.c_str());
  	  else
  	    f->pack->clear_modified();
  	  f->autosave_rm();
  	}
        } // end if dynamic...
      } // end for
      return true;} {}
  } 
  
  Function {latex_save_DispG(const char * filename)} {return_type void
  } {
    code {double xunit=giac::horiz_latex/(Xcas_DispG_->window_xmax-Xcas_DispG_->window_xmin);
    double yunit=giac::vert_latex/(Xcas_DispG_->window_ymax-Xcas_DispG_->window_ymin);
    graph2tex(filename,Xcas_DispG_->plot_instructions,Xcas_DispG_->window_xmin,Xcas_DispG_->window_xmax,Xcas_DispG_->window_ymin,Xcas_DispG_->window_ymax,xunit,yunit,false,giac::context0);} {}
  } 
  
  Function {a_propos()} {return_type void
  } {
    code {std::string s("xcas "); s+=GIAC_VERSION; s+=" (c) 2000-17, Bernard Parisse, Renee De Graeve\\n";
    s += "http://www-fourier.ujf-grenoble.fr/~parisse/giac.html\\n";
    s += "If you like Xcas, please link your webpage to the above link to help other find it\\n";
    s += "Software licensed under the GPL, General Public License version 3.0 or later\\nSee the file COPYING in this package for more details\\nOr browse http://www.gnu.org\\n";
    s += "French documentation (c) Renee de Graeve\\n";
    s += "This documentation is freely redistribuable for non commercial purpose\\n";
    s += "Giacpy module: Frederic Han\\n";
    s += "Math ML support, Xcas online: Jean-Pierre Branchard\\n";
    s += "Optimization code: Luka Marohnić\\n";
    s += "OpenOffice interface: Christophe Devalland, Serge Moutou\\n";
    s += "Qcas interface: Loic Le Coq, Frederic Han\\n";
    s += "Androcas interface: Thomas Luka\\n";
    s += "SmartCAS interface: Nicolas Pujol\\n";
    s += "Tutorial (dxcas) with B. Ycart\\n";
    s += "Greek localization, Alkiviadis Akritas, Eugenia Kelepesi-Akritas, George Nasopoulos, Nikos Larisis\\n";
    s += "Spanish localization, Xavier Vidaux, J. Manrique Lopez\\n";
    s += "German short help localization, Philipp Rösch\\n";
    s += "English user guide contributions by Luka Marohnić and Jay Belanger\\n";
    s += "Debian package: Carlos Enrique Carleos Artime\\n";
    s += "Mac OS X port thanks to Jean-Yves Avenard and IREM Grenoble\\n";
    s += "Tablor by Guillaume Connan, Pgiac by Jean-Michel Sarlat\\n";
    s += "FreeBSD port, sage interface and agreg tests by Frederic Han\\n";
    s += "Windows port suggestions and tests by Mike Ady\\n";
    s += "Thanks to the geogebra team, especially Zoltán Kovács, Michael Borcherds, Markus Hohenwater, Zbyněk Konečný\\n";
    s += "Xcas early testers: Christiane Serret (lycée de Crest),\\nMichèle Gandit (lycée international de Grenoble)\\nStephane Lejoly, Jean-Joel Bataille, Jean-Eric Visca, Thierry Xuereb\\nPaul Magnien, Denis Le Fur, Phil Pham\\nSébastien Celles, Gérard Vinel, Robert Rolland, Robert Sétif\\nJuan Antonio Martinez Rojas, Nicolas Rosillo (Spain)\\n";
    s += "Francois Maltey (Mupacs)\\nFrederic Faure, Emilien Kia, Andreas Thillosen (giac)\\n";
    s += "Francois Boisson (grace a lui xcas est utilisable a l'agregation de maths)\\n";
    s += "Luc Briel, Georges Dubouloz, Emmanuel Gaunard, Laurent Hofer, Yvan Duron, Martin Deraux (bugs, suggestions)...\\n";
    s += "Uses GMP, (c) T. Granlund & al.\\n";
  \#ifdef HAVE_LIBMPFR
    s += "Longfloat support by MPFR, Guillaume Hanrot, Vincent Lefèvre, Patrick Pélissier, Philippe Théveny and Paul Zimmermann \\n";
  \#endif //
  \#ifdef HAVE_LIBMPFI
    s += "Arithmetic interval support by MPFI, Fabrice Rouillier, Nathalie Revol, Sylvain Chevillard, Hong Diep Nguyen, Christoph Lauter and Philippe Théveny \\n";
  \#endif //
  \#ifdef HAVE_LIBCOCOA
    s += "Alternative Groebner Basis code by CoCoA, J. Abbott & al. \\n";
  \#endif
    s += "Interface using FLTK (c) Bill Spitzak et al\\n";
    s += "FLVW code (c)Larry Charlton and others\\n";
    s += "OpenGL / Mesa (c) 1999-2005  Brian Paul\\n";
  \#ifdef HAVE_LIBPARI
    s += "Contains PARI code (c) Henri Cohen & al.\\n";
  \#endif //
  \#ifdef HAVE_LIBLAPACK
    s += "Contains LAPACK code (c) see http://www.netlib.org/lapack/\\n";
    s += "Might also contain ATLAS code (c) see http://math-atlas.sourceforge.net/\\n";
  \#endif 
  \#ifdef HAVE_LIBGSL
    s += "Contains GSL code (c) Mark Galassi, James Theiler & al\\n";
  \#endif //
  \#ifdef HAVE_LIBNTL
    s += "Contains NTL code (c) Victor Shoup\\n";
  \#endif //
    s += "Postscript output 2-d inspired by eukleides (c) Christian Obrecht\\n";
    s += "3-d exports from gl2ps, (c) 1999-2006 Christophe Geuzaine\\n";
    s += "Implicitplot3d code derived from Paul Bourke and Cory Gene Bloyd\\n";
    s += "TinyMT code from Mutsuo Saito and Makoto Matsumoto\\n";
    Xcas_parse_error_output->value(s.c_str());
    Fl::focus(Xcas_parse_error_output);} {}
  } 
  
  Function {rpn_button(xcas::No_Focus_Button * wid,int i)} {return_type void
  } {
    code {unsigned si=rpn_menu_page*6+i;
    giac::gen e;
    if (!(xcas::Xcas_input_focus)) return;
    const giac::context * contextptr = xcas::get_context(xcas::Xcas_input_focus);
    if (rpn_menu.size()>si){
      e=rpn_menu[si];
      if ( (e.type==giac::_VECT) && (e._VECTptr->size()==2))
        e= e._VECTptr->back();
    }
    else 
      return;
    if (e.type==giac::_VECT){
      giac::vecteur tmp(1,giac::string2gen('"'+std::string("BACK")+'"'));
      if ((rpn_menu.back().type==giac::_VECT) && (rpn_menu.back()._VECTptr->front().type==giac::_STRNG) && (*rpn_menu.back()._VECTptr->front()._STRNGptr==std::string("BACK")) )
        rpn_menu.pop_back();
      tmp.push_back(rpn_menu);
      rpn_menu=*e._VECTptr;
      rpn_menu.push_back(tmp);
      show_rpn_menu(0);
      return;
    }
    try {
      e=giac::gen(e.print(),contextptr);
    }
    catch (std::runtime_error & err) 
    { }
    xcas::Equation * eqwptr=dynamic_cast<xcas::Equation *> (xcas::Xcas_input_focus);
    xcas::History_Pack * hp=get_history_pack(eqwptr);
    const giac::context * cptr=hp?hp->contextptr:0;
    if (eqwptr && e.is_symb_of_sommet(giac::at_program) ){
       make_thread(giac::symbolic(giac::at_of,makevecteur(e,eqwptr->get_selection())),eval_level(cptr),xcas::Equation_eval_callback,eqwptr,cptr);
       return;
    }
    if (e.type==giac::_FUNC){
      xcas::help_output(e._FUNCptr->ptr()->s,giac::language(contextptr));
      if (eqwptr){
        eqwptr->parse_desactivate();
        if (eqwptr->output_equation){
          eqwptr->eval_function(e);
        }
        else 
          eqwptr->replace_selection(giac::symbolic(*e._FUNCptr,eqwptr->get_selection()));
        return;
      }
      if (e.subtype)
        xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,e._FUNCptr->ptr()->s,false);
      else
        xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,(e._FUNCptr->ptr()->s+std::string(" ")).c_str(),false);
      return;
    } // end e.type==FUNC
    std::string s=e.print();
    if (!s.empty())
      xcas::in_Xcas_input_char(xcas::Xcas_input_focus,s.c_str(),s[0]);} {}
  } 
  
  Function {show_rpn_menu(unsigned i)} {return_type void
  } {
    code {rpn_menu_page=i;
    unsigned j=i*6;
    fl_font(Xcas_F1_Key->labelfont(),Xcas_F1_Key->labelsize());
    for (int k=0;k<6;k++){
      std::string s;
      rpn_menu_is_directory[k]=false;
      if (rpn_menu.size()>j+k){
        giac::gen e=rpn_menu[j+k];
        if ( (e.type==giac::_VECT) && (e._VECTptr->size()==2)){
          e=e._VECTptr->front();
          rpn_menu_is_directory[k]=true;
          s=e.print();
          if (s[0]=='"')
            s=s.substr(1,s.size()-2);
        }
        else {
          if (e.type==giac::_FUNC)
            s=e._FUNCptr->ptr()->s;
          else
            s=e.print();
          if (e.type==giac::_VECT)
            rpn_menu_is_directory[k]=true;
        }
      }
      else
        s="";
      while(fl_width(s.c_str())>Xcas_F1_Key->w())
        s=s.substr(0,s.size()-1);
      rpn_menu_string[k]=s;
    }
    Xcas_F1_Key->label(rpn_menu_string[0].c_str());
    Xcas_F1_Key->labelcolor(rpn_menu_is_directory[0]);    
    Xcas_F2_Key->label(rpn_menu_string[1].c_str());
    Xcas_F2_Key->labelcolor(rpn_menu_is_directory[1]);    
    Xcas_F3_Key->label(rpn_menu_string[2].c_str());
    Xcas_F3_Key->labelcolor(rpn_menu_is_directory[2]);    
    Xcas_F4_Key->label(rpn_menu_string[3].c_str());
    Xcas_F4_Key->labelcolor(rpn_menu_is_directory[3]);    
    Xcas_F5_Key->label(rpn_menu_string[4].c_str());
    Xcas_F5_Key->labelcolor(rpn_menu_is_directory[4]);    
    Xcas_F6_Key->label(rpn_menu_string[5].c_str());
    Xcas_F6_Key->labelcolor(rpn_menu_is_directory[5]);    
    Xcas_F1_Key->color(xcas::Xcas_background_color);    
    Xcas_F2_Key->color(xcas::Xcas_background_color);    
    Xcas_F3_Key->color(xcas::Xcas_background_color);    
    Xcas_F4_Key->color(xcas::Xcas_background_color);    
    Xcas_F5_Key->color(xcas::Xcas_background_color);    
    Xcas_F6_Key->color(xcas::Xcas_background_color);    
    Xcas_VAR_Key->color(xcas::Xcas_background_color);   
    Xcas_Home_button->color(xcas::Xcas_background_color);    
    Xcas_CST_Key->color(xcas::Xcas_background_color);    
    Xcas_PREV_Key->color(xcas::Xcas_background_color);    
    Xcas_NXT_Key->color(xcas::Xcas_background_color);    
    Xcas_Bandeau_Keys->redraw();} {}
  } 
  
  Function {Xcas_resize_mainwindow()} {return_type void
  } {
    code {int h=Xcas_Main_Window_->h();
      int w_=Xcas_Main_Window_->w(),i=Xcas_Main_Window_->labelsize(),y=i+4;
      int dy=0;
      int bs=Xcas_Messages->visible()?4*y:0;
      int bottom=bs;
      int kh=4*(i+5); // keyboard size
      int bh=(i+5); // bandeau size
      if (Xcas_Keyboard_Group->visible()) dy += kh ;
      if (Xcas_Bandeau_Keys->visible()) dy += bh;
      Xcas_main_menu->resize(0,0,w_,y);
      Xcas_Main_Tab->resize(0,y,w_,h-y-bottom-dy);
      Xcas_Main_Tab->redraw();
      Xcas_Keyboard_Group->resize(0,h-bottom-dy,w_,kh);
      Xcas_Keyboard_Group->redraw();
      Xcas_Bandeau_Keys->resize(0,h-bottom-bh,w_,bh);
      Xcas_Bandeau_Keys->redraw();
      Xcas_Messages->resize(0,h-bottom,w_,bs);
      Xcas_Messages->redraw();
      Xcas_Main_Window_->init_sizes();} {}
  } 
  
  Function {Xcas_change_labelsize(int i)} {return_type void
  } {
    code {xcas::change_group_fontsize(Xcas_Main_Window_,i);
      Xcas_resize_mainwindow();
      if (xcas::Xcas_Debug_Window){ 
        xcas::Xcas_Debug_Window->labelfont(Xcas_Main_Window_->labelfont());
        xcas::change_group_fontsize(xcas::Xcas_Debug_Window,i);
      }
      if (xcas::Xcas_DispG_Window){
         xcas::Xcas_DispG_Window->labelfont(Xcas_Main_Window_->labelfont());
         xcas::change_group_fontsize(xcas::Xcas_DispG_Window,i);
      }
      if (Xcas_Script_Window){
         Xcas_Script_Window->labelfont(Xcas_Main_Window_->labelfont());
         xcas::change_group_fontsize(Xcas_Script_Window,i);
      }
      Fl_Menu_Bar * menu = dynamic_cast<Fl_Menu_Bar *>(Xcas_Main_Window_->child(0));
      if (menu) 
        menu->labelfont(Xcas_Main_Window_->labelfont());
      xcas::change_group_fontsize(menu,i);
  //Xcas_History_font_output->value(giac::print_INT_(i).c_str());} {}
  } 
  
  Function {Xcas_widget_size(const giac::gen & g,const giac::context * cptr)} {return_type {giac::gen}
  } {
    code {int f=14,ff=0;
      int x=Xcas_Main_Window_->x(),y=Xcas_Main_Window_->y(),w=Xcas_Main_Window_->w(),h=Xcas_Main_Window_->h();
      const giac::context * contextptr=Xcas_get_context();
      if (g.type==giac::_VECT){
        giac::vecteur & v=*g._VECTptr;
        int s=v.size();
        if (s && v[0].type==giac::_INT_)
  	f=v[0].val;
        if (s && v[0].type==giac::_DOUBLE_)
  	f=int(v[0]._DOUBLE_val);
        if (s && v[0].type==giac::_VECT){
          giac::vecteur & w = *v[0]._VECTptr;
          int ws=w.size();
          if (ws && w[0].type==giac::_INT_)
  	 ff=w[0].val;
          if (ws && w[0].type==giac::_DOUBLE_)
  	 ff=int(w[0]._DOUBLE_val);
          if (ws>1 && w[1].type==giac::_INT_)
  	 f=w[1].val;
          if (ws>1 && w[1].type==giac::_DOUBLE_)
  	 f=int(w[1]._DOUBLE_val);
          if (ws>2 && w[2].type==giac::_INT_){
           xcas::Flv_Table_Gen::def_rows=giac::absint(w[2].val);
           Xcas_default_rows->value(giac::absint(w[2].val));
          }
          if (ws>3 && w[3].type==giac::_INT_){
           xcas::Flv_Table_Gen::def_cols=giac::absint(w[3].val);
           Xcas_default_cols->value(giac::absint(w[3].val));
          }
        }
        if (s>1 && v[1].type==giac::_INT_)
  	x=v[1].val;
        if (s>1 && v[1].type==giac::_DOUBLE_)
  	x=int(v[1]._DOUBLE_val);
        if (s>2 && v[2].type==giac::_INT_)
  	y=v[2].val;
        if (s>2 && v[2].type==giac::_DOUBLE_)
  	y=int(v[2]._DOUBLE_val);
        if (s>3 && v[3].type==giac::_INT_)
  	w=v[3].val;
        if (s>3 && v[3].type==giac::_DOUBLE_)
  	w=int(v[3]._DOUBLE_val);
        if (s>4 && v[4].type==giac::_INT_)
  	h=v[4].val;
        if (s>4 && v[4].type==giac::_DOUBLE_)
  	h=int(v[4]._DOUBLE_val);
        if (s>5 && v[5].type==giac::_INT_) { 
          int i=v[5].val;
          if (i%2) Xcas_Keyboard_Group->show(); else Xcas_Keyboard_Group->hide(); 
          if (i/2) Xcas_Bandeau_Keys->show(); else Xcas_Bandeau_Keys->hide(); 
        }
        if (s>6 && v[6].type==giac::_INT_){ // Arg 6 was used for number of windows, now for auto-help
          Xcas_automatic_help_browser->value(v[6].val % 2);
          Xcas_automatic_completion_browser->value( (v[6].val/2) %2);
          xcas::do_helpon=Xcas_automatic_completion_browser->value();
          Xcas_tooltip_disabled->value( (v[6].val/4) %2);
  	Xcas_disable_try_parse_test_i->value(v[6].val/8);
          Fl_Tooltip::enable(!Xcas_tooltip_disabled->value());
          giac::try_parse_i(0)=giac::try_parse_i(xcas::get_context(xcas::Xcas_input_focus))=!Xcas_disable_try_parse_test_i->value();
        }
        if (s>7 && v[7].type==giac::_INT_){ // Arg 7 was used for showing bandeau
          if (v[7].val) Xcas_Messages->show(); else Xcas_Messages->hide();
        }
        if (s>8 && v[8].type==giac::_VECT){ // colors (was pretty print in old xcas)
          giac::vecteur w=*giac::evalf_double(v[8],1,contextptr)._VECTptr;
          int ws=w.size();
          if (ws>=10){
            xcas::Xcas_input_color=Fl_Color(int(w[0]._DOUBLE_val));
            xcas::Xcas_input_background_color=Fl_Color(int(w[1]._DOUBLE_val));
  	  xcas::Xcas_comment_color=Fl_Color(int(w[2]._DOUBLE_val));
  	  xcas::Xcas_comment_background_color=Fl_Color(int(w[3]._DOUBLE_val));
  	  xcas::Xcas_log_color=Fl_Color(int(w[4]._DOUBLE_val));
  	  xcas::Xcas_log_background_color=Fl_Color(int(w[5]._DOUBLE_val));
  	  xcas::Xcas_equation_color=Fl_Color(int(w[6]._DOUBLE_val));
  	  xcas::Xcas_equation_background_color=Fl_Color(int(w[7]._DOUBLE_val));
  	  xcas::Xcas_editor_color=Fl_Color(int(w[8]._DOUBLE_val));
  	  xcas::Xcas_editor_background_color=Fl_Color(int(w[9]._DOUBLE_val));
          }
          if (ws>=11)
  	  xcas::Xcas_background_color=Fl_Color(int(w[10]._DOUBLE_val));
          xcas::set_colors(Xcas_Main_Window_);
        }
        xcas::use_external_browser=false;
        unsetenv("BROWSER");
        if (s>9 && v[9].type==giac::_STRNG){
  	std::string browser=*v[9]._STRNGptr;
  	if (browser.size()!=0 && browser!="builtin"){
  \#ifdef WIN32 // FIXME, check_file_path under windows
             setenv("BROWSER",browser.c_str(),1);
             xcas::use_external_browser=true;
  \#else
            if (!giac::check_file_path(browser))
              fl_alert("%s",("Error, browser "+browser+" not found").c_str());
            else {
             setenv("BROWSER",browser.c_str(),1);
             xcas::use_external_browser=true;
            }
  \#endif
          }
        }
        if (s>10 ){ // User level
  	if (v[10].type==giac::_INT_)
            xcas_user_level=v[10].val;
  	if (v[10].type==giac::_DOUBLE_)
            xcas_user_level=int(v[10]._DOUBLE_val); 
          std::string ss;
          switch(xcas_user_level){
            case 0: ss=gettext("CAS"); break;
            case 1: ss=gettext("Program CAS"); break;
            case 2: ss=gettext("Spreadsheet"); break;
            case 3: ss=gettext("Geometry"); break;
            case 8: ss=gettext("Turtle"); break;
          }
          Xcas_level_output->value(gettext(ss.c_str()));
        }
        if (s>11){ 
          if (v[11].type==giac::_INT_)
            giac::step_infolevel(v[11].val,contextptr);
          if (v[11].type==giac::_DOUBLE_)
            giac::step_infolevel(v[12]._DOUBLE_val,contextptr);
          if (giac::step_infolevel(contextptr) && xcas::Xcas_DispG_Window) xcas::Xcas_DispG_Window->show();
        }     
        if (s>12 && v[12].type==giac::_STRNG){
  	std::string browser=*v[12]._STRNGptr;
  	if (browser.size()!=0)
  	  setenv("GIAC_PREVIEW",browser.c_str(),1);
        }
        if (s>13 && v[13].type==giac::_STRNG){
  	std::string browser=*v[13]._STRNGptr;
  	if (browser.size()!=0)
  	  setenv("http_proxy",browser.c_str(),1);
        }
      }
      else {
        if (g.type!=giac::_INT_)
  	return giac::zero;
        f=g.val;
      }
      f=f>0?f:-f;
      f=f>8?f:8;
      f=f>40?40:f;
      if (ff>=xcas::fonts_available)
        ff=0;
      Xcas_Main_Window_->labelfont(ff);
      Xcas_change_labelsize(f);
      Xcas_Main_Window_->resize(x,y,w,h);
      Xcas_resize_mainwindow(); 	
      return giac::plus_one;} {}
  } 
  
  Function {make_history()} {open
  } {
    code {Fl_Group * s = Xcas_Main_Tab;
          Fl_Group::current(0);
  s->handle(FL_FOCUS);
  xcas::History_Fold * w = new xcas::History_Fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,1);
  w->end();
  w->pack->contextptr = giac::clone_context(giac::context0);
  w->handle(FL_FOCUS);
  w->pack->handle(FL_FOCUS);
  w->labelsize(s->labelsize());
  w->pack->eval=xcas::Xcas_eval;
  w->pack->_insert=xcas::Xcas_pack_insert;
  w->pack->_select=xcas::Xcas_pack_select;  
  Fl_Group::current(0);
  if (xcas_user_level==8){
    Fl_Widget * e=new_program(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->h()/3,w->pack);
    e->labelsize(w->labelsize());
    w->pack->add_entry(-1,e);
    Fl_Widget * l=new_logo(hist_max(w->pack->w()-w->pack->_printlevel_w,1),(w->h())/2,w->pack);
    l->labelsize(w->labelsize());
    w->pack->add_entry(0,l);
  }
  if (xcas_user_level==3){
    Fl_Widget * e=new_figure(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()-2*w->labelsize(),w->pack,false);
    e->labelsize(w->labelsize());
    w->pack->add_entry(-1,e);
    w->add_entry(-1);
  }
  if (xcas_user_level==2){
    Fl_Widget * e=new_tableur(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()-2*w->labelsize(),w->pack);
    e->labelsize(w->labelsize());
    w->pack->add_entry(-1,e);
    w->add_entry(-1);
  }
  if (xcas_user_level==1){
    Fl_Widget * e=new_program(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()/2,w->pack);
    e->labelsize(w->labelsize());
    w->pack->add_entry(-1,e);
    w->add_entry(-1);
  }
  if (!w->pack->children()) 
    w->add_entry(-1);
  w->pack->clear_modified();
  std::cerr << Xcas_Main_Window_->labelfont() << std::endl;
  w->labelfont(Xcas_Main_Window_->labelfont());
  w->pack->labelfont(Xcas_Main_Window_->labelfont());
  xcas::change_group_fontsize(w,Xcas_Main_Window_->labelsize());
  Xcas_Main_Tab->add(w);
  Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
  Xcas_resize_mainwindow();
  Xcas_Main_Tab->redraw();} {}
  } 
  
  Function {load_history(int mws)} {open
  } {
    code {Fl_Group * s = Xcas_Main_Tab;
  Fl_Group::current(0);
  xcas::History_Fold * w = new xcas::History_Fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,1);
  w->end();
  w->pack->contextptr = giac::clone_context(giac::context0);
  w->pack->labelsize(Xcas_Main_Window_->labelsize());
  w->pack->eval=xcas::Xcas_eval;
  w->pack->_insert=xcas::Xcas_pack_insert;
  w->pack->_select=xcas::Xcas_pack_select;  
  if (!w->pack->insert_before(-1,true,mws)){
    delete w;
    return;
  }
  w->pack->clear_modified();
  w->pack->focus(0,true);
  std::cerr << Xcas_Main_Window_->labelfont() << std::endl;
  w->labelfont(Xcas_Main_Window_->labelfont());
  w->pack->labelfont(Xcas_Main_Window_->labelfont());
  xcas::add_recent_filename(*w->pack->url,true);
  xcas::change_group_fontsize(w,w->pack->labelsize());
  Xcas_Main_Tab->add(w);
  Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
  Xcas_resize_mainwindow();
  Xcas_Main_Tab->redraw();} {}
  } 
  
  Function {load_filename(const char * filename,bool modified)} {open
  } {
    code {Fl_Group * s = Xcas_Main_Tab;
          xcas::History_Fold * w=xcas::load_history_fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,s->labelsize(),filename,modified);
          // w->pack->focus(0,true);
          Xcas_Main_Tab->add(w); 
          Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
          Xcas_resize_mainwindow();
          s->redraw();} {}
  } 
  
  Function {cb_Insert_Example(Fl_Widget * w , void*)} {} {
    code {static std::string menu_buffer;
      if (xcas::fl_handle_lock)
        return ;
      const giac::context * contextptr=Xcas_get_context();
      Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(w);
      if (!m)
        return ;
      menu_buffer = (giac::giac_aide_dir()+"examples/");
      int pos=m->value();
      const Fl_Menu_Item * m0 = m->menu();
      const Fl_Menu_Item * mi = m->menu();
      std::string tmp="Exemples/";
      for (int i=0;;i++){
        const Fl_Menu_Item * m1=mi;
        for (;;){
          mi=m1;
          m1=m1->next();
          if (m1-m0>pos)
            break;
        }
        if (mi-m0>=pos)
          break;
        if (i>1){
          tmp += mi->text ;
          tmp += '/';
        }
        ++mi;
      }
      menu_buffer += tmp;
      tmp="";
      std::string last=m->text();
      std::vector<std::string> vfile;
      unsigned ls=last.size(),is=0;
      for (;is<ls;++is){
        if (last[is]==','){
          vfile.push_back(tmp);
          tmp="";
        }
        else tmp+=last[is];
      }
      vfile.push_back(tmp);
      int i=1;
      std::string filename=vfile.front();
  \#ifdef __APPLE__
      std::string thepath="/tmp/";
  \#else
      std::string thepath="";
  \#endif
      if (giac::is_file_available((thepath+filename).c_str())){
        i=fl_ask("%s",("File "+std::string(m->text())+" exists. Overwrite?").c_str());
      }
      if (i){
        ls=vfile.size();
        for (is=0;is<ls;++is){
          std::ifstream in((menu_buffer+vfile[is]).c_str());
          std::ofstream out((thepath+vfile[is]).c_str());
          i=xcas::stream_copy(in,out);
          in.close();
          out.close();
        }
      }
      load_filename((thepath+filename).c_str(),false);} {}
  } 
  
  Function {cb_Insert_ItemName(Fl_Widget * w , void*)} {} {
    code {static std::string menu_buffer;
      if (xcas::fl_handle_lock)
        return ;
      Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(w);
      if (!m)
        return ;
      menu_buffer = m->text();
      int pos=menu_buffer.find(':');
      if (pos>0 && pos<menu_buffer.size()) menu_buffer=menu_buffer.substr(0,pos);
      Fl_Widget * f = xcas::Xcas_input_focus;
      if (!f) return;
      const giac::context * contextptr = xcas::get_context(f);
      giac::gen tmp(menu_buffer,contextptr);
      if (Xcas_automatic_help_browser->value())
        xcas::browser_help(tmp,giac::language(contextptr));
      else
        xcas::help_output(menu_buffer,giac::language(contextptr));
      if (tmp.type==giac::_FUNC){
        if (xcas::Equation * eqwptr = dynamic_cast<xcas::Equation *>(f)){
  	eqwptr->parse_desactivate();
  	if (eqwptr->output_equation)
  	  eqwptr->eval_function(tmp);
  	else 
  	  eqwptr->replace_selection(giac::symbolic(*tmp._FUNCptr,eqwptr->get_selection()));
  	return;
        }
        menu_buffer += '(';
      }
      static std::string ans;
      ans=menu_buffer;
      int remove;
      Fl_Widget * wid=f->window();
      if (!wid) wid=f;
      pos=menu_buffer.find('('); // detect a composite unit
      if (menu_buffer.size()>1 && menu_buffer!="%0" && !(pos>0 && pos<menu_buffer.size()) && Xcas_automatic_completion_browser->value()){
        if (!xcas::handle_tab(menu_buffer,(*giac::vector_completions_ptr()),2*wid->w()/3,2*wid->h()/3,remove,ans))
         return;
      }
      Fl::focus(f);
        if (xcas::Xcas_Text_Editor * in =dynamic_cast<xcas::Xcas_Text_Editor *>(f)){
  	    in->buffer()->insert(in->insert_position(),ans.c_str());
  	    in->insert_position(in->insert_position()+ans.size());
  	  return;
  	}
      if (Fl_Input * in = dynamic_cast<Fl_Input *>(f))
        in->insert(ans.c_str());
      else {
       Fl::e_text = (char * ) ans.c_str();
       Fl::e_length = ans.size();
       // Fl::e_keysym = '\\n';
       xcas::fl_handle(f);
      }} {}
  } 
  
  Function {cb_Assistant_ItemName(Fl_Widget * wid , void* ptr)} {} {
    code {static std::string menu_buffer;
      if (xcas::fl_handle_lock)
        return ;
      Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(wid);
      if (!m)
        return ;
      menu_buffer = m->text();
      int pos=menu_buffer.find(':');
      if (pos>0 && pos<menu_buffer.size()) menu_buffer=menu_buffer.substr(0,pos);
      static std::string ans;
      ans = menu_buffer;
      int remove,ii;
      Fl_Widget * w=xcas::Xcas_input_focus;
      const giac::context * contextptr = xcas::get_context(w);
      xcas::help_output(menu_buffer,giac::language(contextptr));
      Fl_Window * wd=wid->window();
      if (!Xcas_automatic_completion_browser->value())
        ii=1;
      else
        ii=xcas::handle_tab(menu_buffer,(*giac::vector_completions_ptr()),wd->w()/3,wd->h()/3,remove,ans);
      Fl::focus(w);
      if (ii){ 
        if (ii==1)
  	ans = ans +"()";
        if (xcas::Xcas_Text_Editor * in =dynamic_cast<xcas::Xcas_Text_Editor *>(w)){
  	  if (ii>=1){
  	    in->buffer()->insert(in->insert_position(),ans.c_str());
  	    in->insert_position(in->insert_position()+ans.size()-1);
  	  }
  	  return;
  	}
        Fl::e_text = (char * ) ans.c_str();
        Fl::e_length = ans.size();
        if (w){
  	xcas::fl_handle(w);
  	if (Fl_Input * in =dynamic_cast<Fl_Input *>(w)){
  	  if (ii==1) in->position(in->position()-1);
  	}
        }
      }
      else { if (w) w->redraw(); }} {}
  } 
  
  Function {load_autorecover_data()} {open
  } {
    code {\#ifdef WIN32
      std::string configname=giac::xcasroot()+giac::xcasrc();
  \#else
      std::string configname=giac::home_directory()+giac::xcasrc();
  \#endif //
     if (!giac::is_file_available(configname.c_str())){
      Xcas_widget_size(giac::makevecteur(14,40,90,900,550,0,0,1),0);
      FILE * f =fopen(configname.c_str(),"w");
      if (f){
        fclose(f);
       // Xcas_Main_Window_->hide();
       int n=fl_choice(gettext("Choose start mode"),gettext("Xcas (Python-ic)"),gettext("Xcas"),gettext("Other")),mm=-1; // n==0 maple, 1 xcas, 2 other
       if (n==2){
          mm=fl_choice(gettext("Choose start mode"),gettext("Turtle"),gettext("Spreadsheet"),gettext("Geometry"));
          if (mm==0) mm=7;
       }
  \#ifdef IPAQ // default with bandeau
       std::string configs="widget_size(12,1,1,300,240,1,2,1,";
  \#else // ifndef IPAQ, 
       std::string configs="widget_size(14,40,90,900,550,"+giac::print_INT_(n!=0)+",2,0,";
  \#endif // IPAQ
       configs += '7';
       configs += ','; 
       configs += '"'; 
  // \#ifndef WIN32
       configs += Xcas_browser_name();
  // \#endif
       configs += '"' ; 
       configs += ','; // end BROWSER
       configs+=giac::print_INT_(mm+1);
       configs += ",0";
       configs +=");xcas_mode(";
       if (n==0)
        configs+="256"; 
       else
        configs+='0';
       configs += ");xyztrange(-10.0,10.0,-10.0,10.0,-10.0,10.0,-10.0,10.0,-10.0,10.0,-1.4,1.1,1,0.0,1.0);";
       std::ofstream configfile(configname.c_str());
       configfile << configs << std::endl;
       configfile.close();
       // fl_alert("%s",("Configuration written to "+configname + "\\nUse the Cfg menu to modify.\\nLaunching tutorial.").c_str());
       n=fl_ask("%s",gettext("Launch tutorial in browser?"));
       if (n==1){
         if (giac::language(giac::context0)==1)
           giac::system_browser_command(doc_prefix+"tutoriel/index.html");
         else
           giac::system_browser_command(doc_prefix+"casinter/index.html");
       }
       giac::protected_read_config(giac::context0); // read xcas.rc
       xcas::History_cb_Kill(Xcas_current_session(),0);
       make_history();
      } // if (f) ...
     }
      std::vector<xcas::time_string> v;
      char buf[1024];
      bool autoload=true;
      if (xcas::autosave_folder.empty())
        autoload=getcwd(buf,1023);
      else
        strcpy(buf,xcas::autosave_folder.c_str());
      if ( autoload && has_autorecover_data(buf,v)){
        // Ask user: ignore or run file
        int i=fl_ask("%s",gettext("Auto-recovery files found. Load ?"),gettext("Yes"),gettext("No"));
        if (i!=1)
  	return;
        xcas::geo_run=xcas::sheet_run=false;
        // Remove empty new session
        if (Xcas_Main_Tab->children()){
          xcas::History_Fold * hf = dynamic_cast<xcas::History_Fold *>(Xcas_Main_Tab->child(0));
          if (hf && hf->pack && hf->pack->children() < 2 ) { hf->pack->close(""); Xcas_Main_Tab->remove(hf);}
        }
        std::sort(v.begin(),v.end());
        int vs=v.size();
        for (int i=0;i<vs;++i){
          load_filename(v[i].s.c_str(),true);
          unlink(v[i].s.c_str());
        }
        fl_message("%s",gettext("Autorecover files have been loaded. Geometry and spreadsheet were not reevaled"));
      }} {}
  } 
  
  Function {gnuplot_setview()} {return_type void
  } {
    code {\#ifdef WITH_GNUPLOT
    bool clrplot=false;
    int out_handle;
    FILE * gnuplot_out_readstream,* stream = giac::open_gnuplot(clrplot,gnuplot_out_readstream,out_handle);
    fprintf(stream,"%s %f,%f,%f,%f\\n%s\\n","set view ",Xcas_Rot_x->value(),Xcas_Rot_z->value(),Xcas_X_scale->value(),Xcas_Z_scale->value(),"replot");
    fflush(stream);
    giac::gnuplot_wait(out_handle,gnuplot_out_readstream,2);  
  \#endif //} {}
  } 
  
  Function {Xcas_browser_name()} {return_type {std::string}
  } {
    code {\#ifdef __APPLE__ //
  return "open";
  \#endif // apple
  if (getenv("BROWSER"))
    return getenv("BROWSER");
  \#ifdef WIN32 //
    return "cygstart.exe";
  \#endif // win32
  std::string tmp;
  tmp="/usr/bin/firefox";
  if (giac::is_file_available(tmp.c_str()))
     return tmp;
  tmp="/usr/bin/mozilla";
  if (giac::is_file_available(tmp.c_str()))
     return tmp;
  tmp="/usr/bin/dillo";
  if (giac::is_file_available(tmp.c_str()))
     return tmp;
  \#ifdef WIN32 //
    tmp="/cygdrive/c/Program Files/Mozilla Firefox/firefox.exe";
   // if (giac::is_file_available(tmp.c_str())) return "'"+tmp+"'";
    return "'/cygdrive/c/Program Files/Internet Explorer/IEXPLORE.EXE'";
  \#endif // 
  return "";} {}
  } 
  
  Function {Xcas_load_general_setup()} {return_type void
  } {
    code {// xcas::file_save_context has been removed for xcas 1.1.3
  int ste=giac::step_infolevel(Xcas_get_context());
  Xcas_stepbystep->value(ste);
  Xcas_html_browser->value(Xcas_browser_name().c_str());
  static std::string proxy;
  if (getenv("http_proxy")){
    proxy=getenv("http_proxy");
    Xcas_proxy->value(proxy.c_str());
  }
  xcas::change_group_fontsize(Xcas_General_Setup,Xcas_Main_Window_->labelsize());
  Xcas_General_Setup->resize(20,20,3*Xcas_Main_Window_->w()/4,3*Xcas_Main_Window_->h()/4);
    Xcas_General_Setup->show();} {}
  } 
  
  Function {Xcas_update_mode()} {return_type void
  } {
    code {Fl_Widget * wid = Xcas_current_session();
    xcas::History_Fold * hf=xcas::get_history_fold(wid);
    if (hf) hf->update_status();} {}
  } 
  
  Function {Xcas_save_config(const giac::context * contextptr)} {return_type void
  } {
    code {\#ifdef WIN32 
  // Save config in home_dir or if not available in $XCAS_ROOT or current dir
  std::string s((giac::home_directory()));
  if (s.size()<2 && getenv("XCAS_ROOT"))
    s=getenv("XCAS_ROOT")+std::string("/");
  if (s.size()<2)
    s="";
  std::cerr << "Saving preferences in file " << s+giac::xcasrc() << std::endl;
  std::ofstream of((s+giac::xcasrc()).c_str());
  \#else
  std::ofstream of((giac::home_directory()+giac::xcasrc()).c_str());
  \#endif //
     of << "widget_size([" << giac::print_INT_(Xcas_Main_Window_->labelfont()) << "," << giac::print_INT_(Xcas_Main_Window_->labelsize()) << "," << giac::print_INT_(xcas::Flv_Table_Gen::def_rows) << "," << giac::print_INT_(xcas::Flv_Table_Gen::def_cols) << "]," << Xcas_Main_Window_->x() << "," << Xcas_Main_Window_->y() << "," << Xcas_Main_Window_->w() << "," << Xcas_Main_Window_->h() << "," ;
     of << Xcas_Keyboard_Group->visible()+2*Xcas_Bandeau_Keys->visible() <<",";
     of << Xcas_automatic_help_browser->value()+2*Xcas_automatic_completion_browser->value()+4*Xcas_tooltip_disabled->value() + 8*Xcas_disable_try_parse_test_i->value();
     of << "," << Xcas_Messages->visible() ;
     of << ",[" ; 
     of << giac::print_INT_(xcas::Xcas_input_color) << "," << giac::print_INT_(xcas::Xcas_input_background_color) << "," << giac::print_INT_(xcas::Xcas_comment_color) << "," << giac::print_INT_(xcas::Xcas_comment_background_color) << "," << giac::print_INT_(xcas::Xcas_log_color) << "," << giac::print_INT_(xcas::Xcas_log_background_color) << "," << giac::print_INT_(xcas::Xcas_equation_color) << "," << giac::print_INT_(xcas::Xcas_equation_background_color) << "," << giac::print_INT_(xcas::Xcas_editor_color) << "," << giac::print_INT_(xcas::Xcas_editor_background_color) << "," << giac::print_INT_(xcas::Xcas_background_color) ;
     of << "]";
     if (getenv("BROWSER")&&xcas::use_external_browser)
       of << "," << '"' << getenv("BROWSER") << '"' ;
     else
       of << "," << '"' << "builtin" << '"' ;
     of << "," << xcas_user_level ;
     of << "," << int(Xcas_stepbystep->value()) ;
     if (getenv("GIAC_PREVIEW"))
       of << "," << '"' << getenv("GIAC_PREVIEW") << '"' ;
     else
       of << "," << '"' << '"' ;
     if (getenv("http_proxy"))
       of << "," << '"' << getenv("http_proxy") << '"' ;
     else
       of << "," << '"' << '"' ;
     of << ");" << std::endl;
     of << giac::cas_setup_string(contextptr) << ";" << std::endl;
     of << giac::geo_setup_string() << ";" << std::endl;
     of << "autosimplify(" << giac::unlocalize(giac::autosimplify(contextptr)) << ")";
     giac::vecteur vv(*giac::_lsmod(giac::zero,contextptr)._VECTptr);
     giac::const_iterateur it=vv.begin(),itend=vv.end();
     for (;it!=itend;++it)
       of << "insmod(" << it->print(contextptr) << ");" << std::endl;} {}
  } 
  
  Function {Xcas_run(int argc,char ** argv)} {open
  } {
    Fl_Window Xcas_Main_Window_ {
      label {Xcas New Interface} open
      xywh {95 113 775 520} type Single resizable visible
    } {
      Fl_Menu_Bar Xcas_main_menu {open
        xywh {0 0 775 25}
      } {
        Submenu Xcas_file_menu {
          label File
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_new_session {
            label {New session}
            callback {make_history();}
            xywh {0 0 100 20}
          }
          Submenu Xcas_open {
            label Open
            xywh {0 0 70 21}
          } {
            MenuItem Xcas_open_session {
              label File
              callback {load_history(0);}
              xywh {15 15 100 20} shortcut 0x8006f
            }
          }
          MenuItem Xcas_open_recovery {
            label {Open (recovery mode)}
            callback {xcas::recovery_mode=true; load_history(0); xcas::recovery_mode=false;}
            xywh {10 10 100 20}
          }
          Submenu Xcas_Import {
            label Import
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_open_maple {
              label {maple worksheet}
              callback {load_history(1);}
              xywh {15 15 100 20}
            }
            MenuItem Xcas_open_ti89 {
              label {ti89 program}
              callback {load_history(3);}
              xywh {15 15 100 20}
            }
            MenuItem Xcas_open_v200 {
              label {V200 program}
              callback {load_history(7);}
              xywh {15 15 100 20}
            }
          }
          Submenu Xcas_Clone {
            label Clone
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_CloneOffline {
              label Offline
              callback {std::string html5=giac::browser_command("doc/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session())); std::cout << html5 << std::endl; system(html5.c_str());}
              xywh {10 10 100 20}
            }
            MenuItem Xcas_CloneOnline {
              label Online
              callback {std::string html5="http://www-fourier.ujf-grenoble.fr/~parisse/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session()); std::cout << html5 << std::endl; giac::system_browser_command(html5);}
              xywh {10 10 100 20}
            }
          }
          Submenu Xcas_Insert {
            label Insert
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_Insert_Session {
              label {xcas session}
              callback {xcas::History_cb_Insert(Xcas_current_session(),0);}
              xywh {55 55 100 20}
            }
            MenuItem Xcas_Firefox_Insert_Session {
              label {xcas Firefox link}
              callback {fl_alert("Click on a history level then paste (Ctrl-V)");}
              xywh {55 55 100 20}
            }
            MenuItem Xcas_Insert_Figure {
              label figure
              callback {xcas::History_cb_Insert_Figure(Xcas_current_session(),0);}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_Insert_Tableur {
              label spreadsheet
              callback {xcas::History_cb_Insert_Tableur(Xcas_current_session(),0);}
              xywh {75 75 100 20}
            }
            MenuItem Xcas_Insert_Program {
              label program
              callback {xcas::History_cb_Insert_Program(Xcas_current_session(),0);}
              xywh {85 85 100 20}
            }
          }
          MenuItem Xcas_save_current_session {
            label Save
            callback {xcas::History_cb_Save(Xcas_current_session(),0);}
            xywh {20 20 100 20} shortcut 0x80073
          }
          MenuItem Xcas_save_current_session_as {
            label {Save as}
            callback {xcas::History_cb_Save_as(Xcas_current_session(),0);}
            xywh {20 20 100 20}
          }
          MenuItem Xcas_save_all_sessions {
            label {Save all}
            callback {Xcas_save_all(Xcas_Main_Tab);}
            xywh {10 10 100 20}
          }
          Submenu Xcas_Export {
            label {Export as}
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_Export_Xcas {
              label {xcas text}
              callback {xcas::History_cb_Save_as_xcas_text(Xcas_current_session(),0);}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_Export_Maple {
              label {maple text}
              callback {xcas::History_cb_Save_as_maple_text(Xcas_current_session(),0);}
              xywh {75 75 100 20}
            }
            MenuItem Xcas_Export_Mupad {
              label {mupad text}
              callback {xcas::History_cb_Save_as_mupad_text(Xcas_current_session(),0);}
              xywh {85 85 100 20}
            }
            MenuItem Xcas_Export_TI {
              label {ti text}
              callback {xcas::History_cb_Save_as_ti_text(Xcas_current_session(),0);}
              xywh {95 95 100 20}
            }
          }
          MenuItem Xcas_Close {
            label Kill
            callback {xcas::History_cb_Kill(Xcas_current_session(),0);}
            xywh {45 45 100 20}
          }
          Submenu Xcas_Print {
            label Print
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_Print_Preview {
              label preview
              callback {xcas::History_cb_Preview(Xcas_current_session(),0);}
              xywh {95 95 100 20}
            }
            MenuItem Xcas_Print_Printer {
              label {to printer}
              callback {xcas::History_cb_Print(Xcas_current_session(),0);}
              xywh {105 105 100 20}
            }
            MenuItem Xcas_Print_Preview_Selected {
              label {preview selected levels}
              callback {xcas::History_cb_Preview_selected(Xcas_current_session(),0);}
              xywh {115 115 100 20}
            }
          }
          Submenu Xcas_Print_Latex {
            label LaTeX
            xywh {15 15 100 20}
          } {
            MenuItem Xcas_LaTeX_Print_Preview {
              label {latex preview}
              callback {xcas::History_cb_LaTeX_Preview(Xcas_current_session(),0);}
              xywh {110 110 100 20}
            }
            MenuItem Xcas_LaTeX_Print_Printer {
              label {latex print}
              callback {xcas::History_cb_LaTeX_Print(Xcas_current_session(),0);}
              xywh {120 120 100 20}
            }
            MenuItem Xcas_LaTeX_Print_Selection {
              label {latex print selection}
              callback {xcas::History_cb_LaTeX_Print_sel(Xcas_current_session(),0);}
              xywh {130 130 100 20}
            }
          }
          MenuItem Xcas_screen_capture {
            label {Screen capture}
            callback {xcas::widget_ps_print(Xcas_Main_Window_,"window",true,3,true,false,true);}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_do_nothing1 {
            label {--- }
            xywh {10 10 100 20}
          }
          MenuItem Xcas_create_links {
            label {Create links (Mac OS)}
            callback {\#ifdef __APPLE__
  system("/usr/X11/bin/xterm -fn 10x20 -e sudo /Applications/usr/bin/makelinks");
  \#endif}
            xywh {30 30 100 20}
          }
          MenuItem Xcas_quit_update {
            label {Quit and update Xcas}
            callback {Fl::remove_idle(xcas::Xcas_idle_function,0);
  if (!Xcas_save_all(Xcas_Main_Tab)){
    Fl::add_idle(xcas::Xcas_idle_function,0);
    return;
  }
  Xcas_Main_Window_->hide(); 
  // xcas::Xcas_Plot_Setup->hide();
  // xcas::Xcas_Cas_Setup->hide(); 
  Xcas_General_Setup->hide();
  Xcas_Script_Window->hide(); 
  if (xcas::Xcas_help_window) xcas::Xcas_help_window->hide();
  Xcas_DispG_Window_->hide();
  if (xcas::Xcas_Debug_Window) xcas::Xcas_Debug_Window->hide();
  if (xcas::handle_tab_w)
    xcas::handle_tab_w->hide();
  update_xcas=1;}
            xywh {20 20 100 20}
          }
          MenuItem Xcas_do_nothing2 {
            label {--- }
            xywh {10 10 100 20}
          }
          MenuItem Xcas_quit {
            label Quit
            callback {cb_Xcas_quit_update(0,0); 
  update_xcas=0;}
            xywh {10 10 100 20} shortcut 0x40071
          }
        }
        Submenu Xcas_Edit {
          label Edit
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_Execute_Worksheet {
            label {Execute worksheet}
            callback {xcas::History_cb_Run_Worksheet(Xcas_current_session(),0);}
            xywh {140 140 100 20} shortcut 0x4ffc6
          }
          MenuItem Xcas_Execute_Worksheet_Delay {
            label {Execute worksheet with pauses}
            callback {const char * ch=fl_input("Enter delay in seconds","1.5"); 
                if (ch){
                  Fl_Widget * wid=Xcas_current_session();
                  xcas::History_Pack * hp=dynamic_cast<xcas::History_Pack *>(wid);
                  int i=std::floor(atof(ch)*1e6);
                  if (hp && i>0 && i<120e6){ hp->next_delay=i;xcas::History_cb_Run_Worksheet(wid,0);}
               }
            }
            xywh {140 140 100 20} 
          }
          MenuItem Xcas_Execute_Below {
            label {Execute below}
            callback {xcas::History_cb_Run_Below(Xcas_current_session(),0);}
            xywh {150 150 100 20}
          }
          MenuItem Xcas_Remove_Answers {
            label {Remove answers below}
            callback {xcas::cb_Rm_Answers(Xcas_current_session(),0);}
            xywh {160 160 100 20}
          }
          MenuItem Xcas_Undo {
            label Undo
            callback {if (xcas::get_history_pack(xcas::Xcas_input_focus)) xcas::History_cb_Undo(xcas::Xcas_input_focus,0); else xcas::History_cb_Undo(Xcas_current_session(),0);}
            xywh {230 230 100 20} shortcut 0x4007a
          }
          MenuItem Xcas_Redo {
            label Redo
            callback {if (xcas::get_history_pack(xcas::Xcas_input_focus)) xcas::History_cb_Redo(xcas::Xcas_input_focus,0); else xcas::History_cb_Redo(Xcas_current_session(),0);}
            xywh {240 240 100 20} shortcut 0x40079
          }
          MenuItem Xcas_Paste {
            label Paste
            callback {xcas::cb_Paste(Xcas_current_session(),0);}
            xywh {180 180 100 20}
          }
          MenuItem Xcas_Delete {
            label {Del selected levels}
            callback {xcas::cb_Delete(Xcas_current_session(),0);}
            xywh {190 190 100 20}
          }
          MenuItem Xcas_Tex_Selection {
            label {selection -> LaTeX}
            callback {static std::string s; giac::gen g;
      const giac::context * contextptr=xcas::get_context(xcas::Xcas_input_focus);
    try {
     if (xcas::Xcas_Text_Editor * ptr=dynamic_cast<xcas::Xcas_Text_Editor *> (xcas::Xcas_input_focus)){
       int a,b;
       ptr->buffer()->selection_position(&a,&b);
      char * ch=ptr->buffer()->text_range(a,b);
      g=giac::gen(ch,contextptr);
      free(ch);
    }
     if (xcas::Equation * ptr=dynamic_cast<xcas::Equation *> (xcas::Xcas_input_focus))
      g=ptr->get_selection();
     if (xcas::Flv_Table_Gen * ptr=dynamic_cast<xcas::Flv_Table_Gen *> (xcas::Xcas_input_focus))
      g=extractmatricefromsheet(ptr->selected);
     if (Fl_Input_ * ptr=dynamic_cast<Fl_Input *>(xcas::Xcas_input_focus)){
      int i=ptr->position(),j=ptr->mark();
      if (i>j) std::swap<int>(i,j);
      s=ptr->value();
      s=s.substr(i,j-i);
      g=giac::gen(s,contextptr);
     }
     s=giac::gen2tex(g,contextptr);
    } 
    catch (std::runtime_error & e){
      s = e.what()+g.print();
    }
  Xcas_parse_error_output->value(s.c_str());
  int ss=s.size();
  Fl::copy(s.c_str(),ss,0);
  Fl::copy(s.c_str(),ss,1);}
            xywh {190 190 100 20} shortcut 0x40074
          }
          MenuItem Xcas_Add_Entry1 {
            label {New entry}
            callback {xcas::cb_New_Input(Xcas_current_session(),0);}
            xywh {60 60 100 20} shortcut 0x8006e
          }
          MenuItem Xcas_Add_Parameter {
            label {New parameter}
            callback {std::string tmp,name;
  double tmin,tmax,tcur,tstep;
  Fl_Widget * wid = xcas::Xcas_input_focus;
  int pos;
  xcas::History_Pack * hp=xcas::get_history_pack(wid,pos);
  if (hp && xcas::figure_param_dialog(xcas::Xcas_input_focus,false,tmin,tmax,tcur,tstep,name,false,tmp)){
   if (hp){
     Fl_Widget * q=xcas::new_question_multiline_input(giac::giacmax(hp->w()-hp->_printlevel_w,1),hp->labelsize()+12);	
      hp->add_entry(pos,q);
      hp->set_value(pos,tmp,true);
   }
  }}
            xywh {70 70 100 20} shortcut 0x40070
          }
          MenuItem Xcas_Insert_Newline {
            label {Insert newline}
            callback {xcas::History_cb_Newline(Xcas_current_session(),0);}
            xywh {170 170 100 20}
          }
          MenuItem Xcas_Merge {
            label {Merge selected levels}
            callback {xcas::History_cb_Merge(Xcas_current_session(),0);}
            xywh {210 210 100 20}
          }
          MenuItem Xcas_Add_HF {
            label {New group}
            callback {xcas::History_cb_New_HF(Xcas_current_session(),0);}
            xywh {130 130 100 20}
          }
          MenuItem Xcas_Fold {
            label {Group selected levels}
            callback {xcas::History_cb_Fold(Xcas_current_session(),0);}
            xywh {200 200 100 20}
          }
          MenuItem Xcas_Flatten {
            label {Degroup selected levels}
            callback {xcas::History_cb_Flatten(Xcas_current_session(),0);}
            xywh {220 220 100 20}
          }
        }
        Submenu Xcas_main_configuration {
          label Cfg
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_cas_config_ {
            label {Cas configuration}
            callback {const giac::context * contextptr=Xcas_get_context();
  xcas::Xcas_load_cas_setup(contextptr);}
            xywh {20 20 100 20}
          }
          MenuItem Xcas_graph_config_ {
            label {Graph configuration}
            callback {const giac::context * contextptr=Xcas_get_context();
  xcas::Xcas_load_graph_setup(contextptr);}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_general_config_ {
            label {General configuration}
            callback {Xcas_load_general_setup();}
            xywh {20 20 100 20}
          }
          Submenu Xcas_config_program {
            label {Mode (syntax)}
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_Set_Xcas0 {
              label xcas
              callback {const giac::context * contextptr=Xcas_get_context();
  giac::xcas_mode(contextptr)=0;
  xcas_user_level=0;
  Xcas_update_mode();}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_Set_Maple0 {
              label maple
              callback {const giac::context * contextptr=Xcas_get_context();
  giac::xcas_mode(contextptr)=1;
  xcas_user_level=0;
  Xcas_update_mode();}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_Set_Mupad0 {
              label mupad
              callback {const giac::context * contextptr=Xcas_get_context();
  giac::xcas_mode(contextptr)=2;
  xcas_user_level=0;
  Xcas_update_mode();}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_Set_TI0 {
              label {ti89/92}
              callback {const giac::context * contextptr=Xcas_get_context();
  giac::xcas_mode(contextptr)=3;xcas_user_level=0;
  Xcas_update_mode();}
              xywh {40 40 100 20}
            }
          }
          Submenu Xcas_show_something {
            label Show
            xywh {5 5 100 20}
          } {
            MenuItem Xcas_show_DispG {
              label DispG
              callback {Xcas_DispG_Window_->show(); 
  Xcas_DispG_Cancel_->hide();} selected
              xywh {45 45 100 20} shortcut 0x80064
            }
            MenuItem Xcas_show_keyboard {
              label keyboard
              callback {Xcas_Keyboard_Group->show(); Xcas_resize_mainwindow();}
              xywh {30 30 100 20}
            }
            MenuItem Xcas_show_bandeau {
              label bandeau
              callback {Xcas_Bandeau_Keys->show(); Xcas_resize_mainwindow();}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_show_msg {
              label msg
              callback {Xcas_Messages->show(); Xcas_resize_mainwindow();}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_show_script_window {
              label {Show script window}
              callback {Xcas_Script_Window->show();}
              xywh {20 20 100 20} hide
            }
          }
          Submenu Xcas_Hide_Something {
            label Hide
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_hide_DispG {
              label DispG
              callback {Xcas_DispG_Window_->hide(); 
  Xcas_DispG_Cancel_->hide();}
              xywh {55 55 100 20}
            }
            MenuItem Xcas_hide_keyboard {
              label keyboard
              callback {Xcas_Keyboard_Group->hide(); Xcas_resize_mainwindow();}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_hide_bandeau {
              label bandeau
              callback {Xcas_Bandeau_Keys->hide(); Xcas_resize_mainwindow();}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_hide_msg {
              label msg
              callback {Xcas_Messages->hide(); Xcas_resize_mainwindow();}
              xywh {45 45 100 20}
            }
          }
          Submenu Xcas_index_language {
            label {Index language}
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_index_Francais {
              label francais
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(1,giac::context0);
  doc_prefix=giac::set_language(1,contextptr);
  giac::language(1,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_index_English {
              label english
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(2,giac::context0);
  doc_prefix=giac::set_language(2,contextptr);
  giac::language(2,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_index_Espanol {
              label espanol
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(3,giac::context0);
  doc_prefix=giac::set_language(3,contextptr);
  giac::language(3,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_index_Greek {
              label greek
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(4,giac::context0);
  doc_prefix=giac::set_language(4,contextptr);
  giac::language(4,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_index_Chinese {
              label chinese
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(4,giac::context0);
  doc_prefix=giac::set_language(8,contextptr);
  giac::language(8,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_index_German {
              label deutsch
              callback {const giac::context * contextptr=Xcas_get_context();
  // doc_prefix=giac::set_language(3,giac::context0);
  doc_prefix=giac::set_language(9,contextptr);
  giac::language(9,giac::context0);
  giac::html_help_init("aide_cas",1);}
              xywh {0 0 100 20}
            }
          }
          Submenu Xcas_Colors {
            label Colors open
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_background_color_item {
              label {default background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_background_color);
  xcas::Xcas_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {10 10 100 20}
            }
            MenuItem Xcas_input_text_color {
              label {input text}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_input_color);
  xcas::Xcas_input_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_input_text_background_color {
              label {input background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_input_background_color);
  xcas::Xcas_input_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_comment_color_item {
              label {comment text}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_comment_color);
  xcas::Xcas_comment_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_comment_background_color_item {
              label {comment background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_comment_background_color);
  xcas::Xcas_comment_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_log_color_item {
              label {log text}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_log_color);
  xcas::Xcas_log_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_log_background_color_item {
              label {log background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_log_background_color);
  xcas::Xcas_log_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_equation_color_item {
              label {equation text}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_equation_color);
  xcas::Xcas_equation_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_equation_background_color_item {
              label {equation background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_equation_background_color);
  xcas::Xcas_equation_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20}
            }
            MenuItem Xcas_editor_color_item {
              label {editor text}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_editor_color);
  xcas::Xcas_editor_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20} hide
            }
            MenuItem Xcas_editor_background_color_item {
              label {editor background}
              callback {Fl_Color c=fl_show_colormap(xcas::Xcas_editor_background_color);
  xcas::Xcas_editor_background_color=c;
  xcas::set_colors(Xcas_Main_Window_);}
              xywh {0 0 100 20} hide
            }
          }
          MenuItem Xcas_change_current_fontsize {
            label {Session font}
            callback {Fl_Widget * wid=Xcas_Main_Tab->value();
   if (wid){
    int taille=wid->labelsize();
    Fl_Font police=wid->labelfont();
    if (xcas::get_font(police,taille)){
     wid->labelfont(police);
     xcas::change_group_fontsize(wid,taille);
    }
    Xcas_Main_Window_->redraw();
   }}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_change_fontsize {
            label {All fonts}
            callback {Fl_Widget * wid=Xcas_Main_Window_;
   if (wid){
    int taille=wid->labelsize();
    Fl_Font police=wid->labelfont();
    if (xcas::get_font(police,taille)){
     wid->labelfont(police);
     xcas::change_group_fontsize(wid,taille);
    }
    Xcas_change_labelsize(taille);
    Xcas_Main_Window_->redraw();
   }}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_browser {
            label browser
            callback {std::string s=Xcas_browser_name();
  const char * ch=fl_input(gettext("Enter new help browser program (empty line for builtin)"),s.c_str());
  if (!ch)
    return;
  if (strlen(ch) && strcmp(ch,"builtin")){
    setenv("BROWSER",ch,1);
  xcas::use_external_browser=true;
  }
  else
    xcas::use_external_browser=false;}
            xywh {5 5 100 20}
          }
          MenuItem Save_config {
            label {Save configuration}
            callback {Xcas_save_config(Xcas_get_context());}
            xywh {10 10 100 20}
          }
        }
        Submenu Xcas_help_menu {
          label Help open
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_index {
            label Index
            callback {static std::string ans; 
     int remove,ii;
     Fl_Widget * w=xcas::Xcas_input_focus;
     if (
     (ii=xcas::handle_tab("",(*giac::vector_completions_ptr()),Xcas_Main_Window_->w()/3,Xcas_Main_Window_->h()/3,remove,ans)) ){ 
      if (ii==1)
        ans = ans +"()";
      Fl::e_text = (char * ) ans.c_str();
      Fl::e_length = ans.size();
      if (w){
        xcas::fl_handle(w);
        if (Fl_Input * in =dynamic_cast<Fl_Input *>(w)){
          if (ii==1) in->position(in->position()-1);
        }
      }
    }}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_help_find {
            label {Find word in HTML help}
            callback {xcas::help_fltk("");}
            xywh {10 10 100 20} shortcut 0xffc9
          }
          MenuItem Xcas_help_casinter {
            label Interface
            callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"casinter/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casinter/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_help_fiches {
            label {Reference card, fiches}
            callback {if (giac::language(Xcas_get_context())==1) giac::system_browser_command(giac::giac_aide_dir()+"doc/fr/troussesurvie_fr.pdf"); else giac::system_browser_command(giac::giac_aide_dir()+"doc/en/troussesurvie_en.pdf");}
            xywh {25 25 100 20}
          }
          Submenu Xcas_help_manuals {
            label Manuals
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_CAS {
              label {CAS reference}
              callback {const giac::context * contextptr=Xcas_get_context();
  if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"cascmd_"+giac::find_lang_prefix(giac::language(contextptr))+"index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cascmd_"+giac::find_lang_prefix(giac::language(contextptr))+"index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
            MenuItem Xcas_help_algo {
              label {Algorithmes (HTML)}
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"algo.html");
          else {
           if (xcas::Xcas_help_window){ //disabled because it crashes with builin browser
             fl_message("%s",("Open with your browser "+giac::giac_aide_dir()+doc_prefix+"algo.html").c_str());
             // xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"algo.html").c_str());
             // xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
            MenuItem Xcas_help_algo_pdf {
              label {Algorithmes (PDF)}
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"algo.pdf");
          else {
           if (xcas::Xcas_help_window){
             fl_message("%s",("Open "+giac::giac_aide_dir()+doc_prefix+"algo.pdf").c_str());
             // xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"algo.pdf").c_str());
             // xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
            MenuItem Xcas_help_Geo {
              label Geometry
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"casgeo/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casgeo/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
            MenuItem Xcas_help_Prog {
              label Programmation
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"casrouge/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casrouge/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
            MenuItem Xcas_help_Tableur {
              label Simulation
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"cassim/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cassim/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {15 15 100 20}
            }
            MenuItem Xcas_help_Tortue {
              label Turtle
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"castor/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"castor/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_Exercices {
              label Exercices
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"casexo/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casexo/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_Amusement {
              label Amusement
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"cascas/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cascas/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_PARI {
              label {PARI-GP}
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(giac::giac_aide_dir()+"doc/pari/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+"doc/pari/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {5 5 100 20}
            }
          }
          Submenu Xcas_help_internet {
            label Internet open
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_forum {
              label Forum
              callback {const giac::context * contextptr = xcas::get_context(xcas::Xcas_input_focus);
   giac::system_browser_command(giac::language(contextptr)==4?"http://www.inf.uth.gr/xcas/":"http://xcas.e.ujf-grenoble.fr/XCAS");}
              xywh {15 15 100 20}
            }
            MenuItem Xcas_help_lycee_card {
              label {Aide-memoire lycee}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/irem/placlycee.pdf");}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_lycee {
              label {Documents pedagogiques lycee}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/irem.html");}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_algo_lycee {
              label {Documents algorithmique}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/algoxcas.html");}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_connan {
              label {Site Lycee de G. Connan}
              callback {giac::system_browser_command("http://gconnan.free.fr/?page=33");}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_alb {
              label {Site Lycee de L. Briel}
              callback {giac::system_browser_command("http://lycee-rodezlaroque.eap.entmip.fr/le-lycee/xcas/");}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_cheval {
              label {Calcul formel au lycee, par D. Chevallier}
              callback {giac::system_browser_command("http://courelectr.free.fr/Xcas/Xcas_calcul_formel_lycee.pdf");}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_han {
              label {Site de F. Han}
              callback {giac::system_browser_command("http://www.math.jussieu.fr/~han/xcas");}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_capes {
              label {Ressources Capes}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/capes.html");}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_agreg {
              label {Ressources Agregation externe}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/agreg.html");}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_agregint {
              label {Ressources Agregation interne}
              callback {giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/agregint.html");}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_load {
              label {Update help}
              callback {\#ifdef WIN32
    fl_message("%s","Xcas will launch your browser to get the help archive giacshare.tgz.\\nAfter the download is completed, please unarchive casdoc.tgz\\nin the Xcas directory (c:Ês by default)");
   giac::system_browser_command("http://www-fourier.ujf-grenoble.fr/~parisse/giac/casdoc.tgz");
   return;
  \#endif
    std::string path=giac::xcasroot();
   int s=path.size(),i=s-1;
   for (--i;i>0;--i){
     if (path[i]=='/')
       break;
   }
   path=path.substr(0,i+1)+"share";
   i=fl_ask("%s",("Check that you can write over "+path+",\\ncheck that your Internet connection is ready\\nand check that wget, tar and gzip are installed.\\nProceed?").c_str());
    if (i){
      fl_message("%s",("Executing: mkdir /tmp ; cd /tmp && wget http://www-fourier.ujf-grenoble.fr/~parisse/giac/giacshare.tgz && cd "+path+" && tar xvfz /tmp/giacshare.tgz").c_str());
      system(("mkdir /tmp ; cd /tmp && wget http://www-fourier.ujf-grenoble.fr/~parisse/giac/giacshare.tgz && cd "+path+" && tar xvfz /tmp/giacshare.tgz").c_str());
    }}
              xywh {5 5 100 20}
            }
          }
          Submenu Xcas_help_start {
            label {Start with CAS}
            xywh {5 5 100 20}
          } {
            MenuItem Xcas_help_tutorial {
              label Tutorial
              callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"tutoriel/index.html");
          else {
           if (xcas::Xcas_help_window){
             xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"tutoriel/index.html").c_str());
             xcas::Xcas_help_window->show();
            }
           }}
              xywh {15 15 100 20}
            }
            MenuItem Xcas_help_solution {
              label solutions
              callback {const char * ch=fl_input(gettext("Exercise number (from 1 to 25)?"));
  if (!ch) return;
  int i=atoi(ch);
  if (i>0 && i<26){
    std::string name="demarr"+giac::print_INT_(i)+".xws";
    std::ifstream in((giac::giac_aide_dir()+"doc/dxcas/"+name).c_str());
    std::ofstream out(name.c_str());
    bool b=xcas::stream_copy(in,out);
    in.close();
    out.close();
    if (b)
      load_filename(name.c_str(),false);
    else
      load_filename((giac::giac_aide_dir()+"doc/dxcas/"+name).c_str(),false);
  }}
              xywh {5 5 100 20}
            }
          }
          MenuItem Xcas_help_start_algoseconde {
            label {Tutoriel algo}
            callback {if (xcas::use_external_browser)
             giac::system_browser_command(doc_prefix+"../algoseconde.html");
            }
            xywh {10 10 100 20}
          }
          MenuItem Xcas_help_make_index {
            label {Rebuild help cache}
            callback {const giac::context * contextptr=Xcas_get_context();
  giac::html_help_init("aide_cas",language(contextptr),true,true);}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_a_propos {
            label About
            callback {a_propos();   Xcas_Messages->show(); 
    Xcas_resize_mainwindow();}
            xywh {5 5 100 20}
          }
        }
        Submenu Xcas_help_CASmenu {
          label Toolbox
          xywh {20 20 100 20}
        } {
          MenuItem Xcas_Add_Entry {
            label {New entry}
            callback {xcas::cb_New_Input(Xcas_current_session(),0);}
            xywh {50 50 100 20} shortcut 0x8006e
          }
          MenuItem Xcas_Add_Comment {
            label {New comment}
            callback {xcas::History_cb_New_Comment_Input(Xcas_current_session(),0);}
            xywh {40 40 100 20} shortcut 0x80063
          }
          Submenu Xcas_help_equations {
            label Equations
            xywh {5 5 100 20}
          } {
            MenuItem Xcas_help_solve {
              label {solve: Solve equation or system}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_fsolve {
              label {fsolve: Solve equation numerically}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_proot {
              label {proot: Roots of a polynomial}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_linsolve {
              label {linsolve: Solve linear system}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_desolve {
              label {desolve: Solve differential equation}
              xywh {25 25 100 20}
            }
            MenuItem Xcas_help_odesolve {
              label {odesolve: Solve differential equation (numeric)}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_rsolve {
              label {rsolve: Solve recurrence equation}
              xywh {45 45 100 20}
            }
          }
          Submenu Xcas_help_calculus {
            label Calculus
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_int {
              label {int: Integration (definite/indefinite)}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_diff {
              label {diff: Derivative}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_limit {
              label {limit: Limit}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ptayl {
              label {ptayl: Taylor polynomial}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_series {
              label {series: series expansion (with remainder)}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_sum {
              label {sum: Discrete summation}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_laplace {
              label {laplace: Laplace transform}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ilaplace {
              label {ilaplace: invert Laplace transform}
              xywh {35 35 100 20}
            }
          }
          Submenu Xcas_help_Simplify {
            label Simplify
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_simplify {
              label {simplify: Simplify expression}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_normal {
              label {normal: Simplify rational and algebraic expression}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ratnormal {
              label {ratnormal: Simplify rational expressions}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_factor {
              label {factor: Factorization}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_cfactor {
              label {cfactor: Factorization over C}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_partfrac {
              label {partfrac: Partial fraction decomposition}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_cpartfrac {
              label {cpartfrac: Partial fraction decomposition over C}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_sep1 {
              label {---}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_subst {
              label {subst: Substitution of variables by expressions}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_reorder {
              label {reorder: Reorder expression wrt list of variables}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_sep2 {
              label {---}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_lin {
              label {lin: Linearization of exponentials}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_tlin {
              label {tlin: Trigonometric linearization}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_texpand {
              label {texpand: Expand transcendental expressions}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_lncollect {
              label {lncollect: Collect logarithms}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_exp2pow {
              label {exp2pow: Convert exp(a*ln(b)) to b^a}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_exp2trig {
              label {exp2trig: Convert complex exponentials to trig}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_trig2exp {
              label {trig2exp: Convert trig to complex exponentials}
              xywh {35 35 100 20}
            }
          }
          Submenu Xcas_help_arit {
            label Arithmetic
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_isprime {
              label {isprime: test if an integer is prime}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ifactor {
              label {ifactor: factorize an integer}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_iquo {
              label {iquo: quotient for integers}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_irem {
              label {irem: remainder for integers}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_iabcuv {
              label {iabcuv: Solve a.u+b.v=c in Z}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ichinrem {
              label {ichinrem: Chinese remainder for integers}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_sep3 {
              label {---}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_gcd {
              label {gcd: gcd of integers or polynomials}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_lcm {
              label {lcm: lcm of integers or polynomials}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_powmod {
              label {powmod: fast powering modulo}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_sep4 {
              label {---}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_quo {
              label {quo: quotient (poly. synthetic division)}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_rem {
              label {rem: remainder (poly. synthetic division)}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_abcuv {
              label {abcuv: Solve a.u+b.v=c for polynomials}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_chinrem {
              label {chinrem: Chinese remainder for polynomials}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_pourcent {
              label {%: Z/pZ, p premier}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_GF {
              label {GF: Corps fini non premier}
              xywh {35 35 100 20}
            }
          }
          Submenu Xcas_help_linal {
            label {Linear algebra}
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_matrix {
              label {matrix: Create a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_tran {
              label {tran: Transpose a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_ker {
              label {ker: Kernel of a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_image {
              label {image: Image of a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_inverse {
              label {inv: Invert a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_det {
              label {det: Determinant of a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_charpoly {
              label {charpoly: Characteristic polynomial}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_egv {
              label {egv: Eigenvectors of a matrix}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_egvl {
              label {egvl: Eigenvalues of a matrix}
              xywh {35 35 100 20}
            }
          }
          Submenu Xcas_help_proba {
            label Proba
            xywh {0 0 100 20}
          } {
            MenuItem Xcas_help_binomial {
              label {binomial: Binomial distribution}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_comb {
              label {comb: comb(n.k) k parmi n}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_normald {
              label {normald: Normal density}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_seq {
              label {seq: list}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_rand {
              label {rand: random number}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_ranm {
              label {ranm: random vector/matrix}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_randmarkov {
              label {randmarkov: random Markov matrix or chain}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_markov {
              label {markov: transition matrix decomposition}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_cdf {
              label {cdf: cumulated distribution function}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_icdf {
              label {icdf: inverse cumulated distributed function}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_proba_plot {
              label {=== see also plots in Graph ====}
              xywh {35 35 100 20}
            }
            Submenu {} {
              label {Continuous (densities)} open
              xywh {0 0 62 20}
            } {
              MenuItem Xcas_help_betad {
                label {betad: Beta density}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_cauchy {
                label {cauchyd: Cauchy density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_chisquare {
                label {chisquared: Chi 2 density}
                xywh {50 50 100 20}
              }
              MenuItem Xcas_help_exponential {
                label {exponentiald: Exponential density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_fisher {
                label {fisherd: Fisher-Snedecor density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_gammad {
                label {gammad: Gamma density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_normald2 {
                label {normald: Normal density}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_student {
                label {studentd: Student density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_uniform {
                label {uniformd: Uniform density}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_weibull {
                label {weibulld: Weibull density}
                xywh {40 40 100 20}
              }
            }
            Submenu {} {
              label {Discrete distributions} open
              xywh {0 0 62 20}
            } {
              MenuItem Xcas_help_binomial2 {
                label {binomial: Binomial distribution}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_negbinomial {
                label {negbinomial: Negative binomial distribution}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_geometric {
                label {geometric: Geometric distribution}
                xywh {40 40 100 20}
              }
              MenuItem Xcas_help_poisson {
                label {poisson: poisson distribution}
                xywh {40 40 100 20}
              }
            }
            Submenu {} {
              label Tests open
              xywh {0 0 62 20}
            } {
              MenuItem Xcas_help_chisquare_icdf {
                label {chisquared_icdf: Chi 2 inverse}
                xywh {60 60 100 20}
              }
              MenuItem Xcas_help_chisquaret {
                label {chisquaret: Chi 2 test}
                xywh {50 50 100 20}
              }
              MenuItem Xcas_help_kolmogorovd {
                label {kolmogorovd: K-Smirnov density}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_kolmogorovt {
                label {kolmogorovt: K-Smirnov test}
                xywh {45 45 100 20}
              }
              MenuItem Xcas_help_normald_icdf2 {
                label {normald_icdf: Normal inverse}
                xywh {60 60 100 20}
              }
              MenuItem Xcas_help_normalt {
                label {normalt: Z-Test}
                xywh {50 50 100 20}
              }
              MenuItem Xcas_help_studentd_icdf2 {
                label {studentd_icdf: Student inverse}
                xywh {60 60 100 20}
              }
              MenuItem Xcas_help_studentt {
                label {studentt: T-Test}
                xywh {50 50 100 20}
              }
              MenuItem Xcas_help_wilcoxont {
                label {wilcoxont: Test}
                xywh {50 50 100 20}
              }
            }
          }
        }
        Submenu Xcas_help_expression {
          label Expression
          xywh {40 40 100 20}
        } {
          MenuItem Xcas_Add_Expression {
            label {New expression}
            callback {xcas::History_cb_New_Equation(Xcas_current_session(),0);}
            xywh {125 125 100 20} shortcut 0x80065
          }
        }
        Submenu Xcas_help_allcmds {
          label Cmds
          xywh {85 85 100 20}
        } {
          Submenu Xcas_help_constants {
            label Constants open
            xywh {15 15 100 20}
          } {
            MenuItem Xcas_help_i {
              label {i: sqrt(-1)}
              callback {int mode=giac::xcas_mode(Xcas_get_context()); if (mode==1 || mode==2) xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"I",'I'); else xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"i",'i');}
              xywh {35 35 100 20}
            }
            MenuItem Xcas_help_e {
              label {e: exp(1)}
              callback {int mode=giac::xcas_mode(Xcas_get_context()); if (mode==1 || mode==2) xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"exp(1)",'e'); else xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"e",'e');}
              xywh {35 35 100 20}
            }
          }
        }
        Submenu Xcas_help_prog {
          label Prg
          xywh {55 55 100 20}
        } {
          MenuItem Xcas_Add_Program {
            label {New program}
            callback {xcas::History_cb_New_Program(Xcas_current_session(),0);}
            xywh {110 110 100 20} shortcut 0x80070
          }
          MenuItem Xcas_help_debug {
            label {debug: debug a program}
            xywh {65 65 100 20}
          }
        }
        Submenu Xcas_help_graph {
          label Graphic
          xywh {40 40 100 20}
        } {
          MenuItem Xcas_help_attributs {
            label Attributs
            callback {static int res=0;
  bool untranslate=false,approx=false,formel=false;
  Fl_Widget * w=xcas::Xcas_input_focus;
  Fl_Input_ * i=dynamic_cast<Fl_Input_*>(w);
  xcas::Xcas_Text_Editor * ed=dynamic_cast<xcas::Xcas_Text_Editor *>(w);
  if (i && xcas::change_line_type(res,false,approx,"Attributs",false,formel,untranslate,false,
  Xcas_Main_Window_->labelsize())!=1){
    std::string s="display="+xcas::print_color(res);
    i->insert(s.c_str()); 
    Fl::focus(i);
  }
  if (ed && xcas::change_line_type(res,false,approx,"Attributs",false,formel,untranslate,false,
  Xcas_Main_Window_->labelsize())!=1){
    std::string s="display="+xcas::print_color(res);
    ed->insert(s.c_str()); 
    Fl::focus(ed);
  }}
            xywh {65 65 100 20} shortcut 0x8006b
          }
          Submenu Xcas_help_curves {
            label Curves
            xywh {10 10 100 20}
          } {
            MenuItem Xcas_help_plot {
              label {plotfunc: Plot a 1-var function}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && tablefunc_dialog(f,arg,true,0,gettext("Graph of a function"))){
  	f->add_entry(pos);
  	arg="plot(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotparam2d {
              label {plotparam: Parametric 2-d curve}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,0)){
  	f->add_entry(pos);
  	arg="plotparam(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotpolar {
              label {plotpolar: Polar 2-d curve}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,-1)){
  	f->add_entry(pos);
  	arg="plotpolar(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotarea {
              label {plotarea: Area under curve}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && tablefunc_dialog(f,arg,true,2,gettext("Area under curve"))){
  	f->add_entry(pos);
  	arg="plotarea(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotimplicit {
              label {plotimplicit: Implicit plot}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,3)){
  	f->add_entry(pos);
  	arg="plotimplicit(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotcontour {
              label {plotcontour: Level curves}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_plotdensity {
              label {plotdensity: 2-d z view as color}
              xywh {50 50 100 20}
            }
          }
          Submenu Xcas_help_graph_surfaces {
            label Surfaces
            xywh {75 75 100 20}
          } {
            MenuItem Xcas_help_plot3d {
              label {plotfunc: Plot a 2-var function}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && tablefunc_dialog(f,arg,true,1,gettext("Graph of a function"))){
  	f->add_entry(pos);
  	arg="plotfunc(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_plotparam3d {
              label {plotparam: Parametric 3-d surface}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,1)){
  	f->add_entry(pos);
  	arg="plotparam(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {45 45 100 20}
            }
          }
          Submenu Xcas_help_graph_suite {
            label Sequence
            xywh {65 65 100 20}
          } {
            MenuItem Xcas_help_plotseq {
              label {plotseq: Recurrent sequence plot}
              callback {int pos;
  std::string arg,u0param;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && tableseq_dialog(f,arg,true,gettext("Graph of a recurrent sequence"),u0param)){
  	f->add_entry(pos);
  	arg=u0param+"; plotseq(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_plotlist {
              label {plotlist: plot a list of values}
              xywh {55 55 100 20}
            }
          }
          Submenu Xcas_help_graph_ode {
            label Ode
            xywh {75 75 100 20}
          } {
            MenuItem Xcas_help_plotfield {
              label {plotfield: 2-d or 3-d field}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,2)){
  	f->add_entry(pos);
  	arg="plotfield(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_plotode {
              label {plotode: Diff. equation plot}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_iplotode {
              label {interactive_odeplot: Interactive diff. equation plot}
              callback {int pos;
  std::string arg;
  xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
  if (f && plotparam_dialog(f,arg,2)){
  	f->add_entry(pos);
  	arg="interactive_plotode(" +arg+")";
  	f->set_value(pos,arg,true);
        }}
              xywh {55 55 100 20}
            }
          }
          Submenu Xcas_help_graph_stats {
            label {Proba Stats}
            xywh {65 65 100 20}
          } {
            MenuItem Xcas_help_camembert {
              label {camembert: 1-d stats}
              xywh {55 55 100 20}
            }
            MenuItem Xcas_help_baton {
              label {bar_plot: bar plot}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_help_histogram {
              label {histogram: 1-d stats}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_help_plotstat {
              label {plot: plot distribution law}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_help_plotcdf {
              label {plotcdf: plot cumulated distribution function}
              xywh {65 65 100 20}
            }
            MenuItem Xcas_help_moustache {
              label {moustache: 1-d stats}
              xywh {75 75 100 20}
            }
            MenuItem Xcas_help_scatterplot {
              label {scatterplot: 2-d stats}
              xywh {85 85 100 20}
            }
            MenuItem Xcas_help_polygonplot {
              label {polygonplot: 2-d stats}
              xywh {95 95 100 20}
            }
            MenuItem Xcas_help_polygonscatterplot {
              label {polygonscatterplot: 2-d stats}
              xywh {95 95 100 20}
            }
            MenuItem Xcas_help_linear_regression_plot {
              label {linear_regressionplot: 2-d stats}
              xywh {95 95 100 20}
            }
            MenuItem Xcas_help_plotproba {
              label {plotproba: probabilistic graph}
              xywh {65 65 100 20}
            }
          }
        }
        Submenu Xcas_help_geo {
          label Geo
          xywh {40 40 100 20}
        } {
          MenuItem Xcas_Add_Figure {
            label {New figure 2d}
            callback {xcas::History_cb_New_Figure(Xcas_current_session(),0);}
            xywh {75 75 100 20} shortcut 0x80067
          }
          MenuItem Xcas_Add_Figure3d {
            label {New figure 3d}
            callback {xcas::History_cb_New_Figure3d(Xcas_current_session(),0);}
            xywh {85 85 100 20} shortcut 0x80068
          }
        }
        Submenu Xcas_help_tableur {
          label Spreadsheet
          xywh {30 30 100 20}
        } {
          MenuItem Xcas_Add_Tableur {
            label {New spreadsheet}
            callback {xcas::History_cb_New_Tableur(Xcas_current_session(),0);}
            xywh {60 60 100 20} shortcut 0x80074
          }
        }
        Submenu Xcas_help_phys {
          label Phys open
          xywh {95 95 100 20}
        } {}
        Submenu Xcas_help_scolaire {
          label Highschool open
          xywh {75 75 100 20}
        } {}
        Submenu Xcas_help_tortue {
          label Turtle
          xywh {65 65 100 20}
        } {
          MenuItem Xcas_Add_Logo {
            label {New turtle}
            callback {xcas::History_cb_New_Logo(Xcas_current_session(),0);}
            xywh {105 105 100 20} shortcut 0x80064
          }
        }
      }
      Fl_Tabs Xcas_Main_Tab {open
        xywh {0 25 775 360} selection_color 215 resizable
        class {xcas::Xcas_Tabs}
      } {}
      Fl_Group Xcas_Keyboard_Group {open
        xywh {0 415 455 100}
      } {
        Fl_Group Xcas_Alpha_Keyboard {
          xywh {0 415 305 100} hide
        } {
          Fl_Button Xcas_a_key {
            label a
            xywh {0 415 30 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_b_key {
            label b
            xywh {30 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_c_key {
            label c
            xywh {55 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_d_key {
            label d
            xywh {80 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_e_key {
            label e
            xywh {105 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_f_key {
            label f
            xywh {130 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_g_key {
            label g
            xywh {155 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_h_key {
            label h
            xywh {180 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_i_key {
            label i
            xywh {205 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_j_key {
            label j
            xywh {230 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_k_key {
            label k
            xywh {255 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_l_key {
            label l
            xywh {280 415 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_m_key {
            label m
            xywh {0 440 30 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_n_key {
            label n
            xywh {30 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_o_key {
            label o
            xywh {55 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_p_key {
            label p
            xywh {80 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_q_key {
            label q
            xywh {105 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_r_key {
            label r
            xywh {130 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_s_key {
            label s
            xywh {155 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_t_key {
            label t
            xywh {180 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_u_key {
            label u
            xywh {205 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_v_key {
            label v
            xywh {230 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_w_key {
            label w
            xywh {255 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_x_key {
            label x
            xywh {280 440 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_y_key {
            label y
            xywh {0 465 30 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_z_key {
            label z
            xywh {30 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Inferieur_key {
            label {<}
            xywh {55 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Superieur_key {
            label {>}
            xywh {80 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Backslash_key {
            label {\\}
            xywh {30 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Parenthese_ouvrante_key {
            label {(}
            xywh {105 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Parenthese_fermante_key {
            label {)}
            xywh {130 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Espace_key {
            label { }
            xywh {255 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Point_exclamation_key {
            label {!}
            xywh {180 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Crochet_fermant_key {
            label {]}
            xywh {180 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Crochet_ouvrant_key {
            label {[}
            xywh {155 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Accolade_ouvrant_key {
            label {\{}
            xywh {205 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Accolade_fermant_key {
            label {\}}
            xywh {230 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Deux_points_key {
            label {:}
            xywh {130 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Equal_key {
            label {=}
            xywh {155 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Guillemet_key {
            label {"}
            xywh {280 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Souligne_key {
            label _
            xywh {55 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Majuscule_key {
            label Maj
            callback {if (Xcas_Majuscule_key->label()==std::string(gettext("min"))){
    Xcas_Majuscule_key->label(gettext("Maj"));
    Xcas_a_key->label("a");
    Xcas_b_key->label("b");
    Xcas_c_key->label("c");
    Xcas_d_key->label("d");
    Xcas_e_key->label("e");
    Xcas_f_key->label("f");
    Xcas_g_key->label("g");
    Xcas_h_key->label("h");
    Xcas_i_key->label("i");
    Xcas_j_key->label("j");
    Xcas_k_key->label("k");
    Xcas_l_key->label("l");
    Xcas_m_key->label("m");
    Xcas_n_key->label("n");
    Xcas_o_key->label("o");
    Xcas_p_key->label("p");
    Xcas_q_key->label("q");
    Xcas_r_key->label("r");
    Xcas_s_key->label("s");
    Xcas_t_key->label("t");
    Xcas_u_key->label("u");
    Xcas_v_key->label("v");
    Xcas_w_key->label("w");
    Xcas_x_key->label("x");
    Xcas_y_key->label("y");
    Xcas_z_key->label("z");
  \#ifdef _HAVE_FL_UTF8_HDR_
  if (Xcas_Greek_key->label()==std::string("A")){
    Xcas_a_key->label("α");
    Xcas_b_key->label("β");
    Xcas_g_key->label("γ");
    Xcas_d_key->label("δ");
    Xcas_e_key->label("ε");
    Xcas_z_key->label("ζ");
    Xcas_h_key->label("η");
    Xcas_q_key->label("θ");
    Xcas_i_key->label("ι");
    Xcas_k_key->label("κ");
    Xcas_l_key->label("λ");
    Xcas_m_key->label("μ");
    Xcas_n_key->label("ν");
    Xcas_x_key->label("ξ");
    Xcas_o_key->label("ο");
    Xcas_p_key->label("π");
    Xcas_r_key->label("ρ");
    Xcas_s_key->label("σ");
    Xcas_t_key->label("τ");
    Xcas_u_key->label("υ");
    Xcas_f_key->label("φ");
    Xcas_c_key->label("χ");
    Xcas_y_key->label("ψ"); // FIXME
    Xcas_w_key->label("ω");
    Xcas_j_key->label("ϒ"); // FIXME
    Xcas_v_key->label("ϖ"); // FIXME
  }
  \#endif
  }
  else {
    Xcas_Majuscule_key->label(gettext("min"));
    Xcas_a_key->label("A");
    Xcas_b_key->label("B");
    Xcas_c_key->label("C");
    Xcas_d_key->label("D");
    Xcas_e_key->label("E");
    Xcas_f_key->label("F");
    Xcas_g_key->label("G");
    Xcas_h_key->label("H");
    Xcas_i_key->label("I");
    Xcas_j_key->label("J");
    Xcas_k_key->label("K");
    Xcas_l_key->label("L");
    Xcas_m_key->label("M");
    Xcas_n_key->label("N");
    Xcas_o_key->label("O");
    Xcas_p_key->label("P");
    Xcas_q_key->label("Q");
    Xcas_r_key->label("R");
    Xcas_s_key->label("S");
    Xcas_t_key->label("T");
    Xcas_u_key->label("U");
    Xcas_v_key->label("V");
    Xcas_w_key->label("W");
    Xcas_x_key->label("X");
    Xcas_y_key->label("Y");
    Xcas_z_key->label("Z");
  \#ifdef _HAVE_FL_UTF8_HDR_
  if (Xcas_Greek_key->label()==std::string("A")){
    Xcas_a_key->label("Α");
    Xcas_b_key->label("Β");
    Xcas_g_key->label("Γ");
    Xcas_d_key->label("Δ");
    Xcas_e_key->label("Ε");
    Xcas_z_key->label("Ζ");
    Xcas_h_key->label("Η");
    Xcas_q_key->label("Θ");
    Xcas_i_key->label("Ι");
    Xcas_k_key->label("Κ");
    Xcas_l_key->label("Λ");
    Xcas_m_key->label("Μ");
    Xcas_n_key->label("Ν");
    Xcas_x_key->label("Ξ");
    Xcas_o_key->label("Ο");
    Xcas_p_key->label("Π");
    Xcas_r_key->label("Ρ");
    Xcas_s_key->label("Σ");
    Xcas_t_key->label("Τ");
    Xcas_u_key->label("Υ");
    Xcas_f_key->label("Φ");
    Xcas_c_key->label("Χ");
    Xcas_y_key->label("Ψ"); // FIXME
    Xcas_w_key->label("Ω");
    Xcas_j_key->label("ϒ"); // FIXME
    Xcas_v_key->label("ϖ"); // FIXME
  }
  \#endif
  }
  Xcas_Alpha_Keyboard->redraw();}
            xywh {0 490 30 25} color 1 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Diese_key {
            label {\#}
            xywh {205 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Pi_key {
            label {Π}
            xywh {230 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Greek_key {
            label a
            callback {\#ifdef _HAVE_FL_UTF8_HDR_
  if (Xcas_Greek_key->label()==std::string("α")){
    Xcas_Greek_key->label("A");
  }
  else {
    Xcas_Greek_key->label("α");
  }
  if (Xcas_Majuscule_key->label()==std::string(gettext("min")))
    Xcas_Majuscule_key->label(gettext("Maj"));
  else
    Xcas_Majuscule_key->label(gettext("min"));
  cb_Xcas_Majuscule_key(0,0);
  \#else // _HAVE_FL_UTF8_HDR_
  if (Xcas_Greek_key->label()==std::string("a")){
    Xcas_Greek_key->label("A");
    Xcas_a_key->labelfont(FL_SYMBOL);
    Xcas_b_key->labelfont(FL_SYMBOL);
    Xcas_c_key->labelfont(FL_SYMBOL);
    Xcas_d_key->labelfont(FL_SYMBOL);
    Xcas_e_key->labelfont(FL_SYMBOL);
    Xcas_f_key->labelfont(FL_SYMBOL);
    Xcas_g_key->labelfont(FL_SYMBOL);
    Xcas_h_key->labelfont(FL_SYMBOL);
    Xcas_i_key->labelfont(FL_SYMBOL);
    Xcas_j_key->labelfont(FL_SYMBOL);
    Xcas_k_key->labelfont(FL_SYMBOL);
    Xcas_l_key->labelfont(FL_SYMBOL);
    Xcas_m_key->labelfont(FL_SYMBOL);
    Xcas_n_key->labelfont(FL_SYMBOL);
    Xcas_o_key->labelfont(FL_SYMBOL);
    Xcas_p_key->labelfont(FL_SYMBOL);
    Xcas_q_key->labelfont(FL_SYMBOL);
    Xcas_r_key->labelfont(FL_SYMBOL);
    Xcas_s_key->labelfont(FL_SYMBOL);
    Xcas_t_key->labelfont(FL_SYMBOL);
    Xcas_u_key->labelfont(FL_SYMBOL);
    Xcas_v_key->labelfont(FL_SYMBOL);
    Xcas_w_key->labelfont(FL_SYMBOL);
    Xcas_x_key->labelfont(FL_SYMBOL);
    Xcas_y_key->labelfont(FL_SYMBOL);
    Xcas_z_key->labelfont(FL_SYMBOL);
  }
  else {
    Xcas_Greek_key->label("a");
    Xcas_a_key->labelfont(FL_HELVETICA);
    Xcas_b_key->labelfont(FL_HELVETICA);
    Xcas_c_key->labelfont(FL_HELVETICA);
    Xcas_d_key->labelfont(FL_HELVETICA);
    Xcas_e_key->labelfont(FL_HELVETICA);
    Xcas_f_key->labelfont(FL_HELVETICA);
    Xcas_g_key->labelfont(FL_HELVETICA);
    Xcas_h_key->labelfont(FL_HELVETICA);
    Xcas_i_key->labelfont(FL_HELVETICA);
    Xcas_j_key->labelfont(FL_HELVETICA);
    Xcas_k_key->labelfont(FL_HELVETICA);
    Xcas_l_key->labelfont(FL_HELVETICA);
    Xcas_m_key->labelfont(FL_HELVETICA);
    Xcas_n_key->labelfont(FL_HELVETICA);
    Xcas_o_key->labelfont(FL_HELVETICA);
    Xcas_p_key->labelfont(FL_HELVETICA);
    Xcas_q_key->labelfont(FL_HELVETICA);
    Xcas_r_key->labelfont(FL_HELVETICA);
    Xcas_s_key->labelfont(FL_HELVETICA);
    Xcas_t_key->labelfont(FL_HELVETICA);
    Xcas_u_key->labelfont(FL_HELVETICA);
    Xcas_v_key->labelfont(FL_HELVETICA);
    Xcas_w_key->labelfont(FL_HELVETICA);
    Xcas_x_key->labelfont(FL_HELVETICA);
    Xcas_y_key->labelfont(FL_HELVETICA);
    Xcas_z_key->labelfont(FL_HELVETICA);
  }
  \#endif
  Xcas_Alpha_Keyboard->redraw();}
            xywh {280 490 25 25} color 1 selection_color 0 labelfont 12
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Alpha_virgule_key {
            label {,}
            xywh {80 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Alpha_point_virgule_key {
            label {;}
            xywh {105 490 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Alpha_quote_key {
            label {'}
            xywh {255 465 25 25} color 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Xcas_Scientific_Keyboard {open
          xywh {0 415 310 100}
        } {
          Fl_Group Lettre_keyboard {
            xywh {0 415 50 50}
          } {
            Fl_Button Xcas_Variable_x {
              label x
              xywh {0 415 25 25} shortcut 0x78 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Variable_y {
              label y
              xywh {25 415 25 25} shortcut 0x79 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Variable_z {
              label z
              xywh {0 440 25 25} shortcut 0x7a labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Variable_t {
              label t
              xywh {25 440 25 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
          }
          Fl_Group Xcas_Delim_keyboard {
            xywh {50 415 140 50}
          } {
            Fl_Button Xcas_Double_quote {
              label {"}
              tooltip {String delimiter} xywh {70 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Parentheses {
              label {(}
              xywh {100 440 25 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Brackets {
              label {{}}
              tooltip {Bloc delimiter (set delimiter in maple compatible mode)} xywh {130 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Crochets {
              label {[]}
              tooltip {List, vector, matrix delimiter} xywh {100 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Quote {
              label {'}
              tooltip Quote xywh {50 415 20 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Virgule {
              label {,}
              xywh {125 440 20 25}
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Semi_button {
              label {;}
              xywh {160 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Sto {
              label {:=}
              tooltip Assign xywh {70 440 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Keyboard_suchthat {
              label {|}
              xywh {50 440 20 25}
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Keyboard_rp {
              label {)}
              xywh {145 440 25 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_RPN_space {
              label { }
              xywh {170 440 20 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
          }
          Fl_Group Cst_keyboard {open
            xywh {190 415 60 50}
          } {
            Fl_Button Xcas_Cst_i {
              label i
              callback {const giac::context * contextptr=Xcas_get_context();
  Xcas_input_0arg(Xcas_Cst_i,giac::printi(contextptr));}
              tooltip {Complex square root of -1} xywh {190 440 30 25} shortcut 0x69 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Cst_pi {
              label {π}
              callback {Xcas_input_0arg(Xcas_Cst_pi,"pi");}
              tooltip {The pi number} xywh {220 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Keyboard_infinity {
              label oo
              callback {Xcas_input_0arg(Xcas_Keyboard_infinity,"+infinity");}
              tooltip {Infinity (unsigned)} xywh {190 415 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Racine_carree {
              label sqrt
              callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"sqrt",true);}
              tooltip {Square root} xywh {220 440 30 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
          }
          Fl_Group Rewrite_keyboard {open
            xywh {0 465 60 50}
          } {
            Fl_Button Xcas_approx_key {
              label {~}
              callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"approx",true);}
              tooltip Evalf xywh {0 465 15 25} shortcut 0x80061 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_simplify_key {
              label simplify
              callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"simplify",true);}
              tooltip {simplify: Simplify expression} xywh {0 490 30 25} shortcut 0xc0073 labelsize 10 align 84
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_factor_key {
              label factor
              callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"factor",true);}
              tooltip {factor: Factorization} xywh {30 465 30 25} shortcut 0x80066 labelsize 10 align 84
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_convert_key {
              label {=>}
              callback {Xcas_input_0arg(Xcas_convert_key," => ");}
              tooltip {Sto/Convert to} xywh {15 465 15 25} shortcut 0x80063 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Menu_Button Xcas_Prg_Menubutton {
              label prg open
              xywh {30 490 30 25} labelsize 10
            } {
              MenuItem Xcas_Prg_si {
                label si
                callback {Fl::e_text=(char *)" si alors sinon fsi; ";Fl::e_length=21; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
              MenuItem Xcas_Prg_pour {
                label pour
                callback {Fl::e_text=(char *)" pour de jusque faire  fpour; ";Fl::e_length=30; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
              MenuItem Xcas_Prg_tantque {
                label tantque
                callback {Fl::e_text=(char *)" tantque faire ftantque; ";Fl::e_length=25; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
              MenuItem Xcas_Prg_repeter {
                label repeter
                callback {Fl::e_text=(char *)" repeter jusqua ; ";Fl::e_length=18; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
              MenuItem Xcas_Prg_fonction {
                label fonction
                callback {Fl::e_text=(char *)"f(x,y):= { local ;  }";
  Fl::e_length=21; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
              MenuItem Xcas_Prg_return {
                label return
                callback {Fl::e_text=(char *)"return ;";
  Fl::e_length=8; xcas::fl_handle(xcas::Xcas_input_focus);}
                xywh {0 0 31 20} labelsize 10
              }
            }
          }
          Fl_Group Xcas_calculus_group {open
            xywh {60 465 40 50}
          } {
            Fl_Button Xcas_diff_key {
              label {∂}
              callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_diff_key,"∂"); else xcas::Xcas_input_arg(Xcas_diff_key,"diff");}
              tooltip diff xywh {60 465 20 25} shortcut 0x80064 labelfont 10 labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_int_key {
              label {∫}
              callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_int_key,"∫"); else xcas::Xcas_input_arg(Xcas_int_key,"integrate");}
              tooltip Integral xywh {80 465 20 25} shortcut 0x80069 labelfont 10 labelsize 12
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_sigma_key {
              label {Σ}
              callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_sigma_key,"Σ"); else xcas::Xcas_input_arg(Xcas_sigma_key,"sum");}
              tooltip Sum xywh {80 490 20 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_limit_key {
              label lim
              callback {xcas::Xcas_input_arg(Xcas_limit_key,"limit");}
              tooltip Limit xywh {60 490 20 25} shortcut 0x8006c labelsize 10
              class {xcas::No_Focus_Button}
            }
          }
          Fl_Group Transcendental {open
            xywh {100 465 150 50}
          } {
            Fl_Group Trig_keyboard {open
              xywh {100 465 150 25}
            } {
              Fl_Button Xcas_Sinus_button {
                label sin
                tooltip Sinus xywh {115 465 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Cosinus_button {
                label cos
                xywh {165 465 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Tangeant_button {
                label tan
                tooltip Tangent xywh {215 465 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Asinus_button {
                label a
                callback {Xcas_input_arg(Xcas_Asinus_button,"asin");}
                tooltip Arcsinus xywh {100 465 15 25} color 29 labelsize 10 labelcolor 4
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Acosinus_button {
                label a
                callback {Xcas_input_arg(Xcas_Acosinus_button,"acos");}
                tooltip Arccosinus xywh {150 465 15 25} color 29 labelsize 10 labelcolor 4
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Atangeant_button {
                label a
                callback {Xcas_input_arg(Xcas_Atangeant_button,"atan");}
                tooltip Arctangent xywh {200 465 15 25} color 29 labelsize 10 labelcolor 4
                class {xcas::No_Focus_Button}
              }
            }
            Fl_Group Exp_keyboard {open
              xywh {100 490 150 25}
            } {
              Fl_Button Xcas_Exp_button {
                label exp
                tooltip Exponential xywh {135 490 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Dix_puissance {
                label {10^}
                xywh {215 490 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Ln10_button {
                label log10
                tooltip {base 10 logarithm} xywh {170 490 45 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
              Fl_Button Xcas_Ln_button {
                label ln
                tooltip {Natural logarithm} xywh {100 490 35 25} labelsize 10 align 64
                class {xcas::No_Focus_Button}
              }
            }
          }
          Fl_Group Operations_keyboard {open
            xywh {250 415 60 100}
          } {
            Fl_Button Xcas_Plus {
              label {+}
              xywh {280 415 30 25} shortcut 0x2b
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Moins {
              label {-}
              tooltip Subtract xywh {290 440 20 25} shortcut 0x2d
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Fois {
              label {*}
              xywh {280 465 30 25} shortcut 0x2a
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Divise {
              label {/}
              xywh {280 490 30 25} shortcut 0x2f
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Puissance {
              label {^}
              xywh {250 465 30 25} shortcut 0x5e labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_C_mod {
              label {%}
              tooltip Modulo xywh {250 490 30 25} labelsize 10
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Inverse_button {
              label inv
              tooltip Inverse xywh {250 415 30 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Neg_button {
              label neg
              tooltip Opposite xywh {270 440 20 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Superieur {
              label {>}
              xywh {250 440 20 25} shortcut 0x2d
              class {xcas::No_Focus_Button}
            }
          }
        }
        Fl_Group Numeric_numbers {
          xywh {310 415 75 100}
        } {
          Fl_Button Xcas_Un {
            label 1
            xywh {310 465 25 25} shortcut 0x31
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Deux {
            label 2
            xywh {335 465 25 25} shortcut 0x32
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Trois {
            label 3
            xywh {360 465 25 25} shortcut 0x33
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Quatre {
            label 4
            xywh {310 440 25 25} shortcut 0x34
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Cinq {
            label 5
            xywh {335 440 25 25} shortcut 0x35
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Six {
            label 6
            xywh {360 440 25 25} shortcut 0x36
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Sept {
            label 7
            xywh {310 415 25 25} shortcut 0x37
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Huit {
            label 8
            xywh {335 415 25 25} shortcut 0x38
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Neuf {
            label 9
            xywh {360 415 25 25} shortcut 0x39
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Zero {
            label 0
            xywh {310 490 25 25} shortcut 0x30
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Point {
            label {.}
            xywh {335 490 25 25}
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_EEX {
            label E
            xywh {360 490 25 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Kbd_control {open
          xywh {385 415 70 100}
        } {
          Fl_Button Xcas_Echap {
            label esc
            callback {;
  static char petit_buffer[]="";
  Fl::e_length=0;
  Fl::e_text=petit_buffer;
  Fl::e_keysym=FL_Escape;
  xcas::fl_handle(xcas::Xcas_input_focus);}
            tooltip {Cancel (erase cmdline, stop interactive_plotode)} xywh {385 415 35 20} shortcut 0xff1b labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Alpha {
            label abc
            callback {if (Xcas_Alpha_Keyboard->visible()){
    Xcas_Alpha_Keyboard->hide();
    Xcas_Scientific_Keyboard->show();
  }
  else {
    Xcas_Alpha_Keyboard->show();
    Xcas_Scientific_Keyboard->hide();
  }}
            tooltip {Show/Hide alphabetic keyboard} xywh {420 475 35 20} shortcut 0xff1b labelsize 10 labelcolor 4 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Cmds {
            label cmds
            callback {Xcas_Keyboard_Switch(4);}
            tooltip {Show commands bandeau} xywh {420 435 35 20} shortcut 0xff1b color 17 labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Msg {
            label msg
            callback {Xcas_Keyboard_Switch(2);}
            tooltip {Show messages} xywh {420 455 35 20} shortcut 0xff1b color 17 labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_b7 {
            label b7
            callback {xcas::alt_ctrl=4+Xcas_Alpha_Keyboard->visible();
    Xcas_Alpha_Keyboard->show();
    Xcas_Scientific_Keyboard->hide();}
            tooltip {Set bit 7 for next key entry} xywh {385 435 35 20} shortcut 0xff1b labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Ctrl {
            label ctrl
            callback {xcas::alt_ctrl=2+Xcas_Alpha_Keyboard->visible();
    Xcas_Alpha_Keyboard->show();
    Xcas_Scientific_Keyboard->hide();}
            tooltip Control xywh {385 455 35 20} shortcut 0xff1b labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_close_keyboard {
            label X
            callback {Xcas_Keyboard_Switch(1);}
            tooltip {Close keyboard} xywh {420 415 35 20} color 17 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_main_del_button {
            label {@<}
            callback {static char petit_buffer[]="";
        petit_buffer[0]=0;
        Fl::e_length=0;
        Fl::e_text=petit_buffer;
        Fl::e_keysym=FL_BackSpace;
        xcas::fl_handle(xcas::Xcas_input_focus);}
            tooltip Backspace xywh {420 495 35 20} shortcut 0x40076 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_main_paste_button {
            label paste
            callback {xcas::cb_Paste(0,0);}
            xywh {385 475 35 20} shortcut 0x40076 labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_main_enter_button {
            label {@returnarrow}
            callback {static char petit_buffer[]="";
        petit_buffer[0]=0;
        Fl::e_length=0;
        Fl::e_text=petit_buffer;
        Fl::e_keysym=FL_Enter;
        xcas::fl_handle(xcas::Xcas_input_focus);}
            xywh {385 495 35 20} shortcut 0x40076 color 167 labelcolor 49 align 64
            class {xcas::No_Focus_Button}
          }
        }
      }
      Fl_Group Xcas_Bandeau_Keys {open
        xywh {0 515 455 30}
      } {
        Fl_Group Xcas_Bandeau_Keys_Group {
          xywh {0 515 420 30}
        } {
          Fl_Button Xcas_PREV_Key {
            label {<<}
            callback {if (rpn_menu_page )
    --rpn_menu_page;
  else
    rpn_menu_page=rpn_menu.size()/6;
  show_rpn_menu(rpn_menu_page);}
            tooltip {Previous menu page} xywh {40 515 25 30} shortcut 0xffc7 color 7 labelcolor 1 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F1_Key {
            callback {rpn_button(Xcas_F1_Key,0);}
            xywh {65 515 45 30} shortcut 0xffbe color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F2_Key {
            callback {rpn_button(Xcas_F2_Key,1);}
            xywh {110 515 45 30} shortcut 0xffbf color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F3_Key {
            callback {rpn_button(Xcas_F3_Key,2);}
            xywh {155 515 45 30} shortcut 0xffc0 color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F4_Key {
            callback {rpn_button(Xcas_F4_Key,3);}
            xywh {200 515 45 30} shortcut 0xffc1 color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F5_Key {
            callback {rpn_button(Xcas_F5_Key,4);}
            xywh {245 515 45 30} shortcut 0xffc2 color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_F6_Key {
            callback {rpn_button(Xcas_F6_Key,5);}
            xywh {290 515 45 30} shortcut 0xffc3 color 8 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_NXT_Key {
            label {>>}
            callback {if ( ((rpn_menu_page+1)*6) < rpn_menu.size() )
     ++rpn_menu_page;
  else
     rpn_menu_page=0;
  show_rpn_menu(rpn_menu_page);}
            tooltip {Next menu page} xywh {335 515 25 30} shortcut 0xffc4 color 7 labelcolor 1 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_CST_Key {
            label cust
            callback {giac::gen e=giac::protecteval(giac::CST__IDNT_e,2,0);
    if (e.type==giac::_VECT){
      rpn_menu=*e._VECTptr;
      show_rpn_menu(0);
    }}
            tooltip {Custom menu} xywh {390 515 30 30} shortcut 0xffc8 color 7 labelcolor 4 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_VAR_Key {
            label var
            callback {const giac::context * contextptr=Xcas_get_context();
  giac::gen e=giac::_VARS(1,contextptr);
      rpn_menu=*e._VECTptr;
      show_rpn_menu(0);}
            tooltip {Show list of variables} xywh {360 515 30 30} shortcut 0xffc5 color 7 labelcolor 4 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Home_button {
            label home
            callback {rpn_menu=home_menu;
  show_rpn_menu(0);}
            tooltip {Home menu} xywh {0 515 40 30} shortcut 0xffc6 color 7 labelcolor 1 align 64
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Button Xcas_close_bandeau {
          label X
          callback {Xcas_Keyboard_Switch(4);}
          xywh {420 515 35 30} color 17 labelsize 10
          class {xcas::No_Focus_Button}
        }
      }
      Fl_Group Xcas_Messages {open
        xywh {0 545 775 45}
      } {
        Fl_Scroll Xcas_Messages_Scroll {open
          xywh {0 545 755 45}
        } {
          Fl_Output Xcas_parse_error_output {
            tooltip Messages xywh {0 545 755 45} type Multiline labelfont 2
            class {xcas::Enlargable_Multiline_Output}
          }
        }
        Fl_Button Xcas_close_messages {
          label X
          callback {Xcas_Messages->hide();
  Xcas_resize_mainwindow();}
          xywh {755 545 20 25} color 17 labelsize 10
          class {xcas::No_Focus_Button}
        }
      }
    }
    Fl_Window Xcas_General_Setup {
      label {Xcas General Setup} open
      xywh {349 164 305 345} type Double hide resizable
    } {
      Fl_Menu_Button Xcas_Level {
        label Level
        tooltip {Choose user level (from tortue to university)} xywh {170 15 130 25} align 64 when 3
      } {
        MenuItem Xcas_CAS_level {
          label CAS
          callback {xcas_user_level=0;
  Xcas_update_mode();
  Xcas_level_output->value("University");}
          xywh {15 15 100 20}
        }
        MenuItem Xcas_Prog_level {
          label {Program CAS}
          callback {xcas_user_level=1;
  Xcas_update_mode();
  Xcas_level_output->value(gettext("CAS"));}
          xywh {25 25 100 20}
        }
        MenuItem Xcas_Tableur_level {
          label Spreadsheet
          callback {xcas_user_level=2;
  Xcas_update_mode();
  Xcas_level_output->value(gettext("Tableur"));}
          xywh {35 35 100 20}
        }
        MenuItem Xcas_Geometry_level {
          label Geometry
          callback {xcas_user_level=3;
  Xcas_update_mode();
  Xcas_level_output->value(gettext("Geometry"));}
          xywh {45 45 100 20}
        }
        MenuItem Xcas_Tortue_level {
          label Turtle
          callback {xcas_user_level=8;
  Xcas_update_mode();
  Xcas_level_output->value("Tortue");}
          xywh {55 55 100 20}
        }
      }
      Fl_Output Xcas_level_output {
        label Size
        xywh {170 40 130 25} labeltype NO_LABEL align 68
      }
      Fl_Check_Button Xcas_automatic_help_browser {
        label {Auto HTML help}
        tooltip {Selecting a menu item displays fulls help in browser} xywh {10 105 160 25} down_box DOWN_BOX align 84
      }
      Fl_Input Xcas_html_browser {
        label browser
        callback {const char * ch =Xcas_html_browser->value();
                   xcas::use_external_browser=false;
                  unsetenv("BROWSER");
                   if (strlen(ch) && strcmp(ch,"builtin")){
                     setenv("BROWSER",ch,1);
                     xcas::use_external_browser=true;
                    }}
        xywh {100 75 195 25} align 68 when 8
      }
      Fl_Value_Input Xcas_default_rows {
        label rows
        callback {xcas::Flv_Table_Gen::def_rows=int(Xcas_default_rows->value());}
        tooltip {Number of rows for new->spreadsheet} xywh {245 175 55 30} align 68 maximum 1000 step 1 value 40
      }
      Fl_Value_Input Xcas_default_cols {
        label cols
        callback {xcas::Flv_Table_Gen::def_cols=int(Xcas_default_cols->value());}
        tooltip {Number of columns for new->spreadsheet} xywh {245 210 55 30} align 68 maximum 100 step 1 value 10
      }
      Fl_Return_Button Xcas_general_setup_save {
        label Save
        callback {Xcas_General_Setup->hide();
  const char * ch =Xcas_html_browser->value();
                   xcas::use_external_browser=false;
                  unsetenv("BROWSER");
                   if (strlen(ch) && strcmp(ch,"builtin")){
                     setenv("BROWSER",ch,1);
                     xcas::use_external_browser=true;
                    }
  Xcas_save_config(Xcas_get_context());}
        tooltip {Close window and save as default configuration} xywh {15 315 125 25} align 64
      }
      Fl_Button Xcas_general_setup_close {
        label Close
        callback {Xcas_General_Setup->hide();}
        xywh {175 315 125 25} shortcut 0xff1b align 64
      }
      Fl_Group Print_config {open
        xywh {5 145 295 165}
      } {
        Fl_Menu_Button Xcas_Page_format {
          label {Print format}
          tooltip {Printer page format} xywh {10 145 165 30} align 64 when 3 textsize 10
        } {
          MenuItem Xcas_Page_A4 {
            label A4
            callback {\#ifdef FL_DEVICE
  xcas::printer_format=Fl_Printer::A4;
  \#endif
  Xcas_Page_Format_Output->value("A4");}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_Page_A5 {
            label A5
            callback {\#ifdef FL_DEVICE
  xcas::printer_format=Fl_Printer::A5;
  \#endif
  Xcas_Page_Format_Output->value("A5");}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_Page_A3 {
            label A3
            callback {\#ifdef FL_DEVICE
  xcas::printer_format=Fl_Printer::A5;
  \#endif
  Xcas_Page_Format_Output->value("A3");}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_Page_LETTER {
            label LETTER
            callback {\#ifdef FL_DEVICE
  xcas::printer_format=Fl_Printer::LETTER;
  \#endif
  Xcas_Page_Format_Output->value("LETTER");}
            xywh {55 55 100 20}
          }
          MenuItem Xcas_Page_ENVELOPE {
            label ENVELOPE
            callback {\#ifdef FL_DEVICE
  xcas::printer_format=Fl_Printer::ENVELOPE;
  \#endif
  Xcas_Page_Format_Output->value("8");}
            xywh {65 65 100 20}
          }
        }
        Fl_Output Xcas_Page_Format_Output {
          label Format
          xywh {10 175 165 30} labeltype NO_LABEL align 68
        }
        Fl_Check_Button Xcas_Printer_landscape {
          label Landscape
          callback {xcas::printer_landscape=Xcas_Printer_landscape->value();}
          tooltip {Landscape or Portrait} xywh {10 210 165 25} down_box DIAMOND_DOWN_BOX color 51 selection_color 1 align 84
        }
        Fl_Input Xcas_ps_preview {
          label {PS view}
          callback {setenv("GIAC_PREVIEW",Xcas_ps_preview->value(),1);}
          tooltip {Postscript previewer program (put no for no preview)} xywh {70 245 105 30} align 68
        }
        Fl_Input Xcas_proxy {
          label Proxy
          callback {setenv("http_proxy",Xcas_proxy->value(),1);}
          tooltip {Proxy server for update, e.g. http://cache.domain:3128} xywh {70 280 230 30} align 68
        }
      }
      Fl_Button Xcas_All_Fonts {
        label Font
        callback {cb_Xcas_change_fontsize(0,0);}
        xywh {15 15 110 25}
      }
      Fl_Check_Button Xcas_automatic_completion_browser {
        label {Auto index help}
        callback {xcas::do_helpon=Xcas_automatic_completion_browser->value();}
        tooltip {Selecting a menu item displays short index help} xywh {180 105 125 25} down_box DOWN_BOX align 84
      }
      Fl_Check_Button Xcas_stepbystep {
        label {Step by step}
        callback {giac::step_infolevel(Xcas_get_context())=Xcas_stepbystep->value();}
        tooltip {If not checked, save context information, incompatible with Xcas < 0.8.1} xywh {180 245 125 25} down_box DOWN_BOX align 84
      }
      Fl_Check_Button Xcas_tooltip_disabled {
        label {Disable tooltips}
        callback {Fl_Tooltip::enable(!Xcas_tooltip_disabled->value());}
        tooltip {Check box to disable tooltips} xywh {180 145 125 25} down_box DOWN_BOX align 84
      }
      Fl_Check_Button Xcas_disable_try_parse_test_i {
        label {Disable test i}
        callback {giac::try_parse_i(0)=giac::try_parse_i(xcas::get_context(xcas::Xcas_input_focus))=!Xcas_disable_try_parse_test_i->value();}
        tooltip {Check to disable replacement of i inside loop by a variable} xywh {15 45 110 20} down_box DOWN_BOX align 84
      }
    }
    Fl_Window Xcas_Script_Window {
      label {Xcas Script Window}
      xywh {483 87 540 345} type Double resizable visible
    } {}
    Fl_Window Xcas_DispG_Window_ {
      label {Xcas DispG Window} open
      xywh {483 123 540 550} type Double resizable
      class {xcas::DispG_Window} visible
    } {
      Fl_Menu_Bar Xcas_DispG_Menu {
        xywh {0 0 95 25} align 64
      } {
        Submenu {} {
          label Print open
          xywh {0 0 100 20}
        } {
          MenuItem {} {
            label preview
            callback {xcas::widget_ps_print(Xcas_DispG_,"DispG",true,3,true,true,true);}
            xywh {0 0 100 20}
          }
          MenuItem {} {
            label print
            callback {xcas::widget_print(Xcas_DispG_);}
            xywh {0 0 100 20}
          }
          MenuItem {} {
            label {latex preview}
            callback {latex_save_DispG("DispG.tex"); xcas::xdvi("DispG.tex")}
            xywh {0 0 100 20}
          }
          MenuItem {} {
            label {latex print}
            callback {latex_save_DispG("DispG.tex"); xcas::dvips("DispG.tex")}
            xywh {0 0 100 20}
          }
          MenuItem {} {
            label close
            callback {Xcas_DispG_Window_->hide();}
            xywh {0 0 100 20}
          }
        }
      }
      Fl_Button Xcas_DispG_Cancel_ {
        label {Click or Cancel}
        callback {Xcas_DispG_->waiting_click=false;Xcas_DispG_->waiting_click_value=giac::undef;}
        tooltip {Click in graph or here to cancel} xywh {220 0 365 25} align 64
      }
      Fl_Tile Xcas_DispG_Tile {open
        xywh {0 25 545 550}
      } {
        Fl_Box Xcas_DispG_ {
          label label
          xywh {0 25 545 320} labeltype NO_LABEL
          class {xcas::Graph2d}
        }
        Fl_Box Xcas_PrintG_ {
          label label
          xywh {0 345 545 205} labeltype NO_LABEL resizable
          class {xcas::Equation}
        }
      }
      Fl_Button Xcas_DispG_ClrGraph {
        label Clear
        callback {Xcas_DispG_->clear(0); Xcas_PrintG_->set_data(giac::gen(giac::makevecteur(giac::string2gen("",false),giac::string2gen("Step by step console",false)),giac::_HIST__VECT));}
        tooltip {Clear DispG graphic} xywh {95 0 125 25} align 64
      }
    }
    code {xcas::Xcas_Main_Window=Xcas_Main_Window_;
  xcas::Xcas_DispG=Xcas_DispG_;
  giac::my_gprintf=xcas::xcas_gprintf;
  Xcas_PrintG_->modifiable=false;
  xcas::Xcas_PrintG=Xcas_PrintG_;
  xcas::Xcas_DispG_Window=Xcas_DispG_Window_;
  xcas::Xcas_DispG_Cancel=Xcas_DispG_Cancel_;
  xcas::Xcas_Cancel=0;
  xcas::Xcas_help_output=Xcas_parse_error_output;
  Xcas_Sinus_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Cosinus_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Tangeant_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Exp_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Ln_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Dix_puissance->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Ln10_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Inverse_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Neg_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_a_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_b_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_c_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_d_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_e_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_f_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_g_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_h_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_i_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_j_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_k_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_l_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_m_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_n_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_o_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_p_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_q_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_r_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_s_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_t_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_u_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_v_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_w_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_x_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_y_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_z_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Inferieur_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Superieur_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Backslash_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Parenthese_ouvrante_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Parenthese_fermante_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Espace_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Point_exclamation_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Crochet_fermant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Crochet_ouvrant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Accolade_ouvrant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Accolade_fermant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Deux_points_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Equal_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Guillemet_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Souligne_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Diese_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Pi_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Alpha_virgule_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Alpha_point_virgule_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Alpha_quote_key->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Double_quote->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Parentheses->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Brackets->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Crochets->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Quote->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Virgule->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Semi_button->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Sto->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_RPN_space->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Keyboard_rp->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Variable_x->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Variable_y->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Variable_z->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Variable_t->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Un->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Deux->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Trois->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Quatre->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Cinq->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Six->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Sept->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Huit->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Neuf->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Zero->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Point->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_EEX->callback((Fl_Callback *)xcas::Xcas_input_char);
  Xcas_Plus->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_Moins->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_Fois->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_Divise->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_Puissance->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_C_mod->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_Keyboard_suchthat->callback((Fl_Callback *)xcas::Xcas_binary_op);
  Xcas_help_solve->callback(cb_Assistant_ItemName);
  Xcas_help_fsolve->callback(cb_Assistant_ItemName);
  Xcas_help_fsolve->callback(cb_Assistant_ItemName);
  Xcas_help_proot->callback(cb_Assistant_ItemName);
  Xcas_help_linsolve->callback(cb_Assistant_ItemName);
  Xcas_help_desolve->callback(cb_Assistant_ItemName);
  Xcas_help_odesolve->callback(cb_Assistant_ItemName);
  Xcas_help_rsolve->callback(cb_Assistant_ItemName);
  Xcas_help_int->callback(cb_Assistant_ItemName);
  Xcas_help_diff->callback(cb_Assistant_ItemName);
  Xcas_help_limit->callback(cb_Assistant_ItemName);
  Xcas_help_ptayl->callback(cb_Assistant_ItemName);
  Xcas_help_series->callback(cb_Assistant_ItemName);
  Xcas_help_sum->callback(cb_Assistant_ItemName);
  Xcas_help_laplace->callback(cb_Assistant_ItemName);
  Xcas_help_ilaplace->callback(cb_Assistant_ItemName);
  Xcas_help_simplify->callback(cb_Insert_ItemName);
  Xcas_help_normal->callback(cb_Insert_ItemName);
  Xcas_help_ratnormal->callback(cb_Insert_ItemName);
  Xcas_help_factor->callback(cb_Insert_ItemName);
  Xcas_help_cfactor->callback(cb_Insert_ItemName);
  Xcas_help_partfrac->callback(cb_Insert_ItemName);
  Xcas_help_cpartfrac->callback(cb_Insert_ItemName);
  Xcas_help_subst->callback(cb_Assistant_ItemName);
  Xcas_help_reorder->callback(cb_Assistant_ItemName);
  Xcas_help_lin->callback(cb_Insert_ItemName);
  Xcas_help_tlin->callback(cb_Insert_ItemName);
  Xcas_help_texpand->callback(cb_Insert_ItemName);
  Xcas_help_exp2trig->callback(cb_Insert_ItemName);
  Xcas_help_trig2exp->callback(cb_Insert_ItemName);
  Xcas_help_exp2pow->callback(cb_Insert_ItemName);
  Xcas_help_lncollect->callback(cb_Insert_ItemName);
  Xcas_help_isprime->callback(cb_Assistant_ItemName);
  Xcas_help_ifactor->callback(cb_Insert_ItemName);
  Xcas_help_iquo->callback(cb_Assistant_ItemName);
  Xcas_help_irem->callback(cb_Assistant_ItemName);
  Xcas_help_iabcuv->callback(cb_Assistant_ItemName);
  Xcas_help_ichinrem->callback(cb_Assistant_ItemName);
  Xcas_help_gcd->callback(cb_Assistant_ItemName);
  Xcas_help_lcm->callback(cb_Assistant_ItemName);
  Xcas_help_powmod->callback(cb_Assistant_ItemName);
  Xcas_help_quo->callback(cb_Assistant_ItemName);
  Xcas_help_rem->callback(cb_Assistant_ItemName);
  Xcas_help_abcuv->callback(cb_Assistant_ItemName);
  Xcas_help_chinrem->callback(cb_Assistant_ItemName);
  Xcas_help_pourcent->callback(cb_Assistant_ItemName);
  Xcas_help_GF->callback(cb_Assistant_ItemName);
  Xcas_help_plotcontour->callback(cb_Assistant_ItemName);
  Xcas_help_plotdensity->callback(cb_Assistant_ItemName);
  Xcas_help_plotode->callback(cb_Assistant_ItemName);
  //Xcas_help_iplotode->callback(cb_Assistant_ItemName);
  Xcas_help_plotlist->callback(cb_Assistant_ItemName);
  Xcas_help_scatterplot->callback(cb_Assistant_ItemName);
  Xcas_help_polygonscatterplot->callback(cb_Assistant_ItemName);
  Xcas_help_linear_regression_plot->callback(cb_Assistant_ItemName);
  Xcas_help_moustache->callback(cb_Assistant_ItemName);
  Xcas_help_histogram->callback(cb_Assistant_ItemName);
  Xcas_help_plotstat->callback(cb_Assistant_ItemName);
  Xcas_help_plotcdf->callback(cb_Assistant_ItemName);
  Xcas_help_baton->callback(cb_Assistant_ItemName);
  Xcas_help_camembert->callback(cb_Assistant_ItemName);
  Xcas_help_debug->callback(cb_Assistant_ItemName);
  Xcas_help_matrix->callback(cb_Assistant_ItemName);
  Xcas_help_tran->callback(cb_Assistant_ItemName);
  Xcas_help_ker->callback(cb_Assistant_ItemName);
  Xcas_help_image->callback(cb_Assistant_ItemName);
  Xcas_help_inverse->callback(cb_Assistant_ItemName);
  Xcas_help_det->callback(cb_Assistant_ItemName);
  Xcas_help_charpoly->callback(cb_Assistant_ItemName);
  Xcas_help_egv->callback(cb_Assistant_ItemName);
  Xcas_help_egvl->callback(cb_Assistant_ItemName);
  Xcas_help_rand->callback(cb_Assistant_ItemName);
  Xcas_help_ranm->callback(cb_Assistant_ItemName);
  Xcas_help_markov->callback(cb_Assistant_ItemName);
  Xcas_help_randmarkov->callback(cb_Assistant_ItemName);
  Xcas_help_cdf->callback(cb_Assistant_ItemName);
  Xcas_help_icdf->callback(cb_Assistant_ItemName);
  Xcas_help_binomial->callback(cb_Assistant_ItemName);
  Xcas_help_comb->callback(cb_Assistant_ItemName);
  Xcas_help_plotproba->callback(cb_Assistant_ItemName);
  Xcas_help_binomial2->callback(cb_Assistant_ItemName);
  Xcas_help_negbinomial->callback(cb_Assistant_ItemName);
  Xcas_help_normald->callback(cb_Assistant_ItemName);
  Xcas_help_normald_icdf2->callback(cb_Assistant_ItemName);
  Xcas_help_normalt->callback(cb_Assistant_ItemName);
  Xcas_help_studentd_icdf2->callback(cb_Assistant_ItemName);
  Xcas_help_studentt->callback(cb_Assistant_ItemName);
  Xcas_help_wilcoxont->callback(cb_Assistant_ItemName);
  Xcas_help_normald2->callback(cb_Assistant_ItemName);
  Xcas_help_poisson->callback(cb_Assistant_ItemName);
  Xcas_help_student->callback(cb_Assistant_ItemName);
  Xcas_help_fisher->callback(cb_Assistant_ItemName);
  Xcas_help_geometric->callback(cb_Assistant_ItemName);
  Xcas_help_exponential->callback(cb_Assistant_ItemName);
  Xcas_help_uniform->callback(cb_Assistant_ItemName);
  Xcas_help_chisquare->callback(cb_Assistant_ItemName);
  Xcas_help_chisquare_icdf->callback(cb_Assistant_ItemName);
  Xcas_help_chisquaret->callback(cb_Assistant_ItemName);
  Xcas_help_kolmogorovd->callback(cb_Assistant_ItemName);
  Xcas_help_kolmogorovt->callback(cb_Assistant_ItemName);
  Xcas_help_cauchy->callback(cb_Assistant_ItemName);
  Xcas_help_weibull->callback(cb_Assistant_ItemName);
  Xcas_help_gammad->callback(cb_Assistant_ItemName);
  Xcas_help_betad->callback(cb_Assistant_ItemName);
  
  Xcas_help_debug->callback(cb_Assistant_ItemName);
  
  \#ifdef IPAQ
  static unsigned char Xcas_racine_carree_bitmap[]={0,0xe0,0x20,0x20,0x10,0x11,0x0a,0x0c}; // {0xc0,0xe0,0xe0,0x60,0x30,0x31,0x1b,0x1e,0x0c};
  Fl_Bitmap * Xcas_Racine_carree_image=new Fl_Bitmap(Xcas_racine_carree_bitmap,8,8);
  Xcas_Racine_carree->image(Xcas_Racine_carree_image);
  \#else
  \#ifndef __APPLE__
  \#ifndef _HAVE_FL_UTF8_HDR_
  Xcas_Keyboard_infinity->label("¥");
  Xcas_Keyboard_infinity->labelfont(FL_SYMBOL);
  \#endif
  \#endif
  \#ifdef _HAVE_FL_UTF8_HDR_
  Xcas_Greek_key->label("α");
  Xcas_Greek_key->labelfont(FL_HELVETICA);
  // Xcas_Neg_button->label("-");
  Xcas_Neg_button->label("-");
  // Xcas_Neg_button->label("−");
  Xcas_Neg_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
  Xcas_Superieur->callback((Fl_Callback* )xcas::Xcas_binary_op);
  \#else
  Xcas_Racine_carree->label("Ö");
  Xcas_Racine_carree->labelfont(FL_SYMBOL);
  Xcas_approx_key->label("»");
  Xcas_approx_key->labelfont(FL_SYMBOL);
  \#endif
  \#endif} {}
    code {// First take control of signals
  signal(SIGINT,giac::ctrl_c_signal_handler);
  giac::child_id=1;
  giac::print_rewrite_prod_inv=true;
  doc_prefix=giac::read_env(giac::context0); // Set giac::language and modes from environment
  xcas::read_aide("aide_cas",giac::language(giac::context0));
  giac::set_language(giac::language(giac::context0),giac::context0);
  // Add spreadsheet menu
  Fl_Menu_Item * tmpitem = xcas::Tableur_menu;
  xcas::copy_menu(Xcas_main_menu,gettext("Spreadsheet")+std::string("/"),tmpitem);
  tmpitem=xcas::Figure_menu;
  xcas::copy_menu(Xcas_main_menu,gettext("Geo")+std::string("/"),tmpitem);
  tmpitem=xcas::Graph2d3d_menu+1;
  xcas::copy_menu(Xcas_main_menu,gettext("Graphic")+std::string("/"),tmpitem);
  tmpitem=xcas::Editeur_menu;
  xcas::copy_menu(Xcas_main_menu,gettext("Prg")+std::string("/"),tmpitem);
  xcas::add_user_menu(Xcas_main_menu,"xcasex",doc_prefix,cb_Insert_Example); // Load User menus
  xcas::add_user_menu(Xcas_main_menu,"xcasmenu",doc_prefix,cb_Insert_ItemName); // Load User menus
  xcas::menu2rpn_callback=cb_Insert_ItemName;
  // Add RPN-like menus, skip the first four items
  Fl_Menu_Item * menu_xcas_tmp= (Fl_Menu_Item *)Xcas_main_menu->menu();
  for (int i=0;i<6;i++){
   if (menu_xcas_tmp->text)
    xcas::nextfl_menu(menu_xcas_tmp);
  }
  home_menu.clear();
  for (;menu_xcas_tmp->text;){
    giac::gen tmp1=giac::string2gen(menu_xcas_tmp->text,false);
    giac::gen tmp2=xcas::fl_menu2rpn_menu(menu_xcas_tmp);
    if (tmp2.type!=giac::_VECT || !tmp2._VECTptr->empty())
      home_menu.push_back(giac::makevecteur(tmp1,tmp2));
    ++menu_xcas_tmp;
  }
  rpn_menu=home_menu;
  int ii=home_menu.size();
  /*
  int n=Xcas_Bandeau_Keys->find(Xcas_RPN1_button),c=Xcas_Bandeau_Keys->children();
  for (int i=0;i<ii && n+i<c;++i){
    giac::gen tmp=home_menu[i];
    if (tmp.type==giac::_VECT && tmp._VECTptr->size()==2 && tmp._VECTptr->back().type==giac::_VECT){
      rpnn_menu[i]=*tmp._VECTptr->back()._VECTptr;
      rpnn_menu_string[i]=giac::gen2string(tmp._VECTptr->front());
      Xcas_Bandeau_Keys->child(n+i)->label(rpnn_menu_string[i].c_str());
    }
  }
  */
  // try for localisation
  if (!getenv("LANG")){
    if (std::string(Xcas_Main_Window_->label())=="Xcas Nouvelle Interface"){
      giac::set_language(1,giac::context0);
      giac::html_help_init("aide_cas",1);
    }
  }
  // add here redefinition of interactive functions
  giac::__click.op=&xcas::Xcas_fltk_input;
  giac::__input.op=&xcas::Xcas_fltk_inputform;
  giac::__inputform.op=&xcas::Xcas_fltk_inputform;
  giac::__interactive.op=&xcas::Xcas_fltk_interactive;
  giac::__widget_size.op=&Xcas_widget_size;
  giac::__getKey.op=&xcas::Xcas_fltk_getKey;
  //__keyboard.op=&fltk_keyboard;
  giac::__current_sheet.op=&xcas::Xcas_fltk_current_sheet;
  giac::__Row.op=&xcas::Xcas_fltk_Row;
  giac::__Col.op=&xcas::Xcas_fltk_Col;
  giac::__xyztrange.op=&xcas::Xcas_xyztrange;
  giac::MAX_PRINTABLE_ZINT=3200;
  //fl_widget_delete_function=&fltk_fl_widget_delete_function;
  //fl_widget_archive_function=&fltk_fl_widget_archive_function;
  //fl_widget_unarchive_function=&fltk_fl_widget_unarchive_function;
  //fl_widget_texprint_function=&fltk_fl_widget_texprint_function;
  //fl_widget_updatepict_function=&fltk_fl_widget_updatepict_function;
  giac::protected_read_config(giac::context0); // read xcas.rc
  xcas::read_recent_filenames(Xcas_main_menu); 
  xcas::Xcas_load_filename=load_filename;
  giac::secure_run=false;
  xcas::interrupt_button=true;
  xcas::Keyboard_Switch=Xcas_Keyboard_Switch;
  int nargs=0;
  int argstart=Fl::args(argc,argv,nargs);
  Xcas_Main_Window_->show(argc,argv);
  Fl_Group::current(Xcas_Script_Window);
  xcas::Editeur * t = new xcas::Editeur(0,0,Xcas_Script_Window->w(),Xcas_Script_Window->h());
  Xcas_Script_Window->add(t);
  Xcas_Script_Window->hide();
  Xcas_update_mode();
  //Xcas_parse_error_output->resize(Xcas_parse_error_output->x(),Xcas_parse_error_output->y(),Xcas_parse_error_output->w(),10*Xcas_parse_error_output->textsize());
  xcas::initialize_function=load_autorecover_data;
  xcas::alt_ctrl_cb=Xcas_alt_ctrl_cb;
  Fl::add_idle(xcas::Xcas_idle_function,0);
  xcas::idle_function=Xcas_update_mode;
  Xcas_Page_Format_Output->value("A4");
  if (getenv("GIAC_PREVIEW")) Xcas_ps_preview->value(getenv("GIAC_PREVIEW"));
  xcas::Xcas_update_mode_ptr=Xcas_update_mode;
  xcas::Xcas_save_config_ptr=Xcas_save_config;
  Fl_Tooltip::delay(0.2); // hoverdelay may be defined too
  // Now load files from commandline
  fl_font(FL_HELVETICA,Xcas_Main_Window_->labelsize());
  a_propos();
  show_rpn_menu(0);
  if (argc>argstart){
    bool link=false;
    if (!strcmp(argv[argstart],"--online")){
      link=true; ++argstart; 
    }
    for (int i=argstart;i<argc;++i){
      load_filename(argv[i],false);
      if (link){
        std::string html5="http://www-fourier.ujf-grenoble.fr/~parisse/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session()); std::cout << html5 << std::endl; giac::system_browser_command(html5);
      }
    }
    if (link){
      return 0;
    }
  }
  else make_history();
    bool running=true;
  \#ifdef WIN32
    static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (win"+giac::print_INT_(8*sizeof(long))+")";
  \#else
  \#ifdef __APPLE__ 
    static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (osx"+giac::print_INT_(8*sizeof(long))+")";
  \#else
    static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (linux"+giac::print_INT_(8*sizeof(long))+")";
  \#endif
  \#endif
    Xcas_Main_Window_->label(windowname.c_str());
    while (running){
      while (Xcas_Main_Window_->visible() || Xcas_Main_Window_->shown() ) {
        Fl::wait();
      }
      running=!Xcas_save_all(Xcas_Main_Tab);
      if (running) Xcas_Main_Window_->show();
    }
    return 0;} {}
  } 
  
  Function {main(int argc,char ** argv)} {open return_type int
  } {
    code {
  if (argc==2 && strlen(argv[1])==0)
    argc=1;
  if (getenv("XCAS_AUTOSAVE_FOLDER")){
    xcas::autosave_folder=getenv("XCAS_AUTOSAVE_FOLDER");
    if (!xcas::autosave_folder.empty() && xcas::autosave_folder[xcas::autosave_folder.size()-1]!='/')
      xcas::autosave_folder += '/';
  }
  \#if defined WIN32 || defined __APPLE__
  static std::string arg0;
  if (!getenv("XCAS_ROOT")){
  \#ifdef __APPLE__
    setenv("XCAS_ROOT","/Applications/usr/bin/",1);
  \#else
    arg0=xcas::unix_path(argv[0]);
    int s=arg0.size(),i;
    for (i=s-1;i>0;--i){
      if (arg0[i]=='/')
        break;
    }
    arg0=arg0.substr(0,i);
    if (i>0)
      setenv("XCAS_ROOT",arg0.c_str(),1);
  \#endif
  }
  \#endif
  \#ifdef HAVE_LIBGSL //
     std::cerr << "GSL error handler off" << std::endl;
      gsl_set_error_handler_off();
  \#endif //
  xcas_argc=argc; xcas_argv=argv;
  \#ifdef HAVE_LIBPTHREAD //
  Fl::lock(); 
  \#ifdef __APPLE__
  //chdir(giac::home_directory().c_str());
  if (xcas::autosave_folder.empty())
  xcas::autosave_folder=giac::home_directory();
  //Fl::unlock();
  \#endif
  \#endif //
  Fl::gl_visual(FL_RGB | FL_DEPTH | FL_ACCUM | FL_ALPHA);
  xcas::fonts_available=Fl::set_fonts(0);
  fl_register_images();
  Xcas_run(argc,argv);
  \#ifdef WITH_GNUPLOT
  giac::kill_gnuplot();
  \#endif
  if (update_xcas){
  \#ifdef WIN32
  // chdir(getenv("XCAS_ROOT"));
  // system("./bash.exe update.sh &");
  fl_message("%s",gettext("Please close this window and run update.bat in the Xcas installation directory"));
  \#else
  \#ifdef __APPLE__
  system("cd ~ && rm -f ~/Desktop/xcas_osx6.dmg.gz && open http://www-fourier.ujf-grenoble.fr/~parisse/giac/xcas_osx6.dmg.gz &");
  \#else
  if (giac::is_file_available("/usr/bin/xcas")){
    if (giac::is_file_available("/usr/bin/apt-get"))
      system("xterm -e 'sudo apt-get update ; sudo apt-get install giac'");
    else
  \#ifdef __x86_64__ 
      system("xterm -e 'rm -f giac64.rpm && wget http://www-fourier.ujf-grenoble.fr/~parisse/giac/giac64.rpm && sudo rpm -e giac && sudo rpm -U gia64c.rpm'");    
  \#else
      system("xterm -e 'rm -f giac32.rpm && wget http://www-fourier.ujf-grenoble.fr/~parisse/giac/giac32.rpm && sudo rpm -e giac && sudo rpm -U giac32.rpm'");    
  \#endif
  }
  else {
    if (giac::is_file_available("/usr/local/bin/xcas")){
      system("cd /tmp && wget http://www-fourier.ujf-grenoble.fr/~parisse/giac/xcas.tgz && cd /usr/local && xterm -e 'sudo tar xvfz tmp/xcas.tgz' &");
    }
    else
      fl_alert("%s","Update implemented only for debian/rpm packages");
  }
  \#endif // __APPLE__
  \#endif // __WIN32__
  }} {}
  }